本文整理汇总了Java中org.olap4j.metadata.Member.equals方法的典型用法代码示例。如果您正苦于以下问题:Java Member.equals方法的具体用法?Java Member.equals怎么用?Java Member.equals使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.olap4j.metadata.Member
的用法示例。
在下文中一共展示了Member.equals方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: toggleMember
import org.olap4j.metadata.Member; //导入方法依赖的package包/类
/**
* If the member is currently "expanded" (its children are part of the MDX
* query), its children will be removed from the query. Otherwise (the
* member's children are not showing), the member's children will be added
* to the query. In either case, the query will be re-executed after the
* member selections have been adjusted.
*
* @param member The member whose drilldown state to toggle. Must not be null.
* @throws QueryInitializationException
* @throws OlapException if the list of child members can't be retrieved
* @return Returns true if the query was NOT expanded
*/
public synchronized boolean toggleMember(Member member) throws QueryInitializationException {
Dimension d = member.getDimension();
QueryDimension qd = getMDXQuery().getDimension(d.getName());
boolean wasCollapsed = false;
for (Iterator<Selection> it = qd.getInclusions().iterator(); it.hasNext(); ) {
Selection s = it.next();
logger.debug("Checking if " + s.getMember().getName() + " is a descendant of " + member.getName());
if (OlapUtils.isDescendant(member, s.getMember()) ||
(member.equals(s.getMember()) && (s.getOperator() == Operator.CHILDREN || s.getOperator() == Operator.INCLUDE_CHILDREN))) {
logger.debug(s.getMember().getName() + " was collapsed and removed");
// XXX query model docs now say not to do this,
// but there is no other way in the API
it.remove();
wasCollapsed = true;
}
}
if (!wasCollapsed) {
qd.include(Operator.CHILDREN, member);
}
updateAttributes();
return wasCollapsed;
}
示例2: drillUpTo
import org.olap4j.metadata.Member; //导入方法依赖的package包/类
/**
* Modifies this query's selection so that targetAncestor, and every
* ancestor of fromMember in between will be included. If targetAncestor
* isn't actually an ancestor, it returns right away.
*
* @param fromMember
* The member whose ancestors will be added to the query
* selection
* @param targetAncestor
* The highest ancestor member that will be added to the query
* selection
* @throws QueryInitializationException
*/
public synchronized void drillUpTo(Member fromMember, Member targetAncestor) throws QueryInitializationException {
// is targetAncestor REALLY an ancestor?
if (!OlapUtils.isDescendant(targetAncestor, fromMember)) return;
Member member = fromMember;
while (member.getParentMember() != null && !member.equals(targetAncestor)) {
member = member.getParentMember();
if (!isIncluded(member)) {
includeMember(member);
}
}
updateAttributes();
}
示例3: compare
import org.olap4j.metadata.Member; //导入方法依赖的package包/类
public int compare(Member m1, Member m2) {
if (m1.equals(m2)) return 0;
// Find common ancestor
List<Member> m1path = path(m1);
List<Member> m2path = path(m2);
int i = 0;
while (i < m1path.size() && i < m2path.size()) {
if (! m1path.get(i).equals((m2path).get(i))) break;
i++;
}
// Lowest common ancestor is m1path.get(i - 1), but we don't care
if (m1path.size() == i) return -1;
if (m2path.size() == i) return 1;
logger.debug("m1path[i] ordinal=" + m1path.get(i).getOrdinal() + " name=" + m1path.get(i).getName());
logger.debug("m2path[i] ordinal=" + m2path.get(i).getOrdinal() + " name=" + m2path.get(i).getName());
if (m1path.get(i).getName().matches("[0-9]+") && m2path.get(i).getName().matches("[0-9]+")) {
Integer member1Int = Integer.parseInt(m1path.get(i).getName());
Integer member2Int = Integer.parseInt(m2path.get(i).getName());
return member1Int.compareTo(member2Int);
} else {
return m1path.get(i).getName().compareToIgnoreCase(m2path.get(i).getName());
}
}
示例4: isDescendant
import org.olap4j.metadata.Member; //导入方法依赖的package包/类
/**
* Tests whether or not the given parent member has the other member as one
* of its descendants--either a direct child, or a child of a child, and so
* on. Does not consider parent to be a descendant of itself, so in the case
* both arguments are equal, this method returns false.
*
* @param parent
* The parent member
* @param testForDescendituitivitiness
* The member to check if it has parent as an ancestor
*/
public static boolean isDescendant(Member parent, Member testForDescendituitivitiness) {
if (testForDescendituitivitiness.equals(parent)) return false;
while (testForDescendituitivitiness != null) {
if (testForDescendituitivitiness.equals(parent)) return true;
testForDescendituitivitiness = testForDescendituitivitiness.getParentMember();
}
return false;
}
示例5: isDescendantOrEqualTo
import org.olap4j.metadata.Member; //导入方法依赖的package包/类
/**
* Tests whether or not the given parent member is the same as or has the
* other member as one of its descendants--either a direct child, or a child
* of a child, and so on.
*
* @param parent
* The parent member
* @param testForDescendituitivitiness
* The member to check if it is parent or has parent as an ancestor
*/
public static boolean isDescendantOrEqualTo(
Member parent, Member testForEquidescendituitivitiness) {
return parent.equals(testForEquidescendituitivitiness) ||
isDescendant(parent, testForEquidescendituitivitiness);
}
示例6: isChild
import org.olap4j.metadata.Member; //导入方法依赖的package包/类
/**
* Tests whether or not the given parent member has the other member as one
* of a direct child. Does not consider parent to be a direct child of
* itself, so in the case both arguments are equal, this method returns
* false.
*
* @param parent
* The potential parent member
* @param testForChildishness
* The member to check if it has parent as its parent member
* @return True if testForChildishness is a direct child of parent. False
* otherwise.
*/
public static boolean isChild(Member parent, Member testForChildishness) {
return parent.equals(testForChildishness.getParentMember());
}