public class Counters.Group extends Object implements Writable, Iterable<Counters.Counter>
Group
of counters, comprising of counters from a particular
counter Enum
class.
Group
handles localization of the class name and the
counter names.
限定符和类型 | 方法和说明 |
---|---|
boolean |
equals(Object obj)
Checks for (content) equality of Groups
|
Counters.Counter |
getCounter(int id,
String name)
已过时。
use
getCounter(String) instead |
long |
getCounter(String counterName)
Returns the value of the specified counter, or 0 if the counter does
not exist.
|
Counters.Counter |
getCounterForName(String name)
Get the counter for the given name and create it if it doesn't exist.
|
String |
getDisplayName()
Returns localized name of the group.
|
String |
getName()
Returns raw name of the group.
|
int |
hashCode() |
Iterator<Counters.Counter> |
iterator() |
String |
makeEscapedCompactString()
Returns the compact stringified version of the group in the format
{(actual-name)(display-name)(value)[][][]} where [] are compact strings for the
counters within.
|
void |
readFields(DataInput in)
Deserialize the fields of this object from
in . |
void |
setDisplayName(String displayName)
Set the display name
|
int |
size()
Returns the number of counters in this group.
|
void |
write(DataOutput out)
Serialize the fields of this object to
out . |
public String getName()
public String getDisplayName()
public void setDisplayName(String displayName)
public String makeEscapedCompactString()
public boolean equals(Object obj)
public long getCounter(String counterName)
@Deprecated public Counters.Counter getCounter(int id, String name)
getCounter(String)
insteadid
- the numeric id of the counter within the groupname
- the internal counter namepublic Counters.Counter getCounterForName(String name)
name
- the internal counter namepublic int size()
public void write(DataOutput out) throws IOException
Writable
out
.write
在接口中 Writable
out
- DataOuput
to serialize this object into.IOException
public void readFields(DataInput in) throws IOException
Writable
in
.
For efficiency, implementations should attempt to re-use storage in the existing object where possible.
readFields
在接口中 Writable
in
- DataInput
to deseriablize this object from.IOException
public Iterator<Counters.Counter> iterator()
iterator
在接口中 Iterable<Counters.Counter>
Copyright © 2009 The Apache Software Foundation