jfreerails.world.common
Class IntLine

java.lang.Object
  extended by jfreerails.world.common.IntLine
All Implemented Interfaces:
java.io.Serializable

public class IntLine
extends java.lang.Object
implements java.io.Serializable

This class defines a straight line between two points. Units are arbitrary.

Author:
Luke
See Also:
Serialized Form

Field Summary
private static long serialVersionUID
           
 int x1
           
 int x2
           
 int y1
           
 int y2
           
 
Constructor Summary
IntLine()
          Default constructor - defines a dot at 0,0.
IntLine(int xx1, int yy1, int xx2, int yy2)
           
 
Method Summary
 boolean equals(java.lang.Object o)
           
 double getLength()
           
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

x1

public int x1

x2

public int x2

y1

public int y1

y2

public int y2
Constructor Detail

IntLine

public IntLine(int xx1,
               int yy1,
               int xx2,
               int yy2)
Parameters:
xx1 - x of the first point
yy1 - y of the first point
xx2 - x of the second point
yy2 - y of the second point

IntLine

public IntLine()
Default constructor - defines a dot at 0,0.

Method Detail

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

getLength

public double getLength()
Returns:
the length of the line

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object