test_class.declarator: message = "272"
test_class.modifier: static final
test_class.original_string: static final String message = "272";
test_class.type: String
test_class.var_name: message
test_class.declarator: correctIdx = new int[]{9754050, 11917035, 12238481, 14522717, 5947587, 1548765, 7212604, 12309647, 16066215, 1232510, 10694178, 14271239, 4784036, 15510045, 304956, 5224878}
test_class.modifier: static final
test_class.original_string: static final int[] correctIdx = new int[]{9754050, 11917035, 12238481, 14522717, 5947587, 1548765, 7212604, 12309647, 16066215, 1232510, 10694178, 14271239, 4784036, 15510045, 304956, 5224878};
test_class.type: int[]
test_class.var_name: correctIdx
test_class.declarator: correctHash = "C2D594EBD6B591BEBA5D99DDC3C05ADDA1173C0E"
test_class.modifier: static final
test_class.original_string: static final String correctHash = "C2D594EBD6B591BEBA5D99DDC3C05ADDA1173C0E";
test_class.type: String
test_class.var_name: correctHash
test_class.file: ml/streaminer/src/test/java/org/streaminer/stream/avg/TEWMATest.java
test_class.identifier: TEWMATest
test_case.body: @Test
      public void testAdd() {
          System.out.println("testAdd");
          TEWMA tewma = new TEWMA(16, 24, 0.3, 10);
          
          double value = tewma.add(272, 1, System.currentTimeMillis()/1000);
          System.out.println("Value: " + value);
          
          assertEquals(Math.ceil(1.203972), Math.ceil(value), 0);
      }
test_case.class_method_signature: TEWMATest.testAdd()
test_case.full_signature: @Test public void testAdd()
test_case.identifier: testAdd
test_case.invocations: println add currentTimeMillis println assertEquals ceil ceil
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testAdd()
focal_class.declarator: hexArray = "0123456789ABCDEF".toCharArray()
focal_class.modifier: private static final
focal_class.original_string: private static final char[] hexArray = "0123456789ABCDEF".toCharArray();
focal_class.type: char[]
focal_class.var_name: hexArray
focal_class.declarator: sha1
focal_class.modifier: private
focal_class.original_string: private MessageDigest sha1;
focal_class.type: MessageDigest
focal_class.var_name: sha1
focal_class.declarator: beta
focal_class.modifier: private
focal_class.original_string: private double beta;
focal_class.type: double
focal_class.var_name: beta
focal_class.declarator: logBeta
focal_class.modifier: private
focal_class.original_string: private double logBeta;
focal_class.type: double
focal_class.var_name: logBeta
focal_class.declarator: nhash
focal_class.modifier: private
focal_class.original_string: private int nhash;
focal_class.type: int
focal_class.var_name: nhash
focal_class.declarator: shash
focal_class.modifier: private
focal_class.original_string: private int shash;
focal_class.type: int
focal_class.var_name: shash
focal_class.declarator: w
focal_class.modifier: private
focal_class.original_string: private double w;
focal_class.type: double
focal_class.var_name: w
focal_class.declarator: digest
focal_class.modifier: private
focal_class.original_string: private int digest;
focal_class.type: int
focal_class.var_name: digest
focal_class.declarator: counters
focal_class.modifier: private
focal_class.original_string: private double[] counters;
focal_class.type: double[]
focal_class.var_name: counters
focal_class.declarator: timers
focal_class.modifier: private
focal_class.original_string: private long[] timers;
focal_class.type: long[]
focal_class.var_name: timers
focal_class.file: ml/streaminer/src/main/java/org/streaminer/stream/avg/TEWMA.java
focal_class.identifier: TEWMA
focal_class.class_method_signature: TEWMA.TEWMA(int nhash, int shash, double beta, double w)
focal_class.full_signature: public  TEWMA(int nhash, int shash, double beta, double w)
focal_class.identifier: TEWMA
focal_class.modifiers: public
focal_class.parameters: (int nhash, int shash, double beta, double w)
focal_class.signature:  TEWMA(int nhash, int shash, double beta, double w)
focal_class.class_method_signature: TEWMA.add(Object item, double quantity, long timestamp)
focal_class.full_signature: public double add(Object item, double quantity, long timestamp)
focal_class.identifier: add
focal_class.modifiers: public
focal_class.parameters: (Object item, double quantity, long timestamp)
focal_class.return: double
focal_class.signature: double add(Object item, double quantity, long timestamp)
focal_class.class_method_signature: TEWMA.check(Object item, long timestamp)
focal_class.full_signature: public double check(Object item, long timestamp)
focal_class.identifier: check
focal_class.modifiers: public
focal_class.parameters: (Object item, long timestamp)
focal_class.return: double
focal_class.signature: double check(Object item, long timestamp)
focal_class.class_method_signature: TEWMA.getMinCounter(int[] idx, long timestamp)
focal_class.full_signature: protected double getMinCounter(int[] idx, long timestamp)
focal_class.identifier: getMinCounter
focal_class.modifiers: protected
focal_class.parameters: (int[] idx, long timestamp)
focal_class.return: double
focal_class.signature: double getMinCounter(int[] idx, long timestamp)
focal_class.class_method_signature: TEWMA.indexes(Object o)
focal_class.full_signature: protected int[] indexes(Object o)
focal_class.identifier: indexes
focal_class.modifiers: protected
focal_class.parameters: (Object o)
focal_class.return: int[]
focal_class.signature: int[] indexes(Object o)
focal_class.class_method_signature: TEWMA.bytesToHex(byte[] bytes)
focal_class.full_signature: protected String bytesToHex(byte[] bytes)
focal_class.identifier: bytesToHex
focal_class.modifiers: protected
focal_class.parameters: (byte[] bytes)
focal_class.return: String
focal_class.signature: String bytesToHex(byte[] bytes)
focal_class.class_method_signature: TEWMA.toSHA1(Object o)
focal_class.full_signature: protected byte[] toSHA1(Object o)
focal_class.identifier: toSHA1
focal_class.modifiers: protected
focal_class.parameters: (Object o)
focal_class.return: byte[]
focal_class.signature: byte[] toSHA1(Object o)
focal_class.class_method_signature: TEWMA.toSHA1(byte[] in)
focal_class.full_signature: protected byte[] toSHA1(byte[] in)
focal_class.identifier: toSHA1
focal_class.modifiers: protected
focal_class.parameters: (byte[] in)
focal_class.return: byte[]
focal_class.signature: byte[] toSHA1(byte[] in)
focal_method.body: public double add(Object item, double quantity, long timestamp) {
          // compute the hash functions
          int[] idx = indexes(item);
          
          double minCounter = getMinCounter(idx, timestamp);
          
          // compute the new value including the insertion and update 
  	// the filter by waterfilling the new counter array bins
          double newCounter = minCounter + quantity * logBeta;
          
          if (newCounter > 1.0e99)
              throw new AssertionError("newCounter shouldn't be greater than 1.0e99.");
          
          for (int i=0; i<nhash; i++)
              if (counters[idx[i]] < newCounter)
                  counters[idx[i]] = newCounter;
          
          return newCounter;
      }
focal_method.class_method_signature: TEWMA.add(Object item, double quantity, long timestamp)
focal_method.full_signature: public double add(Object item, double quantity, long timestamp)
focal_method.identifier: add
focal_method.invocations: indexes getMinCounter
focal_method.modifiers: public
focal_method.parameters: (Object item, double quantity, long timestamp)
focal_method.return: double
focal_method.signature: double add(Object item, double quantity, long timestamp)