/** * Randomly permutes the receiver. After invocation, all elements will be at random positions. */ public final void shuffle() { shuffleFromTo(0, size()-1); } /**
/** * Appends all of the elements of the specified Collection to the receiver. * * @exception ClassCastException * if an element in the collection is not of the same * parameter type of the receiver. */ public void addAllOf(java.util.Collection collection) { this.beforeInsertAllOf(size(), collection); }
/** * Randomly permutes the receiver. After invocation, all elements will be at * random positions. */ public final void shuffle() { shuffleFromTo(0, size() - 1); }
/** * Appends all of the elements of the specified Collection to the * receiver. * * @exception ClassCastException if an element in the collection is not * of the same parameter type of the receiver. */ public void addAllOf(java.util.Collection collection) { this.beforeInsertAllOf(size(), collection); } /** Inserts all elements of the specified collection before the specified position into the receiver.
/** * Sorts the receiver into ascending order. * * The sorting algorithm is dynamically chosen according to the characteristics of the data set. * * This implementation simply calls <tt>sortFromTo(...)</tt>. * Override <tt>sortFromTo(...)</tt> if you can determine which sort is most appropriate for the given data set. */ public final void sort() { sortFromTo(0, size()-1); } /**
/** * Appends all of the elements of the specified Collection to the * receiver. * * @exception ClassCastException if an element in the collection is not * of the same parameter type of the receiver. */ public void addAllOf(java.util.Collection collection) { this.beforeInsertAllOf(size(), collection); } /** Inserts all elements of the specified collection before the specified position into the receiver.
/** * Randomly permutes the receiver. After invocation, all elements will be at random positions. */ public final void shuffle() { shuffleFromTo(0, size()-1); } /**
/** * Sorts the receiver into ascending order. * * The sorting algorithm is dynamically chosen according to the characteristics of the data set. * * This implementation simply calls <tt>sortFromTo(...)</tt>. * Override <tt>sortFromTo(...)</tt> if you can determine which sort is most appropriate for the given data set. */ public final void sort() { sortFromTo(0, size()-1); } /**
/** * Removes all elements from the receiver. The receiver will * be empty after this call returns, but keep its current capacity. */ public void clear() { removeFromTo(0,size()-1); } /**
/** * Randomly permutes the receiver. After invocation, all elements will be at * random positions. */ public final void shuffle() { shuffleFromTo(0, size() - 1); }
/** * Removes all elements from the receiver. The receiver will be empty after * this call returns, but keep its current capacity. */ public void clear() { removeFromTo(0, size() - 1); }
/** * Adds the cycle <TT>c</TT> to the list of all cycles. * This method is used by subclass constructors to fill up the list of cycles. * */ protected void addCycle (AbstractList c) { // Adds the cycle \texttt{c} to the list of all cycles. // Used by subclass constructors to fill up the list of cycles. cycles.add (c); numCycles++; numPoints += c.size(); }
/** * Appends all of the elements of the specified Collection to the receiver. * * @exception ClassCastException * if an element in the collection is not of the same * parameter type of the receiver. */ public void addAllOf(java.util.Collection collection) { this.beforeInsertAllOf(size(), collection); }
/** * Removes all elements from the receiver. The receiver will be empty after * this call returns, but keep its current capacity. */ public void clear() { removeFromTo(0, size() - 1); }
/** * Removes all elements from the receiver. The receiver will be empty after * this call returns, but keep its current capacity. */ public void clear() { removeFromTo(0, size() - 1); }
/** * Randomly permutes the receiver. After invocation, all elements will be at * random positions. */ public final void shuffle() { shuffleFromTo(0, size() - 1); }
/** * Removes all elements from the receiver. The receiver will * be empty after this call returns, but keep its current capacity. */ public void clear() { removeFromTo(0,size()-1); } /**
public int resetToNextPoint() { curPointIndex++; startPointInCycle++; if (startPointInCycle >= curCycle.size()) { startPointInCycle = 0; if (curCycleIndex < (numCycles - 1)) resetCurCycle (curCycleIndex + 1); } curCoordIndex = 0; curCoordInCycle = startPointInCycle; return curPointIndex; }
/** * Sorts the receiver into ascending order. * * The sorting algorithm is dynamically chosen according to the * characteristics of the data set. * * This implementation simply calls <tt>sortFromTo(...)</tt>. Override * <tt>sortFromTo(...)</tt> if you can determine which sort is most * appropriate for the given data set. */ public final void sort() { sortFromTo(0, size() - 1); }
public void setCurPointIndex (int i) { int l = 0; int n = 0; int j ; for (j=0; n <= i; j++) n += l = ((AbstractList) cycles.get (j)).size(); resetCurCycle (j-1); startPointInCycle = i - n + l; curPointIndex = i; curCoordIndex = 0; curCoordInCycle = startPointInCycle; }