@Test public void testToString() { assertEquals("To string of empty sequence wrong", "",seq.toString()); seq.append("a"); seq.append("b"); seq.append("c"); assertEquals("ToString of 3 element seq wrong", "abc", seq.toString()); seq.prepend("d"); seq.prepend("e"); seq.prepend("f"); assertEquals("toString of 6 element seq wrong", "fedabc", seq.toString()); }
public String toString(){ String stringSeq = ""; boolean halt = false; int index = front; while (halt == false){ if (index == backingArray.length){ index = 0; } if (index == rear){ halt = true; } else{ stringSeq = stringSeq + backingArray[index].toString(); index += 1; } } return stringSeq; }
CircularArraySequence implements Sequence { public String toString(){ String stringSeq = ""; boolean halt = false; int index = front; while (halt == false){ if (index == backingArray.length){ index = 0; } if (index == rear){ halt = true; } else{ stringSeq = stringSeq + backingArray[index].toString(); index += 1; } } return stringSeq; } }
CircularArraySequence implements Sequence { public String toString(){ String stringSeq = ""; boolean halt = false; int index = front; while (halt == false){ if (index == backingArray.length){ index = 0; } if (index == rear){ halt = true; } else{ stringSeq = stringSeq + backingArray[index].toString(); index += 1; } } return stringSeq; } CircularArraySequence(int size);  CircularArraySequence(CircularArraySequence<T> seq); }
CircularArraySequence implements Sequence { public String toString(){ String stringSeq = ""; boolean halt = false; int index = front; while (halt == false){ if (index == backingArray.length){ index = 0; } if (index == rear){ halt = true; } else{ stringSeq = stringSeq + backingArray[index].toString(); index += 1; } } return stringSeq; } CircularArraySequence(int size);  CircularArraySequence(CircularArraySequence<T> seq); @Override Object head(); @Override Object last(); @Override Sequence front(); @Override Sequence tail(); @Override Sequence<T> concat(Sequence seq); @Override boolean contains(Sequence subseq); @Override boolean contains(Object element); @Override void append(Object element); @Override void prepend(Object element); @Override boolean isEmpty(); @Override Object peekHead(); @Override Object peekLast(); @Override boolean equals(Sequence seq); @Override int length(); @Override Iterator<T> iterator(); String toString(); }
CircularArraySequence implements Sequence { public String toString(){ String stringSeq = ""; boolean halt = false; int index = front; while (halt == false){ if (index == backingArray.length){ index = 0; } if (index == rear){ halt = true; } else{ stringSeq = stringSeq + backingArray[index].toString(); index += 1; } } return stringSeq; } CircularArraySequence(int size);  CircularArraySequence(CircularArraySequence<T> seq); @Override Object head(); @Override Object last(); @Override Sequence front(); @Override Sequence tail(); @Override Sequence<T> concat(Sequence seq); @Override boolean contains(Sequence subseq); @Override boolean contains(Object element); @Override void append(Object element); @Override void prepend(Object element); @Override boolean isEmpty(); @Override Object peekHead(); @Override Object peekLast(); @Override boolean equals(Sequence seq); @Override int length(); @Override Iterator<T> iterator(); String toString();  }