org.caida.otter
Class LineSegment

java.lang.Object
  |
  +--org.caida.otter.LineSegment

public class LineSegment
extends java.lang.Object


Constructor Summary
LineSegment(float x1, float y1, float x2, float y2)
          Create a line segment from these coordinates
LineSegment(int x1, int y1, int x2, int y2)
          Create a line segment from these coordinates
 
Method Summary
 boolean doesLineIntersect(LineSegment otherLine)
          Test of the current line segment intersects with the argument.
 float getX1()
          return x1
 float getX2()
          return x2
 float getY1()
          return y1
 float getY2()
          return y2
 java.lang.String toString()
          Override default toString to print Coordinates of line segment to the screen
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LineSegment

public LineSegment(int x1,
                   int y1,
                   int x2,
                   int y2)
Create a line segment from these coordinates

LineSegment

public LineSegment(float x1,
                   float y1,
                   float x2,
                   float y2)
Create a line segment from these coordinates
Method Detail

toString

public java.lang.String toString()
Override default toString to print Coordinates of line segment to the screen
Overrides:
toString in class java.lang.Object

doesLineIntersect

public boolean doesLineIntersect(LineSegment otherLine)
Test of the current line segment intersects with the argument. Returns a the boolean result of the intersection test.
Returns:
result of intersection test -> true = overlap, false = no overlap.

getX1

public float getX1()
return x1

getY1

public float getY1()
return y1

getX2

public float getX2()
return x2

getY2

public float getY2()
return y2