cad.simcad.pathfinding.astar
Class AlgoAssociation

java.lang.Object
  |
  +--cad.simcad.pathfinding.astar.AlgoAssociation
All Implemented Interfaces:
java.util.Comparator

public class AlgoAssociation
extends java.lang.Object
implements java.util.Comparator

a ligthweight object internally used by AStar

Version:
Author:
Charles-Philip Bentley

Field Summary
protected  double _d
           
protected  int _id
           
protected  PathPlace _mp
           
 
Constructor Summary
AlgoAssociation(PathPlace mp, double d, int id)
          Creates new TempCell
 
Method Summary
 int compare(java.lang.Object ppOne, java.lang.Object ppTwo)
          Compare two AlgoAssociations.
 double getCost()
           
 int getId()
           
 PathPlace getPathPlace()
           
 void setId(int id)
           
 
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
 

Field Detail

_mp

protected PathPlace _mp

_d

protected double _d

_id

protected int _id
Constructor Detail

AlgoAssociation

public AlgoAssociation(PathPlace mp,
                       double d,
                       int id)
Creates new TempCell

Method Detail

getCost

public double getCost()

setId

public void setId(int id)

getId

public int getId()

getPathPlace

public PathPlace getPathPlace()

compare

public int compare(java.lang.Object ppOne,
                   java.lang.Object ppTwo)
Compare two AlgoAssociations. Returns -1 if first AlgoAssociations is has a lower cost Returns 1 if first AlgoAssociations is has a higher cost returns 0 if Object One is the Object two This method prefers AlgoAssociations that were inserted last

Specified by:
compare in interface java.util.Comparator

Logo

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