|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.nhncorp.neptune.common.io.NObjectWritable
public class NObjectWritable
A polymorphic Writable that writes an instance with it's class name. Handles arrays, strings and primitive types without a Writable wrapper.
| Field Summary | |
|---|---|
static org.apache.commons.logging.Log |
LOG
|
static short |
TYPE_DIFF
|
static short |
TYPE_SAME
|
| Constructor Summary | |
|---|---|
NObjectWritable()
|
|
NObjectWritable(java.lang.Class declaredClass,
java.lang.Object instance)
|
|
NObjectWritable(java.lang.Object instance)
|
|
| Method Summary | |
|---|---|
java.lang.Object |
get()
Return the instance, or null if none. |
NConfiguration |
getConf()
Return the configuration used by this object. |
java.lang.Class |
getDeclaredClass()
Return the class this is meant to be. |
static void |
main(java.lang.String[] args)
|
void |
readFields(java.io.DataInput in)
Reads the fields of this object from in. |
static java.lang.Object |
readObject(java.io.DataInput in,
NConfiguration conf)
Read a NWritable, String, primitive type, or an array of
the preceding. |
static java.lang.Object |
readObject(java.io.DataInput in,
NObjectWritable objectWritable,
NConfiguration conf)
|
static java.lang.Object |
readObject(java.io.DataInput in,
NObjectWritable objectWritable,
NConfiguration conf,
boolean arrayComponent,
java.lang.Class componentClass)
Read a NWritable, String, primitive type, or an array of
the preceding. |
void |
set(java.lang.Object instance)
Reset the instance. |
void |
setConf(NConfiguration conf)
Set the configuration to be used by this object. |
static java.lang.Object |
test(java.lang.Object instance,
java.lang.Class instanceClass)
|
static void |
testString()
|
java.lang.String |
toString()
|
void |
write(java.io.DataOutput out)
Writes the fields of this object to out. |
static void |
writeObject(java.io.DataOutput out,
java.lang.Object instance,
java.lang.Class declaredClass,
NConfiguration conf)
|
static void |
writeObject(java.io.DataOutput out,
java.lang.Object instance,
java.lang.Class declaredClass,
NConfiguration conf,
boolean arrayComponent)
Write a NWritable, String, primitive type, or an array of
the preceding. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final org.apache.commons.logging.Log LOG
public static final short TYPE_SAME
public static final short TYPE_DIFF
| Constructor Detail |
|---|
public NObjectWritable()
public NObjectWritable(java.lang.Object instance)
public NObjectWritable(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
NWritablein. For efficiency,
implementations should attempt to re-use storage in the existing object
where possible.
readFields in interface NWritablejava.io.IOException
public void write(java.io.DataOutput out)
throws java.io.IOException
NWritableout.
write in interface NWritablejava.io.IOException
public static void writeObject(java.io.DataOutput out,
java.lang.Object instance,
java.lang.Class declaredClass,
NConfiguration conf)
throws java.io.IOException
java.io.IOException
public static void writeObject(java.io.DataOutput out,
java.lang.Object instance,
java.lang.Class declaredClass,
NConfiguration conf,
boolean arrayComponent)
throws java.io.IOException
NWritable, String, primitive type, or an array of
the preceding.
java.io.IOException
public static java.lang.Object readObject(java.io.DataInput in,
NConfiguration conf)
throws java.io.IOException
NWritable, String, primitive type, or an array of
the preceding.
java.io.IOException
public static java.lang.Object readObject(java.io.DataInput in,
NObjectWritable objectWritable,
NConfiguration conf)
throws java.io.IOException
java.io.IOException
public static java.lang.Object readObject(java.io.DataInput in,
NObjectWritable objectWritable,
NConfiguration conf,
boolean arrayComponent,
java.lang.Class componentClass)
throws java.io.IOException
NWritable, String, primitive type, or an array of
the preceding.
java.io.IOExceptionpublic void setConf(NConfiguration conf)
NConfigurable
setConf in interface NConfigurablepublic NConfiguration getConf()
NConfigurable
getConf in interface NConfigurable
public static void main(java.lang.String[] args)
throws java.lang.Exception
java.lang.Exception
public static java.lang.Object test(java.lang.Object instance,
java.lang.Class instanceClass)
throws java.lang.Exception
java.lang.Exception
public static void testString()
throws java.lang.Exception
java.lang.Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||