From b0a89642b77736ab5032661f60eb3310a0864c30 Mon Sep 17 00:00:00 2001 From: Bennet Gerlach Date: Tue, 21 Jun 2011 01:38:42 +0200 Subject: Added Javadoc comments to private methods in the model git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@522 72836036-5685-4462-b002-a69064685172 --- src/jrummikub/model/Hand.java | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) (limited to 'src/jrummikub/model/Hand.java') diff --git a/src/jrummikub/model/Hand.java b/src/jrummikub/model/Hand.java index 69d659b..3e6bfeb 100644 --- a/src/jrummikub/model/Hand.java +++ b/src/jrummikub/model/Hand.java @@ -47,8 +47,8 @@ public class Hand extends StoneTray implements IHand { } @Override - protected Pair fixInvalidDrop(Stone stone, - Position pos, Direction dir) { + protected Pair fixInvalidDrop(Stone stone, Position pos, + Direction dir) { double x = pos.getX(); double y = pos.getY(); @@ -59,11 +59,9 @@ public class Hand extends StoneTray implements IHand { return new Pair(new Position(0, y), RIGHT); } else { if (getFreeRowSpace((int) y) == 0) { - return new Pair(new Position(0, y + 1), - RIGHT); + return new Pair(new Position(0, y + 1), RIGHT); } else { - return new Pair( - new Position(WIDTH - 1, y), LEFT); + return new Pair(new Position(WIDTH - 1, y), LEFT); } } } @@ -96,8 +94,14 @@ public class Hand extends StoneTray implements IHand { turnLogic.needIntialMeldThreshold(); return turnLogic.solve(); } - - + + /** + * Increments the count of a stone in the list of all stones + * + * @param stones + * all stones and their respective numbers + * @param stone + */ private static void incrementStoneCount( TreeMap, Integer> stones, Pair stone) { @@ -108,6 +112,9 @@ public class Hand extends StoneTray implements IHand { } } + /** + * The measure to compare the stones by + */ private final static Comparator> comparator = new Comparator>() { @Override public int compare(Pair o1, @@ -120,7 +127,7 @@ public class Hand extends StoneTray implements IHand { } } }; - + /** * Counts the numbers of stones * @@ -152,8 +159,7 @@ public class Hand extends StoneTray implements IHand { public int getIdenticalStoneCount() { List stones = new ArrayList(); - for (Iterator> iter = this.iterator(); iter - .hasNext();) { + for (Iterator> iter = this.iterator(); iter.hasNext();) { stones.add(iter.next().getFirst()); } -- cgit v1.2.3