public class BooleanTerm extends HashSet<BooleanVar>
Modifier and Type | Field and Description |
---|---|
static BooleanTerm |
FALSE |
static BooleanTerm |
TRUE |
Constructor and Description |
---|
BooleanTerm(BooleanVar var) |
BooleanTerm(Set<BooleanVar> term) |
BooleanTerm(String str)
Constructs an object from a string of the form "A*B*!C" where
A, B and C are variable names and names preceeded by ! are
negated.
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(BooleanVar object) |
boolean |
addAll(Collection<? extends BooleanVar> collection) |
BooleanTerm |
andWith(BooleanTerm other)
Returns the logical AND of this term with the specified
term.
|
void |
clear() |
boolean |
equals(Object other) |
int |
hashCode() |
boolean |
isFalse() |
boolean |
isTrue() |
boolean |
remove(Object object) |
boolean |
removeAll(Collection<?> collection) |
BooleanTerm |
resolveWith(Features features)
Applies the feature values specified in
features to the term
and returns a new term with the resolved result. |
BooleanTerm |
resolveWith(Features features,
boolean coerceUndefinedToFalse)
Applies the feature values specified in
features to the term
and returns a new term with the resolved result. |
boolean |
retainAll(Collection<?> collection) |
String |
toString() |
containsAll, toArray, toArray
finalize, getClass, notify, notifyAll, wait, wait, wait
containsAll, toArray, toArray
public static final BooleanTerm TRUE
public static final BooleanTerm FALSE
public BooleanTerm(BooleanVar var)
public BooleanTerm(Set<BooleanVar> term)
public BooleanTerm(String str)
str
- the boolean term in string form.public boolean isTrue()
public boolean isFalse()
public BooleanTerm resolveWith(Features features)
features
to the term
and returns a new term with the resolved result. A result of null
indicates the term is false. An empty term indicates the the term is truefeatures
- the varialbe names and values to resolve withpublic BooleanTerm resolveWith(Features features, boolean coerceUndefinedToFalse)
features
to the term
and returns a new term with the resolved result. A result of null
indicates the term is false. An empty term indicates the the term is truefeatures
- the varialbe names and values to resolve withcoerceUndefinedToFalse
- if true, undefined features will be treated as falsepublic BooleanTerm andWith(BooleanTerm other)
other
- the term to and this term with.public String toString()
toString
in class AbstractCollection<BooleanVar>
public boolean add(BooleanVar object)
add
in interface Collection<BooleanVar>
add
in interface Set<BooleanVar>
add
in class HashSet<BooleanVar>
public void clear()
clear
in interface Collection<BooleanVar>
clear
in interface Set<BooleanVar>
clear
in class HashSet<BooleanVar>
public boolean remove(Object object)
remove
in interface Collection<BooleanVar>
remove
in interface Set<BooleanVar>
remove
in class HashSet<BooleanVar>
public boolean removeAll(Collection<?> collection)
removeAll
in interface Collection<BooleanVar>
removeAll
in interface Set<BooleanVar>
removeAll
in class AbstractSet<BooleanVar>
public boolean addAll(Collection<? extends BooleanVar> collection)
addAll
in interface Collection<BooleanVar>
addAll
in interface Set<BooleanVar>
addAll
in class AbstractCollection<BooleanVar>
public boolean retainAll(Collection<?> collection)
retainAll
in interface Collection<BooleanVar>
retainAll
in interface Set<BooleanVar>
retainAll
in class AbstractCollection<BooleanVar>
public int hashCode()
hashCode
in interface Collection<BooleanVar>
hashCode
in interface Set<BooleanVar>
hashCode
in class AbstractSet<BooleanVar>
public boolean equals(Object other)
equals
in interface Collection<BooleanVar>
equals
in interface Set<BooleanVar>
equals
in class AbstractSet<BooleanVar>
Copyright © 2011-2015 IBM. All Rights Reserved.