@Test public void toStringTest () { FloatQueue q = new FloatQueue(1); assertEquals("[]", q.toString()); q.addLast((float) 4); assertEquals("[4.0]", q.toString()); q.addLast((float) 5); q.addLast((float) 6); q.addLast((float) 7); assertEquals("[4.0, 5.0, 6.0, 7.0]", q.toString()); }
public String toString () { if (size == 0) { return "[]"; } final float[] values = this.values; final int head = this.head; final int tail = this.tail; StringBuilder sb = new StringBuilder(64); sb.append('['); sb.append(values[head]); for (int i = (head + 1) % values.length; i != tail; i = (i + 1) % values.length) { sb.append(", ").append(values[i]); } sb.append(']'); return sb.toString(); }
FloatQueue { public String toString () { if (size == 0) { return "[]"; } final float[] values = this.values; final int head = this.head; final int tail = this.tail; StringBuilder sb = new StringBuilder(64); sb.append('['); sb.append(values[head]); for (int i = (head + 1) % values.length; i != tail; i = (i + 1) % values.length) { sb.append(", ").append(values[i]); } sb.append(']'); return sb.toString(); } }
FloatQueue { public String toString () { if (size == 0) { return "[]"; } final float[] values = this.values; final int head = this.head; final int tail = this.tail; StringBuilder sb = new StringBuilder(64); sb.append('['); sb.append(values[head]); for (int i = (head + 1) % values.length; i != tail; i = (i + 1) % values.length) { sb.append(", ").append(values[i]); } sb.append(']'); return sb.toString(); } FloatQueue();  FloatQueue(int initialSize); }
FloatQueue { public String toString () { if (size == 0) { return "[]"; } final float[] values = this.values; final int head = this.head; final int tail = this.tail; StringBuilder sb = new StringBuilder(64); sb.append('['); sb.append(values[head]); for (int i = (head + 1) % values.length; i != tail; i = (i + 1) % values.length) { sb.append(", ").append(values[i]); } sb.append(']'); return sb.toString(); } FloatQueue();  FloatQueue(int initialSize); void addLast(float object); void addFirst(float object); void ensureCapacity(int additional); float removeFirst(); float removeLast(); int indexOf(float value); boolean removeValue(float value); float removeIndex(int index); boolean notEmpty(); boolean isEmpty(); float first(); float last(); float get(int index); void clear(); Iterator<Float> iterator(); String toString(); String toString(String separator); int hashCode(); boolean equals(Object o); }
FloatQueue { public String toString () { if (size == 0) { return "[]"; } final float[] values = this.values; final int head = this.head; final int tail = this.tail; StringBuilder sb = new StringBuilder(64); sb.append('['); sb.append(values[head]); for (int i = (head + 1) % values.length; i != tail; i = (i + 1) % values.length) { sb.append(", ").append(values[i]); } sb.append(']'); return sb.toString(); } FloatQueue();  FloatQueue(int initialSize); void addLast(float object); void addFirst(float object); void ensureCapacity(int additional); float removeFirst(); float removeLast(); int indexOf(float value); boolean removeValue(float value); float removeIndex(int index); boolean notEmpty(); boolean isEmpty(); float first(); float last(); float get(int index); void clear(); Iterator<Float> iterator(); String toString(); String toString(String separator); int hashCode(); boolean equals(Object o); public int size; }