cad.simcad.maps
Class CellRectangle

java.lang.Object
  |
  +--cad.simcad.maps.CellGroup
        |
        +--cad.simcad.maps.CellRectangle
All Implemented Interfaces:
java.util.Comparator, PathPlace
Direct Known Subclasses:
CellSquare

public class CellRectangle
extends CellGroup

a Group of cells forming a rectangular shape This is a subclass of CellGroup

Version:
1.0
Author:
Charles-Philip Bentley

Field Summary
 
Fields inherited from class cad.simcad.maps.CellGroup
_art, _cellMap, _cellNum, _cells, _maxHeight, _maxWidth, _ref, _value, _z
 
Constructor Summary
CellRectangle(CellMap cellMap, Cell[][] cells)
          Creates new CellRectangle
CellRectangle(CellMap cellMap, Cell[][] cells, Cell ref)
          Creates new CellRectangle
 
Method Summary
 int compare(java.lang.Object cellOne, java.lang.Object cellTwo)
          Compare two Cells.
 CellGroup createInstance(CellMap cellMap, Cell[][] newCells)
           
 CellGroup createInstance(CellMap cellMap, Cell[][] newCells, Cell ref)
           
 boolean equals(PathPlace pp)
           
 double getCostToReachFrom(PathPlace pp, PathUser pu)
          Returns the cost associated with originating cell and path user
 MapUnit[] getInnerMapUnitBoundary()
          Returns an Array of MapUnits that make the inner boundary of the PathPlace This method applied to a MapUnit PathPlace returns itself
 int getNumberOfUnits()
          Returns the number of units contained in the PathPlace
 int getSteepRatio(MapUnit mu)
           
 java.util.TreeSet sortMapUnits(MapUnit[] mus)
          Returns an array of sorted MapUnits
 
Methods inherited from class cad.simcad.maps.CellGroup
belongsTo, contained, contains, containsMapUnit, getAdjacentPathPlaces, getAverageAltitude, getBiggestXLength, getBiggestYLength, getCells, getDifference, getEastX, getElevation, getGroupHeight, getGroupWidth, getImplementingObject, getIntersection, getMap, getMyAdjacentMapUnits, getNorthY, getNotMyAdjacentMapUnits, getNumberOfCells, getOuterMapUnitBoundary, getRatio, getResolution, getSouthY, getUnits, getValue, getWestX, getX, getY, intersection, isAdjacent, moveEast, moveNorth, moveNorthEast, moveNorthWest, moveSouth, moveSouthEast, moveSouthWest, moveWest, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

CellRectangle

public CellRectangle(CellMap cellMap,
                     Cell[][] cells,
                     Cell ref)
Creates new CellRectangle


CellRectangle

public CellRectangle(CellMap cellMap,
                     Cell[][] cells)
Creates new CellRectangle

Method Detail

getCostToReachFrom

public double getCostToReachFrom(PathPlace pp,
                                 PathUser pu)
Returns the cost associated with originating cell and path user

Specified by:
getCostToReachFrom in interface PathPlace
Specified by:
getCostToReachFrom in class CellGroup

getSteepRatio

public int getSteepRatio(MapUnit mu)
Specified by:
getSteepRatio in class CellGroup

sortMapUnits

public java.util.TreeSet sortMapUnits(MapUnit[] mus)
Returns an array of sorted MapUnits


getInnerMapUnitBoundary

public MapUnit[] getInnerMapUnitBoundary()
Returns an Array of MapUnits that make the inner boundary of the PathPlace This method applied to a MapUnit PathPlace returns itself

Specified by:
getInnerMapUnitBoundary in interface PathPlace
Specified by:
getInnerMapUnitBoundary in class CellGroup

createInstance

public CellGroup createInstance(CellMap cellMap,
                                Cell[][] newCells)
Specified by:
createInstance in class CellGroup

createInstance

public CellGroup createInstance(CellMap cellMap,
                                Cell[][] newCells,
                                Cell ref)
Specified by:
createInstance in class CellGroup

compare

public int compare(java.lang.Object cellOne,
                   java.lang.Object cellTwo)
Compare two Cells.


equals

public boolean equals(PathPlace pp)

getNumberOfUnits

public int getNumberOfUnits()
Returns the number of units contained in the PathPlace


Logo

With the help of www.sourceforge.net and www.info.ucl.ac.be