本文整理汇总了Java中org.olap4j.metadata.Hierarchy类的典型用法代码示例。如果您正苦于以下问题:Java Hierarchy类的具体用法?Java Hierarchy怎么用?Java Hierarchy使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Hierarchy类属于org.olap4j.metadata包,在下文中一共展示了Hierarchy类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: lookupMember
import org.olap4j.metadata.Hierarchy; //导入依赖的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.Hierarchy; //导入依赖的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: Olap4jHierarchy
import org.olap4j.metadata.Hierarchy; //导入依赖的package包/类
public Olap4jHierarchy(Hierarchy hierarchy)
{
this.hierarchy = hierarchy;
if (hierarchy == null)
{
levels = new Olap4jLevel[0];
}
else
{
NamedList<org.olap4j.metadata.Level> hierarchyLevels = hierarchy.getLevels();
levels = new Olap4jLevel[hierarchyLevels.size()];
for (int i = 0; i < hierarchyLevels.size(); i++)
{
levels[i] = new Olap4jLevel(hierarchyLevels.get(i));
}
}
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:19,代码来源:Olap4jHierarchy.java
示例4: Olap4jResultAxis
import org.olap4j.metadata.Hierarchy; //导入依赖的package包/类
public Olap4jResultAxis(CellSetAxis axis,
List<Hierarchy> axisHierarchies,
Olap4jFactory factory)
{
List<Position> positions = axis.getPositions();
this.tuples = new ArrayList<Olap4jTuple>(positions.size());
for (Iterator<Position> it = positions.iterator(); it.hasNext(); )
{
tuples.add(new Olap4jTuple(it.next(), factory));
}
this.hierarchies = new ArrayList<Olap4jHierarchy>(axisHierarchies.size());
for (Iterator<Hierarchy> it = axisHierarchies.iterator(); it.hasNext(); )
{
hierarchies.add(new Olap4jHierarchy(it.next()));
}
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:18,代码来源:Olap4jResultAxis.java
示例5: HierarchyComponent
import org.olap4j.metadata.Hierarchy; //导入依赖的package包/类
/**
* @param axis
* The {@link CellSetAxis} that this HierachyComponent is in.
* @param hierarchy
* The hierarchy that this Component represents. Must not be
* null.
* @param hierarchyOrdinal
* The index of <tt>hierarchy</tt> within <tt>axis</tt>.
* @param columnModel
* The columnModel that will be used to determine column
* positions in the table. If the axis type is not
* {@link Axis#COLUMNS}, then this can be null.
*/
public HierarchyComponent(CellSetAxis axis, Hierarchy hierarchy, final int hierarchyOrdinal, TableColumnModel columnModel) {
// HierarchyComponent may exceed the default maximum size of
// Short.MAX_VALUE x Short.MAX_VALUE, so we have to increase it or
// it won't display properly.
this.setMaximumSize(new java.awt.Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE));
this.axis = axis;
this.hierarchyOrdinal = hierarchyOrdinal;
this.columnModel = columnModel;
this.hierarchy = hierarchy;
if (hierarchy == null) {
throw new NullPointerException("Null hierarchy not allowed");
}
setOpaque(true);
addMouseListener(mouseHandler);
addMouseMotionListener(mouseHandler);
}
开发者ID:SQLPower,项目名称:wabit,代码行数:32,代码来源:CellSetTableHeaderComponent.java
示例6: determineRowAxisColumns
import org.olap4j.metadata.Hierarchy; //导入依赖的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
示例7: populateDimension
import org.olap4j.metadata.Hierarchy; //导入依赖的package包/类
protected void populateDimension(
OlapConnection connection,
Catalog catalog,
Cube cube,
Dimension dimension,
int ordinal,
List<Row> rows)
throws XmlaException, SQLException
{
final NamedList<Hierarchy> hierarchies = dimension.getHierarchies();
for (Hierarchy hierarchy
: filter(hierarchies, hierarchyNameCond, hierarchyUnameCond))
{
populateHierarchy(
connection,
catalog,
cube,
dimension,
hierarchy,
ordinal + hierarchies.indexOf(hierarchy),
rows);
}
}
开发者ID:OSBI,项目名称:mondrian,代码行数:24,代码来源:RowsetDefinition.java
示例8: getHierarchies
import org.olap4j.metadata.Hierarchy; //导入依赖的package包/类
public NamedList<Hierarchy> getHierarchies() {
NamedList<MondrianOlap4jHierarchy> list =
new NamedListImpl<MondrianOlap4jHierarchy>();
final MondrianOlap4jConnection olap4jConnection =
olap4jSchema.olap4jCatalog.olap4jDatabaseMetaData.olap4jConnection;
final mondrian.olap.SchemaReader schemaReader =
olap4jConnection.getMondrianConnection2().getSchemaReader()
.withLocus();
for (mondrian.olap.Dimension dimension
: schemaReader.getCubeDimensions(cube))
{
for (mondrian.olap.Hierarchy hierarchy
: schemaReader.getDimensionHierarchies(dimension))
{
list.add(
new MondrianOlap4jHierarchy(
olap4jSchema, hierarchy));
}
}
return Olap4jUtil.cast(list);
}
开发者ID:OSBI,项目名称:mondrian,代码行数:22,代码来源:MondrianOlap4jCube.java
示例9: getHierarchiesNonFilter
import org.olap4j.metadata.Hierarchy; //导入依赖的package包/类
/**
* Returns the hierarchies on a non-filter axis.
*
* @return List of hierarchies, never null
*/
private List<Hierarchy> getHierarchiesNonFilter() {
final Exp exp = queryAxis.getSet();
if (exp == null) {
return Collections.emptyList();
}
List<Hierarchy> hierarchyList = new ArrayList<Hierarchy>();
for (mondrian.olap.Hierarchy hierarchy
: TypeUtil.getHierarchies(exp.getType()))
{
hierarchyList.add(
cellSetMetaData.olap4jStatement.olap4jConnection.toOlap4j(
hierarchy));
}
return hierarchyList;
}
开发者ID:OSBI,项目名称:mondrian,代码行数:21,代码来源:MondrianOlap4jCellSetAxisMetaData.java
示例10: axisInfo
import org.olap4j.metadata.Hierarchy; //导入依赖的package包/类
private List<Hierarchy> axisInfo(SaxWriter writer, CellSetAxis axis, String axisName) {
writer.startElement("AxisInfo", "name", axisName);
List<Hierarchy> hierarchies;
Iterator<org.olap4j.Position> it = axis.getPositions().iterator();
if (it.hasNext()) {
final org.olap4j.Position position = it.next();
hierarchies = new ArrayList<Hierarchy>();
for (Member member : position.getMembers()) {
hierarchies.add(member.getHierarchy());
}
} else {
hierarchies = axis.getAxisMetaData().getHierarchies();
}
List<Property> props = getProps(axis.getAxisMetaData());
writeHierarchyInfo(writer, hierarchies, props);
writer.endElement(); // AxisInfo
return hierarchies;
}
开发者ID:OpenlinkFinancial,项目名称:MXMLABridge,代码行数:22,代码来源:MDataSet.java
示例11: writeHierarchyInfo
import org.olap4j.metadata.Hierarchy; //导入依赖的package包/类
private void writeHierarchyInfo(SaxWriter writer, List<Hierarchy> hierarchies, List<Property> props) {
writer.startSequence(null, "HierarchyInfo");
for (Hierarchy hierarchy : hierarchies) {
writer.startElement("HierarchyInfo", "name", "[" + hierarchy.getName() + "]");
// exclude props "PARENT_UNIQUE_NAME" and "HIERARCHY_UNIQUE_NAME" by
// exlcuding props[1]
for (final Property prop : props) {
if (!prop.getName().equals("PARENT_UNIQUE_NAME") && !prop.getName().equals("HIERARCHY_UNIQUE_NAME")) {
final String encodedProp = encoder.encode(prop.getName());
final Object[] attributes = getAttributes(prop, hierarchy);
writer.element(encodedProp, attributes);
}
}
writer.endElement(); // HierarchyInfo
}
writer.endSequence(); // "HierarchyInfo"
}
开发者ID:OpenlinkFinancial,项目名称:MXMLABridge,代码行数:19,代码来源:MDataSet.java
示例12: getHierarchies
import org.olap4j.metadata.Hierarchy; //导入依赖的package包/类
@Override
protected List<Hierarchy> getHierarchies() {
List<Hierarchy> hierarchies = new ArrayList<Hierarchy>();
for(LevelMemberSet layer : layers){
Hierarchy h = layer.getLevel().getHierarchy();
if(!hierarchies.contains(h))
hierarchies.add(h);
}
return hierarchies;
}
开发者ID:Wondersoft,项目名称:olaper,代码行数:13,代码来源:ResultAxis.java
示例13: equals
import org.olap4j.metadata.Hierarchy; //导入依赖的package包/类
@Override
public boolean equals(Object obj) {
if(! (obj instanceof Hierarchy) )
return true;
Hierarchy h = (Hierarchy) obj;
return getUniqueName().equals(h.getUniqueName());
}
开发者ID:Wondersoft,项目名称:olaper,代码行数:8,代码来源:ServerHierarchy.java
示例14: getHierarchies
import org.olap4j.metadata.Hierarchy; //导入依赖的package包/类
@Override
public NamedList<Hierarchy> getHierarchies() {
if(hierarchies!=null)
return hierarchies;
hierarchies = MetadataUtils.metadataNamedList(new ArrayList<Hierarchy>());
return hierarchies;
}
开发者ID:Wondersoft,项目名称:olaper,代码行数:9,代码来源:ServerCube.java
示例15: readHierarchies
import org.olap4j.metadata.Hierarchy; //导入依赖的package包/类
private void readHierarchies() throws OlapException {
hierarchies = MetadataUtils.metadataNamedList(new ArrayList<Hierarchy>());
Map<String, AttributeDefinition> attributeMap = new HashMap<String, AttributeDefinition>();
if(definition.attributes!=null)
for(AttributeDefinition cdef: definition.attributes){
attributeMap.put(cdef.name, cdef);
if(cdef.auto_hierarchy){
hierarchies.add(new ServerHierarchy(this, cdef, Collections.singletonList((NamedElement)cdef)));
}
}
if(definition.hierarchies!=null)
for(HierarchyDefinition hdef : definition.hierarchies){
List<NamedElement> levelDefs = new ArrayList<NamedElement>();
for(String level : hdef.levels){
AttributeDefinition attr_def = attributeMap.get(level);
if(attr_def==null)
throw new OlapException("Fail to find attribute "+level+" used in dimension "+ getName());
levelDefs.add(attr_def);
}
hierarchies.add(new ServerHierarchy(this, hdef, levelDefs));
}
}
开发者ID:Wondersoft,项目名称:olaper,代码行数:29,代码来源:ServerDimension.java
示例16: lookupMember
import org.olap4j.metadata.Hierarchy; //导入依赖的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
示例17: handleHierInfo
import org.olap4j.metadata.Hierarchy; //导入依赖的package包/类
protected void handleHierInfo(JRXmlaResultAxis xmlaAxis, CellSetAxisMetaData axisMetaData)
{
for (Hierarchy h : axisMetaData.getHierarchies())
{
String dimName = h.getName(); // Get the Dimension Name
JRXmlaHierarchy hier = new JRXmlaHierarchy(dimName);
if (log.isDebugEnabled())
{
log.debug("Adding hierarchy: " + dimName);
}
xmlaAxis.addHierarchy(hier);
}
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:15,代码来源:Olap4jXmlaQueryExecuter.java
示例18: setLabelAsEmptyNoPositions
import org.olap4j.metadata.Hierarchy; //导入依赖的package包/类
/**
* This method will set the header component to have a default message if
* the axis contains no positions (due to all members being omitted or
* excluded)
*
* @param hierarchies
* A list of Hierarchies used to clear all exclusions if necessary
*/
private void setLabelAsEmptyNoPositions(final List<Hierarchy> hierarchies) {
setLayout(new BorderLayout());
JPanel panel = new JPanel(new MigLayout("flowy, align 50% 50%, ins 20", "align center", ""));
panel.setBackground(Color.WHITE);
JLabel label = new JLabel("No members in this axis");
panel.add(label);
label = new JLabel("Try unchecking 'Omit Empty Rows' or clicking ");
panel.add(label);
label = new JLabel("<html><a href=\"\">here to Clear All Exceptions</a></html>");
label.addMouseListener(new MouseAdapter() {
@Override
public void mousePressed(MouseEvent e) {
for (Hierarchy h: hierarchies) {
try {
query.clearExclusions(h);
} catch (QueryInitializationException ex) {
throw new RuntimeException("Error while clearing all exclusions", ex);
}
}
}
});
panel.add(label);
panel.setBorder(defaultBorder);
add(panel, BorderLayout.CENTER);
}
开发者ID:SQLPower,项目名称:wabit,代码行数:36,代码来源:CellSetTableHeaderComponent.java
示例19: reset
import org.olap4j.metadata.Hierarchy; //导入依赖的package包/类
/**
* This function is called by the 'Reset Query' button on the toolbar. It
* will replace the current MDX Query with a blank one.
* @throws SQLException
*/
public synchronized void reset() throws SQLException {
slicerMember = null;
hierarchiesInUse = new HashMap<QueryDimension, Hierarchy>();
if (getCurrentCube() != null){
setMdxQuery(new Query(OLAP4J_QUERY_NAME, getCurrentCube()));
}
fireStructureChanged();
}
开发者ID:SQLPower,项目名称:wabit,代码行数:14,代码来源:OlapQuery.java
示例20: getHierarchies
import org.olap4j.metadata.Hierarchy; //导入依赖的package包/类
private synchronized List<Hierarchy> getHierarchies(Axis axis) throws QueryInitializationException {
if (getMDXQuery() == null) return Collections.emptyList();
QueryAxis qa = getMDXQuery().getAxis(axis);
List<Hierarchy> selectedHierarchies = new ArrayList<Hierarchy>();
for (QueryDimension qd : qa.getDimensions()) {
Hierarchy h = hierarchiesInUse.get(qd);
assert h != null : qd + " not in " + hierarchiesInUse;
selectedHierarchies.add(h);
}
return selectedHierarchies;
}
开发者ID:SQLPower,项目名称:wabit,代码行数:12,代码来源:OlapQuery.java
注:本文中的org.olap4j.metadata.Hierarchy类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论