Class Scn

  • All Implemented Interfaces:
    Comparable<Scn>

    public class Scn
    extends Object
    implements Comparable<Scn>
    Oracle System Change Number implementation
    Author:
    Chris Cranford
    • Field Detail

      • MAX

        public static final Scn MAX
        Represents an Scn that implies the maximum possible value of an SCN, useful as a placeholder.
      • NULL

        public static final Scn NULL
        Represents an Scn without a value.
      • ONE

        public static final Scn ONE
        Represents an Scn with value 1, useful for playing with inclusive/exclusive query boundaries.
    • Method Detail

      • isNull

        public boolean isNull()
        Returns whether this Scn is null and contains no value.
      • valueOf

        public static Scn valueOf​(int value)
        Construct a Scn from an integer value.
        Parameters:
        value - integer value
        Returns:
        instance of Scn
      • valueOf

        public static Scn valueOf​(long value)
        Construct a Scn from a long value.
        Parameters:
        value - long value
        Returns:
        instance of Scn
      • valueOf

        public static Scn valueOf​(String value)
        Construct a Scn from a string value.
        Parameters:
        value - string value, should not be null
        Returns:
        instance of Scn
      • longValue

        public long longValue()
        Get the Scn represented as a long data type.
      • add

        public Scn add​(Scn value)
        Returns a SCn whose value is (this + value).
        Parameters:
        value - the value to be added to this Scn.
        Returns:
        this + value
      • subtract

        public Scn subtract​(Scn value)
        Returns a Scn whose value is (this - value).
        Parameters:
        value - the value to be subtracted from this Scn.
        Returns:
        this - value
      • compareTo

        public int compareTo​(Scn o)
        Compares this Scn with the specified Scn.
        Specified by:
        compareTo in interface Comparable<Scn>
        Parameters:
        o - Scn to which this Scn is to be compared
        Returns:
        -1, 0, or 1 as this {code Scn} is numerically less than, equal to, or greater than o.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object