Class AtomicBiInteger

  • All Implemented Interfaces:
    Serializable

    @Deprecated(since="2021-05-27")
    public class AtomicBiInteger
    extends AtomicLong
    Deprecated.
    The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.
    An AtomicLong with additional methods to treat it as two hi/lo integers.
    See Also:
    Serialized Form
    • Constructor Detail

      • AtomicBiInteger

        public AtomicBiInteger()
        Deprecated.
      • AtomicBiInteger

        public AtomicBiInteger​(long encoded)
        Deprecated.
      • AtomicBiInteger

        public AtomicBiInteger​(int hi,
                               int lo)
        Deprecated.
    • Method Detail

      • getHi

        public int getHi()
        Deprecated.
        Returns:
        the hi value
      • getLo

        public int getLo()
        Deprecated.
        Returns:
        the lo value
      • getAndSetHi

        public int getAndSetHi​(int hi)
        Deprecated.
        Atomically sets the hi value without changing the lo value.
        Parameters:
        hi - the new hi value
        Returns:
        the previous hi value
      • getAndSetLo

        public int getAndSetLo​(int lo)
        Deprecated.
        Atomically sets the lo value without changing the hi value.
        Parameters:
        lo - the new lo value
        Returns:
        the previous lo value
      • set

        public void set​(int hi,
                        int lo)
        Deprecated.
        Sets the hi and lo values.
        Parameters:
        hi - the new hi value
        lo - the new lo value
      • compareAndSetHi

        public boolean compareAndSetHi​(int expectHi,
                                       int hi)
        Deprecated.

        Atomically sets the hi value to the given updated value only if the current value == the expected value.

        Concurrent changes to the lo value result in a retry.

        Parameters:
        expectHi - the expected hi value
        hi - the new hi value
        Returns:
        true if successful. False return indicates that the actual hi value was not equal to the expected hi value.
      • compareAndSetLo

        public boolean compareAndSetLo​(int expectLo,
                                       int lo)
        Deprecated.

        Atomically sets the lo value to the given updated value only if the current value == the expected value.

        Concurrent changes to the hi value result in a retry.

        Parameters:
        expectLo - the expected lo value
        lo - the new lo value
        Returns:
        true if successful. False return indicates that the actual lo value was not equal to the expected lo value.
      • compareAndSet

        public boolean compareAndSet​(long encoded,
                                     int hi,
                                     int lo)
        Deprecated.
        Atomically sets the values to the given updated values only if the current encoded value == the expected encoded value.
        Parameters:
        encoded - the expected encoded value
        hi - the new hi value
        lo - the new lo value
        Returns:
        true if successful. False return indicates that the actual encoded value was not equal to the expected encoded value.
      • compareAndSet

        public boolean compareAndSet​(int expectHi,
                                     int hi,
                                     int expectLo,
                                     int lo)
        Deprecated.
        Atomically sets the hi and lo values to the given updated values only if the current hi and lo values == the expected hi and lo values.
        Parameters:
        expectHi - the expected hi value
        hi - the new hi value
        expectLo - the expected lo value
        lo - the new lo value
        Returns:
        true if successful. False return indicates that the actual hi and lo values were not equal to the expected hi and lo value.
      • addAndGetHi

        public int addAndGetHi​(int delta)
        Deprecated.
        Atomically adds the given delta to the current hi value, returning the updated hi value.
        Parameters:
        delta - the delta to apply
        Returns:
        the updated hi value
      • addAndGetLo

        public int addAndGetLo​(int delta)
        Deprecated.
        Atomically adds the given delta to the current lo value, returning the updated lo value.
        Parameters:
        delta - the delta to apply
        Returns:
        the updated lo value
      • add

        public void add​(int deltaHi,
                        int deltaLo)
        Deprecated.
        Atomically adds the given deltas to the current hi and lo values.
        Parameters:
        deltaHi - the delta to apply to the hi value
        deltaLo - the delta to apply to the lo value
      • getHi

        public static int getHi​(long encoded)
        Deprecated.
        Gets a hi value from the given encoded value.
        Parameters:
        encoded - the encoded value
        Returns:
        the hi value
      • getLo

        public static int getLo​(long encoded)
        Deprecated.
        Gets a lo value from the given encoded value.
        Parameters:
        encoded - the encoded value
        Returns:
        the lo value
      • encode

        public static long encode​(int hi,
                                  int lo)
        Deprecated.
        Encodes hi and lo values into a long.
        Parameters:
        hi - the hi value
        lo - the lo value
        Returns:
        the encoded value
      • encodeHi

        public static long encodeHi​(long encoded,
                                    int hi)
        Deprecated.
        Sets the hi value into the given encoded value.
        Parameters:
        encoded - the encoded value
        hi - the hi value
        Returns:
        the new encoded value
      • encodeLo

        public static long encodeLo​(long encoded,
                                    int lo)
        Deprecated.
        Sets the lo value into the given encoded value.
        Parameters:
        encoded - the encoded value
        lo - the lo value
        Returns:
        the new encoded value