Add a sequence to the suffix tree. It is immediately processed
and added to the tree.

@param sequence A sequence to be added.
483706
public void add(S sequence) {
        int start = currentEnd;
        this.sequence.add(sequence);
        suffix = new Suffix<>(currentEnd, currentEnd, this.sequence);
        activePoint.setPosition(root, null, 0);
        extendTree(start, this.sequence.getLength());
    }
231323
public static <C extends Compound> int indexOf(Sequence<C> sequence,
			C compound) {
		int index = 1;
		for (C currentCompound : sequence) {
			if (currentCompound.equals(compound)) {
				return index;
			}
			index++;
		}
		return 0;
	}
914112
protected <C extends Compound> boolean canComplement(Sequence<C> sequence) {
		CompoundSet<C> compoundSet = sequence.getCompoundSet();
		Compound c = compoundSet.getAllCompounds().iterator().next();
		return ComplementCompound.class.isAssignableFrom(c.getClass());
	}
1025312
@Override
	public SequenceView<C> getSubSequence(Integer start, Integer end) {
		return new SequenceProxyView<C>(this, start, end);
	}
1312138
private void createSequencesConstraintsStatements(List<Statement> statements, Iterable<Sequence> sequences) {
		Statement statement = createUniqueConstraintStatement( SEQUENCE_NAME_PROPERTY, NodeLabel.SEQUENCE.name() );
		statements.add( statement );
	}
1220881
protected void writeRaw(CharSequence seq, CharBuf buffer) {
        if (seq != null) {
            buffer.add(seq.toString());
        }
    }
1295567
public static <S extends Seq<S>> S concatenate(S... sequences) {
        if (sequences.length == 0)
            throw new IllegalArgumentException("Zero arguments");

        if (sequences.length == 1)
            return sequences[0];

        int size = 0;
        for (S s : sequences)
            size += s.size();

        SeqBuilder<S> builder = sequences[0].getBuilder().ensureCapacity(size);

        for (S s : sequences)
            builder.append(s);

        return builder.createAndDestroy();
    }
242912
public function addSequence(Sequence $sequence)
    {
        if ($this->hasSequence($sequence->getName())) {
            throw SchemaException::schemaSequenceAlreadyExists($this->getName(), $sequence->getName());
        }

        $this->sequences[$sequence->getName()] = $sequence;
    }
757703
public static <T> Sequence<T> sort(final Sequence<T> sequence, final Comparator<T> comparator)
  {
    List<T> seqList = sequence.toList();
    Collections.sort(seqList, comparator);
    return simple(seqList);
  }
723076
public static void writeSequence(OutputStream outputStream, Sequence<?> sequence) throws Exception {
		writeSequences(outputStream, singleSeqToCollection(sequence));
	}
624833
@Override
    public Object mapSequence(Object sequence) {
        List<List<Long>> seq = (List<List<Long>>) sequence;
        List<Long> ret = new ArrayList<>();
        for (List<Long> l : seq)
            ret.add((Long) map(l));
        return ret;
    }
1268788
public static <T> Sequence<T> wrap(Sequence<T> seq, SequenceWrapper wrapper)
  {
    Preconditions.checkNotNull(seq, "seq");
    Preconditions.checkNotNull(wrapper, "wrapper");
    return new WrappingSequence<>(seq, wrapper);
  }
680293
public void updateSequenceElement(int[] sequence, int pos, int oldVal) {
    if(models != null){
      for(int i = 0; i < models.length; i++)
        models[i].updateSequenceElement(sequence, pos, oldVal);
      return; 
    }
    model1.updateSequenceElement(sequence, pos, 0);
    model2.updateSequenceElement(sequence, pos, 0);
  }
305777
def add_sequence(tag, options={})
      add(s = Sequence.new(tag, options))
      s
    end
819800
@Override
    public Object mapSequence(Object sequence) {
        List<List<Integer>> seq = (List<List<Integer>>) sequence;
        List<Integer> ret = new ArrayList<>();
        for (List<Integer> step : seq)
            ret.add((Integer) map(step));
        return ret;
    }
343362
@SuppressWarnings("unchecked")
	protected <C extends Compound> Sequence<C> reverseSequence(Sequence<C> sequence) {
		if(getStrand() != Strand.NEGATIVE) {
			return sequence;
		}

		Sequence<C> reversed = new ReversedSequenceView<C>(sequence);
		// "safe" operation as we have tried to check this
		if(canComplement(sequence)) {
			Sequence<ComplementCompound> casted = (Sequence<ComplementCompound>) reversed;
			ComplementSequenceView<ComplementCompound> complement =
					new ComplementSequenceView<ComplementCompound>(casted);
			return (Sequence<C>)complement;
		}
		return reversed;
	}
416398
protected void removeSequence(String sequenceName)
    {
        // lookup the sequence map for calling DB
        Map mapForDB = (Map) sequencesDBMap.get(getBrokerForClass()
                .serviceConnectionManager().getConnectionDescriptor().getJcdAlias());
        if(mapForDB != null)
        {
            synchronized(SequenceManagerHighLowImpl.class)
            {
                mapForDB.remove(sequenceName);
            }
        }
    }