From 670fcf2613f6db2a4bfdaa91ac9d90001a90359e Mon Sep 17 00:00:00 2001 From: Ida Massow Date: Tue, 10 May 2011 16:59:40 +0200 Subject: docs fertig und vorher repariert git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@232 72836036-5685-4462-b002-a69064685172 --- doc/jrummikub/model/StoneTray.html | 483 +++++++++++++++++++++++++++++++++++++ 1 file changed, 483 insertions(+) create mode 100644 doc/jrummikub/model/StoneTray.html (limited to 'doc/jrummikub/model/StoneTray.html') diff --git a/doc/jrummikub/model/StoneTray.html b/doc/jrummikub/model/StoneTray.html new file mode 100644 index 0000000..a980742 --- /dev/null +++ b/doc/jrummikub/model/StoneTray.html @@ -0,0 +1,483 @@ + + + + + + +StoneTray + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +jrummikub.model +
+Class StoneTray<E extends Sizeable>

+
+java.lang.Object
+  extended by jrummikub.model.StoneTray<E>
+
+
+
Type Parameters:
E - Type of positioned objects (must implement Sizeable)
+
+
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Iterable<Pair<E,Position>>, IStoneTray<E>
+
+
+
Direct Known Subclasses:
Hand, Table
+
+
+
+
public class StoneTray<E extends Sizeable>
extends java.lang.Object
implements IStoneTray<E>
+ + +

+A StoneTray is a collection of positioned objects (for example Stones + or StoneSets. +

+ +

+


+ +

+ + + + + + + + + + + +
+Nested Class Summary
+protected static classStoneTray.Direction + +
+          Possible move directions in case of overlapping Stones/Sets
+ + + + + + + + + + +
+Field Summary
+protected  java.util.HashMap<E,Pair<E,Position>>objects + +
+           
+  + + + + + + + + + + +
+Constructor Summary
StoneTray() + +
+           
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ IStoneTray<E>clone() + +
+          Create a clone of the StoneTray
+ voiddrop(E object, + Position position) + +
+          Adds object to the tray
+protected  Pair<Position,StoneTray.Direction>fixInvalidDrop(E object, + Position pos, + StoneTray.Direction dir) + +
+          Checks whether the object may be placed on the given position, computes + new position if not
+ PositiongetPosition(E object) + +
+          Returns the position of an object that is already on the tray
+ intgetSize() + +
+          Return the number of objects on the tray
+ java.util.Iterator<Pair<E,Position>>iterator() + +
+           
+ booleanpickUp(E object) + +
+          Tries to pick up (remove) a given object
+ + + + + + + +
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Field Detail
+ +

+objects

+
+protected java.util.HashMap<E extends Sizeable,Pair<E extends Sizeable,Position>> objects
+
+
+
+
+ + + + + + + + +
+Constructor Detail
+ +

+StoneTray

+
+public StoneTray()
+
+
+ + + + + + + + +
+Method Detail
+ +

+drop

+
+public void drop(E object,
+                 Position position)
+
+
Description copied from interface: IStoneTray
+
Adds object to the tray +

+

+
Specified by:
drop in interface IStoneTray<E extends Sizeable>
+
+
+
Parameters:
object - object to add to Hand
position - Position to put the object
+
+
+
+ +

+fixInvalidDrop

+
+protected Pair<Position,StoneTray.Direction> fixInvalidDrop(E object,
+                                                            Position pos,
+                                                            StoneTray.Direction dir)
+
+
Checks whether the object may be placed on the given position, computes + new position if not +

+

+
+
+
+
Parameters:
object - to be dropped
dir -
pos - the object is dropped at +
Returns:
null if the drop is valid, new position otherwise
+
+
+
+ +

+getPosition

+
+public Position getPosition(E object)
+
+
Description copied from interface: IStoneTray
+
Returns the position of an object that is already on the tray +

+

+
Specified by:
getPosition in interface IStoneTray<E extends Sizeable>
+
+
+
Parameters:
object - object whose position is requested +
Returns:
position of the object or null when the object is not on the tray
+
+
+
+ +

+iterator

+
+public java.util.Iterator<Pair<E,Position>> iterator()
+
+
+
Specified by:
iterator in interface java.lang.Iterable<Pair<E extends Sizeable,Position>>
+
+
+
+
+
+
+ +

+pickUp

+
+public boolean pickUp(E object)
+
+
Description copied from interface: IStoneTray
+
Tries to pick up (remove) a given object +

+

+
Specified by:
pickUp in interface IStoneTray<E extends Sizeable>
+
+
+
Parameters:
object - object to pick up +
Returns:
true when the object was successfully removed
+
+
+
+ +

+clone

+
+public IStoneTray<E> clone()
+
+
Description copied from interface: IStoneTray
+
Create a clone of the StoneTray +

+

+
Specified by:
clone in interface IStoneTray<E extends Sizeable>
Overrides:
clone in class java.lang.Object
+
+
+ +
Returns:
cloned StoneTray
+
+
+
+ +

+getSize

+
+public int getSize()
+
+
Description copied from interface: IStoneTray
+
Return the number of objects on the tray +

+

+
Specified by:
getSize in interface IStoneTray<E extends Sizeable>
+
+
+ +
Returns:
number of objects
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + -- cgit v1.2.3