|
JavaTM Platform Standard Ed. 6 |
|||||||||
| 전의 클래스 다음의 클래스 | 프레임 있어 프레임 없음 | |||||||||
| 개요: 상자 | 열거형 정수 | 필드 | 메소드 | 상세 : 열거형 정수 | 필드 | 메소드 | |||||||||
java.lang.Objectjava.lang.Enum <NestingKind >
javax.lang.model.element.NestingKind
public enum NestingKind
형태 요소의 「상자의 종류」입니다. 형태 요소에는, 톱 레벨, 멤버, 로컬, 및 익명의 4 종류가 있습니다. 「상자의 종류」는, 이 분류를 나타내기 위해서(때문에) 여기에서만 사용하는 비표준의 용어입니다.
플랫폼의 장래의 버젼으로, 그 외의 상자의 종류가 추가될 가능성이 있는 것에 주의해 주세요.
례: 차의 클래스에서는, 그 클래스의 상자의 종류가 주석으로 나타나고 있습니다.
import java.lang.annotation. *;
import static java.lang.annotation.RetentionPolicy. *;
import javax.lang.model.element. *;
import static javax.lang.model.element.NestingKind. *;
@Nesting(TOP_LEVEL)
public class NestingExamples {
@Nesting(MEMBER)
static class MemberClass1{}
@Nesting(MEMBER)
class MemberClass2{}
public static void main(String... argv) {
@Nesting(LOCAL)
class LocalClass{};
Class<? >[] classes = {
NestingExamples.class,
MemberClass1.class,
MemberClass2.class,
LocalClass.class
};
for(Class<? > clazz : classes) {
System.out.format("%s is %s%n",
clazz.getName(),
clazz.getAnnotation(Nesting.class). value());
}
}
}
@Retention(RUNTIME)
@interface Nesting {
NestingKind value();
}
| 열거형 정수의 개요 | |
|---|---|
ANONYMOUS
|
|
LOCAL
|
|
MEMBER
|
|
TOP_LEVEL
|
|
| 메소드의 개요 | |
|---|---|
boolean |
isNested ()
이 정수와 상자로 된 형태 요소의 대응 관계는 다음과 같습니다. |
static NestingKind |
valueOf (String name)
지정한 이름을 가지는 이 형태의 열거형 정수를 돌려줍니다. |
static NestingKind [] |
values ()
이 열거형의 정수를 포함한 배열이 선언되고 있는 순서로 돌려줍니다. |
| 클래스 java.lang. Enum 로부터 상속된 메소드 |
|---|
clone , compareTo , equals , finalize , getDeclaringClass , hashCode , name , ordinal , toString , valueOf |
| 클래스 java.lang. Object 로부터 상속된 메소드 |
|---|
getClass , notify , notifyAll , wait , wait , wait |
| 열거형 정수의 상세 |
|---|
public static final NestingKind TOP_LEVEL
public static final NestingKind MEMBER
public static final NestingKind LOCAL
public static final NestingKind ANONYMOUS
| 메소드의 상세 |
|---|
public static NestingKind [] values()
for (NestingKind c : NestingKind.values()) System.out.println(c);
public static NestingKind valueOf(String name)
name - 반환되는 열거형 정수의 이름
IllegalArgumentException - 지정된 이름을 가지는 정수를
이 열거형이 가지고 있지 않은 경우
NullPointerException - 인수가 null 의 경우public boolean isNested()
|
JavaTM Platform Standard Ed. 6 |
|||||||||
| 전의 클래스 다음의 클래스 | 프레임 있어 프레임 없음 | |||||||||
| 개요: 상자 | 열거형 정수 | 필드 | 메소드 | 상세 : 열거형 정수 | 필드 | 메소드 | |||||||||
Copyright 2006 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms . Documentation Redistribution Policy 도 참조해 주세요.