/** * Deletes the first element from the receiver that matches the specified element. * Does nothing, if no such matching element is contained. * * Tests elements for equality or identity as specified by <tt>testForEquality</tt>. * When testing for equality, two elements <tt>e1</tt> and * <tt>e2</tt> are <i>equal</i> if <tt>(e1==null ? e2==null : * e1.equals(e2))</tt>.) * * @param testForEquality if true -> tests for equality, otherwise for identity. * @param element the element to be deleted. */ public void delete(Object element, boolean testForEquality) { int index = indexOfFromTo(element, 0, size-1, testForEquality); if (index>=0) removeFromTo(index,index); } /**
/** * Deletes the first element from the receiver that matches the specified element. * Does nothing, if no such matching element is contained. * * Tests elements for equality or identity as specified by <tt>testForEquality</tt>. * When testing for equality, two elements <tt>e1</tt> and * <tt>e2</tt> are <i>equal</i> if <tt>(e1==null ? e2==null : * e1.equals(e2))</tt>.) * * @param testForEquality if true -> tests for equality, otherwise for identity. * @param element the element to be deleted. */ public void delete(Object element, boolean testForEquality) { int index = indexOfFromTo(element, 0, size-1, testForEquality); if (index>=0) removeFromTo(index,index); } /**
/** * Deletes the first element from the receiver that matches the specified * element. Does nothing, if no such matching element is contained. * * Tests elements for equality or identity as specified by * <tt>testForEquality</tt>. When testing for equality, two elements * <tt>e1</tt> and <tt>e2</tt> are <i>equal</i> if * <tt>(e1==null ? e2==null : * e1.equals(e2))</tt>.) * * @param testForEquality * if true -> tests for equality, otherwise for identity. * @param element * the element to be deleted. */ public void delete(Object element, boolean testForEquality) { int index = indexOfFromTo(element, 0, size - 1, testForEquality); if (index >= 0) removeFromTo(index, index); }
removeFromTo(theLast+diff, theLast-1);
removeFromTo(theLast+diff, theLast-1);
} else { if (diff < 0) { removeFromTo(theLast + diff, theLast - 1);
hs.getTiers().removeFromTo(indexOfLastTier - (dirtyTiersCount - 1), indexOfLastTier);