com.twitter.common.text.util
Interface TokenStreamSerializer.AttributeSerializer

All Known Implementing Classes:
CharSequenceTermAttributeSerializer, PositionIncrementAttributeSerializer, TokenTypeAttributeSerializer
Enclosing class:
TokenStreamSerializer

public static interface TokenStreamSerializer.AttributeSerializer

Defines how individual attributes a (de)serialized.


Method Summary
 void deserialize(TokenStreamSerializer.AttributeInputStream input, CharSequence charSequence)
          Deserializes a single attribute.
 void initialize(org.apache.lucene.util.AttributeSource attributeSource, TokenStreamSerializer.Version version)
          Initialises this AttributeSerializer.
 void serialize(TokenStreamSerializer.AttributeOutputStream output)
          Serializes a single attribute.
 

Method Detail

initialize

void initialize(org.apache.lucene.util.AttributeSource attributeSource,
                TokenStreamSerializer.Version version)
                throws IOException
Initialises this AttributeSerializer. This method should be used to get the attribute instance from the TokenStream that this serializer handles. E.g.: CharSequenceTermAttribute termAtt = attributeSource.addAttribute(CharSequenceTermAttribute.class);

Throws:
IOException

serialize

void serialize(TokenStreamSerializer.AttributeOutputStream output)
               throws IOException
Serializes a single attribute.

Throws:
IOException

deserialize

void deserialize(TokenStreamSerializer.AttributeInputStream input,
                 CharSequence charSequence)
                 throws IOException
Deserializes a single attribute.

Throws:
IOException