|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.stanford.nlp.stats.HashObservation
Observation
Represents an observation, or a specification of
values for random variables.
Observation
represents a possibly partial state of the
world. It contains a map between random variables and their values.
Constructor Summary | |
HashObservation()
Default constructor. |
|
HashObservation(int size)
Constructor which allows specification of the initial number of random variables expected. |
Method Summary | |
boolean |
equals(Object o)
|
int |
hashCode()
|
boolean |
isEmpty()
Checks if this is the empty observation which specifies the value of no random variables. |
void |
setValue(String randomVariable,
String value)
Sets the value of a single RandomVariable
in this observation. |
int |
size()
Get the number of random variables specified in this observation. |
List |
toListOver(List randomVariables)
Transforms the observation into a List of values. |
String |
toString()
|
String |
value(String randomVariable)
Gets the value of a given RandomVariable. |
Set |
variables()
Gets a set view of all the random variables specified in this observation. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public HashObservation()
public HashObservation(int size)
size
- the initial size of the internal Map
Method Detail |
public void setValue(String randomVariable, String value)
RandomVariable
in this observation.
setValue
in interface Observation
randomVariable
- a RandomVariable
value
- the value for randomVariablepublic String value(String randomVariable)
value
in interface Observation
randomVariable
- a RandomVariable
to look up
public Set variables()
variables
in interface Observation
Set
of random variablespublic int size()
public boolean isEmpty()
public List toListOver(List randomVariables)
List
of values.
randomVariables
- a List
of String
s
specifying which random variables' values are to
be included in the returned List
.
List
over the specified random variables.public int hashCode()
hashCode
in class Object
public boolean equals(Object o)
equals
in class Object
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |