/** * Returns a view of the portion of this set whose elements occur with a frequency equal or greater than * {@code fromElement} frequency. * * @param fromElement low endpoint (inclusive) of the returned set. May be {@code null}. * @return a view of the portion of this set delimited by the given endpoint. */ @Override public SortedSet<E> tailSet(final E fromElement) { return new SubSet(true, fromElement, false, null); }
/** * Returns a view of the portion of this set whose elements occur with a frequency in the range of * {@code fromElement} frequency inclusive to {@code toElement} frequency exclusive. * * @param fromElement low endpoint (inclusive) of the returned set. May be {@code null}. * @param toElement high endpoint (exclusive) of the returned set. May be {@code null}. * @return a view of the portion of this set delimited by the given endpoints. */ @Override public SortedSet<E> subSet(final E fromElement, final E toElement) { return new SubSet(true, fromElement, true, toElement); }
/** * Returns a view of the portion of this set whose elements occur with a frequency strictly less than * {@code toElement} frequency. * * @param toElement high endpoint (exclusive) of the returned set. May be {@code null}. * @return a view of the portion of this set delimited by the given endpoint. */ @Override public SortedSet<E> headSet(final E toElement) { return new SubSet(false, null, true, toElement); }
/** * Returns a view of the portion of this set whose elements occur with a frequency in the range of * {@code fromElement} frequency inclusive to {@code toElement} frequency exclusive. * * @param fromElement low endpoint (inclusive) of the returned set. May be {@code null}. * @param toElement high endpoint (exclusive) of the returned set. May be {@code null}. * @return a view of the portion of this set delimited by the given endpoints. */ @Override public SortedSet<E> subSet(final E fromElement, final E toElement) { return new SubSet(true, fromElement, true, toElement); }
/** * Returns a view of the portion of this set whose elements occur with a frequency strictly less than * {@code toElement} frequency. * * @param toElement high endpoint (exclusive) of the returned set. May be {@code null}. * @return a view of the portion of this set delimited by the given endpoint. */ @Override public SortedSet<E> headSet(final E toElement) { return new SubSet(false, null, true, toElement); }
/** * Returns a view of the portion of this set whose elements occur with a frequency equal or greater than * {@code fromElement} frequency. * * @param fromElement low endpoint (inclusive) of the returned set. May be {@code null}. * @return a view of the portion of this set delimited by the given endpoint. */ @Override public SortedSet<E> tailSet(final E fromElement) { return new SubSet(true, fromElement, false, null); }