edu.nau.cs.scu
Enum SerialConfiguration

java.lang.Object
  extended by java.lang.Enum<SerialConfiguration>
      extended by edu.nau.cs.scu.SerialConfiguration
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<SerialConfiguration>

public enum SerialConfiguration
extends java.lang.Enum<SerialConfiguration>

This is an enumeration which describes the different baud rates and configurations for serial communications.

Author:
Sam

Enum Constant Summary
_115200_8_N_1
          This constant is for communicating at a baud rate of 115.2k, 8 data bits, 1 stop bit, and no parity
_38400_8_N_1
          This constant is for communicating at a baud rate of 115.2k, 8 data bits, 1 stop bit, and no parity
 
Method Summary
 int baudRate()
          Retrieves the baud rate specified by this enum constant
 int dataBits()
          Retrieves the numerical constant specified in SerialPort which signifies the number of data bits
 SerialConfiguration getSerialConfig(java.lang.String propertyString)
          Retrieves the SerialConfiguration enum constant related to the specially formatted property string which can be retrieved using propertyString().
 int parityBits()
          Retrieves the numerical constant specified in SerialPort which signifies the number of parity bits
 java.lang.String propertyString()
          Returns a specially formatted string which uniquely identifies one of the SerialConfiguration enum constants.
 int stopBits()
          Retrieves the numerical constant specified in SerialPort which signifies the number of stop bits
static SerialConfiguration valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static SerialConfiguration[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

_115200_8_N_1

public static final SerialConfiguration _115200_8_N_1
This constant is for communicating at a baud rate of 115.2k, 8 data bits, 1 stop bit, and no parity


_38400_8_N_1

public static final SerialConfiguration _38400_8_N_1
This constant is for communicating at a baud rate of 115.2k, 8 data bits, 1 stop bit, and no parity

Method Detail

values

public static SerialConfiguration[] 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 (SerialConfiguration c : SerialConfiguration.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static SerialConfiguration 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 name
java.lang.NullPointerException - if the argument is null

baudRate

public int baudRate()
Retrieves the baud rate specified by this enum constant

Returns:
the associated baud rate

dataBits

public int dataBits()
Retrieves the numerical constant specified in SerialPort which signifies the number of data bits

Returns:
The number of data bits

parityBits

public int parityBits()
Retrieves the numerical constant specified in SerialPort which signifies the number of parity bits

Returns:
The number of parity bits

stopBits

public int stopBits()
Retrieves the numerical constant specified in SerialPort which signifies the number of stop bits

Returns:
The number of stop bits

propertyString

public java.lang.String propertyString()
Returns a specially formatted string which uniquely identifies one of the SerialConfiguration enum constants. This is used for storing serial communications configurations in property files for future retrieval.

Returns:
A specially formatted string uniquely identifying this SerialConfiguration

getSerialConfig

public SerialConfiguration getSerialConfig(java.lang.String propertyString)
Retrieves the SerialConfiguration enum constant related to the specially formatted property string which can be retrieved using propertyString().

Parameters:
propertyString - The formatted string
Returns:
The associated SerialConfiguration enum constant