# The Java GroupByResult Class

GroupByResult represents the result of `group by` aggregation operation

### For an overview see page Java Classes

### Class Definition

        public  class GroupByResult implements java.io.Closeable
        {
            private SequenceIterator aggIterator;
            private SequenceIterator grpIterator;

            GroupByResult(long[] handles)
            {
                aggIterator = new SequenceIterator(handles[0]);
                grpIterator = new SequenceIterator(handles[1]);
            }

            public SequenceIterator getAggIterator()
            {
                return aggIterator;
            }

            public SequenceIterator getGroupIterator()
            {
                return grpIterator;
            }

            public void close()
            {
                if (grpIterator != null)
                {
                    close(grpIterator.handle);
                    grpIterator = null;
                    aggIterator = null;
                }
            }
        };

### Methods

`GroupByResult(long[] handles)` | Constructor: Return a GroupByResult instance
`public SequenceIterator getAggIterator()` | Return the sequence iterator of the calculated aggregates for each group
`public SequenceIterator getGroupIterator()` | Return the sequence iterator of the group values
`public void close()` | Release the memory used by hash table