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
Calendarobjects.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Calendaradd(String name)Adds a new base calendar to this CalendarCollection object and returns added calendar.Calendaradd(String name, Calendar baseCalendar)Adds a new calendar with specified base calendar to this CalendarCollection object and returns added calendar.voidclear()Removes all of the elements from this collection.Calendarget(int index)(@inheritDoc}CalendargetByName(String name)Returns a calendar with the specified name.CalendargetByUid(int uid)Returns a calendar with the specified UID.ProjectgetParentProject()Gets a parentProjectof this object.Iterator<Calendar>iterator()Returns an enumerator for this collection.Calendarremove(int index)Removes the element at the specified position in this list.booleanremove(Object item)Removes Calendar from Project CalendarCollection.Calendarset(int index, Calendar element)Replaces the element at the specified position in this list with the specified element.intsize()Gets the number of objects contained in thisCalendarCollectionobject.voidsort(Comparator<? super T> c)List<Calendar>toList()Converts the CalendarCollection object to a list ofCalendarobjects.-
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
Calendarobject. - 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
Calendarobject.
-
clear
public final void clear()
Removes all of the elements from this collection.- Specified by:
clearin interfaceCollection<Calendar>- Specified by:
clearin interfaceList<Calendar>- Overrides:
clearin 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
public final Project getParentProject()
Gets a parent
Projectof this object.- Returns:
- a parent
Projectof this object.
-
remove
public final boolean remove(Object item)
Removes Calendar from Project CalendarCollection.
- Specified by:
removein interfaceCollection<Calendar>- Specified by:
removein interfaceList<Calendar>- Overrides:
removein 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
CalendarCollectionobject.- Specified by:
sizein interfaceCollection<Calendar>- Specified by:
sizein interfaceList<Calendar>- Specified by:
sizein classAbstractCollection<Calendar>- Returns:
- the number of objects contained in this
CalendarCollectionobject.
-
toList
public final List<Calendar> toList()
Converts the CalendarCollection object to a list of
Calendarobjects.- Returns:
- List of
Calendarobjects.
-
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-
-
-