cc.mallet.grmm.types
Class Variable

java.lang.Object
  extended by cc.mallet.grmm.types.Variable
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable

public class Variable
extends java.lang.Object
implements java.lang.Comparable, java.io.Serializable

Class for a discrete random variable in a graphical model. Created: Thu Sep 18 09:32:25 2003

Version:
$Id: Variable.java,v 1.1 2007/10/22 21:37:44 mccallum Exp $
Author:
Charles Sutton
See Also:
Serialized Form

Field Summary
static int CONTINUOUS
          Number of outcomes for a continous variable.
 
Constructor Summary
Variable(int numOutcomes)
           
Variable(LabelAlphabet outs)
          Creates a new variable with the given outcomes.
Variable(Universe universe, int numOutcomes)
           
Variable(Universe universe, LabelAlphabet outs)
           
 
Method Summary
 int compareTo(java.lang.Object o)
           
 int getIndex()
          Returns the index of this variable in its universe
 java.lang.String getLabel()
           
 LabelAlphabet getLabelAlphabet()
           
 double getNumericProperty(java.lang.String key)
           
 int getNumOutcomes()
           
 Universe getUniverse()
           
 boolean isContinuous()
           
 java.lang.Object lookupOutcome(int i)
           
 void setLabel(java.lang.String label)
           
 void setNumericProperty(java.lang.String key, double value)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CONTINUOUS

public static final int CONTINUOUS
Number of outcomes for a continous variable.

See Also:
Constant Field Values
Constructor Detail

Variable

public Variable(LabelAlphabet outs)
Creates a new variable with the given outcomes.


Variable

public Variable(Universe universe,
                LabelAlphabet outs)

Variable

public Variable(int numOutcomes)

Variable

public Variable(Universe universe,
                int numOutcomes)
Method Detail

getLabel

public java.lang.String getLabel()

setLabel

public void setLabel(java.lang.String label)

getNumOutcomes

public int getNumOutcomes()

lookupOutcome

public java.lang.Object lookupOutcome(int i)

getLabelAlphabet

public LabelAlphabet getLabelAlphabet()

compareTo

public int compareTo(java.lang.Object o)
Specified by:
compareTo in interface java.lang.Comparable

setNumericProperty

public void setNumericProperty(java.lang.String key,
                               double value)

getNumericProperty

public double getNumericProperty(java.lang.String key)

toString

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

getIndex

public int getIndex()
Returns the index of this variable in its universe


getUniverse

public Universe getUniverse()

isContinuous

public boolean isContinuous()