Package org.moltools.lib.seq

Examples of org.moltools.lib.seq.SequenceElement


  /**Returns an array of all Polymorphisms present in this sequence at the top level*/
  public Polymorphism[] getPolys() {
    Polymorphism[] polys = new Polymorphism[countPolys()];
    int polypos = 0;
    for (Iterator<SequenceElement> i = sequence.iterator(); i.hasNext(); ) {
      SequenceElement e = i.next();
      if (e instanceof Polymorphism) {
        polys[polypos++] = (Polymorphism) e;
      }
    }
    return polys;
View Full Code Here


  }

  protected static List<SequenceElement> expandElements(SequenceElementContainer sc) {
    List<SequenceElement> expandedElements = new ArrayList<SequenceElement>();
    for (Iterator<SequenceElement> i = sc.getElements().iterator(); i.hasNext(); ) {
      SequenceElement e = i.next();
      if (e instanceof SequenceElementContainer) {
        expandedElements.addAll(expandElements((SequenceElementContainer) e));
      }
      else {
        expandedElements.add(e);
View Full Code Here

 
  protected int getPolyPosition(int poly) {
    int pos = 1;
    int polyno = 0;
    for (Iterator<SequenceElement> i = sequence.iterator(); i.hasNext(); ) {
      SequenceElement e = i.next();
      if (e instanceof Polymorphism) {
        polyno++;
      }
      if (polyno == poly) {
        return pos;
      }
      pos += e.length();
    }
    throw new UnsupportedOperationException("No such polymorphism found"); //$NON-NLS-1$
  }
View Full Code Here

 
  protected int getPolyPosition(int poly) {
    int pos = 1;
    int polyno = 0;
    for (Iterator<SequenceElement> i = sequence.iterator(); i.hasNext(); ) {
      SequenceElement e = i.next();
      if (e instanceof Polymorphism) {
        polyno++;
      }
      if (polyno == poly) {
        return pos;
      }
      pos += e.length();
    }
    throw new UnsupportedOperationException("No such polymorphism found"); //$NON-NLS-1$
  }
View Full Code Here

  @Override
  protected int getPolyPosition(int poly) {
    int pos = 1;
    int polyno = -1;
    for (Iterator<SequenceElement> i = sequence.iterator(); i.hasNext(); ) {
      SequenceElement e = i.next();
      if (e instanceof Polymorphism) {
        polyno++;
      }
      if (polyno == poly) {
        return pos;
      }
      pos += e.length();
    }
    throw new UnsupportedOperationException("No such polymorphism found"); //$NON-NLS-1$
  }
View Full Code Here

TOP

Related Classes of org.moltools.lib.seq.SequenceElement

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.