|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.io.ObjectWritable
public class ObjectWritable
A polymorphic Writable that writes an instance with it's class name. Handles arrays, strings and primitive types without a Writable wrapper.
Constructor Summary | |
---|---|
ObjectWritable()
|
|
ObjectWritable(java.lang.Class declaredClass,
java.lang.Object instance)
|
|
ObjectWritable(java.lang.Object instance)
|
Method Summary | |
---|---|
java.lang.Object |
get()
Return the instance, or null if none. |
Configuration |
getConf()
Return the configuration used by this object. |
java.lang.Class |
getDeclaredClass()
Return the class this is meant to be. |
void |
readFields(java.io.DataInput in)
Deserialize the fields of this object from in . |
static java.lang.Object |
readObject(java.io.DataInput in,
Configuration conf)
Read a Writable , String , primitive type, or an array of
the preceding. |
static java.lang.Object |
readObject(java.io.DataInput in,
ObjectWritable objectWritable,
Configuration conf)
Read a Writable , String , primitive type, or an array of
the preceding. |
void |
set(java.lang.Object instance)
Reset the instance. |
void |
setConf(Configuration conf)
Set the configuration to be used by this object. |
java.lang.String |
toString()
|
void |
write(java.io.DataOutput out)
Serialize the fields of this object to out . |
static void |
writeObject(java.io.DataOutput out,
java.lang.Object instance,
java.lang.Class declaredClass,
Configuration conf)
Write a Writable , String , primitive type, or an array of
the preceding. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ObjectWritable()
public ObjectWritable(java.lang.Object instance)
public ObjectWritable(java.lang.Class declaredClass, java.lang.Object instance)
Method Detail |
---|
public java.lang.Object get()
public java.lang.Class getDeclaredClass()
public void set(java.lang.Object instance)
public java.lang.String toString()
toString
in class java.lang.Object
public void readFields(java.io.DataInput in) throws java.io.IOException
Writable
in
.
For efficiency, implementations should attempt to re-use storage in the existing object where possible.
readFields
in interface Writable
in
- DataInput
to deseriablize this object from.
java.io.IOException
public void write(java.io.DataOutput out) throws java.io.IOException
Writable
out
.
write
in interface Writable
out
- DataOuput
to serialize this object into.
java.io.IOException
public static void writeObject(java.io.DataOutput out, java.lang.Object instance, java.lang.Class declaredClass, Configuration conf) throws java.io.IOException
Writable
, String
, primitive type, or an array of
the preceding.
java.io.IOException
public static java.lang.Object readObject(java.io.DataInput in, Configuration conf) throws java.io.IOException
Writable
, String
, primitive type, or an array of
the preceding.
java.io.IOException
public static java.lang.Object readObject(java.io.DataInput in, ObjectWritable objectWritable, Configuration conf) throws java.io.IOException
Writable
, String
, primitive type, or an array of
the preceding.
java.io.IOException
public void setConf(Configuration conf)
Configurable
setConf
in interface Configurable
public Configuration getConf()
Configurable
getConf
in interface Configurable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |