Package gnu.trove.stack.array

Examples of gnu.trove.stack.array.TIntArrayStack.push()


    if (count <= 0) {
      return;
    }

    TIntStack parents = new TIntArrayStack();
    parents.push(rootNodeId);

    TIntStack parentsEntry = new TIntArrayStack();
    parentsEntry.push(-1);

    TIntArrayList savedValues = new TIntArrayList();
View Full Code Here


    TIntStack parents = new TIntArrayStack();
    parents.push(rootNodeId);

    TIntStack parentsEntry = new TIntArrayStack();
    parentsEntry.push(-1);

    TIntArrayList savedValues = new TIntArrayList();
    float savedPriority = 0;

    // TODO: possible shortcut here - could test for intersection with the
View Full Code Here

          if (Rectangle.distanceSq(n.entriesMinX[i], n.entriesMinY[i],
                                 n.entriesMaxX[i], n.entriesMaxY[i],
                                 p.x, p.y) <= furthestDistanceSq) {
            parents.push(n.ids[i]);
            parentsEntry.pop();
            parentsEntry.push(i); // this becomes the start index when the child has been searched
            parentsEntry.push(-1);
            near = true;
            break; // ie go to next iteration of while()
          }
        }
View Full Code Here

                                 n.entriesMaxX[i], n.entriesMaxY[i],
                                 p.x, p.y) <= furthestDistanceSq) {
            parents.push(n.ids[i]);
            parentsEntry.pop();
            parentsEntry.push(i); // this becomes the start index when the child has been searched
            parentsEntry.push(-1);
            near = true;
            break; // ie go to next iteration of while()
          }
        }
        if (near) {
View Full Code Here

   */
  public void contains(Rectangle r, TIntProcedure v) {
    // find all rectangles in the tree that are contained by the passed rectangle
    // written to be non-recursive (should model other searches on this?)
    TIntStack parents = new TIntArrayStack();
    parents.push(rootNodeId);

    TIntStack parentsEntry = new TIntArrayStack();
    parentsEntry.push(-1);

    // TODO: possible shortcut here - could test for intersection with the
View Full Code Here

    // written to be non-recursive (should model other searches on this?)
    TIntStack parents = new TIntArrayStack();
    parents.push(rootNodeId);

    TIntStack parentsEntry = new TIntArrayStack();
    parentsEntry.push(-1);

    // TODO: possible shortcut here - could test for intersection with the
    // MBR of the root node. If no intersection, return immediately.

    while (parents.size() > 0) {
View Full Code Here

        for (int i = startIndex; i < n.entryCount; i++) {
          if (Rectangle.intersects(r.minX, r.minY, r.maxX, r.maxY,
                                   n.entriesMinX[i], n.entriesMinY[i], n.entriesMaxX[i], n.entriesMaxY[i])) {
            parents.push(n.ids[i]);
            parentsEntry.pop();
            parentsEntry.push(i); // this becomes the start index when the child has been searched
            parentsEntry.push(-1);
            intersects = true;
            break; // ie go to next iteration of while()
          }
        }
View Full Code Here

          if (Rectangle.intersects(r.minX, r.minY, r.maxX, r.maxY,
                                   n.entriesMinX[i], n.entriesMinY[i], n.entriesMaxX[i], n.entriesMaxY[i])) {
            parents.push(n.ids[i]);
            parentsEntry.pop();
            parentsEntry.push(i); // this becomes the start index when the child has been searched
            parentsEntry.push(-1);
            intersects = true;
            break; // ie go to next iteration of while()
          }
        }
        if (intersects) {
View Full Code Here

      // CT3 [Eliminiate under-full node] If N has too few entries,
      // delete En from P and add N to the list of eliminated nodes
      if (n.entryCount < minNodeEntries) {
        parent.deleteEntry(parentEntry);
        eliminatedNodeIds.push(n.nodeId);
      } else {
        // CT4 [Adjust covering rectangle] If N has not been eliminated,
        // adjust EnI to tightly contain all entries in N
        if (n.mbrMinX != parent.entriesMinX[parentEntry] ||
            n.mbrMinY != parent.entriesMinY[parentEntry] ||
View Full Code Here

      final char openBracket = possibleBracketsInStructure[b][0];
      final char closeBracket = possibleBracketsInStructure[b][1];
      stack.clear();
      for (int i = 0; i < secondary.length(); i++) {
        if (secondary.charAt(i) == openBracket) {
          stack.push(i);
        } else if (secondary.charAt(i) == closeBracket) {
          if (stack.size() == 0) {
            return false;
          }
          final int start = stack.pop();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.