org.das2.datum.EnumerationUnits

Units class for mapping arbitrary objects to Datums. Nothing about the contract for a Datum requires that they correspond to physical quantities, and we can assign a mapping from numbers to objects using this class. This allows information such as "Cluster 1" or "Spin Flip" to be encoded. This is used to model ordinal or nominal data, as described in http://en.wikipedia.org/wiki/Level_of_measurement

EnumerationUnits( String id )

EnumerationUnits( String id, String description )


add

add( Number a, Number b, Units bUnits ) → Datum

Parameters

a - a Number
b - a Number
bUnits - an Units

Returns:

org.das2.datum.Datum

[search for examples] [view on GitHub] [view on old javadoc] [view source]


convertDoubleTo

convertDoubleTo( Units toUnits, double value ) → double

Parameters

toUnits - an Units
value - a double

Returns:

double

[search for examples] [view on GitHub] [view on old javadoc] [view source]


create

create( Object o ) → EnumerationUnits

create the enumeration unit with the given context.

Parameters

o - an Object

Returns:

an org.das2.datum.EnumerationUnits

[search for examples] [view on GitHub] [view on old javadoc] [view source]


createDatum

createDatum( int ival, Object sval, int color ) → Datum

creates the datum, explicitly setting the ordinal. Use with caution.

Parameters

ival - the integer value of the datum
sval - the object to associate. This can be an object for legacy reasons, but should be a String.
color - RGB color to associate with this value.

Returns:

the Datum, which may have been created already.

[search for examples] [view on GitHub] [view on old javadoc] [view source]

createDatum( int ival, Object sval ) → Datum
createDatum( Object object ) → Datum
createDatum( int value ) → Datum
createDatum( long value ) → Datum
createDatum( Number value ) → Datum
createDatum( double d ) → Datum
createDatum( double d, double resolution ) → Datum
createDatum( Datum value ) → Datum

createDatumAndUnits

createDatumAndUnits( Object object ) → Datum

Parameters

object - an Object

Returns:

org.das2.datum.Datum

[search for examples] [view on GitHub] [view on old javadoc] [view source]


createDatumVector

createDatumVector( java.lang.Object[] objects ) → DatumVector

Parameters

objects - a java.lang.Object[]

Returns:

org.das2.datum.DatumVector

[search for examples] [view on GitHub] [view on old javadoc] [view source]


divide

divide( Number a, Number b, Units bUnits ) → Datum

Parameters

a - a Number
b - a Number
bUnits - an Units

Returns:

org.das2.datum.Datum

[search for examples] [view on GitHub] [view on old javadoc] [view source]


getColor

getColor( Datum d ) → int

return color suggestion for this value. Note this color is not always used.

Parameters

d - the datum

Returns:

the color suggestions

[search for examples] [view on GitHub] [view on old javadoc] [view source]


getDatumFormatterFactory

getDatumFormatterFactory( ) → DatumFormatterFactory

Returns:

org.das2.datum.format.DatumFormatterFactory

[search for examples] [view on GitHub] [view on old javadoc] [view source]


getFillDatum

getFillDatum( ) → Datum

return the datum for ""

Returns:

a Datum

[search for examples] [view on GitHub] [view on old javadoc] [view source]


getFillDouble

getFillDouble( ) → double

return the double for ""

Returns:

a double

[search for examples] [view on GitHub] [view on old javadoc] [view source]


getHighestOrdinal

getHighestOrdinal( ) → int

Returns:

int

[search for examples] [view on GitHub] [view on old javadoc] [view source]


getObject

getObject( Datum datum ) → Object

return the object (typically a string) associated with this Datum

Parameters

datum - a Datum

Returns:

the object associated with the Datum.

[search for examples] [view on GitHub] [view on old javadoc] [view source]


getValues

getValues( ) → Map

provides access to map of all values.

Returns:

all the values

[search for examples] [view on GitHub] [view on old javadoc] [view source]


hasFillDatum

hasFillDatum( ) → boolean

true if fill has been defined, which is the empty string or all spaces.

Returns:

true if fill has been defined.

[search for examples] [view on GitHub] [view on old javadoc] [view source]


isFill

isFill( Number value ) → boolean

Parameters

value - a Number

Returns:

boolean

[search for examples] [view on GitHub] [view on old javadoc] [view source]


multiply

multiply( Number a, Number b, Units bUnits ) → Datum

Parameters

a - a Number
b - a Number
bUnits - an Units

Returns:

org.das2.datum.Datum

[search for examples] [view on GitHub] [view on old javadoc] [view source]


parse

parse( String s ) → Datum

Parameters

s - a String

Returns:

org.das2.datum.Datum

[search for examples] [view on GitHub] [view on old javadoc] [view source]


subtract

subtract( Number a, Number b, Units bUnits ) → Datum

Parameters

a - a Number
b - a Number
bUnits - an Units

Returns:

org.das2.datum.Datum

[search for examples] [view on GitHub] [view on old javadoc] [view source]


toString

toString( ) → String

Returns:

java.lang.String

[search for examples] [view on GitHub] [view on old javadoc] [view source]