public void remove() { for (int i=startIndex+length-1; i>=startIndex; i--) owner.removeItem(i); }
public Item removeItem(int index) { if (locked) { dontRemove(); } return super.removeItem(index); }
public Item removeItem(int index) { Item removed = super.removeItem(index); if (index == 0) { // Don't make the first negative the positive insertNullFirstItem(); } return removed; }
public boolean removeItem(Item item) { if (locked) { dontRemove(); } return super.removeItem(item); }
/** Removes this item */ public void removeItem(Item item) { item.getParent().removeItem(item); }
/** * Removes this item by identity to ensure we remove the right one if there are multiple * equal items */ public void removeItemByIdentity(Item item) { int position=findIndexByIdentity(item); if (position>=0) item.getParent().removeItem(position); else item.getParent().removeItem(item); // Fallback to removeField by equal() }
public boolean removeItem(Item item) { int removedIndex = getItemIndex(item); boolean removed = super.removeItem(item); if (removed && removedIndex == 0) { insertNullFirstItem(); } return removed; }
/** * Removes and returns the first <i>not</i> found in the composite, * or returns null if there's none */ private NotItem removeNot(CompositeItem composite) { for (int i = 0; i < composite.getItemCount(); i++) { if (composite.getItem(i) instanceof NotItem) { return (NotItem) composite.removeItem(i); } } return null; }
recall = Recall.RECALLS_EVERYTHING; } else if ((item instanceof AndItem) || (item instanceof NearItem)) { item.removeItem(i); } else if (item instanceof RankItem) { case RECALLS_NOTHING: if ((item instanceof OrItem) || (item instanceof EquivItem)) { item.removeItem(i); } else if ((item instanceof AndItem) || (item instanceof NearItem)) { return Recall.RECALLS_NOTHING; } else if (item instanceof RankItem) { item.removeItem(i); } else { throw new UnsupportedOperationException(item.getClass().getName());
/** Removes an item, prefers the one at/close to the given position if there are multiple ones */ public void removeItem(int position,Item item) { Item removeCandidate=item.getParent().getItem(position); if (removeCandidate.equals(item)) // Remove based on position item.getParent().removeItem(position); else item.getParent().removeItem(item); // Otherwise, just removeField any such item }
private static void removeOtherNonrankedChildren(CompositeItem parent, int indexOfChildToKeep) { Item childToKeep = parent.getItem(indexOfChildToKeep); for (int i = parent.getItemCount(); --i >= 0; ) { Item child = parent.getItem(i); if ( child != childToKeep && ! parent.getItem(i).isRanked()) parent.removeItem(i); } }
public void replace() { PhraseItem phrase=new PhraseItem(); TermItem firstWord=(TermItem)owner.setItem(startIndex,phrase); replace(firstWord,0); phrase.setIndexName(firstWord.getIndexName()); phrase.addItem(firstWord); for (int i=1; i<length; i++) { TermItem followingWord=(TermItem)owner.removeItem(startIndex+1); replace(followingWord,i); phrase.addItem(followingWord); } }
/** Remove items until there's only one item left */ private void removeNonreferencedMatches(RuleEvaluation e) { int itemCount=e.getEvaluation().getQuerySize(); // Remove items backwards to ease index handling for (int i=e.getNonreferencedMatchCount()-1; i>=0; i--) { // Ensure we don't produce an empty query if (getProduction().getTermCount()==0 && itemCount==1) break; itemCount--; Match match=e.getNonreferencedMatch(i); match.getItem().getParent().removeItem(match.getPosition()); } }
parent.removeItem(matchIndex);
return ((CompositeItem) topLevelItem).removeItem(0);