Correctly show invalid sets

git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@471 72836036-5685-4462-b002-a69064685172
This commit is contained in:
Matthias Schiffer 2011-06-19 00:14:27 +02:00
parent e8549b95df
commit 479384d6bf
13 changed files with 183 additions and 100 deletions

View file

@ -55,4 +55,6 @@ public interface IStoneTray<E extends Sizeable> extends
*/
public int getSize();
public boolean contains(E object);
}

View file

@ -189,7 +189,16 @@ public class StoneTray<E extends Sizeable> implements IStoneTray<E> {
*/
@Override
public Position getPosition(E object) {
return objects.get(object).getSecond();
Pair<E, Position> entry = objects.get(object);
if (entry == null) {
return null;
}
return entry.getSecond();
}
@Override
public boolean contains(E object) {
return objects.containsKey(objects);
}
@Override