Adds a <i>potentially</i> fused cycle. If the cycle is discovered not be
fused it will still be added as isolated.

@param cycle vertex set of a potentially fused cycle, indicated by the
set bits
517892
private void addFused(BitSet cycle) {

        int i = indexOfFused(0, cycle);

        if (i != -1) {
            // add new cycle and mark as fused
            cycles.get(i).or(cycle);
            fused.set(i, true);
            int j = i;

            // merge other cycles we could be fused with into 'i'
            while ((j = indexOfFused(j + 1, cycle)) != -1) {
                cycles.get(i).or(cycles.remove(j));
                fused.remove(j);
                j--;
            }
        } else {
            addIsolated(cycle);
        }

    }
330726
@Override
    public void addBond(IBond bond) {
        if (bondCount >= bonds.length) growBondArray();
        bonds[bondCount] = bond;
        ++bondCount;
        notifyChanged();
    }
258605
private void addSelfToAtoms() {
		List<Bond> bonds = atomA.getBonds();
		if (bonds==null) {
			bonds = new ArrayList<Bond>(AtomImpl.BONDS_INITIAL_CAPACITY);
			atomA.setBonds(bonds);
		}

		boolean exists = false;
		for (Bond bond : bonds) {
			// TODO is it equals() what we want here, or is it == ? - JD 2016-03-02
			if (bond.getOther(atomA).equals(atomB)) {
				exists = true;
				break;
			}
		}
		if (!exists) {
			atomA.addBond(this);
			atomB.addBond(this);
		}
	}
539909
def add_edge(self, edge):
        
        u, v = edge

        both_exist = u in self.vertices and v in self.vertices
        # Using `is` because if they belong to the same component, they MUST
        # share the same set object!
        if both_exist and self.components[u] is self.components[v]:
            # Both vertices are part of the same connected component.
            raise InvariantError('Adding %r would form a cycle' % (edge,))
        if u == v:
            raise InvariantError('Cannot add loop: %r' % (edge,))

        # Ensure the vertices exist in the graph.
        self.add_vertex(u)
        self.add_vertex(v)

        # Add the edges to each other.
        self._vertices[u].add(v)
        self._vertices[v].add(u)

        # Add all of the smaller components to the bigger one.
        smaller_component, bigger_component = self.sort_components(u, v)
        for vertex in smaller_component:
            bigger_component.add(vertex)
            # And with this assignment, say bye-bye to the smaller component.
            self.components[vertex] = bigger_component
301532
def add(self, key):
        
        if key in self._vertices:
            raise ValueError('vertex exists')
        self._vertices.add(key)
        self._forwards[key] = set()
        self._backwards[key] = set()
348443
public void addVertex(V vertex) {
        if (containsVertex(vertex)) {
            return;
        }

        neighbors.put(vertex, new ArrayList<V>());
    }
436937
public B timerWithCycle(String timerCycle) {
    TimeCycle timeCycle = createInstance(TimeCycle.class);
    timeCycle.setTextContent(timerCycle);

    TimerEventDefinition timerEventDefinition = createInstance(TimerEventDefinition.class);
    timerEventDefinition.setTimeCycle(timeCycle);

    element.getEventDefinitions().add(timerEventDefinition);

    return myself;
  }
1045659
@Override
	public void addEdge(Edge e) {
		
		addDirectionalEdge(e);
		
		if (e.isBidirectional())
			addDirectionalEdge(new Edge(e.getToNodeId(), e.getFromNodeId(), e.getWeight()));
	}
666144
public void addNotCombine(Item item)
    {
        Item innerItem = trie.get(item.key);
        if (innerItem == null)
        {
            innerItem = item;
            trie.put(innerItem.key, innerItem);
        }
    }
193179
public void addEdge(int from, int to) {
        Set<Integer> outEdges = edges.get(from);
        if (outEdges == null) {
            outEdges = new TreeSet<Integer>();
            edges.put(from, outEdges);
        }
        outEdges.add(to);
    }
556663
public void addDependencyGraph(DAGraph<DataT, NodeT> dependencyGraph) {
        this.rootNode.addDependency(dependencyGraph.rootNode.key());
        Map<String, NodeT> sourceNodeTable = dependencyGraph.nodeTable;
        Map<String, NodeT> targetNodeTable = this.nodeTable;
        this.merge(sourceNodeTable, targetNodeTable);
        dependencyGraph.parentDAGs.add(this);
        if (this.hasParents()) {
            this.bubbleUpNodeTable(this, new LinkedList<String>());
        }
    }
1100211
public void add(Face vtx) {
        if (head == null) {
            head = vtx;
        } else {
            tail.next = vtx;
        }
        vtx.next = null;
        tail = vtx;
    }
1142879
private void addEdgesForVertex(Vertex vertex)
    {
        ClassDescriptor cld = vertex.getEnvelope().getClassDescriptor();
        Iterator rdsIter = cld.getObjectReferenceDescriptors(true).iterator();
        while (rdsIter.hasNext())
        {
            ObjectReferenceDescriptor rds = (ObjectReferenceDescriptor) rdsIter.next();
            addObjectReferenceEdges(vertex, rds);
        }
        Iterator cdsIter = cld.getCollectionDescriptors(true).iterator();
        while (cdsIter.hasNext())
        {
            CollectionDescriptor cds = (CollectionDescriptor) cdsIter.next();
            addCollectionEdges(vertex, cds);
        }
    }
1238007
@Override
    public TitanMultiVertexQuery addVertex(Vertex vertex) {
        assert vertex != null;
        assert vertex instanceof InternalVertex;
        vertices.add(((InternalVertex)vertex).it());
        return this;
    }
912871
public void add(final ObjectSinkNode node) {
        if ( this.firstNode == null ) {
            this.firstNode = node;
            this.lastNode = node;
        } else {
            this.lastNode.setNextObjectSinkNode( node );
            node.setPreviousObjectSinkNode( this.lastNode );
            this.lastNode = node;
        }
        this.size++;
    }
287933
@Override
    public void add(IAtomContainerSet atomContainerSet) {
        for (IAtomContainer iter : atomContainerSet.atomContainers()) {
            addAtomContainer(iter);
        }
        /*
         * notifyChanged() is called by addAtomContainer()
         */
    }
522551
public void add(final LeftTupleSinkNode node) {
        if ( this.firstNode == null ) {
            this.firstNode = node;
            this.lastNode = node;;
        } else {
            this.lastNode.setNextLeftTupleSinkNode( node );
            node.setPreviousLeftTupleSinkNode( this.lastNode );
            this.lastNode = node;
        }
        this.size++;
    }