com.tibco.cep.runtime.model.element

## Interface PropertyAtom

- All Superinterfaces:
    Property
  All Known Subinterfaces:
    PropertyAtomBoolean, PropertyAtomConcept, PropertyAtomConceptReference, PropertyAtomContainedConcept, PropertyAtomDateTime, PropertyAtomDouble, PropertyAtomInt, PropertyAtomLong, PropertyAtomString

      public interface PropertyAtom
      extends Property

  Base for atom properties (properties that contains one value).
  Since:
    2.0.0

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface com.tibco.cep.runtime.model.element.Property

      `Property.PropertyBoolean, Property.PropertyConcept, Property.PropertyConceptReference, Property.PropertyContainedConcept, Property.PropertyDateTime, Property.PropertyDouble, Property.PropertyInt, Property.PropertyLong, Property.PropertyString`

  - ### Field Summary

    - ### Fields inherited from interface com.tibco.cep.runtime.model.element.Property

      `HISTORY_POLICY_ALL_VALUES, HISTORY_POLICY_CHANGES_ONLY`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `getHistoryTimeInterval(long time, long[] interval)` Sets `interval[0]` to `t1` and `interval[1]` to `t2` where `t1` and `t2` are timestamps in the current property history and `t1 <=time <= t2`.``
    `java.lang.String` | `getString()` Gets the `String` representation of the value of this `PropertyAtom`.
    `java.lang.String` | `getString(long time)` Gets the `String` representation of the value of this `PropertyAtom` at the given time.
    `java.lang.String` | `getStringAtIdx(int idx)` Gets the `String` representation of the value of this `PropertyAtom` at the given history index.
    `long` | `getTimeAtIdx(int idx)` Gets the time at which the value at the given history index was set.
    `long` | `howCurrent()` Gets the timestamp of the latest value in the current history of this property.
    `int` | `howMany(long stime, long etime)` Gets the number of values known to the current history of this property, between stime and etime.
    `long` | `howOld()` Gets the timestamp of the oldest value in the current history of this property.
    `boolean` | `isSet()` Returns true if the property is set.
    `boolean` | `setValue(java.lang.Object obj)` Sets the current value of this `PropertyAtom`.
    `boolean` | `setValue(java.lang.Object obj, long time)` Sets the value of this `PropertyAtom` with a given time.

    - ### Methods inherited from interface com.tibco.cep.runtime.model.element.Property

      `getHistoryPolicy, getHistorySize, getName, getParent`

- - ### Method Detail

    - #### getTimeAtIdx

          long getTimeAtIdx(int idx)
                     throws PropertyException

      Gets the time at which the value at the given history index was set.
      Parameters:
        `idx` - index in the history of this property.
      Returns:
        the timestamp at the given index.
      Throws:
        `PropertyException`
      Since:
        2.0.0
      See Also:
        `Property.getHistoryPolicy()`, `Property.getHistorySize()`

    - #### howOld

          long howOld()

      Gets the timestamp of the oldest value in the current history of this property. Note that since the history is a ring, the return value may change over time.
      Returns:
        the oldest timestamp in the current history of this property.
      Since:
        2.0.0
      See Also:
        `Property.getHistoryPolicy()`, `Property.getHistorySize()`

    - #### howCurrent

          long howCurrent()

      Gets the timestamp of the latest value in the current history of this property.
      Returns:
        the latest timestamp in the current history of this property.
      Since:
        2.0.0
      See Also:
        `Property.getHistoryPolicy()`, `Property.getHistorySize()`

    - #### howMany

          int howMany(long stime,
                      long etime)
               throws PropertyException

      Gets the number of values known to the current history of this property, between stime and etime. Passing 0 for stime and etime returns the total number of values known in the current history. This method fails if stime is older than the oldest timestamp in the history.
      Parameters:
        `stime` - a time expressed in ms since the epoch.
        `etime` - a time expressed in ms since the epoch, greater than or equal to stime.
      Returns:
        the number of values known to the current history of this property, between stime and etime.
      Throws:
        `PropertyException` - if stime is older than the oldest history timestamp.
      Since:
        2.0.0
      See Also:
        `Property.getHistoryPolicy()`, `Property.getHistorySize()`

    - #### setValue

          boolean setValue(java.lang.Object obj)

      Sets the current value of this `PropertyAtom`.
      Parameters:
        `obj` - the value to set
      Returns:
        true if a new entry was added in the history for this value.
      Since:
        2.0.0
      See Also:
        `Property.getHistoryPolicy()`

    - #### setValue

          boolean setValue(java.lang.Object obj,
                           long time)

      Sets the value of this `PropertyAtom` with a given time.
      Parameters:
        `obj` - the value to set.
        `time` - the time to associate with the value.
      Returns:
        true if a new entry was added in the history for this value.
      Since:
        2.0.0
      See Also:
        `Property.getHistoryPolicy()`

    - #### getString

          java.lang.String getString()

      Gets the `String` representation of the value of this `PropertyAtom`.
      Returns:
        the `String` value of this `PropertyAtom`.
      Since:
        2.0.0

    - #### getString

          java.lang.String getString(long time)
                              throws PropertyException

      Gets the `String` representation of the value of this `PropertyAtom` at the given time.
      Parameters:
        `time` - a time expressed in number of milliseconds since the epoch.
      Returns:
        the `String` value of this `PropertyAtom` at the given time.
      Throws:
        `PropertyException` - if time is older than the oldest history timestamp.
      Since:
        2.0.0
      See Also:
        `Property.getHistoryPolicy()`, `Property.getHistorySize()`

    - #### getStringAtIdx

          java.lang.String getStringAtIdx(int idx)
                                   throws PropertyException

      Gets the `String` representation of the value of this `PropertyAtom` at the given history index.
      Parameters:
        `idx` - an index in the history of this property.
      Returns:
        the `String` value of this `PropertyAtom` at the given history index.
      Throws:
        `PropertyException` - if idx is not a valid history index.
      Since:
        2.0.0
      See Also:
        `Property.getHistoryPolicy()`, `Property.getHistorySize()`

    - #### getHistoryTimeInterval

          void getHistoryTimeInterval(long time,
                                      long[] interval)
                               throws PropertyException

      Sets `interval[0]` to `t1` and `interval[1]` to `t2` where `t1` and `t2` are timestamps in the current property history and `t1 <=time <= t2`.``
      Parameters:
        `time` - a time in ms since the epoch
        `interval` - a `long[]` of length 2 or greater.
      Throws:
        `PropertyException`
      Since:
        2.0.0

    - #### isSet

          boolean isSet()

      Returns true if the property is set.
      Returns:
        true if the property is set, false otherwise
      Since:
        2.0.0