story.dbcore.admin
Class CommandType

java.lang.Object
  extended by story.dbcore.admin.CommandType
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable, GenericType, RenderableObject

public class CommandType
extends java.lang.Object
implements GenericType, java.lang.Comparable, java.io.Serializable, RenderableObject

Manually implemented enum for types. Allows classes to specify types to one another by passing one of the fields of this class rather than a string. No public constructor.

Based (loosely) on http://xoot.org/index.php?name=Java+enum+classes

See Also:
Serialized Form

Field Summary
static CommandType AreRelatedDirectly
           
static CommandType AreRelatedIndirectly
           
static CommandType CloseDocument
           
static CommandType CommandHistory
           
static CommandType CoreBrowser
           
static CommandType FindNode
           
static CommandType Generate
           
static CommandType GetCommandHistory
           
static CommandType GetLinksFromNode
           
static CommandType GetLinksToNode
           
static CommandType GetLinkVias
           
static CommandType GetNode
           
static CommandType GetNodeAttribute
           
static CommandType GetNodeAttributeIDs
           
static CommandType GetNodeDefinition
           
static CommandType GetNodeProxy
           
static CommandType GetNodeType
           
static CommandType GetRepositoryType
           
static CommandType Link
           
static CommandType LinkInstancing
           
static CommandType ListRepositories
           
static CommandType MaxAttributeLength
           
static CommandType MoveNode
           
static CommandType NewDocument
           
static CommandType NewInstanceNode
           
static CommandType NewInstancing
           
static CommandType NewNode
           
static CommandType NewNodeAddress
           
static CommandType NewRepository
           
static CommandType NewSubtypeNode
           
static CommandType NodeAttributeEquals
           
static CommandType NodeAttributeGreaterThan
           
static CommandType NodeExists
           
static CommandType NodeRepositoryExists
           
static CommandType OpenDocument
           
static CommandType Query
           
static CommandType Reconstruct
           
static CommandType RedefineNode
           
static CommandType Redo
           
static CommandType RedoTo
           
static CommandType RemoveNode
           
static CommandType RemoveRepository
           
static CommandType RenameNode
           
static CommandType RenameRepository
           
static CommandType RenderDocument
           
static CommandType RenderNode
           
static CommandType RenderNodeAttributes
           
static CommandType RenderRawLinkTables
           
static CommandType RenderRepositoryContents
           
static CommandType Reset
           
static CommandType SetNodeAttribute
           
static CommandType TestSatisfaction
           
static CommandType Undo
           
static CommandType UndoTo
           
static CommandType Unlink
           
static CommandType UnlinkAllLinks
           
static CommandType UnlinkInstancing
           
static CommandType ValidateNodeInstancing
           
 
Method Summary
static java.lang.String capitalize(java.lang.String in)
           
 int compareTo(java.lang.Object other)
           
 boolean equals(java.lang.Object other)
          Tests if one instance is the same as some other.
static CommandType get(int number)
          Return the corresponding CommandType for the given Unique ID (see getUniqueID).
static CommandType get(java.lang.String string)
          Static version of get() that gets around the Java restriction on static types in interfaces.
static ImmutableHashSet getAllTypes()
          Return a HashSet of every item in the enumeration.
 ImmutableHashSet getAllTypesNonStatically()
          Return a HashSet of every item in the enumeration.
 GenericType getAsGeneric(java.lang.String string)
          Return the corresponding CommandType for the given string as a GenericType object.
 int getUniqueID()
          Get a unique numerial ID for this type that goes from 0 to (numMembers() - 1).
static int numMembers()
          Get the number of members of this type.
 java.lang.StringBuffer render()
          Return the string equivalent of the CommandType with the type type, formatted with the dot operator that the command interpreter understands.
 java.lang.String toString()
          Return the string equivalent of the CommandType.
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

AreRelatedDirectly

public static final CommandType AreRelatedDirectly

AreRelatedIndirectly

public static final CommandType AreRelatedIndirectly

CommandHistory

public static final CommandType CommandHistory

CoreBrowser

public static final CommandType CoreBrowser

CloseDocument

public static final CommandType CloseDocument

FindNode

public static final CommandType FindNode

Generate

public static final CommandType Generate

GetLinkVias

public static final CommandType GetLinkVias

GetLinksFromNode

public static final CommandType GetLinksFromNode

GetLinksToNode

public static final CommandType GetLinksToNode

GetCommandHistory

public static final CommandType GetCommandHistory

GetNode

public static final CommandType GetNode

GetNodeAttributeIDs

public static final CommandType GetNodeAttributeIDs

GetNodeAttribute

public static final CommandType GetNodeAttribute

GetNodeDefinition

public static final CommandType GetNodeDefinition

GetNodeType

public static final CommandType GetNodeType

GetNodeProxy

public static final CommandType GetNodeProxy

GetRepositoryType

public static final CommandType GetRepositoryType

Link

public static final CommandType Link

LinkInstancing

public static final CommandType LinkInstancing

ListRepositories

public static final CommandType ListRepositories

MaxAttributeLength

public static final CommandType MaxAttributeLength

MoveNode

public static final CommandType MoveNode

NewNode

public static final CommandType NewNode

NewInstanceNode

public static final CommandType NewInstanceNode

NewSubtypeNode

public static final CommandType NewSubtypeNode

RedefineNode

public static final CommandType RedefineNode

NewNodeAddress

public static final CommandType NewNodeAddress

NewRepository

public static final CommandType NewRepository

NewDocument

public static final CommandType NewDocument

NewInstancing

public static final CommandType NewInstancing

NodeAttributeEquals

public static final CommandType NodeAttributeEquals

NodeAttributeGreaterThan

public static final CommandType NodeAttributeGreaterThan

NodeExists

public static final CommandType NodeExists

NodeRepositoryExists

public static final CommandType NodeRepositoryExists

OpenDocument

public static final CommandType OpenDocument

Query

public static final CommandType Query

Redo

public static final CommandType Redo

RedoTo

public static final CommandType RedoTo

RemoveNode

public static final CommandType RemoveNode

RemoveRepository

public static final CommandType RemoveRepository

RenameNode

public static final CommandType RenameNode

RenameRepository

public static final CommandType RenameRepository

RenderNode

public static final CommandType RenderNode

RenderNodeAttributes

public static final CommandType RenderNodeAttributes

RenderRawLinkTables

public static final CommandType RenderRawLinkTables

RenderRepositoryContents

public static final CommandType RenderRepositoryContents

RenderDocument

public static final CommandType RenderDocument

Reset

public static final CommandType Reset

Reconstruct

public static final CommandType Reconstruct

SetNodeAttribute

public static final CommandType SetNodeAttribute

TestSatisfaction

public static final CommandType TestSatisfaction

Undo

public static final CommandType Undo

UndoTo

public static final CommandType UndoTo

UnlinkAllLinks

public static final CommandType UnlinkAllLinks

Unlink

public static final CommandType Unlink

UnlinkInstancing

public static final CommandType UnlinkInstancing

ValidateNodeInstancing

public static final CommandType ValidateNodeInstancing
Method Detail

get

public static CommandType get(int number)
Return the corresponding CommandType for the given Unique ID (see getUniqueID).

Parameters:
number - Number index.

toString

public java.lang.String toString()
Return the string equivalent of the CommandType.

Specified by:
toString in interface GenericType
Overrides:
toString in class java.lang.Object

render

public java.lang.StringBuffer render()
Return the string equivalent of the CommandType with the type type, formatted with the dot operator that the command interpreter understands.

Specified by:
render in interface GenericType
Specified by:
render in interface RenderableObject

equals

public boolean equals(java.lang.Object other)
Tests if one instance is the same as some other.

Specified by:
equals in interface GenericType
Overrides:
equals in class java.lang.Object
Parameters:
other - Other CommandType to compare to.

getAllTypes

public static ImmutableHashSet getAllTypes()
Return a HashSet of every item in the enumeration.


getAllTypesNonStatically

public ImmutableHashSet getAllTypesNonStatically()
Return a HashSet of every item in the enumeration.

Specified by:
getAllTypesNonStatically in interface GenericType

getAsGeneric

public GenericType getAsGeneric(java.lang.String string)
Return the corresponding CommandType for the given string as a GenericType object.

Specified by:
getAsGeneric in interface GenericType

get

public static CommandType get(java.lang.String string)
Static version of get() that gets around the Java restriction on static types in interfaces.


compareTo

public int compareTo(java.lang.Object other)
              throws java.lang.ClassCastException
Specified by:
compareTo in interface java.lang.Comparable
Throws:
java.lang.ClassCastException

getUniqueID

public int getUniqueID()
Get a unique numerial ID for this type that goes from 0 to (numMembers() - 1).


numMembers

public static int numMembers()
Get the number of members of this type.


capitalize

public static java.lang.String capitalize(java.lang.String in)


Copyright © 2011 David K. Elson. All Rights Reserved.