nl.lxtreme.ols.api.data
Interface Cursor

All Superinterfaces:
Cloneable

public interface Cursor
extends Cloneable

Defines a cursor, which is a temporary marker in time defined somewhere on the captured data.


Method Summary
 void clear()
          Clears this cursor, making it undefined.
 Cursor clone()
          Creates a clone of this cursor.
 Color getColor()
          Returns the cursor color.
 int getIndex()
          Returns the index of this cursor.
 String getLabel()
          Returns the label of this cursor.
 long getTimestamp()
          Returns the time stamp of this cursor.
 boolean hasLabel()
          Returns whether or not this cursor has a label.
 boolean inArea(long aTimestamp, double aDelta)
          Returns whether the time stamp of this cursor falls within the range of a given time stamp.
 boolean isDefined()
          Returns whether or not this cursor has a defined time stamp.
 void setColor(Color aColor)
          Sets the color of this cursor.
 void setLabel(String aLabel)
          Sets the label.
 void setTimestamp(long aTimestamp)
          Sets the time stamp for this cursor.
 

Method Detail

clear

void clear()
Clears this cursor, making it undefined.


clone

Cursor clone()
Creates a clone of this cursor.

Returns:
an exact copy of this cursor.

getColor

Color getColor()
Returns the cursor color.

Returns:
the color of this cursor, never null.

getIndex

int getIndex()
Returns the index of this cursor.

Returns:
an index, >= 0 && < 10.

getLabel

String getLabel()
Returns the label of this cursor.

Returns:
the label, can be null if no label is (yet) defined.

getTimestamp

long getTimestamp()
Returns the time stamp of this cursor.

Returns:
a time stamp.
Throws:
IllegalStateException - in case this cursor is undefined.
See Also:
isDefined()

hasLabel

boolean hasLabel()
Returns whether or not this cursor has a label.

Returns:
true if there's a label assigned to this cursor, false otherwise.

inArea

boolean inArea(long aTimestamp,
               double aDelta)
Returns whether the time stamp of this cursor falls within the range of a given time stamp.

Parameters:
aTimestamp - the time stamp to check against;
aDelta - the delta deviation between this time stamp and the given time stamp, >= 0.
Returns:
true if this cursor is within the area of the given time stamp, false otherwise.

isDefined

boolean isDefined()
Returns whether or not this cursor has a defined time stamp.

Returns:
true if this cursor has a defined time stamp, false otherwise.

setColor

void setColor(Color aColor)
Sets the color of this cursor.

Parameters:
aColor - the color to set, cannot be null.

setLabel

void setLabel(String aLabel)
Sets the label.

Parameters:
aLabel - the label to set

setTimestamp

void setTimestamp(long aTimestamp)
Sets the time stamp for this cursor.

Parameters:
aTimestamp - the time stamp to set, >= 0.


Copyright © 2012 L'Xtreme IT consultancy. All Rights Reserved.