org.apache.hadoop.hdfs.util
Class EnumCounters.Map<K,E extends Enum<E>,C extends EnumCounters<E>>

java.lang.Object
  extended by org.apache.hadoop.hdfs.util.EnumCounters.Map<K,E,C>
Type Parameters:
K - the key type
E - the enum type
C - the counter type
Direct Known Subclasses:
Content.CountsMap
Enclosing class:
EnumCounters<E extends Enum<E>>

public static class EnumCounters.Map<K,E extends Enum<E>,C extends EnumCounters<E>>
extends Object

A key-value map which maps the keys to EnumCounters. Note that null key is supported.


Constructor Summary
EnumCounters.Map(EnumCounters.Factory<E,C> factory)
          Construct a map.
 
Method Summary
 C getCounts(K key)
           
 C sum()
           
 long sum(E e)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EnumCounters.Map

public EnumCounters.Map(EnumCounters.Factory<E,C> factory)
Construct a map.

Method Detail

getCounts

public final C getCounts(K key)
Returns:
the counters for the given key.

sum

public final C sum()
Returns:
the sum of the values of all the counters.

sum

public final long sum(E e)
Returns:
the sum of the values of all the counters for e.

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2014 Apache Software Foundation. All Rights Reserved.