@SuppressWarnings("cast") public boolean contains(Object o) { assert type == null || type.isInstance(o); return find((T) o) >= 0; }
@SuppressWarnings("cast") public boolean contains(Object o) { assert type == null || type.isInstance(o); return find((T) o) >= 0; }
public int indexOf(Object o) { assert type == null || type.isInstance(o); int n = find((T) o); if (n < end && comparator.compare(o, list[n]) == 0) return n; return -1; }
public int indexOf(Object o) { assert type == null || type.isInstance(o); int n = find((T) o); if (n < end && comparator.compare(o, list[n]) == 0) return n; return -1; }
public int lastIndexOf(Object o) { assert type == null || type.isInstance(o); int n = find((T) o); if (n >= end || comparator.compare(o, list[n]) != 0) return -1; while (n < end - 1 && comparator.compare(o, list[n + 1]) == 0) n++; return n; }
public int lastIndexOf(Object o) { assert type == null || type.isInstance(o); int n = find((T) o); if (n >= end || comparator.compare(o, list[n]) != 0) return -1; while (n < end - 1 && comparator.compare(o, list[n + 1]) == 0) n++; return n; }
@Override public SortedList<T> subSet(T fromElement, T toElement) { int start = find(fromElement); int end = find(toElement); if (isSubSet() && (start < 0 || end < 0)) throw new IllegalArgumentException("This list is a subset"); if (start < 0) start = 0; if (end < 0) end = list.length; return subList(start, end); }
@Override public int indexOf(Object o) { assert type == null || type.isInstance(o); int n = find(o); if (n < end && compare((T) o, list[n]) == 0) return n; return -1; }
@Override public SortedSet<T> tailSet(T fromElement) { int i = find(fromElement); return subList(i - start, end - start); }
@Override public SortedList<T> headSet(T toElement) { int i = find(toElement); return subList(start, i - start); }
@Override public int indexOf(Object o) { assert type == null || type.isInstance(o); int n = find(o); if (n < end && compare((T) o, list[n]) == 0) return n; return -1; }
@Override public int indexOf(Object o) { assert type == null || type.isInstance(o); int n = find(o); if (n < end && compare((T) o, list[n]) == 0) return n; return -1; }
@Override public SortedSet<T> tailSet(T fromElement) { int i = find(fromElement); return subList(i - start, end - start); }
@Override public SortedList<T> headSet(T toElement) { int i = find(toElement); return subList(start, i - start); }
@Override public int indexOf(Object o) { assert type == null || type.isInstance(o); int n = find(o); if (n < end && compare((T) o, list[n]) == 0) return n; return -1; }
@Override public SortedSet<T> tailSet(T fromElement) { int i = find(fromElement); return subList(i - start, end - start); }
@Override public SortedList<T> headSet(T toElement) { int i = find(toElement); return subList(start, i - start); }
@Override public int lastIndexOf(Object o) { assert type == null || type.isInstance(o); int n = find(o); if (n >= end || compare((T) o, list[n]) != 0) return -1; while (n < end - 1 && compare((T) o, list[n + 1]) == 0) n++; return n; }
@Override public int lastIndexOf(Object o) { assert type == null || type.isInstance(o); int n = find(o); if (n >= end || compare((T) o, list[n]) != 0) return -1; while (n < end - 1 && compare((T) o, list[n + 1]) == 0) n++; return n; }
@Override public int lastIndexOf(Object o) { assert type == null || type.isInstance(o); int n = find(o); if (n >= end || compare((T) o, list[n]) != 0) return -1; while (n < end - 1 && compare((T) o, list[n + 1]) == 0) n++; return n; }