Package org.apache.lucene.util

Examples of org.apache.lucene.util.AttributeImpl


    getAttributes().add( attr );
  }

  @Override
  public void addTypeAttribute(String type) {
    AttributeImpl attr = AttributeSource.AttributeFactory
        .DEFAULT_ATTRIBUTE_FACTORY
        .createAttributeInstance( TypeAttribute.class );
    ( (TypeAttribute) attr ).setType( type );
    getAttributes().add( attr );
  }
View Full Code Here


    getAttributes().add( attr );
  }

  @Override
  public void addOffsetAttribute(int startOffset, int endOffset) {
    AttributeImpl attr = AttributeSource.AttributeFactory
        .DEFAULT_ATTRIBUTE_FACTORY
        .createAttributeInstance( OffsetAttribute.class );
    ( (OffsetAttribute) attr ).setOffset( startOffset, endOffset );
    getAttributes().add( attr );
  }
View Full Code Here

    getAttributes().add( attr );
  }

  @Override
  public void addCharTermAttribute(CharSequence sequence) {
    AttributeImpl attr = AttributeSource.AttributeFactory
        .DEFAULT_ATTRIBUTE_FACTORY
        .createAttributeInstance( CharTermAttribute.class );
    ( (CharTermAttribute) attr ).append( sequence );
    getAttributes().add( attr );
  }
View Full Code Here

    getAttributes().add( attr );
  }

  @Override
  public void addPayloadAttribute(byte[] payloads) {
    AttributeImpl attr = AttributeSource.AttributeFactory
        .DEFAULT_ATTRIBUTE_FACTORY
        .createAttributeInstance( PayloadAttribute.class );
    ( (PayloadAttribute) attr ).setPayload( new Payload( payloads ) );
    getAttributes().add( attr );
  }
View Full Code Here

    getAttributes().add( attr );
  }

  @Override
  public void addKeywordAttribute(boolean isKeyword) {
    AttributeImpl attr = AttributeSource.AttributeFactory
        .DEFAULT_ATTRIBUTE_FACTORY
        .createAttributeInstance( KeywordAttribute.class );
    ( (KeywordAttribute) attr ).setKeyword( isKeyword );
    getAttributes().add( attr );
  }
View Full Code Here

    getAttributes().add( attr );
  }

  @Override
  public void addPositionIncrementAttribute(int positionIncrement) {
    AttributeImpl attr = AttributeSource.AttributeFactory
        .DEFAULT_ATTRIBUTE_FACTORY
        .createAttributeInstance( PositionIncrementAttribute.class );
    ( (PositionIncrementAttribute) attr ).setPositionIncrement( positionIncrement );
    getAttributes().add( attr );
  }
View Full Code Here

    getAttributes().add( attr );
  }

  @Override
  public void addFlagsAttribute(int flags) {
    AttributeImpl attr = AttributeSource.AttributeFactory
        .DEFAULT_ATTRIBUTE_FACTORY
        .createAttributeInstance( FlagsAttribute.class );
    ( (FlagsAttribute) attr ).setFlags( flags );
    getAttributes().add( attr );
  }
View Full Code Here

    getAttributes().add( attr );
  }

  @Override
  public void addTypeAttribute(String type) {
    AttributeImpl attr = AttributeSource.AttributeFactory
        .DEFAULT_ATTRIBUTE_FACTORY
        .createAttributeInstance( TypeAttribute.class );
    ( (TypeAttribute) attr ).setType( type );
    getAttributes().add( attr );
  }
View Full Code Here

    getAttributes().add( attr );
  }

  @Override
  public void addOffsetAttribute(int startOffset, int endOffset) {
    AttributeImpl attr = AttributeSource.AttributeFactory
        .DEFAULT_ATTRIBUTE_FACTORY
        .createAttributeInstance( OffsetAttribute.class );
    ( (OffsetAttribute) attr ).setOffset( startOffset, endOffset );
    getAttributes().add( attr );
  }
View Full Code Here

      List<AttributeImpl> copyToken = serCopy.getStream().get( i );
      if ( origToken.size() != copyToken.size() ) {
        return false;
      }
      for ( int j = 0; j < origToken.size(); j++ ) {
        AttributeImpl origAttr = origToken.get( j );
        AttributeImpl copyAttr = copyToken.get( j );
        if ( origAttr.getClass() != copyAttr.getClass() ) {
          return false;
        }
        testAttributeTypes( origAttr, copyAttr );
      }
    }
View Full Code Here

TOP

Related Classes of org.apache.lucene.util.AttributeImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.