Package mondrian.olap

Class EnumeratedValues.BasicValue

    • Field Summary

      Fields 
      Modifier and Type Field Description
      java.lang.String description  
      java.lang.String name  
      int ordinal  
    • Constructor Summary

      Constructors 
      Constructor Description
      BasicValue​(java.lang.String name, int ordinal, java.lang.String description)  
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.String s)
      Deprecated.
      I bet you meant to write value.name_.equals(s) rather than value.equals(s), didn't you?
      java.lang.String getDescription()  
      java.lang.String getName()  
      int getOrdinal()  
      java.lang.String toString()
      Returns the value's name.
      java.lang.RuntimeException unexpected()
      Returns an error indicating that we did not expect to find this value in this context.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • name

        public final java.lang.String name
      • ordinal

        public final int ordinal
      • description

        public final java.lang.String description
    • Constructor Detail

      • BasicValue

        public BasicValue​(java.lang.String name,
                          int ordinal,
                          java.lang.String description)
        Pre-condition:
        name != null
    • Method Detail

      • toString

        public java.lang.String toString()
        Returns the value's name.
        Overrides:
        toString in class java.lang.Object
      • equals

        public boolean equals​(java.lang.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 java.lang.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();
         }