Nengo.ca

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').


Enum Constant Summary
ACU
          Arbitrary current units
AVU
          Arbitrary voltage units
M
          Metres
M_PER_S
          Metres per second
mV
          Millivolts
N
          Newtons
Nm
          Newton metres
RAD
          Radians
RAD_PER_S
          Radians per second
S
          Seconds
SPIKES
          Spikes (count)
SPIKES_PER_S
          Spike rate
uA
          Microamps
uAcm2
          Micro-amps per cm^2
UNK
          Unknown units
 
Field Summary
 java.lang.String myName
          Standard name of units
 
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
Seconds


mV

public static final Units mV
Millivolts


uA

public static final Units uA
Microamps


uAcm2

public static final Units uAcm2
Micro-amps per cm^2


ACU

public static final Units ACU
Arbitrary current units


AVU

public static final Units AVU
Arbitrary voltage units


UNK

public static final Units UNK
Unknown units


SPIKES

public static final Units SPIKES
Spikes (count)


SPIKES_PER_S

public static final Units SPIKES_PER_S
Spike rate


N

public static final Units N
Newtons


Nm

public static final Units Nm
Newton metres


M

public static final Units M
Metres


RAD

public static final Units RAD
Radians


M_PER_S

public static final Units M_PER_S
Metres per second


RAD_PER_S

public static final Units RAD_PER_S
Radians per second

Field Detail

myName

public java.lang.String myName
Standard name of units

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

Nengo.ca