test_class.file: ml/streaminer/src/test/java/org/streaminer/stream/cardinality/TestCountThenEstimate.java
test_class.identifier: TestCountThenEstimate
test_case.body: @Test
      public void testMerge() throws CardinalityMergeException
      {
          int numToMerge = 10;
          int tippingPoint = 100;
          int cardinality = 1000;
  
          CountThenEstimate[] ctes = new CountThenEstimate[numToMerge];
  
          for (int i = 0; i < numToMerge; i++)
          {
              ctes[i] = new CountThenEstimate(tippingPoint, AdaptiveCounting.Builder.obyCount(100000));
              for (int j = 0; j < tippingPoint - 1; j++)
              {
                  ctes[i].offer(Math.random());
              }
          }
  
          int expectedCardinality = numToMerge * (tippingPoint - 1);
          long mergedEstimate = CountThenEstimate.mergeEstimators(ctes).cardinality();
          double error = Math.abs(mergedEstimate - expectedCardinality) / (double) expectedCardinality;
          assertEquals(0.01, error, 0.01);
  
          for (int i = 0; i < numToMerge / 2; i++)
          {
              for (int j = tippingPoint - 1; j < cardinality; j++)
              {
                  ctes[i].offer(Math.random());
              }
          }
  
          expectedCardinality = (numToMerge / 2) * (cardinality + tippingPoint - 1);
          mergedEstimate = CountThenEstimate.mergeEstimators(ctes).cardinality();
          error = Math.abs(mergedEstimate - expectedCardinality) / (double) expectedCardinality;
          assertEquals(0.01, error, 0.01);
  
  
          for (int i = numToMerge / 2; i < numToMerge; i++)
          {
              for (int j = tippingPoint - 1; j < cardinality; j++)
              {
                  ctes[i].offer(Math.random());
              }
          }
  
          expectedCardinality = numToMerge * cardinality;
          mergedEstimate = CountThenEstimate.mergeEstimators(ctes).cardinality();
          error = Math.abs(mergedEstimate - expectedCardinality) / (double) expectedCardinality;
          assertEquals(0.01, error, 0.01);
  
  
      }
test_case.class_method_signature: TestCountThenEstimate.testMerge()
test_case.full_signature: @Test public void testMerge()
test_case.identifier: testMerge
test_case.invocations: obyCount offer random cardinality mergeEstimators abs assertEquals offer random cardinality mergeEstimators abs assertEquals offer random cardinality mergeEstimators abs assertEquals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testMerge()
focal_class.declarator: LC = 1
focal_class.modifier: protected final static
focal_class.original_string: protected final static byte LC = 1;
focal_class.type: byte
focal_class.var_name: LC
focal_class.declarator: AC = 2
focal_class.modifier: protected final static
focal_class.original_string: protected final static byte AC = 2;
focal_class.type: byte
focal_class.var_name: AC
focal_class.declarator: HLC = 3
focal_class.modifier: protected final static
focal_class.original_string: protected final static byte HLC = 3;
focal_class.type: byte
focal_class.var_name: HLC
focal_class.declarator: LLC = 4
focal_class.modifier: protected final static
focal_class.original_string: protected final static byte LLC = 4;
focal_class.type: byte
focal_class.var_name: LLC
focal_class.declarator: HLPC = 5
focal_class.modifier: protected final static
focal_class.original_string: protected final static byte HLPC = 5;
focal_class.type: byte
focal_class.var_name: HLPC
focal_class.declarator: tippingPoint
focal_class.modifier: protected
focal_class.original_string: protected int tippingPoint;
focal_class.type: int
focal_class.var_name: tippingPoint
focal_class.declarator: tipped = false
focal_class.modifier: protected
focal_class.original_string: protected boolean tipped = false;
focal_class.type: boolean
focal_class.var_name: tipped
focal_class.declarator: builder
focal_class.modifier: protected
focal_class.original_string: protected IBuilder<IRichCardinality> builder;
focal_class.type: IBuilder<IRichCardinality>
focal_class.var_name: builder
focal_class.declarator: estimator
focal_class.modifier: protected
focal_class.original_string: protected IRichCardinality estimator;
focal_class.type: IRichCardinality
focal_class.var_name: estimator
focal_class.declarator: counter
focal_class.modifier: protected
focal_class.original_string: protected Set<Object> counter;
focal_class.type: Set<Object>
focal_class.var_name: counter
focal_class.file: ml/streaminer/src/main/java/org/streaminer/stream/cardinality/CountThenEstimate.java
focal_class.identifier: CountThenEstimate
focal_class.interfaces: implements IRichCardinality, Externalizable
focal_class.class_method_signature: CountThenEstimate.CountThenEstimate()
focal_class.full_signature: public  CountThenEstimate()
focal_class.identifier: CountThenEstimate
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  CountThenEstimate()
focal_class.class_method_signature: CountThenEstimate.CountThenEstimate(int tippingPoint, IBuilder<IRichCardinality> builder)
focal_class.full_signature: public  CountThenEstimate(int tippingPoint, IBuilder<IRichCardinality> builder)
focal_class.identifier: CountThenEstimate
focal_class.modifiers: public
focal_class.parameters: (int tippingPoint, IBuilder<IRichCardinality> builder)
focal_class.signature:  CountThenEstimate(int tippingPoint, IBuilder<IRichCardinality> builder)
focal_class.class_method_signature: CountThenEstimate.CountThenEstimate(byte[] bytes)
focal_class.full_signature: public  CountThenEstimate(byte[] bytes)
focal_class.identifier: CountThenEstimate
focal_class.modifiers: public
focal_class.parameters: (byte[] bytes)
focal_class.signature:  CountThenEstimate(byte[] bytes)
focal_class.class_method_signature: CountThenEstimate.cardinality()
focal_class.full_signature: @Override public long cardinality()
focal_class.identifier: cardinality
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: long
focal_class.signature: long cardinality()
focal_class.class_method_signature: CountThenEstimate.offerHashed(long hashedLong)
focal_class.full_signature: @Override public boolean offerHashed(long hashedLong)
focal_class.identifier: offerHashed
focal_class.modifiers: @Override public
focal_class.parameters: (long hashedLong)
focal_class.return: boolean
focal_class.signature: boolean offerHashed(long hashedLong)
focal_class.class_method_signature: CountThenEstimate.offerHashed(int hashedInt)
focal_class.full_signature: @Override public boolean offerHashed(int hashedInt)
focal_class.identifier: offerHashed
focal_class.modifiers: @Override public
focal_class.parameters: (int hashedInt)
focal_class.return: boolean
focal_class.signature: boolean offerHashed(int hashedInt)
focal_class.class_method_signature: CountThenEstimate.offer(Object o)
focal_class.full_signature: @Override public boolean offer(Object o)
focal_class.identifier: offer
focal_class.modifiers: @Override public
focal_class.parameters: (Object o)
focal_class.return: boolean
focal_class.signature: boolean offer(Object o)
focal_class.class_method_signature: CountThenEstimate.sizeof()
focal_class.full_signature: @Override public int sizeof()
focal_class.identifier: sizeof
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int sizeof()
focal_class.class_method_signature: CountThenEstimate.tip()
focal_class.full_signature: private void tip()
focal_class.identifier: tip
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void tip()
focal_class.class_method_signature: CountThenEstimate.tipped()
focal_class.full_signature: public boolean tipped()
focal_class.identifier: tipped
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean tipped()
focal_class.class_method_signature: CountThenEstimate.getBytes()
focal_class.full_signature: @Override public byte[] getBytes()
focal_class.identifier: getBytes
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: byte[]
focal_class.signature: byte[] getBytes()
focal_class.class_method_signature: CountThenEstimate.readExternal(ObjectInput in)
focal_class.full_signature: @SuppressWarnings("unchecked") @Override public void readExternal(ObjectInput in)
focal_class.identifier: readExternal
focal_class.modifiers: @SuppressWarnings("unchecked") @Override public
focal_class.parameters: (ObjectInput in)
focal_class.return: void
focal_class.signature: void readExternal(ObjectInput in)
focal_class.class_method_signature: CountThenEstimate.writeExternal(ObjectOutput out)
focal_class.full_signature: @Override public void writeExternal(ObjectOutput out)
focal_class.identifier: writeExternal
focal_class.modifiers: @Override public
focal_class.parameters: (ObjectOutput out)
focal_class.return: void
focal_class.signature: void writeExternal(ObjectOutput out)
focal_class.class_method_signature: CountThenEstimate.merge(IRichCardinality... estimators)
focal_class.full_signature: @Override public IRichCardinality merge(IRichCardinality... estimators)
focal_class.identifier: merge
focal_class.modifiers: @Override public
focal_class.parameters: (IRichCardinality... estimators)
focal_class.return: IRichCardinality
focal_class.signature: IRichCardinality merge(IRichCardinality... estimators)
focal_class.class_method_signature: CountThenEstimate.mergeEstimators(CountThenEstimate... estimators)
focal_class.full_signature: public static CountThenEstimate mergeEstimators(CountThenEstimate... estimators)
focal_class.identifier: mergeEstimators
focal_class.modifiers: public static
focal_class.parameters: (CountThenEstimate... estimators)
focal_class.return: CountThenEstimate
focal_class.signature: CountThenEstimate mergeEstimators(CountThenEstimate... estimators)
focal_method.body: @Override
      public IRichCardinality merge(IRichCardinality... estimators) throws CardinalityMergeException {
          if (estimators == null) {
              return mergeEstimators(this);
          }
          
          CountThenEstimate[] all = Arrays.copyOf(estimators, estimators.length + 1, CountThenEstimate[].class);
          all[all.length - 1] = this;
          return mergeEstimators(all);
      }
focal_method.class_method_signature: CountThenEstimate.merge(IRichCardinality... estimators)
focal_method.full_signature: @Override public IRichCardinality merge(IRichCardinality... estimators)
focal_method.identifier: merge
focal_method.invocations: mergeEstimators copyOf mergeEstimators
focal_method.modifiers: @Override public
focal_method.parameters: (IRichCardinality... estimators)
focal_method.return: IRichCardinality
focal_method.signature: IRichCardinality merge(IRichCardinality... estimators)