thinkmap.server.search
Class FieldDef<T>

java.lang.Object
  extended by thinkmap.server.search.FieldDef<T>
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
FieldDef.ArrayDef, FieldDef.BooleanDef, FieldDef.CharDef, FieldDef.ClassDef, FieldDef.DateDef, FieldDef.NumericDef, FieldDef.ObjectDef, FieldDef.StringDef

public abstract class FieldDef<T>
extends Object
implements Serializable

See Also:
Serialized Form

Nested Class Summary
static class FieldDef.ArrayDef<T>
           
static class FieldDef.BigDecimalDef
           
static class FieldDef.BooleanDef
           
static class FieldDef.ByteDef
           
static class FieldDef.CharDef
           
static class FieldDef.ClassDef
           
static class FieldDef.DateDef
           
static class FieldDef.DoubleDef
           
static class FieldDef.FloatDef
           
static class FieldDef.IntegerDef
           
static class FieldDef.LongDef
           
static class FieldDef.NumericDef<T extends Number>
           
static class FieldDef.ObjectDef<T>
           
static class FieldDef.ShortDef
           
static class FieldDef.StringDef
           
 
Field Summary
protected  org.apache.lucene.analysis.Analyzer analyzer
           
protected  org.apache.lucene.document.Fieldable field
           
protected  String name
           
 
Constructor Summary
protected FieldDef(String name)
           
 
Method Summary
 T convertTo(Object value)
           
abstract  T decode(String s)
           
 T decodeValue(org.apache.lucene.document.Document d)
           
abstract  String encode(T o)
           
abstract  void encodeValue(org.apache.lucene.document.Document d, T value)
           
 boolean equals(Object obj)
           
static
<T> FieldDef<T>
fieldFor(String name, Class<T> type)
           
 org.apache.lucene.analysis.Analyzer getAnalyzer()
           
 org.apache.lucene.document.Fieldable getField()
           
 String getName()
           
abstract  Class<T> getType()
           
 int hashCode()
           
 String humanEncode(T o)
           
 org.apache.lucene.analysis.Analyzer initAnalyzer()
           
protected  org.apache.lucene.document.Fieldable initField()
           
 boolean isIndexed()
           
protected  org.apache.lucene.search.Query range(T lower, T upper, boolean lowerInclusive, boolean upperInclusive)
           
 org.apache.lucene.search.Query termQuery(Object term)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

protected String name

field

protected transient org.apache.lucene.document.Fieldable field

analyzer

protected transient org.apache.lucene.analysis.Analyzer analyzer
Constructor Detail

FieldDef

protected FieldDef(String name)
Method Detail

fieldFor

public static <T> FieldDef<T> fieldFor(String name,
                                       Class<T> type)

convertTo

public T convertTo(Object value)

getType

public abstract Class<T> getType()

isIndexed

public boolean isIndexed()

range

protected org.apache.lucene.search.Query range(T lower,
                                               T upper,
                                               boolean lowerInclusive,
                                               boolean upperInclusive)

getName

public String getName()

decodeValue

public T decodeValue(org.apache.lucene.document.Document d)

encodeValue

public abstract void encodeValue(org.apache.lucene.document.Document d,
                                 T value)

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

getField

public org.apache.lucene.document.Fieldable getField()

initField

protected org.apache.lucene.document.Fieldable initField()

initAnalyzer

public org.apache.lucene.analysis.Analyzer initAnalyzer()

getAnalyzer

public org.apache.lucene.analysis.Analyzer getAnalyzer()

decode

public abstract T decode(String s)

encode

public abstract String encode(T o)

humanEncode

public String humanEncode(T o)

termQuery

public org.apache.lucene.search.Query termQuery(Object term)


Copyright © 2013 Thinkmap, Inc. All Rights Reserved.