Package edu.caltech.nanodb.server
Enum CommandState
- java.lang.Object
-
- java.lang.Enum<CommandState>
-
- edu.caltech.nanodb.server.CommandState
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<CommandState>
public enum CommandState extends java.lang.Enum<CommandState>
An enumeration indicating the current command's execution status. It is used to implement a very simple communication protocol between the server and clients.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description BEGIN_TUPLES
This state value indicates that the command will be generating a sequence of tuples as the result of a query.COMMAND_COMPLETED
This state value indicates that the command to be executed has been completed by the server.COMMAND_RECEIVED
This state value indicates that the server has received the command sent by the client, and is proceeding to execute it.END_TUPLES
This state value indicates that the command has generated all tuples it will generate.
-
Constructor Summary
Constructors Modifier Constructor Description private
CommandState()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static CommandState
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static CommandState[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
COMMAND_RECEIVED
public static final CommandState COMMAND_RECEIVED
This state value indicates that the server has received the command sent by the client, and is proceeding to execute it.
-
BEGIN_TUPLES
public static final CommandState BEGIN_TUPLES
This state value indicates that the command will be generating a sequence of tuples as the result of a query.
-
END_TUPLES
public static final CommandState END_TUPLES
This state value indicates that the command has generated all tuples it will generate.
-
COMMAND_COMPLETED
public static final CommandState COMMAND_COMPLETED
This state value indicates that the command to be executed has been completed by the server.
-
-
Method Detail
-
values
public static CommandState[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (CommandState c : CommandState.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static CommandState valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
-