/** * Creates a dimension expression. * * @param dimension Dimension * @pre dimension != null */ public DimensionExpr(Dimension dimension) { Util.assertPrecondition(dimension != null, "dimension != null"); this.dimension = dimension; }
/** * @pre name != null */ public BasicValue(String name, int ordinal, String description) { Util.assertPrecondition(name != null, "name != null"); this.name = name; this.ordinal = ordinal; this.description = description; }
/** * Creates a hierarchy expression. * * @param hierarchy Hierarchy * @pre hierarchy != null */ public HierarchyExpr(Hierarchy hierarchy) { Util.assertPrecondition(hierarchy != null, "hierarchy != null"); this.hierarchy = hierarchy; }
/** * Creates a level expression. * * @param level Level * @pre level != null */ public LevelExpr(Level level) { Util.assertPrecondition(level != null, "level != null"); this.level = level; }
/** * Creates a usage of a named set. * * @param namedSet namedSet * @pre NamedSet != null */ public NamedSetExpr(NamedSet namedSet) { Util.assertPrecondition(namedSet != null, "namedSet != null"); this.namedSet = namedSet; }
/** * Creates a member expression. * * @param member Member * @pre member != null */ public MemberExpr(Member member) { Util.assertPrecondition(member != null, "member != null"); this.member = member; }
public Dimension getDimension(Schema schema) { Util.assertPrecondition(schema != null, "schema != null"); return this; }
public Dimension getDimension(Schema schema) { Util.assertPrecondition(schema != null, "schema != null"); return this; }
/** * Creates a ValidatorImpl. * * @param funTable Function table * * @param resolvedIdentifiers map of already resolved Ids * @pre funTable != null */ protected ValidatorImpl( FunTable funTable, Map<QueryPart, QueryPart> resolvedIdentifiers) { Util.assertPrecondition(funTable != null, "funTable != null"); this.funTable = funTable; resolvedNodes.putAll(resolvedIdentifiers); }
public Dimension getDimension(Schema schema) { Util.assertPrecondition(schema != null, "schema != null"); for (int i = 0; i < schema.dimensions.length; i++) { if (schema.dimensions[i].name.equals(source)) { return schema.dimensions[i]; } } throw Util.newInternal( "Cannot find shared dimension '" + source + "'"); } // END pass-through code block ---
public Access getAccess(NamedSet set) { Util.assertPrecondition(set != null, "set != null"); // TODO Named sets cannot be secured at the moment. LOGGER.trace( "Access level ALL " + " granted to NamedSet " + set.getUniqueName() + " because I said so."); return Access.ALL; }
public Dimension getDimension(Schema schema) { Util.assertPrecondition(schema != null, "schema != null"); for (int i = 0; i < schema.dimensions.length; i++) { if (schema.dimensions[i].name.equals(source)) { return schema.dimensions[i]; } } throw Util.newInternal( "Cannot find shared dimension '" + source + "'"); } // END pass-through code block ---
/** * Returns the name associated with an ordinal; the return value * is null if the ordinal is not a member of the enumeration. * * @pre isImmutable() */ public final V getValue(int ordinal) { Util.assertPrecondition(isImmutable()); return (V) ordinalToValueMap[ordinal - min]; }
/** * Returns the description associated with an ordinal; the return value * is null if the ordinal is not a member of the enumeration. * * @pre isImmutable() */ public final String getDescription(int ordinal) { Util.assertPrecondition(isImmutable()); final Value value = ordinalToValueMap[ordinal - min]; return (value == null) ? null : value.getDescription(); }
/** * Returns the name associated with an ordinal; the return value * is null if the ordinal is not a member of the enumeration. * * @pre isImmutable() */ public final String getName(int ordinal) { Util.assertPrecondition(isImmutable()); final Value value = ordinalToValueMap[ordinal - min]; return (value == null) ? null : value.getName(); }
/** * Associates a symbolic name with an ordinal value. * * @pre value != null * @pre !isImmutable() * @pre value.getName() != null */ public void register(V value) { assert value != null : "pre: value != null"; Util.assertPrecondition(!isImmutable(), "isImmutable()"); final String name = value.getName(); Util.assertPrecondition(name != null, "value.getName() != null"); Value old = valuesByName.put(name, value); if (old != null) { throw Util.newInternal( "Enumeration already contained a value '" + old.getName() + "'"); } final int ordinal = value.getOrdinal(); min = Math.min(min, ordinal); max = Math.max(max, ordinal); }
public Dimension getDimension(Schema schema) { Util.assertPrecondition(schema != null, "schema != null"); if (cubeName == null) { return schema.getPublicDimension(name); } else { Cube cube = schema.getCube(cubeName); return cube.getDimension(schema, name); } } // END pass-through code block ---
public Dimension getDimension(Schema schema) { Util.assertPrecondition(schema != null, "schema != null"); if (cubeName == null) { return schema.getPublicDimension(name); } else { Cube cube = schema.getCube(cubeName); return cube.getDimension(schema, name); } } // END pass-through code block ---
public int compareMembersHierarchically(Member m1, Member m2) { RolapMember member1 = (RolapMember) m1; RolapMember member2 = (RolapMember) m2; final RolapHierarchy hierarchy = member1.getHierarchy(); Util.assertPrecondition(hierarchy == m2.getHierarchy()); return getMemberReader(hierarchy).compare(member1, member2, true); }
public boolean canAccess(OlapElement olapElement) { Util.assertPrecondition(olapElement != null, "olapElement != null"); if (olapElement instanceof Member) { return getAccess((Member) olapElement) != Access.NONE; } else if (olapElement instanceof Level) { return getAccess((Level) olapElement) != Access.NONE; } else if (olapElement instanceof NamedSet) { return getAccess((NamedSet) olapElement) != Access.NONE; } else if (olapElement instanceof Hierarchy) { return getAccess((Hierarchy) olapElement) != Access.NONE; } else if (olapElement instanceof Cube) { return getAccess((Cube) olapElement) != Access.NONE; } else if (olapElement instanceof Dimension) { return getAccess((Dimension) olapElement) != Access.NONE; } else { return false; } }