|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.moyoman.util.closestpoint.ClosestPointGroup
This class represents a group of stones, and the points which are closer to one of those stones than to any other stones.
Field Summary | |
private int |
maxx
The maximum horizontal value of any point or stone. |
private int |
maxy
The maximum vertical value of any point or stone. |
private int |
minx
The minimum horizontal value of any point or stone. |
private int |
miny
The minimum vertical value of any point or stone. |
private HashSet |
points
The points which are as close to this group as any other. |
private ArrayList |
stones
The stones which make up this group. |
Constructor Summary | |
protected |
ClosestPointGroup(Stone st)
Create a new ClosestPointGroup object. |
Method Summary | |
protected void |
addEmptyPoint(Point pt)
Add an empty point to the list. |
protected void |
addStone(Stone st)
Add a stone to the group. |
Object |
clone()
Override the Object.clone() method. |
protected void |
combineGroups(ClosestPointGroup cpg)
Add all of the stones and empty points from the specified group to this one. |
boolean |
containsPoint(Point pt)
Determine whether the group contains the empty point. |
boolean |
containsStone(Stone st)
Determine if the stone is in the group. |
Stone |
getAnyStone()
Get any stone in the group. |
Color |
getColor()
|
protected int |
getMaxX()
Get the maximum horizontal value for an empty point or stone in this group. |
protected int |
getMaxY()
Get the maximum vertical value for an empty point or stone in this group. |
protected int |
getMinX()
Get the minimum horizontal value for an empty point or stone in this group. |
protected int |
getMinY()
Get the minimum vertical value for an empty point or stone in this group. |
Point[] |
getPoints()
Get all the points which are closest to one of the stones of this group. |
Point[] |
getPointsAndStones()
Get all of the stones and empty points in this group. |
Stone[] |
getStones()
Get all of the stones contained by this polygon. |
protected short |
getTotalPoints()
Get the number of empty points in this group. |
protected short |
getTotalStones()
Get the total number of stones in this group. |
private void |
initializeBoundsVariables()
Set the variables which describe the bounding box for this group. |
boolean |
isInBoundingBox(Point pt)
Determine if the point is inside of the bounding box for this group. |
protected void |
removeEmptyPoint(Point pt)
Remove an empty point from this group. |
protected void |
removePoints(Point[] pts)
Remove multiple empty points from this group. |
protected void |
removeStones(Stone[] st)
Remove some stones from this group. |
private void |
setBoundsVariables(Point pt)
Update the bounds variables for this group. |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private HashSet points
private ArrayList stones
private int minx
private int maxx
private int miny
private int maxy
Constructor Detail |
protected ClosestPointGroup(Stone st)
st
- The stone which this new group contains.Method Detail |
protected void addStone(Stone st)
st
- The stone to be added to this group.protected void combineGroups(ClosestPointGroup cpg)
cpg
- The group which is to be combined with this one.protected void addEmptyPoint(Point pt)
pt
- The empty point to be added.private void initializeBoundsVariables()
private void setBoundsVariables(Point pt)
pt
- The point which has been added to the group.protected int getMinX()
protected int getMaxX()
protected int getMinY()
protected int getMaxY()
protected void removeEmptyPoint(Point pt)
pt
- The empty point to be removed.protected void removePoints(Point[] pts)
pts
- The empty points to be removed.protected void removeStones(Stone[] st)
protected short getTotalStones()
protected short getTotalPoints()
public Point[] getPoints()
ClosestPoints.getUniquePoints()
public Point[] getPointsAndStones()
public boolean containsPoint(Point pt)
pt
- The point in question.
public boolean isInBoundingBox(Point pt)
pt
- The point in question.
public boolean containsStone(Stone st)
st
- The stone in question.
public Stone[] getStones()
public Stone getAnyStone()
public Color getColor()
public Object clone()
clone
in class Object
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |