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 long |
ramBytesUsed(T output)
Return memory usage for the provided 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) . |
void |
skipFinalOutput(DataInput in)
Skip the output previously written with
writeFinalOutput(T, org.apache.lucene.store.DataOutput) ;
defaults to just calling readFinalOutput(org.apache.lucene.store.DataInput) and discarding
the result. |
void |
skipOutput(DataInput in)
Skip the output; defaults to just calling
read(org.apache.lucene.store.DataInput)
and discarding the result. |
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 void skipOutput(DataInput in) throws IOException
read(org.apache.lucene.store.DataInput)
and discarding the result.IOException
public T readFinalOutput(DataInput in) throws IOException
writeFinalOutput(Object, DataOutput)
. By default this
just calls read(DataInput)
.IOException
public void skipFinalOutput(DataInput in) throws IOException
writeFinalOutput(T, org.apache.lucene.store.DataOutput)
;
defaults to just calling readFinalOutput(org.apache.lucene.store.DataInput)
and discarding
the result.IOException
public abstract T getNoOutput()
public abstract long ramBytesUsed(T output)
Accountable
Copyright © 2000-2019 Apache Software Foundation. All Rights Reserved.