|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.mindtree.techworks.insight.preferences.model.Preference
public class Preference
This class stores a list of Preference attributes. It has a unique identifier and name. No preference attribute can exist without a preference.
PreferenceAttribute,
Serialized Form| Field Summary | |
|---|---|
static java.lang.String |
ID_SEPERATOR
Seperator between the IDs of parent and child Preferences |
| Constructor Summary | |
|---|---|
Preference(java.lang.String id,
boolean isUserModifiable,
boolean isAggregated)
Constructor which sets the fields. |
|
Preference(java.lang.String id,
boolean isUserModifiable,
boolean isAggregated,
java.lang.String name)
Utility constructor which sets the display name also |
|
| Method Summary | |
|---|---|
boolean |
addChildPreference(Preference preference)
Adds a child preference to this preference |
boolean |
addPreferenceAttribute(PreferenceAttribute preferenceAttribute)
Adds a preferenceAttribute to the Preference. |
boolean |
deregisterPreferenceModelManager(PreferenceModelManager manager)
Deregisters the manager from this preference. |
java.lang.String |
getCompleteId()
Returns the complete Id of the preference, including the parent's id. |
java.lang.String |
getDisplayClass()
|
java.lang.String |
getId()
|
java.lang.String |
getName()
|
PreferenceAttribute |
getPreferenceAttributeById(java.lang.String attributeId)
Returns a PreferenceAttribute for the id specified. |
Preference |
getPreferenceById(java.lang.String preferenceId)
Returns a child preference for the Id passed |
PreferenceInfo |
getPreferenceInfo()
Constructs and returns a PreferenceInfo object for this instance. |
boolean |
isAggregated()
|
boolean |
isPreferenceAttributePresent(java.lang.String attributeId)
Checks if the preference has an attribute with the attribute id. |
boolean |
isPreferencePresent(java.lang.String preferenceId)
Checks if the Preference with the id specified is a child of this preference. |
boolean |
isUserModifiable()
|
java.util.Iterator |
iterateChildPreferenceIds()
Returns an iterator to the child Preference ids. |
java.util.Iterator |
iterateChildPreferences()
Returns an iterator to the child Preferences. |
java.util.Iterator |
iteratePreferenceAttributeIds()
Returns an iterator for the ids of all the Preference Attribtues in this Preference. |
java.util.Iterator |
iteratePreferenceAttributes()
Returns an iterator for all the Preference Attributes. |
boolean |
registerPreferenceModelManager(PreferenceModelManager manager)
Registers the manager for this preference. |
boolean |
removePreference(Preference preference)
Removes a child preference |
boolean |
removePreferenceAttribute(PreferenceAttribute preferenceAttribute)
Removes a preference attribute from this preference |
void |
setDisplayClass(java.lang.String displayClass)
|
void |
setName(java.lang.String name)
|
protected void |
setParent(Preference parentPreference)
Sets the parent preference of this preference |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String ID_SEPERATOR
| Constructor Detail |
|---|
public Preference(java.lang.String id,
boolean isUserModifiable,
boolean isAggregated)
id - The unique identifier for the PreferenceisUserModifiable - s the preference user modifiableisAggregated - If this is an aggregated preference.
public Preference(java.lang.String id,
boolean isUserModifiable,
boolean isAggregated,
java.lang.String name)
id - The unique identifier for the PreferenceisUserModifiable - s the preference user modifiableisAggregated - If this is an aggregated preference.name - The display name of the Preference| Method Detail |
|---|
public boolean isAggregated()
public java.lang.String getId()
public java.lang.String getCompleteId()
PARENTID_CHILDID
Seperator between two IDspublic boolean isUserModifiable()
public java.lang.String getName()
public boolean addPreferenceAttribute(PreferenceAttribute preferenceAttribute)
preferenceAttribute - The PreferenceAttribute to add.
true if the addition is succesfull or
falsepublic boolean registerPreferenceModelManager(PreferenceModelManager manager)
manager - The preferenceModelManager to set.
true if the registration succeeds or
falsepublic boolean deregisterPreferenceModelManager(PreferenceModelManager manager)
manager - The manager to deregister
true if the deregistration succeeds or
falsepublic PreferenceAttribute getPreferenceAttributeById(java.lang.String attributeId)
attributeId - The id of the attribute
java.lang.ArrayIndexOutOfBoundsException - If the id is not found.public boolean isPreferenceAttributePresent(java.lang.String attributeId)
attributeId - The id to check
true if the attribute is present or
falsepublic java.util.Iterator iteratePreferenceAttributes()
Iterator for all the Preference Attribtues.public java.util.Iterator iteratePreferenceAttributeIds()
Iterator for all the Preference Attribute Keys.public Preference getPreferenceById(java.lang.String preferenceId)
preferenceId - The id of the preference required.
java.lang.ArrayIndexOutOfBoundsException - If the Preference for the id
passed is not present.public boolean isPreferencePresent(java.lang.String preferenceId)
preferenceId - The id of the child preference to check.
true if the preference is present or
falsepublic java.util.Iterator iterateChildPreferences()
null if
none are present.public java.util.Iterator iterateChildPreferenceIds()
null if
none are present.public PreferenceInfo getPreferenceInfo()
PreferenceInfopublic java.lang.String getDisplayClass()
public void setDisplayClass(java.lang.String displayClass)
displayClass - The displayClass to set.protected void setParent(Preference parentPreference)
parentPreference - Parent preferencepublic boolean addChildPreference(Preference preference)
preference - The preference to add
true If preference is added successfully or
falsepublic boolean removePreference(Preference preference)
preference - The preference to remove
true if remove succeeds or false.public boolean removePreferenceAttribute(PreferenceAttribute preferenceAttribute)
preferenceAttribute - The preferenceAttribute to remove
true if the removal succeeds or false.public void setName(java.lang.String name)
name - The name to set.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||