Class Probability

java.lang.Object
  |
  +--Probability

public class Probability
extends java.lang.Object

A probability with a "correctness."

Author:
Noah A. Smith

Constructor Summary
Probability()
          Instantiate a probability with no given initial value.
Probability(double p, boolean c)
          Instantiate a probability with value 'p' and correctness 'c'.
Probability(Probability P)
          Copy the probability 'P'.
 
Method Summary
 boolean correct()
          Return the correctness of the probable event.
 java.lang.String read(java.io.StreamTokenizer st, boolean c)
          Read in a probability UP TO AND INCLUDING AN END OF LINE from the StreamTokenizer 'st', given its correctness 'c'.
 void setEqualTo(Probability P)
          Assign argument's value to the Probability 'P'.
 java.lang.String toString()
          Create a printable string representing the value and correctness.
 double val()
          Return the probability value itself.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Probability

public Probability()
Instantiate a probability with no given initial value.

Probability

public Probability(double p,
                   boolean c)
Instantiate a probability with value 'p' and correctness 'c'.

Probability

public Probability(Probability P)
Copy the probability 'P'.
Method Detail

val

public double val()
Return the probability value itself.

correct

public boolean correct()
Return the correctness of the probable event.

setEqualTo

public void setEqualTo(Probability P)
Assign argument's value to the Probability 'P'.

read

public java.lang.String read(java.io.StreamTokenizer st,
                             boolean c)
                      throws FormatException
Read in a probability UP TO AND INCLUDING AN END OF LINE from the StreamTokenizer 'st', given its correctness 'c'.

toString

public java.lang.String toString()
Create a printable string representing the value and correctness.
Overrides:
toString in class java.lang.Object