Examples of FastStack


Examples of org.codehaus.jettison.util.FastStack

    public BadgerFishXMLStreamReader(JSONObject obj)
        throws JSONException, XMLStreamException {
        String rootName = (String) obj.keys().next();
       
        this.node = new Node(rootName, obj.getJSONObject(rootName), CONVENTION);
        this.nodes = new FastStack();
        nodes.push(node);
        event = START_DOCUMENT;
    }
View Full Code Here

Examples of org.jfree.util.FastStack

                             final String target,
                             final ImageService imageService)
      throws ReportProcessingException
  {
    super(reportJob, resourceManager, baseResource, inputRepository, outputRepository, target, imageService);
    activePageContext = new FastStack();
    this.sectionNames = new AttributeNameGenerator();

    this.tableLayoutConfig = TABLE_LAYOUT_SINGLE_DETAIL_TABLE;
  }
View Full Code Here

Examples of org.jfree.util.FastStack

    this.target = target;

    this.tableNameGenerator = new AttributeNameGenerator();
    this.autoStyleNameGenerator = new AttributeNameGenerator();
    this.outputRepository = outputRepository;
    this.states = new FastStack();
    this.xmlWriters = new FastStack();
    this.imageNames = new AttributeNameGenerator();

    this.imageProducer = new ImageProducer(inputRepository, outputRepository, imageService);

    try
View Full Code Here

Examples of org.pentaho.reporting.libraries.base.util.FastStack

      throw new NullPointerException();
    }

    this.reportContext = reportContext;
    this.exportDescriptor = reportContext.getExportDescriptor();
    this.expressionsStack = new FastStack(10);
    this.dataContextStack = new FastStack(10);
    this.advanceRequested = false;
    this.parameters = parameters;

    this.dataRow = GlobalMasterRow.createReportRow
        (reportContext, schemaDefinition, new ParameterDataRow(parameters), parameterDefinitionEntries, includeStructuralPreprocessing);
View Full Code Here

Examples of org.pentaho.reporting.libraries.base.util.FastStack


  private BoxAlignContext createVerticalAlignContext(final InlineRenderBox box)
  {
    BoxAlignContext alignContext = new BoxAlignContext(box);
    final FastStack contextStack = new FastStack(50);
    final FastStack alignContextStack = new FastStack(50);
    RenderNode next = box.getFirstChild();
    RenderBox context = box;

    while (next != null)
    {
      // process next
      if ((next.getNodeType() & LayoutNodeTypes.MASK_BOX_INLINE) == LayoutNodeTypes.MASK_BOX_INLINE)
      {
        final RenderBox nBox = (RenderBox) next;
        final RenderNode firstChild = nBox.getFirstChild();
        if (firstChild != null)
        {
          // Open a non-empty box context
          contextStack.push(context);
          alignContextStack.push(alignContext);

          next = firstChild;

          final BoxAlignContext childBoxContext = new BoxAlignContext(nBox);
          alignContext.addChild(childBoxContext);
          context = nBox;
          alignContext = childBoxContext;
        }
        else
        {
          // Process an empty box.
          final BoxAlignContext childBoxContext = new BoxAlignContext(nBox);
          alignContext.addChild(childBoxContext);
          next = nBox.getNext();
        }
      }
      else
      {
        // Process an ordinary node.
        if (next.getNodeType() == LayoutNodeTypes.TYPE_NODE_TEXT)
        {
          alignContext.addChild(new TextElementAlignContext((RenderableText) next));
        }
        else if (next.getNodeType() == LayoutNodeTypes.TYPE_BOX_CONTENT)
        {
          alignContext.addChild(new ReplacedContentAlignContext((RenderableReplacedContentBox) next, 0));
        }
        else if ((next.getNodeType() & LayoutNodeTypes.MASK_BOX_BLOCK) == LayoutNodeTypes.MASK_BOX_BLOCK)
        {
          alignContext.addChild(new InlineBlockAlignContext((RenderBox) next));
        }
        else
        {
          alignContext.addChild(new NodeAlignContext(next));
        }
        next = next.getNext();
      }

      while (next == null && contextStack.isEmpty() == false)
      {
        // Finish the current box context, if needed
        next = context.getNext();
        context = (RenderBox) contextStack.pop();
        alignContext.validate();
        alignContext = (BoxAlignContext) alignContextStack.pop();
      }
    }
    return alignContext;
  }
View Full Code Here

Examples of org.pentaho.reporting.libraries.base.util.FastStack

    sequenceList.add(StartSequenceElement.INSTANCE, box);

    RenderNode next = box.getFirstChild();
    RenderBox context = box;

    final FastStack contextStack = new FastStack(50);
    boolean containsContent = false;

    while (next != null)
    {
      // process next
      if ((next.getNodeType() & LayoutNodeTypes.MASK_BOX_INLINE) == LayoutNodeTypes.MASK_BOX_INLINE)
      {
        final RenderBox nBox = (RenderBox) next;
        final RenderNode firstChild = nBox.getFirstChild();
        if (firstChild != null)
        {
          // Open a non-empty box context
          contextStack.push(context);
          next = firstChild;

          sequenceList.add(StartSequenceElement.INSTANCE, nBox);
          context = nBox;
        }
        else
        {
          // Process an empty box.
          sequenceList.add(StartSequenceElement.INSTANCE, nBox);
          sequenceList.add(EndSequenceElement.INSTANCE, nBox);
          next = nBox.getNext();
        }
      }
      else
      {
        // Process an ordinary node.
        if (next.getNodeType() == LayoutNodeTypes.TYPE_NODE_TEXT)
        {
          sequenceList.add(TextSequenceElement.INSTANCE, next);
          containsContent = true;
        }
        else if (next.getNodeType() == LayoutNodeTypes.TYPE_BOX_CONTENT)
        {
          sequenceList.add(ReplacedContentSequenceElement.INSTANCE, next);
          containsContent = true;
        }
        else if (next.getNodeType() == LayoutNodeTypes.TYPE_NODE_SPACER)
        {
          if (containsContent)
          {
            sequenceList.add(SpacerSequenceElement.INSTANCE, next);
          }
        }
        else if ((next.getNodeType() & LayoutNodeTypes.MASK_BOX_BLOCK) == LayoutNodeTypes.MASK_BOX_BLOCK)
        {
          containsContent = true;
          sequenceList.add(InlineBoxSequenceElement.INSTANCE, next);
        }
        else
        {
          containsContent = true;
          sequenceList.add(InlineNodeSequenceElement.INSTANCE, next);
        }
        next = next.getNext();
      }

      while (next == null && contextStack.isEmpty() == false)
      {
        // Finish the current box context, if needed
        sequenceList.add(EndSequenceElement.INSTANCE, context);
        next = context.getNext();
        context = (RenderBox) contextStack.pop();
      }
    }

    sequenceList.add(EndSequenceElement.INSTANCE, box);
    return sequenceList;
View Full Code Here

Examples of org.pentaho.reporting.libraries.base.util.FastStack

    }

    boolean needToAddSpacing = true;

    // do the merging ..
    final FastStack contextStack = new FastStack(50);
    RenderNode next = nextBox.getFirstChild();
    MergeContext context = new MergeContext(lineBox, nextBox);
    while (next != null)
    {
      // process next
      final RenderBox writeContext = context.getWriteContext();
      final StaticBoxLayoutProperties staticBoxLayoutProperties = writeContext.getStaticBoxLayoutProperties();
      long spaceWidth = staticBoxLayoutProperties.getSpaceWidth();
      if (spaceWidth == 0)
      {
        // Space has not been computed yet.
        final FontMetrics fontMetrics = metaData.getFontMetrics(writeContext.getStyleSheet());
        spaceWidth = fontMetrics.getCharWidth(' ');
        staticBoxLayoutProperties.setSpaceWidth(spaceWidth);
      }

      if ((next.getNodeType() & LayoutNodeTypes.MASK_BOX) == LayoutNodeTypes.MASK_BOX)
      {
        final RenderBox nBox = (RenderBox) next;
        final RenderNode firstChild = nBox.getFirstChild();
        if (firstChild != null)
        {
          contextStack.push(context);
          next = firstChild;

          final RenderNode writeContextLastChild = writeContext.getLastChild();
          if ((writeContextLastChild.getNodeType() & LayoutNodeTypes.MASK_BOX) == LayoutNodeTypes.MASK_BOX)
          {
            if (writeContextLastChild.getInstanceId() == nBox.getInstanceId())
            {
              context = new MergeContext((RenderBox) writeContextLastChild, nBox);
            }
            else
            {
              if (needToAddSpacing)
              {
                if (spaceWidth > 0)
                {
                  // docmark: Used zero as new height
                  final SpacerRenderNode spacer = new SpacerRenderNode(spaceWidth, 0, false, 1);
                  spacer.setVirtualNode(true);
                  writeContext.addGeneratedChild(spacer);
                }
                needToAddSpacing = false;
              }
              final RenderBox newWriter = (RenderBox) nBox.derive(false);
              newWriter.setVirtualNode(true);
              writeContext.addGeneratedChild(newWriter);
              context = new MergeContext(newWriter, nBox);
            }
          }
          else
          {
            if (needToAddSpacing)
            {
              if (spaceWidth > 0)
              {
                // docmark: Used zero as new height
                final SpacerRenderNode spacer = new SpacerRenderNode(spaceWidth, 0, false, 1);
                spacer.setVirtualNode(true);
                writeContext.addGeneratedChild(spacer);
              }
              needToAddSpacing = false;
            }

            final RenderBox newWriter = (RenderBox) nBox.derive(false);
            newWriter.setVirtualNode(true);
            writeContext.addGeneratedChild(newWriter);
            context = new MergeContext(newWriter, nBox);
          }
        }
        else
        {
          if (needToAddSpacing)
          {
            if (spaceWidth > 0)
            {
              // docmark: Used zero as new height
              final SpacerRenderNode spacer = new SpacerRenderNode(spaceWidth, 0, false, 1);
              spacer.setVirtualNode(true);
              writeContext.addGeneratedChild(spacer);
            }
            needToAddSpacing = false;
          }

          final RenderNode box = nBox.derive(true);
          box.setVirtualNode(true);
          writeContext.addGeneratedChild(box);
          next = nBox.getNext();
        }
      }
      else
      {
        if (needToAddSpacing)
        {
          final RenderNode lastChild = writeContext.getLastChild();
          if (spaceWidth > 0 && lastChild != null &&
              (lastChild.getNodeType() != LayoutNodeTypes.TYPE_NODE_SPACER))
          {
            // docmark: Used zero as new height
            final SpacerRenderNode spacer = new SpacerRenderNode(spaceWidth, 0, false, 1);
            spacer.setVirtualNode(true);
            writeContext.addGeneratedChild(spacer);
          }
          needToAddSpacing = false;
        }

        final RenderNode child = next.derive(true);
        child.setVirtualNode(true);
        writeContext.addGeneratedChild(child);
        next = next.getNext();
      }

      while (next == null && contextStack.isEmpty() == false)
      {
//        Log.debug ("FINISH " + context.getReadContext());
        next = context.getReadContext().getNext();
        context = (MergeContext) contextStack.pop();
      }
    }

    return rebuildLastLine(lineBox, (ParagraphPoolBox) nextBox.getNext());
  }
View Full Code Here

Examples of org.pentaho.reporting.libraries.base.util.FastStack

  private boolean overflowX;


  protected AbstractAlignmentProcessor()
  {
    this.contexts = new FastStack(50);
    this.pendingElements = new ArrayList();
    this.elementDimensions = AbstractAlignmentProcessor.EMPTY;
    this.elementPositions = AbstractAlignmentProcessor.EMPTY;
  }
View Full Code Here

Examples of org.pentaho.reporting.libraries.base.util.FastStack

  private ReportStateKey lastSeenStateKey;

  public CleanFlowBoxesStep()
  {
    finishContexts = new HashMap();
    blockContexts = new FastStack(50);
  }
View Full Code Here

Examples of org.pentaho.reporting.libraries.base.util.FastStack

  private ParagraphLinebreaker breakState;
  private SimpleLinebreaker reusableSimpleLinebreaker;

  public ParagraphLineBreakStep()
  {
    paragraphNesting = new FastStack(50);
  }
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.