1 21 22 package org.apache.derby.impl.sql.execute; 23 24 import org.apache.derby.iapi.services.io.StoredFormatIds; 25 import org.apache.derby.iapi.services.io.FormatIdUtil; 26 import org.apache.derby.iapi.services.io.Formatable; 27 28 import java.io.ObjectOutput ; 29 import java.io.ObjectInput ; 30 import java.io.IOException ; 31 import java.util.Vector ; 32 33 40 public class AggregatorInfoList extends Vector implements Formatable 41 { 42 58 59 62 public AggregatorInfoList() {} 63 64 69 public boolean hasDistinct() 70 { 71 int count = size(); 72 for (int i = 0; i < count; i++) 73 { 74 AggregatorInfo aggInfo = (AggregatorInfo) elementAt(i); 75 if (aggInfo.isDistinct()) 76 { 77 return true; 78 } 79 } 80 return false; 81 } 82 83 89 90 public void writeExternal(ObjectOutput out) throws IOException 91 { 92 int count = size(); 93 out.writeInt(count); 94 for (int i = 0; i < count; i++) 95 { 96 out.writeObject(elementAt(i)); 97 } 98 } 99 100 106 public void readExternal(ObjectInput in) throws IOException , ClassNotFoundException 107 { 108 int count = in.readInt(); 109 110 ensureCapacity(count); 111 for (int i = 0; i < count; i++) 112 { 113 AggregatorInfo agg = (AggregatorInfo)in.readObject(); 114 addElement(agg); 115 } 116 } 117 118 123 public int getTypeFormatId() { return StoredFormatIds.AGG_INFO_LIST_V01_ID; } 124 125 } 131 | Popular Tags |