| Modifier and Type | Class and Description |
|---|---|
| private static enum | ConstrainedFieldPosition.ConstraintType
Represents the type of constraint for ConstrainedFieldPosition. |
| Modifier and Type | Field and Description |
|---|---|
| private Class | |
| private ConstrainedFieldPosition. | |
| private long | |
| private Format. | |
| private int | |
| private int | |
| private Object |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | constrainClass(Class<?>
The field class to fix when iterating. classConstraint)Sets a constraint on the field class. |
| public void | |
| public void | constrainFieldAndValue(Format.
The field to fix when iterating. field,The field value to fix when iterating. fieldValue)
Deprecated
This API is for technology preview and might be changed or removed in a future release.
Sets a constraint on field and field value.
|
| public Format. | Returns: The field saved in the instance. See above for null conditions.Gets the field for the current position. |
| public Object | Returns: The value for the current position. Might be null.Gets the value associated with the current field position. |
| public long | Returns: The current iteration context fromsetInt64IterationContext.Gets an int64 that FormattedValue implementations may use for storage. |
| public int | Returns: The end index saved in the instance.Gets the EXCLUSIVE end index stored for the current position. |
| public int | Returns: The start index saved in the instance.Gets the INCLUSIVE start index for the current position. |
| public boolean | Returns: Whether the field should be included given the constraints.The field to test. field,The field value to test. Should be null if there is no value. fieldValue)Determines whether a given field and value should be included given the constraints. |
| public void | reset()
Resets this ConstrainedFieldPosition to its initial state, as if it were newly created: - Removes any constraints that may have been set on the instance. |
| public void | setInt64IterationContext(long
The new iteration context. context)Sets an int64 that FormattedValue implementations may use for storage. |
| public void | |
| public String |
| fClassConstraint | back to summary |
|---|---|
| private Class<?> fClassConstraint | |
| fConstraint | back to summary |
|---|---|
| private ConstrainedFieldPosition. | |
| fContext | back to summary |
|---|---|
| private long fContext | |
| fField | back to summary |
|---|---|
| private Format. | |
| fLimit | back to summary |
|---|---|
| private int fLimit | |
| fStart | back to summary |
|---|---|
| private int fStart | |
| fValue | back to summary |
|---|---|
| private Object fValue | |
| ConstrainedFieldPosition | back to summary |
|---|---|
| public ConstrainedFieldPosition() Initializes a CategoryFieldPosition. By default, the CategoryFieldPosition has no iteration constraints.
| |
| constrainClass | back to summary |
|---|---|
| public void constrainClass(Class<?> classConstraint) Sets a constraint on the field class.
When this instance of ConstrainedFieldPosition is passed to
ConstrainedFieldPosition cfpos;
cfpos.constrainClass(NumberFormat.Field.class);
while (fmtval.nextPosition(cfpos)) {
// handle the number-related field position
}
| |
| constrainField | back to summary |
|---|---|
| public void constrainField(Format. Sets a constraint on the field.
When this instance of ConstrainedFieldPosition is passed to
ConstrainedFieldPosition cfpos;
cfpos.constrainField(NumberFormat.Field.GROUPING_SEPARATOR);
while (fmtval.nextPosition(cfpos)) {
// handle the grouping separator position
}
Changing the constraint while in the middle of iterating over a FormattedValue
does not generally have well-defined behavior.
| |
| constrainFieldAndValue | back to summary |
|---|---|
| public void constrainFieldAndValue(Format. Deprecated This API is for technology preview and might be changed or removed in a future release. Sets a constraint on field and field value.
When this instance of ConstrainedFieldPosition is passed to
ConstrainedFieldPosition cfpos;
cfpos.constrainFieldAndValue(DateIntervalFormat.SpanField.DATE_INTERVAL_SPAN, 0);
while (fmtval.nextPosition(cfpos)) {
// handle the span of the first date in the date interval
}
| |
| getField | back to summary |
|---|---|
| public Format. Gets the field for the current position. The return value is well-defined and non-null only after FormattedValue#nextPosition returns true. | |
| getFieldValue | back to summary |
|---|---|
| public Object getFieldValue() Gets the value associated with the current field position. The field value is often not set. The return value is well-defined only after FormattedValue#nextPosition returns true. | |
| getInt64IterationContext | back to summary |
|---|---|
| public long getInt64IterationContext() Gets an int64 that FormattedValue implementations may use for storage. The initial value is zero. Users of FormattedValue should not need to call this method.
| |
| getLimit | back to summary |
|---|---|
| public int getLimit() Gets the EXCLUSIVE end index stored for the current position. The return value is well-defined only after FormattedValue#nextPosition returns true.
| |
| getStart | back to summary |
|---|---|
| public int getStart() Gets the INCLUSIVE start index for the current position. The return value is well-defined only after FormattedValue#nextPosition returns true.
| |
| matchesField | back to summary |
|---|---|
| public boolean matchesField(Format. Determines whether a given field and value should be included given the constraints. Intended to be used by FormattedValue implementations. | |
| reset | back to summary |
|---|---|
| public void reset() Resets this ConstrainedFieldPosition to its initial state, as if it were newly created: - Removes any constraints that may have been set on the instance. - Resets the iteration position.
| |
| setInt64IterationContext | back to summary |
|---|---|
| public void setInt64IterationContext(long context) Sets an int64 that FormattedValue implementations may use for storage. Intended to be used by FormattedValue implementations.
| |
| setState | back to summary |
|---|---|
| public void setState(Format. Sets new values for the primary public getters. Intended to be used by FormattedValue implementations. It is up to the implementation to ensure that the user-requested constraints are satisfied. This method does not check! | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| Modifier and Type | Field and Description |
|---|---|
| public static final ConstrainedFieldPosition. | CLASS
Represents that the field class is constrained. |
| public static final ConstrainedFieldPosition. | FIELD
Represents that the field is constrained. |
| public static final ConstrainedFieldPosition. | NONE
Represents the lack of a constraint. |
| public static final ConstrainedFieldPosition. | VALUE
Represents that the field value is constrained. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static ConstrainedFieldPosition. | |
| public static ConstrainedFieldPosition. |
| CLASS | back to summary |
|---|---|
| public static final ConstrainedFieldPosition. Represents that the field class is constrained.
This is the value of fConstraint
after | |
| FIELD | back to summary |
|---|---|
| public static final ConstrainedFieldPosition. Represents that the field is constrained.
This is the value of fConstraint
after | |
| NONE | back to summary |
|---|---|
| public static final ConstrainedFieldPosition. Represents the lack of a constraint. This is the value of fConstraint if no "constrain" methods were called. | |
| VALUE | back to summary |
|---|---|
| public static final ConstrainedFieldPosition. Represents that the field value is constrained.
This is the value of fConstraint
after | |
| ConstraintType | back to summary |
|---|---|
| private ConstraintType() | |
| valueOf | back to summary |
|---|---|
| public static ConstrainedFieldPosition. | |
| values | back to summary |
|---|---|
| public static ConstrainedFieldPosition. | |