/** * Retrieves a property by name from an array. */ static Exp get(MemberProperty[] a, String name) { // TODO: Linear search may be a performance problem. for (int i = 0; i < a.length; i++) { if (Util.equalName(a[i].name, name)) { return a[i].exp; } } return null; } }
public boolean equals(Object o) { if (o instanceof HierarchyUsage) { HierarchyUsage other = (HierarchyUsage) o; return (this.kind == other.kind) && Util.equals(this.fact, other.fact) && this.hierarchyName.equals(other.hierarchyName) && Util.equalName(this.name, other.name) && Util.equalName(this.source, other.source) && Util.equalName(this.foreignKey, other.foreignKey); } else { return false; } }
private boolean segListMatchInUniqueNames( List<Id.Segment> segments, Collection<String> names) { String segUniqueName = Util.implode(segments); for (String name : names) { if (Util.equalName(segUniqueName, name)) { return true; } } return false; }
/** * Looks up a dimension in this cube based on a component of its name. * * @param s Name segment * @return Dimension, or null if not found */ public Dimension lookupDimension(Id.Segment s) { if (!(s instanceof Id.NameSegment)) { return null; } final Id.NameSegment nameSegment = (Id.NameSegment) s; for (Dimension dimension : dimensions) { if (Util.equalName(dimension.getName(), nameSegment.name)) { return dimension; } } return null; }
/** * Looks up a member whose unique name is <code>memberUniqueName</code> * from cache. If the member is not in cache, returns null. */ public Member lookupMemberFromCache(String memberUniqueName) { // first look in defined members for (Member member : getDefinedMembers()) { if (Util.equalName(member.getUniqueName(), memberUniqueName) || Util.equalName( getUniqueNameWithoutAll(member), memberUniqueName)) { return member; } } return null; }
private Hierarchy lookupHierarchy(Id.NameSegment s) { for (Hierarchy hierarchy : hierarchies) { if (Util.equalName(hierarchy.getName(), s.getName())) { return hierarchy; } } return null; } }
/** * Looks up a named set defined by an alias. * * @param nameParts Multi-part identifier for set * @param scopeList Parse tree node where name is used (last in list) and */ ScopedNamedSet lookupScopedNamedSet( List<Id.Segment> nameParts, ArrayStack<QueryPart> scopeList) { if (nameParts.size() != 1) { return null; } if (!(nameParts.get(0) instanceof Id.NameSegment)) { return null; } String name = ((Id.NameSegment) nameParts.get(0)).getName(); ScopedNamedSet bestScopedNamedSet = null; int bestScopeOrdinal = -1; for (ScopedNamedSet scopedNamedSet : scopedNamedSets) { if (Util.equalName(scopedNamedSet.name, name)) { int scopeOrdinal = scopeList.indexOf(scopedNamedSet.scope); if (scopeOrdinal > bestScopeOrdinal) { bestScopedNamedSet = scopedNamedSet; bestScopeOrdinal = scopeOrdinal; } } } return bestScopedNamedSet; }
public OlapElement lookupChild( SchemaReader schemaReader, Id.Segment s, MatchType matchType) { if (!(s instanceof Id.NameSegment)) { return null; } final Id.NameSegment nameSegment = (Id.NameSegment) s; if (Util.equalName(nameSegment.name, dimension.getName())) { return dimension; } // Archaic form <dimension>.<hierarchy>, e.g. [Time.Weekly].[1997] if (!MondrianProperties.instance().SsasCompatibleNaming.get() && Util.equalName( nameSegment.name, dimension.getName() + "." + subName)) { return RolapHierarchy.this; } return null; }
private Hierarchy getHierarchyWithDefaultName() { for ( Hierarchy hierarchy : dimension.getHierarchies() ) { if ( Util.equalName( hierarchy.getName(), dimension.getName() ) ) { return hierarchy; } } return null; }
public static boolean matches(IdentifierSegment segment, String name) { switch (segment.getQuoting()) { case KEY: return false; // FIXME case QUOTED: return equalName(segment.getName(), name); case UNQUOTED: return segment.getName().equalsIgnoreCase(name); default: throw unexpected(segment.getQuoting()); } }
public Parameter getParameter(String name) { // Scan through schema parameters. for (RolapSchemaParameter parameter : schema.parameterList) { if (Util.equalName(parameter.getName(), name)) { return parameter; } } // Scan through mondrian properties. List<Property> propertyList = MondrianProperties.instance().getPropertyList(); for (Property property : propertyList) { if (property.getPath().equals(name)) { return new SystemPropertyParameter(name, false); } } return null; }
public static boolean matches( Member member, List<Id.Segment> nameParts) { if (Util.equalName(Util.implode(nameParts), member.getUniqueName())) { // exact match return true; } Id.Segment segment = nameParts.get(nameParts.size() - 1); while (member.getParentMember() != null) { if (!segment.matches(member.getName())) { return false; } member = member.getParentMember(); nameParts = nameParts.subList(0, nameParts.size() - 1); segment = nameParts.get(nameParts.size() - 1); } if (segment.matches(member.getName())) { return Util.equalName( member.getHierarchy().getUniqueName(), Util.implode(nameParts.subList(0, nameParts.size() - 1))); } else if (member.isAll()) { return Util.equalName( member.getHierarchy().getUniqueName(), Util.implode(nameParts)); } else { return false; } }
&& !Util.equalName(child.getName(), name.getName()))
/** * Returns a child relation which maps onto a given relation, or null * if there is none. */ public Table findChild( MondrianDef.Relation relation, Condition joinCondition) { for (Table child : getChildren()) { if (child.relation.equals(relation)) { Condition condition = joinCondition; if (!Util.equalName(relation.getAlias(), child.alias)) { // Make the two conditions comparable, by replacing // occurrence of this table's alias with occurrences // of the child's alias. AliasReplacer aliasReplacer = new AliasReplacer( relation.getAlias(), child.alias); condition = aliasReplacer.visit(joinCondition); } if (child.joinCondition.equals(condition)) { return child; } } } return null; }
if (Util.equalName(measure.getName(), xmlCube.defaultMeasure)) { defaultMeasure = measure;