summaryrefslogtreecommitdiffstats
path: root/src/jrummikub/model/IStoneTray.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/jrummikub/model/IStoneTray.java')
-rw-r--r--src/jrummikub/model/IStoneTray.java31
1 files changed, 27 insertions, 4 deletions
diff --git a/src/jrummikub/model/IStoneTray.java b/src/jrummikub/model/IStoneTray.java
index 11fcbbb..c1ed05d 100644
--- a/src/jrummikub/model/IStoneTray.java
+++ b/src/jrummikub/model/IStoneTray.java
@@ -2,6 +2,12 @@ package jrummikub.model;
import jrummikub.util.Pair;
+/**
+ * Interface for the {@link StoneTray} model
+ *
+ * @param <E>
+ * Objects held by the IStoneTray
+ */
public interface IStoneTray<E extends Sizeable> extends
Iterable<Pair<E, Position>>, Cloneable {
@@ -9,7 +15,7 @@ public interface IStoneTray<E extends Sizeable> extends
* Removes object from tray and returns it
*
* @param position
- * position of the object that will be removed
+ * position of the object that will be removed
* @return the picked up stone
*/
public E pickUp(Position position);
@@ -18,9 +24,9 @@ public interface IStoneTray<E extends Sizeable> extends
* Adds object to the tray
*
* @param object
- * object to add to Hand
+ * object to add to Hand
* @param position
- * {@link Position} to put the object
+ * {@link Position} to put the object
*/
public void drop(E object, Position position);
@@ -28,15 +34,32 @@ public interface IStoneTray<E extends Sizeable> extends
* Returns the position of an object that is already on the tray
*
* @param object
- * object whose position is requested
+ * object whose position is requested
* @return position of the object or null when the object is not on the tray
*/
public Position getPosition(E object);
+ /**
+ * Tries to pick up (remove) a given object
+ *
+ * @param object
+ * object to pick up
+ * @return true when the object was successfully removed
+ */
public boolean pickUp(E object);
+ /**
+ * Create a clone of the StoneTray
+ *
+ * @return cloned StoneTray
+ */
public IStoneTray<E> clone();
+ /**
+ * Return the number of objects on the tray
+ *
+ * @return number of objects
+ */
public int getSize();
} \ No newline at end of file