<s> package org . eclipse . jdt . internal . core ; import org . eclipse . core . runtime . Assert ; import org . eclipse . jdt . core . * ; public class ImportDeclaration extends SourceRefElement implements IImportDeclaration { protected String name ; protected boolean isOnDemand ; protected ImportDeclaration ( ImportContainer parent , String name , boolean isOnDemand ) { super ( parent ) ; this . name = name ; this . isOnDemand = isOnDemand ; } public boolean equals ( Object o ) { if ( ! ( o instanceof ImportDeclaration ) ) return false ; return super . equals ( o ) ; } public String getElementName ( ) { if ( this . isOnDemand ) return this . name + ".*" ; return this . name ; } public String getNameWithoutStar ( ) { return this . name ; } public int getElementType ( ) { return IMPORT_DECLARATION ; } public int getFlags ( ) throws JavaModelException { ImportDeclarationElementInfo info = ( ImportDeclarationElementInfo ) getElementInfo ( ) ; return info . getModifiers ( ) ; } protected void getHandleMemento ( StringBuffer buff ) { ( ( JavaElement ) getParent ( ) ) . getHandleMemento ( buff ) ; escapeMementoName ( buff , getElementName ( ) ) ; if ( this . occurrenceCount > 1 ) { buff . append ( JEM_COUNT ) ; buff . append ( this . occurrenceCount ) ; } } protected char getHandleMementoDelimiter ( ) { Assert . isTrue ( false , "" ) ; return 0 ; } public ISourceRange getNameRange ( ) throws JavaModelException { ImportDeclarationElementInfo info = ( ImportDeclarationElementInfo ) getElementInfo ( ) ; return info . getNameRange ( ) ; } public IJavaElement getPrimaryElement ( boolean checkOwner ) { CompilationUnit cu = ( CompilationUnit ) this . parent . getParent ( ) ; if ( checkOwner && cu . isPrimary ( ) ) return this ; return cu . getImport ( getElementName ( ) ) ; } public boolean isOnDemand ( ) { return this . isOnDemand ; } public String readableName ( ) { return null ; } protected void toStringInfo ( int tab , StringBuffer buffer , Object info , boolean showResolvedInfo ) { buffer . append ( tabString ( tab ) ) ; buffer . append ( "import " ) ; toStringName ( buffer ) ; if ( info == null ) { buffer . append ( " (not open)" ) ; } } } </s>