net.fortuna.ical4j.model
Class DateList

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

public class DateList
extends java.lang.Object
implements java.util.List, java.io.Serializable

$Id: DateList.java,v 1.32 2011/03/19 07:06:53 fortuna Exp $ [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(int initialCapacity)
          Deprecated.  
DateList(java.lang.String aValue, Value aType)
           
DateList(java.lang.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, java.lang.Object arg1)
           
 boolean add(java.lang.Object date)
          Overrides superclass to throw an IllegalArgumentException Where argument is not a net.fortuna.ical4j.model.Date.
 boolean addAll(java.util.Collection arg0)
           
 boolean addAll(int arg0, java.util.Collection arg1)
           
 void clear()
           
 boolean contains(java.lang.Object o)
           
 boolean containsAll(java.util.Collection arg0)
           
 boolean equals(java.lang.Object obj)
           
 java.lang.Object get(int index)
           
 TimeZone getTimeZone()
           
 Value getType()
          Returns the VALUE parameter specifying the type of dates (ie.
 int hashCode()
           
 int indexOf(java.lang.Object o)
           
 boolean isEmpty()
           
 boolean isUtc()
          Indicates whether this list is in local or UTC format.
 java.util.Iterator iterator()
           
 int lastIndexOf(java.lang.Object o)
           
 java.util.ListIterator listIterator()
           
 java.util.ListIterator listIterator(int index)
           
 boolean remove(Date date)
          Remove a date from the list.
 java.lang.Object remove(int index)
           
 boolean remove(java.lang.Object o)
           
 boolean removeAll(java.util.Collection arg0)
           
 boolean retainAll(java.util.Collection arg0)
           
 java.lang.Object set(int arg0, java.lang.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()
           
 java.util.List subList(int fromIndex, int toIndex)
           
 java.lang.Object[] toArray()
           
 java.lang.Object[] toArray(java.lang.Object[] arg0)
           
 java.lang.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(int initialCapacity)
Deprecated. 

Creates a new instance with the specified initial capacity.

Parameters:
initialCapacity - the initial capacity of the list

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(java.lang.String aValue,
                Value aType)
         throws java.text.ParseException
Parameters:
aValue - a string representation of a date list
aType - the date types contained in the instance
Throws:
java.text.ParseException - where the specified string is not a valid date list

DateList

public DateList(java.lang.String aValue,
                Value aType,
                TimeZone timezone)
         throws java.text.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:
java.text.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 java.lang.String toString()

Overrides:
toString in class java.lang.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(java.lang.Object date)
Overrides superclass to throw an IllegalArgumentException Where argument is not a net.fortuna.ical4j.model.Date.

Specified by:
add in interface java.util.Collection
Specified by:
add in interface java.util.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 void add(int arg0,
                java.lang.Object arg1)
Specified by:
add in interface java.util.List

addAll

public boolean addAll(java.util.Collection arg0)
Specified by:
addAll in interface java.util.Collection
Specified by:
addAll in interface java.util.List

addAll

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

clear

public void clear()
Specified by:
clear in interface java.util.Collection
Specified by:
clear in interface java.util.List

contains

public boolean contains(java.lang.Object o)
Specified by:
contains in interface java.util.Collection
Specified by:
contains in interface java.util.List

containsAll

public boolean containsAll(java.util.Collection arg0)
Specified by:
containsAll in interface java.util.Collection
Specified by:
containsAll in interface java.util.List

get

public java.lang.Object get(int index)
Specified by:
get in interface java.util.List

indexOf

public int indexOf(java.lang.Object o)
Specified by:
indexOf in interface java.util.List

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface java.util.Collection
Specified by:
isEmpty in interface java.util.List

iterator

public java.util.Iterator iterator()
Specified by:
iterator in interface java.lang.Iterable
Specified by:
iterator in interface java.util.Collection
Specified by:
iterator in interface java.util.List

lastIndexOf

public int lastIndexOf(java.lang.Object o)
Specified by:
lastIndexOf in interface java.util.List

listIterator

public java.util.ListIterator listIterator()
Specified by:
listIterator in interface java.util.List

listIterator

public java.util.ListIterator listIterator(int index)
Specified by:
listIterator in interface java.util.List

remove

public java.lang.Object remove(int index)
Specified by:
remove in interface java.util.List

remove

public boolean remove(java.lang.Object o)
Specified by:
remove in interface java.util.Collection
Specified by:
remove in interface java.util.List

removeAll

public boolean removeAll(java.util.Collection arg0)
Specified by:
removeAll in interface java.util.Collection
Specified by:
removeAll in interface java.util.List

retainAll

public boolean retainAll(java.util.Collection arg0)
Specified by:
retainAll in interface java.util.Collection
Specified by:
retainAll in interface java.util.List

set

public java.lang.Object set(int arg0,
                            java.lang.Object arg1)
Specified by:
set in interface java.util.List

size

public int size()
Specified by:
size in interface java.util.Collection
Specified by:
size in interface java.util.List

subList

public java.util.List subList(int fromIndex,
                              int toIndex)
Specified by:
subList in interface java.util.List

toArray

public java.lang.Object[] toArray()
Specified by:
toArray in interface java.util.Collection
Specified by:
toArray in interface java.util.List

toArray

public java.lang.Object[] toArray(java.lang.Object[] arg0)
Specified by:
toArray in interface java.util.Collection
Specified by:
toArray in interface java.util.List

equals

public boolean equals(java.lang.Object obj)
Specified by:
equals in interface java.util.Collection
Specified by:
equals in interface java.util.List
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Specified by:
hashCode in interface java.util.Collection
Specified by:
hashCode in interface java.util.List
Overrides:
hashCode in class java.lang.Object


Copyright © 2004-2011 Modularity. All Rights Reserved.