Package org.olap4j

Examples of org.olap4j.CellSetAxis


  public static int[] computeItemsPerAxis(final List<CellSetAxis> axes)
  {
    int[] axesSize = new int[axes.size()];
    for (int axesIndex = 0; axesIndex < axes.size(); axesIndex += 1)
    {
      final CellSetAxis axis = axes.get(axesIndex);
      axesSize[axesIndex] = axis.getPositions().size();
    }
    return axesSize;
  }
View Full Code Here


  {
    final int[] membersPerAxis = new int[axes.size()];
    // Axis contains (zero or more) positions, which contains (zero or more) members
    for (int axesIndex = startAxis; axesIndex < axes.size(); axesIndex++)
    {
      CellSetAxis axis = axes.get(axesIndex);
      membersPerAxis[axesIndex] = ResultSetProcessingLib.computeMemberCountForAxis(axis, membersOnAxisSorted);
    }

    return membersPerAxis;
  }
View Full Code Here

                                                               final boolean membersOnAxisSorted)
  {
    final ArrayList<Member> columnToMemberMapper = new ArrayList<Member>();
    for (int axesIndex = axes.size() - 1; axesIndex >= startAxis; axesIndex -= 1)
    {
      final CellSetAxis axis = axes.get(axesIndex);
      final List<Position> positions = axis.getPositions();

      final MemberAddingStrategy strategy = membersOnAxisSorted ?
          new SortedMemberAddingStrategy(positions) :
          new ResultSetOrderMemberAddingStrategy();
View Full Code Here

      columnNames.add(member.getLevel().getUniqueName());
    }
    if (axes.size() > 0)
    {
      // now create the column names for the column-axis
      final CellSetAxis axis = axes.get(0);
      final List<Position> positions = axis.getPositions();
      for (int i = 0; i < positions.size(); i++)
      {
        final Position position = positions.get(i);
        columnNames.add(ResultSetProcessingLib.computeUniqueColumnName(position));
      }
View Full Code Here

                                     final List<Integer> cellKey)
  {

    final int axisIndex = columnToAxisPosition.get(columnIndex);
    final List<CellSetAxis> axes = resultSet.getAxes();
    final CellSetAxis axis = axes.get(axisIndex);

    final List<Position> positionList = axis.getPositions();
    if (positionList.isEmpty())
    {
      return null;
    }
View Full Code Here

  private String calcColumnNameFromRowHeader(final int columnNumber)
  {
    // Flatten out the column headers into one column-name
    final List<CellSetAxis> axes = this.resultSet.getAxes();
    final CellSetAxis axis = axes.get(AXIS_ROW);
    final List<Position> positions = axis.getPositions();
    final Position firstPosition = positions.get(0);
    final List<Member> memberList = firstPosition.getMembers();
    if (columnNumber < memberList.size())
    {
      final Member member = memberList.get(columnNumber);
View Full Code Here

    final List<CellSetAxis> axes = this.resultSet.getAxes();
    if (axes.size() < 1)
    {
      return new GenericObjectTable();
    }
    final CellSetAxis axis = axes.get(AXIS_COLUMN);
    final List<Position> positions = axis.getPositions();
    final int colCount = positions.size();
    final GenericObjectTable result = new GenericObjectTable(20, Math.max(1, colCount));
    for (int c = 0; c < colCount; c++)
    {
      final Position position = positions.get(c);
View Full Code Here

    final List<CellSetAxis> axes = this.resultSet.getAxes();
    if (axes.size() < 2)
    {
      return new GenericObjectTable();
    }
    final CellSetAxis axis = axes.get(AXIS_ROW);
    final List<Position> positions = axis.getPositions();
    final int rowCount = positions.size();
    final GenericObjectTable result = new GenericObjectTable(Math.max(1, rowCount), 5);

    for (int r = 0; r < rowCount; r++)
    {
View Full Code Here

      @NotNull
      public Iterator<Cell> iterator() {
        final int[] axisDimensions = new int[cellSet.getAxes().size() - pageCoords.length];
        assert pageCoords.length <= axisDimensions.length;
        for (int i = 0; i < axisDimensions.length; i++) {
          final CellSetAxis axis = cellSet.getAxes().get(i);
          axisDimensions[i] = axis.getPositions().size();
        }
        final CoordinateIterator coordIter = new CoordinateIterator(axisDimensions, true);
        return new Iterator<Cell>() {
          public boolean hasNext() {
            return coordIter.hasNext();
View Full Code Here

  @NotNull
  private final List<Integer> ignorey = new ArrayList<Integer>();

  public Matrix format(@NotNull final CellSet cellSet) {
    // Compute how many rows are required to display the columns axis.
    final CellSetAxis columnsAxis;
    if (cellSet.getAxes().size() > 0) {
      columnsAxis = cellSet.getAxes().get(0);
    } else {
      columnsAxis = null;
    }
    final AxisInfo columnsAxisInfo = computeAxisInfo(columnsAxis);

    // Compute how many columns are required to display the rows axis.
    final CellSetAxis rowsAxis;
    if (cellSet.getAxes().size() > 1) {
      rowsAxis = cellSet.getAxes().get(1);
    } else {
      rowsAxis = null;
    }
    final AxisInfo rowsAxisInfo = computeAxisInfo(rowsAxis);

    if (cellSet.getAxes().size() > 2) {
      final int[] dimensions = new int[cellSet.getAxes().size() - 2];
      for (int i = 2; i < cellSet.getAxes().size(); i++) {
        final CellSetAxis cellSetAxis = cellSet.getAxes().get(i);
        dimensions[i - 2] = cellSetAxis.getPositions().size();
      }
      for (final int[] pageCoords : CoordinateIterator.iterate(dimensions)) {
        matrix = formatPage(cellSet, pageCoords, columnsAxis, columnsAxisInfo, rowsAxis, rowsAxisInfo);
      }
    } else {
View Full Code Here

TOP

Related Classes of org.olap4j.CellSetAxis

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.