ca.nengo.model
Enum Units

java.lang.Object
  extended by java.lang.Enum<Units>
      extended by ca.nengo.model.Units
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<Units>

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

Models units for physical quantities. We use this class to model both fundamental units (e.g. 's') and composite units (e.g. 'spikes/s').

Author:
Bryan Tripp

Enum Constant Summary
ACU
           
AVU
           
M
           
M_PER_S
           
mV
           
N
           
Nm
           
RAD
           
RAD_PER_S
           
S
           
SPIKES
           
SPIKES_PER_S
           
uA
           
uAcm2
           
UNK
           
 
Field Summary
 java.lang.String myName
           
 
Method Summary
 java.lang.String toString()
           
static Units[] uniform(Units units, int length)
          Returns an array of Units in which all Units are the same.
static Units valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static Units[] values()
          Returns an array containing the constants of this enum type, in the order they're declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, valueOf
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

S

public static final Units S

mV

public static final Units mV

uA

public static final Units uA

uAcm2

public static final Units uAcm2

ACU

public static final Units ACU

AVU

public static final Units AVU

UNK

public static final Units UNK

SPIKES

public static final Units SPIKES

SPIKES_PER_S

public static final Units SPIKES_PER_S

N

public static final Units N

Nm

public static final Units Nm

M

public static final Units M

RAD

public static final Units RAD

M_PER_S

public static final Units M_PER_S

RAD_PER_S

public static final Units RAD_PER_S
Field Detail

myName

public java.lang.String myName
Method Detail

values

public static final Units[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(Units c : Units.values())
        System.out.println(c);

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

valueOf

public static Units 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

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Enum<Units>

uniform

public static Units[] uniform(Units units,
                              int length)
Returns an array of Units in which all Units are the same.

Parameters:
units - Units to be returned in every element
length - Number of elements
Returns:
Array of given length with given Units in every element