net.fortuna.ical4j.model
Class DateList

java.lang.Object
  extended by net.fortuna.ical4j.model.DateList
All Implemented Interfaces:
Serializable, Iterable, Collection, List

public class DateList
extends Object
implements List, Serializable

$Id$ [23-Apr-2004] Defines a list of iCalendar dates. If no value type is specified a list defaults to DATE-TIME instances.

Author:
Ben Fortuna
See Also:
Serialized Form

Constructor Summary
DateList()
          Default constructor.
DateList(boolean unmodifiable)
           
DateList(DateList list, Value type)
          Constructs a new date list of the specified type containing the dates in the specified list.
DateList(String aValue, Value aType)
           
DateList(String aValue, Value aType, TimeZone timezone)
          Parses the specified string representation to create a list of dates.
DateList(Value aType)
           
DateList(Value aType, TimeZone timezone)
          Default constructor.
 
Method Summary
 boolean add(Date date)
          Add a date to the list.
 void add(int arg0, Object arg1)
           
 boolean add(Object date)
          Overrides superclass to throw an IllegalArgumentException Where argument is not a net.fortuna.ical4j.model.Date.
 boolean addAll(Collection arg0)
           
 boolean addAll(int arg0, Collection arg1)
           
 void clear()
           
 boolean contains(Object o)
           
 boolean containsAll(Collection arg0)
           
 boolean equals(Object obj)
           
 Object get(int index)
           
 TimeZone getTimeZone()
           
 Value getType()
          Returns the VALUE parameter specifying the type of dates (ie.
 int hashCode()
           
 int indexOf(Object o)
           
 boolean isEmpty()
           
 boolean isUtc()
          Indicates whether this list is in local or UTC format.
 Iterator iterator()
           
 int lastIndexOf(Object o)
           
 ListIterator listIterator()
           
 ListIterator listIterator(int index)
           
 boolean remove(Date date)
          Remove a date from the list.
 Object remove(int index)
           
 boolean remove(Object o)
           
 boolean removeAll(Collection arg0)
           
 boolean retainAll(Collection arg0)
           
 Object set(int arg0, Object arg1)
           
 void setTimeZone(TimeZone timeZone)
          Applies the specified timezone to all dates in the list.
 void setUtc(boolean utc)
          Sets whether this list is in UTC or local time format.
 int size()
           
 List subList(int fromIndex, int toIndex)
           
 Object[] toArray()
           
 Object[] toArray(Object[] arg0)
           
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DateList

public DateList()
Default constructor.


DateList

public DateList(boolean unmodifiable)

DateList

public DateList(Value aType)
Parameters:
aType - the type of dates contained by the instance

DateList

public DateList(Value aType,
                TimeZone timezone)
Default constructor.

Parameters:
aType - specifies the type of dates (either date or date-time)
timezone - the timezone to apply to dates contained by the instance

DateList

public DateList(String aValue,
                Value aType)
         throws ParseException
Parameters:
aValue - a string representation of a date list
aType - the date types contained in the instance
Throws:
ParseException - where the specified string is not a valid date list

DateList

public DateList(String aValue,
                Value aType,
                TimeZone timezone)
         throws ParseException
Parses the specified string representation to create a list of dates.

Parameters:
aValue - a string representation of a list of dates
aType - specifies the type of dates (either date or date-time)
timezone - the timezone to apply to contained dates
Throws:
ParseException - if an invalid date representation exists in the date list string

DateList

public DateList(DateList list,
                Value type)
Constructs a new date list of the specified type containing the dates in the specified list.

Parameters:
list - a list of dates to include in the new list
type - the type of the new list
Method Detail

toString

public final String toString()

Overrides:
toString in class Object

add

public final boolean add(Date date)
Add a date to the list. The date will be updated to reflect the timezone of this list.

Parameters:
date - the date to add
Returns:
true
See Also:
List.add(java.lang.Object)

add

public final boolean add(Object date)
Overrides superclass to throw an IllegalArgumentException Where argument is not a net.fortuna.ical4j.model.Date.

Specified by:
add in interface Collection
Specified by:
add in interface List
Parameters:
date - the date to add
Returns:
true if the object was added, otherwise false
See Also:
List#add(E)

remove

public final boolean remove(Date date)
Remove a date from the list.

Parameters:
date - the date to remove
Returns:
true if the list contained the specified date
See Also:
List.remove(java.lang.Object)

getType

public final Value getType()
Returns the VALUE parameter specifying the type of dates (ie. date or date-time) stored in this date list.

Returns:
Returns a Value parameter.

isUtc

public final boolean isUtc()
Indicates whether this list is in local or UTC format. This property will have no affect if the type of the list is not DATE-TIME.

Returns:
Returns true if in UTC format, otherwise false.

setUtc

public final void setUtc(boolean utc)
Sets whether this list is in UTC or local time format.

Parameters:
utc - The utc to set.

setTimeZone

public final void setTimeZone(TimeZone timeZone)
Applies the specified timezone to all dates in the list. All dates added to this list will also have this timezone applied.

Parameters:
timeZone - a timezone to apply to contained dates

getTimeZone

public final TimeZone getTimeZone()
Returns:
Returns the timeZone.

add

public final void add(int arg0,
                      Object arg1)
Specified by:
add in interface List

addAll

public final boolean addAll(Collection arg0)
Specified by:
addAll in interface Collection
Specified by:
addAll in interface List

addAll

public final boolean addAll(int arg0,
                            Collection arg1)
Specified by:
addAll in interface List

clear

public final void clear()
Specified by:
clear in interface Collection
Specified by:
clear in interface List

contains

public final boolean contains(Object o)
Specified by:
contains in interface Collection
Specified by:
contains in interface List

containsAll

public final boolean containsAll(Collection arg0)
Specified by:
containsAll in interface Collection
Specified by:
containsAll in interface List

get

public final Object get(int index)
Specified by:
get in interface List

indexOf

public final int indexOf(Object o)
Specified by:
indexOf in interface List

isEmpty

public final boolean isEmpty()
Specified by:
isEmpty in interface Collection
Specified by:
isEmpty in interface List

iterator

public final Iterator iterator()
Specified by:
iterator in interface Iterable
Specified by:
iterator in interface Collection
Specified by:
iterator in interface List

lastIndexOf

public final int lastIndexOf(Object o)
Specified by:
lastIndexOf in interface List

listIterator

public final ListIterator listIterator()
Specified by:
listIterator in interface List

listIterator

public final ListIterator listIterator(int index)
Specified by:
listIterator in interface List

remove

public final Object remove(int index)
Specified by:
remove in interface List

remove

public final boolean remove(Object o)
Specified by:
remove in interface Collection
Specified by:
remove in interface List

removeAll

public final boolean removeAll(Collection arg0)
Specified by:
removeAll in interface Collection
Specified by:
removeAll in interface List

retainAll

public final boolean retainAll(Collection arg0)
Specified by:
retainAll in interface Collection
Specified by:
retainAll in interface List

set

public final Object set(int arg0,
                        Object arg1)
Specified by:
set in interface List

size

public final int size()
Specified by:
size in interface Collection
Specified by:
size in interface List

subList

public final List subList(int fromIndex,
                          int toIndex)
Specified by:
subList in interface List

toArray

public final Object[] toArray()
Specified by:
toArray in interface Collection
Specified by:
toArray in interface List

toArray

public final Object[] toArray(Object[] arg0)
Specified by:
toArray in interface Collection
Specified by:
toArray in interface List

equals

public final boolean equals(Object obj)
Specified by:
equals in interface Collection
Specified by:
equals in interface List
Overrides:
equals in class Object

hashCode

public final int hashCode()
Specified by:
hashCode in interface Collection
Specified by:
hashCode in interface List
Overrides:
hashCode in class Object


Copyright © 2004-2012 Micronode. All Rights Reserved.