tpp
Class Series

java.lang.Object
  extended by tpp.Series

public class Series
extends java.lang.Object

Represents a set of series in the data. A series is defined by two attributes: the id attribute which identifies members of the series (which may be nominal or string); and the index attribute which orders them (which may be real or nominal or date). The id attribute may be null, in which case it is assumed that the data comprises a single series ordered by the index attribute.


Constructor Summary
Series(Instances ins, Attribute indexAttribute, Attribute idAttribute)
           
Series(Instances ins, java.lang.String indexAttributeName, java.lang.String idAttributeName)
          Create a series given just the names of the two attributes.
 
Method Summary
 java.util.HashMap<java.lang.String,java.util.TreeSet<Instance>> getAllSeries()
          The series themselves.
 Attribute getIdAttribute()
           
 Attribute getIndexAttribute()
           
 Instance next(Instance in)
          Find the instance after this one in whichever series it is a member of.
 int next(int i)
          Find the index of the next instance, given the index of an instance.
 Instance previous(Instance in)
          Find the instance before this one in whichever series it is a member of.
 int previous(int i)
          Find the index of the previous instance, given the index of an instance.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Series

public Series(Instances ins,
              java.lang.String indexAttributeName,
              java.lang.String idAttributeName)
       throws TPPException
Create a series given just the names of the two attributes.

Throws:
TPPException - if indexAttribute cannot be recognised

Series

public Series(Instances ins,
              Attribute indexAttribute,
              Attribute idAttribute)
Method Detail

getAllSeries

public java.util.HashMap<java.lang.String,java.util.TreeSet<Instance>> getAllSeries()
The series themselves. Each entry in the hashmap is a set of instances, ordered by the index attribute. The hashmap is keyed by the values of the id attribute. If there is no id attribute then there will be a single set of instances in the hashmap which contains all instances in indexAttribute order, and keyed by "";


getIdAttribute

public Attribute getIdAttribute()

getIndexAttribute

public Attribute getIndexAttribute()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

previous

public Instance previous(Instance in)
Find the instance before this one in whichever series it is a member of. Returns null if it is the first member of its series


next

public Instance next(Instance in)
Find the instance after this one in whichever series it is a member of. Returns null if it is the last member of its series


previous

public int previous(int i)
Find the index of the previous instance, given the index of an instance. Returns -1 if the instance was first in the series.

Throws:
TPPException

next

public int next(int i)
Find the index of the next instance, given the index of an instance. Returns -1 if the instance was last in the series.

Throws:
TPPException