Top Description Fields Constructors Methods
org.jboss.marshalling.util

public abstract Class ReadField

extends Object
implements Comparable<ReadField>
Class Inheritance
All Implemented Interfaces
java.lang.Comparable
Known Direct Subclasses
org.jboss.marshalling.util.ShortReadField, org.jboss.marshalling.util.BooleanReadField, org.jboss.marshalling.util.ByteReadField, org.jboss.marshalling.util.CharReadField, org.jboss.marshalling.util.DoubleReadField, org.jboss.marshalling.util.FloatReadField, org.jboss.marshalling.util.IntReadField, org.jboss.marshalling.util.LongReadField, org.jboss.marshalling.util.ObjectReadField
Imports
java.io.IOException

Base class for a field which was read from the data stream.

Field Summary

Modifier and TypeField and Description
private final boolean
private final String

Constructor Summary

AccessConstructor and Description
protected
ReadField(final String
the field name
name
,
final boolean
true if the field's value was defaulted, false otherwise
defaulted
)

Construct a new instance.

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

the sort result based on the name of this field and the given field
compareTo
(final ReadField
the other field object
o
)

Implements java.lang.Comparable.compareTo.

Compare this field with another on the basis of its name.
public boolean

Returns:

the boolean value of this field
getBoolean
()

Get the boolean value of this field.

public byte

Returns:

the byte value of this field
getByte
()

Get the byte value of this field.

public char

Returns:

the character value of this field
getChar
()

Get the character value of this field.

public double

Returns:

the double value of this field
getDouble
()

Get the double value of this field.

public float

Returns:

the float value of this field
getFloat
()

Get the float value of this field.

public int

Returns:

the integer value of this field
getInt
()

Get the integer value of this field.

public abstract Kind

Returns:

the kind of field represented by this object
getKind
()

Get the kind of field represented by this object.

public long

Returns:

the long value of this field
getLong
()

Get the long value of this field.

public String

Returns:

the field name
getName
()

Get the field name.

public Object

Returns:

the object value of this field
getObject
()

Get the object value of this field.

public short

Returns:

the short value of this field
getShort
()

Get the short value of this field.

public boolean

Returns:

true if this field value was defaulted, false otherwise
isDefaulted
()

Determine whether this field was defaulted.

private static IllegalArgumentException
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

defaultedback to summary
private final boolean defaulted
nameback to summary
private final String name

Constructor Detail

ReadFieldback to summary
protected ReadField(final String name, final boolean defaulted)

Construct a new instance.

Parameters
name:String

the field name

defaulted:boolean

true if the field's value was defaulted, false otherwise

Method Detail

compareToback to summary
public int compareTo(final ReadField o)

Implements java.lang.Comparable.compareTo.

Compare this field with another on the basis of its name.

Parameters
o:ReadField

the other field object

Returns:int

the sort result based on the name of this field and the given field

getBooleanback to summary
public boolean getBoolean() throws IOException

Get the boolean value of this field.

Returns:boolean

the boolean value of this field

Exceptions
IOException:
if the value cannot be read
getByteback to summary
public byte getByte() throws IOException

Get the byte value of this field.

Returns:byte

the byte value of this field

Exceptions
IOException:
if the value cannot be read
getCharback to summary
public char getChar() throws IOException

Get the character value of this field.

Returns:char

the character value of this field

Exceptions
IOException:
if the value cannot be read
getDoubleback to summary
public double getDouble() throws IOException

Get the double value of this field.

Returns:double

the double value of this field

Exceptions
IOException:
if the value cannot be read
getFloatback to summary
public float getFloat() throws IOException

Get the float value of this field.

Returns:float

the float value of this field

Exceptions
IOException:
if the value cannot be read
getIntback to summary
public int getInt() throws IOException

Get the integer value of this field.

Returns:int

the integer value of this field

Exceptions
IOException:
if the value cannot be read
getKindback to summary
public abstract Kind getKind()

Get the kind of field represented by this object.

Returns:Kind

the kind of field represented by this object

getLongback to summary
public long getLong() throws IOException

Get the long value of this field.

Returns:long

the long value of this field

Exceptions
IOException:
if the value cannot be read
getNameback to summary
public String getName()

Get the field name.

Returns:String

the field name

getObjectback to summary
public Object getObject() throws IOException

Get the object value of this field.

Returns:Object

the object value of this field

Exceptions
IOException:
if the value cannot be read
getShortback to summary
public short getShort() throws IOException

Get the short value of this field.

Returns:short

the short value of this field

Exceptions
IOException:
if the value cannot be read
isDefaultedback to summary
public boolean isDefaulted()

Determine whether this field was defaulted.

Returns:boolean

true if this field value was defaulted, false otherwise

wrongFieldTypeback to summary
private static IllegalArgumentException wrongFieldType()