oracle.kv.table

## Class FieldRange

- java.lang.Object
- - oracle.kv.table.FieldRange

-     public class FieldRange
      extends Object

  FieldRange defines a range of values to be used in a table or index iteration or multiGet operation. A FieldRange is used as the least significant component in a partially specified `PrimaryKey` or `IndexKey` in order to create a value range for an operation that returns multiple rows or keys. The data types supported by FieldRange are limited to those which are valid for primary keys and/or index keys, as indicated by `FieldDef.isValidKeyField()` and `FieldDef.isValidIndexField()`.

  This object is used to scope a table or index operation and is constructed by `Table.createFieldRange(java.lang.String)` and `Index.createFieldRange(java.lang.String)`. If used on a table the field referenced must be part of the table's primary key and be in proper order relative to the parent value. If used on an index the field must be part of the index definition and in proper order relative to the index definition.

  Indexes can include array fields as long as the array element type is valid for use in an index. For example, an array of LONG can be indexed but an array of MAP cannot. An array of ARRAY cannot be indexed because of the explosion of index entries that would result. There can be only one array in an index, also because of the potential explosion of entries. When querying an index using an array only a single value can be specified. That is, it is not possible to provide a set of possible values for the index. When an array field is the target of a FieldRange the caller must use the methods associated with the type of the array element. For example, if it is an array of LONG then methods such as setStart(long, boolean) should be used.

  Since:
    3.0

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `MultiRowOptions` | `createMultiRowOptions()` A convenience factory method to create a MultiRowOptions instance using this FieldRange.
    `FieldDef` | `getDefinition()` Returns the FieldDef for the field used in the range.
    `FieldValue` | `getEnd()` Returns the FieldValue that defines upper bound of the range, or null if no upper bound is enforced.
    `boolean` | `getEndInclusive()` Returns whether end is included in the range, i.e., end is greater than or equal to the last FieldValue in the range.
    `String` | `getFieldName()` Returns the name for the field used in the range.
    `FieldValue` | `getStart()` Returns the FieldValue that defines lower bound of the range, or null if no lower bound is enforced.
    `boolean` | `getStartInclusive()` Returns whether start is included in the range, i.e., start is less than or equal to the first FieldValue in the range.
    `FieldRange` | `setEnd(double value, boolean isInclusive)` Sets the end value of the range to the specified double value.
    `FieldRange` | `setEnd(FieldValue value, boolean isInclusive)` Sets the end value of the range to the specified value.
    `FieldRange` | `setEnd(float value, boolean isInclusive)` Sets the end value of the range to the specified float value.
    `FieldRange` | `setEnd(int value, boolean isInclusive)` Sets the end value of the range to the specified integer value.
    `FieldRange` | `setEnd(long value, boolean isInclusive)` Sets the end value of the range to the specified long value.
    `FieldRange` | `setEnd(String value, boolean isInclusive)` Sets the end value of the range to the specified string value.
    `FieldRange` | `setEndEnum(String value, boolean isInclusive)` Sets the end value of the range to the specified enumeration value.
    `FieldRange` | `setStart(double value, boolean isInclusive)` Sets the start value of the range to the specified double value.
    `FieldRange` | `setStart(FieldValue value, boolean isInclusive)` Sets the start value of the range to the specified value.
    `FieldRange` | `setStart(float value, boolean isInclusive)` Sets the start value of the range to the specified float value.
    `FieldRange` | `setStart(int value, boolean isInclusive)` Sets the start value of the range to the specified integer value.
    `FieldRange` | `setStart(long value, boolean isInclusive)` Sets the start value of the range to the specified long value.
    `FieldRange` | `setStart(String value, boolean isInclusive)` Sets the start value of the range to the specified string value.
    `FieldRange` | `setStartEnum(String value, boolean isInclusive)` Sets the start value of the range to the specified enumeration value.

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

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

- - ### Method Detail

    - #### createMultiRowOptions

          public MultiRowOptions createMultiRowOptions()

      A convenience factory method to create a MultiRowOptions instance using this FieldRange.
      Returns:
        a new MultiRowOptions

    - #### getStart

          public FieldValue getStart()

      Returns the FieldValue that defines lower bound of the range, or null if no lower bound is enforced.
      Returns:
        the start FieldValue

    - #### getStartInclusive

          public boolean getStartInclusive()

      Returns whether start is included in the range, i.e., start is less than or equal to the first FieldValue in the range. This value is valid only if the start value is not null.
      Returns:
        true if the start value is inclusive

    - #### getEnd

          public FieldValue getEnd()

      Returns the FieldValue that defines upper bound of the range, or null if no upper bound is enforced.
      Returns:
        the end FieldValue

    - #### getEndInclusive

          public boolean getEndInclusive()

      Returns whether end is included in the range, i.e., end is greater than or equal to the last FieldValue in the range. This value is valid only if the end value is not null.
      Returns:
        true if the end value is inclusive

    - #### getDefinition

          public FieldDef getDefinition()

      Returns the FieldDef for the field used in the range.
      Returns:
        the FieldDef

    - #### getFieldName

          public String getFieldName()

      Returns the name for the field used in the range.
      Returns:
        the name of the field

    - #### setStart

          public FieldRange setStart(int value,
                            boolean isInclusive)

      Sets the start value of the range to the specified integer value.
      Parameters:
        `value` - the value to set
        `isInclusive` - set to true if the range is inclusive of the value, false if it is exclusive.
      Returns:
        this
      Throws:
        `IllegalArgumentException` - if the value is not valid for the field in the range.

    - #### setStart

          public FieldRange setStart(double value,
                            boolean isInclusive)

      Sets the start value of the range to the specified double value.
      Parameters:
        `value` - the value to set
        `isInclusive` - set to true if the range is inclusive of the value, false if it is exclusive.
      Returns:
        this
      Throws:
        `IllegalArgumentException` - if the value is not valid for the field in the range.

    - #### setStart

          public FieldRange setStart(float value,
                            boolean isInclusive)

      Sets the start value of the range to the specified float value.
      Parameters:
        `value` - the value to set
        `isInclusive` - set to true if the range is inclusive of the value, false if it is exclusive.
      Returns:
        this
      Throws:
        `IllegalArgumentException` - if the value is not valid for the field in the range.

    - #### setStart

          public FieldRange setStart(long value,
                            boolean isInclusive)

      Sets the start value of the range to the specified long value.
      Parameters:
        `value` - the value to set
        `isInclusive` - set to true if the range is inclusive of the value, false if it is exclusive.
      Returns:
        this
      Throws:
        `IllegalArgumentException` - if the value is not valid for the field in the range.

    - #### setStart

          public FieldRange setStart(String value,
                            boolean isInclusive)

      Sets the start value of the range to the specified string value.
      Parameters:
        `value` - the value to set
        `isInclusive` - set to true if the range is inclusive of the value, false if it is exclusive.
      Returns:
        this
      Throws:
        `IllegalArgumentException` - if the value is not valid for the field in the range.

    - #### setStartEnum

          public FieldRange setStartEnum(String value,
                                boolean isInclusive)

      Sets the start value of the range to the specified enumeration value.
      Parameters:
        `value` - the value to set
        `isInclusive` - set to true if the range is inclusive of the value, false if it is exclusive.
      Returns:
        this
      Throws:
        `IllegalArgumentException` - if the value is not valid for the field in the range.

    - #### setEnd

          public FieldRange setEnd(int value,
                          boolean isInclusive)

      Sets the end value of the range to the specified integer value.
      Parameters:
        `value` - the value to set
        `isInclusive` - set to true if the range is inclusive of the value, false if it is exclusive.
      Returns:
        this
      Throws:
        `IllegalArgumentException` - if the value is not valid for the field in the range.

    - #### setEnd

          public FieldRange setEnd(double value,
                          boolean isInclusive)

      Sets the end value of the range to the specified double value.
      Parameters:
        `value` - the value to set
        `isInclusive` - set to true if the range is inclusive of the value, false if it is exclusive.
      Returns:
        this
      Throws:
        `IllegalArgumentException` - if the value is not valid for the field in the range.

    - #### setEnd

          public FieldRange setEnd(float value,
                          boolean isInclusive)

      Sets the end value of the range to the specified float value.
      Parameters:
        `value` - the value to set
        `isInclusive` - set to true if the range is inclusive of the value, false if it is exclusive.
      Returns:
        this
      Throws:
        `IllegalArgumentException` - if the value is not valid for the field in the range.

    - #### setEnd

          public FieldRange setEnd(long value,
                          boolean isInclusive)

      Sets the end value of the range to the specified long value.
      Parameters:
        `value` - the value to set
        `isInclusive` - set to true if the range is inclusive of the value, false if it is exclusive.
      Returns:
        this
      Throws:
        `IllegalArgumentException` - if the value is not valid for the field in the range.

    - #### setEnd

          public FieldRange setEnd(String value,
                          boolean isInclusive)

      Sets the end value of the range to the specified string value.
      Parameters:
        `value` - the value to set
        `isInclusive` - set to true if the range is inclusive of the value, false if it is exclusive.
      Returns:
        this
      Throws:
        `IllegalArgumentException` - if the value is not valid for the field in the range.

    - #### setEndEnum

          public FieldRange setEndEnum(String value,
                              boolean isInclusive)

      Sets the end value of the range to the specified enumeration value.
      Parameters:
        `value` - the value to set
        `isInclusive` - set to true if the range is inclusive of the value, false if it is exclusive.
      Returns:
        this
      Throws:
        `IllegalArgumentException` - if the value is not valid for the field in the range.

    - #### setStart

          public FieldRange setStart(FieldValue value,
                            boolean isInclusive)

      Sets the start value of the range to the specified value.
      Parameters:
        `value` - the value to set
        `isInclusive` - set to true if the range is inclusive of the value, false if it is exclusive.
      Returns:
        this
      Throws:
        `IllegalArgumentException` - if the value is not valid for the field in the range.

    - #### setEnd

          public FieldRange setEnd(FieldValue value,
                          boolean isInclusive)

      Sets the end value of the range to the specified value.
      Parameters:
        `value` - the value to set
        `isInclusive` - set to true if the range is inclusive of the value, false if it is exclusive.
      Returns:
        this
      Throws:
        `IllegalArgumentException` - if the value is not valid for the field in the range.

Copyright (c) 2011, 2014 Oracle and/or its affiliates. All rights reserved.