mondrian.olap
Class EnumeratedValues.BasicValue
java.lang.Object
mondrian.olap.EnumeratedValues.BasicValue
- All Implemented Interfaces:
- EnumeratedValues.Value
- Direct Known Subclasses:
- Property, RolapAggregator
- Enclosing class:
- EnumeratedValues<V extends EnumeratedValues.Value>
public static class EnumeratedValues.BasicValue
- extends Object
- implements EnumeratedValues.Value
BasicValue is an obvious implementation of EnumeratedValues.Value.
name
public final String name
ordinal
public final int ordinal
description
public final String description
EnumeratedValues.BasicValue
public EnumeratedValues.BasicValue(String name,
int ordinal,
String description)
- Pre-condition:
- name != null
getName
public String getName()
- Specified by:
getName in interface EnumeratedValues.Value
getOrdinal
public int getOrdinal()
- Specified by:
getOrdinal in interface EnumeratedValues.Value
getDescription
public String getDescription()
- Specified by:
getDescription in interface EnumeratedValues.Value
toString
public String toString()
- Returns the value's name.
- Overrides:
toString in class Object
equals
public boolean equals(String s)
- Deprecated. I bet you meant to write
value.name_.equals(s) rather than
value.equals(s), didn't you?
- Returns whether this value is equal to a given string.
unexpected
public RuntimeException unexpected()
- Returns an error indicating that we did not expect to find this
value in this context. Typical use is in a
switch
statement:
switch (fruit) {
case Fruit.AppleORDINAL:
return 1;
case Fruir.OrangeORDINAL:
return 2;
default:
throw fruit.unexpected();
}