Package com.aspose.tasks
Class CalendarCollection
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<T>
-
- com.aspose.tasks.CalendarCollection
-
public class CalendarCollection extends AbstractList<T>
Represents a collection of
Calendar
objects.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Calendar
add(String name)
Adds a new base calendar to this CalendarCollection object and returns added calendar.Calendar
add(String name, Calendar baseCalendar)
Adds a new calendar with specified base calendar to this CalendarCollection object and returns added calendar.void
clear()
Removes all of the elements from this collection.Calendar
get(int index)
(@inheritDoc}Calendar
getByName(String name)
Returns a calendar with the specified name.Calendar
getByUid(int uid)
Returns a calendar with the specified UID.Project
getParentProject()
Deprecated.This member is obsolete and will be removed after the release 23.3.Iterator<Calendar>
iterator()
Returns an enumerator for this collection.Calendar
remove(int index)
Removes the element at the specified position in this list.boolean
remove(Object item)
Removes Calendar from Project CalendarCollection.Calendar
set(int index, Calendar element)
Replaces the element at the specified position in this list with the specified element.int
size()
Gets the number of objects contained in thisCalendarCollection
object.void
sort(Comparator<? super T> c)
List<Calendar>
toList()
Converts the CalendarCollection object to a list ofCalendar
objects.-
Methods inherited from class java.util.AbstractList
add, add, addAll, equals, hashCode, indexOf, lastIndexOf, listIterator, listIterator, subList
-
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, removeAll, retainAll, toArray, toArray, toString
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface java.util.List
addAll, contains, containsAll, isEmpty, removeAll, replaceAll, retainAll, spliterator, toArray, toArray
-
-
-
-
Method Detail
-
add
public final Calendar add(String name)
Adds a new base calendar to this CalendarCollection object and returns added calendar.
- Parameters:
name
- Calendar name.- Returns:
- Added
Calendar
object. - Throws:
com.aspose.ms.System.ArgumentException
- Thrown when calendar name is null.
-
add
public final Calendar add(String name, Calendar baseCalendar)
Adds a new calendar with specified base calendar to this CalendarCollection object and returns added calendar.
- Parameters:
name
- Specified name.baseCalendar
- Specified base calendar.- Returns:
- Added
Calendar
object.
-
clear
public final void clear()
Removes all of the elements from this collection.- Specified by:
clear
in interfaceCollection<Calendar>
- Specified by:
clear
in interfaceList<Calendar>
- Overrides:
clear
in classAbstractList<Calendar>
-
getByName
public final Calendar getByName(String name)
Returns a calendar with the specified name.
- Parameters:
name
- Name of a calendar.- Returns:
- If found returns calendar with a specified name else returns null.
-
getByUid
public final Calendar getByUid(int uid)
Returns a calendar with the specified UID.
- Parameters:
uid
- UID of a calendar.- Returns:
- Calendar with a specified UID.
-
getParentProject
@Deprecated public final Project getParentProject()
Deprecated.This member is obsolete and will be removed after the release 23.3.Gets a parent
Project
of this object.- Returns:
- a parent
Project
of this object.
-
remove
public final boolean remove(Object item)
Removes Calendar from Project CalendarCollection.
- Specified by:
remove
in interfaceCollection<Calendar>
- Specified by:
remove
in interfaceList<Calendar>
- Overrides:
remove
in classAbstractCollection<Calendar>
- Parameters:
item
- The calendar to remove.- Returns:
- If removed returns true, else returns false.
- Throws:
com.aspose.ms.System.InvalidOperationException
- Thrown when calendar cannot be removed.
-
size
public final int size()
Gets the number of objects contained in this
CalendarCollection
object.- Specified by:
size
in interfaceCollection<Calendar>
- Specified by:
size
in interfaceList<Calendar>
- Specified by:
size
in classAbstractCollection<Calendar>
- Returns:
- the number of objects contained in this
CalendarCollection
object.
-
toList
public final List<Calendar> toList()
Converts the CalendarCollection object to a list of
Calendar
objects.- Returns:
- List of
Calendar
objects.
-
remove
public Calendar remove(int index)
Removes the element at the specified position in this list.
-
get
public Calendar get(int index)
(@inheritDoc}
-
set
public Calendar set(int index, Calendar element)
Replaces the element at the specified position in this list with the specified element.
-
sort
public void sort(Comparator<? super T> c)
- Parameters:
c
-
-
-