<s> package org . eclipse . jdt . internal . core ; import org . eclipse . core . runtime . IProgressMonitor ; import org . eclipse . jdt . core . * ; import org . eclipse . jdt . core . Flags ; import org . eclipse . jdt . core . IInitializer ; import org . eclipse . jdt . core . IJavaModelStatusConstants ; import org . eclipse . jdt . core . ISourceRange ; import org . eclipse . jdt . core . IType ; import org . eclipse . jdt . core . JavaModelException ; import org . eclipse . jdt . internal . core . util . Util ; public class Initializer extends Member implements IInitializer { protected Initializer ( JavaElement parent , int count ) { super ( parent ) ; if ( count <= 0 ) throw new IllegalArgumentException ( ) ; this . occurrenceCount = count ; } public boolean equals ( Object o ) { if ( ! ( o instanceof Initializer ) ) return false ; return super . equals ( o ) ; } public int getElementType ( ) { return INITIALIZER ; } protected void getHandleMemento ( StringBuffer buff ) { ( ( JavaElement ) getParent ( ) ) . getHandleMemento ( buff ) ; buff . append ( getHandleMementoDelimiter ( ) ) ; buff . append ( this . occurrenceCount ) ; } protected char getHandleMementoDelimiter ( ) { return JavaElement . JEM_INITIALIZER ; } public int hashCode ( ) { return Util . combineHashCodes ( this . parent . hashCode ( ) , this . occurrenceCount ) ; } public String readableName ( ) { return ( ( JavaElement ) getDeclaringType ( ) ) . readableName ( ) ; } public void rename ( String newName , boolean force , IProgressMonitor monitor ) throws JavaModelException { throw new JavaModelException ( new JavaModelStatus ( IJavaModelStatusConstants . INVALID_ELEMENT_TYPES , this ) ) ; } public ISourceRange getNameRange ( ) { return null ; } public IJavaElement getPrimaryElement ( boolean checkOwner ) { if ( checkOwner ) { CompilationUnit cu = ( CompilationUnit ) getAncestor ( COMPILATION_UNIT ) ; if ( cu == null || cu . isPrimary ( ) ) return this ; } IJavaElement primaryParent = this . parent . getPrimaryElement ( false ) ; return ( ( IType ) primaryParent ) . getInitializer ( this . occurrenceCount ) ; } protected void toStringInfo ( int tab , StringBuffer buffer , Object info , boolean showResolvedInfo ) { buffer . append ( tabString ( tab ) ) ; if ( info == null ) { buffer . append ( "" ) ; buffer . append ( this . occurrenceCount ) ; buffer . append ( "> (not open)" ) ; } else if ( info == NO_INFO ) { buffer . append ( "" ) ; buffer . append ( this . occurrenceCount ) ; buffer . append ( ">" ) ; } else { try { buffer . append ( "<" ) ; if ( Flags . isStatic ( getFlags ( ) ) ) { buffer . append ( "static " ) ; } buffer . append ( "" ) ; buffer . append ( this . occurrenceCount ) ; buffer . append ( ">" ) ; } catch ( JavaModelException e ) { buffer . append ( "" + getElementName ( ) ) ; } } } } </s>