1 package com.daffodilwoods.daffodildb.server.sql99.dql.tableexpression.groupbyclause; 2 3 import java.util.*; 4 import com.daffodilwoods.daffodildb.server.sql99.common.*; 5 import com.daffodilwoods.daffodildb.server.sql99.utils.*; 6 import com.daffodilwoods.database.resource.*; 7 8 18 public class groupingsetlist implements com.daffodilwoods.daffodildb.utils.parser.StatementExecuter { 19 22 public groupingset[] _OptRepScomma94843605groupingset0; 23 30 public Object run(Object object) throws com.daffodilwoods.database.resource.DException { 31 int length = _OptRepScomma94843605groupingset0.length; 32 Object [] result = new Object [length]; 33 for (int i = 0; i < length; i++) { 34 Object obj = _OptRepScomma94843605groupingset0[i].run(object); 35 result[i] = obj instanceof Object [] ? ( (Object [])obj )[0] : obj; 36 } 37 return result; 38 } 39 public ColumnDetails[] getColumnDetails() throws DException { 40 ArrayList aList = new ArrayList(5); 41 for (int i = 0; i < _OptRepScomma94843605groupingset0.length; i++) { 42 aList.addAll(Arrays.asList(_OptRepScomma94843605groupingset0[i].getColumnDetails())); 43 } 44 return (ColumnDetails[]) aList.toArray(new ColumnDetails[0]); 45 } 46 47 public void getColumnsIncluded(ArrayList aList) throws DException { 48 for (int i = 0; i < _OptRepScomma94843605groupingset0.length; i++) { 49 _OptRepScomma94843605groupingset0[i].getColumnsIncluded(aList); 50 } 51 } 52 53 public void getTablesIncluded(ArrayList aList) throws DException { 54 } 55 56 public String toString() { 57 StringBuffer sb = new StringBuffer (); 58 sb.append(" "); 59 sb.append(_OptRepScomma94843605groupingset0[0]); 60 for (int i = 1; i < _OptRepScomma94843605groupingset0.length; i++) { 61 sb.append(",").append(_OptRepScomma94843605groupingset0[i]); 62 } 63 return sb.toString(); 64 } 65 66 public Object clone() throws CloneNotSupportedException { 67 groupingsetlist tempClass = new groupingsetlist(); 68 if (_OptRepScomma94843605groupingset0 != null) { 69 groupingset[] temp_OptRepScomma94843605groupingset0 = new groupingset[_OptRepScomma94843605groupingset0.length]; 70 for (int i = 0; i < _OptRepScomma94843605groupingset0.length; i++) { 71 temp_OptRepScomma94843605groupingset0[i] = (groupingset) _OptRepScomma94843605groupingset0[i].clone(); 72 } 73 tempClass._OptRepScomma94843605groupingset0 = temp_OptRepScomma94843605groupingset0; 74 } 75 return tempClass; 76 } 77 85 public _Reference[] getReferences(TableDetails[] tableDetails) throws DException { 86 ArrayList aList = new ArrayList(5); 87 for (int i = 0; i < _OptRepScomma94843605groupingset0.length; i++) { 88 _Reference[] tempRef = _OptRepScomma94843605groupingset0[i].getReferences(tableDetails); 89 if (tempRef != null) { 90 aList.addAll(Arrays.asList(tempRef)); 91 } 92 } 93 return (_Reference[]) aList.toArray(new _Reference[0]); 94 } 95 } 96 | Popular Tags |