ViewCollection

Inheritance: java.lang.Object, java.util.AbstractCollection

public class ViewCollection extends AbstractCollection<View>

Contains a list of View objects. Extends AbstractCollection class.

Methods

MethodDescription
add(View item)Adds the specified item to this collection.
clear()Removes all items from this collection.
contains(View item)Returns true if the specified item is found in this collection; otherwise, false.
copyTo(View[] array, int arrayIndex)Copies the elements of this collection to the specified array, starting at the specified array index.
getByName(String viewName)Searches for a View with the name, and returns the first occurrence within the collection.
getByViewScreen(int screen)Searches for a View with the specified Screen property, and returns the first occurrence within the collection.
getParentProject()Gets the parent of the View object.
iterator()Returns an iterator over the elements contained in this collection.
remove(View item)Removes the first occurrence of a specific object from this collection.
size()Gets the number of elements contained in this collection.
toList()Converts a view collection to a list of View objects.

add(View item)

public final boolean add(View item)

Adds the specified item to this collection.

Parameters:

ParameterTypeDescription
itemViewthe specified item to add to this collection.

Returns: boolean - true if the operation was successful.

clear()

public final void clear()

Removes all items from this collection.

contains(View item)

public final boolean contains(View item)

Returns true if the specified item is found in this collection; otherwise, false.

Parameters:

ParameterTypeDescription
itemViewthe specified item to find.

Returns: boolean - true if the specified item is found in this collection; otherwise, false.

copyTo(View[] array, int arrayIndex)

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:

ParameterTypeDescription
arrayView[]the specified one-dimensional array to copy elements to
arrayIndexintthe zero-based index of the specified array at which copying begins.

getByName(String viewName)

public final View getByName(String viewName)

Searches for a View with the name, and returns the first occurrence within the collection.

Parameters:

ParameterTypeDescription
viewNamejava.lang.StringName of the View to search.

Returns: View - The first View in collection with the specified name, if found; otherwise, null.

getByViewScreen(int screen)

public final View getByViewScreen(int screen)

Searches for a View with the specified Screen property, and returns the first occurrence within the collection.

Parameters:

ParameterTypeDescription
screenintViewScreen enumeration value.

Returns: View - 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: Project - the parent of the View object.

iterator()

public Iterator<View> iterator()

Returns an iterator over the elements contained in this collection.

Returns: java.util.Iterator<com.aspose.tasks.View> - collection iterator.

remove(View item)

public final boolean remove(View item)

Removes the first occurrence of a specific object from this collection.

Parameters:

ParameterTypeDescription
itemViewthe specified object to remove.

Returns: boolean - 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.

Returns: int - the number of elements contained in this collection.

toList()

public final List<View> toList()

Converts a view collection to a list of View objects.

Returns: java.util.List<com.aspose.tasks.View> - Generic list of View objects.