public class Observations extends Object implements ObservationsInterface
Modifier and Type | Class and Description |
---|---|
class |
Observations.Observation
The Observation class holds one observation, cummulative probability
entry.
|
ObservationsInterface.Entry
CUMPROBABILITY, OBSERVATION
Constructor and Description |
---|
Observations(Number[] observations)
constructs a new Observations
|
Observations(Number[][] observations,
boolean cummulative)
constructs a new Observations
|
Observations(SortedMap observations,
boolean cummulative)
constructs a new Observations
|
Modifier and Type | Method and Description |
---|---|
boolean |
contains(Number object,
byte type)
returns whether the structure contains this specific object (either an
observation or a probability).
|
ObservationsInterface.Entry |
get(int index)
Returns the element at the specified position in this structure.
|
ObservationsInterface.Entry |
getCeilingEntry(Number object,
byte type,
boolean inclusive)
Gets the entry corresponding to the specified key if inclusive; if not
inclusive or such entry does not exists, returns the entry for the least
key greater than the specified key; if no such entry exists (i.e., the
greatest key in the Tree is less than the specified key), returns
null.
|
List |
getCumProbabilities()
Returns the cummulative probabilities
|
ObservationsInterface.Entry |
getEntry(Number object,
byte type)
Returns the entry to which the structure maps the specific object.
|
protected int |
getIndex(Number object,
byte type)
returns the preceding index of the object
|
int |
getIndex(ObservationsInterface.Entry entry)
Returns the index of the entry of this structure.
|
List |
getObservations()
Returns the observations
|
ObservationsInterface.Entry |
getPrecedingEntry(Number object,
byte type,
boolean inclusive)
Gets the entry corresponding to the specified key if inclusive; if not
inclusive or such entry does not exists, returns the entry for the
greatest key less than the specified key; if no such entry exists (i.e.,
the least key in the Tree is greater than the specified key), returns
null.
|
protected int |
getPrecedingIndex(Number object,
byte type)
returns the preceding index of the object
|
boolean |
isEmpty()
Returns true if this structure contains no object-value
mappings.
|
boolean |
isGrouped()
Returns true if this structure contains grouped empirical
data.
|
int |
size()
Returns the number of observation-probability mappings in this structure.
|
String |
toString() |
public Observations(Number[] observations)
observations
- the observationspublic Observations(SortedMap observations, boolean cummulative)
observations
- a sortedMap of observations. The double values in the
map either represent actual times of observation, or represent a
probabilitycummulative
- are the probabilities in the map cummulative?public Observations(Number[][] observations, boolean cummulative)
observations
- a sortedMap of observations. The double values in the
map either represent actual times of observation, or represent a
probabilitycummulative
- are the probabilities in the map cummulative?public int size()
ObservationsInterface
size
in interface ObservationsInterface
ObservationsInterface.size()
public boolean isEmpty()
ObservationsInterface
isEmpty
in interface ObservationsInterface
ObservationsInterface.isEmpty()
public boolean isGrouped()
ObservationsInterface
isGrouped
in interface ObservationsInterface
ObservationsInterface.isGrouped()
public int getIndex(ObservationsInterface.Entry entry)
getIndex
in interface ObservationsInterface
entry
- the entrypublic List getCumProbabilities()
getCumProbabilities
in interface ObservationsInterface
public List getObservations()
getObservations
in interface ObservationsInterface
public boolean contains(Number object, byte type)
contains
in interface ObservationsInterface
object
- the object to look fortype
- the type (either the ObservationsInterface.OBSERVATION or the
ObservationsInterface.CUMPROBABILITY)public ObservationsInterface.Entry getEntry(Number object, byte type)
getEntry
in interface ObservationsInterface
object
- entry whose associated entry is to be returned.type
- the type (either the ObservationsInterface.OBSERVATION or the
ObservationsInterface.CUMPROBABILITY)public ObservationsInterface.Entry getPrecedingEntry(Number object, byte type, boolean inclusive)
getPrecedingEntry
in interface ObservationsInterface
object
- object whose next key associated value is to be returned.type
- the type (either the ObservationsInterface.OBSERVATION or the
ObservationsInterface.CUMPROBABILITY)inclusive
- if inclusive and structure contains key key is returnedpublic ObservationsInterface.Entry getCeilingEntry(Number object, byte type, boolean inclusive)
getCeilingEntry
in interface ObservationsInterface
object
- object whose associated value is to be returned.type
- the type (either the ObservationsInterface.OBSERVATION or the
ObservationsInterface.CUMPROBABILITY)inclusive
- if inclusive and structure contains key key is returnedpublic ObservationsInterface.Entry get(int index)
get
in interface ObservationsInterface
index
- index of element to return.IndexOutOfBoundsException
- if the index is out of range (index
< 0 || index >= size()).protected int getIndex(Number object, byte type)
object
- the objecttype
- the typeprotected int getPrecedingIndex(Number object, byte type)
object
- the objecttype
- the typepublic String toString()
toString
in class Object
Object.toString()
Copyright © 2002-2012 Delft University of Technology, the Netherlands. All Rights Reserved.