jchrest.lib
Class ItemSquarePattern

java.lang.Object
  extended by jchrest.lib.Pattern
      extended by jchrest.lib.PrimitivePattern
          extended by jchrest.lib.ItemSquarePattern

public class ItemSquarePattern
extends PrimitivePattern

The ItemSquarePattern is a type of PrimitivePattern used to hold objects places on a square array. The item-on-square is treated as a single object. Instances of this class are immutable.


Constructor Summary
ItemSquarePattern(java.lang.String item, int column, int row)
          Constructor takes a string to identify the item, and a column and row to identify the square.
 
Method Summary
 boolean equals(java.lang.Object object)
          Two ItemSquarePatterns are only equal if all their parts are the same.
 int getColumn()
          Accessor method for the column.
 java.lang.String getItem()
          Accessor method for the stored item.
 int getRow()
          Accessor method for the row.
 boolean matches(Pattern givenPattern)
          Two ItemSquarePatterns only match if they are the same.
 java.lang.String toString()
          Return a string representation of the item on square.
 
Methods inherited from class jchrest.lib.Pattern
makeActionList, makeNumber, makeString, makeVerbalList, makeVerbalList, makeVisualList, makeVisualList
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ItemSquarePattern

public ItemSquarePattern(java.lang.String item,
                         int column,
                         int row)
Constructor takes a string to identify the item, and a column and row to identify the square.

Method Detail

getItem

public java.lang.String getItem()
Accessor method for the stored item.


getColumn

public int getColumn()
Accessor method for the column.


getRow

public int getRow()
Accessor method for the row.


equals

public boolean equals(java.lang.Object object)
Two ItemSquarePatterns are only equal if all their parts are the same.

Overrides:
equals in class java.lang.Object

matches

public boolean matches(Pattern givenPattern)
Two ItemSquarePatterns only match if they are the same.

Specified by:
matches in class Pattern

toString

public java.lang.String toString()
Return a string representation of the item on square.

Specified by:
toString in class Pattern