com.xerox.bantam
Class EnumeratedType

java.lang.Object
  |
  +--com.xerox.bantam.ClassTypeDescriptor
        |
        +--com.xerox.bantam.EnumeratedType
All Implemented Interfaces:
Serializable, TypeDescriptor

public class EnumeratedType
extends ClassTypeDescriptor

TypeDescriptor for value types that are particular enumerated subsets of values of a Java class.

Version:
$Revision: 1.4 $, $Date: 2000/03/14 18:31:59 $
Author:
Tom Rodriguez
See Also:
Serialized Form

Field Summary
protected  ArrayList members
          The values in this enumerated type.
 
Fields inherited from class com.xerox.bantam.ClassTypeDescriptor
clazz
 
Constructor Summary
EnumeratedType(Class clazz)
           
 
Method Summary
 void addValue(Object member)
           
 boolean contains(Object item)
          return true if the item is in the type
 String description()
          return a string describing the possible values, suitable for an error message or other guidance to the user
 Object parse(String name)
          Try to do something reasonable with the string passed in.
 Collection possibleValues()
          return null if the possible values can't be enumerated.
 String toString()
           
 
Methods inherited from class com.xerox.bantam.ClassTypeDescriptor
equals, getBaseType, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

members

protected ArrayList members
The values in this enumerated type.
Constructor Detail

EnumeratedType

public EnumeratedType(Class clazz)
Method Detail

contains

public boolean contains(Object item)
Description copied from class: ClassTypeDescriptor
return true if the item is in the type
Overrides:
contains in class ClassTypeDescriptor

possibleValues

public Collection possibleValues()
Description copied from class: ClassTypeDescriptor
return null if the possible values can't be enumerated.
Overrides:
possibleValues in class ClassTypeDescriptor

description

public String description()
Description copied from class: ClassTypeDescriptor
return a string describing the possible values, suitable for an error message or other guidance to the user
Overrides:
description in class ClassTypeDescriptor

parse

public Object parse(String name)
Description copied from class: ClassTypeDescriptor
Try to do something reasonable with the string passed in. return null if that is not possible
Overrides:
parse in class ClassTypeDescriptor

addValue

public void addValue(Object member)

toString

public String toString()
Overrides:
toString in class ClassTypeDescriptor

Project Harland