fulmine
Class Type

java.lang.Object
  extended by fulmine.Type
All Implemented Interfaces:
IType

public final class Type
extends Object
implements IType

A standard IType implementation backed by an IAutoCreatingStore that returns canonical IType instances.

The standard types for the framework are defined and accessible as static member variables (e.g. LONG_FIELD).

Use the Type#get(byte) factory method to obtain an instance. Any user defined types must start from BASE_USER_START.

Author:
Ramon Servadei

Field Summary
static int BASE_USER_START
          The starting type value for user defined types.
static IType BOOLEAN_FIELD
          The type value for a boolean component.
static IType CONTAINER_DEFINITION
          The type value for a container definition component.
static IType DESCRIPTOR_FIELD
          The type value for a descriptor component.
static IType DOUBLE_FIELD
          The type value for a double component.
static IType FLOAT_FIELD
          The type value for a float component.
static IType INTEGER_FIELD
          The type value for an integer component.
static IType LONG_FIELD
          The type value for a long component.
static IType RECORD
          The type value for a record component.
static IType REMOVED
          Represents a 'removed' type
static IType STRING_FIELD
          The type value for a string component.
static IType SYSTEM
          The type value for a system level component.
static IType UNSPECIFIED_TYPE
          Represents an unspecified type
 
Method Summary
 boolean equals(Object obj)
           
static IType get(int code, String... name)
          Factory method to obtain a sharable, immutable Type instance.
 String getName()
          Get the name for the type.
 int hashCode()
           
 String toString()
           
 byte value()
          Get a byte representing the type component for the entity.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

UNSPECIFIED_TYPE

public static final IType UNSPECIFIED_TYPE
Represents an unspecified type


REMOVED

public static final IType REMOVED
Represents a 'removed' type


SYSTEM

public static final IType SYSTEM
The type value for a system level component.


CONTAINER_DEFINITION

public static final IType CONTAINER_DEFINITION
The type value for a container definition component. This is also the wire-code for the ContainerDefinitionField.


BOOLEAN_FIELD

public static final IType BOOLEAN_FIELD
The type value for a boolean component.


INTEGER_FIELD

public static final IType INTEGER_FIELD
The type value for an integer component.


LONG_FIELD

public static final IType LONG_FIELD
The type value for a long component.


FLOAT_FIELD

public static final IType FLOAT_FIELD
The type value for a float component.


DOUBLE_FIELD

public static final IType DOUBLE_FIELD
The type value for a double component.


STRING_FIELD

public static final IType STRING_FIELD
The type value for a string component.


DESCRIPTOR_FIELD

public static final IType DESCRIPTOR_FIELD
The type value for a descriptor component.


RECORD

public static final IType RECORD
The type value for a record component.


BASE_USER_START

public static final int BASE_USER_START
The starting type value for user defined types.

Method Detail

get

public static final IType get(int code,
                              String... name)
Factory method to obtain a sharable, immutable Type instance.

Parameters:
code - the code for the type (a byte)
name - the name for the type, optional. This is only set on the first call for each code. If no name is supplied on the first call, the type will have no name, irrespective of subsequent calls.
Returns:
a sharable, immutable IType instance representing the code.

value

public byte value()
Description copied from interface: IType
Get a byte representing the type component for the entity.

Specified by:
value in interface IType
Returns:
a byte representing the type component for the entity

getName

public String getName()
Description copied from interface: IType
Get the name for the type.

Specified by:
getName in interface IType
Returns:
the name for the type

toString

public final String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object


Copyright © 2007-2009. All Rights Reserved.