|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.moyoman.util.closestpoint.PointInfo
Each object of this class represents a single point, and the groups closest to it.
Field Summary | |
private HashSet |
closestPointGroups
Each element is a ClosestPointGroup which is as close to the point as any other group(s). |
private short |
distance
The square of the distance to the closest group(s). |
private Point |
point
The point being represented. |
Constructor Summary | |
protected |
PointInfo(Point pt)
Create a new PointInfo object. |
Method Summary | |
protected void |
addGroup(ClosestPointGroup cpg)
Add a group to the list of closest groups. |
Object |
clone()
Override the Object.clone() method. |
private short |
computeDistance(Point pt)
Compute the distance between this point and the parameter point. |
protected boolean |
contains(ClosestPointGroup cpg)
Determine if the group is already in the closest groups list. |
boolean |
equals(Object o)
Compare this object with another one. |
short |
getDistance()
Return the square of the distance to the closest group(s). |
protected int |
getGroupNumber()
Get the number of groups which are on the closest groups list. |
ClosestPointGroup[] |
getGroups()
Get all of the groups which are the closest to this point. |
protected Point |
getPoint()
Get the point that this object represents. |
int |
hashCode()
Get a hash code for this object. |
protected short |
proximity(Point pt)
Compare the distance of the point with that of the closest groups. |
protected void |
removeAllGroups()
Remove all groups from the closest groups list. |
protected void |
removeGroup(ClosestPointGroup cpg)
Remove a group from the closest groups list. |
protected void |
replaceGroup(ClosestPointGroup oldcpg,
ClosestPointGroup newcpg)
Replace one group with another. |
protected void |
setDistance(Point pt)
Set the distance between this point and the parameter point. |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private Point point
private short distance
private HashSet closestPointGroups
Constructor Detail |
protected PointInfo(Point pt)
pt
- The point which is represented.Method Detail |
protected void setDistance(Point pt)
pt
- The point to which the distance is being set.public short getDistance()
private short computeDistance(Point pt)
pt
- The point to which the distance is being compared.
protected void addGroup(ClosestPointGroup cpg)
cpg
- A group which to be added to the list.protected void removeGroup(ClosestPointGroup cpg)
cpg
- The group to be removed from the list.protected void replaceGroup(ClosestPointGroup oldcpg, ClosestPointGroup newcpg)
oldcpg
- The old groupnewcpg
- The new group.protected boolean contains(ClosestPointGroup cpg)
cpg
- The group in question.
protected void removeAllGroups()
public ClosestPointGroup[] getGroups()
protected int getGroupNumber()
protected short proximity(Point pt)
pt
- The point which is being compared.
protected Point getPoint()
public boolean equals(Object o)
equals
in class Object
o
- The object being compared with this one.
public int hashCode()
hashCode
in class Object
public Object clone()
clone
in class Object
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |