|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.umd.cfar.lamp.viper.geometry.Component edu.umd.cfar.lamp.viper.geometry.Pnt
Represents a 2d point in Rational format.
Field Summary |
Fields inherited from class edu.umd.cfar.lamp.viper.geometry.Component |
t, x, y |
Fields inherited from interface edu.umd.cfar.lamp.viper.geometry.Moveable |
EAST, NORTH, NORTHEAST, NORTHWEST, SOUTH, SOUTHEAST, SOUTHWEST, WEST |
Constructor Summary | |
Pnt()
Constructs a new Pnt set to the origin. |
|
Pnt(Component C)
Constructs a new Pnt with the given coordinates. |
|
Pnt(int X,
int Y)
Constructs a new Pnt at the given location. |
|
Pnt(Rational X,
Rational Y)
Constructs a new Pnt at the given location. |
Method Summary | |
boolean |
equals(java.lang.Object o)
Tests the equality of this with another Component. |
Pnt |
getCentroid()
Gets a copy of the centroid. |
Rational |
getX()
Gets the x-coordinate of the point. |
Rational |
getY()
Gets the y-coordinate of the point. |
int |
hashCode()
Generates a hash code for this object. |
boolean |
isLeftOf(Pnt a,
Pnt b)
Tests to see if this point is to the left of the oriented line segment ab. |
boolean |
isLeftOfOrOn(Pnt a,
Pnt b)
Tests to see if this point is to the left of or on the oriented line segment ab. |
Moveable |
move(int direction,
int distance)
Moves the box in the given direction. |
java.awt.geom.Point2D.Double |
point2DDoubleValue()
Gets the Point2D representation of this point. |
java.awt.Point |
pointValue()
Gets the Point representation of this point. |
Moveable |
shift(int x,
int y)
Shifts the moveable by the given amount. |
static Pnt |
valueOf(java.lang.String S)
Creates a new point from the given number pair. |
Methods inherited from class edu.umd.cfar.lamp.viper.geometry.Component |
dot, length, minus, plus, set, toString |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Pnt()
public Pnt(int X, int Y)
X
- The x coordinate of the point.Y
- The y coordinate of the point.public Pnt(Rational X, Rational Y)
X
- The x coordinate of the point.Y
- The y coordinate of the point.public Pnt(Component C)
C
- A Component to take the x and y coordinates from for a point.Method Detail |
public static Pnt valueOf(java.lang.String S)
12 13
S
- the pair of numbers
BadAttributeDataException
- if the string isn't formed properlypublic boolean equals(java.lang.Object o)
equals
in class Component
o
- The object to test against this Component.
true
if these are equal.public int hashCode()
hashCode
in class Component
public java.awt.geom.Point2D.Double point2DDoubleValue()
public java.awt.Point pointValue()
public Rational getX()
public Rational getY()
public Moveable move(int direction, int distance)
move
in interface Moveable
direction
- the direction to move, one of Movable.NORTH, etc.distance
- the distance to move
Moveable
public Moveable shift(int x, int y)
Moveable
shift
in interface Moveable
x
- y
-
Moveable.shift(int, int)
public Pnt getCentroid()
HasCentroid
getCentroid
in interface HasCentroid
HasCentroid.getCentroid()
public boolean isLeftOf(Pnt a, Pnt b)
a
- startb
- look from a to this point to see where left is
public boolean isLeftOfOrOn(Pnt a, Pnt b)
a
- startb
- look from a to this point to see where left is
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |