|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.sensorevent.model.generic.GenericAttribute
public class GenericAttribute
GenericAttribute represents a data value (an attribute) managed by the even model. All attributes have a name, value, and type. The name uniquely identifies each attribute within a GenericGroup. The value is any single Java Object or arrays of Java Objects. Primitive values are managed using the standard wrapper classes. The type indicates the type of data stored in the value field and whether the value represent a single value or an array of values.
The interface associated with this class is IGenericAttribute
.
Field Summary | |
---|---|
static java.lang.String |
COPYRIGHT
|
protected java.lang.String |
name
The attribute's name |
protected int |
type
The attribute's type as defined in IGenericType . |
protected java.lang.Object[] |
value
The attribute's value |
Constructor Summary | |
---|---|
protected |
GenericAttribute()
Constructs a new GenericAttribute |
protected |
GenericAttribute(java.lang.String name)
Constructs a new GenericAttribute with the specified name |
Method Summary | |
---|---|
java.lang.Object[] |
getArrayValue()
Returns the attribute's values as an Object array |
boolean[] |
getBooleanArrayValue()
Returns the attribute's values as a boolean array |
boolean |
getBooleanValue()
Returns the attribute's value as a boolean |
byte[] |
getByteArrayValue()
Returns the attribute's values as a byte array |
byte |
getByteValue()
Returns the attribute's value as a byte |
java.util.Date[] |
getDateArrayValue()
Returns the attribute's value as a java.util.Date array |
long[] |
getDateArrayValueAsLong()
Returns the attribute's java.util.Date values as an array of long millisecond values |
java.util.Date |
getDateValue()
Returns the attribute's value as a java.util.Date |
long |
getDateValueAsLong()
Returns the attribute's java.util.Date value as a long millisecond value |
double[] |
getDoubleArrayValue()
Returns the attribute's values as a double array |
double |
getDoubleValue()
Returns the attribute's value as a double |
float[] |
getFloatArrayValue()
Returns the attribute's values as a float array |
float |
getFloatValue()
Returns the attribute's value as a float |
byte[] |
getHexValue()
Returns the attribute's value as an array of hex bytes. |
java.lang.String |
getHexValueAsString()
Returns the attribute's hex byte array value as a String |
static IGenericAttribute |
getInstance(java.lang.String name)
Factory method to create a IGenericAttribute instance |
int[] |
getIntArrayValue()
Returns the attribute's values as an int array |
int |
getIntValue()
Returns the attribute's value as an int |
long[] |
getLongArrayValue()
Returns the attribute's values as a long array |
long |
getLongValue()
Returns the attribute's value as a long |
java.lang.String |
getName()
Returns the attribute's name |
static int |
getObjectDataType(java.lang.Object obj)
Returns the IGenericType describing the object's data type. |
short[] |
getShortArrayValue()
Returns the attribute's values as a short array |
short |
getShortValue()
Returns the attribute's value as a short |
java.lang.String[] |
getStringArrayValue()
Returns the attribute's values as a String array |
java.lang.String |
getStringValue()
Returns the attribute's value as a String |
int |
getType()
Returns the type of this attribute |
java.lang.Object |
getValue()
Returns the attribute's value as an Object or an Object[] |
void |
setArrayValue(java.lang.Object[] value)
Sets the value of this attribute to an Object array |
void |
setBooleanArrayValue(boolean[] b)
Sets the value of this attribute to a boolean array |
void |
setBooleanValue(boolean b)
Sets the value of this attribute to a single boolean value |
void |
setByteArrayValue(byte[] b)
Sets the value of this attribute to a byte array |
void |
setByteValue(byte b)
Sets the value of this attribute to a single byte value |
void |
setDateArrayValue(java.util.Date[] d)
Sets the value of this attribute to a java.util.Date array |
void |
setDateArrayValueAsLong(long[] l)
Sets the value of this attribute to a java.util.Date array converted from the long milliseconds array values |
void |
setDateValue(java.util.Date d)
Sets the value of this attribute to a single java.util.Date value |
void |
setDateValueAsLong(long l)
Sets the value of this attribute to a single java.util.Date value converted from the given long milliseconds value |
void |
setDoubleArrayValue(double[] d)
Sets the value of this attribute to a double array |
void |
setDoubleValue(double d)
Sets the value of this attribute to a single double value |
void |
setFloatArrayValue(float[] f)
Sets the value of this attribute to a float array |
void |
setFloatValue(float f)
Sets the value of this attribute to a single float value |
void |
setHexValue(byte[] b)
Sets the value of this attribute to a single HexBinary string converted from the given byte array. |
void |
setHexValue(java.lang.String s)
Sets the value of this attribute to a single HexBinary string converted from the given byte array. |
void |
setIntArrayValue(int[] i)
Sets the value of this attribute to an int array |
void |
setIntValue(int i)
Sets the value of this attribute to a single int value |
void |
setLongArrayValue(long[] l)
Sets the value of this attribute to a long array |
void |
setLongValue(long l)
Sets the value of this attribute to a single long value |
void |
setName(java.lang.String name)
Sets the name of this attribute |
void |
setShortArrayValue(short[] s)
Sets the value of this attribute to a short array |
void |
setShortValue(short s)
Sets the value of this attribute to a single short value |
void |
setStringArrayValue(java.lang.String[] s)
Sets the value of this attribute to a String array |
void |
setStringValue(java.lang.String s)
Sets the value of this attribute to a single String value |
void |
setType(int type)
Sets the type of this attribute |
void |
setValue(java.lang.Object value)
Sets the value of this attribute; value may be a single Object or an Object[] |
java.lang.String |
toString()
Returns a string representation of this attribute (for debug purposes) |
java.lang.String |
valueAsString()
Returns a string representation of this attribute's value |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String COPYRIGHT
protected volatile java.lang.String name
protected volatile java.lang.Object[] value
protected volatile int type
IGenericType
. The type
indicates whether the value fields represents one value or an array of values.
Constructor Detail |
---|
protected GenericAttribute()
protected GenericAttribute(java.lang.String name) throws SensorEventException
name
- the name of the attribute
SensorEventException
Method Detail |
---|
public static IGenericAttribute getInstance(java.lang.String name) throws SensorEventException
name
- the name of the attribute
SensorEventException
public java.lang.String getName()
getName
in interface IGenericAttribute
public java.lang.Object getValue()
getValue
in interface IGenericAttribute
public boolean getBooleanValue() throws SensorEventException
getBooleanValue
in interface IGenericAttribute
SensorEventException
public byte getByteValue() throws SensorEventException
getByteValue
in interface IGenericAttribute
SensorEventException
public java.util.Date getDateValue() throws SensorEventException
getDateValue
in interface IGenericAttribute
SensorEventException
public long getDateValueAsLong() throws SensorEventException
getDateValueAsLong
in interface IGenericAttribute
SensorEventException
public double getDoubleValue() throws SensorEventException
getDoubleValue
in interface IGenericAttribute
SensorEventException
public float getFloatValue() throws SensorEventException
getFloatValue
in interface IGenericAttribute
SensorEventException
public byte[] getHexValue() throws SensorEventException
HexBinary
algorithm.
getHexValue
in interface IGenericAttribute
SensorEventException
public java.lang.String getHexValueAsString() throws SensorEventException
getHexValueAsString
in interface IGenericAttribute
SensorEventException
public int getIntValue() throws SensorEventException
getIntValue
in interface IGenericAttribute
SensorEventException
public long getLongValue() throws SensorEventException
getLongValue
in interface IGenericAttribute
SensorEventException
public short getShortValue() throws SensorEventException
getShortValue
in interface IGenericAttribute
SensorEventException
public java.lang.String getStringValue() throws SensorEventException
getStringValue
in interface IGenericAttribute
SensorEventException
public java.lang.Object[] getArrayValue() throws SensorEventException
getArrayValue
in interface IGenericAttribute
SensorEventException
public boolean[] getBooleanArrayValue() throws SensorEventException
getBooleanArrayValue
in interface IGenericAttribute
SensorEventException
public byte[] getByteArrayValue() throws SensorEventException
getByteArrayValue
in interface IGenericAttribute
SensorEventException
public java.util.Date[] getDateArrayValue() throws SensorEventException
getDateArrayValue
in interface IGenericAttribute
SensorEventException
public long[] getDateArrayValueAsLong() throws SensorEventException
getDateArrayValueAsLong
in interface IGenericAttribute
SensorEventException
public double[] getDoubleArrayValue() throws SensorEventException
getDoubleArrayValue
in interface IGenericAttribute
SensorEventException
public float[] getFloatArrayValue() throws SensorEventException
getFloatArrayValue
in interface IGenericAttribute
SensorEventException
public int[] getIntArrayValue() throws SensorEventException
getIntArrayValue
in interface IGenericAttribute
SensorEventException
public long[] getLongArrayValue() throws SensorEventException
getLongArrayValue
in interface IGenericAttribute
SensorEventException
public short[] getShortArrayValue() throws SensorEventException
getShortArrayValue
in interface IGenericAttribute
SensorEventException
public java.lang.String[] getStringArrayValue() throws SensorEventException
getStringArrayValue
in interface IGenericAttribute
SensorEventException
public int getType()
getType
in interface IGenericAttribute
IGenericType
public void setName(java.lang.String name) throws SensorEventException
setName
in interface IGenericAttribute
SensorEventException
public void setValue(java.lang.Object value) throws SensorEventException
setValue
in interface IGenericAttribute
SensorEventException
public void setBooleanValue(boolean b) throws SensorEventException
setBooleanValue
in interface IGenericAttribute
SensorEventException
public void setByteValue(byte b) throws SensorEventException
setByteValue
in interface IGenericAttribute
SensorEventException
public void setDateValue(java.util.Date d) throws SensorEventException
setDateValue
in interface IGenericAttribute
SensorEventException
public void setDateValueAsLong(long l) throws SensorEventException
setDateValueAsLong
in interface IGenericAttribute
SensorEventException
public void setDoubleValue(double d) throws SensorEventException
setDoubleValue
in interface IGenericAttribute
SensorEventException
public void setFloatValue(float f) throws SensorEventException
setFloatValue
in interface IGenericAttribute
SensorEventException
public void setHexValue(byte[] b) throws SensorEventException
HexBinary
algorithm.
setHexValue
in interface IGenericAttribute
SensorEventException
public void setHexValue(java.lang.String s) throws SensorEventException
setHexValue
in interface IGenericAttribute
SensorEventException
public void setIntValue(int i) throws SensorEventException
setIntValue
in interface IGenericAttribute
SensorEventException
public void setLongValue(long l) throws SensorEventException
setLongValue
in interface IGenericAttribute
SensorEventException
public void setShortValue(short s) throws SensorEventException
setShortValue
in interface IGenericAttribute
SensorEventException
public void setStringValue(java.lang.String s) throws SensorEventException
setStringValue
in interface IGenericAttribute
SensorEventException
public void setArrayValue(java.lang.Object[] value) throws SensorEventException
setArrayValue
in interface IGenericAttribute
SensorEventException
public void setBooleanArrayValue(boolean[] b) throws SensorEventException
setBooleanArrayValue
in interface IGenericAttribute
SensorEventException
public void setByteArrayValue(byte[] b) throws SensorEventException
setByteArrayValue
in interface IGenericAttribute
SensorEventException
public void setDateArrayValue(java.util.Date[] d) throws SensorEventException
setDateArrayValue
in interface IGenericAttribute
SensorEventException
public void setDateArrayValueAsLong(long[] l) throws SensorEventException
setDateArrayValueAsLong
in interface IGenericAttribute
SensorEventException
public void setDoubleArrayValue(double[] d) throws SensorEventException
setDoubleArrayValue
in interface IGenericAttribute
SensorEventException
public void setFloatArrayValue(float[] f) throws SensorEventException
setFloatArrayValue
in interface IGenericAttribute
SensorEventException
public void setIntArrayValue(int[] i) throws SensorEventException
setIntArrayValue
in interface IGenericAttribute
SensorEventException
public void setLongArrayValue(long[] l) throws SensorEventException
setLongArrayValue
in interface IGenericAttribute
SensorEventException
public void setShortArrayValue(short[] s) throws SensorEventException
setShortArrayValue
in interface IGenericAttribute
SensorEventException
public void setStringArrayValue(java.lang.String[] s) throws SensorEventException
setStringArrayValue
in interface IGenericAttribute
SensorEventException
public void setType(int type)
setType
in interface IGenericAttribute
IGenericType
public static int getObjectDataType(java.lang.Object obj) throws SensorEventException
SensorEventException
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String valueAsString()
valueAsString
in interface IGenericAttribute
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |