summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpshi2011-10-18 21:18:46 (EDT)
committer xgu2011-10-18 21:18:46 (EDT)
commit67f172f7ded499656bbb0e78c773e035d7f51e2e (patch)
tree716e3c402d260972d798bed0aa16441eac7f7522
parent93f0eb353bec963532ae4e391cf29ff7abf3b46b (diff)
downloadorg.eclipse.birt-67f172f7ded499656bbb0e78c773e035d7f51e2e.zip
org.eclipse.birt-67f172f7ded499656bbb0e78c773e035d7f51e2e.tar.gz
org.eclipse.birt-67f172f7ded499656bbb0e78c773e035d7f51e2e.tar.bz2
clean code
-rw-r--r--data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/api/CubeFeaturesTest.java2
-rw-r--r--data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/cursor/DateCube.java11
-rw-r--r--data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/AggregationCalculator.java2
-rw-r--r--data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/TimeFunctionCalculator.java2
4 files changed, 10 insertions, 7 deletions
diff --git a/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/api/CubeFeaturesTest.java b/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/api/CubeFeaturesTest.java
index 134a62d..2a2e1c5 100644
--- a/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/api/CubeFeaturesTest.java
+++ b/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/api/CubeFeaturesTest.java
@@ -64,7 +64,6 @@ import org.eclipse.birt.data.engine.olap.api.query.IHierarchyDefinition;
import org.eclipse.birt.data.engine.olap.api.query.ILevelDefinition;
import org.eclipse.birt.data.engine.olap.api.query.ISubCubeQueryDefinition;
import org.eclipse.birt.data.engine.olap.cursor.DateCube;
-import org.eclipse.birt.data.engine.olap.data.api.CubeQueryExecutorHelper;
import org.eclipse.birt.data.engine.olap.data.api.ILevel;
import org.eclipse.birt.data.engine.olap.data.api.cube.DocManagerMap;
import org.eclipse.birt.data.engine.olap.data.api.cube.DocManagerReleaser;
@@ -76,7 +75,6 @@ import org.eclipse.birt.data.engine.olap.data.api.cube.ILevelDefn;
import org.eclipse.birt.data.engine.olap.data.document.DocumentManagerFactory;
import org.eclipse.birt.data.engine.olap.data.document.IDocumentManager;
import org.eclipse.birt.data.engine.olap.data.impl.Cube;
-import org.eclipse.birt.data.engine.olap.data.impl.aggregation.function.TimeMember;
import org.eclipse.birt.data.engine.olap.data.impl.dimension.Dimension;
import org.eclipse.birt.data.engine.olap.data.impl.dimension.DimensionFactory;
import org.eclipse.birt.data.engine.olap.data.impl.dimension.DimensionForTest;
diff --git a/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/cursor/DateCube.java b/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/cursor/DateCube.java
index ad54629..af1363e 100644
--- a/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/cursor/DateCube.java
+++ b/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/cursor/DateCube.java
@@ -21,6 +21,7 @@ import org.eclipse.birt.data.engine.core.DataException;
import org.eclipse.birt.data.engine.impl.DataEngineImpl;
import org.eclipse.birt.data.engine.impl.StopSign;
import org.eclipse.birt.data.engine.olap.data.api.CubeQueryExecutorHelper;
+import org.eclipse.birt.data.engine.olap.data.api.cube.CubeElementFactory;
import org.eclipse.birt.data.engine.olap.data.api.cube.DocManagerMap;
import org.eclipse.birt.data.engine.olap.data.api.cube.DocManagerReleaser;
import org.eclipse.birt.data.engine.olap.data.api.cube.ICube;
@@ -83,7 +84,7 @@ public class DateCube
iterator.setLevelMember( 6, DateFactTable.DIM1_DAY_Col );
iterator.setLevelMember( 7, DateFactTable.ATTRIBUTE_Col );
- ILevelDefn[] levelDefs = new ILevelDefn[4];
+ ILevelDefn[] levelDefs = new ILevelDefn[5];
levelDefs[0] = new LevelDefinition( "level11", new String[]{
"level11"
@@ -113,6 +114,10 @@ public class DateCube
} );
levelDefs[3].setTimeType( "day-of-month" );
+ levelDefs[4] = CubeElementFactory.createLevelDefinition( "_${INTERNAL_INDEX}$_",
+ new String[]{"year/DateTime", "quarter/DateTime", "month/DateTime", "day-of-month/DateTime"},
+ new String[0] );
+
dimensions[0] = (Dimension) DimensionFactory.createDimension( "dimension1",
documentManager,
iterator,
@@ -236,8 +241,8 @@ class DateFactTable implements IDatasetIterator
static Date[] ATTRIBUTE_Col = {
new Date( 98, 0, 1),new Date( 98, 4, 1),
new Date( 99, 0, 1),new Date( 99, 4, 1),
- new Date( 99, 0, 1),new Date( 99, 4, 1),
- new Date( 98, 0, 1),new Date( 99, 4, 1)
+ new Date( 97, 0, 1),new Date( 96, 4, 1),
+ new Date( 95, 0, 1),new Date( 94, 4, 1)
};
public void close( ) throws BirtException
diff --git a/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/AggregationCalculator.java b/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/AggregationCalculator.java
index 5b72982..4459a7b 100644
--- a/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/AggregationCalculator.java
+++ b/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/AggregationCalculator.java
@@ -109,7 +109,7 @@ public class AggregationCalculator
IDimension timeDimension = cubeDimensionReader.getDimension( tDimName );
this.timeFunctionFilter[i] = getTimeFunctinResult( timeDimension, aggregationFunction[i].getTimeFunctionFilter() );
this.timeFilterDimensionIndex[i] = cubeDimensionReader.getDimensionIndex( tDimName );
- this.timeFilterLevelCount[i] = cubeDimensionReader.getlowestLevelIndex( tDimName ) ;
+ this.timeFilterLevelCount[i] = cubeDimensionReader.getlowestLevelIndex( tDimName ) - 1;
}
if (aggregation == null)
{
diff --git a/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/TimeFunctionCalculator.java b/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/TimeFunctionCalculator.java
index 27e1df5..68c17b9 100644
--- a/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/TimeFunctionCalculator.java
+++ b/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/TimeFunctionCalculator.java
@@ -108,7 +108,7 @@ public class TimeFunctionCalculator
}
if( existReferenceDate )
{
- endLevelIndex = cubeDimensionReader.getlowestLevelIndex( tDimName );
+ endLevelIndex = cubeDimensionReader.getlowestLevelIndex( tDimName ) - 1;
}
else
{