com.tractrac.clientmodule.data.containers
Class TimestampContainer<T extends TimeObject>

java.lang.Object
  extended by com.tractrac.clientmodule.data.containers.TimestampContainer<T>
All Implemented Interfaces:
ITimeObjectContainer<T>, java.lang.Iterable<T>

public class TimestampContainer<T extends TimeObject>
extends java.lang.Object
implements ITimeObjectContainer<T>, java.lang.Iterable<T>

Version:
2.0
Author:
TracTrac

Nested Class Summary
static class TimestampContainer.Factory<S extends TimeObject>
           
 
Constructor Summary
TimestampContainer()
           
 
Method Summary
 boolean add(T pos)
          Adds a new time object to the container
 boolean contains(long time)
           
 T floor(long time)
           
 T get(long time)
           
 T higher(long time)
           
 boolean isEmpty()
           
 java.util.Iterator<T> iterator()
           
 int size()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimestampContainer

public TimestampContainer()
Method Detail

add

public boolean add(T pos)
Description copied from interface: ITimeObjectContainer
Adds a new time object to the container

Specified by:
add in interface ITimeObjectContainer<T extends TimeObject>
Parameters:
pos - the time object to add
Returns:
true if the state of the container changed, false otherwise

size

public int size()
Specified by:
size in interface ITimeObjectContainer<T extends TimeObject>

isEmpty

public boolean isEmpty()

floor

public T floor(long time)

higher

public T higher(long time)

iterator

public java.util.Iterator<T> iterator()
Specified by:
iterator in interface java.lang.Iterable<T extends TimeObject>

get

public T get(long time)

contains

public boolean contains(long time)