本文整理汇总了Java中org.olap4j.metadata.Level类的典型用法代码示例。如果您正苦于以下问题:Java Level类的具体用法?Java Level怎么用?Java Level使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Level类属于org.olap4j.metadata包,在下文中一共展示了Level类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: lookupMember
import org.olap4j.metadata.Level; //导入依赖的package包/类
@Override
public Member lookupMember(List<IdentifierSegment> nameParts)
throws OlapException {
Dimension dim = getDimensions().get(nameParts.get(0).getName());
if(dim instanceof ServerMeasureDimension){
String mp = nameParts.get(1).getName();
for(Measure m : getMeasures()){
if(m.getName()!=null && m.getName().equals(mp))
return m;
}
}else if(dim instanceof ServerDimension && nameParts.size()>2){
Hierarchy h = dim.getHierarchies().get(nameParts.get(1).getName());
if(h!=null){
Level level = h.getLevels().get(nameParts.get(2).getName());
if(level!=null){
if(level.getLevelType()==Type.ALL)
return h.getDefaultMember();
else if(nameParts.size()>3)
return new LevelMember(level, nameParts.get(3).getName(), 0);
}
}
}
return null;
}
开发者ID:Wondersoft,项目名称:olaper,代码行数:27,代码来源:ServerCube.java
示例2: lookupLevel
import org.olap4j.metadata.Level; //导入依赖的package包/类
public static Level lookupLevel(Cube cube, List<IdentifierSegment> segmentList) {
if(segmentList.size() < 2)
return null;
Dimension dim = cube.getDimensions().get(segmentList.get(0).getName());
if(dim instanceof ServerDimension){
Hierarchy h = dim.getHierarchies().get(segmentList.get(1).getName());
if(h!=null && segmentList.size()==3 && h.getLevels().size()==1){
return h.getLevels().get(0);
}else if(h!=null && segmentList.size()==4){
return h.getLevels().get(segmentList.get(2).getName());
}
}
return null;
}
开发者ID:Wondersoft,项目名称:olaper,代码行数:21,代码来源:MetadataUtils.java
示例3: determineRowAxisColumns
import org.olap4j.metadata.Level; //导入依赖的package包/类
/**
*
* @param axis
* @return
*/
private List<Level> determineRowAxisColumns(CellSetAxis axis) {
Set<Level> levelsEncountered = new HashSet<Level>();
for (Position p : axis.getPositions()) {
for (Member m : p.getMembers()) {
levelsEncountered.add(m.getLevel());
}
}
List<Level> columnAssignments = new ArrayList<Level>();
for (Hierarchy h : axis.getAxisMetaData().getHierarchies()) {
for (Level l : h.getLevels()) {
if (levelsEncountered.contains(l)) {
columnAssignments.add(l);
}
}
}
return columnAssignments;
}
开发者ID:SQLPower,项目名称:wabit,代码行数:25,代码来源:OlapResultSet.java
示例4: populateLevel
import org.olap4j.metadata.Level; //导入依赖的package包/类
private void populateLevel(
Catalog catalog,
Cube cube,
Level level,
List<Row> rows)
throws SQLException
{
final XmlaHandler.XmlaExtra extra =
getExtra(catalog.getMetaData().getConnection());
for (Property property
: filter(extra.getLevelProperties(level), propertyNameCond))
{
if (extra.isPropertyInternal(property)) {
continue;
}
outputProperty(
property, catalog, cube, level, rows);
}
}
开发者ID:OSBI,项目名称:mondrian,代码行数:20,代码来源:RowsetDefinition.java
示例5: populateCube
import org.olap4j.metadata.Level; //导入依赖的package包/类
protected void populateCube(OlapConnection connection, Catalog catalog, Cube cube, List<Row> rows) throws XmlaException, SQLException {
if (isRestricted(LevelUniqueName)) {
// Note: If the LEVEL_UNIQUE_NAME has been specified, then
// the dimension and hierarchy are specified implicitly.
String levelUniqueName = getRestrictionValueAsString(LevelUniqueName);
if (levelUniqueName == null) {
// The query specified two or more unique names
// which means that nothing will match.
return;
}
Level level = lookupLevel(cube, levelUniqueName);
if (level != null) {
// Get members of this level, without access control, but
// including calculated members.
List<Member> members = level.getMembers();
outputMembers(connection, members, catalog, cube, rows);
}
} else {
for (Dimension dimension : filter(cube.getDimensions(), dimensionUnameCond)) {
populateDimension(connection, catalog, cube, dimension, rows);
}
}
}
开发者ID:OpenlinkFinancial,项目名称:MXMLABridge,代码行数:25,代码来源:RowsetDefinition.java
示例6: LevelMember
import org.olap4j.metadata.Level; //导入依赖的package包/类
public LevelMember(Level level, String name, int ordinal){
String[] comps = name.split("///",2);
this.level = level;
this.name = clearControls( (comps.length>1 && !comps[0].isEmpty()) ? comps[1] : comps[0]);
this.key = clearControls(comps[0]);
this.ordinal = ordinal;
}
开发者ID:Wondersoft,项目名称:olaper,代码行数:8,代码来源:LevelMember.java
示例7: memberSet
import org.olap4j.metadata.Level; //导入依赖的package包/类
@Override
public List<LevelMemberSet> memberSet() throws OlapException {
Level level = MetadataUtils.lookupLevel(cube, node.getSegmentList());
if(level==null)
throw new OlapException("Level not found in cube: "+ParseUtils.toString(node));
return Collections.singletonList(new LevelMemberSet(level, node, this));
}
开发者ID:Wondersoft,项目名称:olaper,代码行数:10,代码来源:MembersFunction.java
示例8: ServerHierarchy
import org.olap4j.metadata.Level; //导入依赖的package包/类
public ServerHierarchy(ServerDimension serverDimension, NamedElement cdef,
List<NamedElement> levelDefs) {
this.serverDimension = serverDimension;
this.definition = cdef;
this.levels = MetadataUtils.metadataNamedList(new ArrayList<Level>());
levels.add(allLevel);
int depth = 1;
for(NamedElement attr_def : levelDefs){
levels.add(new ServerLevel(this, attr_def, depth++));
}
}
开发者ID:Wondersoft,项目名称:olaper,代码行数:15,代码来源:ServerHierarchy.java
示例9: lookupMember
import org.olap4j.metadata.Level; //导入依赖的package包/类
public static Member lookupMember(Cube cube, List<IdentifierSegment> segmentList) {
if(segmentList.size() < 3)
return null;
Dimension dim = cube.getDimensions().get(segmentList.get(0).getName());
if(dim instanceof ServerDimension){
Hierarchy h = dim.getHierarchies().get(segmentList.get(1).getName());
if(h!=null){
Level level = null;
String memberName = null;
if(segmentList.size()==3){
level = h.hasAll() ? h.getLevels().get(1) : h.getLevels().get(0);
memberName = segmentList.get(2).getName();
}else if(segmentList.size()==4){
level = h.getLevels().get(segmentList.get(2).getName());
memberName = segmentList.get(3).getName();
}
if(level!=null){
return new LevelMember(level, memberName, memberName, 0);
}
}
}
return null;
}
开发者ID:Wondersoft,项目名称:olaper,代码行数:33,代码来源:MetadataUtils.java
示例10: getLevelForColumn
import org.olap4j.metadata.Level; //导入依赖的package包/类
/**
* Provides the inverse mapping of {@link #findColumnForLevel(Level)}.
*
* @param colNum
* The result set column number (1-based; first column is 1).
* @return The Level associated with the given column, or null if the given
* column does not exist or is not a Level column.
* @throws SQLException
* if colNum is not a legal column index in this result set.
*/
private Level getLevelForColumn(int colNum) throws SQLException {
if (colNum > rsmd.getColumnCount() || colNum < 1) {
throw new SQLException(
"Column index out of bounds. You requested " + colNum +
"; legal range is 1.." + rsmd.getColumnCount());
} else if (colNum <= rowAxisColumns.size()) {
return rowAxisColumns.get(colNum - 1);
} else {
return null;
}
}
开发者ID:SQLPower,项目名称:wabit,代码行数:22,代码来源:OlapResultSet.java
示例11: populateHierarchy
import org.olap4j.metadata.Level; //导入依赖的package包/类
protected void populateHierarchy(
OlapConnection connection,
Catalog catalog,
Cube cube,
Hierarchy hierarchy,
List<Row> rows)
throws XmlaException, SQLException
{
for (Level level
: filter(hierarchy.getLevels(), levelUnameCond, levelNameCond))
{
outputLevel(
connection, catalog, cube, hierarchy, level, rows);
}
}
开发者ID:OSBI,项目名称:mondrian,代码行数:16,代码来源:RowsetDefinition.java
示例12: populateCube
import org.olap4j.metadata.Level; //导入依赖的package包/类
protected void populateCube(
OlapConnection connection,
Catalog catalog,
Cube cube,
List<Row> rows)
throws XmlaException, SQLException
{
if (isRestricted(LevelUniqueName)) {
// Note: If the LEVEL_UNIQUE_NAME has been specified, then
// the dimension and hierarchy are specified implicitly.
String levelUniqueName =
getRestrictionValueAsString(LevelUniqueName);
if (levelUniqueName == null) {
// The query specified two or more unique names
// which means that nothing will match.
return;
}
Level level = lookupLevel(cube, levelUniqueName);
if (level != null) {
// Get members of this level, without access control, but
// including calculated members.
List<Member> members = level.getMembers();
outputMembers(connection, members, catalog, cube, rows);
}
} else {
for (Dimension dimension
: filter(cube.getDimensions(), dimensionUnameCond))
{
populateDimension(
connection, catalog, cube, dimension, rows);
}
}
}
开发者ID:OSBI,项目名称:mondrian,代码行数:35,代码来源:RowsetDefinition.java
示例13: lookupLevel
import org.olap4j.metadata.Level; //导入依赖的package包/类
private static Level lookupLevel(Cube cube, String levelUniqueName) {
for (Dimension dimension : cube.getDimensions()) {
for (Hierarchy hierarchy : dimension.getHierarchies()) {
for (Level level : hierarchy.getLevels()) {
if (level.getUniqueName().equals(levelUniqueName)) {
return level;
}
}
}
}
return null;
}
开发者ID:OSBI,项目名称:mondrian,代码行数:13,代码来源:RowsetDefinition.java
示例14: MondrianOlap4jLevel
import org.olap4j.metadata.Level; //导入依赖的package包/类
/**
* Creates a MondrianOlap4jLevel.
*
* @param olap4jSchema Schema
* @param level Mondrian level
*/
MondrianOlap4jLevel(
MondrianOlap4jSchema olap4jSchema,
mondrian.olap.Level level)
{
this.olap4jSchema = olap4jSchema;
this.level = level;
}
开发者ID:OSBI,项目名称:mondrian,代码行数:14,代码来源:MondrianOlap4jLevel.java
示例15: getLevelCardinality
import org.olap4j.metadata.Level; //导入依赖的package包/类
public int getLevelCardinality(Level level) throws OlapException {
if (level instanceof MondrianOlap4jLevel) {
// Improved implementation if the provider is mondrian.
final MondrianOlap4jLevel olap4jLevel = (MondrianOlap4jLevel) level;
final mondrian.olap.SchemaReader schemaReader =
olap4jLevel.olap4jSchema.olap4jCatalog.olap4jDatabaseMetaData
.olap4jConnection.getMondrianConnection().getSchemaReader()
.withLocus();
return schemaReader.getLevelCardinality(
olap4jLevel.level, true, true);
} else {
return level.getCardinality();
}
}
开发者ID:OSBI,项目名称:mondrian,代码行数:15,代码来源:MondrianOlap4jExtra.java
示例16: isHierarchyParentChild
import org.olap4j.metadata.Level; //导入依赖的package包/类
public boolean isHierarchyParentChild(Hierarchy hierarchy) {
Level nonAllFirstLevel = hierarchy.getLevels().get(0);
if (nonAllFirstLevel.getLevelType() == Level.Type.ALL) {
nonAllFirstLevel = hierarchy.getLevels().get(1);
}
MondrianOlap4jLevel olap4jLevel =
(MondrianOlap4jLevel) nonAllFirstLevel;
return ((RolapLevel) olap4jLevel.level).isParentChild();
}
开发者ID:OSBI,项目名称:mondrian,代码行数:10,代码来源:MondrianOlap4jExtra.java
示例17: populateLevel
import org.olap4j.metadata.Level; //导入依赖的package包/类
private void populateLevel(Catalog catalog, Cube cube, Level level, List<Row> rows) throws SQLException {
final CustomXmlaHandler.XmlaExtra extra = getExtra(catalog.getMetaData().getConnection());
for (Property property : filter(extra.getLevelProperties(level), propertyNameCond)) {
if (extra.isPropertyInternal(property)) {
continue;
}
outputProperty(property, catalog, cube, level, rows);
}
}
开发者ID:OpenlinkFinancial,项目名称:MXMLABridge,代码行数:10,代码来源:RowsetDefinition.java
示例18: outputProperty
import org.olap4j.metadata.Level; //导入依赖的package包/类
private void outputProperty(Property property, Catalog catalog, Cube cube, Level level, List<Row> rows) {
Hierarchy hierarchy = level.getHierarchy();
Dimension dimension = hierarchy.getDimension();
String propertyName = property.getName();
Row row = new Row();
row.set(CatalogName.name, catalog.getName());
row.set(CubeName.name, cube.getName());
row.set(DimensionUniqueName.name, dimension.getUniqueName());
row.set(HierarchyUniqueName.name, hierarchy.getUniqueName());
row.set(LevelUniqueName.name, level.getUniqueName());
row.set(PropertyName.name, propertyName);
row.set(PropertyCaption.name, property.getCaption());
// Only member properties now
row.set(PropertyType.name, 1);
row.set(PropertyContentType.name, Property.ContentType.REGULAR.xmlaOrdinal());
XmlaConstants.DBType dbType = getDBTypeFromProperty(property);
row.set(DataType.name, 0);
row.set(PropertyOrigin.name, 1);
String desc = cube.getName() + " Cube - " + getHierarchyName(hierarchy) + " Hierarchy - " + level.getName() + " Level - " + property.getName() + " Property";
row.set(Description.name, desc);
row.set(PropertyCardinality.name, "MANY");
row.set(PropertyAttributeHierarchyName.name, propertyName);
//row.set(PropertyVisibility.name, 1);
row.set(PropertyIsVisible.name, true);
addRow(row, rows);
}
开发者ID:OpenlinkFinancial,项目名称:MXMLABridge,代码行数:34,代码来源:RowsetDefinition.java
示例19: lookupLevel
import org.olap4j.metadata.Level; //导入依赖的package包/类
private static Level lookupLevel(Cube cube, String levelUniqueName) {
for (Dimension dimension : cube.getDimensions()) {
for (Hierarchy hierarchy : dimension.getHierarchies()) {
for (Level level : hierarchy.getLevels()) {
if (level.getUniqueName().equals(levelUniqueName)) {
return level;
}
}
}
}
return null;
}
开发者ID:OpenlinkFinancial,项目名称:MXMLABridge,代码行数:13,代码来源:RowsetDefinition.java
示例20: getLevels
import org.olap4j.metadata.Level; //导入依赖的package包/类
public NamedList<Level> getLevels() {
final NamedList<MondrianOlap4jLevel> list =
new NamedListImpl<MondrianOlap4jLevel>();
final MondrianOlap4jConnection olap4jConnection =
olap4jSchema.olap4jCatalog.olap4jDatabaseMetaData.olap4jConnection;
for (mondrian.olap.Level level : hierarchy.getLevels()) {
list.add(olap4jConnection.toOlap4j(level));
}
return Olap4jUtil.cast(list);
}
开发者ID:Twixer,项目名称:mondrian-3.1.5,代码行数:11,代码来源:MondrianOlap4jHierarchy.java
注:本文中的org.olap4j.metadata.Level类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论