Class ViewCollection
- java.lang.Object
-
- java.util.AbstractCollection<View>
-
- com.aspose.tasks.ViewCollection
-
- All Implemented Interfaces:
Iterable<View>
,Collection<View>
public class ViewCollection extends AbstractCollection<View>
Contains a list of
View
objects. ExtendsAbstractCollection<View>
class.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
add(View item)
Adds the specified item to this collection.void
clear()
Removes all items from this collection.boolean
contains(View item)
Returns true if the specified item is found in this collection; otherwise, false.void
copyTo(View[] array, int arrayIndex)
Copies the elements of this collection to the specified array, starting at the specified array index.View
getByName(String viewName)
Searches for a View with the name, and returns the first occurrence within the collection.View
getByViewScreen(int screen)
Searches for a View with the specified Screen property, and returns the first occurrence within the collection.Project
getParentProject()
Gets the parent of the View object.Iterator<View>
iterator()
Returns an iterator over the elements contained in this collection.boolean
remove(View item)
Removes the first occurrence of a specific object from this collection.int
size()
Gets the number of elements contained in this collection.List<View>
toList()
Converts a view collection to a list ofView
objects.-
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
equals, hashCode, parallelStream, removeIf, spliterator, stream, toArray
-
-
-
-
Method Detail
-
add
public final boolean add(View item)
Adds the specified item to this collection.
- Specified by:
add
in interfaceCollection<View>
- Overrides:
add
in classAbstractCollection<View>
- Parameters:
item
- the specified item to add to this collection.- Returns:
- true if the operation was successful.
-
clear
public final void clear()
Removes all items from this collection.
- Specified by:
clear
in interfaceCollection<View>
- Overrides:
clear
in classAbstractCollection<View>
-
contains
public final boolean contains(View item)
Returns true if the specified item is found in this collection; otherwise, false.
- Parameters:
item
- the specified item to find.- Returns:
- true if the specified item is found in this collection; otherwise, false.
-
copyTo
public final void copyTo(View[] array, int arrayIndex)
Copies the elements of this collection to the specified array, starting at the specified array index.
- Parameters:
array
- the specified one-dimensional array to copy elements toarrayIndex
- the zero-based index of the specified array at which copying begins.
-
getByName
public final View getByName(String viewName)
Searches for a View with the name, and returns the first occurrence within the collection.
- Parameters:
viewName
- Name of the View to search.- Returns:
- The first View in collection with the specified name, if found; otherwise, null.
-
getByViewScreen
public final View getByViewScreen(int screen)
Searches for a View with the specified Screen property, and returns the first occurrence within the collection.
- Parameters:
screen
-ViewScreen
enumeration value.- Returns:
- The first View in collection which Screen property matches the specified screen argument, if found; otherwise, null.
-
getParentProject
public final Project getParentProject()
Gets the parent of the View object. Read-only
Project
.- Returns:
- the parent of the View object.
-
iterator
public Iterator<View> iterator()
Returns an iterator over the elements contained in this collection.- Specified by:
iterator
in interfaceCollection<View>
- Specified by:
iterator
in interfaceIterable<View>
- Specified by:
iterator
in classAbstractCollection<View>
- Returns:
- collection iterator.
-
remove
public final boolean remove(View item)
Removes the first occurrence of a specific object from this collection.
- Parameters:
item
- the specified object to remove.- Returns:
- true if the specified object was successfully removed from this collection; otherwise, false.
-
size
public final int size()
Gets the number of elements contained in this collection.
- Specified by:
size
in interfaceCollection<View>
- Specified by:
size
in classAbstractCollection<View>
- Returns:
- the number of elements contained in this collection.
-
-