All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.aksw.commons.collection.rangeset.RangeSetDelegate Maven / Gradle / Ivy

There is a newer version: 0.9.9
Show newest version
package org.aksw.commons.collection.rangeset;

import java.util.Set;

import com.google.common.collect.ForwardingSet;
import com.google.common.collect.Range;
import com.google.common.collect.RangeSet;

public interface RangeSetDelegate>
	extends RangeSet
{
	RangeSet getDelegate();

	@Override
	default boolean contains(T value) {
		return getDelegate().contains(value);
	}

	@Override
	default Range rangeContaining(T value) {
		return getDelegate().rangeContaining(value);
	}

	@Override
	default boolean intersects(Range otherRange) {
		return getDelegate().intersects(otherRange);
	}

	@Override
	default boolean encloses(Range otherRange) {
		return getDelegate().encloses(otherRange);
	}

	@Override
	default boolean enclosesAll(RangeSet other) {
		return getDelegate().enclosesAll(other);
	}

	@Override
	default boolean isEmpty() {
		return getDelegate().isEmpty();
	}

	@Override
	default Range span() {
		return getDelegate().span();
	}

	@Override
	default Set> asRanges() {
		return new ForwardingSet>() {
			@Override
			protected Set> delegate() {
				return RangeSetDelegate.this.getDelegate().asRanges();
			}
		};
	}

	@Override
	default Set> asDescendingSetOfRanges() {
		return new ForwardingSet>() {
			@Override
			protected Set> delegate() {
				return RangeSetDelegate.this.getDelegate().asDescendingSetOfRanges();
			}
		};
	}

	@Override
	default RangeSet complement() {
		return new RangeSetDelegate() {
			@Override
			public RangeSet getDelegate() {
				return RangeSetDelegate.this.getDelegate().complement();
			}
		};
	}

	@Override
	default RangeSet subRangeSet(Range view) 
	{
		return new RangeSetDelegate() {
			@Override
			public RangeSet getDelegate() {
				return RangeSetDelegate.this.getDelegate().subRangeSet(view);
			}
		};
	}

	@Override
	default void add(Range range) {
		getDelegate().add(range);
	}

	@Override
	default void remove(Range range) {
		getDelegate().remove(range);
	}

	@Override
	default void clear() {
		getDelegate().clear();
	}

	@Override
	default void addAll(RangeSet other) {
		getDelegate().addAll(other);
	}

	@Override
	default void removeAll(RangeSet other) {
		getDelegate().removeAll(other);
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy