java.io
public class ObjectStreamField extends Object implements Comparable<Object>
Constructor Summary | |
---|---|
ObjectStreamField(String name, Class<?> type)
This constructor creates an ObjectStreamField instance
which represents a field named name and is
of the type type .
| |
ObjectStreamField(String name, Class<?> type, boolean unshared)
This constructor creates an ObjectStreamField instance
which represents a field named name and is
of the type type .
|
Method Summary | |
---|---|
int | compareTo(Object obj)
Compares this object to the given object.
|
String | getName()
This method returns the name of the field represented by the
ObjectStreamField instance.
|
int | getOffset()
This method returns the current offset of the field in
the serialization stream relatively to the other fields.
|
Class<?> | getType()
This method returns the class representing the type of the
field which is represented by this instance of ObjectStreamField.
|
char | getTypeCode()
This method returns the char encoded type of the field which
is represented by this instance of ObjectStreamField.
|
String | getTypeString()
This method returns a more explicit type name than
{@link #getTypeCode()} in the case the type is a real
class (and not a primitive).
|
boolean | isPrimitive()
This method returns true if the type of the field
represented by this instance is a primitive.
|
boolean | isUnshared()
This method returns whether the field represented by this object is
unshared or not.
|
protected void | setOffset(int off)
This method sets the current offset of the field.
|
String | toString()
Returns a string representing this object.
|
name
and is
of the type type
.
Parameters: name Name of the field to export. type Type of the field in the concerned class.
name
and is
of the type type
.
Parameters: name Name of the field to export. type Type of the field in the concerned class. unshared true if field will be unshared, false otherwise.
Parameters: obj the object to compare to.
Returns: -1, 0 or 1.
Returns: A string containing the name of the field.
Returns: The offset of the field in bytes.
See Also: ObjectStreamField
Returns: A class representing the type of the field.
Returns: A char representing the type of the field.
Returns: The name of the type (class name) if it is not a primitive, in the other case null is returned.
Returns: true if the type is a primitive, false in the other case.
Returns: Tells if this field is unshared or not.
Parameters: off The offset of the field in bytes.
See Also: getOffset
Returns: the string.