nl.lxtreme.ols.api.data
Class BaseData<TYPE extends Comparable<? super TYPE>>

java.lang.Object
  extended by nl.lxtreme.ols.api.data.BaseData<TYPE>
Type Parameters:
TYPE - the actual content type of this base data entity.
All Implemented Interfaces:
Comparable<TYPE>

public abstract class BaseData<TYPE extends Comparable<? super TYPE>>
extends Object
implements Comparable<TYPE>

Provides a base data implementation.


Constructor Summary
protected BaseData(int aIdx, int aChannelIdx, int aStartSampleIdx, int aEndSampleIdx)
          Creates a new BaseData instance.
protected BaseData(int aIdx, int aChannelIdx, int aStartSampleIdx, int aEndSampleIdx, String aEventName)
          Creates a new BaseData instance.
protected BaseData(int aIdx, int aChannelIdx, int aSampleIdx, String aEventName)
          Creates a new BaseData instance.
 
Method Summary
 int compareTo(TYPE aComparable)
           
 boolean equals(Object aObject)
           
 int getChannelIdx()
          Returns the channel index this data belongs to.
 int getEndSampleIndex()
          Returns the start sample (array) index on which this data/event ended.
 String getEventName()
          Returns the event name, in case this data represents an event.
 int getIndex()
          Returns the index of this data event/value.
 int getStartSampleIndex()
          Returns the start sample (array) index on which this data/event started.
 int hashCode()
           
 boolean isEvent()
          Returns whether this data represents an event.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseData

protected BaseData(int aIdx,
                   int aChannelIdx,
                   int aStartSampleIdx,
                   int aEndSampleIdx)
Creates a new BaseData instance.


BaseData

protected BaseData(int aIdx,
                   int aChannelIdx,
                   int aStartSampleIdx,
                   int aEndSampleIdx,
                   String aEventName)
Creates a new BaseData instance.


BaseData

protected BaseData(int aIdx,
                   int aChannelIdx,
                   int aSampleIdx,
                   String aEventName)
Creates a new BaseData instance.

Method Detail

compareTo

public int compareTo(TYPE aComparable)
Specified by:
compareTo in interface Comparable<TYPE extends Comparable<? super TYPE>>
See Also:
Comparable.compareTo(java.lang.Object)

equals

public boolean equals(Object aObject)
Overrides:
equals in class Object
See Also:
Object.equals(java.lang.Object)

getChannelIdx

public final int getChannelIdx()
Returns the channel index this data belongs to.

Returns:
a channel index, >= 0 && < 32.

getEndSampleIndex

public final int getEndSampleIndex()
Returns the start sample (array) index on which this data/event ended.

Returns:
an array index, >= 0.
See Also:
getStartSampleIndex()

getEventName

public final String getEventName()
Returns the event name, in case this data represents an event.

Returns:
the event name, can be null.
See Also:
isEvent()

getIndex

public final int getIndex()
Returns the index of this data event/value.

Returns:
the index, zero-based.

getStartSampleIndex

public final int getStartSampleIndex()
Returns the start sample (array) index on which this data/event started.

Returns:
an array index, >= 0.
See Also:
getEndSampleIndex()

hashCode

public int hashCode()
Overrides:
hashCode in class Object
See Also:
Object.hashCode()

isEvent

public boolean isEvent()
Returns whether this data represents an event.

By default, an event is characterized by having a defined event name.

Returns:
true if this data represents an event, false otherwise.


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