org.apache.lucene.util.fst
Class ByteSequenceOutputs

java.lang.Object
  extended by org.apache.lucene.util.fst.Outputs<BytesRef>
      extended by org.apache.lucene.util.fst.ByteSequenceOutputs

public final class ByteSequenceOutputs
extends Outputs<BytesRef>

Output is a sequence of bytes, for each input term.

WARNING: This API is experimental and might change in incompatible ways in the next release.

Method Summary
 BytesRef add(BytesRef prefix, BytesRef output)
          Eg add("foo", "bar") -> "foobar"
 BytesRef common(BytesRef output1, BytesRef output2)
          Eg common("foo", "foobar") -> "foo"
 BytesRef getNoOutput()
          NOTE: this output is compared with == so you must ensure that all methods return the single object if it's really no output
static ByteSequenceOutputs getSingleton()
           
 String outputToString(BytesRef output)
           
 BytesRef read(DataInput in)
           
 BytesRef subtract(BytesRef output, BytesRef inc)
          Eg subtract("foobar", "foo") -> "bar"
 void write(BytesRef prefix, DataOutput out)
           
 
Methods inherited from class org.apache.lucene.util.fst.Outputs
merge
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getSingleton

public static ByteSequenceOutputs getSingleton()

common

public BytesRef common(BytesRef output1,
                       BytesRef output2)
Description copied from class: Outputs
Eg common("foo", "foobar") -> "foo"

Specified by:
common in class Outputs<BytesRef>

subtract

public BytesRef subtract(BytesRef output,
                         BytesRef inc)
Description copied from class: Outputs
Eg subtract("foobar", "foo") -> "bar"

Specified by:
subtract in class Outputs<BytesRef>

add

public BytesRef add(BytesRef prefix,
                    BytesRef output)
Description copied from class: Outputs
Eg add("foo", "bar") -> "foobar"

Specified by:
add in class Outputs<BytesRef>

write

public void write(BytesRef prefix,
                  DataOutput out)
           throws IOException
Specified by:
write in class Outputs<BytesRef>
Throws:
IOException

read

public BytesRef read(DataInput in)
              throws IOException
Specified by:
read in class Outputs<BytesRef>
Throws:
IOException

getNoOutput

public BytesRef getNoOutput()
Description copied from class: Outputs
NOTE: this output is compared with == so you must ensure that all methods return the single object if it's really no output

Specified by:
getNoOutput in class Outputs<BytesRef>

outputToString

public String outputToString(BytesRef output)
Specified by:
outputToString in class Outputs<BytesRef>


Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.