<s> package org . eclipse . jdt . internal . core ; import org . eclipse . jdt . core . IJavaElementDelta ; public class SimpleDelta { protected int kind = 0 ; protected int changeFlags = 0 ; public void added ( ) { this . kind = IJavaElementDelta . ADDED ; } public void changed ( int flags ) { this . kind = IJavaElementDelta . CHANGED ; this . changeFlags |= flags ; } public int getFlags ( ) { return this . changeFlags ; } public int getKind ( ) { return this . kind ; } public void modifiers ( ) { changed ( IJavaElementDelta . F_MODIFIERS ) ; } public void removed ( ) { this . kind = IJavaElementDelta . REMOVED ; this . changeFlags = 0 ; } public void superTypes ( ) { changed ( IJavaElementDelta . F_SUPER_TYPES ) ; } protected void toDebugString ( StringBuffer buffer ) { buffer . append ( "[" ) ; switch ( getKind ( ) ) { case IJavaElementDelta . ADDED : buffer . append ( '+' ) ; break ; case IJavaElementDelta . REMOVED : buffer . append ( '-' ) ; break ; case IJavaElementDelta . CHANGED : buffer . append ( '*' ) ; break ; default : buffer . append ( '?' ) ; break ; } buffer . append ( "]: {" ) ; toDebugString ( buffer , getFlags ( ) ) ; buffer . append ( "}" ) ; } protected boolean toDebugString ( StringBuffer buffer , int flags ) { boolean prev = false ; if ( ( flags & IJavaElementDelta . F_MODIFIERS ) != 0 ) { if ( prev ) buffer . append ( " | " ) ; buffer . append ( "" ) ; prev = true ; } if ( ( flags & IJavaElementDelta . F_SUPER_TYPES ) != 0 ) { if ( prev ) buffer . append ( " | " ) ; buffer . append ( "" ) ; prev = true ; } return prev ; } public String toString ( ) { StringBuffer buffer = new StringBuffer ( ) ; toDebugString ( buffer ) ; return buffer . toString ( ) ; } } </s>