public class ResourceType extends Object
ResourceType
s are defined.
ResourceType
s may also be created by of(java.lang.String)
.Modifier and Type | Field and Description |
---|---|
static ResourceType |
DATAGRAM_OPEN
DATAGRAM_OPEN - number of open datagram sockets.
|
static ResourceType |
DATAGRAM_READ
DATAGRAM_READ - number of bytes of datagrams read.
|
static ResourceType |
DATAGRAM_RECEIVED
DATAGRAM_RECIEVED - number of datagrams received.
|
static ResourceType |
DATAGRAM_SENT
DATAGRAM_SENT - number of datagrams sent.
|
static ResourceType |
DATAGRAM_WRITE
DATAGRAM_WRITE - number of bytes of datagrams written.
|
static ResourceType |
FILE_OPEN
FILE_OPEN - number of open files.
|
static ResourceType |
FILE_READ
FILE_READ - number of bytes read from files.
|
static ResourceType |
FILE_WRITE
FILE_WRITE - number of bytes written to files.
|
static ResourceType |
FILEDESCRIPTOR_OPEN
FILEDESCRIPTOR_OPEN - number of open file descriptors.
|
static ResourceType |
HEAP_ALLOCATED
HEAP_ALLOCATED - running total of heap allocations in bytes.
|
static ResourceType |
HEAP_RETAINED
HEAP_RETAINED - number of bytes of heap memory in use.
|
static ResourceType |
SOCKET_OPEN
SOCKET_OPEN - number of open sockets.
|
static ResourceType |
SOCKET_READ
SOCKET_READ - number of bytes read from sockets.
|
static ResourceType |
SOCKET_WRITE
SOCKET_WRITE - number of bytes written to sockets.
|
static ResourceType |
STDERR_WRITE
STDERR_WRITE - number of bytes written to the standard error stream.
|
static ResourceType |
STDIN_READ
STDIN_READ - number of bytes read from the standard input stream.
|
static ResourceType |
STDOUT_WRITE
STDOUT_WRITE - number of bytes written to the standard output stream.
|
static ResourceType |
THREAD_CPU
THREAD_CPU - amount of cpu time used by threads, in nanoseconds.
|
static ResourceType |
THREAD_CREATED
THREAD_CREATED - number of threads created and active.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj)
Indicates whether some other object is "equal to" this one based on the name.
|
String |
getName()
Returns the name of the resource.
|
int |
hashCode()
Returns a hash code value for this ResourceType based on the name.
|
static ResourceType |
of(String name)
Returns a ResourceType for the named resource.
|
String |
toString()
Returns a string representation of the object.
|
public static final ResourceType FILE_OPEN
public static final ResourceType FILE_READ
public static final ResourceType FILE_WRITE
public static final ResourceType STDERR_WRITE
public static final ResourceType STDIN_READ
public static final ResourceType STDOUT_WRITE
public static final ResourceType SOCKET_OPEN
public static final ResourceType SOCKET_READ
public static final ResourceType SOCKET_WRITE
public static final ResourceType DATAGRAM_OPEN
public static final ResourceType DATAGRAM_RECEIVED
public static final ResourceType DATAGRAM_SENT
public static final ResourceType DATAGRAM_READ
public static final ResourceType DATAGRAM_WRITE
public static final ResourceType THREAD_CREATED
public static final ResourceType THREAD_CPU
public static final ResourceType HEAP_RETAINED
public static final ResourceType HEAP_ALLOCATED
public static final ResourceType FILEDESCRIPTOR_OPEN
public static ResourceType of(String name)
name
- the resource nameIllegalArgumentException
- if the length of the name is zeropublic String getName()
public String toString()
java.lang.Object
toString
method returns a string that
"textually represents" this object. The result should
be a concise but informative representation that is easy for a
person to read.
It is recommended that all subclasses override this method.
The toString
method for class Object
returns a string consisting of the name of the class of which the
object is an instance, the at-sign character `@
', and
the unsigned hexadecimal representation of the hash code of the
object. In other words, this method returns a string equal to the
value of:
getClass().getName() + '@' + Integer.toHexString(hashCode())
public int hashCode()
hashCode
in class Object
Object.equals(java.lang.Object)
,
System.identityHashCode(java.lang.Object)
public boolean equals(Object obj)
equals
in class Object
obj
- the reference object with which to compareObject.hashCode()
,
HashMap
Copyright © 2014, 2016, Oracle and/or its affiliates. All rights reserved.