@Override public int hashCode() { return toString().hashCode(); }
/** * Checks this node vs another one for equality. * * @param o another node * @return true if the string representation of the entry and weighting match. */ @Override public boolean equals(Object o) { boolean result = false; if(o instanceof GazetteerNode) { result = this.toString().equals(o.toString()); } return result; }
/** * Stores the list to the specified url * * @throws ResourceInstantiationException */ public void store() throws ResourceInstantiationException { try { if(null == url) { throw new ResourceInstantiationException("URL not specified (null)"); } File fileo = Files.fileFromURL(url); fileo.delete(); OutputStreamWriter listWriter = new OutputStreamWriter(new FileOutputStream(fileo), encoding); // BufferedWriter listWriter = new BufferedWriter(new // FileWriter(fileo)); Iterator<GazetteerNode> iter = entries.iterator(); while(iter.hasNext()) { listWriter.write(iter.next().toString()); listWriter.write(13); listWriter.write(10); } listWriter.close(); } catch(Exception x) { throw new ResourceInstantiationException(x.getClass() + ":" + x.getMessage()); } isModified = false; } // store()
String normalisedWord = null; for(; iterator.hasNext(); add(normalisedWord, lookup1)) { String word = iterator.next().toString(); int wordLength = word.length(); for(int j = 0; j < wordLength; j++) {