public class AttributeDescriptorImpl extends Object implements AttributeDescriptor
AttributeDescriptor
This class does not have a custom serialization implementation (like some other API classes
such as AttributeImpl
) because its physical representation is the same as its logical
representation, which according to Joshua Bloch in Effective Java, Second Edition makes it
a good candidate for the default Java serialization implementation.
For what constitutes a compatible change in serialization, see Sun's Guidelines.
Modifier and Type | Field and Description |
---|---|
protected boolean |
indexed |
protected boolean |
multivalued |
protected String |
name |
protected boolean |
stored |
protected boolean |
tokenized |
protected AttributeType<?> |
type |
Constructor and Description |
---|
AttributeDescriptorImpl(String name,
boolean indexed,
boolean stored,
boolean tokenized,
boolean multivalued,
AttributeType<?> type)
Constructor
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
String |
getName()
Returns the name of this
AttributeDescriptor |
AttributeType<?> |
getType()
|
int |
hashCode() |
boolean |
isIndexed()
|
boolean |
isMultiValued()
Returns whether or not
Attribute s described by this AttributeDescriptor are
multivalued, that is, Attribute.getValue() returns a List . |
boolean |
isStored()
|
boolean |
isTokenized()
If the
AttributeType.AttributeFormat of this Attribute is
AttributeType.AttributeFormat.STRING , returns whether or not Source implementations should tokenize it; removing stopwords, etc. |
String |
toString() |
protected String name
protected boolean indexed
protected boolean stored
protected boolean tokenized
protected boolean multivalued
protected AttributeType<?> type
public AttributeDescriptorImpl(String name, boolean indexed, boolean stored, boolean tokenized, boolean multivalued, AttributeType<?> type)
name
- - the name of this AttributeDescriptor
indexed
- - whether Attribute
values using this AttributeDescriptor
should be indexedstored
- - whether Attribute
values using this AttributeDescriptor
should be storedtokenized
- - whether Attribute
values using this AttributeDescriptor
should be tokenizedmultivalued
- whether Attribute
values using this AttributeDescriptor
are multivaluedtype
- - the type of this AttributeDescriptor
AttributeDescriptor.isIndexed()
,
AttributeDescriptor.isStored()
,
AttributeDescriptor.isTokenized()
,
AttributeDescriptor.isMultiValued()
public String getName()
AttributeDescriptor
AttributeDescriptor
getName
in interface AttributeDescriptor
String
- the name of this AttributeDescriptor
public AttributeType<?> getType()
AttributeDescriptor
getType
in interface AttributeDescriptor
AttributeType
- the type of values of Attribute
s described by this
AttributeDescriptor
public boolean isIndexed()
AttributeDescriptor
Attribute
should be indexed by Source
implementations, therefore part of Query
evaluation. Attribute
s may only want to be stored, not indexed.isIndexed
in interface AttributeDescriptor
Attribute
AttributeDescriptor.isStored()
public boolean isStored()
AttributeDescriptor
Source
implementations must store the value
of this Attribute
. Some Attribute
s may only need to be indexed, not stored (or
vice versa).isStored
in interface AttributeDescriptor
Attribute
AttributeDescriptor.isIndexed()
public boolean isTokenized()
AttributeDescriptor
AttributeType.AttributeFormat
of this Attribute
is
AttributeType.AttributeFormat.STRING
, returns whether or not Source
implementations should tokenize it; removing stopwords, etc.
This method is only relevant to Attribute
s with an AttributeType.AttributeFormat
of AttributeType.AttributeFormat.STRING
Some Attribute
s may only
need to be stored, not indexed (or vice versa).
isTokenized
in interface AttributeDescriptor
Attribute
sAttributeDescriptor.isStored()
public boolean isMultiValued()
AttributeDescriptor
Attribute
s described by this AttributeDescriptor
are
multivalued, that is, Attribute.getValue()
returns a List
.isMultiValued
in interface AttributeDescriptor
This work is licensed under a Creative Commons Attribution 4.0 International License.