edu.washington.cs.supple.rep
Class StringTypeImpl

java.lang.Object
  extended byedu.washington.cs.supple.rep.SuppleBeanImpl
      extended byedu.washington.cs.supple.rep.BaseType
          extended byedu.washington.cs.supple.rep.SimpleValueTypeImpl
              extended byedu.washington.cs.supple.rep.StringTypeImpl
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable, SimpleValueType, StringType, SuppleBean, SuppleType, ValueListener
Direct Known Subclasses:
FileType

public class StringTypeImpl
extends SimpleValueTypeImpl
implements StringType

Author:
kgajos
See Also:
Serialized Form

Field Summary
protected  int typicalValueLength
           
 
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
StringTypeImpl()
           
StringTypeImpl(java.util.Collection likelyValues)
           
StringTypeImpl(java.util.Collection likelyValues, java.util.Collection legalValues)
           
StringTypeImpl(java.util.Collection likelyValues, java.util.Collection legalValues, boolean finalDomain)
           
StringTypeImpl(java.lang.Object[] likelyValues, java.lang.Object[] legalValues)
           
StringTypeImpl(java.lang.Object[] likelyValues, java.lang.Object[] legalValues, boolean finalDomain)
           
StringTypeImpl(ValueBinding likelyVals, ValueBinding legalVals)
           
 
Method Summary
 void enableAlphabeticalOrdering(boolean b)
          If set to true, the legal and likely values will be kept in alphabetical order; by default this is set to false
 int getTypicalIndexLength()
          Returns the typical lenght of the index
 int getTypicalValueLength()
           
 boolean isEnumerable()
          String type is enumerable if the set of allowed values has been set
 boolean isLegalValueClass(java.lang.Class c)
          Check if a class is legal for this type.
protected  boolean isLegalValueType(java.lang.Object value)
           
 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 setTypicalValueLength(int i)
           
 java.lang.String toString()
           
 
Methods inherited from class edu.washington.cs.supple.rep.SimpleValueTypeImpl
getIndex, hasIndex, isPrimitiveType
 
Methods inherited from class edu.washington.cs.supple.rep.BaseType
accept, addLegalValue, addLegalValueHelper, addLegalValues, addLikelyValue, addLikelyValueHelper, bindLegalValues, bindLikelyValues, ensureLegalValues, equals, getIndex, getLegalValues, getLikelyValues, getLongestLegalIndex, getMaxNumLegalValues, getNumLegalValues, getNumLikelyValues, getUniqueId, hashCode, hasOrdering, hasSetLegalValues, isFinalLegalValues, isLegalValue, setFinalLegalValues, setLegalValues, setLikelyValues, setMaxNumLegalValues, setTypicalIndexLength, toPrettyString, valueChanged, verifyCurrentValue, visitBoundProperties
 
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, getIndex, getLegalValues, getLikelyValues, getLongestLegalIndex, getMaxNumLegalValues, getNumLegalValues, getNumLikelyValues, getUniqueId, hasIndex, hasOrdering, hasSetLegalValues, isFinalLegalValues, isLegalValue, isPrimitiveType, toPrettyString, verifyCurrentValue
 
Methods inherited from interface edu.washington.cs.supple.rep.SuppleBean
addPropertyChangeListener, removePropertyChangeListener
 

Field Detail

typicalValueLength

protected int typicalValueLength
Constructor Detail

StringTypeImpl

public StringTypeImpl()

StringTypeImpl

public StringTypeImpl(java.util.Collection likelyValues)

StringTypeImpl

public StringTypeImpl(java.util.Collection likelyValues,
                      java.util.Collection legalValues)

StringTypeImpl

public StringTypeImpl(java.util.Collection likelyValues,
                      java.util.Collection legalValues,
                      boolean finalDomain)

StringTypeImpl

public StringTypeImpl(java.lang.Object[] likelyValues,
                      java.lang.Object[] legalValues,
                      boolean finalDomain)

StringTypeImpl

public StringTypeImpl(java.lang.Object[] likelyValues,
                      java.lang.Object[] legalValues)

StringTypeImpl

public StringTypeImpl(ValueBinding likelyVals,
                      ValueBinding legalVals)
Method Detail

isEnumerable

public boolean isEnumerable()
String type is enumerable if the set of allowed values has been set

Specified by:
isEnumerable in interface SuppleType
Specified by:
isEnumerable in class BaseType

enableAlphabeticalOrdering

public void enableAlphabeticalOrdering(boolean b)
If set to true, the legal and likely values will be kept in alphabetical order; by default this is set to false

Specified by:
enableAlphabeticalOrdering in interface StringType
Parameters:
b -

orderValues

public java.util.Vector orderValues(java.util.Vector v)
Description copied from interface: SuppleType
This method enforces type-specific ordering on values (can only be legally invoked if hasOrdering() returns true)

Specified by:
orderValues in interface SuppleType
Overrides:
orderValues in class BaseType
Parameters:
v - values to be ordered
Returns:
ordered vector of values

getTypicalValueLength

public int getTypicalValueLength()
Specified by:
getTypicalValueLength in interface StringType
Returns:
the expected lenght (in characters) of usual inputs

getTypicalIndexLength

public int getTypicalIndexLength()
Description copied from interface: SuppleType
Returns the typical lenght of the index

Specified by:
getTypicalIndexLength in interface SuppleType
Overrides:
getTypicalIndexLength in class BaseType
Returns:
typical index length (in characters)

setTypicalValueLength

public void setTypicalValueLength(int i)
Parameters:
i - the expected length (in characters) of usual inputs

isLegalValueType

protected boolean isLegalValueType(java.lang.Object value)

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:

toString

public java.lang.String toString()
Overrides:
toString in class BaseType