@ Override public boolean hasNext ( ) { // trying to iterate over an empty structure... if ( group == null ) return false ; // if there is another group ... if ( current_atom_pos < group . size ( ) - 1 ) { return true ; } else { // search through the next groups if they contain an atom if ( groupiter != null ) { GroupIterator tmp = ( GroupIterator ) groupiter . clone ( ) ; while ( tmp . hasNext ( ) ) { Group tmpg = tmp . next ( ) ; if ( tmpg . size ( ) > 0 ) { return true ; } } } else { // just an iterator over one group ... return false ; } } return false ; }
Is there a next atom ?