org.opennms.report.availability
Class CalendarTable

java.lang.Object
  extended by org.opennms.report.availability.CalendarTable
All Implemented Interfaces:
Serializable

public class CalendarTable
extends Object
implements Serializable

Class CalendarTable.

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

Constructor Summary
CalendarTable()
           
 
Method Summary
 void addWeek(int index, Week vWeek)
           
 void addWeek(Week vWeek)
           
 Enumeration<Week> enumerateWeek()
          Method enumerateWeek.
 DaysOfWeek getDaysOfWeek()
          Returns the value of field 'daysOfWeek'.
 String getMonth()
          Returns the value of field 'month'.
 Week[] getWeek()
          Method getWeek.Returns the contents of the collection in an Array.
 Week getWeek(int index)
          Method getWeek.
 List<Week> getWeekCollection()
          Method getWeekCollection.Returns a reference to '_weekList'.
 int getWeekCount()
          Method getWeekCount.
 boolean isValid()
          Method isValid.
 Iterator<Week> iterateWeek()
          Method iterateWeek.
 void marshal(ContentHandler handler)
           
 void marshal(Writer out)
           
 void removeAllWeek()
           
 boolean removeWeek(Week vWeek)
          Method removeWeek.
 Week removeWeekAt(int index)
          Method removeWeekAt.
 void setDaysOfWeek(DaysOfWeek daysOfWeek)
          Sets the value of field 'daysOfWeek'.
 void setMonth(String month)
          Sets the value of field 'month'.
 void setWeek(int index, Week vWeek)
           
 void setWeek(List<Week> vWeekList)
          Sets the value of '_weekList' by copying the given Vector.
 void setWeek(Week[] vWeekArray)
           
 void setWeekCollection(List<Week> weekList)
          Deprecated.  
static CalendarTable 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

CalendarTable

public CalendarTable()
Method Detail

addWeek

public void addWeek(Week vWeek)
             throws IndexOutOfBoundsException
Parameters:
vWeek -
Throws:
IndexOutOfBoundsException - if the index given is outside the bounds of the collection

addWeek

public void addWeek(int index,
                    Week vWeek)
             throws IndexOutOfBoundsException
Parameters:
index -
vWeek -
Throws:
IndexOutOfBoundsException - if the index given is outside the bounds of the collection

enumerateWeek

public Enumeration<Week> enumerateWeek()
Method enumerateWeek.

Returns:
an Enumeration over all possible elements of this collection

getDaysOfWeek

public DaysOfWeek getDaysOfWeek()
Returns the value of field 'daysOfWeek'.

Returns:
the value of field 'DaysOfWeek'.

getMonth

public String getMonth()
Returns the value of field 'month'.

Returns:
the value of field 'Month'.

getWeek

public Week getWeek(int index)
             throws IndexOutOfBoundsException
Method getWeek.

Parameters:
index -
Returns:
the value of the org.opennms.report.availability.Week at the given index
Throws:
IndexOutOfBoundsException - if the index given is outside the bounds of the collection

getWeek

public Week[] getWeek()
Method getWeek.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

getWeekCollection

public List<Week> getWeekCollection()
Method getWeekCollection.Returns a reference to '_weekList'. No type checking is performed on any modifications to the Vector.

Returns:
a reference to the Vector backing this class

getWeekCount

public int getWeekCount()
Method getWeekCount.

Returns:
the size of this collection

isValid

public boolean isValid()
Method isValid.

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

iterateWeek

public Iterator<Week> iterateWeek()
Method iterateWeek.

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

removeAllWeek

public void removeAllWeek()

removeWeek

public boolean removeWeek(Week vWeek)
Method removeWeek.

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

removeWeekAt

public Week removeWeekAt(int index)
Method removeWeekAt.

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

setDaysOfWeek

public void setDaysOfWeek(DaysOfWeek daysOfWeek)
Sets the value of field 'daysOfWeek'.

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

setMonth

public void setMonth(String month)
Sets the value of field 'month'.

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

setWeek

public void setWeek(int index,
                    Week vWeek)
             throws IndexOutOfBoundsException
Parameters:
index -
vWeek -
Throws:
IndexOutOfBoundsException - if the index given is outside the bounds of the collection

setWeek

public void setWeek(Week[] vWeekArray)
Parameters:
vWeekArray -

setWeek

public void setWeek(List<Week> vWeekList)
Sets the value of '_weekList' by copying the given Vector. All elements will be checked for type safety.

Parameters:
vWeekList - the Vector to copy.

setWeekCollection

public void setWeekCollection(List<Week> weekList)
Deprecated. 

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

Parameters:
weekList - the Vector to set.

unmarshal

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

Parameters:
reader -
Returns:
the unmarshaled org.opennms.report.availability.CalendarTable
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.