Пример #1
0
        public void eliminarNodo(Object nodoAEliminar)
        {
            NodoListaDoble nodo = (NodoListaDoble)nodoAEliminar;
            NodoListaDoble aux;

            if (nodo.getNodoAnterior() != null)
            {
                aux = nodo.getNodoAnterior();
                aux.setNodoSiguiente(nodo.getNodoSiguiente());

                if (nodo.getNodoSiguiente() != null)
                {
                    aux = nodo.getNodoSiguiente();
                    aux.setNodoAnterior(nodo.getNodoAnterior());
                }
                else
                {
                    Fin = aux;
                }
            }
            else if (nodo.getNodoSiguiente() != null)
            {
                aux = nodo.getNodoSiguiente();
                aux.setNodoAnterior(null);
                Inicio = aux;
            }
            else
            {
                Inicio = null;
                Fin    = null;
                Actual = null;
            }

            NumeroElementos--;
        }