Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void removeCurrent() throws IllegalStateException
- {
- // check
- if (isCurrent() == false)
- {
- throw new IllegalStateException("No current");
- }
- else if (current == head)
- {
- previous = null;
- head.setLink(null);
- current = current.getLink();
- current = head;
- }
- else if (current != tail && current != head)
- {
- previous.setLink(current.getLink());
- current = previous.getLink();
- }
- else if (current == tail)
- {
- previous.setLink(current.getLink());
- current = null;
- }
- manyNodes--;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement