|
|||||||||||
| 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
| Field Summary | |
protected boolean |
finalLegalValues
|
protected boolean |
hasOrdering
|
protected static int |
lastUid
|
protected java.util.Vector |
legalValues
|
protected ValueBinding |
legalValuesBinding
|
protected java.util.Vector |
likelyValues
|
protected ValueBinding |
likelyValuesBinding
|
protected int |
maxNumLegalValues
|
protected boolean |
nullLegal
|
protected int |
typicalIndexLength
|
protected int |
uid
|
| Fields inherited from class edu.washington.cs.supple.rep.SuppleBeanImpl |
pcs |
| Constructor Summary | |
BaseType()
|
|
BaseType(java.util.Collection likelyValues)
|
|
BaseType(java.util.Collection likelyValues,
java.util.Collection legalValues)
|
|
BaseType(java.lang.Object[] likelyValues,
java.lang.Object[] legalValues)
|
|
BaseType(ValueBinding likelyValues,
ValueBinding legalValues)
|
|
| Method Summary | |
void |
accept(UiVisitor visitor)
Visitor pattern. |
void |
addLegalValue(java.lang.Object v)
Lets you add a legal value for this type instance |
protected boolean |
addLegalValueHelper(java.lang.Object v)
Adds a legal value without sending out any notifications |
void |
addLegalValues(java.util.Collection vals)
Lets you add a bunch of legal values at once for this type instance |
void |
addLikelyValue(java.lang.Object v)
Adds a new value to the list of likely values and fires property change notification if the list really changed |
protected boolean |
addLikelyValueHelper(java.lang.Object v)
A helper function that adds a new value at the beginning of th elist and creates the storage object but does not fire property change; |
void |
bindLegalValues(ValueBinding binding)
|
void |
bindLikelyValues(ValueBinding binding)
|
protected void |
ensureLegalValues()
To be overriden by enumerable types that dynamically change the set of legal values. |
boolean |
equals(java.lang.Object o)
Equality test is based on the unique id assigned to each instance of the BaseType |
java.lang.String |
getIndex(java.lang.Object value,
int maxLength)
Returns a version of the index that is no longer than the specified maximum |
java.util.Vector |
getLegalValues()
|
java.util.Vector |
getLikelyValues()
|
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 |
getMaxNumLegalValues()
|
int |
getNumLegalValues()
For enumerable types, returns the number of legal values; throws UnsupportedOperationException otherwise |
int |
getNumLikelyValues()
|
int |
getTypicalIndexLength()
Returns the typical lenght of the index |
int |
getUniqueId()
Returns a unique id of this instantiation. |
int |
hashCode()
Hashcode is a function of the uid |
boolean |
hasOrdering()
This method returns true if there exists a natural ordering on the values of this type; false otherwise; |
boolean |
hasSetLegalValues()
|
abstract boolean |
isEnumerable()
This method tells you if possible values for this type can be (reasonably) enumerated |
boolean |
isFinalLegalValues()
Returns true if the legal values are guaranteed not to change throughout the duration of this run time |
boolean |
isLegalValue(java.lang.Object value)
Check if a value is legal for this type. |
java.util.Vector |
orderValues(java.util.Vector v)
This method enforces type-specific ordering on values (can only be legally invoked if hasOrdering() returns true) |
void |
setFinalLegalValues(boolean b)
|
void |
setLegalValues(java.util.Collection c)
Lets you set the legal values for this type instance |
void |
setLikelyValues(java.util.Collection c)
Sets the list of likely values |
void |
setMaxNumLegalValues(int v)
|
void |
setTypicalIndexLength(int i)
Allows you to specify the typical lenght of an index for any value of this type |
java.lang.String |
toPrettyString(java.lang.String pref)
|
java.lang.String |
toString()
|
void |
valueChanged(ValueBinding binding,
java.lang.Object value)
Signals variable change. |
java.lang.Object |
verifyCurrentValue(java.lang.Object value)
(non-Javadoc) The default implementation of this method: it returns the value if it is legal, and null otherwise. |
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.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 |
getIndex, hasIndex, isLegalValueClass, isPrimitiveType |
| Methods inherited from interface edu.washington.cs.supple.rep.SuppleBean |
addPropertyChangeListener, removePropertyChangeListener |
| Field Detail |
protected int uid
protected static int lastUid
protected java.util.Vector likelyValues
protected java.util.Vector legalValues
protected int maxNumLegalValues
protected boolean finalLegalValues
protected boolean nullLegal
protected int typicalIndexLength
protected boolean hasOrdering
protected transient ValueBinding likelyValuesBinding
protected transient ValueBinding legalValuesBinding
| Constructor Detail |
public BaseType()
public BaseType(java.util.Collection likelyValues)
likelyValues - a collection of initial likely values
public BaseType(java.util.Collection likelyValues,
java.util.Collection legalValues)
public BaseType(java.lang.Object[] likelyValues,
java.lang.Object[] legalValues)
public BaseType(ValueBinding likelyValues,
ValueBinding legalValues)
| Method Detail |
public void bindLikelyValues(ValueBinding binding)
public void bindLegalValues(ValueBinding binding)
public abstract boolean isEnumerable()
isEnumerable in interface SuppleTypepublic int getNumLegalValues()
getNumLegalValues in interface SuppleTypepublic int getMaxNumLegalValues()
getMaxNumLegalValues in interface SuppleTypepublic void setMaxNumLegalValues(int v)
public boolean hasSetLegalValues()
hasSetLegalValues in interface SuppleTypepublic boolean isFinalLegalValues()
SuppleType
isFinalLegalValues in interface SuppleTypepublic void setFinalLegalValues(boolean b)
public boolean isLegalValue(java.lang.Object value)
SuppleType
isLegalValue in interface SuppleTypevalue - value to be checked
public void setLegalValues(java.util.Collection c)
c - the collection of legal valuespublic void addLegalValues(java.util.Collection vals)
vals - new values to be addedpublic void addLegalValue(java.lang.Object v)
v - a new value to be addedprotected boolean addLegalValueHelper(java.lang.Object v)
v - value to be added
public boolean hasOrdering()
hasOrdering in interface SuppleTypepublic java.util.Vector orderValues(java.util.Vector v)
orderValues in interface SuppleTypev - values to be ordered
protected boolean addLikelyValueHelper(java.lang.Object v)
v - value to be added
public void addLikelyValue(java.lang.Object v)
v - the value to be addedpublic void setLikelyValues(java.util.Collection c)
c - the new list of likely valuespublic java.util.Vector getLikelyValues()
getLikelyValues in interface SuppleTypepublic int getNumLikelyValues()
getNumLikelyValues in interface SuppleTypepublic java.util.Vector getLegalValues()
getLegalValues in interface SuppleTypeprotected void ensureLegalValues()
public java.lang.String getIndex(java.lang.Object value,
int maxLength)
getIndex in interface SuppleTypemaxLength - the maximum length allowed for the index (in characters)
public int getTypicalIndexLength()
getTypicalIndexLength in interface SuppleTypepublic void setTypicalIndexLength(int i)
i - the typical lenght of an index (in characters)public java.lang.String getLongestLegalIndex()
getLongestLegalIndex in interface SuppleTypepublic int hashCode()
Object.hashCode()public boolean equals(java.lang.Object o)
public java.lang.String toString()
public java.lang.String toPrettyString(java.lang.String pref)
toPrettyString in interface SuppleTypepublic java.lang.Object verifyCurrentValue(java.lang.Object value)
verifyCurrentValue in interface SuppleTypevalue - value to be verified
public void valueChanged(ValueBinding binding,
java.lang.Object value)
ValueListener
valueChanged in interface ValueListenerbinding - value - public int getUniqueId()
SuppleType
getUniqueId in interface SuppleTypepublic void accept(UiVisitor visitor)
SuppleType
accept in interface SuppleTypeprotected void visitBoundProperties(UiVisitor visitor)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||