A
- Type of first objectB
- Type of second objectpublic abstract class ReadWritableIndependentPair<A,B> extends IndependentPair<A,B> implements ReadWriteableBinary
Constructor and Description |
---|
ReadWritableIndependentPair(A obj1,
B obj2)
initialise with data
|
ReadWritableIndependentPair(IndependentPair<A,B> pair)
initialise with an existing pair
|
Modifier and Type | Method and Description |
---|---|
byte[] |
binaryHeader()
Header for binary input.
|
void |
readBinary(DataInput in)
Read internal state from in.
|
abstract A |
readFirst(DataInput in) |
abstract B |
readSecond(DataInput in) |
void |
writeBinary(DataOutput out)
Write the content of this as binary to out.
|
abstract void |
writeFirst(DataOutput out,
A firstObject)
first object written to out
|
abstract void |
writeSecond(DataOutput out,
B secondObject)
second object written to out
|
equals, firstObject, getFirst, getFirstFunction, getFirstObject, getSecond, getSecondFunction, getSecondObject, pair, pairList, secondObject, setFirstObject, setSecondObject, swap, swapList, toString
public ReadWritableIndependentPair(A obj1, B obj2)
obj1
- obj2
- public ReadWritableIndependentPair(IndependentPair<A,B> pair)
pair
- public void readBinary(DataInput in) throws IOException
ReadableBinary
readBinary
in interface ReadableBinary
in
- source to read from.IOException
- an error reading inputpublic abstract A readFirst(DataInput in) throws IOException
in
- IOException
public abstract B readSecond(DataInput in) throws IOException
in
- IOException
public abstract void writeFirst(DataOutput out, A firstObject) throws IOException
out
- firstObject
- IOException
public abstract void writeSecond(DataOutput out, B secondObject) throws IOException
out
- secondObject
- IOException
public byte[] binaryHeader()
ReadableBinary
binaryHeader
in interface ReadableBinary
binaryHeader
in interface WriteableBinary
public void writeBinary(DataOutput out) throws IOException
WriteableBinary
writeBinary
in interface WriteableBinary
out
- sink to write toIOException
- an error writing to out