org.springframework.core.enums
Class ShortCodedLabeledEnum

java.lang.Object
  extended by org.springframework.core.enums.AbstractLabeledEnum
      extended by org.springframework.core.enums.ShortCodedLabeledEnum
All Implemented Interfaces:
Serializable, Comparable, LabeledEnum

public class ShortCodedLabeledEnum
extends AbstractLabeledEnum

Implementation of LabeledEnum which uses Short as the code type.

Should almost always be subclassed, but for some simple situations it may be used directly. Note that you will not be able to use unique type-based functionality like LabeledEnumResolver.getLabeledEnumSet(type) in this case.

Since:
1.2.2
Author:
Keith Donald
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.springframework.core.enums.LabeledEnum
CODE_ORDER, DEFAULT_ORDER, LABEL_ORDER
 
Constructor Summary
ShortCodedLabeledEnum(int code, String label)
          Create a new ShortCodedLabeledEnum instance.
 
Method Summary
 Comparable getCode()
          This abstract method declaration shadows the method in the LabeledEnum interface.
 short getShortCode()
          Return the short code of this LabeledEnum instance.
 
Methods inherited from class org.springframework.core.enums.AbstractLabeledEnum
compareTo, equals, getLabel, getType, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ShortCodedLabeledEnum

public ShortCodedLabeledEnum(int code,
                             String label)
Create a new ShortCodedLabeledEnum instance.

Parameters:
code - the short code
label - the label (can be null)
Method Detail

getCode

public Comparable getCode()
Description copied from class: AbstractLabeledEnum
This abstract method declaration shadows the method in the LabeledEnum interface. This is necessary to properly work on Sun's JDK 1.3 classic VM in all cases.

Specified by:
getCode in interface LabeledEnum
Specified by:
getCode in class AbstractLabeledEnum

getShortCode

public short getShortCode()
Return the short code of this LabeledEnum instance.



Copyright (c) 2002-2005 The Spring Framework Project.