/** * Sets the receiver's elements to be the specified array. * The size and capacity of the list is the length of the array. * <b>WARNING:</b> For efficiency reasons and to keep memory usage low, this method may decide <b>not to copy the array</b>. * So if subsequently you modify the returned array directly via the [] operator, be sure you know what you're doing. * * @param elements the new elements to be stored. * @return the receiver itself. */ public AbstractCharList elements(char[] elements) { clear(); addAllOfFromTo(new CharArrayList(elements),0,elements.length-1); return this; } /**
/** * Sets the receiver's elements to be the specified array. * The size and capacity of the list is the length of the array. * <b>WARNING:</b> For efficiency reasons and to keep memory usage low, this method may decide <b>not to copy the array</b>. * So if subsequently you modify the returned array directly via the [] operator, be sure you know what you're doing. * * @param elements the new elements to be stored. * @return the receiver itself. */ public AbstractCharList elements(char[] elements) { clear(); addAllOfFromTo(new CharArrayList(elements),0,elements.length-1); return this; } /**
/** * Returns a list which is a concatenation of <code>times</code> times the receiver. * @param times the number of times the receiver shall be copied. */ public AbstractCharList times(int times) { AbstractCharList newList = new CharArrayList(times*size()); for (int i=times; --i >= 0; ) { newList.addAllOfFromTo(this,0,size()-1); } return newList; } /**
/** * Returns a list which is a concatenation of <code>times</code> times the receiver. * @param times the number of times the receiver shall be copied. */ public AbstractCharList times(int times) { AbstractCharList newList = new CharArrayList(times*size()); for (int i=times; --i >= 0; ) { newList.addAllOfFromTo(this,0,size()-1); } return newList; } /**