fi.hut.tml.xsmiles.mlfc.smil.basic
Class TimeListImpl

java.lang.Object
  extended byfi.hut.tml.xsmiles.mlfc.smil.basic.TimeListImpl
All Implemented Interfaces:
TimeList

public class TimeListImpl
extends java.lang.Object
implements TimeList

The TimeList interface provides the abstraction of an ordered collection of times, without defining or constraining how this collection is implemented.

The items in the TimeList are accessible via an integral index, starting from 0.


Constructor Summary
TimeListImpl()
          Initializes this object.
TimeListImpl(java.lang.String timeListString, SMILDocumentImpl doc, ElementBasicTimeImpl e, boolean beginList)
          Parses a time list string into Time objects.
 
Method Summary
 void add(Time time)
          Add a time to TimeList.
 int getLength()
          The number of times in the list.
 Time getTimeGreaterThan(Time time)
          Get the next time greater than time.
 TimeListImpl getTimeInstanceList()
          Create a Time Instance List from this list.
 boolean isDefined()
          If this list has time instances - then the parameter was defined.
 Time item(int index)
          Returns the index the item in the collection.
 void print()
           
 void reset()
          Reset this instance time list - all event condition times are cleared from the list.
 void timeChanged(Time time)
          Time in this instance time list has changed (dependency time's base time was changed).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimeListImpl

public TimeListImpl()
Initializes this object.


TimeListImpl

public TimeListImpl(java.lang.String timeListString,
                    SMILDocumentImpl doc,
                    ElementBasicTimeImpl e,
                    boolean beginList)
Parses a time list string into Time objects. This requires the SMILDocumentImpl for syncbase clock values. Those values link themselves to SMILElements, which are found with SMILDocumentImpl.searchElementWithIdInBody().

Parameters:
timeListString - List of times '2s;3s'
doc - SMILDocumentImpl, required for syncbase clock values.
e - Element, which will receive time changes from syncbase element
beginList - true for beginlists, false for endlists
Method Detail

add

public void add(Time time)
Add a time to TimeList. The times will be kept in order, unresolved > indefinite > resolved time.

Parameters:
time - Time value to be added

item

public Time item(int index)
Returns the index the item in the collection. If index is greater than or equal to the number of times in the list, this returns null .

Specified by:
item in interface TimeList
Parameters:
index - Index into the collection.
Returns:
The time at the index th position in the TimeList , or null if that is not a valid index.

getLength

public int getLength()
The number of times in the list. The range of valid child time indices is 0 to length-1 inclusive.

Specified by:
getLength in interface TimeList

getTimeGreaterThan

public Time getTimeGreaterThan(Time time)
Get the next time greater than time.

Specified by:
getTimeGreaterThan in interface TimeList
Parameters:
time - Time to compare against
Returns:
Index to time item, -1 if not found

isDefined

public boolean isDefined()
If this list has time instances - then the parameter was defined.

Specified by:
isDefined in interface TimeList
Returns:
true if the TimeList is not empty - and parameter was specified.

reset

public void reset()
Reset this instance time list - all event condition times are cleared from the list. DOM created times are of type SMIL_TIME_EVENT_BASED.


print

public void print()

getTimeInstanceList

public TimeListImpl getTimeInstanceList()
Create a Time Instance List from this list. Event and syncbase listeners are still hold in the original TimeList. Time Instance List will only hold offset values (resolved or unresolved).


timeChanged

public void timeChanged(Time time)
Time in this instance time list has changed (dependency time's base time was changed). This will notify the dependency element.



X-Smiles 1.2