com.sas.entities
Class AttributeGroup

com.sas.entities.AttributeGroup
All Implemented Interfaces:
AttributeGroupInterface, BaseAttributeDescriptorInterface, com.sas.RemoteObjectInterface, java.io.Serializable, java.rmi.Remote

public class AttributeGroup
implements AttributeGroupInterface

An implementation of AttributeGroupInterface.

See Also:
Serialized Form

Field Summary
static int LAST_POSITION
          Indicates that the AttributeDescriptor/AttributeGroup to be added should be added at the end of the list
 
Constructor Summary
AttributeGroup()
          Default constructor
AttributeGroup(RemoteEntityInterface entity)
          Constructs an instance of AttributeGroup.
AttributeGroup(RemoteEntityInterface entity, java.util.Map entityStaticProperties)
          Constructs an instance of AttributeGroup.
AttributeGroup(RemoteEntityInterface entity, java.util.Map entityStaticProperties, AttributeTypeFactoryInterface atfi)
          Constructs an instance of AttributeGroup.
AttributeGroup(RemoteEntityInterface entity, java.util.Map entityStaticProperties, AttributeTypeFactoryInterface atfi, java.util.Map supplementalProperties)
          Constructs an instance of AttributeGroup.
AttributeGroup(RemoteEntityInterface entity, java.util.Map entityStaticProperties, java.util.Map supplementalProperties)
          Constructs an instance of AttributeGroup.
AttributeGroup(java.lang.String name)
          Constructs an instance of AttributeGroup with the given name.
 
Method Summary
 void addAttributeDescriptor(AttributeDescriptorInterface attribute, int index)
          Add an AttributeDescriptor to this AttributeGroup.
 void addAttributeDescriptor(AttributeDescriptorInterface attribute, int index, boolean replace)
          Add an AttributeDescriptor to this AttributeGroup.
 void addAttributeDescriptors(AttributeDescriptorInterface[] newAttributes)
          Add a set of AttributeDescriptors to this AttributeGroup.
 void addAttributeDescriptors(AttributeDescriptorInterface[] newAttributes, boolean replace)
          Add a set of AttributeDescriptors to this AttributeGroup.
 void addAttributeGroup(AttributeGroupInterface group, int index)
          Add a subgroup to this AttributeGroup.
 void addAttributeGroup(AttributeGroupInterface group, int index, boolean replace)
          Add subgroups to this AttributeGroup.
 void addAttributeGroups(AttributeGroupInterface[] groups)
          Add subgroups to this AttributeGroup.
 void addAttributeGroups(AttributeGroupInterface[] groups, boolean replace)
          Add subgroups to this AttributeGroup.
 boolean containsAttributeDescriptorNamed(java.lang.String attributeName, boolean recursive)
          Determine if this AttributeGroup contains a value with the name attributeName.
 int count(boolean recursive)
          Return the number of AttributeDescriptors in this AttributeGroup.
 AttributeDescriptorInterface getAttributeDescriptor(java.lang.String attributeName, boolean recursive)
          Return the AttributeDescriptor corresponding to attributeName.
 java.lang.String[] getAttributeDescriptorNames(boolean recursive)
          Return a list of AttributeDescriptor names for AttributeDescriptors organized into this AttributeGroup.
 AttributeDescriptorInterface[] getAttributeDescriptors(boolean recursive)
          Returns an array of AttributeDescriptors which are in this AttributeGroup.
 AttributeGroupInterface getAttributeGroup(java.lang.String groupName)
          Return the subgroup corresponding to groupName.
 java.lang.String[] getAttributeGroupNames()
          Returns an array of the names of the subgroups.
 AttributeGroupInterface[] getAttributeGroups()
          Returns an array of subgroups nested within this AttributeGroup.
 boolean isExpert()
          Returns true if the AttributeGroup is classified as expert.
 boolean isModifiable()
          Returns true if the AttributeGroup is modifiable.
 boolean isVisible()
          Returns true if the AttributeGroup is visible.
 boolean removeAttributeDescriptor(java.lang.String attributeName, boolean recursive)
          Remove an AttributeDescriptor from this AttributeGroup.
 java.lang.String[] removeAttributeDescriptors(java.lang.String[] attributeNames, boolean recursive)
          Remove all the AttributeDescriptors included in the input array, attributeNames, from this AttributeGroup.
 AttributeDescriptorInterface[] removeAttributeGroup(java.lang.String groupName)
          Remove the subgroup corresponding to groupName.
 AttributeDescriptorInterface[] removeAttributeGroups(java.lang.String[] groupNames)
          Remove the subgroups corresponding to the group names in the input array, groupsNames.
 void setAttributeDescriptor(AttributeDescriptorInterface attribute)
          Replace an AttributeDescriptor in this AttributeGroup.
 void setAttributeDescriptors(AttributeDescriptorInterface[] attributes)
          Replace a set of AttributeDescriptors in this AttributeGroup.
 void setExpert(boolean expert)
          Sets the expert state.
 void setModifiable(boolean modifiable)
          Sets whether the AttributeGroup is modifiable.
 void setVisible(boolean visible)
          Sets whether the AttributeGroup should be visible.
 
Methods inherited from class com.sas.entities.BaseAttributeDescriptor
getAttributeCustomizerContexts, getAttributeCustomizers, getConfigurationXML, getCustomizer, getDescription, getDescriptions, getLabel, getLabels, getLargeIconURL, getLargeIconURLs, getName, getSmallIconURL, getSmallIconURLs, setConfigurationXML, setCustomizer, setDescription, setLabel, setLargeIconURL, setName, setSmallIconURL
 
Methods inherited from interface com.sas.entities.BaseAttributeDescriptorInterface
getAttributeCustomizerContexts, getAttributeCustomizers, getConfigurationXML, getCustomizer, getDescription, getDescriptions, getLabel, getLabels, getLargeIconURL, getLargeIconURLs, getName, getSmallIconURL, getSmallIconURLs, setConfigurationXML, setCustomizer, setDescription, setLabel, setLargeIconURL, setName, setSmallIconURL
 

Field Detail

LAST_POSITION

public static final int LAST_POSITION
Indicates that the AttributeDescriptor/AttributeGroup to be added should be added at the end of the list

See Also:
Constant Field Values
Constructor Detail

AttributeGroup

public AttributeGroup()
Default constructor


AttributeGroup

public AttributeGroup(java.lang.String name)
Constructs an instance of AttributeGroup with the given name.

Parameters:
name - name associated with the AttributeGroup

AttributeGroup

public AttributeGroup(RemoteEntityInterface entity)
Constructs an instance of AttributeGroup. Creates AttributeDescriptors for all of the static (type-based) attributes of the specified Entity.

Parameters:
entity - instance of RemoteEntityInterface

AttributeGroup

public AttributeGroup(RemoteEntityInterface entity,
                      java.util.Map entityStaticProperties,
                      AttributeTypeFactoryInterface atfi)
Constructs an instance of AttributeGroup. Creates AttributeDescriptors for all of the attributes in the specified map using the specified instance of AttributeTypeFactoryInterface.

Parameters:
entity - instance of RemoteEntityInterface
entityStaticProperties - name/value pair (attribute name/attribute value)
atfi - instance of AttributeTypeFactoryInterface

AttributeGroup

public AttributeGroup(RemoteEntityInterface entity,
                      java.util.Map entityStaticProperties,
                      AttributeTypeFactoryInterface atfi,
                      java.util.Map supplementalProperties)
Constructs an instance of AttributeGroup. Creates AttributeDescriptors for all of the attributes in the specified map using the specified instance of AttributeTypeFactoryInterface.

Parameters:
entity - instance of RemoteEntityInterface
entityStaticProperties - name/value pair (attribute name/attribute value)
atfi - instance of AttributeTypeFactoryInterface

AttributeGroup

public AttributeGroup(RemoteEntityInterface entity,
                      java.util.Map entityStaticProperties)
Constructs an instance of AttributeGroup. Creates AttributeDescriptors for all of the attributes in the specified map.

Parameters:
entity - instance of RemoteEntityInterface
entityStaticProperties - name/value pair (attribute name/attribute value)

AttributeGroup

public AttributeGroup(RemoteEntityInterface entity,
                      java.util.Map entityStaticProperties,
                      java.util.Map supplementalProperties)
Constructs an instance of AttributeGroup. Creates AttributeDescriptors for all of the attributes in the specified map.

Parameters:
entity - instance of RemoteEntityInterface
entityStaticProperties - name/value pair (attribute name/attribute value)
Method Detail

addAttributeDescriptor

public void addAttributeDescriptor(AttributeDescriptorInterface attribute,
                                   int index)
Description copied from interface: AttributeGroupInterface
Add an AttributeDescriptor to this AttributeGroup.

Specified by:
addAttributeDescriptor in interface AttributeGroupInterface
Parameters:
attribute - the AttributeDescriptor to add to the AttributeGroup
index - position to add the AttributeDescriptor (index of -1 indicates add to the end)
See Also:
AttributeGroupInterface.addAttributeDescriptor(AttributeDescriptorInterface attribute, int index, boolean replace)

addAttributeDescriptor

public void addAttributeDescriptor(AttributeDescriptorInterface attribute,
                                   int index,
                                   boolean replace)
Add an AttributeDescriptor to this AttributeGroup.

Specified by:
addAttributeDescriptor in interface AttributeGroupInterface
Parameters:
attribute - the AttributeDescriptor to add to the AttributeGroup
index - position to add the AttributeDescriptor (index of -1 indicates add to the end)
replace - indicates whether to replace an AttributeDescriptor if a duplicate name is detected. The default value is true. If set to false, this method throws an IllegalArgumentException if a duplicate name is detected.
Throws:
java.lang.IllegalArgumentException - if the AttributeDescriptor already exists and the replace parameter is false
java.lang.IndexOutOfBoundsException - if the index is invalid

addAttributeDescriptors

public void addAttributeDescriptors(AttributeDescriptorInterface[] newAttributes)
Add a set of AttributeDescriptors to this AttributeGroup. Each AttributeDescriptor must have a unique name within this AttributeGroup and its subgroups. An AttributeDescriptor will be replaced if it is detected as a duplicate (by name).

Specified by:
addAttributeDescriptors in interface AttributeGroupInterface
Parameters:
newAttributes - the array of AttributeDescriptors to add to the AttributeGroup.

addAttributeDescriptors

public void addAttributeDescriptors(AttributeDescriptorInterface[] newAttributes,
                                    boolean replace)
Add a set of AttributeDescriptors to this AttributeGroup. Each AttributeDescriptor must have a unique name within this AttributeGroup and its subgroups.

Specified by:
addAttributeDescriptors in interface AttributeGroupInterface
Parameters:
newAttributes - the array of AttributeDescriptors to add to the AttributeGroup.
replace - indicates whether to replace an AttributeDescriptor if a duplicate name is detected. The default value is true. If set to false, this method throws an IllegalArgumentException if a duplicate name is detected.
Throws:
java.lang.IllegalArgumentException - if any of the AttributeDescriptors already exists and the replace parameter is false

addAttributeGroup

public void addAttributeGroup(AttributeGroupInterface group,
                              int index)
Description copied from interface: AttributeGroupInterface
Add a subgroup to this AttributeGroup.

Specified by:
addAttributeGroup in interface AttributeGroupInterface
Parameters:
group - a new AttributeGroup to add
index - position to add the AttributeGroup (index of -1 indicates add to the end)
See Also:
AttributeGroupInterface.addAttributeGroup(AttributeGroupInterface group, int index, boolean replace)

addAttributeGroup

public void addAttributeGroup(AttributeGroupInterface group,
                              int index,
                              boolean replace)
Add subgroups to this AttributeGroup.

Specified by:
addAttributeGroup in interface AttributeGroupInterface
Parameters:
groups - an array of new AttributeGroups to add
replace - indicates whether to replace a subgroup if a duplicate name is detected. The default value is true. If set to false, this method throws an IllegalArgumentException if a duplicate name is detected.
Throws:
java.lang.IllegalArgumentException - if the group already exists and the replace parameter is false

addAttributeGroups

public void addAttributeGroups(AttributeGroupInterface[] groups)
Description copied from interface: AttributeGroupInterface
Add subgroups to this AttributeGroup.

Specified by:
addAttributeGroups in interface AttributeGroupInterface
Parameters:
groups - an array of new AttributeGroups to add
See Also:
AttributeGroupInterface.addAttributeGroups(AttributeGroupInterface[], boolean replace)

addAttributeGroups

public void addAttributeGroups(AttributeGroupInterface[] groups,
                               boolean replace)
Description copied from interface: AttributeGroupInterface
Add subgroups to this AttributeGroup.

Specified by:
addAttributeGroups in interface AttributeGroupInterface
Parameters:
groups - an array of new AttributeGroups to add
replace - indicates whether to replace a subgroup if a duplicate name is detected. If set to false, this method throws an IllegalArgumentException if a duplicate name is detected.

containsAttributeDescriptorNamed

public boolean containsAttributeDescriptorNamed(java.lang.String attributeName,
                                                boolean recursive)
Description copied from interface: AttributeGroupInterface
Determine if this AttributeGroup contains a value with the name attributeName.

Specified by:
containsAttributeDescriptorNamed in interface AttributeGroupInterface
Parameters:
attributeName - the name of the attribute
recursive - if true, search the subgroups of this AttributeGroup
Returns:
true if this AttributeGroup (or subgroups if recursive is true) contains the AttributeDescriptor

count

public int count(boolean recursive)
Description copied from interface: AttributeGroupInterface
Return the number of AttributeDescriptors in this AttributeGroup.

Specified by:
count in interface AttributeGroupInterface
Parameters:
recursive - if true, count the AttributeDescriptors from any subgroups of this AttributeGroup
Returns:
the number of AttributesDescriptors in this AttributeGroup (and its subgroups, if recursive is true)

getAttributeDescriptor

public AttributeDescriptorInterface getAttributeDescriptor(java.lang.String attributeName,
                                                           boolean recursive)
Description copied from interface: AttributeGroupInterface
Return the AttributeDescriptor corresponding to attributeName.

Specified by:
getAttributeDescriptor in interface AttributeGroupInterface
Parameters:
attributeName - the name of the AttributeDescriptor
recursive - If true, will search all subgroups for the AttributeDescriptor
Returns:
the AttributeDescriptor with the specified name or null if not found

getAttributeDescriptorNames

public java.lang.String[] getAttributeDescriptorNames(boolean recursive)
Description copied from interface: AttributeGroupInterface
Return a list of AttributeDescriptor names for AttributeDescriptors organized into this AttributeGroup.

Specified by:
getAttributeDescriptorNames in interface AttributeGroupInterface
Parameters:
recursive - if true, return AttributeDescriptor names from this AttributeGroup and its subgroups. If false, this method only returns the AttributeDescriptor names that are in this AttributeGroup.
Returns:
the list of AttributeDescriptor names in this AttributeGroup (or subgroups if recursive is true)

getAttributeDescriptors

public AttributeDescriptorInterface[] getAttributeDescriptors(boolean recursive)
Description copied from interface: AttributeGroupInterface
Returns an array of AttributeDescriptors which are in this AttributeGroup.

Specified by:
getAttributeDescriptors in interface AttributeGroupInterface
Parameters:
recursive - if true, return AttributeDescriptors in this AttributeGroup and its subgroups. If false, this method only returns the AttributeDescriptor names that are in this AttributeGroup.
Returns:
the list of AttributeDescriptors in this AttributeGroup (or subgroups if recursive is true)

getAttributeGroup

public AttributeGroupInterface getAttributeGroup(java.lang.String groupName)
Description copied from interface: AttributeGroupInterface
Return the subgroup corresponding to groupName.

Specified by:
getAttributeGroup in interface AttributeGroupInterface
Parameters:
groupName - the name of the AttributeGroup
Returns:
the subgroup with the specified name

getAttributeGroupNames

public java.lang.String[] getAttributeGroupNames()
Description copied from interface: AttributeGroupInterface
Returns an array of the names of the subgroups.

Specified by:
getAttributeGroupNames in interface AttributeGroupInterface

getAttributeGroups

public AttributeGroupInterface[] getAttributeGroups()
Description copied from interface: AttributeGroupInterface
Returns an array of subgroups nested within this AttributeGroup.

Specified by:
getAttributeGroups in interface AttributeGroupInterface
Returns:
subgroups of this AttributeGroup

isExpert

public boolean isExpert()
Description copied from interface: AttributeGroupInterface
Returns true if the AttributeGroup is classified as expert. If true, all AttributeDescriptors that are a part of the AttributeGroup will behave as though their expert state had been set to the AttributeGroup's state. Under normal use, UI (User Interface) components do not display expert attributes, although they may provide a mechanism to enable the display and editing of expert AttributeGroups and AttributeDescriptors.

Specified by:
isExpert in interface AttributeGroupInterface
Returns:
true if expert; false otherwise
See Also:
AttributeGroupInterface.setExpert(boolean expert)

isModifiable

public boolean isModifiable()
Description copied from interface: AttributeGroupInterface
Returns true if the AttributeGroup is modifiable. If false, UI (User Interface) components can display the AttributeGroup and its AttributeDescriptors but should not allow them to be modified.

Specified by:
isModifiable in interface AttributeGroupInterface
Returns:
true if modifiable; false otherwise
See Also:
AttributeGroupInterface.setModifiable(boolean modifiable)

isVisible

public boolean isVisible()
Description copied from interface: AttributeGroupInterface
Returns true if the AttributeGroup is visible. If false, UI (User Interface) components should not display the AttributeGroup and its AttributesDescriptors.

Specified by:
isVisible in interface AttributeGroupInterface
Returns:
true if visible, false otherwise
See Also:
AttributeGroupInterface.setVisible(boolean visible)

removeAttributeDescriptor

public boolean removeAttributeDescriptor(java.lang.String attributeName,
                                         boolean recursive)
Description copied from interface: AttributeGroupInterface
Remove an AttributeDescriptor from this AttributeGroup. Not all AttributeDescriptors may be removed; this method only addresses instance-based attributes.

Specified by:
removeAttributeDescriptor in interface AttributeGroupInterface
Parameters:
attributeName - name of the AttributeDescriptor
recursive - if true, try to remove the AttributeDescriptor from any subgroups if the AttributeDescriptor is not found in this AttributeGroup
Returns:
false if the AttributeDescriptor is not found in this AttributeGroup (or its subgroups, if recursive is true)

removeAttributeDescriptors

public java.lang.String[] removeAttributeDescriptors(java.lang.String[] attributeNames,
                                                     boolean recursive)
Description copied from interface: AttributeGroupInterface
Remove all the AttributeDescriptors included in the input array, attributeNames, from this AttributeGroup. Not all AttributeDescriptors may be removed; this method only addresses instance-based attributes.

Specified by:
removeAttributeDescriptors in interface AttributeGroupInterface
Parameters:
attributeNames - an array of AttributeDescriptor names to remove from the group (and its subgroups, if recursive is true)
recursive - if true, any AttributeDescriptors listed in this set are removed from the nested subgroups
Returns:
an array containing the names of the AttributeDescriptors which were removed from this AttributeGroup (and its subgroups, if recursive is true)

removeAttributeGroup

public AttributeDescriptorInterface[] removeAttributeGroup(java.lang.String groupName)
Description copied from interface: AttributeGroupInterface
Remove the subgroup corresponding to groupName.

Specified by:
removeAttributeGroup in interface AttributeGroupInterface
Parameters:
groupName - the name of the AttributeGroup to remove
Returns:
array of AttributeDescriptors that were removed from the AttributeGroup and its subgroups

removeAttributeGroups

public AttributeDescriptorInterface[] removeAttributeGroups(java.lang.String[] groupNames)
Description copied from interface: AttributeGroupInterface
Remove the subgroups corresponding to the group names in the input array, groupsNames.

Specified by:
removeAttributeGroups in interface AttributeGroupInterface
Parameters:
groupNames - an array of AttributeGroup names to remove from this AttributeGroup
Returns:
array of AttributeDescriptors that were removed from the AttributeGroup and its subgroups
See Also:
AttributeGroupInterface.removeAttributeGroup(String)

setAttributeDescriptor

public void setAttributeDescriptor(AttributeDescriptorInterface attribute)
                            throws java.lang.IllegalArgumentException
Description copied from interface: AttributeGroupInterface
Replace an AttributeDescriptor in this AttributeGroup.

Specified by:
setAttributeDescriptor in interface AttributeGroupInterface
Parameters:
attribute - the AttributeDescriptor to replace in the AttributeGroup.
Throws:
java.lang.IllegalArgumentException - if the AttributeDescriptor already exists

setAttributeDescriptors

public void setAttributeDescriptors(AttributeDescriptorInterface[] attributes)
                             throws java.lang.IllegalArgumentException
Description copied from interface: AttributeGroupInterface
Replace a set of AttributeDescriptors in this AttributeGroup.

Specified by:
setAttributeDescriptors in interface AttributeGroupInterface
Parameters:
attributes - the array of AttributeDescriptors to replace
Throws:
java.lang.IllegalArgumentException - if any of the AttributeDescriptors already exist

setExpert

public void setExpert(boolean expert)
Description copied from interface: AttributeGroupInterface
Sets the expert state.

Specified by:
setExpert in interface AttributeGroupInterface
Parameters:
expert - a boolean value If true, under normal circumstances, UI (User Interface) components will not display this AttributeGroup and its AttributeDescriptors.
See Also:
AttributeGroupInterface.isExpert()

setModifiable

public void setModifiable(boolean modifiable)
Description copied from interface: AttributeGroupInterface
Sets whether the AttributeGroup is modifiable.

Specified by:
setModifiable in interface AttributeGroupInterface
Parameters:
modifiable - a boolean value. If false, UI (User Interface) components can display the AttributeGroup and its AttributeDescriptors but should not allow them to be modified.
See Also:
AttributeGroupInterface.isModifiable()

setVisible

public void setVisible(boolean visible)
Description copied from interface: AttributeGroupInterface
Sets whether the AttributeGroup should be visible.

Specified by:
setVisible in interface AttributeGroupInterface
Parameters:
visible - a boolean value. If false, the AttributeGroup and its AttributeDescriptors should not be displayed in UI (User Interface) components.
See Also:
AttributeGroupInterface.isVisible()



Copyright © 2009 SAS Institute Inc. All Rights Reserved.