diva.compat.trace
Class TraceModel.Trace

java.lang.Object
  extended by diva.compat.trace.TraceModel.Trace
Enclosing class:
TraceModel

public static class TraceModel.Trace
extends Object

The data contained along a single trace


Constructor Summary
TraceModel.Trace()
          Create a new Trace with an unspecified initial capacity
TraceModel.Trace(int capacity)
          Create a new Trace with the given initial capacity
 
Method Summary
 void add(TraceModel.Element elt)
          Append an element to the trace.
 Iterator elements()
          Get an iterator over all elements
 TraceModel.Element get(double location)
          Get the element that overlaps the given time, or null if there isn't one.
 TraceModel.Element get(int index)
          Get an element at the specified index.
 int getID()
          Get the id of the trace.
 Object getUserObject()
          Get the user object.
 void insert(TraceModel.Element elt)
          Insert an element according to its start time The ID of the element will be set to a unique value within this trace.
 void setUserObject(Object o)
          Set the user object.
 void truncate(double startTime)
          Truncate the trace by removing all elements less than the given start time.
 void truncateEnd(double endTime)
          Truncate the trace by removing all elements greater than the given end time.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TraceModel.Trace

public TraceModel.Trace()
Create a new Trace with an unspecified initial capacity


TraceModel.Trace

public TraceModel.Trace(int capacity)
Create a new Trace with the given initial capacity

Method Detail

add

public void add(TraceModel.Element elt)
Append an element to the trace. The start time of the element must be no less than the end of the previous time. The ID of the element will be set to a unique value within this trace.


elements

public Iterator elements()
Get an iterator over all elements


get

public TraceModel.Element get(int index)
Get an element at the specified index. FIXME: is this useful?


get

public TraceModel.Element get(double location)
Get the element that overlaps the given time, or null if there isn't one.


getID

public int getID()
Get the id of the trace. Once the trace has been added to a model, the id is guaranteed to be unique within that model.


getUserObject

public Object getUserObject()
Get the user object.


insert

public void insert(TraceModel.Element elt)
Insert an element according to its start time The ID of the element will be set to a unique value within this trace.


setUserObject

public void setUserObject(Object o)
Set the user object.


truncate

public void truncate(double startTime)
Truncate the trace by removing all elements less than the given start time. By "less," this means elements that have an end time less than the given start time.


truncateEnd

public void truncateEnd(double endTime)
Truncate the trace by removing all elements greater than the given end time.



Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.