Returns an element at seqno
@param seqno
@return
2686
public T get(long seqno) {
        lock.lock();
        try {
            if(seqno - low <= 0 || seqno - hr > 0)
                return null;
            int row_index=computeRow(seqno);
            if(row_index < 0 || row_index >= matrix.length)
                return null;
            T[] row=matrix[row_index];
            if(row == null)
                return null;
            int index=computeIndex(seqno);
            return index >= 0? row[index] : null;
        }
        finally {
            lock.unlock();
        }
    }
833103
def _list_to_seq(lst):
    """"""
    ml = autoclass('scala.collection.mutable.MutableList')()
    for element in lst:
        ml.appendElem(element)
    return ml
619496
public Object next() throws java.util.NoSuchElementException {
        Object element = null;
        if (nextElement != null) {
            element = nextElement;
            nextElement = null;
        } else {
            element = getNextElement();
            if (element == null) {
                throw new java.util.NoSuchElementException();
            }
        }
        return element;
    }
945659
protected ArrayList<Long> getSequencePortion(String seqName, int number) {
		if (number < 1 || number > 100000)
			throw new IllegalArgumentException("Invalid requested sequence count: " + number);
		String sql = "select nextval('" + seqName + "') as seqval from generate_series(1," + number + ")";
		List<ResSeqVal> seqVals = selectData("seq_portion", sql, ResSeqVal.class, Collections.<SqlParam>emptyList());
		ArrayList<Long> result = new ArrayList<Long>();
		for (ResSeqVal item : seqVals) {
			result.add(item.seqval);
		}
		return result;
	}
658478
public static Element[] toElementArray(Document doc, Object o) throws PageException {
	// Node[]
	if (o instanceof Node[]) {
	    Node[] nodes = (Node[]) o;
	    if (_isAllOfSameType(nodes, Node.ELEMENT_NODE)) return (Element[]) nodes;

	    Element[] elements = new Element[nodes.length];
	    for (int i = 0; i < nodes.length; i++) {
		elements[i] = toElement(doc, nodes[i]);
	    }
	    return elements;
	}
	// Collection
	else if (o instanceof Collection) {
	    Collection coll = (Collection) o;
	    Iterator<Object> it = coll.valueIterator();
	    List<Element> elements = new ArrayList<Element>();
	    while (it.hasNext()) {
		elements.add(toElement(doc, it.next()));
	    }
	    return elements.toArray(new Element[elements.size()]);
	}
	// Node Map and List
	Node[] nodes = _toNodeArray(doc, o);
	if (nodes != null) return toElementArray(doc, nodes);
	// Single Text Node
	try {
	    return new Element[] { toElement(doc, o) };
	}
	catch (ExpressionException e) {
	    throw new XMLException("can't cast Object of type " + Caster.toClassName(o) + " to a XML Element Array");
	}
    }
195066
@Override
	public MaybeNode get(int index) {
		if (index == 0) {
			final OMElement first = element.getFirstElement();
			return factory().newNode(first,
					pathBuilder().withPart("any").atIndex(0));
		}
		return NodeFactory.noneNode(pathBuilder().atIndex(index));
	}
495696
private Element getChildElement(Element parent) {
	NodeList list = parent.getChildNodes();
	int len = list.getLength();
	for (int i = 0; i < len; i++) {
	    Node node = list.item(i);
	    if (node instanceof Element) {
		return (Element) node;
	    }
	}
	return null;
    }
100819
public Pair<Long, Long> getRangeContaining(long seq) {
        Range<Long> range = m_map.rangeContaining(seq);
        if (range != null) {
            return new Pair<Long, Long>(start(range), end(range));
        }
        return null;
    }
714071
static Object coerceToJava(XObject xo) throws TransformerException {
        if (xo instanceof XBoolean) {
            return xo.bool();
        } else if (xo instanceof XNumber) {
            return xo.num();
        } else if (xo instanceof XString) {
            return xo.str();
        } else if (xo instanceof XNodeSet) {
            NodeList nodes = xo.nodelist();
            // if there is only one node in the nodeset return it rather than the list
            if (nodes.getLength() == 1) {
                return nodes.item(0);
            } else {
                return nodes;
            }
        } else {
            // unexpected result type
            throw new AssertionError();
        }
    }
127668
private static Element toDom(final org.jdom.Element element) {
        return toDom(element.getDocument()).getDocumentElement();
    }
608561
public FastqBuilder withSequence(final String sequence)
	{
		if (sequence == null)
		{
			throw new IllegalArgumentException("sequence must not be null");
		}
		if (this.sequence == null)
		{
			this.sequence = new StringBuilder(sequence.length());
		}
		this.sequence.replace(0, this.sequence.length(), sequence);
		return this;
	}
734923
public static ASN1Sequence getInstance(
        Object  obj)
    {
        if (obj == null || obj instanceof ASN1Sequence)
        {
            return (ASN1Sequence)obj;
        }

        throw new IllegalArgumentException("unknown object in getInstance");
    }
1324073
@Requires({
    "element != null",
    "element.getKind() != ElementKind.PACKAGE",
    "element.getKind() != ElementKind.OTHER"
  })
  @Ensures("element != null")
  protected static TypeElement getRootElement(Element element) {
    if (element.getKind().isClass() || element.getKind().isInterface()) {
      TypeElement type = (TypeElement) element;
      if (!type.getNestingKind().isNested()) {
        return type;
      }
    }

    return getRootElement(element.getEnclosingElement());
  }
148744
@Nonnull
  @SafeVarargs
  public static <ELEMENTTYPE> Enumeration <ELEMENTTYPE> getEnumeration (@Nullable final ELEMENTTYPE... aArray)
  {
    return getEnumeration (getIterator (aArray));
  }
320382
public static Collection<Node> findElementsByName(String elementName, Node node)
	{
		if ( node == null ||
			node.getNodeType() == Node.COMMENT_NODE ||
			node.getNodeType() == Node.TEXT_NODE )
			return null;

		HashSet<Node> results = new HashSet<Node>();

		if (elementName.equals(node.getNodeName()))
		{
			results.add(node);
		}

		NodeList nodeList = node.getChildNodes();

		if (nodeList == null)
			return null;

		int len = nodeList.getLength();

		Node child;

		for (int i = 0; i < len; i++)
		{
			child = nodeList.item(i);

			if (child.getNodeType() == Node.TEXT_NODE)
				continue;

			if (elementName.equals(child.getNodeName()))
				 results.add(child);

			// check for next
			NodeList grands = child.getChildNodes();
			if (grands != null)
			{
				int grandsCnt = grands.getLength();
				for (int x = 0; x < grandsCnt; x++)
				{
					Collection<Node> grandResults = findElementsByName(elementName, grands.item(x));

					if (grandResults != null)
						results.addAll(grandResults);
				}
			}
		}

		return results.isEmpty()? null : results;

	}
517073
@Override
    public T element() {
        T retrievedElement = peek();

        if (retrievedElement == null) {
            throw new NoSuchElementException();
        }

        return retrievedElement;
    }
850842
@Nonnull
  private static <E extends Comparable<? super E>> Set<E> ofSeqInternal(final Seq<E> seq) {
    if (seq.isEmpty()) {
      return empty();
    }
    final SeqSimpleSorted<E> seqSimpleSorted;
    if (seq instanceof SeqSimpleSorted) {
      seqSimpleSorted = (SeqSimpleSorted<E>) seq; // assumes it's distinct
    } else {
      seqSimpleSorted = (SeqSimpleSorted<E>) seq.sorted().distinct(); // if not a SeqSimpleSorted, make it one
    }
    return new Set<>(seqSimpleSorted);
  }