Package com.caplin.datasrc.fields
Interface FieldManager
-
public interface FieldManager
Provides field management functionality, including field name/number mapping.Each managed field is represented by a
FieldInfo
instance, and is available using the getter methods by name and field number.
-
-
Field Summary
Fields Modifier and Type Field Description static int
DS_FIELDS_MAX
The maximum number of fields that can be used.static int
DS_FIELDS_NUM_MAX
The maximum field number for any field.static int
DS_FIELDS_NUM_MIN
The minimum field number for any field.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addField(java.lang.String name, int number)
Adds a new field to thisFieldManager
.FieldInfo
getFieldByName(java.lang.String name)
Gets the FieldInfo for a field, given a field name.FieldInfo
getFieldByNumber(int num)
Gets the FieldInfo for a field, given a field number.int
getFieldCount()
The number of configured fields, both those configured via XML and those added manually using the addField method.java.util.Iterator
iterator()
An iterator of all the existing fields.
-
-
-
Field Detail
-
DS_FIELDS_MAX
static final int DS_FIELDS_MAX
The maximum number of fields that can be used.- See Also:
- Constant Field Values
-
DS_FIELDS_NUM_MIN
static final int DS_FIELDS_NUM_MIN
The minimum field number for any field.- See Also:
- Constant Field Values
-
DS_FIELDS_NUM_MAX
static final int DS_FIELDS_NUM_MAX
The maximum field number for any field.- See Also:
- Constant Field Values
-
-
Method Detail
-
addField
void addField(java.lang.String name, int number)
Adds a new field to this
FieldManager
.- Parameters:
name
- the name of this field.number
- the field number.- Throws:
FieldLimitReachedException
- ifDS_FIELDS_MAX
fields have already been added to the FieldManager.java.lang.IllegalArgumentException
- if the name or number is already defined, if the name argument is null, or if the specified number is less thanDS_FIELDS_NUM_MIN
greater thanDS_FIELDS_NUM_MAX
.
-
getFieldByName
FieldInfo getFieldByName(java.lang.String name)
Gets the FieldInfo for a field, given a field name.- Parameters:
name
- the name of the field.- Returns:
- the FieldInfo for that field name, or null if there is not one.
-
getFieldByNumber
FieldInfo getFieldByNumber(int num)
Gets the FieldInfo for a field, given a field number.- Parameters:
num
- the field number.- Returns:
- the FieldInfo for that field number, or null if there is not one.
-
getFieldCount
int getFieldCount()
The number of configured fields, both those configured via XML and those added manually using the addField method.- Returns:
- the total number of configured fields.
-
iterator
java.util.Iterator iterator()
An iterator of all the existing fields.- Returns:
- an iterator of FieldInfo instances containing all the existing fields.
-
-