/*
(non-Javadoc)

@see com.ibm.ws.objectManager.Collection#add(com.ibm.ws.objectManager.Token, com.ibm.ws.objectManager.Transaction)
513935
public boolean add(Token token,
                       Transaction transaction)
                    throws ObjectManagerException
    {
        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.entry(this, cclass,
                        "add",
                        new Object[] { token, transaction });

        List.Entry newEntry = null;
        // Lock the tailSequenceNumber until the new link is in the list.
        // This prevents the possibility that after we had incremented the tail sequence number
        // but before we had added it to the subList some thread resets the headSequenceNumber 
        // and skipped passed the link we just added.
        synchronized (transaction.internalTransaction) {
            tailSequenceNumberLock.lock();
            try {
                if (!tailSequenceNumberSet)
                    resetTailSequenceNumber();
                // Establish the sequenceNumber of this Object in the overall list.
                long usableTailSequenceNumber = ++tailSequenceNumber;

                // Figure out which subList the Object should be added to.
                ConcurrentSubList list = getSublist(usableTailSequenceNumber);
                // Add the link near the tail of the list according to its assigned
                // sequence number.
                newEntry = list.addEntry(token,
                                         transaction,
                                         usableTailSequenceNumber,
                                         this);
            } finally {
                if (tailSequenceNumberLock.isHeldByCurrentThread())
                    tailSequenceNumberLock.unlock();
            } // try (tailSequenceNumberLock).
        } // synchronized (transaction.internalTransaction).

        boolean modified = (newEntry != null);
        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.exit(this, cclass,
                       "add",
                       new Object[] { new Boolean(modified) });
        return modified;
    }
476954
public void putTransaction(SipServletRequestImpl request) {
            final String txId = ((ViaHeader) request.getMessage().getHeader(ViaHeader.NAME)).getBranch();
            final TransactionApplicationData txData = request.getTransactionApplicationData();
            if(txData != null && this.transactionMap.put(txId, txData) == null) {
                    if(logger.isDebugEnabled()) {
                            logger.debug("Transaction "+txId+" added to proxy.");
                    }
            }                               
    }
492657
public synchronized Token get(Object key,
                                  Transaction transaction)
                    throws ObjectManagerException
    {
        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.entry(this,
                        cclass,
                        "get",
                        new Object[] { key,
                                      transaction });

        Entry entry = getEntry(key, transaction);
        Token value = null;
        if (entry != null)
            value = entry.getValue();

        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.exit(this,
                       cclass,
                       "get",
                       new Object[] { entry, value });
        return value;
    }
1197131
public boolean remove(Token token,
                          Transaction transaction)
                    throws ObjectManagerException
    {
        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.entry(this, cclass,
                        "remove",
                        new Object[] { token, transaction });

        Iterator iterator = iterator();
        boolean removed = false;
        synchronized (iterator) {
            synchronized (transaction.internalTransaction) {
                synchronized (this) {
                    try {
                        while (iterator.next(transaction) != token);
                        iterator.remove(transaction);
                        removed = true;
                    } catch (java.util.NoSuchElementException exception) {
                        // No FFDC code needed.
                    } // try.
                } // synchronized (this).
            } // synchronized (transaction.internalTransaction).
        } // synchronized (iterator).

        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.exit(this, cclass,
                       "remove",
                       new Object[] { new Boolean(removed) });
        return removed;
    }
1067509
public <T extends Relation> T add(T statement,
                                     int num,
                                     Collection<T> anonRelationCollection,
                                     HashMap<QualifiedName, Collection<T>> namedRelationMap,
                                     HashMap<QualifiedName, Collection<T>> effectRelationMap,
                                     HashMap<QualifiedName, Collection<T>> causeRelationMap) {
	QualifiedName aid2 = u.getEffect(statement); //wib.getInformed();
	QualifiedName aid1 = u.getCause(statement); //wib.getInformant();

	statement = pFactory.newStatement(statement); // clone
	
	QualifiedName id;
	if (statement instanceof Identifiable) {
	    id=((Identifiable)statement).getId();	
	} else {
	    id=null;
	}

	if (id == null) {

	    boolean found = false;
	    Collection<T> relationCollection = effectRelationMap.get(aid2);
	    if (relationCollection == null) {
		relationCollection = new LinkedList<T>();
		relationCollection.add(statement);
		effectRelationMap.put(aid2, relationCollection);
	    } else {
		for (T u : relationCollection) {
		    if (u.equals(statement)) {
			found = true;
			statement = u;
			break;
		    }
		}
		if (!found) {
		    relationCollection.add(statement);
		}
	    }

	    relationCollection = causeRelationMap.get(aid1);
	    if (relationCollection == null) {
		relationCollection = new LinkedList<T>();
		relationCollection.add(statement);
		causeRelationMap.put(aid1, relationCollection);
	    } else {
		if (!found) {
		    // if we had not found it in the first table, then we
		    // have to add it here too
		    relationCollection.add(statement);
		}
	    }

	    if (!found) {
		anonRelationCollection.add(statement);
	    }
	} else {
	    Collection<T> relationCollection=namedRelationMap.get(id);
	    if (relationCollection==null) {
		relationCollection=new LinkedList<T>();
		relationCollection.add(statement);
		namedRelationMap.put(id, relationCollection);
	    } else {
		boolean found=false;
		for (T u1: relationCollection) {
		    if (sameEdge(u1,statement,num)) {
			found=true;
			mergeAttributes(u1, statement);
			break;			
		    }
		}
		if (!found) {
		    relationCollection.add(statement);
		}
	    }
	}
	return statement;
}
1233842
public void addTransaction(SipServletRequestImpl request) {
        if(!request.getMethod().equalsIgnoreCase("ACK") && !request.getMethod().equalsIgnoreCase("PRACK")) {
                String branch = ((Via)request.getMessage().getHeader(Via.NAME)).getBranch();
                if(this.ongoingTransactions.add(new TransactionRequest(branch, request))) {
                        request.getTransactionApplicationData().setProxyBranch(this);
                        if(logger.isDebugEnabled()) {
                                logger.debug("Added transaction "+branch+" to proxy branch.");
                        }
                }                                               
        }                               
    }
1305658
public void add(Collection<KeyTransaction> keyTransactions)
    {
        for(KeyTransaction keyTransaction : keyTransactions)
            this.keyTransactions.put(keyTransaction.getId(), keyTransaction);
    }
1215380
public TransactionLoadRequest addLoad(Object key) {
        objectsToLoad.add(key);
        objectLoadExpressions.add(null);
        return this;
    }
870480
def add_token(self, token):
        
        token = self.process_token(token)
        self._token_count.update([token])
77416
private StatementResult addCompany( final Transaction tx, final String name )
    {
        return tx.run( "CREATE (:Company {name: $name})", parameters( "name", name ) );
    }
853803
public TransactionWriteRequest addUpdate(Object object, DynamoDBTransactionWriteExpression transactionWriteExpression) {
        return addUpdate(object, transactionWriteExpression, null /* returnValuesOnConditionCheckFailure */);
    }
147442
public void addToken(Token token)
    {
        // Add verification of no token overlap
        if (!token.getSentence().equals(this))
            throw new IllegalArgumentException();
        tokens.add(token);
    }
455113
private void addTokens(final Token curToken, final List<Token> tokens) {
    if (curToken.tokenLength() != 0) {
      if (this.unTokenizable) {
        tokens.add(curToken);
      } else if (!this.unTokenizable) {
        if (!replacement.matcher(curToken.getTokenValue()).matches()) {
          tokens.add(curToken);
        }
      }
    }
  }
1041695
public void registerTransaction(TransactionImpl tran) {
        if (tc.isEntryEnabled())
            Tr.entry(tc, "registerTransaction", new Object[] { this, tran });

        _recoveringTransactions.add(tran);

        if (tc.isEntryEnabled())
            Tr.exit(tc, "registerTransaction", _recoveringTransactions.size());
    }
830760
void postCommit(Transaction transaction)
                    throws ObjectManagerException
    {
        throw new InvalidStateException(this, InternalTransaction.stateTerminated, InternalTransaction.stateNames[InternalTransaction.stateTerminated]);
    }
64829
@Override
  public void add(T indexElement) {
    mapByNum.put(indexElement.getNumber(), indexElement);
    if (mapByRawNum != null) {
      mapByRawNum.put(indexElement.getRawNumber(), indexElement);
    }
    if (mapById != null) {
      mapById.put(indexElement.getId(), indexElement);
    }
  }
1367686
protected synchronized void addFromCheckpoint(ManagedObject managedObject,
                                                  Transaction transaction)
                    throws ObjectManagerException {
        final String methodName = "addFromCheckpoint";
        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.entry(this, cclass, methodName, new Object[] { managedObject,
                                                                transaction });

        // Make the ManagedObject ready for an addition.
        // Nothing went wrong during forward processing!
        managedObject.preAdd(transaction);

        // Only persistent objects are recovered from a checkpoint.
        setState(nextStateForInvolvePersistentObjectFromCheckpoint);
        // The object is now included in the transaction.
        includedManagedObjects.put(managedObject.owningToken, managedObject);

        // The ManagedObject was read from the ObjectStore, give it a low log
        // and ManagedObject sequence number so that any later operation will supercede this one.
        // The loggedSerialisedBytes will be unchanged, possibly null for this Token.
        // If there already a logSequenceNumber known for this token it must have been put
        // there after the checkpoint start and has already been superceded.
        if (!logSequenceNumbers.containsKey(managedObject.owningToken)) {
            logSequenceNumbers.put(managedObject.owningToken,
                                   new Long(0));
            managedObjectSequenceNumbers.put(managedObject.owningToken,
                                             new Long(0));
        } // if (!logSequenceNumbers.containsKey(managedObject.owningToken)).

        // Redrive the postAdd method for the object.
        managedObject.postAdd(transaction, true);

        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.exit(this, cclass, methodName);
    }