@Override public void clear() { if (null != dictionary && dictionary.isEditable()) { List<Word> copy = new ArrayList<>(this); super.clear(); for (Word word : copy) { removeThisSynsetFromIndexWords(word); } } else { super.clear(); } }
@Override public void clear() { if (null != dictionary && dictionary.isEditable()) { List<Word> copy = new ArrayList<>(this); super.clear(); for (Word word : copy) { removeThisSynsetFromIndexWords(word); } } else { super.clear(); } }
@Override public Word remove(int index) { if (null != dictionary && dictionary.isEditable()) { Word result = super.remove(index); removeThisSynsetFromIndexWords(result); return result; } else { return super.remove(index); } }
@Override public Word set(int index, Word word) { checkWordIsNotNull(word); if (null != dictionary && dictionary.isEditable()) { checkDictionaryIsOurs(word); Word result = super.set(index, word); if (null != result) { removeThisSynsetFromIndexWords(result); } addToIndexWords(word); return result; } else { return super.set(index, word); } }
@Override public Word set(int index, Word word) { checkWordIsNotNull(word); if (null != dictionary && dictionary.isEditable()) { checkDictionaryIsOurs(word); Word result = super.set(index, word); if (null != result) { removeThisSynsetFromIndexWords(result); } addToIndexWords(word); return result; } else { return super.set(index, word); } }
@Override public boolean remove(Object o) { if (null != dictionary && dictionary.isEditable()) { boolean result = super.remove(o); if (result && o instanceof Word) { removeThisSynsetFromIndexWords((Word) o); } return result; } else { return super.remove(o); } }
@Override public boolean remove(Object o) { if (null != dictionary && dictionary.isEditable()) { boolean result = super.remove(o); if (result && o instanceof Word) { removeThisSynsetFromIndexWords((Word) o); } return result; } else { return super.remove(o); } }
@Override public Word remove(int index) { if (null != dictionary && dictionary.isEditable()) { Word result = super.remove(index); removeThisSynsetFromIndexWords(result); return result; } else { return super.remove(index); } }
@Override protected void removeRange(int fromIndex, int toIndex) { if (null != dictionary && dictionary.isEditable()) { List<Word> copy = new ArrayList<>(subList(fromIndex, toIndex)); super.removeRange(fromIndex, toIndex); for (Word word : copy) { removeThisSynsetFromIndexWords(word); } } else { super.removeRange(fromIndex, toIndex); } }
@Override protected void removeRange(int fromIndex, int toIndex) { if (null != dictionary && dictionary.isEditable()) { List<Word> copy = new ArrayList<>(subList(fromIndex, toIndex)); super.removeRange(fromIndex, toIndex); for (Word word : copy) { removeThisSynsetFromIndexWords(word); } } else { super.removeRange(fromIndex, toIndex); } }