
**Inheritance:**
java.lang.Object, [com.aspose.cells.CollectionBase](../../com.aspose.cells/collectionbase)
```
public class PivotFieldCollection extends CollectionBase
```

Represents a collection of all the PivotField objects in the different regions of the pivot table.
## Methods

| Method | Description |
| --- | --- |
| [add(PivotField pivotField)](#add-com.aspose.cells.PivotField-) | Adds a PivotField Object to the specific type PivotFields. |
| [add(Object o)](#add-java.lang.Object-) | Adds an item to the CollectionBase instance. |
| [addByBaseIndex(int baseFieldIndex)](#addByBaseIndex-int-) | Adds a PivotField Object to the specific type PivotFields. |
| [clear()](#clear--) | clear all fields of PivotFieldCollection |
| [contains(Object o)](#contains-java.lang.Object-) | Return whether instance contains this object |
| [equals(Object arg0)](#equals-java.lang.Object-) |  |
| [get(int index)](#get-int-) | Gets the PivotField Object at the specific index. |
| [get(String name)](#get-java.lang.String-) | Gets the PivotField Object of the specific name. |
| [getClass()](#getClass--) |  |
| [getCount()](#getCount--) | Gets the number of elements contained in the CollectionBase instance. |
| [getType()](#getType--) | Gets the PivotFields type. |
| [hashCode()](#hashCode--) |  |
| [indexOf(Object o)](#indexOf-java.lang.Object-) | Determines the index of a specific item in the CollectionBase instance. |
| [insert(int index, PivotField pivotField)](#insert-int-com.aspose.cells.PivotField-) | Insert a pivot field at specific index. |
| [iterator()](#iterator--) | Returns an enumerator that iterates through the CollectionBase instance. |
| [move(int currPos, int destPos)](#move-int-int-) | Moves the PivotField from current position to destination position |
| [notify()](#notify--) |  |
| [notifyAll()](#notifyAll--) |  |
| [remove(PivotField pivotField)](#remove-com.aspose.cells.PivotField-) | Removes field from the current region. |
| [removeAt(int index)](#removeAt-int-) | Removes field by the index. |
| [toString()](#toString--) |  |
| [wait()](#wait--) |  |
| [wait(long arg0)](#wait-long-) |  |
| [wait(long arg0, int arg1)](#wait-long-int-) |  |
### add(PivotField pivotField) {#add-com.aspose.cells.PivotField-}
```
public int add(PivotField pivotField)
```


Adds a PivotField Object to the specific type PivotFields.

**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| pivotField | [PivotField](../../com.aspose.cells/pivotfield) | a PivotField Object. |

**Returns:**
int - the index of the PivotField Object in this PivotFields.
### add(Object o) {#add-java.lang.Object-}
```
public int add(Object o)
```


Adds an item to the CollectionBase instance.

**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| o | java.lang.Object | The Object to add to the CollectionBase instance. |

**Returns:**
int - The position into which the new element was inserted.
### addByBaseIndex(int baseFieldIndex) {#addByBaseIndex-int-}
```
public int addByBaseIndex(int baseFieldIndex)
```


Adds a PivotField Object to the specific type PivotFields.

**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| baseFieldIndex | int | field index in the base PivotFields. |

**Returns:**
int - the index of the PivotField Object in this PivotFields.
### clear() {#clear--}
```
public void clear()
```


clear all fields of PivotFieldCollection

### contains(Object o) {#contains-java.lang.Object-}
```
public boolean contains(Object o)
```


Return whether instance contains this object

**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| o | java.lang.Object | test object |

**Returns:**
boolean - Whether instance contains this object
### equals(Object arg0) {#equals-java.lang.Object-}
```
public boolean equals(Object arg0)
```




**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| arg0 | java.lang.Object |  |

**Returns:**
boolean
### get(int index) {#get-int-}
```
public PivotField get(int index)
```


Gets the PivotField Object at the specific index.

**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| index | int |  |

**Returns:**
[PivotField](../../com.aspose.cells/pivotfield)
### get(String name) {#get-java.lang.String-}
```
public PivotField get(String name)
```


Gets the PivotField Object of the specific name.

**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| name | java.lang.String |  |

**Returns:**
[PivotField](../../com.aspose.cells/pivotfield)
### getClass() {#getClass--}
```
public final native Class<?> getClass()
```




**Returns:**
java.lang.Class<?>
### getCount() {#getCount--}
```
public int getCount()
```


Gets the number of elements contained in the CollectionBase instance.

**Returns:**
int - The number of elements contained in the CollectionBase instance.
### getType() {#getType--}
```
public int getType()
```


Gets the PivotFields type.

See [PivotFieldType](../../com.aspose.cells/pivotfieldtype).

**Returns:**
int
### hashCode() {#hashCode--}
```
public native int hashCode()
```




**Returns:**
int
### indexOf(Object o) {#indexOf-java.lang.Object-}
```
public int indexOf(Object o)
```


Determines the index of a specific item in the CollectionBase instance.

**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| o | java.lang.Object | Determines the index of a specific item in the CollectionBase instance. |

**Returns:**
int - The index of value if found in the list; otherwise, -1.
### insert(int index, PivotField pivotField) {#insert-int-com.aspose.cells.PivotField-}
```
public void insert(int index, PivotField pivotField)
```


Insert a pivot field at specific index.

**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| index | int | The index. |
| pivotField | [PivotField](../../com.aspose.cells/pivotfield) | The field. |

### iterator() {#iterator--}
```
public Iterator iterator()
```


Returns an enumerator that iterates through the CollectionBase instance.

**Returns:**
java.util.Iterator - An iterator for the CollectionBase instance.
### move(int currPos, int destPos) {#move-int-int-}
```
public void move(int currPos, int destPos)
```


Moves the PivotField from current position to destination position

**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| currPos | int | Current position of PivotField based on zero |
| destPos | int | Destination position of PivotField based on zero |

### notify() {#notify--}
```
public final native void notify()
```




### notifyAll() {#notifyAll--}
```
public final native void notifyAll()
```




### remove(PivotField pivotField) {#remove-com.aspose.cells.PivotField-}
```
public void remove(PivotField pivotField)
```


Removes field from the current region.

**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| pivotField | [PivotField](../../com.aspose.cells/pivotfield) |  |

### removeAt(int index) {#removeAt-int-}
```
public void removeAt(int index)
```


Removes field by the index. Only for filter,row,column,data region.

**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| index | int |  |

### toString() {#toString--}
```
public String toString()
```




**Returns:**
java.lang.String
### wait() {#wait--}
```
public final void wait()
```




### wait(long arg0) {#wait-long-}
```
public final native void wait(long arg0)
```




**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| arg0 | long |  |

### wait(long arg0, int arg1) {#wait-long-int-}
```
public final void wait(long arg0, int arg1)
```




**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| arg0 | long |  |
| arg1 | int |  |

