Package org.apache.wicket.util.time
Class TimeMap
- java.lang.Object
-
- org.apache.wicket.util.time.TimeMap
-
- All Implemented Interfaces:
java.io.Serializable
public final class TimeMap extends java.lang.Object implements java.io.SerializableThis class mapsITimeFrames toObjects. Since values are stored usingITimeFrameSourceimplementing objects, the value returned by the source may vary over time. For example, one implementation ofITimeFrameSourcemight return the start and end time of lunch on any given day.To associate an object with a dynamic
TimeFrame(viaITimeFrameSource), callput(ITimeFrameSource, Object). You can later retrieve the first object for a point in time withget(Time). Thegetmethod is provided for convenience and is equivalent toget(Time.now()).This class is not thread-safe.
- Since:
- 1.2.6
- Author:
- Jonathan Locke
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description TimeMap()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectget()Retrieves anObjectfor the currentTimevalue.java.lang.Objectget(Time time)Retrieves anObjectfor the givenTimevalue.voidput(ITimeFrameSource source, java.lang.Object o)Associates anObjectwith a dynamicTimeFrame.
-
-
-
Method Detail
-
get
public java.lang.Object get()
Retrieves anObjectfor the currentTimevalue.- Returns:
Objectfor the currentTimevalue
-
get
public java.lang.Object get(Time time)
Retrieves anObjectfor the givenTimevalue.- Parameters:
time- theTimevalue- Returns:
- gets an
Objectfor the givenTimevalue ornullif none exists
-
put
public void put(ITimeFrameSource source, java.lang.Object o)
Associates anObjectwith a dynamicTimeFrame.- Parameters:
source- a source that can produce aTimeFramewith which to compare aTimevalueo- theObjectto be returned for the given dynamicTimeFrame
-
-