DESY ACOP Beans Home

com.cosylab.gui.components.table.cells
Class LongEnumCell

java.lang.Object
  extended by com.cosylab.gui.components.table.cells.TableCell
      extended by com.cosylab.gui.components.table.cells.NumericCell
          extended by com.cosylab.gui.components.table.cells.LongCell
              extended by com.cosylab.gui.components.table.cells.LongEnumCell
All Implemented Interfaces:
java.lang.Comparable

public class LongEnumCell
extends LongCell

LongEnumCell holds enumeration valies. Each long value from min to max represents one enumeration state, which can have own name and value.

Author:
Igor Kriznar

Field Summary
static java.lang.String STATE_DESCRIPTION
          State description property tag.
static java.lang.String STATE_VALUE
          State value property tag
 
Fields inherited from class com.cosylab.gui.components.table.cells.NumericCell
FORMAT, MAXIMUM, MINIMUM, UNITS, UNITS_VISIBLE
 
Fields inherited from class com.cosylab.gui.components.table.cells.TableCell
ALARM, commands, dataSource, ERROR, identifier, OUT_OF_BOUNDS, SEVERITY, SUSPENDED, TIMEOUT, timestamp, TOOLTIP, value, WARNING
 
Constructor Summary
LongEnumCell()
          Constructs a new LongEnumCell.
LongEnumCell(java.lang.String identifier, java.lang.Object dataSource, long value, Command[] commands)
          Constructs a new LongEnumCell.
LongEnumCell(java.lang.String identifier, java.lang.Object dataSource, long value, Command[] commands, java.lang.String[] descriptions, java.lang.Object[] values)
          Creates a new LongEnumCell object.
 
Method Summary
 java.lang.String getStateDescription(long i)
          Returns the state description under the index i.
 java.lang.String getStateLabel(long l)
          Returns the label name of the state under the index i.
 java.lang.Object getStateValue(long i)
          Returns the value under the index i.
 long toLongValue(java.lang.String label)
          Trys to lookup state table and find enum index with this label.
 
Methods inherited from class com.cosylab.gui.components.table.cells.LongCell
getLongValue, setValue
 
Methods inherited from class com.cosylab.gui.components.table.cells.NumericCell
getFormat, getMaximum, getMaximum, getMinimum, getMinimum, getUnits, isUnitsVisible
 
Methods inherited from class com.cosylab.gui.components.table.cells.TableCell
addSupportedCharacteristic, compareTo, getCharacteristic, getCharacteristic, getCharacteristics, getCommands, getDataSource, getIdentifier, getSupportedCharacteristics, getTimestamp, getTooltip, getValue, isAlarm, isError, isOutOfBounds, isSuspended, isTimeout, isWarning, putAllCharacteristics, putCharacteristic, removeSupportedCharacteristic, setTimestamp, setValue, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

STATE_DESCRIPTION

public static final java.lang.String STATE_DESCRIPTION
State description property tag.

See Also:
Constant Field Values

STATE_VALUE

public static final java.lang.String STATE_VALUE
State value property tag

See Also:
Constant Field Values
Constructor Detail

LongEnumCell

public LongEnumCell()
Constructs a new LongEnumCell.


LongEnumCell

public LongEnumCell(java.lang.String identifier,
                    java.lang.Object dataSource,
                    long value,
                    Command[] commands)
Constructs a new LongEnumCell.

Parameters:
identifier -
dataSource -
value -
commands -

LongEnumCell

public LongEnumCell(java.lang.String identifier,
                    java.lang.Object dataSource,
                    long value,
                    Command[] commands,
                    java.lang.String[] descriptions,
                    java.lang.Object[] values)
Creates a new LongEnumCell object.

Parameters:
identifier -
dataSource -
value -
commands -
descriptions -
values -
Method Detail

getStateDescription

public java.lang.String getStateDescription(long i)
Returns the state description under the index i.

Parameters:
i - index of the requested description
Returns:
the description

getStateValue

public java.lang.Object getStateValue(long i)
Returns the value under the index i.

Parameters:
i - index of the requested value
Returns:
the value

getStateLabel

public java.lang.String getStateLabel(long l)
Returns the label name of the state under the index i.

Parameters:
l - index of the requested label
Returns:
the label

toLongValue

public long toLongValue(java.lang.String label)
Trys to lookup state table and find enum index with this label. If value is not found, -1 is returned.

Parameters:
label - enum state description label
Returns:
state index or -1


Copyright © 2010. All Rights Reserved.