Search this API

y.option
Class OptionGroup

java.lang.Object
  extended by y.option.OptionGroup
All Implemented Interfaces:
AttributeOwner, PropertyChangeReporter

public class OptionGroup
extends java.lang.Object
implements AttributeOwner, PropertyChangeReporter

This class bundles a set of OptionItem objects.

 

Field Summary
static java.lang.String ATTRIBUTE_TITLE
          Attribute key used to store a title String.
 
Constructor Summary
OptionGroup()
          Creates a new OptionGroup instance.
 
Method Summary
 OptionItem addItem(OptionItem item)
          Adds an option item to this option group.
 void addPropertyChangeListener(java.beans.PropertyChangeListener pcl)
          Adds a PropertyChangeListener to the listener list.
 void addPropertyChangeListener(java.lang.String propertyname, java.beans.PropertyChangeListener pcl)
          Adds a PropertyChangeListener to the listener list for a specific property.
 boolean containsItem(OptionItem item)
          Returns true if this group contains the specified option item.
 java.lang.Object getAttribute(java.lang.String name)
          Returns the value of the attribute with the specified name.
 java.util.Iterator items()
          Returns a read-only iterator over all option items belonging to this option group.
 void removeAttribute(java.lang.String name)
          Removes the attribute with the specified name.
 void removeItem(OptionItem item)
          Removes an option item from this option group.
 void removePropertyChangeListener(java.beans.PropertyChangeListener pcl)
          Removes a PropertyChangeListener from the listener list.
 void removePropertyChangeListener(java.lang.String propertyname, java.beans.PropertyChangeListener pcl)
          Removes a PropertyChangeListener from the listener list for a specific property.
 void setAttribute(java.lang.String name, java.lang.Object value)
          Sets an arbitrary attribute with the specified name and value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ATTRIBUTE_TITLE

public static final java.lang.String ATTRIBUTE_TITLE
Attribute key used to store a title String.

See Also:
Constant Field Values
Constructor Detail

OptionGroup

public OptionGroup()
Creates a new OptionGroup instance.

Method Detail

addItem

public OptionItem addItem(OptionItem item)
Adds an option item to this option group.

Parameters:
item - the OptionItem to add
Returns:
the specified OptionItem

removeItem

public void removeItem(OptionItem item)
Removes an option item from this option group.

Parameters:
item - the OptionItem to remove

containsItem

public boolean containsItem(OptionItem item)
Returns true if this group contains the specified option item.

Parameters:
item - the OptionItem whose presence in this group is to be tested
Returns:
true if this group contains the specified option item

items

public java.util.Iterator items()
Returns a read-only iterator over all option items belonging to this option group. The items are returned in no particular order.

Returns:
a read-only Iterator over all option items belonging to this option group

getAttribute

public java.lang.Object getAttribute(java.lang.String name)
Returns the value of the attribute with the specified name.

Specified by:
getAttribute in interface AttributeOwner
Parameters:
name - the name of the attribute being queried
Returns:
the value of the attribute with the specified name
See Also:
setAttribute(String, Object)

removeAttribute

public void removeAttribute(java.lang.String name)
Removes the attribute with the specified name.
Removing an attribute is reported with PropertyChange events.

Specified by:
removeAttribute in interface AttributeOwner
Parameters:
name - the name of the attribute being removed
See Also:
setAttribute(String, Object)

setAttribute

public void setAttribute(java.lang.String name,
                         java.lang.Object value)
Sets an arbitrary attribute with the specified name and value.

If value is null, this method will remove the attribute.
Setting an attribute is reported with PropertyChange events.

Specified by:
setAttribute in interface AttributeOwner
Parameters:
name - the name of the attribute being added
value - the value of the attribute being added
See Also:
getAttribute(String), removeAttribute(String)

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener pcl)
Adds a PropertyChangeListener to the listener list. The listener is registered for all bound properties of this class.

If listener is null, no exception is thrown and no action is performed.

Specified by:
addPropertyChangeListener in interface PropertyChangeReporter
Parameters:
pcl - the PropertyChangeListener to be added
See Also:
removePropertyChangeListener(java.beans.PropertyChangeListener), addPropertyChangeListener(String,java.beans.PropertyChangeListener)

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener pcl)
Removes a PropertyChangeListener from the listener list. This method should be used to remove the PropertyChangeListeners that were registered for all bound properties of this class.

If listener is null, no exception is thrown and no action is performed.

Specified by:
removePropertyChangeListener in interface PropertyChangeReporter
Parameters:
pcl - the PropertyChangeListener to be removed
See Also:
addPropertyChangeListener(java.beans.PropertyChangeListener), removePropertyChangeListener(String,java.beans.PropertyChangeListener)

addPropertyChangeListener

public void addPropertyChangeListener(java.lang.String propertyname,
                                      java.beans.PropertyChangeListener pcl)
Adds a PropertyChangeListener to the listener list for a specific property.

If listener is null, no exception is thrown and no action is performed.

Specified by:
addPropertyChangeListener in interface PropertyChangeReporter
Parameters:
propertyname - the name of the property to receive change notifications for
pcl - the PropertyChangeListener to be added
See Also:
addPropertyChangeListener(java.beans.PropertyChangeListener), removePropertyChangeListener(String,java.beans.PropertyChangeListener)

removePropertyChangeListener

public void removePropertyChangeListener(java.lang.String propertyname,
                                         java.beans.PropertyChangeListener pcl)
Removes a PropertyChangeListener from the listener list for a specific property. This method should be used to remove PropertyChangeListeners that were registered for a specific property.

If listener is null, no exception is thrown and no action is performed.

Specified by:
removePropertyChangeListener in interface PropertyChangeReporter
Parameters:
propertyname - a valid property name
pcl - the PropertyChangeListener to be removed
See Also:
addPropertyChangeListener(String,java.beans.PropertyChangeListener), removePropertyChangeListener(java.beans.PropertyChangeListener)

© Copyright 2000-2022,
yWorks GmbH.
All rights reserved.