|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.EmulatedFields
class EmulatedFields
An EmulatedFields is an object that represents a set of emulated fields for an object being dumped or loaded. It allows objects to be dumped with a shape different than the fields they were declared to have.
ObjectInputStream.GetField,
ObjectOutputStream.PutField,
EmulatedFieldsForLoading,
EmulatedFieldsForDumping| Nested Class Summary | |
|---|---|
(package private) static class |
EmulatedFields.ObjectSlot
|
| Constructor Summary | |
|---|---|
EmulatedFields(ObjectStreamField[] fields,
ObjectStreamField[] declared)
Constructs a new instance of EmulatedFields. |
|
| Method Summary | |
|---|---|
boolean |
defaulted(String name)
Return a boolean indicating if the field named name has
been assigned a value explicitly (false) or if it still holds a default
value for the type (true) because it hasn't been assigned to yet. |
boolean |
get(String name,
boolean defaultValue)
Find and return the boolean value of a given field named name in the receiver. |
byte |
get(String name,
byte defaultValue)
Find and return the byte value of a given field named name
in the receiver. |
char |
get(String name,
char defaultValue)
Find and return the char value of a given field named name
in the receiver. |
double |
get(String name,
double defaultValue)
Find and return the double value of a given field named name
in the receiver. |
float |
get(String name,
float defaultValue)
Find and return the float value of a given field named name
in the receiver. |
int |
get(String name,
int defaultValue)
Find and return the int value of a given field named name
in the receiver. |
long |
get(String name,
long defaultValue)
Find and return the long value of a given field named name
in the receiver. |
Object |
get(String name,
Object defaultValue)
Find and return the Object value of a given field named name
in the receiver. |
short |
get(String name,
short defaultValue)
Find and return the short value of a given field named name
in the receiver. |
void |
put(String name,
boolean value)
Find and set the boolean value of a given field named name
in the receiver. |
void |
put(String name,
byte value)
Find and set the byte value of a given field named name in
the receiver. |
void |
put(String name,
char value)
Find and set the char value of a given field named name in
the receiver. |
void |
put(String name,
double value)
Find and set the double value of a given field named name
in the receiver. |
void |
put(String name,
float value)
Find and set the float value of a given field named name
in the receiver. |
void |
put(String name,
int value)
Find and set the int value of a given field named name in
the receiver. |
void |
put(String name,
long value)
Find and set the long value of a given field named name in
the receiver. |
void |
put(String name,
Object value)
Find and set the Object value of a given field named name
in the receiver. |
void |
put(String name,
short value)
Find and set the short value of a given field named name
in the receiver. |
EmulatedFields.ObjectSlot[] |
slots()
Return the array of ObjectSlot the receiver represents. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public EmulatedFields(ObjectStreamField[] fields,
ObjectStreamField[] declared)
fields - an array of ObjectStreamFields, which describe the fields to
be emulated (names, types, etc).declared - an array of ObjectStreamFields, which describe the declared
fields.| Method Detail |
|---|
public boolean defaulted(String name)
throws IllegalArgumentException
name has
been assigned a value explicitly (false) or if it still holds a default
value for the type (true) because it hasn't been assigned to yet.
name - a String, the name of the field to test
true if name still holds its
default value, false otherwise
IllegalArgumentException - If name is null
public byte get(String name,
byte defaultValue)
throws IllegalArgumentException
name
in the receiver. If the field has not been assigned any value yet, the
default value defaultValue is returned instead.
name - A String, the name of the field to finddefaultValue - Return value in case the field has not been assigned to yet.
IllegalArgumentException - If the corresponding field can not be found.
public char get(String name,
char defaultValue)
throws IllegalArgumentException
name
in the receiver. If the field has not been assigned any value yet, the
default value defaultValue is returned instead.
name - A String, the name of the field to finddefaultValue - Return value in case the field has not been assigned to yet.
IllegalArgumentException - If the corresponding field can not be found.
public double get(String name,
double defaultValue)
throws IllegalArgumentException
name
in the receiver. If the field has not been assigned any value yet, the
default value defaultValue is returned instead.
name - A String, the name of the field to finddefaultValue - Return value in case the field has not been assigned to yet.
IllegalArgumentException - If the corresponding field can not be found.
public float get(String name,
float defaultValue)
throws IllegalArgumentException
name
in the receiver. If the field has not been assigned any value yet, the
default value defaultValue is returned instead.
name - A String, the name of the field to finddefaultValue - Return value in case the field has not been assigned to yet.
IllegalArgumentException - If the corresponding field can not be found.
public int get(String name,
int defaultValue)
throws IllegalArgumentException
name
in the receiver. If the field has not been assigned any value yet, the
default value defaultValue is returned instead.
name - A String, the name of the field to finddefaultValue - Return value in case the field has not been assigned to yet.
IllegalArgumentException - If the corresponding field can not be found.
public long get(String name,
long defaultValue)
throws IllegalArgumentException
name
in the receiver. If the field has not been assigned any value yet, the
default value defaultValue is returned instead.
name - A String, the name of the field to finddefaultValue - Return value in case the field has not been assigned to yet.
IllegalArgumentException - If the corresponding field can not be found.
public Object get(String name,
Object defaultValue)
throws IllegalArgumentException
name
in the receiver. If the field has not been assigned any value yet, the
default value defaultValue is returned instead.
name - A String, the name of the field to finddefaultValue - Return value in case the field has not been assigned to yet.
IllegalArgumentException - If the corresponding field can not be found.
public short get(String name,
short defaultValue)
throws IllegalArgumentException
name
in the receiver. If the field has not been assigned any value yet, the
default value defaultValue is returned instead.
name - A String, the name of the field to finddefaultValue - Return value in case the field has not been assigned to yet.
IllegalArgumentException - If the corresponding field can not be found.
public boolean get(String name,
boolean defaultValue)
throws IllegalArgumentException
name in the receiver. If the field has not been assigned
any value yet, the default value defaultValue is returned
instead.
name - A String, the name of the field to finddefaultValue - Return value in case the field has not been assigned to yet.
IllegalArgumentException - If the corresponding field can not be found.
public void put(String name,
byte value)
throws IllegalArgumentException
name in
the receiver.
name - A String, the name of the field to setvalue - New value for the field.
IllegalArgumentException - If the corresponding field can not be found.
public void put(String name,
char value)
throws IllegalArgumentException
name in
the receiver.
name - A String, the name of the field to setvalue - New value for the field.
IllegalArgumentException - If the corresponding field can not be found.
public void put(String name,
double value)
throws IllegalArgumentException
name
in the receiver.
name - A String, the name of the field to setvalue - New value for the field.
IllegalArgumentException - If the corresponding field can not be found.
public void put(String name,
float value)
throws IllegalArgumentException
name
in the receiver.
name - A String, the name of the field to setvalue - New value for the field.
IllegalArgumentException - If the corresponding field can not be found.
public void put(String name,
int value)
throws IllegalArgumentException
name in
the receiver.
name - A String, the name of the field to setvalue - New value for the field.
IllegalArgumentException - If the corresponding field can not be found.
public void put(String name,
long value)
throws IllegalArgumentException
name in
the receiver.
name - A String, the name of the field to setvalue - New value for the field.
IllegalArgumentException - If the corresponding field can not be found.
public void put(String name,
Object value)
throws IllegalArgumentException
name
in the receiver.
name - A String, the name of the field to setvalue - New value for the field.
IllegalArgumentException - If the corresponding field can not be found.
public void put(String name,
short value)
throws IllegalArgumentException
name
in the receiver.
name - A String, the name of the field to setvalue - New value for the field.
IllegalArgumentException - If the corresponding field can not be found.
public void put(String name,
boolean value)
throws IllegalArgumentException
name
in the receiver.
name - A String, the name of the field to setvalue - New value for the field.
IllegalArgumentException - If the corresponding field can not be found.public EmulatedFields.ObjectSlot[] slots()
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||