java.lang.Object
org.jboss.marshalling.util.ReadField
- All Implemented Interfaces:
Comparable<ReadField>
- Direct Known Subclasses:
BooleanReadField,ByteReadField,DoubleReadField,FloatReadField,CharReadField,IntReadField,LongReadField,ObjectReadField,ShortReadField
Base class for a field which was read from the data stream.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintCompare this field with another on the basis of its name.booleanGet the boolean value of this field.bytegetByte()Get the byte value of this field.doubleGet the double value of this field.floatgetFloat()Get the float value of this field.chargetChar()Get the character value of this field.intgetInt()Get the integer value of this field.abstract KindgetKind()Get the kind of field represented by this object.longgetLong()Get the long value of this field.getName()Get the field name.Get the object value of this field.shortgetShort()Get the short value of this field.booleanDetermine whether this field was defaulted.
-
Constructor Details
-
ReadField
Construct a new instance.- Parameters:
name- the field namedefaulted-trueif the field's value was defaulted,falseotherwise
-
-
Method Details
-
getKind
Get the kind of field represented by this object.- Returns:
- the kind of field represented by this object
-
getName
Get the field name.- Returns:
- the field name
-
isDefaulted
public boolean isDefaulted()Determine whether this field was defaulted.- Returns:
trueif this field value was defaulted,falseotherwise
-
getBoolean
Get the boolean value of this field.- Returns:
- the boolean value of this field
- Throws:
IOException- if the value cannot be read
-
getChar
Get the character value of this field.- Returns:
- the character value of this field
- Throws:
IOException- if the value cannot be read
-
getFloat
Get the float value of this field.- Returns:
- the float value of this field
- Throws:
IOException- if the value cannot be read
-
getDouble
Get the double value of this field.- Returns:
- the double value of this field
- Throws:
IOException- if the value cannot be read
-
getByte
Get the byte value of this field.- Returns:
- the byte value of this field
- Throws:
IOException- if the value cannot be read
-
getShort
Get the short value of this field.- Returns:
- the short value of this field
- Throws:
IOException- if the value cannot be read
-
getInt
Get the integer value of this field.- Returns:
- the integer value of this field
- Throws:
IOException- if the value cannot be read
-
getLong
Get the long value of this field.- Returns:
- the long value of this field
- Throws:
IOException- if the value cannot be read
-
getObject
Get the object value of this field.- Returns:
- the object value of this field
- Throws:
IOException- if the value cannot be read
-
compareTo
Compare this field with another on the basis of its name.- Specified by:
compareToin interfaceComparable<ReadField>- Parameters:
o- the other field object- Returns:
- the sort result based on the name of this field and the given field
-