|
|||||||||||
| 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.SimpleBeanType
| Field Summary | |
protected boolean |
finalLegalValues
|
protected boolean |
hasOrdering
|
protected static int |
lastUid
|
protected java.util.Vector |
legalValues
|
protected java.util.Vector |
likelyValues
|
protected int |
maxNumLegalValues
|
protected int |
typicalIndexLength
|
protected int |
uid
|
| Fields inherited from class edu.washington.cs.supple.rep.SuppleBeanImpl |
pcs |
| Constructor Summary | |
SimpleBeanType()
|
|
SimpleBeanType(java.util.Collection likelyValues)
|
|
SimpleBeanType(java.util.Collection likelyValues,
java.util.Collection legalValues)
|
|
SimpleBeanType(java.lang.Object[] likelyValues,
java.lang.Object[] legalValues)
|
|
| Method Summary | |
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; |
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)
|
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 |
hashCode()
Hashcode is a function of the uid |
abstract boolean |
hasIndex()
Index is a short unique summary of the value (which can be used for choosing present values, etc. |
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. |
protected abstract boolean |
isLegalValueType(java.lang.Object value)
Check if the value is of the correct type (used when setting legal values) |
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()
|
| 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, getUniqueId, isLegalValueClass, isPrimitiveType, verifyCurrentValue |
| Methods inherited from interface edu.washington.cs.supple.rep.SuppleBean |
addPropertyChangeListener, removePropertyChangeListener |
| Field Detail |
protected java.util.Vector likelyValues
protected transient int uid
protected static int lastUid
protected int maxNumLegalValues
protected boolean finalLegalValues
protected int typicalIndexLength
protected boolean hasOrdering
protected java.util.Vector legalValues
| Constructor Detail |
public SimpleBeanType()
public SimpleBeanType(java.util.Collection likelyValues)
likelyValues - a collection of initial likely values
public SimpleBeanType(java.util.Collection likelyValues,
java.util.Collection legalValues)
public SimpleBeanType(java.lang.Object[] likelyValues,
java.lang.Object[] legalValues)
| Method Detail |
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
protected abstract boolean isLegalValueType(java.lang.Object value)
value - 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 abstract boolean hasIndex()
hasIndex in interface SuppleTypepublic java.lang.String getIndex(java.lang.Object value)
getIndex in interface SuppleType
public java.lang.String getIndex(java.lang.Object value,
int maxLength)
getIndex in interface SuppleTypemaxLength - the maximum lenght 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 SuppleType
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||