rle.core.board
Class Locator

java.lang.Object
  extended by rle.core.board.Locator

public class Locator
extends java.lang.Object

Immutable object for locating stuff in the Board.


Field Summary
 int height
           
 int width
           
 int x
           
 int y
           
 
Constructor Summary
Locator(Board board, RLPoint loc)
           
Locator(Board board, RLPoint loc, RLDimension dim)
           
Locator(Board board, RLRectangle bounds)
           
Locator(Board board, RLRectangle bounds, java.util.HashMap<java.lang.String,java.lang.Object> attributes)
           
 
Method Summary
 java.util.Map<java.lang.String,java.lang.Object> attributes()
          Return any attributes associated.
 Board board()
          Returns the board that this Locator points to.
 RLRectangle bounds()
          Returns the bounding rectangle for this Locator.
 boolean isRectangular()
          Return whether this Locator represents a filled rectangle, i.e.
 RLPoint point()
          Returns the upper left corner of the bounding rectangle.
 java.util.Set<RLPoint> points()
          Return the set of RLPoints that are part of this Locator.
 RLDimension size()
          Returns the dimensions of the bounding rectangle.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

x

public final int x

y

public final int y

width

public final int width

height

public final int height
Constructor Detail

Locator

public Locator(Board board,
               RLPoint loc)

Locator

public Locator(Board board,
               RLPoint loc,
               RLDimension dim)

Locator

public Locator(Board board,
               RLRectangle bounds)

Locator

public Locator(Board board,
               RLRectangle bounds,
               java.util.HashMap<java.lang.String,java.lang.Object> attributes)
Method Detail

points

public java.util.Set<RLPoint> points()
Return the set of RLPoints that are part of this Locator. For rectangular Locators, this will be every RLPoint in the bounding rectangle.


point

public RLPoint point()
Returns the upper left corner of the bounding rectangle.


bounds

public RLRectangle bounds()
Returns the bounding rectangle for this Locator.


size

public RLDimension size()
Returns the dimensions of the bounding rectangle.


attributes

public java.util.Map<java.lang.String,java.lang.Object> attributes()
Return any attributes associated.


board

public Board board()
Returns the board that this Locator points to.

Returns:
Board

isRectangular

public boolean isRectangular()
Return whether this Locator represents a filled rectangle, i.e. whether bounds().points() returns the same set of points as points().