NPTLab
Class CoordWrapperUserMap

java.lang.Object
  extended by NPTLab.CoordWrapper
      extended by NPTLab.CoordWrapperUserMap

public class CoordWrapperUserMap
extends CoordWrapper

Class that creates a map specific for the user for each location containing the time spent at each location in a given day.

Author:
Andrea Campanella, NPTLab, Public university of Milan, 2014

Method Summary
 void addLocationDayTime(int Day, java.lang.Double Time)
          Adds a location and his time if it's not already contained, if is already in the map adds the time for that day
static CoordWrapperUserMap createCoordWrapUserMap(CoordWrapper cwUser)
          Creates a CoordWrapUserMap
 CoordWrapper getCw()
          Returns the CoordWrapper for this instance of the map
 java.util.HashMap<java.lang.Integer,java.lang.Double> getMap()
          Returns the Map
 void setCw(CoordWrapper cwCorrectId)
          Sets the CoordWrapper
 java.lang.String toString()
          Method for printing
 
Methods inherited from class NPTLab.CoordWrapper
createCoordWrap, createDummyCoordWrap, getCoord, getID
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

createCoordWrapUserMap

public static CoordWrapperUserMap createCoordWrapUserMap(CoordWrapper cwUser)
Creates a CoordWrapUserMap

Parameters:
cwUser - Element of CoordWrapper class
Returns:
CoordWrapperUserMap

addLocationDayTime

public void addLocationDayTime(int Day,
                               java.lang.Double Time)
Adds a location and his time if it's not already contained, if is already in the map adds the time for that day

Parameters:
Day - the day the user visited a specific location, Time time spent in that location
Time - the time spent at the given location that day

getCw

public CoordWrapper getCw()
Returns the CoordWrapper for this instance of the map

Returns:
CoordWrapper

getMap

public java.util.HashMap<java.lang.Integer,java.lang.Double> getMap()
Returns the Map

Returns:
Map

setCw

public void setCw(CoordWrapper cwCorrectId)
Sets the CoordWrapper

Parameters:
cwCorrectId - CoordWrapper element with the correct ID

toString

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

Overrides:
toString in class CoordWrapper
Returns:
string