org.nak.cleaning.map
Class FieldMap

java.lang.Object
  extended by org.nak.cleaning.map.FieldMap
Direct Known Subclasses:
Map03, Map04, Map0401, Map05, Map06, Map11, Map12, Map13, Map21, Map22, Map53, Map54, Map55, Map56, Map65, Map66, Map67, Map68, Map72, Map74, Map75, Map76, Map77, SampleMap01, SampleMap02, SampleMap03, SampleMap03Beta, SampleMap04, SampleMap05, SampleMap05Diff

public class FieldMap
extends java.lang.Object

Field map class

Version:
1.0
Author:
Hiroyuki NAKAGAWA

Field Summary
static int _CHARGE_STATION_
           
static int _CLEANER_ROBOT_
           
static int _DEPTH_
           
static int _EMPTY_
           
static int _HEAVY_WAIGHT_DUST_
           
static int _LIGHT_WAIGHT_DUST_
           
static int _MIDDLE_WAIGHT_DUST_
           
static int _WIDTH_
           
 java.awt.Point initRobotPoint
           
 java.util.HashMap<java.awt.Point,Element> map
           
 Obstacle obstacle
           
 
Constructor Summary
FieldMap()
          The constructor.
 
Method Summary
 boolean existsDust(java.awt.Point p)
          Checks whether a dust item is located at the specified point.
 Appearance getAppearance(java.awt.Point p)
          Gets appearance of the object located at the point p.
static FieldMap getFieldMap()
           
 java.util.HashMap<java.awt.Point,Element> getHashMap()
          Returns map data representing as (Concurrent)HashMap
 boolean isContainedInMap(java.awt.Point p)
          Checks whether the specified point is in the map.
 boolean isFinished()
          Returns whether dust items remain in the map.
 boolean isLocated(java.awt.Point p, java.lang.String className)
          Checks whether the specified object exists at the specified point.
 Element pickUp(java.awt.Point p)
          Returns the result of picking up at the point p.
 Element sweep(java.awt.Point p)
          Returns the result of sweeping at the point p.
 Element wipe(java.awt.Point p)
          Returns the result of wiping at the point p.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_WIDTH_

public static int _WIDTH_

_DEPTH_

public static int _DEPTH_

_EMPTY_

public static final int _EMPTY_
See Also:
Constant Field Values

_LIGHT_WAIGHT_DUST_

public static final int _LIGHT_WAIGHT_DUST_
See Also:
Constant Field Values

_MIDDLE_WAIGHT_DUST_

public static final int _MIDDLE_WAIGHT_DUST_
See Also:
Constant Field Values

_HEAVY_WAIGHT_DUST_

public static final int _HEAVY_WAIGHT_DUST_
See Also:
Constant Field Values

_CHARGE_STATION_

public static final int _CHARGE_STATION_
See Also:
Constant Field Values

_CLEANER_ROBOT_

public static final int _CLEANER_ROBOT_
See Also:
Constant Field Values

obstacle

public Obstacle obstacle

initRobotPoint

public java.awt.Point initRobotPoint

map

public java.util.HashMap<java.awt.Point,Element> map
Constructor Detail

FieldMap

public FieldMap()
The constructor.

Method Detail

getFieldMap

public static FieldMap getFieldMap()

getHashMap

public java.util.HashMap<java.awt.Point,Element> getHashMap()
Returns map data representing as (Concurrent)HashMap

Returns:

isLocated

public boolean isLocated(java.awt.Point p,
                         java.lang.String className)
Checks whether the specified object exists at the specified point.

Parameters:
p - Point
className - Class name of the specified object
Returns:
returns true if the specified object is located at the specified point.

isFinished

public boolean isFinished()
Returns whether dust items remain in the map. (for checking termination condition)

Returns:
Returns true if there are no dust items in the map.

isContainedInMap

public boolean isContainedInMap(java.awt.Point p)
Checks whether the specified point is in the map.

Parameters:
p - Point
Returns:
returns if Point p is in the map, otherwise returns false.

existsDust

public boolean existsDust(java.awt.Point p)
Checks whether a dust item is located at the specified point.

Parameters:
p - Point
Returns:
returns true if there is a dust item at the specified point.

getAppearance

public Appearance getAppearance(java.awt.Point p)
Gets appearance of the object located at the point p.

Returns:
Appearance of the object at the point p.

sweep

public Element sweep(java.awt.Point p)
Returns the result of sweeping at the point p.

Returns:
returns true if the cleaning by sweeping is succeeded, otherwise returns false.

pickUp

public Element pickUp(java.awt.Point p)
Returns the result of picking up at the point p.

Returns:
returns true if the cleaning by picking up is succeeded, otherwise returns false.

wipe

public Element wipe(java.awt.Point p)
Returns the result of wiping at the point p.

Returns:
returns true if the cleaning by wiping is succeeded, otherwise returns false.