Package org.apache.lucene.index

Examples of org.apache.lucene.index.Payload


    @Override
    public boolean incrementToken() throws IOException {
      boolean result = false;
      if (input.incrementToken()) {
        if (numSeen % 2 == 0) {
          payAtt.setPayload(new Payload(payload2));
        } else {
          payAtt.setPayload(new Payload(payload4));
        }
        numSeen++;
        result = true;
      }
      return result;
View Full Code Here


     * @param type
     *            the JCR property type.
     */
    public SingletonTokenStream(String value, int type) {
        this.value = value;
        this.payload = new Payload(new PropertyMetaData(type).toByteArray());
    }
View Full Code Here

     * @param value the string value that will be returned with the token.
     * @param type the JCR property type.
     */
    public SingletonTokenStream(String value, int type) {
        this.value = value;
        this.payload = new Payload(new PropertyMetaData(type).toByteArray());
    }
View Full Code Here

     *            the string value that will be returned with the token.
     * @param type
     *            the JCR property type.
     */
    public SingletonTokenStream(String value, int type) {
        this(value, new Payload(new PropertyMetaData(type).toByteArray()));
    }
View Full Code Here

    public Token next() throws IOException {
      Token result = input.next();
      if (result != null) {
        if (fieldName.equals("field"))
        {
          result.setPayload(new Payload(payloadField));
        }
        else if (fieldName.equals("multiField"))
        {
          if (numSeen  % 2 == 0)
          {
            result.setPayload(new Payload(payloadMultiField1));
          }
          else
          {
            result.setPayload(new Payload(payloadMultiField2));
          }
          numSeen++;
        }

      }
View Full Code Here

      data[--off] = (byte)(id);
      id >>>= 8;
    }
    while(id > 0);
   
    return new Payload(data, off, data.length - off);
  }
View Full Code Here

      buf[i++] = (byte)(datum >>> 8);
      buf[i++] = (byte)(datum >>> 16);
      buf[i++] = (byte)(datum >>> 24);
    }
   
    _payload = new Payload(buf);
    _returnToken = true;
  }
View Full Code Here

  @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

    * @param type
    *            the JCR property type.
    */
   public SingletonTokenStream(String value, int type)
   {
      this(value, new Payload(new PropertyMetaData(type).toByteArray()));
   }
View Full Code Here

     * @param type the JCR property type.
     */
    public SingletonTokenStream(String value, int type) {
        super();
        t = new Token(value, 0, value.length());
        t.setPayload(new Payload(new PropertyMetaData(type).toByteArray()));
    }
View Full Code Here

TOP

Related Classes of org.apache.lucene.index.Payload

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.