org.jscience.architecture.traffic.infrastructure
Class Turn

java.lang.Object
  extended by org.jscience.architecture.traffic.infrastructure.Turn
All Implemented Interfaces:
XMLSerializable

public class Turn
extends java.lang.Object
implements XMLSerializable

Basic turn. A turn may later be sophisticated with bends in the road.


Field Summary
protected  double angle
          The angle of this turn
static int CONTROLPOINT
          DOCUMENT ME!
protected  java.lang.String parentName
          DOCUMENT ME!
protected  java.awt.Point point
          The coordinates of this turn
protected  double position
          The position (index) of this turn on the road
static int TURNPOINT
          DOCUMENT ME!
protected  int type
          DOCUMENT ME!
 
Constructor Summary
Turn()
          Creates a new Turn object.
Turn(java.awt.Point p, double a)
          Creates a new Turn object.
Turn(java.awt.Point p, double a, int t)
          Creates a new Turn object.
Turn(java.awt.Point p, int t)
          Creates a new Turn object.
 
Method Summary
 double getAngle()
          Returns the angle of this turn
 java.awt.Point getCoord()
          Returns the coordinates of this turn
 double getPosition()
          Returns the position of this turn on the road
 int getType()
          Returns the type of this turn
 java.lang.String getXMLName()
          DOCUMENT ME!
 void load(XMLElement myElement, XMLLoader loader)
          DOCUMENT ME!
 void saveChilds(XMLSaver saver)
          DOCUMENT ME!
 XMLElement saveSelf()
          DOCUMENT ME!
 void setAngle(double a)
          Sets the angle of this turn
 void setCoord(java.awt.Point p)
          Sets the coordinates of this turn
 void setParentName(java.lang.String parentName)
          DOCUMENT ME!
 void setPosition(double p)
          Sets the position of this turn on the road
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TURNPOINT

public static final int TURNPOINT
DOCUMENT ME!

See Also:
Constant Field Values

CONTROLPOINT

public static final int CONTROLPOINT
DOCUMENT ME!

See Also:
Constant Field Values

point

protected java.awt.Point point
The coordinates of this turn


angle

protected double angle
The angle of this turn


parentName

protected java.lang.String parentName
DOCUMENT ME!


type

protected int type
DOCUMENT ME!


position

protected double position
The position (index) of this turn on the road

Constructor Detail

Turn

public Turn(java.awt.Point p,
            double a)
Creates a new Turn object.

Parameters:
p - DOCUMENT ME!
a - DOCUMENT ME!

Turn

public Turn(java.awt.Point p,
            double a,
            int t)
Creates a new Turn object.

Parameters:
p - DOCUMENT ME!
a - DOCUMENT ME!
t - DOCUMENT ME!

Turn

public Turn(java.awt.Point p,
            int t)
Creates a new Turn object.

Parameters:
p - DOCUMENT ME!
t - DOCUMENT ME!

Turn

public Turn()
Creates a new Turn object.

Method Detail

getCoord

public java.awt.Point getCoord()
Returns the coordinates of this turn

Returns:
DOCUMENT ME!

setCoord

public void setCoord(java.awt.Point p)
Sets the coordinates of this turn

Parameters:
p - DOCUMENT ME!

getAngle

public double getAngle()
Returns the angle of this turn

Returns:
DOCUMENT ME!

setAngle

public void setAngle(double a)
Sets the angle of this turn

Parameters:
a - DOCUMENT ME!

getType

public int getType()
Returns the type of this turn

Returns:
DOCUMENT ME!

getPosition

public double getPosition()
Returns the position of this turn on the road

Returns:
DOCUMENT ME!

setPosition

public void setPosition(double p)
Sets the position of this turn on the road

Parameters:
p - DOCUMENT ME!

load

public void load(XMLElement myElement,
                 XMLLoader loader)
          throws XMLTreeException,
                 java.io.IOException,
                 XMLInvalidInputException
DOCUMENT ME!

Specified by:
load in interface XMLSerializable
Parameters:
myElement - DOCUMENT ME!
loader - DOCUMENT ME!
Throws:
XMLTreeException - DOCUMENT ME!
java.io.IOException - DOCUMENT ME!
XMLInvalidInputException - DOCUMENT ME!

saveSelf

public XMLElement saveSelf()
                    throws XMLCannotSaveException
DOCUMENT ME!

Specified by:
saveSelf in interface XMLSerializable
Returns:
DOCUMENT ME!
Throws:
XMLCannotSaveException - DOCUMENT ME!

saveChilds

public void saveChilds(XMLSaver saver)
                throws XMLTreeException,
                       java.io.IOException,
                       XMLCannotSaveException
DOCUMENT ME!

Specified by:
saveChilds in interface XMLSerializable
Parameters:
saver - DOCUMENT ME!
Throws:
XMLTreeException - DOCUMENT ME!
java.io.IOException - DOCUMENT ME!
XMLCannotSaveException - DOCUMENT ME!

getXMLName

public java.lang.String getXMLName()
DOCUMENT ME!

Specified by:
getXMLName in interface XMLSerializable
Returns:
DOCUMENT ME!

setParentName

public void setParentName(java.lang.String parentName)
DOCUMENT ME!

Specified by:
setParentName in interface XMLSerializable
Parameters:
parentName - DOCUMENT ME!