public class WritableUnion extends Object implements Union, org.apache.hadoop.io.Writable
| Modifier | Constructor and Description |
|---|---|
protected |
WritableUnion(Class<?>... classes)
Creates a new instance.
|
protected |
WritableUnion(org.apache.hadoop.io.Writable... objects)
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
Object |
getObject()
Returns the current object in union.
|
int |
getPosition()
Returns the current position in union.
|
void |
readFields(DataInput in) |
Object |
switchObject(int newPosition)
Switches position and get its object.
|
String |
toString() |
void |
write(DataOutput out) |
protected WritableUnion(Class<?>... classes)
classes - element classesIllegalArgumentException - if some parameters were nullprotected WritableUnion(org.apache.hadoop.io.Writable... objects)
objects - elementsIllegalArgumentException - if some parameters were nullpublic final int getPosition()
UniongetPosition in interface Unionpublic Object switchObject(int newPosition)
UnionswitchObject in interface UnionnewPosition - the position to setpublic final Object getObject()
Unionpublic void write(DataOutput out) throws IOException
write in interface org.apache.hadoop.io.WritableIOExceptionpublic void readFields(DataInput in) throws IOException
readFields in interface org.apache.hadoop.io.WritableIOExceptionCopyright © 2011–2019 Asakusa Framework Team. All rights reserved.