public class WritableRawComparableUnion extends Object implements Union, WritableRawComparable
| Constructor and Description |
|---|
WritableRawComparableUnion(Class<?>... classes)
Creates a new instance.
|
WritableRawComparableUnion(WritableRawComparable... objects)
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareInBytes(byte[] b1,
int o1,
byte[] b2,
int o2)
Compares two objects in bytes.
|
int |
compareTo(WritableRawComparable o) |
boolean |
equals(Object obj) |
Object |
getObject()
Returns the current object in union.
|
int |
getPosition()
Returns the current position in union.
|
int |
getSizeInBytes(byte[] buf,
int offset)
Computes and returns size in bytes.
|
int |
hashCode() |
void |
readFields(DataInput in) |
Object |
switchObject(int newPosition)
Switches position and get its object.
|
String |
toString() |
void |
write(DataOutput out) |
public WritableRawComparableUnion(Class<?>... classes)
classes - element classesIllegalArgumentException - if some parameters were nullpublic WritableRawComparableUnion(WritableRawComparable... 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.WritableIOExceptionpublic int compareTo(WritableRawComparable o)
compareTo in interface Comparable<WritableRawComparable>public int getSizeInBytes(byte[] buf,
int offset)
throws IOException
WritableRawComparablegetSizeInBytes in interface WritableRawComparablebuf - bytes arrayoffset - bytes offsetIOException - if failed to compute sizepublic int compareInBytes(byte[] b1,
int o1,
byte[] b2,
int o2)
throws IOException
WritableRawComparablecompareInBytes in interface WritableRawComparableb1 - bytes representation of the first objecto1 - offset of the first objectb2 - bytes representation of the second objecto2 - offset of the second objectIOException - if failed to comparisonCopyright © 2011–2018 Asakusa Framework Team. All rights reserved.