org.apache.lucene.util.fst
Class Outputs<T>

java.lang.Object
  extended by org.apache.lucene.util.fst.Outputs<T>
Direct Known Subclasses:
ByteSequenceOutputs, IntSequenceOutputs, NoOutputs, PairOutputs, PositiveIntOutputs, UpToTwoPositiveIntOutputs

public abstract class Outputs<T>
extends Object

Represents the outputs for an FST, providing the basic algebra needed for the FST.

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

Constructor Summary
Outputs()
           
 
Method Summary
abstract  T add(T prefix, T output)
          Eg add("foo", "bar") -> "foobar"
abstract  T common(T output1, T output2)
          Eg common("foo", "foobar") -> "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)
           
abstract  T subtract(T output, T inc)
          Eg subtract("foobar", "foo") -> "bar"
abstract  void write(T output, DataOutput out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Outputs

public Outputs()
Method Detail

common

public abstract T common(T output1,
                         T output2)
Eg common("foo", "foobar") -> "foo"


subtract

public abstract T subtract(T output,
                           T inc)
Eg subtract("foobar", "foo") -> "bar"


add

public abstract T add(T prefix,
                      T output)
Eg add("foo", "bar") -> "foobar"


write

public abstract void write(T output,
                           DataOutput out)
                    throws IOException
Throws:
IOException

read

public abstract T read(DataInput in)
                throws IOException
Throws:
IOException

getNoOutput

public 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


outputToString

public abstract String outputToString(T output)

merge

public T merge(T first,
               T second)


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