
**Inheritance:**
java.lang.Object, java.util.AbstractCollection, java.util.AbstractList, com.aspose.tasks.AbstractList
```
public class AvailabilityPeriodCollection extends AbstractList<AvailabilityPeriod>
```

Represents a collection which contains [AvailabilityPeriod](../../com.aspose.tasks/availabilityperiod) objects.
## Methods

| Method | Description |
| --- | --- |
| [add(AvailabilityPeriod item)](#add-com.aspose.tasks.AvailabilityPeriod-) | Adds the specified item to this collection. |
| [clear()](#clear--) | Removes all items from this collection. |
| [contains(Object item)](#contains-java.lang.Object-) | Returns true if the specified item is found in this collection; otherwise, false. |
| [get(int index)](#get-int-) | Gets the parent [Resource](../../com.aspose.tasks/resource) for this object. |
| [getParentResource()](#getParentResource--) | Gets the parent [Resource](../../com.aspose.tasks/resource) for this object. |
| [indexOf(Object item)](#indexOf-java.lang.Object-) | Determines the index of the specified item in this collection. |
| [iterator()](#iterator--) | Returns an iterator for this collection. |
| [remove(int index)](#remove-int-) | Removes the element at the specified position in this collection and returns the element that was removed from the collection. |
| [remove(Object item)](#remove-java.lang.Object-) | Removes the first occurrence of a specific object from this collection. |
| [set(int index, AvailabilityPeriod item)](#set-int-com.aspose.tasks.AvailabilityPeriod-) | Replaces the element at the specified position in this list with the specified element. |
| [size()](#size--) | Returns the number of elements in this collection. |
### add(AvailabilityPeriod item) {#add-com.aspose.tasks.AvailabilityPeriod-}
```
public final boolean add(AvailabilityPeriod item)
```


Adds the specified item to this collection.

**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| item | [AvailabilityPeriod](../../com.aspose.tasks/availabilityperiod) | the specified item to add to this collection. |

**Returns:**
boolean - true if the specified item was added successfully; otherwise, false.
### clear() {#clear--}
```
public final void clear()
```


Removes all items from this collection.

### contains(Object item) {#contains-java.lang.Object-}
```
public final boolean contains(Object item)
```


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

**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| item | java.lang.Object | the specified item to find. |

**Returns:**
boolean - true if the specified item is found in this collection; otherwise, false.
### get(int index) {#get-int-}
```
public AvailabilityPeriod get(int index)
```


Gets the parent [Resource](../../com.aspose.tasks/resource) for this object.

**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| index | int | specified position to getInternal element at. |

**Returns:**
[AvailabilityPeriod](../../com.aspose.tasks/availabilityperiod) - the element at the specified position in this collection.
### getParentResource() {#getParentResource--}
```
public final Resource getParentResource()
```


Gets the parent [Resource](../../com.aspose.tasks/resource) for this object.

**Returns:**
[Resource](../../com.aspose.tasks/resource) - Parent [Resource](../../com.aspose.tasks/resource) object for this collection.
### indexOf(Object item) {#indexOf-java.lang.Object-}
```
public final int indexOf(Object item)
```


Determines the index of the specified item in this collection.

**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| item | java.lang.Object | the specified item to locate in this collection. |

**Returns:**
int - the index of the specified item if found; otherwise, -1.
### iterator() {#iterator--}
```
public Iterator<AvailabilityPeriod> iterator()
```


Returns an iterator for this collection.

**Returns:**
java.util.Iterator&lt;com.aspose.tasks.AvailabilityPeriod&gt; - an iterator for this collection.
### remove(int index) {#remove-int-}
```
public AvailabilityPeriod remove(int index)
```


Removes the element at the specified position in this collection and returns the element that was removed from the collection.

**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| index | int | the specified position to remove the element at. |

**Returns:**
[AvailabilityPeriod](../../com.aspose.tasks/availabilityperiod) - the element that was removed from the collection.
### remove(Object item) {#remove-java.lang.Object-}
```
public final boolean remove(Object item)
```


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

**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| item | java.lang.Object | the specified object to remove. |

**Returns:**
boolean - true if the specified object was successfully removed from this collection; otherwise, false.
### set(int index, AvailabilityPeriod item) {#set-int-com.aspose.tasks.AvailabilityPeriod-}
```
public AvailabilityPeriod set(int index, AvailabilityPeriod item)
```


Replaces the element at the specified position in this list with the specified element.

**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| index | int | the specified position to replace element at. |
| item | [AvailabilityPeriod](../../com.aspose.tasks/availabilityperiod) | the specified element to replace the element at the specified position. |

**Returns:**
[AvailabilityPeriod](../../com.aspose.tasks/availabilityperiod) - the element replaced by the specified element at the specified position.
### size() {#size--}
```
public final int size()
```


Returns the number of elements in this collection.

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