private String getAnnotations ( String id , long component ) { String result = "" ; String incoming = "" , outgoing = "" ; int nri = 1 , nro = 1 ; if ( referentOfToken . get ( id ) != null ) { for ( long l : referentOfToken . get ( id ) . keySet ( ) ) { if ( referentList . get ( ( int ) l ) != null && referentList . get ( ( int ) l ) . component == component && referentList . get ( ( int ) l ) . annotations != null && referentList . get ( ( int ) l ) . annotations . size ( ) > 0 ) { int num = referentOfToken . get ( id ) . get ( l ) ; if ( num == 0 || num == 2 ) { for ( SerializableAnnotation an : referentList . get ( ( int ) l ) . annotations ) { if ( nri == 1 ) { incoming = ", &lt;b&gt;incoming Annotations&lt;/b&gt;: " + an . getName ( ) + "=" + an . getValue ( ) ; nri -- ; } else { incoming += ", " + an . getName ( ) + "=" + an . getValue ( ) ; } } } if ( num == 1 || num == 2 ) { for ( SerializableAnnotation an : referentList . get ( ( int ) ( long ) l ) . annotations ) { if ( nro == 1 ) { outgoing = ", &lt;b&gt;outgoing Annotations&lt;/b&gt;: " + an . getName ( ) + "=" + an . getValue ( ) ; nro -- ; // remove l+"- "+ } else { outgoing += ", " + an . getName ( ) + "=" + an . getValue ( ) ; } } } } } } if ( nro < 1 ) { result += outgoing ; } if ( nri < 1 ) { result += incoming ; } return result ; }
Collects fitting annotations of an Token