|
From: <caw...@us...> - 2006-09-02 20:55:24
|
Revision: 1603
http://svn.sourceforge.net/rubyeclipse/?rev=1603&view=rev
Author: cawilliams
Date: 2006-09-02 13:55:14 -0700 (Sat, 02 Sep 2006)
Log Message:
-----------
add some more flags
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/Flags.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/IMethod.java
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/Flags.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/Flags.java 2006-09-02 20:54:53 UTC (rev 1602)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/Flags.java 2006-09-02 20:55:14 UTC (rev 1603)
@@ -3,16 +3,55 @@
public class Flags {
- public static boolean isPublic(int flags) {
- return flags == IMethod.PUBLIC;
- }
+ /*
+ * Modifiers
+ */
+ public static final int AccPublic = 0x0001;
+ public static final int AccPrivate = 0x0002;
+ public static final int AccProtected = 0x0004;
+ public static final int AccStatic = 0x0008;
+
+ /**
+ * Constant representing the absence of any flag
+ * @since 3.0
+ */
+ public static final int AccDefault = 0;
- public static boolean isProtected(int flags) {
- return flags == IMethod.PROTECTED;
- }
+ /**
+ * Returns whether the given integer includes the <code>private</code> modifier.
+ *
+ * @param flags the flags
+ * @return <code>true</code> if the <code>private</code> modifier is included
+ */
+ public static boolean isPrivate(int flags) {
+ return (flags & AccPrivate) != 0;
+ }
+ /**
+ * Returns whether the given integer includes the <code>protected</code> modifier.
+ *
+ * @param flags the flags
+ * @return <code>true</code> if the <code>protected</code> modifier is included
+ */
+ public static boolean isProtected(int flags) {
+ return (flags & AccProtected) != 0;
+ }
+ /**
+ * Returns whether the given integer includes the <code>public</code> modifier.
+ *
+ * @param flags the flags
+ * @return <code>true</code> if the <code>public</code> modifier is included
+ */
+ public static boolean isPublic(int flags) {
+ return (flags & AccPublic) != 0;
+ }
+ /**
+ * Returns whether the given integer includes the <code>static</code> modifier.
+ *
+ * @param flags the flags
+ * @return <code>true</code> if the <code>static</code> modifier is included
+ */
+ public static boolean isStatic(int flags) {
+ return (flags & AccStatic) != 0;
+ }
- public static boolean isPrivate(int modifierFlags) {
- return modifierFlags == IMethod.PRIVATE;
- }
-
}
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/IMethod.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/IMethod.java 2006-09-02 20:54:53 UTC (rev 1602)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/IMethod.java 2006-09-02 20:55:14 UTC (rev 1603)
@@ -31,9 +31,9 @@
*/
public interface IMethod extends IRubyElement, IMember {
- public static final int PUBLIC = 0;
- public static final int PROTECTED = 1;
- public static final int PRIVATE = 2;
+ public static final int PUBLIC = Flags.AccPublic;
+ public static final int PROTECTED = Flags.AccProtected;
+ public static final int PRIVATE = Flags.AccPrivate;
public int getVisibility() throws RubyModelException;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|