org.opennms.netmgt.config.ackd
Class Readers

java.lang.Object
  extended by org.opennms.netmgt.config.ackd.Readers
All Implemented Interfaces:
Serializable

public class Readers
extends Object
implements Serializable

Location for user to define readers and they're schedules.

Version:
$Revision$ $Date$
See Also:
Serialized Form

Constructor Summary
Readers()
           
 
Method Summary
 void addReader(int index, Reader vReader)
           
 void addReader(Reader vReader)
           
 Enumeration<Reader> enumerateReader()
          Method enumerateReader.
 boolean equals(Object obj)
          Overrides the java.lang.Object.equals method.
 Reader[] getReader()
          Method getReader.Returns the contents of the collection in an Array.
 Reader getReader(int index)
          Method getReader.
 List<Reader> getReaderCollection()
          Method getReaderCollection.Returns a reference to '_readerList'.
 int getReaderCount()
          Method getReaderCount.
 int hashCode()
          Overrides the java.lang.Object.hashCode method.
 boolean isValid()
          Method isValid.
 Iterator<Reader> iterateReader()
          Method iterateReader.
 void marshal(ContentHandler handler)
           
 void marshal(Writer out)
           
 void removeAllReader()
           
 boolean removeReader(Reader vReader)
          Method removeReader.
 Reader removeReaderAt(int index)
          Method removeReaderAt.
 void setReader(int index, Reader vReader)
           
 void setReader(List<Reader> vReaderList)
          Sets the value of '_readerList' by copying the given Vector.
 void setReader(Reader[] vReaderArray)
           
 void setReaderCollection(List<Reader> readerList)
          Deprecated.  
static Readers unmarshal(Reader reader)
          Method unmarshal.
 void validate()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Readers

public Readers()
Method Detail

addReader

public void addReader(Reader vReader)
               throws IndexOutOfBoundsException
Parameters:
vReader -
Throws:
IndexOutOfBoundsException - if the index given is outside the bounds of the collection

addReader

public void addReader(int index,
                      Reader vReader)
               throws IndexOutOfBoundsException
Parameters:
index -
vReader -
Throws:
IndexOutOfBoundsException - if the index given is outside the bounds of the collection

enumerateReader

public Enumeration<Reader> enumerateReader()
Method enumerateReader.

Returns:
an Enumeration over all possible elements of this collection

equals

public boolean equals(Object obj)
Overrides the java.lang.Object.equals method.

Overrides:
equals in class Object
Parameters:
obj -
Returns:
true if the objects are equal.

getReader

public Reader getReader(int index)
                 throws IndexOutOfBoundsException
Method getReader.

Parameters:
index -
Returns:
the value of the org.opennms.netmgt.config.ackd.Reader at the given index
Throws:
IndexOutOfBoundsException - if the index given is outside the bounds of the collection

getReader

public Reader[] getReader()
Method getReader.Returns the contents of the collection in an Array.

Note: Just in case the collection contents are changing in another thread, we pass a 0-length Array of the correct type into the API call. This way we know that the Array returned is of exactly the correct length.

Returns:
this collection as an Array

getReaderCollection

public List<Reader> getReaderCollection()
Method getReaderCollection.Returns a reference to '_readerList'. No type checking is performed on any modifications to the Vector.

Returns:
a reference to the Vector backing this class

getReaderCount

public int getReaderCount()
Method getReaderCount.

Returns:
the size of this collection

hashCode

public int hashCode()
Overrides the java.lang.Object.hashCode method.

The following steps came from Effective Java Programming Language Guide by Joshua Bloch, Chapter 3

Overrides:
hashCode in class Object
Returns:
a hash code value for the object.

isValid

public boolean isValid()
Method isValid.

Returns:
true if this object is valid according to the schema

iterateReader

public Iterator<Reader> iterateReader()
Method iterateReader.

Returns:
an Iterator over all possible elements in this collection

marshal

public void marshal(Writer out)
             throws org.exolab.castor.xml.MarshalException,
                    org.exolab.castor.xml.ValidationException
Parameters:
out -
Throws:
org.exolab.castor.xml.MarshalException - if object is null or if any SAXException is thrown during marshaling
org.exolab.castor.xml.ValidationException - if this object is an invalid instance according to the schema

marshal

public void marshal(ContentHandler handler)
             throws IOException,
                    org.exolab.castor.xml.MarshalException,
                    org.exolab.castor.xml.ValidationException
Parameters:
handler -
Throws:
IOException - if an IOException occurs during marshaling
org.exolab.castor.xml.ValidationException - if this object is an invalid instance according to the schema
org.exolab.castor.xml.MarshalException - if object is null or if any SAXException is thrown during marshaling

removeAllReader

public void removeAllReader()

removeReader

public boolean removeReader(Reader vReader)
Method removeReader.

Parameters:
vReader -
Returns:
true if the object was removed from the collection.

removeReaderAt

public Reader removeReaderAt(int index)
Method removeReaderAt.

Parameters:
index -
Returns:
the element removed from the collection

setReader

public void setReader(int index,
                      Reader vReader)
               throws IndexOutOfBoundsException
Parameters:
index -
vReader -
Throws:
IndexOutOfBoundsException - if the index given is outside the bounds of the collection

setReader

public void setReader(Reader[] vReaderArray)
Parameters:
vReaderArray -

setReader

public void setReader(List<Reader> vReaderList)
Sets the value of '_readerList' by copying the given Vector. All elements will be checked for type safety.

Parameters:
vReaderList - the Vector to copy.

setReaderCollection

public void setReaderCollection(List<Reader> readerList)
Deprecated. 

Sets the value of '_readerList' by setting it to the given Vector. No type checking is performed.

Parameters:
readerList - the Vector to set.

unmarshal

public static Readers unmarshal(Reader reader)
                         throws org.exolab.castor.xml.MarshalException,
                                org.exolab.castor.xml.ValidationException
Method unmarshal.

Parameters:
reader -
Returns:
the unmarshaled org.opennms.netmgt.config.ackd.Reader
Throws:
org.exolab.castor.xml.MarshalException - if object is null or if any SAXException is thrown during marshaling
org.exolab.castor.xml.ValidationException - if this object is an invalid instance according to the schema

validate

public void validate()
              throws org.exolab.castor.xml.ValidationException
Throws:
org.exolab.castor.xml.ValidationException - if this object is an invalid instance according to the schema


Copyright © 2011. All Rights Reserved.