1 10 package mondrian.olap.type; 11 12 import mondrian.olap.Dimension; 13 import mondrian.olap.Hierarchy; 14 import mondrian.olap.Level; 15 16 23 public class SetType implements Type { 24 25 private final Type elementType; 26 27 33 public SetType(Type elementType) { 34 assert elementType instanceof MemberType || 35 elementType instanceof TupleType; 36 this.elementType = elementType; 37 } 38 39 42 public Type getElementType() { 43 return elementType; 44 } 45 46 public boolean usesDimension(Dimension dimension, boolean maybe) { 47 if (elementType == null) { 48 return maybe; 49 } 50 return elementType.usesDimension(dimension, maybe); 51 } 52 53 public Dimension getDimension() { 54 return elementType == null ? null : 55 elementType.getDimension(); 56 } 57 58 public Hierarchy getHierarchy() { 59 return elementType == null ? null : 60 elementType.getHierarchy(); 61 } 62 63 public Level getLevel() { 64 return elementType == null ? null : 65 elementType.getLevel(); 66 } 67 68 74 public int getArity() { 75 return elementType instanceof TupleType ? 76 ((TupleType) elementType).elementTypes.length : 77 1; 78 } 79 } 80 81 | Popular Tags |