Package org.apache.commons.lang.mutable

Examples of org.apache.commons.lang.mutable.MutableLong


    public void addValue(T val) {
        addValue(val,1);
    }

    private void updateValueCount(T actualValue, int sampleCount) {
        MutableLong count = valuesMap.get(actualValue);
        if (count != null) {
            count.add(sampleCount);
        } else {
            // insert new value
            valuesMap.put(actualValue, new MutableLong(sampleCount));
        }
    }
View Full Code Here


    // int count = 0;
    while (transactions.hasNext()) {
      Pair<List<A>,Long> transaction = transactions.next();
      for (A attribute : transaction.getFirst()) {
        if (attributeSupport.containsKey(attribute) == false) {
          attributeSupport.put(attribute, new MutableLong(transaction
            .getSecond()));
        } else {
          attributeSupport.get(attribute).add(
            transaction.getSecond().longValue());
          // count++;
View Full Code Here

      int attribute = tree.getAttributeAtIndex(i);
      if (requiredFeatures.contains(attribute) == false) {
        continue;
      }
      log.info("Mining FTree Tree for all patterns with {}", attribute);
      MutableLong minSupport = new MutableLong(minSupportValue);
      FrequentPatternMaxHeap frequentPatterns = growth(tree, minSupport, k,
        treeCache, 0, attribute, updater);
      patterns.put(attribute, frequentPatterns);
      outputCollector.collect(attribute, frequentPatterns);
     
      minSupportValue = Math.max(minSupportValue, minSupport.longValue() / 2);
      log.info("Found {} Patterns with Least Support {}", patterns.get(
        attribute).count(), patterns.get(attribute).leastSupport());
    }
    log.info("Tree Cache: First Level: Cache hits={} Cache Misses={}",
      treeCache.getHits(), treeCache.getMisses());
View Full Code Here

    for (int i = 0; i < featureSetSize; i++) {
      tree.addHeaderCount(i, attributeFrequency[i]);
    }
   
    // Constructing initial FPTree from the list of transactions
    MutableLong minSupportMutable = new MutableLong(minSupport);
    int nodecount = 0;
    // int attribcount = 0;
    int i = 0;
    while (transactions.hasNext()) {
      Pair<int[],Long> transaction = transactions.next();
View Full Code Here

  }
 
  @Override
  public void incrCounter(Enum<?> key, long amount) {
    if (count1.containsKey(key) == false) {
      count1.put(key, new MutableLong(0));
    }
    count1.get(key).add(amount);
  }
View Full Code Here

      Pair<List<Integer>,Long> p = it.next();
      items += p.getFirst().size();
      count++;
      for (Integer i : p.getFirst()) {
        if (frequencyList.containsKey(i) == false) {
          frequencyList.put(i, new MutableLong(0));
        }
        frequencyList.get(i).add(p.getSecond());
      }
    }
    return frequencyList;
View Full Code Here

  public void incrCounter(String group, String counter, long amount) {
    if (count2.containsKey(group) == false) {
      count2.put(group, new HashMap<String,MutableLong>());
    }
    if (count2.get(group).containsKey(counter) == false) {
      count2.get(group).put(counter, new MutableLong(0));
    }
    count2.get(group).get(counter).add(amount);
   
  }
View Full Code Here

    private MutableLong commReadBufferSizeBytes;

    private MutableLong commWriteBufferSizeBytes;

    public CommBufferSizeStats() {
        commReadBufferSizeBytes = new MutableLong(0);
        commWriteBufferSizeBytes = new MutableLong(0);
    }
View Full Code Here

  }
 
  @Override
  public void incrCounter(Enum<?> key, long amount) {
    if (!count1.containsKey(key)) {
      count1.put(key, new MutableLong(0));
    }
    count1.get(key).add(amount);
  }
View Full Code Here

  public void incrCounter(String group, String counter, long amount) {
    if (!count2.containsKey(group)) {
      count2.put(group, new HashMap<String,MutableLong>());
    }
    if (!count2.get(group).containsKey(counter)) {
      count2.get(group).put(counter, new MutableLong(0));
    }
    count2.get(group).get(counter).add(amount);
   
  }
View Full Code Here

TOP

Related Classes of org.apache.commons.lang.mutable.MutableLong

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.