org.opennms.netmgt.config.common
Class BasicSchedule

java.lang.Object
  extended by org.opennms.netmgt.config.common.BasicSchedule
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
Outage, Schedule

public class BasicSchedule
extends Object
implements Serializable

Class BasicSchedule.

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

Constructor Summary
BasicSchedule()
           
 
Method Summary
 void addTime(int index, Time vTime)
           
 void addTime(Time vTime)
           
 Enumeration<Time> enumerateTime()
          Method enumerateTime.
 String getName()
          Returns the value of field 'name'.
 Time[] getTime()
          Method getTime.Returns the contents of the collection in an Array.
 Time getTime(int index)
          Method getTime.
 List<Time> getTimeCollection()
          Method getTimeCollection.Returns a reference to '_timeList'.
 int getTimeCount()
          Method getTimeCount.
 String getType()
          Returns the value of field 'type'.
 boolean isValid()
          Method isValid.
 Iterator<Time> iterateTime()
          Method iterateTime.
 void marshal(ContentHandler handler)
           
 void marshal(Writer out)
           
 void removeAllTime()
           
 boolean removeTime(Time vTime)
          Method removeTime.
 Time removeTimeAt(int index)
          Method removeTimeAt.
 void setName(String name)
          Sets the value of field 'name'.
 void setTime(int index, Time vTime)
           
 void setTime(List<Time> vTimeList)
          Sets the value of '_timeList' by copying the given Vector.
 void setTime(Time[] vTimeArray)
           
 void setTimeCollection(List<Time> timeList)
          Deprecated.  
 void setType(String type)
          Sets the value of field 'type'.
static BasicSchedule unmarshal(Reader reader)
          Method unmarshal.
 void validate()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicSchedule

public BasicSchedule()
Method Detail

addTime

public void addTime(Time vTime)
             throws IndexOutOfBoundsException
Parameters:
vTime -
Throws:
IndexOutOfBoundsException - if the index given is outside the bounds of the collection

addTime

public void addTime(int index,
                    Time vTime)
             throws IndexOutOfBoundsException
Parameters:
index -
vTime -
Throws:
IndexOutOfBoundsException - if the index given is outside the bounds of the collection

enumerateTime

public Enumeration<Time> enumerateTime()
Method enumerateTime.

Returns:
an Enumeration over all possible elements of this collection

getName

public String getName()
Returns the value of field 'name'. The field 'name' has the following description: outage name

Returns:
the value of field 'Name'.

getTime

public Time getTime(int index)
             throws IndexOutOfBoundsException
Method getTime.

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

getTime

public Time[] getTime()
Method getTime.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

getTimeCollection

public List<Time> getTimeCollection()
Method getTimeCollection.Returns a reference to '_timeList'. No type checking is performed on any modifications to the Vector.

Returns:
a reference to the Vector backing this class

getTimeCount

public int getTimeCount()
Method getTimeCount.

Returns:
the size of this collection

getType

public String getType()
Returns the value of field 'type'. The field 'type' has the following description: outage type

Returns:
the value of field 'Type'.

isValid

public boolean isValid()
Method isValid.

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

iterateTime

public Iterator<Time> iterateTime()
Method iterateTime.

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

removeAllTime

public void removeAllTime()

removeTime

public boolean removeTime(Time vTime)
Method removeTime.

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

removeTimeAt

public Time removeTimeAt(int index)
Method removeTimeAt.

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

setName

public void setName(String name)
Sets the value of field 'name'. The field 'name' has the following description: outage name

Parameters:
name - the value of field 'name'.

setTime

public void setTime(int index,
                    Time vTime)
             throws IndexOutOfBoundsException
Parameters:
index -
vTime -
Throws:
IndexOutOfBoundsException - if the index given is outside the bounds of the collection

setTime

public void setTime(Time[] vTimeArray)
Parameters:
vTimeArray -

setTime

public void setTime(List<Time> vTimeList)
Sets the value of '_timeList' by copying the given Vector. All elements will be checked for type safety.

Parameters:
vTimeList - the Vector to copy.

setTimeCollection

public void setTimeCollection(List<Time> timeList)
Deprecated. 

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

Parameters:
timeList - the Vector to set.

setType

public void setType(String type)
Sets the value of field 'type'. The field 'type' has the following description: outage type

Parameters:
type - the value of field 'type'.

unmarshal

public static BasicSchedule 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.common.BasicSchedule
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 ? 2008. All Rights Reserved.