
**Inheritance:**
java.lang.Object, java.util.AbstractCollection, java.util.AbstractList, com.aspose.tasks.AbstractList

**All Implemented Interfaces:**
com.aspose.tasks.IReadOnlyWorkingTimeCollection
```
public class WorkingTimeCollection extends AbstractList<WorkingTime> implements IReadOnlyWorkingTimeCollection
```

Represents a collection of [WorkingTimeCollection](../../com.aspose.tasks/workingtimecollection) objects.
## Methods

| Method | Description |
| --- | --- |
| [add(WorkingTime e)](#add-com.aspose.tasks.WorkingTime-) | \{@inheritDoc\} |
| [add(int index, WorkingTime element)](#add-int-com.aspose.tasks.WorkingTime-) | Inserts the specified element at the specified position in this list. |
| [clear()](#clear--) | Removes all [WorkingTime](../../com.aspose.tasks/workingtime) items from collection. |
| [contains(Object item)](#contains-java.lang.Object-) | Checks if the specified element is in the List. |
| [get(int index)](#get-int-) | (@inheritDoc\} |
| [indexOf(WorkingTime item)](#indexOf-com.aspose.tasks.WorkingTime-) | Returns the index of the first occurrence of a given item in a list |
| [insert(int index, WorkingTime item)](#insert-int-com.aspose.tasks.WorkingTime-) | Inserts an element into this list at a given index |
| [remove(int index)](#remove-int-) | Removes the element at the specified position in this list. |
| [remove(Object item)](#remove-java.lang.Object-) | Removes `WorkingTime` instance from this collection. |
| [size()](#size--) | Gets the number of objects contained in this [WorkingTimeCollection](../../com.aspose.tasks/workingtimecollection) object. |
| [sort(Comparator&lt;? super WorkingTime&gt; c)](#sort-java.util.Comparator---super-com.aspose.tasks.WorkingTime--) | \{@inheritDoc\} |
| [toList()](#toList--) | Converts the WorkingTimeCollection object to a list of [WorkingTime](../../com.aspose.tasks/workingtime) objects. |
### add(WorkingTime e) {#add-com.aspose.tasks.WorkingTime-}
```
public final boolean add(WorkingTime e)
```




**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| e | [WorkingTime](../../com.aspose.tasks/workingtime) | \{@inheritDoc\} |

**Returns:**
boolean - \{@inheritDoc\}
### add(int index, WorkingTime element) {#add-int-com.aspose.tasks.WorkingTime-}
```
public void add(int index, WorkingTime element)
```


Inserts the specified element at the specified position in this list.

**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| index | int | \{@inheritDoc\} |
| element | [WorkingTime](../../com.aspose.tasks/workingtime) | \{@inheritDoc\} |

### clear() {#clear--}
```
public final void clear()
```


Removes all [WorkingTime](../../com.aspose.tasks/workingtime) items from collection.

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


Checks if the specified element is in the List. Performs a linear O(n) search.

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

**Returns:**
boolean - True, if specified element found in the list, false otherwise.
### get(int index) {#get-int-}
```
public WorkingTime get(int index)
```


(@inheritDoc\}

**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| index | int | \{@inheritDoc\} |

**Returns:**
[WorkingTime](../../com.aspose.tasks/workingtime) - \{@inheritDoc\}
### indexOf(WorkingTime item) {#indexOf-com.aspose.tasks.WorkingTime-}
```
public final int indexOf(WorkingTime item)
```


Returns the index of the first occurrence of a given item in a list

**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| item | [WorkingTime](../../com.aspose.tasks/workingtime) | value to search for. |

**Returns:**
int - the index of the item
### insert(int index, WorkingTime item) {#insert-int-com.aspose.tasks.WorkingTime-}
```
public final void insert(int index, WorkingTime item)
```


Inserts an element into this list at a given index

**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| index | int | an index to insert to |
| item | [WorkingTime](../../com.aspose.tasks/workingtime) | an element to insert |

### remove(int index) {#remove-int-}
```
public WorkingTime remove(int index)
```


Removes the element at the specified position in this list.

**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| index | int | \{@inheritDoc\} |

**Returns:**
[WorkingTime](../../com.aspose.tasks/workingtime) - \{@inheritDoc\}
### remove(Object item) {#remove-java.lang.Object-}
```
public final boolean remove(Object item)
```


Removes `WorkingTime` instance from this collection.

**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| item | java.lang.Object | `WorkingTime` instance to remove. |

**Returns:**
boolean - true if WorkingTime instance was successfully removed from this collection; otherwise, false.
### size() {#size--}
```
public final int size()
```


Gets the number of objects contained in this [WorkingTimeCollection](../../com.aspose.tasks/workingtimecollection) object.

**Returns:**
int - the number of objects contained in this [WorkingTimeCollection](../../com.aspose.tasks/workingtimecollection) object.
### sort(Comparator&lt;? super WorkingTime&gt; c) {#sort-java.util.Comparator---super-com.aspose.tasks.WorkingTime--}
```
public final void sort(Comparator<? super WorkingTime> c)
```




**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| c | java.util.Comparator&lt;? super com.aspose.tasks.WorkingTime&gt; | \{@inheritDoc\} |

### toList() {#toList--}
```
public final List<WorkingTime> toList()
```


Converts the WorkingTimeCollection object to a list of [WorkingTime](../../com.aspose.tasks/workingtime) objects.

**Returns:**
java.util.List&lt;com.aspose.tasks.WorkingTime&gt; - List of [WorkingTime](../../com.aspose.tasks/workingtime) objects.
