001    /*
002    // $Id: //open/mondrian/src/main/mondrian/rolap/agg/GroupingSet.java#4 $
003    // This software is subject to the terms of the Common Public License
004    // Agreement, available at the following URL:
005    // http://www.opensource.org/licenses/cpl.html.
006    // Copyright (C) 2004-2008 Julian Hyde and others
007    // All Rights Reserved.
008    // You must accept the terms of that agreement to use this software.
009    */
010    package mondrian.rolap.agg;
011    
012    import mondrian.rolap.BitKey;
013    import mondrian.rolap.RolapStar;
014    
015    /**
016     * <p>The <code>GroupingSet</code> stores the information about an
017     * {@link mondrian.rolap.agg.Aggregation} which can be represented
018     * as a GROUP BY GROUPING SET in a SQL query.</p>
019     *
020     * @author Thiyagu
021     * @version $Id: //open/mondrian/src/main/mondrian/rolap/agg/GroupingSet.java#4 $
022     * @since 05-Jun-2007
023     */
024    
025    public class GroupingSet {
026        private final Segment[] segments;
027        private final BitKey levelBitKey;
028        private final BitKey measureBitKey;
029        private final Aggregation.Axis[] axes;
030        private final RolapStar.Column[] columns;
031    
032        public GroupingSet(
033            Segment[] segments, BitKey levelBitKey, BitKey measureBitKey,
034            Aggregation.Axis[] axes, RolapStar.Column[] columns)
035        {
036            this.segments = segments;
037            this.levelBitKey = levelBitKey;
038            this.measureBitKey = measureBitKey;
039            this.axes = axes;
040            this.columns = columns;
041        }
042    
043    
044        public Segment[] getSegments() {
045            return segments;
046        }
047    
048        public BitKey getLevelBitKey() {
049            return levelBitKey;
050        }
051    
052        public BitKey getMeasureBitKey() {
053            return measureBitKey;
054        }
055    
056        public Aggregation.Axis[] getAxes() {
057            return axes;
058        }
059    
060        public RolapStar.Column[] getColumns() {
061            return columns;
062        }
063    
064        /**
065         * Sets all the segments which are in loading state as failed
066         */
067        public void setSegmentsFailed() {
068            for (Segment segment : segments) {
069                segment.setFailIfStillLoading();
070            }
071        }
072    }
073    
074    // End GroupingSet.java