Top Description Constructors Methods
com.google.common.collect

pack-priv abstract Class AbstractRangeSet<C extends java.lang.Comparable<T>>

extends Object
implements RangeSet<C extends Comparable<T>>
Class Inheritance
All Implemented Interfaces
com.google.common.collect.RangeSet
Known Direct Subclasses
com.google.common.collect.ImmutableRangeSet, com.google.common.collect.TreeRangeSet
Annotations
@GwtIncompatible
@ElementTypesAreNonnullByDefault
Imports
com.google.common.annotations.GwtIncompatible, javax.annotation.CheckForNull

A skeletal implementation of RangeSet.
Author
Louis Wasserman

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
add(Range<C> range)

Implements com.google.common.collect.RangeSet.add.

Adds the specified range to this RangeSet (optional operation).
public void
addAll(RangeSet<C> other)

Implements com.google.common.collect.RangeSet.addAll.

Adds all of the ranges from the specified range set to this range set (optional operation).
public void
clear()

Implements com.google.common.collect.RangeSet.clear.

Removes all ranges from this RangeSet (optional operation).
public boolean
contains(C value)

Implements com.google.common.collect.RangeSet.contains.

Determines whether any of this range set's member ranges contains value.
public abstract boolean
encloses(Range<C> otherRange)

Redeclares com.google.common.collect.RangeSet.encloses.

Returns true if there exists a member range in this range set which encloses the specified range.
public boolean
enclosesAll(RangeSet<C> other)

Implements com.google.common.collect.RangeSet.enclosesAll.

Returns true if for each member range in other there exists a member range in this range set which encloses it.
public boolean
equals(Object
the reference object with which to compare.
obj
)

Overrides java.lang.Object.equals.

Implements com.google.common.collect.RangeSet.equals.

Returns true if obj is another RangeSet that contains the same ranges according to Range#equals(Object).
public final int
hashCode()

Overrides java.lang.Object.hashCode.

Implements com.google.common.collect.RangeSet.hashCode.

Returns asRanges().hashCode().
public boolean
intersects(Range<C> otherRange)

Implements com.google.common.collect.RangeSet.intersects.

Returns true if there exists a non-empty range enclosed by both a member range in this range set and the specified range.
public boolean
isEmpty()

Implements com.google.common.collect.RangeSet.isEmpty.

Returns true if this range set contains no ranges.
public abstract Range<C>
rangeContaining(C value)

Redeclares com.google.common.collect.RangeSet.rangeContaining.

Returns the unique range from this range set that contains value, or null if this range set does not contain value.
public void
remove(Range<C> range)

Implements com.google.common.collect.RangeSet.remove.

Removes the specified range from this RangeSet (optional operation).
public void
removeAll(RangeSet<C> other)

Implements com.google.common.collect.RangeSet.removeAll.

Removes all of the ranges from the specified range set from this range set (optional operation).
public final String
toString()

Overrides java.lang.Object.toString.

Implements com.google.common.collect.RangeSet.toString.

Returns a readable string representation of this range set.
Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Constructor Detail

AbstractRangeSetback to summary
pack-priv AbstractRangeSet()

Method Detail

addback to summary
public void add(Range<C> range)

Implements com.google.common.collect.RangeSet.add.

Doc from com.google.common.collect.RangeSet.add.

Adds the specified range to this RangeSet (optional operation). That is, for equal range sets a and b, the result of a.add(range) is that a will be the minimal range set for which both a.enclosesAll(b) and a.encloses(range).

Note that range will be coalesced with any ranges in the range set that are connected with it. Moreover, if range is empty, this is a no-op.

Annotations
@Override
addAllback to summary
public void addAll(RangeSet<C> other)

Implements com.google.common.collect.RangeSet.addAll.

Doc from com.google.common.collect.RangeSet.addAll.

Adds all of the ranges from the specified range set to this range set (optional operation). After this operation, this range set is the minimal range set that encloses both the original range set and other.

This is equivalent to calling add on each of the ranges in other in turn.

Annotations
@Override
clearback to summary
public void clear()

Implements com.google.common.collect.RangeSet.clear.

Doc from com.google.common.collect.RangeSet.clear.

Removes all ranges from this RangeSet (optional operation). After this operation, this.contains(c) will return false for all c.

This is equivalent to remove(Range.all()).

Annotations
@Override
containsback to summary
public boolean contains(C value)

Implements com.google.common.collect.RangeSet.contains.

Doc from com.google.common.collect.RangeSet.contains.

Determines whether any of this range set's member ranges contains value.

Annotations
@Override
enclosesback to summary
public abstract boolean encloses(Range<C> otherRange)

Redeclares com.google.common.collect.RangeSet.encloses.

Doc from com.google.common.collect.RangeSet.encloses.

Returns true if there exists a member range in this range set which encloses the specified range.

Annotations
@Override
enclosesAllback to summary
public boolean enclosesAll(RangeSet<C> other)

Implements com.google.common.collect.RangeSet.enclosesAll.

Doc from com.google.common.collect.RangeSet.enclosesAll.

Returns true if for each member range in other there exists a member range in this range set which encloses it. It follows that this.contains(value) whenever other.contains(value). Returns true if other is empty.

This is equivalent to checking if this range set encloses each of the ranges in other.

Annotations
@Override
equalsback to summary
public boolean equals(Object obj)

Overrides java.lang.Object.equals.

Implements com.google.common.collect.RangeSet.equals.

Doc from com.google.common.collect.RangeSet.equals.

Returns true if obj is another RangeSet that contains the same ranges according to Range#equals(Object).

Parameters
obj:Object

Doc from java.lang.Object.equals.

the reference object with which to compare.

Returns:boolean

Doc from java.lang.Object.equals.

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
hashCodeback to summary
public final int hashCode()

Overrides java.lang.Object.hashCode.

Implements com.google.common.collect.RangeSet.hashCode.

Doc from com.google.common.collect.RangeSet.hashCode.

Returns asRanges().hashCode().

Returns:int

Doc from java.lang.Object.hashCode.

a hash code value for this object.

Annotations
@Override
intersectsback to summary
public boolean intersects(Range<C> otherRange)

Implements com.google.common.collect.RangeSet.intersects.

Doc from com.google.common.collect.RangeSet.intersects.

Returns true if there exists a non-empty range enclosed by both a member range in this range set and the specified range. This is equivalent to calling subRangeSet(otherRange) and testing whether the resulting range set is non-empty.

Annotations
@Override
isEmptyback to summary
public boolean isEmpty()

Implements com.google.common.collect.RangeSet.isEmpty.

Doc from com.google.common.collect.RangeSet.isEmpty.

Returns true if this range set contains no ranges.

Annotations
@Override
rangeContainingback to summary
public abstract Range<C> rangeContaining(C value)

Redeclares com.google.common.collect.RangeSet.rangeContaining.

Doc from com.google.common.collect.RangeSet.rangeContaining.

Returns the unique range from this range set that contains value, or null if this range set does not contain value.

Annotations
@Override
@CheckForNull
removeback to summary
public void remove(Range<C> range)

Implements com.google.common.collect.RangeSet.remove.

Doc from com.google.common.collect.RangeSet.remove.

Removes the specified range from this RangeSet (optional operation). After this operation, if range.contains(c), this.contains(c) will return false.

If range is empty, this is a no-op.

Annotations
@Override
removeAllback to summary
public void removeAll(RangeSet<C> other)

Implements com.google.common.collect.RangeSet.removeAll.

Doc from com.google.common.collect.RangeSet.removeAll.

Removes all of the ranges from the specified range set from this range set (optional operation). After this operation, if other.contains(c), this.contains(c) will return false.

This is equivalent to calling remove on each of the ranges in other in turn.

Annotations
@Override
toStringback to summary
public final String toString()

Overrides java.lang.Object.toString.

Implements com.google.common.collect.RangeSet.toString.

Doc from com.google.common.collect.RangeSet.toString.

Returns a readable string representation of this range set. For example, if this RangeSet consisted of Range.closed(1, 3) and Range.greaterThan(4), this might return " [1..3](4..+∞)"}.

Returns:String

Doc from java.lang.Object.toString.

a string representation of the object.

Annotations
@Override