public abstract class DCField
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable
Modifier and Type | Field and Description |
---|---|
static int |
ATTR_HEADER_SIZE |
static int |
BYTE |
static int |
BYTES |
protected int |
datatype |
static int |
DOUBLE |
static int |
FLOAT |
static int |
INTEGER |
static int |
IP |
static int |
IPV6 |
static int |
LIST |
static int |
LONG |
static int |
MAC |
static int |
MAP |
static int |
NULL |
static int |
OBJECT |
static int |
SHORT |
static int |
STRING |
static int |
TIMEINMILLIS |
static int |
TIMEINSECONDS |
static int |
UINT128 |
protected byte[] |
value |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone() |
static DCField |
create(int type,
FieldKey key) |
DCField |
dup(FieldKey newKey)
Given an existing field and a name key name, return a new field
with the same type and value as the original, but with the new key.
|
boolean |
equals(DCField oa)
Compares the value of this DCField with
oa |
boolean |
equalsValue(DCField comparisonField) |
byte[] |
getBytes()
Deprecated.
|
byte[] |
getBytesValue() |
byte |
getByteValue() |
java.util.Date |
getDateValue() |
static DCField |
getDCField(FieldKey key,
int type,
byte[] value) |
static DCField |
getDCField(FieldKey id,
int type,
java.lang.String value) |
static DCField |
getDCField(FieldKey id,
int type,
java.lang.String s,
java.lang.String operation,
java.lang.String original_value) |
double |
getDoubleValue() |
float |
getFloatValue() |
java.lang.String |
getID() |
int |
getIntValue() |
FieldKey |
getKey() |
int |
getLength()
Deprecated.
Use isEmpty to determine if field is empty
|
long |
getLongValue() |
short |
getShortValue() |
static int |
getStaticAttrLength(int type)
Deprecated.
types.
|
java.lang.String |
getStringValue() |
int |
getType() |
protected void |
init(FieldKey sid,
byte[] inValues) |
protected void |
init(int sid,
byte[] inValues)
Set the id and value members to the values provided
|
protected void |
init(java.lang.String sid,
byte[] inValues)
Set the id and value members to the values provided
|
boolean |
isEmpty() |
static boolean |
isVarLength(int type)
Deprecated.
|
static DCField |
makeAttrfromBytes(byte[] attrBytes,
int offset)
Deprecated.
|
static DCField |
makeAttrfromBytes(FieldKey id,
int type,
byte[] valueBytes) |
static DCField |
makeAttrfromBytes(int id,
int type,
byte[] valueBytes)
Deprecated.
|
static DCField |
makeAttrfromBytes(java.lang.String id,
int type,
byte[] valueBytes)
Deprecated.
Use makeAttrfromBytes(Fielkey,...)
|
static DCField |
makeAttrfromStream(java.io.DataInputStream dis)
Deprecated.
|
void |
readValueFromStream(java.io.InputStream in) |
void |
setID(int newID)
Deprecated.
|
void |
setID(java.lang.String newID)
Deprecated.
|
void |
setKey(FieldKey key) |
protected void |
setType(int t)
Sets the type for this DCField object
|
void |
setValue(byte[] valueBytes)
Sets the value of this DCField to what is contained in
valueBytes |
java.lang.String |
toString() |
int |
writeValueToStream(java.io.OutputStream out) |
public static final int STRING
public static final int INTEGER
public static final int LONG
public static final int TIMEINSECONDS
public static final int IP
public static final int TIMEINMILLIS
public static final int MAC
public static final int UINT128
public static final int BYTE
public static final int SHORT
public static final int IPV6
public static final int FLOAT
public static final int DOUBLE
public static final int BYTES
public static final int OBJECT
public static final int LIST
public static final int NULL
public static final int MAP
public static final int ATTR_HEADER_SIZE
protected byte[] value
protected int datatype
public DCField()
public DCField(FieldKey key)
public byte getByteValue() throws java.lang.ClassCastException
java.lang.ClassCastException
public java.util.Date getDateValue() throws java.lang.ClassCastException
java.lang.ClassCastException
public double getDoubleValue() throws java.lang.ClassCastException
java.lang.ClassCastException
public float getFloatValue() throws java.lang.ClassCastException
java.lang.ClassCastException
public int getIntValue() throws java.lang.ClassCastException
java.lang.ClassCastException
public long getLongValue() throws java.lang.ClassCastException
java.lang.ClassCastException
public short getShortValue() throws java.lang.ClassCastException
java.lang.ClassCastException
public java.lang.String getStringValue() throws java.lang.ClassCastException
java.lang.ClassCastException
public java.lang.Object clone()
clone
in class java.lang.Object
public static DCField makeAttrfromStream(java.io.DataInputStream dis)
public static DCField makeAttrfromBytes(byte[] attrBytes, int offset)
public static DCField makeAttrfromBytes(int id, int type, byte[] valueBytes)
public static DCField getDCField(FieldKey id, int type, java.lang.String s, java.lang.String operation, java.lang.String original_value)
public static DCField makeAttrfromBytes(java.lang.String id, int type, byte[] valueBytes)
public DCField dup(FieldKey newKey)
newKey
- The key for the new fieldpublic static final boolean isVarLength(int type)
true
, if type
is
variable length (of type String)public static final int getStaticAttrLength(int type)
protected void init(int sid, byte[] inValues)
protected void init(java.lang.String sid, byte[] inValues)
protected void init(FieldKey sid, byte[] inValues)
public byte[] getBytes()
public java.lang.String toString()
toString
in class java.lang.Object
public final FieldKey getKey()
public final void setKey(FieldKey key)
public java.lang.String getID()
public void setID(int newID)
newID
- the id for this DCField objectpublic void setID(java.lang.String newID)
newID
- the id for this DCField objectpublic int getType()
protected void setType(int t)
t
- the type for this DCField object.public boolean isEmpty()
public int getLength()
public byte[] getBytesValue()
public void setValue(byte[] valueBytes) throws NDKException
valueBytes
NOTE: Caveat Machinator (Engineer beware)
At this time, there is no validation of the byte array passed
in to this method. The developer should ensure that the bytes
used to create this DCField object are appropriate for the
specific data type. For example, a byte[] consisting of 7 bytes
should not be used to create an IntField object.
NDKException
public boolean equals(DCField oa)
oa
true
, if the type and length of
this NARField are the same as those for oa
public boolean equalsValue(DCField comparisonField)
public int writeValueToStream(java.io.OutputStream out) throws java.io.IOException
java.io.IOException
public void readValueFromStream(java.io.InputStream in) throws java.io.IOException
java.io.IOException