de.adom.jade.world
Class Connection

java.lang.Object
  extended by de.adom.jade.kernel.GUIDCarrier
      extended by de.adom.jade.world.Connection
All Implemented Interfaces:
java.io.Serializable

public class Connection
extends GUIDCarrier
implements java.io.Serializable

Stores a connection between two maps on two different locations. Two connections always share an otherwise unique ID to be able to easily find the missing end-point for a connection on another map. This is necessary to be able to defer map building to the latest possible point in time.

See Also:
Serialized Form

Constructor Summary
Connection(long connectionID, int sourceX, int sourceY, Location sourceLocation, int targetX, int targetY, Location targetLocation)
          Builds a new connection.
 
Method Summary
 long getConnectionID()
          Returns the connection identifier shared by both ends of a connection (in both locations).
 int getFromX()
           
 int getFromY()
           
 Location getSource()
           
 Location getTarget()
           
 int getToX()
           
 int getToY()
           
 void setFromX(int x)
           
 void setFromY(int y)
           
 void setSource(Location location)
           
 void setTarget(Location location)
           
 void setToX(int x)
           
 void setToY(int y)
           
 java.lang.String toString()
          Returns a string representation for this connection.
 
Methods inherited from class de.adom.jade.kernel.GUIDCarrier
getGUID
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Connection

public Connection(long connectionID,
                  int sourceX,
                  int sourceY,
                  Location sourceLocation,
                  int targetX,
                  int targetY,
                  Location targetLocation)
Builds a new connection.

Parameters:
connectionID - the identifier that uniquely identifies both ends of a connection
sourceX - the x coordinate of the source map
sourceY - the y coordinate of the source map
sourceLocation - the source location
targetX - the x coordinate of the target map
targetY - the y coordinate of the target ma
targetLocation - the target location
Method Detail

setFromX

public void setFromX(int x)

getFromX

public int getFromX()

setFromY

public void setFromY(int y)

getFromY

public int getFromY()

setToX

public void setToX(int x)

getToX

public int getToX()

setToY

public void setToY(int y)

getToY

public int getToY()

setSource

public void setSource(Location location)

getSource

public Location getSource()

setTarget

public void setTarget(Location location)

getTarget

public Location getTarget()

getConnectionID

public long getConnectionID()
Returns the connection identifier shared by both ends of a connection (in both locations).

Returns:
the connection identifier

toString

public java.lang.String toString()
Returns a string representation for this connection.

Overrides:
toString in class java.lang.Object
Returns:
the string representation of this connection