org.apache.hadoop.hdfs.util
Class EnumCounters.Map<K,E extends Enum<E>,C extends EnumCounters<E>>
java.lang.Object
org.apache.hadoop.hdfs.util.EnumCounters.Map<K,E,C>
- Type Parameters:
K
- the key typeE
- the enum typeC
- 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.
EnumCounters.Map
public EnumCounters.Map(EnumCounters.Factory<E,C> factory)
- Construct a map.
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.