Class PreferenceLevels

  • Direct Known Subclasses:
    EnumPreferenceLevels

    public abstract class PreferenceLevels
    extends java.lang.Object
    PreferenceLevel objects are typically grouped into application context groups. EnumPreferenceLevels is a factory for various groupings used in our framework. This abstract class generalizes the group operations without any dependence to any specific groupings. The convention of the array ordering is from the coarsest to finest level. In general, lookups will begin from a designated level, and if not found, will defer to its coarser parent level.
    Since:
    MicroStrategy Web 7.3.1 or earlier
    See Also:
    EnumPreferenceLevels
    • Method Detail

      • getLevels

        public final PreferenceLevel[] getLevels()
        Returns an array of the PreferenceLevel grouping. The order of this grouping is important - the convention adopted here treats those ordered earlier in the array as more generic, while those further up the array as more specific. This affects the organization of default values.
        Returns:
        The PreferenceLevel grouping
      • getRoot

        public PreferenceLevel getRoot()
        Returns the first PreferenceLevel object in the grouping.
      • getLast

        public PreferenceLevel getLast()
        Returns the last PreferenceLevel object in the grouping.
      • isOutOfScope

        public boolean isOutOfScope​(PreferenceLevel scopeBoundary,
                                    PreferenceLevel received)
                             throws java.lang.IllegalArgumentException
        This is to check to see if a received PreferenceLevel is within the scope of some defined PreferenceLevel boundary.
        Throws:
        java.lang.IllegalArgumentException
      • parse

        public PreferenceLevel parse​(java.lang.String label)
                              throws java.lang.IllegalArgumentException
        Returns the PreferenceLevel from a label.
        Parameters:
        label - Formal string description of the label.
        Returns:
        The PreferenceLevel.
        Throws:
        java.lang.IllegalArgumentException
      • decode

        public PreferenceLevel decode​(int i)
        Returns the PreferenceLevel at a given array position.
        Parameters:
        i - Index position.
        Returns:
        The PreferenceLevel.
      • indexOf

        public int indexOf​(PreferenceLevel lvl)
        Locates the position of the given PreferenceLevel in the PreferenceLevels array group.
        Parameters:
        lvl - The PreferenceLevel.
        Returns:
        The index position in the array (starting from 0).
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object