# Class: com.pnfsoftware.jeb.core.units.code.android.DexConstantLibrary

A manager for constant and pseudo\-constant fields of a dex unit.

## Constructor: DexConstantLibrary
- parameter: `dex`, type: `com.pnfsoftware.jeb.core.units.code.android.IDexUnit`

Description: Create a constant library for a Dex unit.
parameter: dex: Dex unit

## Method: getFieldIndices
- parameter: `value`, type: `java.lang.Object`
- return type: `java.util.Collection<java.lang.Integer>`

Description: Retrieve all fields with the provided value. Only the fields of the provided type are returned. Example: if value is an Integer, only `I`\-type fields are returned. To retrieve a list of smaller\- or bigger\- type values, use [#getFieldIndices(Object, boolean, boolean)](#getFieldIndices(Object, boolean, boolean)).
parameter: value: a non\-null value \(must be a byte, char, short, int, long, float or double\)
return: a collection of dex field indices, possibly empty

## Method: getFieldIndices
- parameter: `value`, type: `java.lang.Object`
- parameter: `alsoGetSmaller`, type: `boolean`
- parameter: `alsoGetBigger`, type: `boolean`
- return type: `java.util.Collection<java.lang.Integer>`

Description: Retrieve all fields with the provided value.
parameter: value: a non\-null value \(must be a byte, char, short, int, long, float or double\)
parameter: alsoGetSmaller: if true, smaller\-type values are returned
parameter: alsoGetBigger: if true, bigger\-type values are returned
return: a collection of dex field indices, possibly empty

## Method: setValue
- parameter: `value`, type: `java.lang.Object`
- parameter: `fieldIndex`, type: `int`
- return type: `boolean`

Description: Record a field constant \(for an internal static final field\) or a pseudo constant \(attached to an external field reference\).
parameter: value: a non\-null value \(must be a byte, char, short, int, long, float or double\)
parameter: fieldIndex: a field index, which can be:
            \- a `static final` field index initialized to the provided value \(note that            the [dex unit](IDexUnit) is responsible for setting those up; clients do not            need to do that, unless a constant is to be forcefully changed to another            value\)
            \- or any index to a **pure field reference** \(external field\) for whom a value            is to be attached
return: true if the value was recorded

