Package org.redisson

Class RedissonLexSortedSet

  • All Implemented Interfaces:
    <>, <>, <>, <>, >, >, >, <>>, <>>, >

    public class RedissonLexSortedSet
    extends >
    implements RLexSortedSet
    Sorted set contained values of String type
    Author:
    Nikita Koksharov
    • Method Detail

      • removeRange

        public int removeRange​( fromElement,
                               boolean fromInclusive,
                                toElement,
                               boolean toInclusive)
        Description copied from interface: RLexSortedSet
        Removes values range starting with fromElement and ending with toElement.
        Specified by:
        removeRange in interface RLexSortedSet
        Parameters:
        fromElement - - start element
        fromInclusive - - start element inclusive
        toElement - - end element
        toInclusive - - end element inclusive
        Returns:
        number of elements removed
      • removeRangeHead

        public int removeRangeHead​( toElement,
                                   boolean toInclusive)
        Description copied from interface: RLexSortedSet
        Removes head values range ending with toElement.
        Specified by:
        removeRangeHead in interface RLexSortedSet
        Parameters:
        toElement - - end element
        toInclusive - - end element inclusive
        Returns:
        number of elements removed
      • removeRangeHeadAsync

        public > removeRangeHeadAsync​( toElement,
                                                     boolean toInclusive)
        Description copied from interface: RLexSortedSetAsync
        Removes head values range ending with toElement.
        Specified by:
        removeRangeHeadAsync in interface RLexSortedSetAsync
        Parameters:
        toElement - - end element
        toInclusive - - end element inclusive
        Returns:
        number of elements removed
      • removeRangeTail

        public int removeRangeTail​( fromElement,
                                   boolean fromInclusive)
        Description copied from interface: RLexSortedSet
        Removes tail values range starting with fromElement.
        Specified by:
        removeRangeTail in interface RLexSortedSet
        Parameters:
        fromElement - - start element
        fromInclusive - - start element inclusive
        Returns:
        number of elements removed
      • removeRangeTailAsync

        public > removeRangeTailAsync​( fromElement,
                                                     boolean fromInclusive)
        Description copied from interface: RLexSortedSetAsync
        Removes tail values range starting with fromElement.
        Specified by:
        removeRangeTailAsync in interface RLexSortedSetAsync
        Parameters:
        fromElement - - start element
        fromInclusive - - start element inclusive
        Returns:
        number of elements removed
      • removeRangeAsync

        public > removeRangeAsync​( fromElement,
                                                 boolean fromInclusive,
                                                  toElement,
                                                 boolean toInclusive)
        Description copied from interface: RLexSortedSetAsync
        Removes values range starting with fromElement and ending with toElement.
        Specified by:
        removeRangeAsync in interface RLexSortedSetAsync
        Parameters:
        fromElement - - start element
        fromInclusive - - start element inclusive
        toElement - - end element
        toInclusive - - end element inclusive
        Returns:
        number of elements removed
      • range

        public <> range​( fromElement,
                                        boolean fromInclusive,
                                         toElement,
                                        boolean toInclusive)
        Description copied from interface: RLexSortedSet
        Returns values range starting with fromElement and ending with toElement.
        Specified by:
        range in interface RLexSortedSet
        Parameters:
        fromElement - - start element
        fromInclusive - - start element inclusive
        toElement - - end element
        toInclusive - - end element inclusive
        Returns:
        collection of elements
      • rangeHead

        public <> rangeHead​( toElement,
                                            boolean toInclusive)
        Description copied from interface: RLexSortedSet
        Returns head values range ending with toElement.
        Specified by:
        rangeHead in interface RLexSortedSet
        Parameters:
        toElement - - end element
        toInclusive - - end element inclusive
        Returns:
        collection of elements
      • rangeHeadAsync

        public <>> rangeHeadAsync​( toElement,
                                                          boolean toInclusive)
        Description copied from interface: RLexSortedSetAsync
        Returns head values range ending with toElement.
        Specified by:
        rangeHeadAsync in interface RLexSortedSetAsync
        Parameters:
        toElement - - end element
        toInclusive - - end element inclusive
        Returns:
        collection of elements
      • rangeTail

        public <> rangeTail​( fromElement,
                                            boolean fromInclusive)
        Description copied from interface: RLexSortedSet
        Returns tail values range starting with fromElement.
        Specified by:
        rangeTail in interface RLexSortedSet
        Parameters:
        fromElement - - start element
        fromInclusive - - start element inclusive
        Returns:
        collection of elements
      • rangeTailAsync

        public <>> rangeTailAsync​( fromElement,
                                                          boolean fromInclusive)
        Description copied from interface: RLexSortedSetAsync
        Returns tail values range starting with fromElement.
        Specified by:
        rangeTailAsync in interface RLexSortedSetAsync
        Parameters:
        fromElement - - start element
        fromInclusive - - start element inclusive
        Returns:
        collection of elements
      • rangeAsync

        public <>> rangeAsync​( fromElement,
                                                      boolean fromInclusive,
                                                       toElement,
                                                      boolean toInclusive)
        Description copied from interface: RLexSortedSetAsync
        Returns values range starting with fromElement and ending with toElement.
        Specified by:
        rangeAsync in interface RLexSortedSetAsync
        Parameters:
        fromElement - - start element
        fromInclusive - - start element inclusive
        toElement - - end element
        toInclusive - - end element inclusive
        Returns:
        collection of elements
      • range

        public <> range​( fromElement,
                                        boolean fromInclusive,
                                         toElement,
                                        boolean toInclusive,
                                        int offset,
                                        int count)
        Description copied from interface: RLexSortedSet
        Returns values range starting with fromElement and ending with toElement. Returned collection limited by count and starts with offset.
        Specified by:
        range in interface RLexSortedSet
        Parameters:
        fromElement - - start element
        fromInclusive - - start element inclusive
        toElement - - end element
        toInclusive - - end element inclusive
        offset - - offset of result collection
        count - - amount of result collection
        Returns:
        collection of elements
      • rangeHead

        public <> rangeHead​( toElement,
                                            boolean toInclusive,
                                            int offset,
                                            int count)
        Description copied from interface: RLexSortedSet
        Returns head values range ending with toElement. Returned collection limited by count and starts with offset.
        Specified by:
        rangeHead in interface RLexSortedSet
        Parameters:
        toElement - - end element
        toInclusive - - end element inclusive
        offset - - offset of result collection
        count - - amount of result collection
        Returns:
        collection of elements
      • rangeHeadAsync

        public <>> rangeHeadAsync​( toElement,
                                                          boolean toInclusive,
                                                          int offset,
                                                          int count)
        Description copied from interface: RLexSortedSetAsync
        Returns head values range ending with toElement. Returned collection limited by count and starts with offset.
        Specified by:
        rangeHeadAsync in interface RLexSortedSetAsync
        Parameters:
        toElement - - end element
        toInclusive - - end element inclusive
        offset - - offset of result collection
        count - - amount of result collection
        Returns:
        collection of elements
      • rangeTail

        public <> rangeTail​( fromElement,
                                            boolean fromInclusive,
                                            int offset,
                                            int count)
        Description copied from interface: RLexSortedSet
        Returns tail values range starting with fromElement. Returned collection limited by count and starts with offset.
        Specified by:
        rangeTail in interface RLexSortedSet
        Parameters:
        fromElement - - start element
        fromInclusive - - start element inclusive
        offset - - offset of result collection
        count - - amount of result collection
        Returns:
        collection of elements
      • rangeTailAsync

        public <>> rangeTailAsync​( fromElement,
                                                          boolean fromInclusive,
                                                          int offset,
                                                          int count)
        Description copied from interface: RLexSortedSetAsync
        Returns tail values range starting with fromElement. Returned collection limited by count and starts with offset.
        Specified by:
        rangeTailAsync in interface RLexSortedSetAsync
        Parameters:
        fromElement - - start element
        fromInclusive - - start element inclusive
        offset - - offset of result collection
        count - - amount of result collection
        Returns:
        collection of elements
      • rangeAsync

        public <>> rangeAsync​( fromElement,
                                                      boolean fromInclusive,
                                                       toElement,
                                                      boolean toInclusive,
                                                      int offset,
                                                      int count)
        Description copied from interface: RLexSortedSetAsync
        Returns values range starting with fromElement and ending with toElement. Returned collection limited by count and starts with offset.
        Specified by:
        rangeAsync in interface RLexSortedSetAsync
        Parameters:
        fromElement - - start element
        fromInclusive - - start element inclusive
        toElement - - end element
        toInclusive - - end element inclusive
        offset - - offset of result collection
        count - - amount of result collection
        Returns:
        collection of elements
      • rangeTailReversed

        public <> rangeTailReversed​( fromElement,
                                                    boolean fromInclusive)
        Description copied from interface: RLexSortedSet
        Returns tail values range in reverse order starting with fromElement.
        Specified by:
        rangeTailReversed in interface RLexSortedSet
        Parameters:
        fromElement - - start element
        fromInclusive - - start element inclusive
        Returns:
        collection of elements
      • rangeHeadReversed

        public <> rangeHeadReversed​( toElement,
                                                    boolean toInclusive)
        Description copied from interface: RLexSortedSet
        Returns head values range in reverse order ending with toElement.
        Specified by:
        rangeHeadReversed in interface RLexSortedSet
        Parameters:
        toElement - - end element
        toInclusive - - end element inclusive
        Returns:
        collection of elements
      • rangeReversed

        public <> rangeReversed​( fromElement,
                                                boolean fromInclusive,
                                                 toElement,
                                                boolean toInclusive)
        Description copied from interface: RLexSortedSet
        Returns values range in reverse order starting with fromElement and ending with toElement.
        Specified by:
        rangeReversed in interface RLexSortedSet
        Parameters:
        fromElement - - start element
        fromInclusive - - start element inclusive
        toElement - - end element
        toInclusive - - end element inclusive
        Returns:
        collection of elements
      • rangeTailReversed

        public <> rangeTailReversed​( fromElement,
                                                    boolean fromInclusive,
                                                    int offset,
                                                    int count)
        Description copied from interface: RLexSortedSet
        Returns tail values range in reverse order starting with fromElement. Returned collection limited by count and starts with offset.
        Specified by:
        rangeTailReversed in interface RLexSortedSet
        Parameters:
        fromElement - - start element
        fromInclusive - - start element inclusive
        offset - - offset of result collection
        count - - amount of result collection
        Returns:
        collection of elements
      • rangeHeadReversed

        public <> rangeHeadReversed​( toElement,
                                                    boolean toInclusive,
                                                    int offset,
                                                    int count)
        Description copied from interface: RLexSortedSet
        Returns head values range in reverse order ending with toElement. Returned collection limited by count and starts with offset.
        Specified by:
        rangeHeadReversed in interface RLexSortedSet
        Parameters:
        toElement - - end element
        toInclusive - - end element inclusive
        offset - - offset of result collection
        count - - amount of result collection
        Returns:
        collection of elements
      • rangeReversed

        public <> rangeReversed​( fromElement,
                                                boolean fromInclusive,
                                                 toElement,
                                                boolean toInclusive,
                                                int offset,
                                                int count)
        Description copied from interface: RLexSortedSet
        Returns values range in reverse order starting with fromElement and ending with toElement. Returned collection limited by count and starts with offset.
        Specified by:
        rangeReversed in interface RLexSortedSet
        Parameters:
        fromElement - - start element
        fromInclusive - - start element inclusive
        toElement - - end element
        toInclusive - - end element inclusive
        offset - - offset of result collection
        count - - amount of result collection
        Returns:
        collection of elements
      • rangeTailReversedAsync

        public <>> rangeTailReversedAsync​( fromElement,
                                                                  boolean fromInclusive)
        Description copied from interface: RLexSortedSetAsync
        Returns tail values range in reverse order starting with fromElement.
        Specified by:
        rangeTailReversedAsync in interface RLexSortedSetAsync
        Parameters:
        fromElement - - start element
        fromInclusive - - start element inclusive
        Returns:
        collection of elements
      • rangeHeadReversedAsync

        public <>> rangeHeadReversedAsync​( toElement,
                                                                  boolean toInclusive)
        Description copied from interface: RLexSortedSetAsync
        Returns head values range in reverse order ending with toElement.
        Specified by:
        rangeHeadReversedAsync in interface RLexSortedSetAsync
        Parameters:
        toElement - - end element
        toInclusive - - end element inclusive
        Returns:
        collection of elements
      • rangeReversedAsync

        public <>> rangeReversedAsync​( fromElement,
                                                              boolean fromInclusive,
                                                               toElement,
                                                              boolean toInclusive)
        Description copied from interface: RLexSortedSetAsync
        Returns values range in reverse order starting with fromElement and ending with toElement.
        Specified by:
        rangeReversedAsync in interface RLexSortedSetAsync
        Parameters:
        fromElement - - start element
        fromInclusive - - start element inclusive
        toElement - - end element
        toInclusive - - end element inclusive
        Returns:
        collection of elements
      • rangeTailReversedAsync

        public <>> rangeTailReversedAsync​( fromElement,
                                                                  boolean fromInclusive,
                                                                  int offset,
                                                                  int count)
        Description copied from interface: RLexSortedSetAsync
        Returns tail values range in reverse order starting with fromElement. Returned collection limited by count and starts with offset.
        Specified by:
        rangeTailReversedAsync in interface RLexSortedSetAsync
        Parameters:
        fromElement - - start element
        fromInclusive - - start element inclusive
        offset - - offset of result collection
        count - - amount of result collection
        Returns:
        collection of elements
      • rangeHeadReversedAsync

        public <>> rangeHeadReversedAsync​( toElement,
                                                                  boolean toInclusive,
                                                                  int offset,
                                                                  int count)
        Description copied from interface: RLexSortedSetAsync
        Returns head values range in reverse order ending with toElement. Returned collection limited by count and starts with offset.
        Specified by:
        rangeHeadReversedAsync in interface RLexSortedSetAsync
        Parameters:
        toElement - - end element
        toInclusive - - end element inclusive
        offset - - offset of result collection
        count - - amount of result collection
        Returns:
        collection of elements
      • rangeReversedAsync

        public <>> rangeReversedAsync​( fromElement,
                                                              boolean fromInclusive,
                                                               toElement,
                                                              boolean toInclusive,
                                                              int offset,
                                                              int count)
        Description copied from interface: RLexSortedSetAsync
        Returns values range in reverse order starting with fromElement and ending with toElement. Returned collection limited by count and starts with offset.
        Specified by:
        rangeReversedAsync in interface RLexSortedSetAsync
        Parameters:
        fromElement - - start element
        fromInclusive - - start element inclusive
        toElement - - end element
        toInclusive - - end element inclusive
        offset - - offset of result collection
        count - - amount of result collection
        Returns:
        collection of elements
      • countTail

        public int countTail​( fromElement,
                             boolean fromInclusive)
        Description copied from interface: RLexSortedSet
        Returns the number of tail values starting with fromElement.
        Specified by:
        countTail in interface RLexSortedSet
        Parameters:
        fromElement - - start element
        fromInclusive - - start element inclusive
        Returns:
        number of elements
      • countTailAsync

        public > countTailAsync​( fromElement,
                                               boolean fromInclusive)
        Description copied from interface: RLexSortedSetAsync
        Returns the number of tail values starting with fromElement.
        Specified by:
        countTailAsync in interface RLexSortedSetAsync
        Parameters:
        fromElement - - start element
        fromInclusive - - start element inclusive
        Returns:
        number of elements
      • countHead

        public int countHead​( toElement,
                             boolean toInclusive)
        Description copied from interface: RLexSortedSet
        Returns the number of head values ending with toElement.
        Specified by:
        countHead in interface RLexSortedSet
        Parameters:
        toElement - - end element
        toInclusive - - end element inclusive
        Returns:
        number of elements
      • countHeadAsync

        public > countHeadAsync​( toElement,
                                               boolean toInclusive)
        Description copied from interface: RLexSortedSetAsync
        Returns the number of head values ending with toElement.
        Specified by:
        countHeadAsync in interface RLexSortedSetAsync
        Parameters:
        toElement - - end element
        toInclusive - - end element inclusive
        Returns:
        number of elements
      • count

        public int count​( fromElement,
                         boolean fromInclusive,
                          toElement,
                         boolean toInclusive)
        Description copied from interface: RLexSortedSet
        Returns the number of elements between fromElement and toElement.
        Specified by:
        count in interface RLexSortedSet
        Parameters:
        fromElement - - start element
        fromInclusive - - start element inclusive
        toElement - - end element
        toInclusive - - end element inclusive
        Returns:
        number of elements
      • countAsync

        public > countAsync​( fromElement,
                                           boolean fromInclusive,
                                            toElement,
                                           boolean toInclusive)
        Description copied from interface: RLexSortedSetAsync
        Returns the number of elements between fromElement and toElement.
        Specified by:
        countAsync in interface RLexSortedSetAsync
        Parameters:
        fromElement - - start element
        fromInclusive - - start element inclusive
        toElement - - end element
        toInclusive - - end element inclusive
        Returns:
        number of elements
      • addAsync

        public > addAsync​( e)
        Description copied from interface: RCollectionAsync
        Adds element into this collection.
        Specified by:
        >
        Specified by:
        >
        Parameters:
        e - - element to add
        Returns:
        true if an element was added and false if it is already present
      • addAllAsync

        public > addAllAsync​(<? extends > c)
        Description copied from interface: RCollectionAsync
        Adds all elements contained in the specified collection
        Specified by:
        >
        Parameters:
        c - - collection of elements to add
        Returns:
        true if at least one element was added and false if all elements are already present
      • add

        public boolean add​( e)
        Specified by:
         in interface <>
        Specified by:
         in interface <>
      • addAll

        public boolean addAll​(<? extends > c)
        Specified by:
         in interface <>
        Specified by:
         in interface <>
      • range

        public <> range​(int startIndex,
                                        int endIndex)
        Description copied from interface: RLexSortedSet
        Returns values by rank range. Indexes are zero based. -1 means the highest score, -2 means the second highest score.
        Specified by:
        range in interface RLexSortedSet
        Parameters:
        startIndex - - start index
        endIndex - - end index
        Returns:
        collection of elements
      • rangeAsync

        public <>> rangeAsync​(int startIndex,
                                                      int endIndex)
        Description copied from interface: RLexSortedSetAsync
        Returns values by rank range. Indexes are zero based. -1 means the highest score, -2 means the second highest score.
        Specified by:
        rangeAsync in interface RLexSortedSetAsync
        Parameters:
        startIndex - - start index
        endIndex - - end index
        Returns:
        collection of elements
      • trySetComparator

        public boolean trySetComparator​(<? super > comparator)
        Description copied from interface: RSortedSet
        Sets new comparator only if current set is empty
        Specified by:
        >
        Parameters:
        comparator - for values
        Returns:
        true if new comparator setted false otherwise
      • comparator

        public <? super > comparator()
        Specified by:
         in interface <>
      • subSet

        public <> subSet​( fromElement,
                                         toElement)
        Specified by:
         in interface <>
      • headSet

        public <> headSet​( toElement)
        Specified by:
         in interface <>
      • tailSet

        public <> tailSet​( fromElement)
        Specified by:
         in interface <>
      • expire

        public boolean expire​(long timeToLive,
                               timeUnit)
        Description copied from interface: RExpirable
        Set a timeout for object. After the timeout has expired, the key will automatically be deleted.
        Specified by:
        expire in interface RExpirable
        Parameters:
        timeToLive - - timeout before object will be deleted
        timeUnit - - timeout time unit
        Returns:
        true if the timeout was set and false if not
      • expireAsync

        public > expireAsync​(long timeToLive,
                                             timeUnit)
        Description copied from interface: RExpirableAsync
        Set a timeout for object in async mode. After the timeout has expired, the key will automatically be deleted.
        Specified by:
        expireAsync in interface RExpirableAsync
        Parameters:
        timeToLive - - timeout before object will be deleted
        timeUnit - - timeout time unit
        Returns:
        true if the timeout was set and false if not
      • expireAt

        public boolean expireAt​(long timestamp)
        Description copied from interface: RExpirable
        Specified by:
        expireAt in interface RExpirable
        Parameters:
        timestamp - - expire date in milliseconds (Unix timestamp)
        Returns:
        true if the timeout was set and false if not
      • expire

        public boolean expire​( instant)
        Description copied from interface: RExpirable
        Set an expire date for object. When expire date comes the key will automatically be deleted.
        Specified by:
        expire in interface RExpirable
        Parameters:
        instant - - expire date
        Returns:
        true if the timeout was set and false if not
      • expireAsync

        public > expireAsync​( instant)
        Description copied from interface: RExpirableAsync
        Set an expire date for object. When expire date comes the key will automatically be deleted.
        Specified by:
        expireAsync in interface RExpirableAsync
        Parameters:
        instant - - expire date
        Returns:
        true if the timeout was set and false if not
      • expireAt

        public boolean expireAt​( timestamp)
        Description copied from interface: RExpirable
        Specified by:
        expireAt in interface RExpirable
        Parameters:
        timestamp - - expire date
        Returns:
        true if the timeout was set and false if not
      • clearExpire

        public boolean clearExpire()
        Description copied from interface: RExpirable
        Clear an expire timeout or expire date for object.
        Specified by:
        clearExpire in interface RExpirable
        Returns:
        true if timeout was removed false if object does not exist or does not have an associated timeout
      • clearExpireAsync

        public > clearExpireAsync()
        Description copied from interface: RExpirableAsync
        Clear an expire timeout or expire date for object in async mode. Object will not be deleted.
        Specified by:
        clearExpireAsync in interface RExpirableAsync
        Returns:
        true if the timeout was cleared and false if not
      • remainTimeToLive

        public long remainTimeToLive()
        Description copied from interface: RExpirable
        Remaining time to live of Redisson object that has a timeout
        Specified by:
        remainTimeToLive in interface RExpirable
        Returns:
        time in milliseconds -2 if the key does not exist. -1 if the key exists but has no associated expire.
      • remainTimeToLiveAsync

        public > remainTimeToLiveAsync()
        Description copied from interface: RExpirableAsync
        Remaining time to live of Redisson object that has a timeout
        Specified by:
        remainTimeToLiveAsync in interface RExpirableAsync
        Returns:
        time in milliseconds -2 if the key does not exist. -1 if the key exists but has no associated expire.
      • expireAsync

        protected > expireAsync​(long timeToLive,
                                                timeUnit,
                                               ... keys)
      • expireAtAsync

        protected > expireAtAsync​(long timestamp,
                                                 ... keys)
      • clearExpireAsync

        protected > clearExpireAsync​(... keys)