@Override
  public boolean convertRecords2Links() {
    final Map<OIdentifiable, Change> newChangedValues = new HashMap<OIdentifiable, Change>();
    for (Map.Entry<OIdentifiable, Change> entry : changes.entrySet()) {
      OIdentifiable identifiable = entry.getKey();
      if (identifiable instanceof ORecord) {
        ORID identity = identifiable.getIdentity();
        ORecord record = (ORecord) identifiable;
        identity = record.getIdentity();

        newChangedValues.put(identity, entry.getValue());
      } else newChangedValues.put(entry.getKey().getIdentity(), entry.getValue());
    }

    for (Map.Entry<OIdentifiable, Change> entry : newChangedValues.entrySet()) {
      if (entry.getKey() instanceof ORecord) {
        ORecord record = (ORecord) entry.getKey();

        newChangedValues.put(record, entry.getValue());
      } else return false;
    }

    newEntries.clear();

    changes.clear();
    changes.putAll(newChangedValues);

    return true;
  }
 public void confirmDelete() {
   collectionPointer = null;
   changes.clear();
   newEntries.clear();
   size = 0;
   if (changeListeners != null) changeListeners.clear();
   changeListeners = null;
 }
  @Override
  public void convertLinks2Records() {
    TreeMap<OIdentifiable, Change> newChanges = new TreeMap<OIdentifiable, Change>();
    for (Map.Entry<OIdentifiable, Change> entry : changes.entrySet()) {
      final OIdentifiable key = entry.getKey().getRecord();
      if (key != null && this.owner != null) {
        ORecordInternal.unTrack(this.owner, entry.getKey());
        ORecordInternal.track(this.owner, key);
      }
      newChanges.put((key == null) ? entry.getKey() : key, entry.getValue());
    }

    changes.clear();
    changes.putAll(newChanges);
  }
Esempio n. 4
0
 @Override
 public void clear() {
   configMap.clear();
 }
 public void clearChanges() {
   changes.clear();
 }
Esempio n. 6
0
 /**
  * Removes all elements from this {@code TreeSet}, leaving it empty.
  *
  * @see #isEmpty
  * @see #size
  */
 @Override
 public void clear() {
   backingMap.clear();
 }
Esempio n. 7
0
 /** Removes all of the elements from this set. The set will be empty after this call returns. */
 public void clear() {
   m.clear();
 }