net.conquiris.lucene.document
Class BaseNumericFieldBuilder<B extends BaseNumericFieldBuilder<B>>

java.lang.Object
  extended by net.derquinse.common.reflect.This<B>
      extended by net.conquiris.lucene.document.FieldableBuilder<B>
          extended by net.conquiris.lucene.document.BaseNumericFieldBuilder<B>
Direct Known Subclasses:
BaseDocumentBuilder.DocNumericFieldBuilder, NumericFieldBuilder

public abstract class BaseNumericFieldBuilder<B extends BaseNumericFieldBuilder<B>>
extends FieldableBuilder<B>

Base class for numeric field builders. Numeric fields are indexed but not stored by default.

Author:
Andres Rodriguez

Method Summary
 org.apache.lucene.document.NumericField build(double value)
          Builds a numeric field with the current information and a double value.
 org.apache.lucene.document.NumericField build(float value)
          Builds a numeric field with the current information and a float value.
 org.apache.lucene.document.NumericField build(int value)
          Builds a numeric field with the current information and an int value.
 org.apache.lucene.document.NumericField build(long value)
          Builds a numeric field with the current information and a long value.
 B index(boolean index)
          Sets whether to index the field.
 boolean isIndexed()
          Returns whether the field will be indexed.
 
Methods inherited from class net.conquiris.lucene.document.FieldableBuilder
store, store, store
 
Methods inherited from class net.derquinse.common.reflect.This
thisValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isIndexed

public final boolean isIndexed()
Returns whether the field will be indexed.


index

public final B index(boolean index)
Sets whether to index the field.


build

public final org.apache.lucene.document.NumericField build(int value)
Builds a numeric field with the current information and an int value.

Parameters:
value - Field value.
Returns:
The created field.
Throws:
IllegalStateException - if the field is neither stored nor indexed.

build

public final org.apache.lucene.document.NumericField build(long value)
Builds a numeric field with the current information and a long value.

Parameters:
value - Field value.
Returns:
The created field.
Throws:
IllegalStateException - if the field is neither stored nor indexed.

build

public final org.apache.lucene.document.NumericField build(float value)
Builds a numeric field with the current information and a float value.

Parameters:
value - Field value.
Returns:
The created field.
Throws:
IllegalStateException - if the field is neither stored nor indexed.

build

public final org.apache.lucene.document.NumericField build(double value)
Builds a numeric field with the current information and a double value.

Parameters:
value - Field value.
Returns:
The created field.
Throws:
IllegalStateException - if the field is neither stored nor indexed.


Copyright © 2012 Derquinse Projects.. All Rights Reserved.