org.apache.cocoon.util
Class EnumerationFactory

java.lang.Object
  |
  +--org.apache.cocoon.util.EnumerationFactory
Direct Known Subclasses:
ValidatorActionResult

public class EnumerationFactory
extends java.lang.Object

Version:
1.1 A factory for the creation of enumeration types (missing in Java). The same operations are provided as for Ada, only representation specification is missing (which does not seem to make much sense in Java). Enumeration classes are to be derived from this class thereby making the constructors private to inhibit creation outside of the derived class.
Author:
Christoph Grein

Constructor Summary
EnumerationFactory()
           
EnumerationFactory(java.lang.String image)
          Constructors with and without a string representation (image).
 
Method Summary
 boolean ge(EnumerationFactory enum)
           
static EnumerationFactory getFirst()
           
static EnumerationFactory getLast()
           
 EnumerationFactory getNext()
           
static EnumerationFactory getObject(java.lang.String image)
           
 int getPos()
          Access to the numeric representation.
 EnumerationFactory getPrev()
           
static EnumerationFactory getVal(int value)
           
 boolean gt(EnumerationFactory enum)
           
 boolean le(EnumerationFactory enum)
           
 boolean lt(EnumerationFactory enum)
          Order relations Object.op (OtherObject) representing the relation Object op OtherObject.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EnumerationFactory

public EnumerationFactory(java.lang.String image)
Constructors with and without a string representation (image). Make constructors private upon derivation. Be careful: No check is made that the image string is unique!
Parameters:
image -  

EnumerationFactory

public EnumerationFactory()
Method Detail

lt

public boolean lt(EnumerationFactory enum)
Order relations Object.op (OtherObject) representing the relation Object op OtherObject.
Parameters:
enum - the right operand

le

public boolean le(EnumerationFactory enum)

gt

public boolean gt(EnumerationFactory enum)

ge

public boolean ge(EnumerationFactory enum)

getPos

public int getPos()
Access to the numeric representation.
Parameters:
value - the numeric value

getVal

public static EnumerationFactory getVal(int value)

getFirst

public static EnumerationFactory getFirst()

getLast

public static EnumerationFactory getLast()

getNext

public EnumerationFactory getNext()

getPrev

public EnumerationFactory getPrev()

toString

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

getObject

public static EnumerationFactory getObject(java.lang.String image)


Copyright © 1999-2002 Apache Software Foundation. All Rights Reserved.