summaryrefslogtreecommitdiffstats
path: root/luni
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2013-05-13 13:17:32 -0700
committerElliott Hughes <enh@google.com>2013-05-13 13:25:21 -0700
commit82a47dc51eba87fe901e675f050ab591c663e0be (patch)
tree501f31bcc923b1b7430443afa3c115a293567259 /luni
parentde6c6eebbace906077e6de87b7d99dd5350b6037 (diff)
downloadlibcore-82a47dc51eba87fe901e675f050ab591c663e0be.zip
libcore-82a47dc51eba87fe901e675f050ab591c663e0be.tar.gz
libcore-82a47dc51eba87fe901e675f050ab591c663e0be.tar.bz2
Improve java.lang.reflect.Modifier documentation.
Change-Id: I514ab7668a933f7ce724408d95464ef25d76b53b
Diffstat (limited to 'luni')
-rw-r--r--luni/src/main/java/java/lang/reflect/Modifier.java131
1 files changed, 22 insertions, 109 deletions
diff --git a/luni/src/main/java/java/lang/reflect/Modifier.java b/luni/src/main/java/java/lang/reflect/Modifier.java
index 225ded1..d3a48e4 100644
--- a/luni/src/main/java/java/lang/reflect/Modifier.java
+++ b/luni/src/main/java/java/lang/reflect/Modifier.java
@@ -26,20 +26,17 @@ package java.lang.reflect;
public class Modifier {
/**
- * The {@code int} value representing the {@code public}
- * modifier.
+ * The {@code int} value representing the {@code public} modifier.
*/
public static final int PUBLIC = 0x1;
/**
- * The {@code int} value representing the {@code private}
- * modifier.
+ * The {@code int} value representing the {@code private} modifier.
*/
public static final int PRIVATE = 0x2;
/**
- * The {@code int} value representing the {@code protected}
- * modifier.
+ * The {@code int} value representing the {@code protected} modifier.
*/
public static final int PROTECTED = 0x4;
@@ -54,20 +51,17 @@ public class Modifier {
public static final int FINAL = 0x10;
/**
- * The {@code int} value representing the {@code synchronized}
- * modifier.
+ * The {@code int} value representing the {@code synchronized} modifier.
*/
public static final int SYNCHRONIZED = 0x20;
/**
- * The {@code int} value representing the {@code volatile}
- * modifier.
+ * The {@code int} value representing the {@code volatile} modifier.
*/
public static final int VOLATILE = 0x40;
/**
- * The {@code int} value representing the {@code transient}
- * modifier.
+ * The {@code int} value representing the {@code transient} modifier.
*/
public static final int TRANSIENT = 0x80;
@@ -77,19 +71,17 @@ public class Modifier {
public static final int NATIVE = 0x100;
/**
- * The {@code int} value representing the {@code interface}
- * modifier.
+ * The {@code int} value representing the {@code interface} modifier.
*/
public static final int INTERFACE = 0x200;
/**
- * The {@code int} value representing the {@code abstract}
- * modifier.
+ * The {@code int} value representing the {@code abstract} modifier.
*/
public static final int ABSTRACT = 0x400;
/**
- * The {@code int} value representing the {@code strict} modifier.
+ * The {@code int} value representing the {@code strictfp} modifier.
*/
public static final int STRICT = 0x800;
@@ -156,156 +148,84 @@ public class Modifier {
}
/**
- * Indicates whether or not the specified modifiers contain the {@code
- * abstract} modifier.
- *
- * @param modifiers
- * the modifiers to test
- * @return {@code true} if the specified modifiers contain the {@code
- * abstract} modifier, {@code false} otherwise
+ * Returns true if the given modifiers contain {@@link #ABSTRACT}.
*/
public static boolean isAbstract(int modifiers) {
return ((modifiers & ABSTRACT) != 0);
}
/**
- * Indicates whether or not the specified modifiers contain the {@code
- * final} modifier.
- *
- * @param modifiers
- * the modifiers to test
- * @return {@code true} if the specified modifiers contain the {@code
- * final} modifier, {@code false} otherwise
+ * Returns true if the given modifiers contain {@link #FINAL}.
*/
public static boolean isFinal(int modifiers) {
return ((modifiers & FINAL) != 0);
}
/**
- * Indicates whether or not the specified modifiers contain the {@code
- * interface} modifier.
- *
- * @param modifiers
- * the modifiers to test
- * @return {@code true} if the specified modifiers contain the {@code
- * interface} modifier, {@code false} otherwise
+ * Returns true if the given modifiers contain {@link #INTERFACE}.
*/
public static boolean isInterface(int modifiers) {
return ((modifiers & INTERFACE) != 0);
}
/**
- * Indicates whether or not the specified modifiers contain the {@code
- * native} modifier.
- *
- * @param modifiers
- * the modifiers to test
- * @return {@code true} if the specified modifiers contain the {@code
- * native} modifier, {@code false} otherwise
+ * Returns true if the given modifiers contain {@link #NATIVE}.
*/
public static boolean isNative(int modifiers) {
return ((modifiers & NATIVE) != 0);
}
/**
- * Indicates whether or not the specified modifiers contain the {@code
- * private} modifier.
- *
- * @param modifiers
- * the modifiers to test
- * @return {@code true} if the specified modifiers contain the {@code
- * private} modifier, {@code false} otherwise
+ * Returns true if the given modifiers contain {@link #PRIVATE}.
*/
public static boolean isPrivate(int modifiers) {
return ((modifiers & PRIVATE) != 0);
}
/**
- * Indicates whether or not the specified modifiers contain the {@code
- * protected} modifier.
- *
- * @param modifiers
- * the modifiers to test
- * @return {@code true} if the specified modifiers contain the {@code
- * protected} modifier, {@code false} otherwise
+ * Returns true if the given modifiers contain {@link #PROTECTED}.
*/
public static boolean isProtected(int modifiers) {
return ((modifiers & PROTECTED) != 0);
}
/**
- * Indicates whether or not the specified modifiers contain the {@code
- * public} modifier.
- *
- * @param modifiers
- * the modifiers to test
- * @return {@code true} if the specified modifiers contain the {@code
- * public} modifier, {@code false} otherwise
+ * Returns true if the given modifiers contain {@link #PUBLIC}.
*/
public static boolean isPublic(int modifiers) {
return ((modifiers & PUBLIC) != 0);
}
/**
- * Indicates whether or not the specified modifiers contain the {@code
- * static} modifier.
- *
- * @param modifiers
- * the modifiers to test
- * @return {@code true} if the specified modifiers contain the {@code
- * static} modifier, {@code false} otherwise
+ * Returns true if the given modifiers contain {@link #STATIC}.
*/
public static boolean isStatic(int modifiers) {
return ((modifiers & STATIC) != 0);
}
/**
- * Indicates whether or not the specified modifiers contain the {@code
- * strict} modifier.
- *
- * @param modifiers
- * the modifiers to test
- * @return {@code true} if the specified modifiers contain the {@code
- * strict} modifier, {@code false} otherwise
+ * Returns true if the given modifiers contain {@link #STRICT}.
*/
public static boolean isStrict(int modifiers) {
return ((modifiers & STRICT) != 0);
}
/**
- * Indicates whether or not the specified modifiers contain the {@code
- * synchronized} modifier.
- *
- * @param modifiers
- * the modifiers to test
- * @return {@code true} if the specified modifiers contain the {@code
- * synchronized} modifier, {@code false} otherwise
+ * Returns true if the given modifiers contain {@link #SYNCHRONIZED}.
*/
public static boolean isSynchronized(int modifiers) {
return ((modifiers & SYNCHRONIZED) != 0);
}
/**
- * Indicates whether or not the specified modifiers contain the {@code
- * transient} modifier.
- *
- * @param modifiers
- * the modifiers to test
- * @return {@code true} if the specified modifiers contain the {@code
- * transient} modifier, {@code false} otherwise
+ * Returns true if the given modifiers contain {@link #TRANSIENT}.
*/
public static boolean isTransient(int modifiers) {
return ((modifiers & TRANSIENT) != 0);
}
/**
- * Indicates whether or not the specified modifiers contain the {@code
- * volatile} modifier.
- *
- * @param modifiers
- * the modifiers to test
- * @return {@code true} if the specified modifiers contain the {@code
- * volatile} modifier, {@code false} otherwise
+ * Returns true if the given modifiers contain {@link #VOLATILE}.
*/
public static boolean isVolatile(int modifiers) {
return ((modifiers & VOLATILE) != 0);
@@ -314,17 +234,10 @@ public class Modifier {
/**
* Returns a string containing the string representation of all modifiers
* present in the specified modifiers. Modifiers appear in the order
- * specified by the Java Language Specification:
- *
- * {@code public private protected abstract static final transient volatile native synchronized interface strict}
- *
- * @param modifiers
- * the modifiers to print
- * @return a printable representation of the modifiers
+ * specified by the Java Language Specification.
*/
public static java.lang.String toString(int modifiers) {
StringBuilder buf = new StringBuilder();
-
if (isPublic(modifiers)) {
buf.append("public ");
}