|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jrummikub.model.StoneSet
public class StoneSet
Class managing Stone
s joined together to form sets
Nested Class Summary | |
---|---|
static class |
StoneSet.Type
Validity type of the set |
Field Summary | |
---|---|
(package private) static float |
HORIZONTAL_BORDER
|
(package private) static float |
VERTICAL_BORDER
|
Constructor Summary | |
---|---|
StoneSet(java.util.List<Stone> stones)
Create a stone set from a list of stones |
|
StoneSet(Stone stone)
Create a new single stone stone set |
Method Summary | |
---|---|
StoneSet.Type |
classify()
Test for rule conflict within the StoneSet and determine whether the set is a group or a run |
Stone |
get(int i)
Returns the i-th stone of the set (starting with 0) |
float |
getHeight()
Get the height of the object |
float |
getWidth()
Get the width of the object |
boolean |
isValid()
Test for rule conflict within the StoneSet |
java.util.Iterator<Stone> |
iterator()
|
StoneSet |
join(StoneSet other)
Joins StoneSet to another StoneSet and returns the resulting new StoneSet |
int |
size()
Returns the number of stones in the set. |
Pair<StoneSet,StoneSet> |
splitAt(int position)
Splits the StoneSet at a specified Position and returns two new
Stone Sets |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
static final float VERTICAL_BORDER
static final float HORIZONTAL_BORDER
Constructor Detail |
---|
public StoneSet(Stone stone)
stone
- single stone of the setpublic StoneSet(java.util.List<Stone> stones)
stones
- list of stones to build a set ofMethod Detail |
---|
public boolean isValid()
public StoneSet.Type classify()
public Pair<StoneSet,StoneSet> splitAt(int position)
Position
and returns two new
Stone Sets
position
- Splitting Position
public StoneSet join(StoneSet other)
other
- StoneSet to be joined to active StoneSet
public int size()
public Stone get(int i)
i
- number of the stone to return
public java.util.Iterator<Stone> iterator()
iterator
in interface java.lang.Iterable<Stone>
public float getWidth()
Sizeable
getWidth
in interface Sizeable
public float getHeight()
Sizeable
getHeight
in interface Sizeable
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 |