Package org.apache.lucene.util
Class AttributeFactory.StaticImplementationAttributeFactory<A extends AttributeImpl>
- java.lang.Object
-
- org.apache.lucene.util.AttributeFactory
-
- org.apache.lucene.util.AttributeFactory.StaticImplementationAttributeFactory<A>
-
- Direct Known Subclasses:
CollationAttributeFactory
,ICUCollationAttributeFactory
- Enclosing class:
- AttributeFactory
public abstract static class AttributeFactory.StaticImplementationAttributeFactory<A extends AttributeImpl> extends AttributeFactory
Expert: AttributeFactory returning an instance of the givenclazz
for the attributes it implements. For all other attributes it calls the given delegate factory as fallback. This class can be used to prefer a specificAttributeImpl
which combines multiple attributes over separate classes.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.lucene.util.AttributeFactory
AttributeFactory.StaticImplementationAttributeFactory<A extends AttributeImpl>
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Class<A>
clazz
private AttributeFactory
delegate
-
Fields inherited from class org.apache.lucene.util.AttributeFactory
DEFAULT_ATTRIBUTE_FACTORY
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
StaticImplementationAttributeFactory(AttributeFactory delegate, java.lang.Class<A> clazz)
Expert: Creates an AttributeFactory returningclazz
as instance for the attributes it implements and for all other attributes calls the given delegate factory.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description AttributeImpl
createAttributeInstance(java.lang.Class<? extends Attribute> attClass)
Returns anAttributeImpl
for the suppliedAttribute
interface class.protected abstract A
createInstance()
Creates an instance ofA
.boolean
equals(java.lang.Object other)
int
hashCode()
-
Methods inherited from class org.apache.lucene.util.AttributeFactory
findAttributeImplCtor, getStaticImplementation
-
-
-
-
Field Detail
-
delegate
private final AttributeFactory delegate
-
clazz
private final java.lang.Class<A extends AttributeImpl> clazz
-
-
Constructor Detail
-
StaticImplementationAttributeFactory
protected StaticImplementationAttributeFactory(AttributeFactory delegate, java.lang.Class<A> clazz)
Expert: Creates an AttributeFactory returningclazz
as instance for the attributes it implements and for all other attributes calls the given delegate factory.
-
-
Method Detail
-
createAttributeInstance
public final AttributeImpl createAttributeInstance(java.lang.Class<? extends Attribute> attClass)
Description copied from class:AttributeFactory
Returns anAttributeImpl
for the suppliedAttribute
interface class.- Specified by:
createAttributeInstance
in classAttributeFactory
-
createInstance
protected abstract A createInstance()
Creates an instance ofA
.
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-