Packagecom.threerings.util
Classpublic class ByteEnum
InheritanceByteEnum Inheritance Enum

An enum value that can be persisted as a byte. On the Java side this is an interface, because all Enum classes are final. But here, we can just let you extend ByteEnum and get in on the goodness from the ground floor! Please follow all other conventions as specified in our Enum class.



Protected Properties
 PropertyDefined by
  _code : int
The byte value of this ByteEnum.
ByteEnum
 Inherited_name : String
The String name of this enum value.
Enum
Public Methods
 MethodDefined by
  
ByteEnum(name:String, code:int)
Call this constructor from your subclass' constructor.
ByteEnum
 Inherited
compareTo(other:Object):int
Enum
 Inherited
equals(other:Object):Boolean
Enum
  
fromByte(clazz:Class, code:int):ByteEnum
[static] Returns the enum value with the specified code in the supplied enum class.
ByteEnum
 Inherited
hashCode():int
Enum
 Inherited
name():String
Get the name of this enum.
Enum
 Inherited
ordinal():int
Get the ordinal of this enum.
Enum
  
toByte():int
Return the byte form of this enum.
ByteEnum
 Inherited
toString():String
Return the String representation of this enum.
Enum
 Inherited
valueOf():Object
Return the primitive value of this Object.
Enum
 Inherited
values(clazz:Class):Array
[static] Get all the enums of the specified class, or null if it's not an enum.
Enum
Protected Methods
 MethodDefined by
 Inherited
finishedEnumerating(clazz:Class):void
[static] This should be called by your enum subclass after you've finished enumating the enum constants.
Enum
Property detail
_codeproperty
protected var _code:int

The byte value of this ByteEnum.

Constructor detail
ByteEnum()constructor
public function ByteEnum(name:String, code:int)

Call this constructor from your subclass' constructor. Note that we do not verify that you're using a valid byte, or that you haven't assigned two enums to the same byte.

Parameters
name:String
 
code:int
Method detail
fromByte()method
public static function fromByte(clazz:Class, code:int):ByteEnum

Returns the enum value with the specified code in the supplied enum class. Throws ArgumentError if the enum lacks a value that maps to the supplied code.

Parameters
clazz:Class
 
code:int

Returns
ByteEnum
toByte()method 
public final function toByte():int

Return the byte form of this enum.

Returns
int