Replaces an entry in the list.

@param oldEntry
the entry to be replaced.
@param newEntry
the replacement entry.
516282
protected void replaceEntry(T oldEntry, T newEntry) {
        T prev = oldEntry.getPrev();
        T next = newEntry.getNext();
        if (prev != null) {
            prev.setNext(newEntry);
        } else {
            head = newEntry;
        }
        if (next != null) {
            next.setPrev(newEntry);
        } else {
            last = newEntry;
        }
    }
719469
public void setEntry(String cacheName, CacheEntry cacheEntry) {
        if (tc.isEntryEnabled())
            Tr.entry(tc, "setEntry: {0}", cacheEntry.id);
        cacheEntry = invalidationAuditDaemon.filterEntry(cacheName, cacheEntry);
        if (cacheEntry != null) {
            DCache cache = ServerCache.getCache(cacheName);
            cache.setEntry(cacheEntry,CachePerf.REMOTE);
        }

        if (tc.isEntryEnabled())
            Tr.exit(tc, "setEntry: {0}", cacheEntry==null?"null":cacheEntry.id );
    }
356371
public ListInventoryEntriesResult withEntries(java.util.Collection<java.util.Map<String, String>> entries) {
        setEntries(entries);
        return this;
    }
357751
private void mergeFreeEntries(List<FileEntry> entries) {
      long startTime = 0;
      if (trace) startTime = timeService.wallClockTime();
      FileEntry lastEntry = null;
      FileEntry newEntry = null;
      int mergeCounter = 0;
      for (FileEntry fe : entries) {
         if (fe.isLocked())
            continue;

         // Merge any holes created (consecutive free entries) in the file
         if ((lastEntry != null) && (lastEntry.offset == (fe.offset + fe.size))) {
            if (newEntry == null) {
               newEntry = new FileEntry(fe.offset, fe.size + lastEntry.size);
               freeList.remove(lastEntry);
               mergeCounter++;
            } else {
               newEntry = new FileEntry(fe.offset, fe.size + newEntry.size);
            }
            freeList.remove(fe);
            mergeCounter++;
         } else {
            if (newEntry != null) {
               mergeAndLogEntry(newEntry, mergeCounter);
               newEntry = null;
               mergeCounter = 0;
            }
         }
         lastEntry = fe;
      }

      if (newEntry != null)
         mergeAndLogEntry(newEntry, mergeCounter);

      if (trace) log.tracef("Total time taken for mergeFreeEntries: " + (timeService.wallClockTime() - startTime) + " (ms)");
   }
332623
static void replaceEntry(PollArrayWrapper source, int sindex,
                      PollArrayWrapper target, int tindex) {
        target.putDescriptor(tindex, source.getDescriptor(sindex));
        target.putEventOps(tindex, source.getEventOps(sindex));
        target.putReventOps(tindex, source.getReventOps(sindex));
    }
132130
private void writeEntry(HashtableEntry entry)

    throws IOException, EOFException, FileManagerException, ClassNotFoundException {

        long index = getHtindex(entry.index, entry.tableid);
        if (index == 0) { // first one in this bucket
            updateEntry(entry); // write to disk
            writeHashIndex(entry.index, entry.location, entry.tableid); // update index
        } else if (index == entry.location) { // replacing first entry
            updateEntry(entry);
            writeHashIndex(entry.index, entry.location, entry.tableid); // update index
        } else { // 
            //
            // If the entry has a "previous" pointer, then it was read earlier
            // from disk.  Otherwise, it is a brand new entry.  If it is a brand
            // entry, we write it to disk and chain at the front of the bucket.
            // If "previous" is not zero, we check to see if reallocation is
            // needed (location == 0).  If not, we simply update on disk and we're
            // done.  If reallocation is needed we update on disk to do the allocation
            // and call updatePointer to chain into the bucket.
            //
            if (entry.previous == 0) {
                entry.next = index;
                updateEntry(entry);
                writeHashIndex(entry.index, entry.location, entry.tableid); // update index
            } else {
                if (entry.location == 0) { // allocation needed?
                    updateEntry(entry); // do allocation
                    updatePointer(entry.previous, entry.location); // chain in
                } else {
                    updateEntry(entry); // no allocation, just update fields
                }
            }
        }

    }
119410
public static void addOrReplaceEntries(final File zip, final ZipEntrySource[] entries) {
    operateInPlace(zip, new InPlaceAction() {
      public boolean act(File tmpFile) {
        addOrReplaceEntries(zip, entries, tmpFile);
        return true;
      }
    });
  }
1194346
public void replace(Card oldOne, Card newOne) {
        VirtualLayoutManager layoutManager = getLayoutManager();
        if (oldOne != null && newOne != null && mGroupBasicAdapter != null && layoutManager != null) {
            List<LayoutHelper> layoutHelpers = layoutManager.getLayoutHelpers();
            int cardIdx = mGroupBasicAdapter.findCardIdxForCard(oldOne);
            if (layoutHelpers != null && cardIdx >= 0 && cardIdx < layoutHelpers.size()) {
                final List<LayoutHelper> newLayoutHelpers = new LinkedList<>();
                for (int i = 0, size = layoutHelpers.size(); i < size; i++) {
                    LayoutHelper layoutHelper = layoutHelpers.get(i);
                    if (i == cardIdx) {
                        layoutHelper = newOne.getLayoutHelper();
                    }
                    newLayoutHelpers.add(layoutHelper);
                }
                layoutManager.setLayoutHelpers(newLayoutHelpers);
                mGroupBasicAdapter.replaceComponent(oldOne, newOne);
            }
        }
    }
156155
public void setEntry(AclEntry entry) {
    // TODO(cc): when setting non-mask entries, the mask should be dynamically updated too.
    switch (entry.getType()) {
      case NAMED_USER:
        mNamedUserActions.put(entry.getSubject(), entry.getActions());
        return;
      case NAMED_GROUP:
        mNamedGroupActions.put(entry.getSubject(), entry.getActions());
        return;
      case MASK:
        mMaskActions = entry.getActions();
        return;
      case OWNING_USER:  // fall through
      case OWNING_GROUP: // fall through
      case OTHER:
        throw new IllegalStateException(
            "Deleting base entry is not allowed. entry: " + entry);
      default:
        throw new IllegalStateException("Unknown ACL entry type: " + entry.getType());
    }
  }
308127
void merge(RepositoryEntry entry)
   {
      merge((RepositoryInfo)entry);
      List<WorkspaceEntry> workspaceEntries = entry.workspaces;
      if (workspaceEntries == null || workspaceEntries.isEmpty())
      {
         return;
      }
      if (workspaces == null || workspaces.isEmpty())
      {
         this.workspaces = workspaceEntries;
         return;
      }
      Map<String, WorkspaceEntry> mWorkspaceEntries = new LinkedHashMap<String, WorkspaceEntry>();
      for (WorkspaceEntry wkEntry : workspaceEntries)
      {
         mWorkspaceEntries.put(wkEntry.getName(), wkEntry);
      }
      for (WorkspaceEntry wkEntry : workspaces)
      {
         mWorkspaceEntries.put(wkEntry.getName(), wkEntry);
      }
      this.workspaces = new ArrayList<WorkspaceEntry>(mWorkspaceEntries.values());
   }
194773
def newEntry(self, ident = "", seq = "", plus = "", qual = "") :
		""""""
		e = FastqEntry()
		self.data.append(e)
		return e
1206323
public final void addEntries(Entry<?>... entries) {
        if (entries != null) {
            for (Entry<?> entry : entries) {
                entry.setCalendar(this);
            }
        }
    }
870888
private void put(DirectoryEntry entry, boolean overwriteExisting) {
    int index = bucketIndex(entry.name(), table.length);

    // find the place the new entry should go, ensuring an entry with the same name doesn't already
    // exist along the way
    DirectoryEntry prev = null;
    DirectoryEntry curr = table[index];
    while (curr != null) {
      if (curr.name().equals(entry.name())) {
        if (overwriteExisting) {
          // just replace the existing entry; no need to expand, and entryCount doesn't change
          if (prev != null) {
            prev.next = entry;
          } else {
            table[index] = entry;
          }
          entry.next = curr.next;
          curr.next = null;
          entry.file().incrementLinkCount();
          return;
        } else {
          throw new IllegalArgumentException("entry '" + entry.name() + "' already exists");
        }
      }

      prev = curr;
      curr = curr.next;
    }

    entryCount++;
    if (expandIfNeeded()) {
      // if the table was expanded, the index/entry we found is no longer applicable, so just add
      // the entry normally
      index = bucketIndex(entry.name(), table.length);
      addToBucket(index, table, entry);
    } else {
      // otherwise, we just can use the index/entry we found
      if (prev != null) {
        prev.next = entry;
      } else {
        table[index] = entry;
      }
    }

    entry.file().incrementLinkCount();
  }
435719
public boolean replace(String key, CacheEntry oldValue, CacheEntry newValue) {
		final String sourceMethod = "replace"; //$NON-NLS-1$
		boolean replaced = false;
		SignalUtil.lock(cloneLock.readLock(), sourceClass, sourceMethod);
		try {
			replaced = map.replace(keyPrefix + key, oldValue, newValue);
			if (replaced && oldValue != newValue) {
				oldValue.delete(cacheMgr);
			}
		} finally {
			cloneLock.readLock().unlock();
		}
		return replaced;
	}
825498
@Override
    void addEntry(int hash, K key, V value, int bucketIndex) {
	super.addEntry(hash, key, value, bucketIndex);

	// Remove eldest entry if instructed
	Entry<K, V> eldest = header.after;
	if (removeEldestEntry(eldest)) {
	    removeEntryForKey(eldest.key);
	}
    }
353756
protected Entry<K, V> put(@NonNull K key, @NonNull V v) {
        Entry<K, V> newEntry = new Entry<>(key, v);
        mSize++;
        if (mEnd == null) {
            mStart = newEntry;
            mEnd = mStart;
            return newEntry;
        }

        mEnd.mNext = newEntry;
        newEntry.mPrevious = mEnd;
        mEnd = newEntry;
        return newEntry;

    }
340137
public void replace(V oldValue, V newValue) {
		if (values.contains(oldValue)) {
			int index = values.indexOf(oldValue);
			values.remove(oldValue);
			values.add(index, newValue);
			
			if (oldValue instanceof JsonEntity) {
				((JsonEntity)oldValue).removePropertyChangeListener(propListener);
			}
			
			if (newValue instanceof JsonEntity) {
				((JsonEntity)newValue).removePropertyChangeListener(propListener);
			}
			
			firePropertyChange("#" + index, oldValue, newValue);
		}
	}