public abstract class Outputs<T> extends Object
Note that any operation that returns NO_OUTPUT must
return the same singleton object from getNoOutput()
.
Constructor and Description |
---|
Outputs() |
Modifier and Type | Method and Description |
---|---|
abstract T |
add(T prefix,
T output)
Eg add("foo", "bar") -> "foobar"
|
abstract T |
common(T output1,
T output2)
Eg common("foobar", "food") -> "foo"
|
abstract T |
getNoOutput()
NOTE: this output is compared with == so you must
ensure that all methods return the single object if
it's really no output
|
T |
merge(T first,
T second) |
abstract String |
outputToString(T output) |
abstract T |
read(DataInput in)
Decode an output value previously written with
write(Object, DataOutput) . |
T |
readFinalOutput(DataInput in)
Decode an output value previously written with
writeFinalOutput(Object, DataOutput) . |
abstract T |
subtract(T output,
T inc)
Eg subtract("foobar", "foo") -> "bar"
|
abstract void |
write(T output,
DataOutput out)
Encode an output value into a
DataOutput . |
void |
writeFinalOutput(T output,
DataOutput out)
Encode an final node output value into a
DataOutput . |
public abstract void write(T output, DataOutput out) throws IOException
DataOutput
.IOException
public void writeFinalOutput(T output, DataOutput out) throws IOException
DataOutput
. By default this just calls write(Object,
DataOutput)
.IOException
public abstract T read(DataInput in) throws IOException
write(Object, DataOutput)
.IOException
public T readFinalOutput(DataInput in) throws IOException
writeFinalOutput(Object, DataOutput)
. By default this
just calls read(DataInput)
.IOException
public abstract T getNoOutput()
Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.