org.mbari.siam.distributed
Class MnemonicIntegerAttributeValueObject

java.lang.Object
  extended by org.mbari.siam.distributed.AttributeValueObject
      extended by org.mbari.siam.distributed.MnemonicIntegerAttributeValueObject
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable, Exportable

public class MnemonicIntegerAttributeValueObject
extends AttributeValueObject

MnemonicIntegerAttributeValueObject - The value for state attributes which have mnemonics that represent integer values (e.g., powerPolicy -- "never":0; "sampling":1; etc.). toString() returns the mnemonic, value() returns the Integer value.

Author:
Kent Headley
See Also:
Serialized Form

Field Summary
protected static org.apache.log4j.Logger _logger
          Log4j logger
 
Fields inherited from class org.mbari.siam.distributed.AttributeValueObject
_value
 
Fields inherited from interface org.mbari.siam.distributed.Exportable
EX_BASE, EX_BOOLEANOBJATT, EX_BYTEARRAYOBJATT, EX_DEVICEMESSAGEPACKET, EX_DEVICEPACKET, EX_DOUBLEOBJATT, EX_FLOATOBJATT, EX_INTEGEROBJATT, EX_LONGOBJATT, EX_MAX, EX_METADATAPACKET, EX_MNEMONICINTEGEROBJATT, EX_SCHEDULESPECIFIEROBJATT, EX_SENSORDATAPACKET, EX_STATE, EX_STATEATTRIBUTE
 
Constructor Summary
MnemonicIntegerAttributeValueObject()
           
MnemonicIntegerAttributeValueObject(int i, java.util.Map map)
           
MnemonicIntegerAttributeValueObject(java.lang.String s, java.util.Map map)
          Contructor
 
Method Summary
 void export(java.io.DataOutput out)
          Fulfills Exportable interface
 java.lang.Object parse(int n)
          Parse and validate the value of this attribute from the specified string
 java.lang.Object parse(java.lang.String s)
          Parse and validate the value of this attribute from the specified string
 void readExternal(java.io.ObjectInput in)
           
 java.lang.String toString()
          Return String representation.
 java.lang.Object value()
          value() is overridden to return the numeric value
 void writeExternal(java.io.ObjectOutput out)
           
 
Methods inherited from class org.mbari.siam.distributed.AttributeValueObject
getVersion
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_logger

protected static org.apache.log4j.Logger _logger
Log4j logger

Constructor Detail

MnemonicIntegerAttributeValueObject

public MnemonicIntegerAttributeValueObject()

MnemonicIntegerAttributeValueObject

public MnemonicIntegerAttributeValueObject(java.lang.String s,
                                           java.util.Map map)
                                    throws java.lang.Exception
Contructor

Parameters:
s - constructor calls parse(s) to obtain _value member
map - mapping between strings and values
Throws:
java.lang.Exception

MnemonicIntegerAttributeValueObject

public MnemonicIntegerAttributeValueObject(int i,
                                           java.util.Map map)
                                    throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

toString

public java.lang.String toString()
Return String representation.

Specified by:
toString in class AttributeValueObject

parse

public java.lang.Object parse(java.lang.String s)
                       throws java.lang.Exception
Parse and validate the value of this attribute from the specified string

Specified by:
parse in class AttributeValueObject
Throws:
java.lang.Exception

parse

public java.lang.Object parse(int n)
                       throws java.lang.Exception
Parse and validate the value of this attribute from the specified string

Throws:
java.lang.Exception

value

public java.lang.Object value()
value() is overridden to return the numeric value

Overrides:
value in class AttributeValueObject

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Specified by:
writeExternal in interface java.io.Externalizable
Overrides:
writeExternal in class AttributeValueObject
Throws:
java.io.IOException

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Specified by:
readExternal in interface java.io.Externalizable
Overrides:
readExternal in class AttributeValueObject
Throws:
java.io.IOException
java.lang.ClassNotFoundException

export

public void export(java.io.DataOutput out)
            throws java.io.IOException
Fulfills Exportable interface

Specified by:
export in interface Exportable
Overrides:
export in class AttributeValueObject
Throws:
java.io.IOException


Copyright © 2003 MBARI.

The Monterey Bay Aquarium Research Institute (MBARI) provides this documentation and code "as is", with no warranty, express or implied, of its quality or consistency. It is provided without support and without obligation on the part of MBARI to assist in its use, correction, modification, or enhancement.