|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjabble.Point
public abstract class Point
Represent a point on a Grid. A point on a grid is determined by either a point identifier (a unique number given to each point on a grid) or the position within the grid (specified by the location along each direction).
Points can be retrieved from a Grid in different ways: iterators, Grid.pointAt, etc...
| Constructor Summary | |
|---|---|
Point()
|
|
| Method Summary | |
|---|---|
abstract boolean |
equals(java.lang.Object obj)
A Point is only equal to another Point if they are both on the same Grid and are at the same coordinates. |
abstract Grid |
getGrid()
Returns the Grid on which the Point is defined. |
abstract int |
getLocation(int dirIndex)
Returns the location of the Point along the direction correspondent to the index. |
abstract boolean |
isBlack()
True if the Point would be a "black square" on a chess board. |
abstract boolean |
isInBlackHole()
|
abstract boolean |
isOnBoundary()
True if the Point is on an edge or a face of the Grid. |
abstract boolean |
isOnInnerBoundary()
|
abstract boolean |
isOnLowerOuterBoundary(int dirIndex)
True if the Point is on the left edge or a face of the Grid along the given direction. |
abstract boolean |
isOnOuterBoundary()
|
abstract boolean |
isOnOuterBoundary(int dirIndex)
True if the Point is on an edge or a face of the Grid along the given direction. |
abstract boolean |
isOnUpperOuterBoundary(int dirIndex)
True if the Point is on the right edge or a face of the Grid along the given direction. |
abstract Point |
neighborAt(int dirIndex,
int distance)
Returns a point walking along a direction at a certain distance. |
abstract Point |
nextPoint(int dirIndex)
Returns the next point along the given direction, or null if it doesn't exist. |
abstract Point |
previousPoint(int dirIndex)
Returns the previous point along the given direction, or null if it doesn't exist. |
abstract void |
setInBlackHole(boolean inBlackHole)
|
java.lang.String |
toString()
Displays the coordinates of the Point |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Point()
| Method Detail |
|---|
public abstract Grid getGrid()
public abstract void setInBlackHole(boolean inBlackHole)
public abstract boolean isInBlackHole()
public abstract boolean isOnBoundary()
public abstract boolean isOnInnerBoundary()
public abstract boolean isOnOuterBoundary()
public abstract boolean isOnOuterBoundary(int dirIndex)
dirIndex - the direction along which to test
public abstract boolean isOnLowerOuterBoundary(int dirIndex)
dirIndex - the direction along which to test
public abstract boolean isOnUpperOuterBoundary(int dirIndex)
dirIndex - the direction along which to test
public abstract boolean isBlack()
public abstract int getLocation(int dirIndex)
dirIndex - The index of the direction as defined by the order given in the Grid constructor.
public abstract Point nextPoint(int dirIndex)
dirIndex - The direction along which to look for the next point (0 for the first, 1 for the second, ...)
public abstract Point previousPoint(int dirIndex)
dirIndex - The direction along which to look for the previous point (0 for the first, 1 for the second, ...)
public abstract Point neighborAt(int dirIndex,
int distance)
dirIndex - the direction along which to look for the pointdistance - the number of steps to move along the direction; negative
number will move in the opposite direction
public abstract boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobj - The object on which to do the comparison
public java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||