org.robokind.impl.motion.serial
Enum BaudRate

java.lang.Object
  extended by java.lang.Enum<BaudRate>
      extended by org.robokind.impl.motion.serial.BaudRate
All Implemented Interfaces:
Serializable, Comparable<BaudRate>

public enum BaudRate
extends Enum<BaudRate>

Serial port baud rates.

Author:
Matthew Stevenson

Enum Constant Summary
BR1000000
          1000000 baud
BR115200
          115200 baud
BR19200
          19200 baud
BR200000
          200000 baud
BR2400
          2400 baud
BR250000
          250000 baud
BR38400
          38400 baud
BR400000
          400000 baud
BR500000
          500000 baud
BR57600
          57600 baud
BR9600
          9600 baud
 
Method Summary
static BaudRate get(int val, BaudRate def)
          Finds the BaudRate with the corresponding int value.
 int getInt()
          Returns the baud rate as an int.
 String toString()
           
static BaudRate valueOf(String name)
          Returns the enum constant of this type with the specified name.
static BaudRate[] 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, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

BR1000000

public static final BaudRate BR1000000
1000000 baud


BR500000

public static final BaudRate BR500000
500000 baud


BR400000

public static final BaudRate BR400000
400000 baud


BR250000

public static final BaudRate BR250000
250000 baud


BR200000

public static final BaudRate BR200000
200000 baud


BR115200

public static final BaudRate BR115200
115200 baud


BR57600

public static final BaudRate BR57600
57600 baud


BR38400

public static final BaudRate BR38400
38400 baud


BR19200

public static final BaudRate BR19200
19200 baud


BR9600

public static final BaudRate BR9600
9600 baud


BR2400

public static final BaudRate BR2400
2400 baud

Method Detail

values

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

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

valueOf

public static BaudRate valueOf(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:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

getInt

public int getInt()
Returns the baud rate as an int.

Returns:
baud rate as an int

toString

public String toString()
Overrides:
toString in class Enum<BaudRate>

get

public static BaudRate get(int val,
                           BaudRate def)
Finds the BaudRate with the corresponding int value.

Parameters:
val - baud rate
def - the default baud rate if the given value is not found
Returns:
BaudRate with the corresponding int value, returns def is no BaudRate is found


Copyright © 2011. All Rights Reserved.