|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectit.unibo.cs.belief.Proposition
public class Proposition
A subset of a frame of discernment. At the moment propositions are limited to frames with up to 31 elements, without any check.
| Field Summary | |
|---|---|
protected java.math.BigInteger |
elements
Comment for elements |
private Frame |
frame
Comment for frame |
| Constructor Summary | |
|---|---|
Proposition(Frame frame)
Creates an empty proposition over a specified frame. |
|
Proposition(Frame frame,
java.math.BigInteger elements)
|
|
Proposition(Frame frame,
int elements)
|
|
Proposition(Frame frame,
long elements)
Creates a proposition over a specified frame, with the elements corresponding to the '1' bits in the input integer. |
|
| Method Summary | |
|---|---|
java.lang.Object |
clone()
|
int |
compareTo(java.lang.Object p)
|
boolean |
contains(int pos)
|
boolean |
equals(Proposition p)
|
java.math.BigInteger |
getElements()
|
Frame |
getFrame()
|
Proposition |
intersect(Proposition prop)
Intersects this proposition with another one. |
boolean |
intersects(Proposition prop)
Checks if this propositions has a not null intersection with another one. |
boolean |
isEmpty()
Checks if this proposition corresponds to the empty set. |
void |
set(int pos)
Adds an element to this proposition (sets to 1 its characteristic function) |
void |
setAll()
Adds all the elements of the frame to this proposition |
boolean |
subset(Proposition prop)
Checks if this propositions is a subset of another one. |
java.lang.String |
toString()
Produces a string representation of this proposition using a set notation. |
Proposition |
union(Proposition prop)
Takes the union of this proposition with another one. |
void |
unset(int pos)
Remove an element from this proposition (sets to 0 its characteristic function) |
void |
unsetAll()
Sets this proposition to the empty set. |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private Frame frame
frame
protected java.math.BigInteger elements
elements
| Constructor Detail |
|---|
public Proposition(Frame frame)
frame - the set of elements representing the universe of the
propositions corresponding to this object
public Proposition(Frame frame,
long elements)
frame - the set of elements representing the universe of the
propositions corresponding to this objectelements - a bit-array representation of this proposition
public Proposition(Frame frame,
int elements)
public Proposition(Frame frame,
java.math.BigInteger elements)
| Method Detail |
|---|
public boolean equals(Proposition p)
public Frame getFrame()
public java.math.BigInteger getElements()
public void set(int pos)
pos - the position of the element added to this propositionpublic void unset(int pos)
pos - the position of the element removed from this propositionpublic void setAll()
public void unsetAll()
public boolean isEmpty()
public Proposition intersect(Proposition prop)
prop - the proposition to be intersected with
public boolean intersects(Proposition prop)
prop - the propositions to be intersected with
public boolean subset(Proposition prop)
prop -
public Proposition union(Proposition prop)
prop - the proposition to take the union with
public java.lang.String toString()
toString in class java.lang.Objectpublic int compareTo(java.lang.Object p)
compareTo in interface java.lang.Comparablepublic java.lang.Object clone()
clone in class java.lang.Objectpublic boolean contains(int pos)
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||