org.apache.wicket.util.time
Class TimeMap

java.lang.Object
  extended by org.apache.wicket.util.time.TimeMap
All Implemented Interfaces:
Serializable

public final class TimeMap
extends Object
implements Serializable

This class maps ITimeFrames to Objects. Since values are stored using ITimeFrameSource implementing objects, the value returned by the source may vary over time. For example, one implementation of ITimeFrameSource might return the start and end time of lunch on any given day.

To associate an object with a dynamic TimeFrame (via ITimeFrameSource), call put(ITimeFrameSource, Object). You can later retrieve the first object for a point in time with get(Time). The get method is provided for convenience and is equivalent to get(Time.now()).

This class is not thread-safe.

Since:
1.2.6
Author:
Jonathan Locke
See Also:
Serialized Form

Constructor Summary
TimeMap()
           
 
Method Summary
 Object get()
          Retrieves an Object for the current Time value.
 Object get(Time time)
          Retrieves an Object for the given Time value.
 void put(ITimeFrameSource source, Object o)
          Associates an Object with a dynamic TimeFrame.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimeMap

public TimeMap()
Method Detail

get

public Object get()
Retrieves an Object for the current Time value.

Returns:
Object for the current Time value

get

public Object get(Time time)
Retrieves an Object for the given Time value.

Parameters:
time - the Time value
Returns:
gets an Object for the given Time value or null if none exists

put

public void put(ITimeFrameSource source,
                Object o)
Associates an Object with a dynamic TimeFrame.

Parameters:
source - a source that can produce a TimeFrame with which to compare a Time value
o - the Object to be returned for the given dynamic TimeFrame


Copyright © 2004-2011 Apache Software Foundation. All Rights Reserved.