Package org.pentaho.reporting.engine.classic.core.util

Examples of org.pentaho.reporting.engine.classic.core.util.LevelList


  private void revalidate()
  {
    // recompute the level storage ..
    int minLevel = Integer.MIN_VALUE;
    final LevelList levelList = new LevelList();
    for (int i = 0; i < length; i++)
    {
      final Expression expression = expressions[i];

      // The list maps the current position to the level ..
      final int dependencyLevel = expression.getDependencyLevel();
      levelList.add(IntegerCache.getInteger(i), dependencyLevel);
      if (minLevel < dependencyLevel)
      {
        minLevel = dependencyLevel;
      }
    }

    if (minLevel > Integer.MIN_VALUE)
    {
      if (isIncludeStructuralProcessing())
      {
        for (int i = 0; i < length; i++)
        {
          final Expression expression = expressions[i];

          // The list maps the current position to the level ..
          final int dependencyLevel = expression.getDependencyLevel();
          if (dependencyLevel == minLevel && (expression instanceof Function == false))
          {
            levelList.add(IntegerCache.getInteger(i), minLevel);
          }
        }
      }
    }

    final Integer[] levels = levelList.getLevelsDescendingArray();
    this.levelData = new LevelStorage[levels.length];
    final int expressionsCount = levelList.size();

    final int capacity = Math.min(20, expressionsCount);
    final IntList expressionPositions = new IntList(capacity);
    final IntList activeExpressions = new IntList(capacity);
    final IntList functions = new IntList(capacity);
    final IntList pageEventListeners = new IntList(capacity);
    final IntList prepareEventListeners = new IntList(capacity);
    final boolean prepareEventListener = false;

    for (int i = 0; i < levels.length; i++)
    {
      final int currentLevel = levels[i].intValue();
      final Integer[] data = (Integer[])
          levelList.getElementArrayForLevel(currentLevel, ExpressionDataRow.EMPTY_INTEGERARRAY);
      for (int x = 0; x < data.length; x++)
      {
        final Integer position = data[x];
        final Expression ex = this.expressions[position.intValue()];
        final int globalPosition = position.intValue();
View Full Code Here


  public static LevelStorageBackend[] revalidate(final Expression[] expressions,
                                                 final int length,
                                                 final boolean includeStructuralProcessing)
  {
    // recompute the level storage ..
    final LevelList levelList = new LevelList();
    int minLevel = Integer.MIN_VALUE;
    for (int i = 0; i < length; i++)
    {
      final Expression expression = expressions[i];

      // The list maps the current position to the level ..
      final int dependencyLevel = expression.getDependencyLevel();
      levelList.add(IntegerCache.getInteger(i), dependencyLevel);
      if (minLevel < dependencyLevel)
      {
        minLevel = dependencyLevel;
      }
    }

    if (includeStructuralProcessing)
    {
      if (minLevel > Integer.MIN_VALUE)
      {
        for (int i = 0; i < length; i++)
        {
          final Expression expression = expressions[i];

          // The list maps the current position to the level ..
          final int dependencyLevel = expression.getDependencyLevel();
          if (dependencyLevel == minLevel && (expression instanceof Function == false))
          {
            // add this expression to the structural pre-processing so that it can influence the
            // construction of the crosstab if needed.
            levelList.add(IntegerCache.getInteger(i), LayoutProcess.LEVEL_STRUCTURAL_PREPROCESSING);
          }
        }
      }
    }

    final Integer[] levels = levelList.getLevelsDescendingArray();
    final LevelStorageBackend[] levelData = new LevelStorageBackend[levels.length];
    final int expressionsCount = levelList.size();

    final int capacity = Math.min(20, expressionsCount);
    final IntList activeExpressions = new IntList(capacity);
    final IntList functions = new IntList(capacity);
    final IntList pageEventListeners = new IntList(capacity);

    for (int i = 0; i < levels.length; i++)
    {
      final int currentLevel = levels[i].intValue();
      final Integer[] data = (Integer[])
          levelList.getElementArrayForLevel(currentLevel, EMPTY_INTEGERARRAY);
      for (int x = 0; x < data.length; x++)
      {
        final Integer position = data[x];
        final Expression ex = expressions[position.intValue()];
        final int globalPosition = position.intValue();
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.engine.classic.core.util.LevelList

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.