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.


Variable Index

 o MODEL_ADD
 o MODEL_CHANGE
 o MODEL_REMOVE

Constructor Index

 o ClassNameModel()
Constructs a ClassNameModel that is initially empty.
 o ClassNameModel(ClassNameModel)
Constructs a ClassNameModel instance from an existing ClassNameModel instance.
 o ClassNameModel(Vector)
Constructs a ClassNameModel object containing the specified class names.

Method Index

 o add(Object)
Ensures that this Collection contains the specified element.
 o 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.
 o addModelChangeListener(ModelChangeListener)
Adds a model change listener to the list of listeners.
 o contains(Object)
Indicates whether the model contains the specified element.
 o elements()
Gets an enumeration of the elements in the collection.
 o equals(Object)
Tests for equality with the passed object.
 o fireModelChangeEvent(ModelEvent, int)
Propagates a ModelEvent to registered model change listeners.
 o hashCode()
Gets a hash code for an instance of this class.
 o isEmpty()
Indicates whether the model contains no elements.
 o remove(Object)
Removes a single instance of the specified element from the model, if it is present.
 o removeModelChangeListener(ModelChangeListener)
Removes a model change listener from the list of listeners.
 o size()
Returns the number of elements in the model.

Variables

 o MODEL_ADD
 protected static final int MODEL_ADD
 o MODEL_REMOVE
 protected static final int MODEL_REMOVE
 o MODEL_CHANGE
 protected static final int MODEL_CHANGE

Constructors

 o ClassNameModel
 public ClassNameModel()
Constructs a ClassNameModel that is initially empty.

 o 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.
 o 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.

Methods

 o 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
 o hashCode
 public int hashCode()
Gets a hash code for an instance of this class.

Returns:
The hash value.
Overrides:
hashCode in class Object
 o 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
 o 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
 o 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.
 o 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.
 o size
 public int size()
Returns the number of elements in the model.

Returns:
The number of elements in the model.
 o isEmpty
 public boolean isEmpty()
Indicates whether the model contains no elements.

Returns:
true if the model is empty, false otherwise.
 o 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.
 o 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.
 o 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.
 o 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