<s> package org . eclipse . jdt . core . dom ; import java . util . ArrayList ; import java . util . HashMap ; import java . util . Iterator ; import java . util . List ; import java . util . Map ; public final class Modifier extends ASTNode implements IExtendedModifier { public static class ModifierKeyword { public static final ModifierKeyword ABSTRACT_KEYWORD = new ModifierKeyword ( "abstract" , ABSTRACT ) ; public static final ModifierKeyword FINAL_KEYWORD = new ModifierKeyword ( "final" , FINAL ) ; private static final Map KEYWORDS ; public static final ModifierKeyword NATIVE_KEYWORD = new ModifierKeyword ( "native" , NATIVE ) ; public static final ModifierKeyword PRIVATE_KEYWORD = new ModifierKeyword ( "private" , PRIVATE ) ; public static final ModifierKeyword PROTECTED_KEYWORD = new ModifierKeyword ( "protected" , PROTECTED ) ; public static final ModifierKeyword PUBLIC_KEYWORD = new ModifierKeyword ( "public" , PUBLIC ) ; public static final ModifierKeyword STATIC_KEYWORD = new ModifierKeyword ( "static" , STATIC ) ; public static final ModifierKeyword STRICTFP_KEYWORD = new ModifierKeyword ( "strictfp" , STRICTFP ) ; public static final ModifierKeyword SYNCHRONIZED_KEYWORD = new ModifierKeyword ( "synchronized" , SYNCHRONIZED ) ; public static final ModifierKeyword TRANSIENT_KEYWORD = new ModifierKeyword ( "transient" , TRANSIENT ) ; public static final ModifierKeyword VOLATILE_KEYWORD = new ModifierKeyword ( "volatile" , VOLATILE ) ; static { KEYWORDS = new HashMap ( 20 ) ; ModifierKeyword [ ] ops = { PUBLIC_KEYWORD , PROTECTED_KEYWORD , PRIVATE_KEYWORD , STATIC_KEYWORD , ABSTRACT_KEYWORD , FINAL_KEYWORD , NATIVE_KEYWORD , SYNCHRONIZED_KEYWORD , TRANSIENT_KEYWORD , VOLATILE_KEYWORD , STRICTFP_KEYWORD } ; for ( int i = 0 ; i < ops . length ; i ++ ) { KEYWORDS . put ( ops [ i ] . toString ( ) , ops [ i ] ) ; } } public static ModifierKeyword fromFlagValue ( int flagValue ) { for ( Iterator it = KEYWORDS . values ( ) . iterator ( ) ; it . hasNext ( ) ; ) { ModifierKeyword k = ( ModifierKeyword ) it . next ( ) ; if ( k . toFlagValue ( ) == flagValue ) { return k ; } } return null ; } public static ModifierKeyword toKeyword ( String keyword ) { return ( ModifierKeyword ) KEYWORDS . get ( keyword ) ; } private int flagValue ; private String keyword ; private ModifierKeyword ( String keyword , int flagValue ) { this . keyword = keyword ; this . flagValue = flagValue ; } public int toFlagValue ( ) { return this . flagValue ; } public String toString ( ) { return this . keyword ; } } public static final int ABSTRACT = 0x0400 ; public static final int FINAL = 0x0010 ; public static final SimplePropertyDescriptor KEYWORD_PROPERTY = new SimplePropertyDescriptor ( Modifier . class , "keyword" , Modifier . ModifierKeyword . class , MANDATORY ) ; public static final int NATIVE = 0x0100 ; public static final int NONE = 0x0000 ; public static final int PRIVATE = 0x0002 ; private static final List PROPERTY_DESCRIPTORS ; public static final int PROTECTED = 0x0004 ; public static final int PUBLIC = 0x0001 ; public static final int STATIC = 0x0008 ; public static final int STRICTFP = 0x0800 ; public static final int SYNCHRONIZED = 0x0020 ; public static final int TRANSIENT = 0x0080 ; public static final int VOLATILE = 0x0040 ; static { List properyList = new ArrayList ( 2 ) ; createPropertyList ( Modifier . class , properyList ) ; addProperty ( KEYWORD_PROPERTY , properyList ) ; PROPERTY_DESCRIPTORS = reapPropertyList ( properyList ) ; } public static boolean isAbstract ( int flags ) { return ( flags & ABSTRACT ) != 0 ; } public static boolean isFinal ( int flags ) { return ( flags & FINAL ) != 0 ; } public static boolean isNative ( int flags ) { return ( flags & NATIVE ) != 0 ; } public static boolean isPrivate ( int flags ) { return ( flags & PRIVATE ) != 0 ; } public static boolean isProtected ( int flags ) { return ( flags & PROTECTED ) != 0 ; } public static boolean isPublic ( int flags ) { return ( flags & PUBLIC ) != 0 ; } public static boolean isStatic ( int flags ) { return ( flags & STATIC ) != 0 ; } public static boolean isStrictfp ( int flags ) { return ( flags & STRICTFP ) != 0 ; } public static boolean isSynchronized ( int flags ) { return ( flags & SYNCHRONIZED ) != 0 ; } public static boolean isTransient ( int flags ) { return ( flags & TRANSIENT ) != 0 ; } public static boolean isVolatile ( int flags ) { return ( flags & VOLATILE ) != 0 ; } public static List propertyDescriptors ( int apiLevel ) { return PROPERTY_DESCRIPTORS ; } private ModifierKeyword modifierKeyword = ModifierKeyword . PUBLIC_KEYWORD ; Modifier ( AST ast ) { super ( ast ) ; unsupportedIn2 ( ) ; } void accept0 ( ASTVisitor visitor ) { visitor . visit ( this ) ; visitor . endVisit ( this ) ; } ASTNode clone0 ( AST target ) { Modifier result = new Modifier ( target ) ; result . setSourceRange ( getStartPosition ( ) , getLength ( ) ) ; result . setKeyword ( getKeyword ( ) ) ; return result ; } public ModifierKeyword getKeyword ( ) { return this . modifierKeyword ; } final int getNodeType0 ( ) { return MODIFIER ; } final Object internalGetSetObjectProperty ( SimplePropertyDescriptor property , boolean get , Object value ) { if ( property == KEYWORD_PROPERTY ) { if ( get ) { return getKeyword ( ) ; } else { setKeyword ( ( ModifierKeyword ) value ) ; return null ; } } return super . internalGetSetObjectProperty ( property , get , value ) ; } final List internalStructuralPropertiesForType ( int apiLevel ) { return propertyDescriptors ( apiLevel ) ; } public boolean isAbstract ( ) { return this . modifierKeyword == ModifierKeyword . ABSTRACT_KEYWORD ; } public boolean isAnnotation ( ) { return false ; } public boolean isFinal ( ) { return this . modifierKeyword == ModifierKeyword . FINAL_KEYWORD ; } public boolean isModifier ( ) { return true ; } public boolean isNative ( ) { return this . modifierKeyword == ModifierKeyword . NATIVE_KEYWORD ; } public boolean isPrivate ( ) { return this . modifierKeyword == ModifierKeyword . PRIVATE_KEYWORD ; } public boolean isProtected ( ) { return this . modifierKeyword == ModifierKeyword . PROTECTED_KEYWORD ; } public boolean isPublic ( ) { return this . modifierKeyword == ModifierKeyword . PUBLIC_KEYWORD ; } public boolean isStatic ( ) { return this . modifierKeyword == ModifierKeyword . STATIC_KEYWORD ; } public boolean isStrictfp ( ) { return this . modifierKeyword == ModifierKeyword . STRICTFP_KEYWORD ; } public boolean isSynchronized ( ) { return this . modifierKeyword == ModifierKeyword . SYNCHRONIZED_KEYWORD ; } public boolean isTransient ( ) { return this . modifierKeyword == ModifierKeyword . TRANSIENT_KEYWORD ; } public boolean isVolatile ( ) { return this . modifierKeyword == ModifierKeyword . VOLATILE_KEYWORD ; } int memSize ( ) { return BASE_NODE_SIZE + 1 * 4 ; } public void setKeyword ( ModifierKeyword modifierKeyord ) { if ( modifierKeyord == null ) { throw new IllegalArgumentException ( ) ; } preValueChange ( KEYWORD_PROPERTY ) ; this . modifierKeyword = modifierKeyord ; postValueChange ( KEYWORD_PROPERTY ) ; } final boolean subtreeMatch0 ( ASTMatcher matcher , Object other ) { return matcher . match ( this , other ) ; } int treeSize ( ) { return memSize ( ) ; } } </s>