org.apache.lucene.facet.associations

## Class CategoryIntAssociation

- java.lang.Object
- - org.apache.lucene.facet.associations.CategoryIntAssociation

All Implemented Interfaces:
  CategoryAssociation

    public class CategoryIntAssociation
    extends Object
    implements CategoryAssociation

A `CategoryAssociation` that associates an integer with a category.

### Field Summary

Fields
`static String` `ASSOCIATION_LIST_ID`

### Constructor Summary

Constructors
Constructor and Description
`CategoryIntAssociation()`
`CategoryIntAssociation(int value)`

### Method Summary

Methods
`void` `deserialize(ByteArrayDataInput input)` Deserializes the association value from the given `DataInput`.
`String` `getCategoryListID()` Returns the ID of the category association.
`int` `getValue()` Returns the value associated with a category.
`int` `maxBytesNeeded()` Returns the maximum bytes needed to encode the association value.
`void` `serialize(ByteArrayDataOutput output)` Serializes the associated value into the given `DataOutput`.
`String` `toString()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Field Detail

#### ASSOCIATION_LIST_ID

    public static final String ASSOCIATION_LIST_ID

See Also:
  Constant Field Values

### Constructor Detail

#### CategoryIntAssociation

    public CategoryIntAssociation()

#### CategoryIntAssociation

    public CategoryIntAssociation(int value)

### Method Detail

#### serialize

    public void serialize(ByteArrayDataOutput output)

Description copied from interface: `CategoryAssociation`
Serializes the associated value into the given `DataOutput`.

Specified by:
  `serialize` in interface `CategoryAssociation`

#### deserialize

    public void deserialize(ByteArrayDataInput input)

Description copied from interface: `CategoryAssociation`
Deserializes the association value from the given `DataInput`.

Specified by:
  `deserialize` in interface `CategoryAssociation`

#### maxBytesNeeded

    public int maxBytesNeeded()

Description copied from interface: `CategoryAssociation`
Returns the maximum bytes needed to encode the association value.

Specified by:
  `maxBytesNeeded` in interface `CategoryAssociation`

#### getCategoryListID

    public String getCategoryListID()

Description copied from interface: `CategoryAssociation`
Returns the ID of the category association. The ID is used as e.g. the term's text under which to encode the association values.

Specified by:
  `getCategoryListID` in interface `CategoryAssociation`

#### getValue

    public int getValue()

Returns the value associated with a category. If you used `CategoryIntAssociation()`, you should call `deserialize(ByteArrayDataInput)` before calling this method, or otherwise the value returned is undefined.

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`