1 21 22 package org.apache.derby.impl.sql.execute; 23 24 import org.apache.derby.iapi.services.sanity.SanityManager; 25 import org.apache.derby.iapi.error.StandardException; 26 import org.apache.derby.iapi.sql.execute.ExecAggregator; 27 import org.apache.derby.iapi.types.DataValueDescriptor; 28 import java.io.ObjectOutput ; 29 import java.io.ObjectInput ; 30 import java.io.IOException ; 31 32 38 abstract class SystemAggregator implements ExecAggregator 39 { 40 41 private boolean eliminatedNulls; 42 43 44 public boolean didEliminateNulls() { 45 return eliminatedNulls; 46 } 47 48 public void accumulate(DataValueDescriptor addend, Object ga) 49 throws StandardException 50 { 51 if ((addend == null) || addend.isNull()) { 52 eliminatedNulls = true; 53 return; 54 } 55 56 this.accumulate(addend); 57 } 58 59 protected abstract void accumulate(DataValueDescriptor addend) 60 throws StandardException; 61 67 public void writeExternal(ObjectOutput out) throws IOException 68 { 69 out.writeBoolean(eliminatedNulls); 70 } 71 72 public void readExternal(ObjectInput in) 73 throws IOException , ClassNotFoundException 74 { 75 eliminatedNulls = in.readBoolean(); 76 } 77 } 78 | Popular Tags |