Package jltk.struc

Class List<ContentType>


  • public class List<ContentType>
    extends Object
    • Constructor Detail

      • List

        public List()
        Create an empty list
    • Method Detail

      • isEmpty

        public boolean isEmpty()
        Return true, if the list is empty, else true,
        Returns:
        true, if this list is empty, else false.
      • hasAccess

        public boolean hasAccess()
        Return true, if a current object exists, else false.
        Returns:
        true, if access ist prossible, else false.
      • toFirst

        public void toFirst()
        Set the current object to the first object.
      • toLast

        public void toLast()
        Set the current object to the last object.
      • next

        public void next()
        If the list is not empty an hasAccess() is true and the current object is not the last object, the current object is set to the successor of this object. Otherwise there is no current object, that means hasAccess() returns false.
      • getContent

        public ContentType getContent()
        If a current object exists (hasAccess() == true), the current object is returned, otherwise null is returned.
        Returns:
        the current object or null.
      • getLast

        public ContentType getLast()
        Return the last object of this list, or null if the list is empty,
        Returns:
        the last object or null.
      • setContent

        public void setContent​(ContentType pContent)
        If a current object exists (hasAccess() == true) and pContent is not null, the current object is set to pContent. Otherwise nothing happens.
        Parameters:
        pContent - The new content for the current object.
      • insert

        public void insert​(ContentType pContent)
      • append

        public void append​(ContentType pContent)
      • remove

        public void remove()