laser.mpi.util.shuffle
Class Mapping

java.lang.Object
  |
  +--laser.mpi.util.shuffle.Mapping

public class Mapping
extends java.lang.Object

A Mapping is a pair (source, target) of two Coordinates, representing the starting and destination coordinates for a move.


Field Summary
(package private)  Coordinate source
          The coordinate for the source.
(package private)  Coordinate target
          The coordinate for the target.
 
Constructor Summary
Mapping(Coordinate source, Coordinate target)
          Constructs a new instance of Mapping with the given source and target coordinates.
 
Method Summary
 Coordinate source()
          Returns the source coordinate.
 Coordinate target()
          Returns the target coordinate.
 java.lang.String toString()
          Returns a string representation of this Mapping.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

source

Coordinate source
The coordinate for the source.


target

Coordinate target
The coordinate for the target.

Constructor Detail

Mapping

public Mapping(Coordinate source,
               Coordinate target)
Constructs a new instance of Mapping with the given source and target coordinates.

Parameters:
source - the source coordinate
target - the target coordinate
Throws:
java.lang.IllegalArgumentException - if source or target is null
Method Detail

toString

public java.lang.String toString()
Returns a string representation of this Mapping. It has the form [source, target].

Overrides:
toString in class java.lang.Object
Returns:
a String representation of this Mapping

source

public Coordinate source()
Returns the source coordinate.

Returns:
source

target

public Coordinate target()
Returns the target coordinate.

Returns:
target