void (String qName, final Processor<? super WordOccurrence> processor) { WordOccurrence occurrence = new WordOccurrence(qName, 0, qName.length(), WordOccurrence.Kind.FOREIGN_LANGUAGE); processor.process(occurrence); int idx = qName.lastIndexOf('.'); while (idx > 0) { qName = qName.substring(0, idx); occurrence.init(qName, 0,qName.length(),WordOccurrence.Kind.FOREIGN_LANGUAGE); processor.process(occurrence); idx = qName.lastIndexOf('.'); } }