|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectedu.washington.cs.supple.rep.SuppleBeanImpl
edu.washington.cs.supple.rep.BaseType
edu.washington.cs.supple.rep.SimpleValueTypeImpl
edu.washington.cs.supple.rep.IntegerTypeImpl
| Field Summary | |
protected boolean |
exact
|
protected int |
increment
|
protected java.lang.String[] |
labels
|
protected java.lang.String |
longestLegalIndex
|
protected int |
max
|
protected ValueBinding |
maxBinding
|
protected int |
min
|
protected ValueBinding |
minBinding
|
| Fields inherited from class edu.washington.cs.supple.rep.BaseType |
finalLegalValues, hasOrdering, lastUid, legalValues, legalValuesBinding, likelyValues, likelyValuesBinding, maxNumLegalValues, nullLegal, typicalIndexLength, uid |
| Fields inherited from class edu.washington.cs.supple.rep.SuppleBeanImpl |
pcs |
| Constructor Summary | |
IntegerTypeImpl(boolean exact)
|
|
IntegerTypeImpl(int min,
int max,
java.util.Collection likelyValues,
boolean exact)
|
|
IntegerTypeImpl(int min,
int max,
int increment,
java.util.Collection likelyValues,
boolean exact)
|
|
| Method Summary | |
void |
bindMax(ValueBinding binding)
Set max value |
void |
bindMin(ValueBinding binding)
|
protected void |
ensureLegalValues()
To be overriden by enumerable types that dynamically change the set of legal values. |
int |
getIncrement()
|
java.lang.String |
getIndex(java.lang.Object value)
If labels are set, getIndex will return the labels instead of integers. |
java.lang.Integer |
getIntegerValue(StateVar uiObject)
|
java.lang.String |
getLongestLegalIndex()
If the type is enumerable, this method will scan through all legal values and return the longest index it finds; if the type is not enumerable, no guarantees are given for the result |
int |
getMax()
|
int |
getMin()
|
int |
getNumLegalValues()
For enumerable types, returns the number of legal values; throws UnsupportedOperationException otherwise |
int |
getTypicalIndexLength()
Returns the typical lenght of the index |
boolean |
hasOrdering()
This method returns true if there exists a natural ordering on the values of this type; false otherwise; |
boolean |
isBounded()
Checks if the type has both an upper and lower bound set |
boolean |
isEnumerable()
We say that an Integer type is reasonably enumerable if it has fewer than a hundred legal values |
boolean |
isExact()
|
boolean |
isLegalValue(java.lang.Object value)
Check if a value is legal for this type. |
boolean |
isLegalValueClass(java.lang.Class c)
Check if a class is legal for this type. |
protected boolean |
isWithinRange(int i)
|
void |
setExact(boolean b)
|
void |
setIndexLabels(java.lang.String[] labels)
For types with bounded legal values, sets index labels. |
void |
setMax(int newMax)
|
void |
setMin(int newMin)
|
java.lang.String |
toPrettyString(java.lang.String pref)
|
java.lang.String |
toString()
|
void |
valueChanged(ValueBinding binding,
java.lang.Object value)
Signals variable change. |
protected boolean |
verifyLegalValuesChangeable(java.lang.String nameOfAttemptedOperation)
|
protected void |
visitBoundProperties(UiVisitor visitor)
Helper for accept() - allows subclasses to extend the bindings to be visited without overriding accept(). |
| Methods inherited from class edu.washington.cs.supple.rep.SimpleValueTypeImpl |
hasIndex, isPrimitiveType |
| Methods inherited from class edu.washington.cs.supple.rep.BaseType |
accept, addLegalValue, addLegalValueHelper, addLegalValues, addLikelyValue, addLikelyValueHelper, bindLegalValues, bindLikelyValues, equals, getIndex, getLegalValues, getLikelyValues, getMaxNumLegalValues, getNumLikelyValues, getUniqueId, hashCode, hasSetLegalValues, isFinalLegalValues, orderValues, setFinalLegalValues, setLegalValues, setLikelyValues, setMaxNumLegalValues, setTypicalIndexLength, verifyCurrentValue |
| Methods inherited from class edu.washington.cs.supple.rep.SuppleBeanImpl |
addPropertyChangeListener, removePropertyChangeListener |
| 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, getMaxNumLegalValues, getNumLikelyValues, getUniqueId, hasIndex, hasSetLegalValues, isFinalLegalValues, isPrimitiveType, orderValues, verifyCurrentValue |
| Methods inherited from interface edu.washington.cs.supple.rep.SuppleBean |
addPropertyChangeListener, removePropertyChangeListener |
| Field Detail |
protected int min
protected int max
protected transient ValueBinding maxBinding
protected transient ValueBinding minBinding
protected java.lang.String[] labels
protected java.lang.String longestLegalIndex
protected int increment
protected boolean exact
| Constructor Detail |
public IntegerTypeImpl(int min,
int max,
int increment,
java.util.Collection likelyValues,
boolean exact)
min - the minimum value for this instancemax - the maximum value for this instanceincrement - the incrementlikelyValues - the set of most likely values (null or empty collection for
none)exact - indicates whether or not it matters for the application that
the user should be able to set the value exactly
public IntegerTypeImpl(int min,
int max,
java.util.Collection likelyValues,
boolean exact)
min - the minimum value for this instancemax - the maximum value for this instancelikelyValues - the set of most likely values (null or empty collection for
none)exact - indicates whether or not it matters for the application that
the user should be able to set the value exactlypublic IntegerTypeImpl(boolean exact)
exact - indicates whether or not it matters for the application that
the user should be able to set the value exactly| Method Detail |
public int getMax()
getMax in interface IntegerTypepublic void setMax(int newMax)
public void bindMax(ValueBinding binding)
binding - public int getMin()
getMin in interface IntegerTypepublic void setMin(int newMin)
public void bindMin(ValueBinding binding)
public int getIncrement()
getIncrement in interface IntegerTypeprotected boolean verifyLegalValuesChangeable(java.lang.String nameOfAttemptedOperation)
public int getNumLegalValues()
SuppleType
getNumLegalValues in interface SuppleTypegetNumLegalValues in class BaseTypeprotected void ensureLegalValues()
BaseType
ensureLegalValues in class BaseTypepublic boolean isEnumerable()
isEnumerable in interface SuppleTypeisEnumerable in class BaseTypepublic java.lang.String toString()
toString in class BaseTypepublic java.lang.String toPrettyString(java.lang.String pref)
toPrettyString in interface SuppleTypetoPrettyString in class BaseTypepublic boolean isExact()
isExact in interface IntegerTypepublic boolean isBounded()
IntegerType
isBounded in interface IntegerTypepublic void setExact(boolean b)
b - true if this type expects exact values, false otherwisepublic boolean hasOrdering()
SuppleType
hasOrdering in interface SuppleTypehasOrdering in class BaseTypepublic java.lang.String getLongestLegalIndex()
SuppleType
getLongestLegalIndex in interface SuppleTypegetLongestLegalIndex in class BaseTypepublic void setIndexLabels(java.lang.String[] labels)
labels -
public int getTypicalIndexLength()
SuppleType
getTypicalIndexLength in interface SuppleTypegetTypicalIndexLength in class BaseTypepublic java.lang.String getIndex(java.lang.Object value)
getIndex in interface SuppleTypegetIndex in class SimpleValueTypeImplprotected boolean isWithinRange(int i)
public boolean isLegalValueClass(java.lang.Class c)
SuppleType
isLegalValueClass in interface SuppleTypec -
public java.lang.Integer getIntegerValue(StateVar uiObject)
getIntegerValue in interface IntegerTypepublic boolean isLegalValue(java.lang.Object value)
SuppleType
isLegalValue in interface SuppleTypeisLegalValue in class BaseType
public void valueChanged(ValueBinding binding,
java.lang.Object value)
ValueListener
valueChanged in interface ValueListenervalueChanged in class BaseTypeprotected void visitBoundProperties(UiVisitor visitor)
BaseType
visitBoundProperties in class BaseType
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||