Hyperic HQ Plugin API v. 4.4.0.2

org.hyperic.util
Class StringCollection

java.lang.Object
  extended by org.hyperic.util.StrongCollection
      extended by org.hyperic.util.StringCollection
All Implemented Interfaces:
java.lang.Iterable, java.util.Collection

public class StringCollection
extends StrongCollection

StringCollection is a collection class that will only java.lang.String objects into the collection. StringCollection implements all of the methods of the java.util.Collection interface.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.hyperic.util.StrongCollection
StrongCollection.Itr
 
Field Summary
 
Fields inherited from class org.hyperic.util.StrongCollection
CLASS_NOT_FOUND_MSG, m_aList
 
Constructor Summary
StringCollection()
          Constructs a StringCollection class.
 
Method Summary
 boolean add(java.lang.String obj)
           
 boolean addAll(StringCollection coll)
           
protected  void checkCollection(java.util.Collection collection)
          Checks whether a Collection object is of the type specified when constructing the StrongBase class and throws a ClassCastException if it is not.
protected  void checkObject(java.lang.Object obj)
          Checks whether a object is of the type that the collection accepts and throws a ClassCastException if it is not.
 boolean contains(java.lang.String obj)
           
 boolean containsAll(StringCollection coll)
           
protected  java.lang.Class getCollectionClass()
          Returns the collection Class.
protected  java.lang.Class getObjectClass()
          Returns the object Class of the objects accepted by a Collection.
protected  void init(java.lang.Class coll, java.lang.Class obj)
          Initializes a StrongBase class.
protected  void init(java.lang.String coll, java.lang.String obj)
          Initializes a StrongBase class.
protected  boolean isValidCollection(java.util.Collection collection)
          Returns whether a Collection object is of the type specified when constructing the StrongBase class.
protected  boolean isValidObject(java.lang.Object obj)
          Returns whether an object is of the type that the collection accepts.
 boolean remove(java.lang.String obj)
           
 boolean removeAll(StringCollection coll)
           
 boolean retainAll(StringCollection coll)
           
 java.lang.String[] toArray(java.lang.String[] a)
           
 
Methods inherited from class org.hyperic.util.StrongCollection
add, addAll, clear, contains, containsAll, isEmpty, iterator, remove, removeAll, retainAll, reverse, size, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Collection
equals, hashCode
 

Constructor Detail

StringCollection

public StringCollection()
Constructs a StringCollection class.

Parameters:
collection - The java.lang.Class type of the subclassed collection.
object - The java.lang.Class type of the object this collection will accept.
Method Detail

add

public boolean add(java.lang.String obj)

addAll

public boolean addAll(StringCollection coll)

contains

public boolean contains(java.lang.String obj)

containsAll

public boolean containsAll(StringCollection coll)

remove

public boolean remove(java.lang.String obj)

removeAll

public boolean removeAll(StringCollection coll)

retainAll

public boolean retainAll(StringCollection coll)

toArray

public java.lang.String[] toArray(java.lang.String[] a)

init

protected void init(java.lang.Class coll,
                    java.lang.Class obj)
Initializes a StrongBase class.

Parameters:
c - The java.lang.Class object of the collection class that will use the StrongBase. The collection class must implement the java.util.Collection interface or a sublcass of this interface.
obj - The java.lang.Class object of the class that the collection will contain. The obj Class can be any type that can be implemented in the Java language.
See Also:
Collection

init

protected void init(java.lang.String coll,
                    java.lang.String obj)
             throws java.lang.ClassNotFoundException
Initializes a StrongBase class.

Parameters:
c - The java.lang.Class object of the collection class that will use the StrongBase. The collection class must implement the java.util.Collection interface or a sublcass of this interface.
obj - The java.lang.Class object of the class that the collection will contain. The obj Class can be any type that can be implemented in the Java language.
Throws:
java.lang.ClassNotFoundException
See Also:
Collection

checkCollection

protected void checkCollection(java.util.Collection collection)
Checks whether a Collection object is of the type specified when constructing the StrongBase class and throws a ClassCastException if it is not.

Parameters:
collection - The java.lang.Class object of the collection class that will use the StrongBase. This methods throws a ClassCastException if the paramater is not valid.
See Also:
ClassCastException, Collection

checkObject

protected void checkObject(java.lang.Object obj)
Checks whether a object is of the type that the collection accepts and throws a ClassCastException if it is not.

Parameters:
obj - The java.lang.Class object of the collection class that will use the StrongBase. This methods throws a ClassCastException if the paramater is not valid.
See Also:
ClassCastException

getCollectionClass

protected java.lang.Class getCollectionClass()
Returns the collection Class.

Returns:
The java.lang.Class object of the Collection class.
See Also:
Class

getObjectClass

protected java.lang.Class getObjectClass()
Returns the object Class of the objects accepted by a Collection.

Returns:
The java.lang.Class object of the objects allowed in the collection.
See Also:
Class

isValidCollection

protected boolean isValidCollection(java.util.Collection collection)
Returns whether a Collection object is of the type specified when constructing the StrongBase class.

Parameters:
collection - The java.lang.Class object of the collection class that will use the StrongBase. This methods throws a ClassCastException if the paramater is not valid.
Returns:
true if the collection class is valid. false otherwise.
See Also:
Collection

isValidObject

protected boolean isValidObject(java.lang.Object obj)
Returns whether an object is of the type that the collection accepts.

Parameters:
obj - The java.lang.Class object of the collection class that will use the StrongBase.
Returns:
true if the object is allowed in the collection. false otherwise.

Hyperic HQ Plugin API v. 4.4.0.2

Copyright © 2004-2006 Hyperic, Inc. support@hyperic.net, All Rights Reserved.