public Iterator<Key> iterator() { return keys.iterator(); }
/** Constructor to create an input stream from raw OSIS input * @param book * @param key */ public OSISInputStream(Book book, Key key) { this.book = book; this.key = key; osisVerseTidy = new OSISVerseTidy(book); keyIterator = key.iterator(); }
private void readNormalOsis(Key key, RawTextToXmlProcessor processor, List<Content> content, T openFileState) throws BookException { // simply lookup the key and process the relevant information Iterator<Key> iterator = key.iterator(); while (iterator.hasNext()) { Key next = iterator.next(); String rawText; try { rawText = readRawContent(openFileState, next); processor.postVerse(next, content, rawText); } catch (IOException e) { // failed to process key 'next' throwFailedKeyException(key, next, e); } } }
/** * Utility to remove all the keys from alter that are not in base * * @param alter * The key to remove keys from * @param base * The check key */ protected static void retain(Key alter, Key base) { Iterator<Key> it = alter.iterator(); while (it.hasNext()) { Key sublist = it.next(); if (sublist.canHaveChildren()) { retain(sublist, base); if (sublist.isEmpty()) { it.remove(); } } else { if (!base.contains(sublist)) { it.remove(); } } } }
result.append("<a href='").append(Constants.BIBLE_PROTOCOL).append(":").append(key.iterator().next().getOsisRef()).append("'>"); result.append(key); result.append("</a>");
Iterator<Key> thatIter = that.iterator();
Iterator<Key> thatIter = that.iterator();
/** * While Bible and Commentary are very similar, a Dictionary is read in a * slightly different way. It is also worth looking at the JavaDoc for Book * that has a way of treating Bible, Commentary and Dictionary the same. * * @throws BookException * @see Book */ public void readDictionary() throws BookException { // This just gets a list of all the known dictionaries and picks the // first. In a real world app you will probably have a better way // of doing this. List<Book> dicts = Books.installed().getBooks(BookFilters.getDictionaries()); Book dict = dicts.get(0); // If I want every key in the Dictionary then I do this (or something // like it - in the real world you want to call hasNext() on an iterator // before next() but the point is the same: Key keys = dict.getGlobalKeyList(); Key first = keys.iterator().next(); System.out.println("The first Key in the default dictionary is " + first); BookData data = new BookData(dict, first); System.out.println("And the text against that key is " + OSISUtil.getPlainText(data.getOsisFragment())); }
Iterator<Key> thatIter = key.iterator(); while (thatIter.hasNext()) { VerseRange thatRange = toVerseRange(getVersification(), thatIter.next());
Iterator<Key> it = key.iterator(); while (it.hasNext()) {