NPTLab
Class CoordSet

java.lang.Object
  extended by NPTLab.CoordSet
Direct Known Subclasses:
CoordSetUser

public class CoordSet
extends java.lang.Object

Class that contains a set of all the location visited wrapped with an univocal ID. CoordWrapper element contains a Coord element and his univoque ID.


Field Summary
static java.util.Set<CoordWrapper> GlobalSet
           
 
Constructor Summary
CoordSet()
          Set of All the locations
 
Method Summary
static boolean addCw(CoordWrapper cw)
          Adds a CoordWrapper to the set if not already contained
static boolean contains(CoordWrapper CW)
          Checks if the global set already contains a Coord
static CoordWrapper getCw(core.Coord c)
          Returns a new CW if the cw is not contained in global set or the CW itself if it's contained, all based on passed coordinates
static int getEntryIdByCoord(core.Coord c)
          Gets an Entry ID in the global set by the Coord Passed
 java.lang.String toString()
          Method for printing
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

GlobalSet

public static java.util.Set<CoordWrapper> GlobalSet
Constructor Detail

CoordSet

public CoordSet()
Set of All the locations

Method Detail

contains

public static boolean contains(CoordWrapper CW)
Checks if the global set already contains a Coord

Parameters:
CW - The CoordWrapper element that is to be checkd
Returns:
true if cointained, else false

addCw

public static boolean addCw(CoordWrapper cw)
Adds a CoordWrapper to the set if not already contained

Parameters:
cw - The CoordWrapper element that has to be added
Returns:
true if added correctly

getEntryIdByCoord

public static int getEntryIdByCoord(core.Coord c)
Gets an Entry ID in the global set by the Coord Passed

Parameters:
c - Coord element used to get the Entry in the set
Returns:
ID of the element with the passed Coord

getCw

public static CoordWrapper getCw(core.Coord c)
Returns a new CW if the cw is not contained in global set or the CW itself if it's contained, all based on passed coordinates

Parameters:
c - Coord element used to create the CW or to return the already existent CW
Returns:
CoordWrapper element

toString

public java.lang.String toString()
Method for printing

Overrides:
toString in class java.lang.Object
Returns:
string