JavaTM 2 Platform
Standard Ed. 6

java.lang.management
枚举 MemoryType

java.lang.Object
  继承者 java.lang.Enum<MemoryType>
      继承者 java.lang.management.MemoryType
所有已实现的接口:
Serializable, Comparable<MemoryType>

public enum MemoryType
extends Enum<MemoryType>

内存池的类型。

从以下版本开始:
1.5

枚举常量摘要
HEAP
          堆内存类型。
NON_HEAP
          非堆内存类型。
 
方法摘要
 String toString()
          返回该 MemoryType 的字符串表示形式。
static MemoryType valueOf(String name)
          返回带有指定名称的该类型的枚举常量。
static MemoryType[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
从类 java.lang.Enum 继承的方法
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
 
从类 java.lang.Object 继承的方法
getClass, notify, notifyAll, wait, wait, wait
 

枚举常量详细信息

HEAP

public static final MemoryType HEAP
堆内存类型。

Java 虚拟机具有一个,堆是运行时数据区域,所有类实例和数组的内存均从此处分配。


NON_HEAP

public static final MemoryType NON_HEAP
非堆内存类型。

Java 虚拟机管理堆之外的内存(称为非堆内存)。非堆内存包括方法区 和 Java 虚拟机的内部处理或优化所需的内存。它存储每个类结构,如运行时常数池、字段和方法数据,以及方法和构造方法的代码。

方法详细信息

values

public static final MemoryType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for(MemoryType c : MemoryType.values())
        System.out.println(c);

返回:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static MemoryType valueOf(String name)
返回带有指定名称的该类型的枚举常量。 字符串必须与用于声明该类型的枚举常量的 标识符完全匹配。(不允许有多余 的空格。)

参数:
指定要返回的枚举常量的名称。 -
返回:
返回带有指定名称的枚举常量
抛出:
如果该枚举类型没有带有指定名称的常量, - 则抛出 IllegalArgumentException

toString

public String toString()
返回该 MemoryType 的字符串表示形式。

覆盖:
Enum<MemoryType> 中的 toString
返回:
MemoryType 的字符串表示形式。

JavaTM 2 Platform
Standard Ed. 6

提交错误或意见

版权所有 2008 Sun Microsystems, Inc. 保留所有权利。请遵守GNU General Public License, version 2 only