All Packages Class Hierarchy This Package Previous Next Index
Class com.ibm.beans.tools.dip.ClassNameModel
java.lang.Object
|
+----com.ibm.beans.tools.dip.ClassNameModel
- public class ClassNameModel
- extends Object
- implements Serializable, Model
This class contains the function for manipulating a collection of
class names.
-
MODEL_ADD
-
-
MODEL_CHANGE
-
-
MODEL_REMOVE
-
-
ClassNameModel()
- Constructs a ClassNameModel that is initially empty.
-
ClassNameModel(ClassNameModel)
- Constructs a ClassNameModel instance from an existing ClassNameModel
instance.
-
ClassNameModel(Vector)
- Constructs a ClassNameModel object containing the specified class names.
-
add(Object)
- Ensures that this Collection contains the specified element.
-
addAll(Vector)
-
Adds all of the elements in the specified collection to this
collection, in the order they are returned by the specified
collection's iterator.
-
addModelChangeListener(ModelChangeListener)
- Adds a model change listener to the list of listeners.
-
contains(Object)
- Indicates whether the model contains the specified element.
-
elements()
- Gets an enumeration of the elements in the collection.
-
equals(Object)
- Tests for equality with the passed object.
-
fireModelChangeEvent(ModelEvent, int)
- Propagates a ModelEvent to registered model change listeners.
-
hashCode()
- Gets a hash code for an instance of this class.
-
isEmpty()
- Indicates whether the model contains no elements.
-
remove(Object)
- Removes a single instance of the specified element from the model,
if it is present.
-
removeModelChangeListener(ModelChangeListener)
- Removes a model change listener from the list of listeners.
-
size()
- Returns the number of elements in the model.
MODEL_ADD
protected static final int MODEL_ADD
MODEL_REMOVE
protected static final int MODEL_REMOVE
MODEL_CHANGE
protected static final int MODEL_CHANGE
ClassNameModel
public ClassNameModel()
- Constructs a ClassNameModel that is initially empty.
ClassNameModel
public ClassNameModel(Vector classes)
- Constructs a ClassNameModel object containing the specified class names.
- Parameters:
- classes - The initial set of class names to be
contained in the model.
ClassNameModel
public ClassNameModel(ClassNameModel model)
- Constructs a ClassNameModel instance from an existing ClassNameModel
instance. The new and old ClassNameModel objects will share the
same class names.
Listeners of the input model are not copied to the new model.
If the input model reference is null, a NullPointerException is thrown.
- Parameters:
- model - The ClassNameModel instance to be copied.
equals
public boolean equals(Object obj)
- Tests for equality with the passed object.
Two models are equal only if the Vectors containing the class names and
the listeners are all the same.
- Returns:
- true if the passed object is equivalent to the
called object; false otherwise.
- Overrides:
- equals in class Object
hashCode
public int hashCode()
- Gets a hash code for an instance of this class.
- Returns:
- The hash value.
- Overrides:
- hashCode in class Object
addModelChangeListener
public void addModelChangeListener(ModelChangeListener l)
- Adds a model change listener to the list of listeners.
- Parameters:
- l - The listener to add.
- See Also:
- ModelChangeListener
removeModelChangeListener
public void removeModelChangeListener(ModelChangeListener l)
- Removes a model change listener from the list of listeners.
- Parameters:
- l - The listener to remove.
- See Also:
- ModelChangeListener
fireModelChangeEvent
protected void fireModelChangeEvent(ModelEvent e,
int listenerMethod)
- Propagates a ModelEvent to registered model change listeners.
- Parameters:
- e - The event to propagate.
- listenerMethod - The listener method to which the event
is dispatched. This value must be
one of MODEL_ADD, MODEL_REMOVE, or MODEL_CHANGE.
add
public void add(Object o) throws NullPointerException, ClassCastException
- Ensures that this Collection contains the specified element.
The specified object must be a String and must not be null.
- Parameters:
- o - The String whose presence in the model is to be ensured.
- Throws: NullPointerException
- Thrown when the specified
object to be added is null.
- Throws: ClassCastException
- Thrown when the specified object
is not a String.
size
public int size()
- Returns the number of elements in the model.
- Returns:
- The number of elements in the model.
isEmpty
public boolean isEmpty()
- Indicates whether the model contains no elements.
- Returns:
- true if the model is empty, false otherwise.
contains
public boolean contains(Object o)
- Indicates whether the model contains the specified element.
- Parameters:
- o - The element whose presence in the model is to be tested.
- Returns:
- true if and only if the model contains at
least one element e such that e.equals(o); false otherwise.
remove
public boolean remove(Object o)
- Removes a single instance of the specified element from the model,
if it is present. More formally, removes an element e such that
e.equals(o), if the model contains one or more such elements.
- Parameters:
- o - The object to be removed from the model, if present.
- Returns:
- true if the model contained the specified
element, false otherwise.
addAll
public void addAll(Vector v) throws NullPointerException, ClassCastException
- Adds all of the elements in the specified collection to this
collection, in the order they are returned by the specified
collection's iterator. The elements in the input collection
must be Strings and must not be null.
If any of the elements is invalid, then none of the elements
is added and an exception is thrown.
Names that already exist in the model are ignored.
If some new class names are added to the model, then a ModelEvent
is fired, containing a vector of all class names added to the model.
- Parameters:
- v - The collection of elements to add to the model.
- Throws: NullPointerException
- Thrown when one of the elements
in the input collection is null.
- Throws: ClassCastException
- Thrown when one of the elements
in the input collection is not a String.
elements
public Enumeration elements()
- Gets an enumeration of the elements in the collection.
Use the Enumeration methods on the returned object to
fetch the elements sequentially.
- Returns:
- An enumeration of the components of this collection.
All Packages Class Hierarchy This Package Previous Next Index