# Grid Aggregate Java SequenceIterator Methods

> The Grid Aggregate Java SequenceIterator methods take an integer interval argument and produce a result sequence containing the calculated aggregate for each interval.

> SequenceIterator gridAggMax(int interval) | Returns a sequence with the maximum value for each interval of elements
> SequenceIterator gridAggMin(int interval) | Returns a sequence with the minimum value for each interval of elements
> SequenceIterator gridAggSum(int interval) | Returns a sequence with the sum of each interval of elements
> SequenceIterator gridAggAvg(int interval) | Returns a sequence with the average of each interval of elements
> SequenceIterator gridAggVar(int interval) | Returns a sequence with the variance of each interval of elements
> SequenceIterator gridAggVarSamp(int interval) | Returns a sequence with the sample variance of each interval of elements
> SequenceIterator gridAggDev(int interval) | Returns a sequence with the standard deviation of each interval of elements
> SequenceIterator gridAggDevSamp(int interval) | Returns a sequence with the sample standard deviation of each interval of elements

> ## Example

> Following is an example code snippet demonstrating a grid aggregate method:

>         public static void gridAggregate(Connection con)
>         {
>             con.startTransaction(Database.TransactionType.ReadOnly);

>             Cursor<Quote> cursor = new Cursor<Quote>(con, Quote.class, "symbol");
>             for (Quote quote : cursor)
>             {
>                 SequenceIterator gridMax = quote.close.iterator().gridAggMax(7));
>                 ...
>             }
>             con.commitTransaction();
>         }