de.adom.jade.world
Class Connection
java.lang.Object
de.adom.jade.kernel.GUIDCarrier
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. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
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 connectionsourceX - the x coordinate of the source mapsourceY - the y coordinate of the source mapsourceLocation - the source locationtargetX - the x coordinate of the target maptargetY - the y coordinate of the target matargetLocation - the target location
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