Exemplo n.º 1
0
 /**
  * {@inheritDoc}
  *
  * @see java.util.NavigableSet#tailSet(Object, boolean)
  * @since 1.6
  */
 @SuppressWarnings("unchecked")
 public NavigableSet<E> tailSet(E start, boolean startInclusive) {
   // Check for errors
   Comparator<? super E> c = backingMap.comparator();
   if (c == null) {
     ((net.sourceforge.retroweaver.harmony.runtime.java.lang.Comparable<E>) start)
         .compareTo(start);
   } else {
     c.compare(start, start);
   }
   return new TreeSet<E>(backingMap.tailMap(start, startInclusive));
 }
Exemplo n.º 2
0
    @Override
    public void remove() {
      if (currentRemoved)
        throw new IllegalStateException("Current element has already been removed");

      if (currentValue == null)
        throw new IllegalStateException("Next method was not called for given iterator");

      if (removeFromNewEntries(currentValue)) {
        if (size >= 0) size--;
      } else {
        Change counter = changedValues.get(currentValue);
        if (counter != null) {
          counter.decrement();
          if (size >= 0)
            if (counter.isUndefined()) size = -1;
            else size--;
        } else {
          if (nextChange != null) {
            changedValues.put(currentValue, new DiffChange(-1));
            changedValuesIterator =
                changedValues.tailMap(nextChange.getKey(), false).entrySet().iterator();
          } else {
            changedValues.put(currentValue, new DiffChange(-1));
          }

          size = -1;
        }
      }

      if (OSBTreeRidBag.this.owner != null)
        ORecordInternal.unTrack(OSBTreeRidBag.this.owner, currentValue);

      if (updateOwner)
        fireCollectionChangedEvent(
            new OMultiValueChangeEvent<OIdentifiable, OIdentifiable>(
                OMultiValueChangeEvent.OChangeType.REMOVE,
                currentValue,
                null,
                currentValue,
                false));
      currentRemoved = true;
    }
Exemplo n.º 3
0
 /**
  * @throws ClassCastException {@inheritDoc}
  * @throws NullPointerException if {@code fromElement} is null and this set uses natural ordering,
  *     or its comparator does not permit null elements
  * @throws IllegalArgumentException {@inheritDoc}
  * @since 1.6
  */
 public NavigableSet<E> tailSet(E fromElement, boolean inclusive) {
   return new TreeSet<E>(m.tailMap(fromElement, inclusive));
 }