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:
parent
e8549b95df
commit
479384d6bf
13 changed files with 183 additions and 100 deletions
|
@ -55,4 +55,6 @@ public interface IStoneTray<E extends Sizeable> extends
|
|||
*/
|
||||
public int getSize();
|
||||
|
||||
public boolean contains(E object);
|
||||
|
||||
}
|
|
@ -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
|
||||
|
|
Reference in a new issue