public class Possibility
extends java.lang.Object
Constructor | Description |
---|---|
Possibility(SimpleField value,
double p) |
Creates new possiblility element.
|
Modifier and Type | Method | Description |
---|---|---|
Possibility |
duplicate() |
Makes new copy of this instance.
|
double |
getProb() |
Reads possibility assigned to stored simple field.
|
SimpleField |
getValue() |
Gives an ability to change value of simple field.
|
void |
setProb(double prob) |
Changes the value of possibility.
|
java.lang.String |
toString() |
Returns a
String which represents value of this field. |
public Possibility(SimpleField value, double p)
value
- simple field stored in this classp
- possibility for this elementjava.lang.NullPointerException
- if given field is nullpublic SimpleField getValue()
public Possibility duplicate()
public double getProb()
public void setProb(double prob)
prob
- new value of possibility connected with simple field.public java.lang.String toString()
String
which represents value of this field.
The result is value of simple field, equality mark and possibility.
Notice that simple field's value may be unknown (question mark is shown then).toString
in class java.lang.Object