edu.washington.cs.supple.rep
Class BooleanTypeImpl
java.lang.Object
edu.washington.cs.supple.rep.SuppleBeanImpl
edu.washington.cs.supple.rep.BaseType
edu.washington.cs.supple.rep.SimpleValueTypeImpl
edu.washington.cs.supple.rep.BooleanTypeImpl
- All Implemented Interfaces:
- BooleanType, java.lang.Cloneable, java.io.Serializable, SimpleValueType, SuppleBean, SuppleType, ValueListener
- public final class BooleanTypeImpl
- extends SimpleValueTypeImpl
- implements BooleanType
- Author:
- kgajos
Represents the boolean type
- See Also:
- Serialized Form
| Fields inherited from class edu.washington.cs.supple.rep.BaseType |
finalLegalValues, hasOrdering, lastUid, legalValues, legalValuesBinding, likelyValues, likelyValuesBinding, maxNumLegalValues, nullLegal, typicalIndexLength, uid |
|
Method Summary |
protected void |
ensureLegalValues()
To be overriden by enumerable types that dynamically change the set of
legal values. |
java.lang.String |
getIndex(java.lang.Object value)
|
int |
getNumLegalValues()
For enumerable types, returns the number of legal values; throws
UnsupportedOperationException otherwise |
boolean |
hasOrdering()
We assume that it is natural to present true then false |
boolean |
isEnumerable()
This method tells you if possible values for this type can be
(reasonably) enumerated |
boolean |
isLegalValueClass(java.lang.Class c)
Check if a class is legal for this type. |
void |
setIndexLabels(java.lang.String trueValue,
java.lang.String falseValue,
java.lang.String unknownValue)
Set labels for the values. |
java.lang.String |
toPrettyString(java.lang.String pref)
|
java.lang.String |
toString()
|
| Methods inherited from class edu.washington.cs.supple.rep.BaseType |
accept, addLegalValue, addLegalValueHelper, addLegalValues, addLikelyValue, addLikelyValueHelper, bindLegalValues, bindLikelyValues, equals, getIndex, getLegalValues, getLikelyValues, getLongestLegalIndex, getMaxNumLegalValues, getNumLikelyValues, getTypicalIndexLength, getUniqueId, hashCode, hasSetLegalValues, isFinalLegalValues, isLegalValue, orderValues, setFinalLegalValues, setLegalValues, setLikelyValues, setMaxNumLegalValues, setTypicalIndexLength, valueChanged, verifyCurrentValue, visitBoundProperties |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface edu.washington.cs.supple.rep.SuppleType |
accept, getIndex, getLegalValues, getLikelyValues, getLongestLegalIndex, getMaxNumLegalValues, getNumLikelyValues, getTypicalIndexLength, getUniqueId, hasIndex, hasSetLegalValues, isFinalLegalValues, isLegalValue, isPrimitiveType, orderValues, verifyCurrentValue |
BooleanTypeImpl
public BooleanTypeImpl()
isEnumerable
public boolean isEnumerable()
- Description copied from interface:
SuppleType
- This method tells you if possible values for this type can be
(reasonably) enumerated
- Specified by:
isEnumerable in interface SuppleType- Specified by:
isEnumerable in class BaseType
ensureLegalValues
protected void ensureLegalValues()
- Description copied from class:
BaseType
- To be overriden by enumerable types that dynamically change the set of
legal values. Inside this method you should set the value of legalValues
field.
- Overrides:
ensureLegalValues in class BaseType
getNumLegalValues
public int getNumLegalValues()
- Description copied from interface:
SuppleType
- For enumerable types, returns the number of legal values; throws
UnsupportedOperationException otherwise
- Specified by:
getNumLegalValues in interface SuppleType- Overrides:
getNumLegalValues in class BaseType
toString
public java.lang.String toString()
- Overrides:
toString in class BaseType
toPrettyString
public java.lang.String toPrettyString(java.lang.String pref)
- Specified by:
toPrettyString in interface SuppleType- Overrides:
toPrettyString in class BaseType
hasOrdering
public boolean hasOrdering()
- We assume that it is natural to present true then false
- Specified by:
hasOrdering in interface SuppleType- Overrides:
hasOrdering in class BaseType
- Returns:
- true
setIndexLabels
public void setIndexLabels(java.lang.String trueValue,
java.lang.String falseValue,
java.lang.String unknownValue)
- Set labels for the values.
getIndex
public java.lang.String getIndex(java.lang.Object value)
- Specified by:
getIndex in interface SuppleType- Overrides:
getIndex in class SimpleValueTypeImpl
isLegalValueClass
public boolean isLegalValueClass(java.lang.Class c)
- Description copied from interface:
SuppleType
- Check if a class is legal for this type.
- Specified by:
isLegalValueClass in interface SuppleType
- Parameters:
c -
- Returns: