protected < C extends Compound > boolean canComplement ( Sequence < C > sequence ) { CompoundSet < C > compoundSet = sequence . getCompoundSet ( ) ; Compound c = compoundSet . getAllCompounds ( ) . iterator ( ) . next ( ) ; return ComplementCompound . class . isAssignableFrom ( c . getClass ( ) ) ; }
Uses the Sequence s CompoundSet to decide if a compound can be assgined to ComplementCompound meaning it can complement