de.uni_paderborn.robots.robot.group9
Class ItemIdListMatcher

java.lang.Object
  |
  +--de.uni_paderborn.robots.robot.group9.ItemIdListMatcher
All Implemented Interfaces:
MapItemMatcher

public class ItemIdListMatcher
extends java.lang.Object
implements MapItemMatcher

Implementation of MapItemMatcher, that searches for the shortest paths to map items that match with their id with one id from a list of ids


Field Summary
private  int[] id
          The ids to search for
private  int idsFound
          We cound how many ids have already been found
 
Constructor Summary
ItemIdListMatcher(int[] id)
          Creates a new ItemTypeMatcher that searches for map items with an id that matches one out of the specified id list.
 
Method Summary
 boolean finished(MapItem mapItem)
          Have all ids aready been found?
 boolean matches(MapItem mapItem)
          Matches the item
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

id

private int[] id
The ids to search for

idsFound

private int idsFound
We cound how many ids have already been found
Constructor Detail

ItemIdListMatcher

public ItemIdListMatcher(int[] id)
Creates a new ItemTypeMatcher that searches for map items with an id that matches one out of the specified id list.
Parameters:
array - of ids to search for.
Method Detail

matches

public boolean matches(MapItem mapItem)
Matches the item
Specified by:
matches in interface MapItemMatcher
Parameters:
mapItem - the map item to check
Returns:
true if the id of the specified map item is equal to one of the ids to be searched for

finished

public boolean finished(MapItem mapItem)
Have all ids aready been found?
Specified by:
finished in interface MapItemMatcher
Parameters:
mapItem - the mapItem that has been finished.
Returns:
true if all ids have been found.