Esempio n. 1
0
  public void InsertAfter(ILNodeValue<T> base, ILNodeValue<T> newValue) {
    ILNode<T> newNode = newValue.GetNode(identifier);
    ILNode<T> baseNode = base.GetNode(identifier);

    newNode.Delete();
    baseNode.InsertAfter(newNode);
    if (baseNode == tail) tail = newNode;
  }
Esempio n. 2
0
  public void InsertBefore(ILNodeValue<T> base, ILNodeValue<T> newValue) {
    ILNode<T> newNode = newValue.GetNode(identifier);
    ILNode<T> baseNode = base.GetNode(identifier);

    newNode.Delete();
    baseNode.InsertBefore(newNode);
    if (baseNode == head) head = newNode;
  }
Esempio n. 3
0
  public void Delete(ILNodeValue<T> value) {
    ILNode<T> node = value.GetNode(identifier);
    ILNode<T> next = node.GetNext();
    ILNode<T> prev = node.GetPrev();

    node.Delete();

    if (node == head) {
      head = next;
    }
    if (node == tail) {
      tail = prev;
    }
  }