de.upb.swtpra05.group03.shuttle
Class Connection

java.lang.Object
  extended byde.upb.swtpra05.group03.shuttle.Connection

public class Connection
extends java.lang.Object

helper to represent a connection between two stations

Version:
$Revision: 1.3 $

Field Summary
private  java.util.LinkedList connectionsOnWayToNextStation
          contains the IDs of the tracks and switches between start- and destinationStation
private  int costs
          the costs of the connection
private  int destinationStationId
          the id of the destination station of the connection
private  java.lang.String destinationStationName
          the name of the destination station
private  int numberOfTracks
          the no of tracks of the connection
private  int startStationId
          the id of the start station of the connection
private  int time
          the time a shuttle will need using the connection
 
Constructor Summary
(package private) Connection(int sId)
          Constructor of a connection
 
Method Summary
protected  void addConnection(int Id)
          Adds a new track to the connction
protected  Connection cloneConnection()
          Clone the connection and all internal values
protected  int getCosts()
          Gets the costs attribute of the Connection object
protected  int getDestinationStationId()
          Gets the destinationStationId attribute of the Connection object
protected  java.lang.String getDestinationStationName()
          Gets the destinationStationName attribute of the Connection object
protected  int getLastConnectionId()
          Gets the lastConnectionId attribute of the Connection object
protected  int getNumberOfTracks()
          Gets the numberOfTracks attribute of the Connection object
protected  int getStartStationId()
          Gets the start station id of the connection.
protected  int getTime()
          Gets the time attribute of the Connection object
protected  void increaseCostsAndTime(int c, int t)
          Increases the costs and time values of the connection.
protected  void increaseNumberOfTracks()
          Increases the numberOfTracks attribute of the Connection object
protected  void setCosts(int costs)
          Sets the costs attribute of the Connection object
protected  void setDestinationStationId(int Id)
          Sets the destinationStationId attribute of the Connection object
protected  void setDestinationStationName(java.lang.String name)
          Sets the destinationStationName attribute of the Connection object
protected  void setNumberOfTracks(int numberOfTracks)
          Sets the numberOfTracks attribute of the Connection object
protected  void setTime(int time)
          Sets the time attribute of the Connection object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

connectionsOnWayToNextStation

private java.util.LinkedList connectionsOnWayToNextStation
contains the IDs of the tracks and switches between start- and destinationStation


startStationId

private int startStationId
the id of the start station of the connection


destinationStationId

private int destinationStationId
the id of the destination station of the connection


costs

private int costs
the costs of the connection


time

private int time
the time a shuttle will need using the connection


numberOfTracks

private int numberOfTracks
the no of tracks of the connection


destinationStationName

private java.lang.String destinationStationName
the name of the destination station

Constructor Detail

Connection

Connection(int sId)
Constructor of a connection

Parameters:
sId - the id of the start station
Method Detail

getStartStationId

protected int getStartStationId()
Gets the start station id of the connection.

Returns:
The start station id value

increaseCostsAndTime

protected void increaseCostsAndTime(int c,
                                    int t)
Increases the costs and time values of the connection.

Parameters:
c - The amount the costs value should be increased by.
t - The amount the time value should be increased by.

increaseNumberOfTracks

protected void increaseNumberOfTracks()
Increases the numberOfTracks attribute of the Connection object


getNumberOfTracks

protected int getNumberOfTracks()
Gets the numberOfTracks attribute of the Connection object

Returns:
The numberOfTracks value

setNumberOfTracks

protected void setNumberOfTracks(int numberOfTracks)
Sets the numberOfTracks attribute of the Connection object

Parameters:
numberOfTracks - The new numberOfTracks value

getCosts

protected int getCosts()
Gets the costs attribute of the Connection object

Returns:
The costs value

setCosts

protected void setCosts(int costs)
Sets the costs attribute of the Connection object

Parameters:
costs - The new costs value

getTime

protected int getTime()
Gets the time attribute of the Connection object

Returns:
The time value

setTime

protected void setTime(int time)
Sets the time attribute of the Connection object

Parameters:
time - The new time value

setDestinationStationId

protected void setDestinationStationId(int Id)
Sets the destinationStationId attribute of the Connection object

Parameters:
Id - The new destinationStationId value

getDestinationStationId

protected int getDestinationStationId()
Gets the destinationStationId attribute of the Connection object

Returns:
The destinationStationId value

setDestinationStationName

protected void setDestinationStationName(java.lang.String name)
Sets the destinationStationName attribute of the Connection object

Parameters:
name - The new destinationStationName value

getDestinationStationName

protected java.lang.String getDestinationStationName()
Gets the destinationStationName attribute of the Connection object

Returns:
The destinationStationName value

addConnection

protected void addConnection(int Id)
Adds a new track to the connction

Parameters:
Id - The track id value

getLastConnectionId

protected int getLastConnectionId()
Gets the lastConnectionId attribute of the Connection object

Returns:
The lastConnectionId value

cloneConnection

protected Connection cloneConnection()
Clone the connection and all internal values

Returns:
The cloned connection