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
Modifier and TypeFieldDescriptionstatic final int
The maximum number of fields that can be used.static final int
The maximum field number for any field.static final int
The minimum field number for any field. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a new field to thisFieldManager
.getFieldByName
(String name) Gets the FieldInfo for a field, given a field name.getFieldByNumber
(int num) Gets the FieldInfo for a field, given a field number.int
The number of configured fields, both those configured via XML and those added manually using the addField method.iterator()
An iterator of all the existing fields.
-
Field Details
-
DS_FIELDS_MAX
static final int DS_FIELDS_MAXThe maximum number of fields that can be used.- See Also:
-
DS_FIELDS_NUM_MIN
static final int DS_FIELDS_NUM_MINThe minimum field number for any field.- See Also:
-
DS_FIELDS_NUM_MAX
static final int DS_FIELDS_NUM_MAXThe maximum field number for any field.- See Also:
-
-
Method Details
-
addField
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.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
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
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
Iterator iterator()An iterator of all the existing fields.- Returns:
- an iterator of FieldInfo instances containing all the existing fields.
-