anvil.annot
Class ValueSetType

java.lang.Object
  |
  +--anvil.annot.ValueType
        |
        +--anvil.annot.ValueSetType
Direct Known Subclasses:
ValueNamedSetType, ValueSetNoEmptyType

public class ValueSetType
extends ValueType

Those attribute values that have a fixed set of values (all Strings).


Field Summary
protected  java.util.Hashtable tokenColor
           
protected  java.util.Hashtable tokenDoc
           
protected  java.lang.String[] tokens
           
 
Fields inherited from class anvil.annot.ValueType
NULL_VALUE, NULL_VALUE_DOC
 
Constructor Summary
ValueSetType(java.util.List values)
           
ValueSetType(ValueSetType vt)
           
 
Method Summary
 boolean changeToken(int i, java.lang.String label)
           
 void changeTokenColor(int i, java.awt.Color col)
           
 void clear()
           
 java.util.Hashtable getTokenColors()
           
 java.util.Hashtable getTokenDocs()
           
 int getTokenIndex(java.lang.String token)
          Returns internal index number of token or 0 ("none") if token does not exist.
 java.lang.String[] getTokens()
           
 java.lang.String[] getTokensWithoutNull()
          Returns token list without the "none" value.
 java.awt.Color getValueColor(java.lang.String val)
           
 java.lang.String getValueDoc(java.lang.String val)
          Returns empty string if there is no doc.
 boolean hasDoc()
          Returns true if there is at least one definition of a token.
 boolean hasDoc(java.lang.String token)
           
 boolean isValidValue(java.lang.Object val)
           
 boolean tokenExistis(java.lang.String token)
           
 java.lang.String toLabel()
          Returns the name of this value type as a string.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

tokens

protected java.lang.String[] tokens

tokenColor

protected java.util.Hashtable tokenColor

tokenDoc

protected java.util.Hashtable tokenDoc
Constructor Detail

ValueSetType

public ValueSetType(java.util.List values)
Parameters:
values - List of three-element arrays (String[3]), first one is a token, second the color, third the doc.

ValueSetType

public ValueSetType(ValueSetType vt)
Method Detail

getTokenColors

public java.util.Hashtable getTokenColors()

getTokenDocs

public java.util.Hashtable getTokenDocs()

getTokens

public java.lang.String[] getTokens()

tokenExistis

public boolean tokenExistis(java.lang.String token)

changeTokenColor

public void changeTokenColor(int i,
                             java.awt.Color col)

changeToken

public boolean changeToken(int i,
                           java.lang.String label)

clear

public void clear()

getTokensWithoutNull

public java.lang.String[] getTokensWithoutNull()
Returns token list without the "none" value.


isValidValue

public boolean isValidValue(java.lang.Object val)
Specified by:
isValidValue in class ValueType

getTokenIndex

public int getTokenIndex(java.lang.String token)
Returns internal index number of token or 0 ("none") if token does not exist.


getValueColor

public java.awt.Color getValueColor(java.lang.String val)

getValueDoc

public java.lang.String getValueDoc(java.lang.String val)
Returns empty string if there is no doc.


hasDoc

public boolean hasDoc()
Returns true if there is at least one definition of a token.


hasDoc

public boolean hasDoc(java.lang.String token)

toLabel

public java.lang.String toLabel()
Description copied from class: ValueType
Returns the name of this value type as a string.

Specified by:
toLabel in class ValueType

toString

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