Class PreferenceLevels
- java.lang.Object
-
- com.microstrategy.web.preferences.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
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
PreferenceLevels(PreferenceLevel[] levels)
Constructor for PreferenceLevels.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PreferenceLevel
decode(int i)
Returns the PreferenceLevel at a given array position.PreferenceLevel
getChild(PreferenceLevel lvl)
PreferenceLevel
getLast()
Returns the last PreferenceLevel object in the grouping.PreferenceLevel[]
getLevels()
Returns an array of the PreferenceLevel grouping.PreferenceLevel
getParent(PreferenceLevel lvl)
PreferenceLevel
getRoot()
Returns the first PreferenceLevel object in the grouping.int
indexOf(PreferenceLevel lvl)
Locates the position of the given PreferenceLevel in the PreferenceLevels array group.boolean
isOutOfScope(PreferenceLevel scopeBoundary, PreferenceLevel received)
This is to check to see if a received PreferenceLevel is within the scope of some defined PreferenceLevel boundary.PreferenceLevel
parse(java.lang.String label)
Returns the PreferenceLevel from a label.java.lang.String
toString()
-
-
-
Constructor Detail
-
PreferenceLevels
protected PreferenceLevels(PreferenceLevel[] levels) throws MSTRUncheckedException
Constructor for PreferenceLevels.- Throws:
MSTRUncheckedException
-
-
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.
-
getParent
public PreferenceLevel getParent(PreferenceLevel lvl)
- Since:
- MicroStrategy Web 8.0.0
-
getChild
public PreferenceLevel getChild(PreferenceLevel lvl)
- Since:
- MicroStrategy Web 8.0.0
-
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 classjava.lang.Object
-
-