Skip navigation links
Drools :: Core 6.5.0.Final-redhat-5
org.drools.core.util

Class LinkedList<T extends LinkedListNode<T>>

    • Field Detail

      • fastIterator

        public static final FastIterator fastIterator
    • Constructor Detail

      • LinkedList

        public LinkedList()
        Construct an empty LinkedList
      • LinkedList

        public LinkedList(T node)
    • Method Detail

      • add

        public void add(T node)
        Add a LinkedListNode to the list. If the LinkedList is empty then the first and last nodes are set to the added node.
        Parameters:
        node - The LinkedListNode to be added
      • addLast

        public void addLast(T node)
        Add a LinkedListNode to the end of the list. If the LinkedList is empty then the first and last nodes are set to the added node.
        Parameters:
        node - The LinkedListNode to be added
      • addFirst

        public void addFirst(T node)
      • remove

        public void remove(T node)
        Removes a LinkedListNode from the list. This works by attach the previous reference to the child reference. When the node to be removed is the first node it calls removeFirst(). When the node to be removed is the last node it calls removeLast().
        Parameters:
        node - The LinkedListNode to be removed.
      • contains

        public boolean contains(T node)
      • getFirst

        public final T getFirst()
        Return the first node in the list
        Returns:
        The first LinkedListNode.
      • getLast

        public final T getLast()
        Return the last node in the list
        Returns:
        The last LinkedListNode.
      • removeFirst

        public T removeFirst()
        Remove the first node from the list. The next node then becomes the first node. If this is the last node then both first and last node references are set to null.
        Returns:
        The first LinkedListNode.
      • insertAfter

        public void insertAfter(T existingNode,
                                T newNode)
      • removeLast

        public T removeLast()
        Remove the last node from the list. The previous node then becomes the last node. If this is the last node then both first and last node references are set to null.
        Returns:
        The first LinkedListNode.
      • get

        public T get(int i)
      • isEmpty

        public final boolean isEmpty()
        Returns:
        boolean value indicating the empty status of the list
      • clear

        public void clear()
        Iterates the list removing all the nodes until there are no more nodes to remove.
      • size

        public final int size()
        Returns:
        return size of the list as an int
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • javaUtilIterator

        public Iterator<T> javaUtilIterator()
Drools :: Core 6.5.0.Final-redhat-5

Copyright © 2001–2017 JBoss by Red Hat. All rights reserved.