Beispiel #1
0
 public void insertBefore(NoDuplo node, NoDuplo node2)
 {
     node2.setProximo(node);
     node2.setAnterior(node.getAnterior());
     node.getAnterior().setProximo(node2);
     node.setAnterior(node2);
     tamanho++;
 }
Beispiel #2
0
 public object remove(NoDuplo node)
 {
     if (isEmpty())
     {
         throw new EmptyListException("lista vazia");
     }
     node.getProximo().setAnterior(node.getAnterior());
     node.getAnterior().setProximo(node.getProximo());
     node.setAnterior(null);
     node.setProximo(null);
     tamanho--;
     return(node.getElemento());
 }
Beispiel #3
0
 public NoDuplo before(NoDuplo node)
 {
     if (isFirst(node))
     {
         throw new ListIndexOutOfBondException("O índice não existe");
     }
     return(node.getAnterior());
 }