Package jltk.struc
Class List<ContentType>
- java.lang.Object
-
- jltk.struc.List<ContentType>
-
public class List<ContentType> extends Object
-
-
Field Summary
Fields Modifier and Type Field Description (package private) jltk.struc.List.Node<ContentType>
current
(package private) jltk.struc.List.Node<ContentType>
first
(package private) jltk.struc.List.Node<ContentType>
last
String
seperator
-
Constructor Summary
Constructors Constructor Description List()
Create an empty list
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
append(ContentType pContent)
void
concat(List<ContentType> pList)
ContentType
getContent()
If a current object exists (hasAccess() == true), the current object is returned, otherwise null is returned.ContentType
getLast()
Return the last object of this list, or null if the list is empty,boolean
hasAccess()
Return true, if a current object exists, else false.void
insert(ContentType pContent)
boolean
isEmpty()
Return true, if the list is empty, else true,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.void
remove()
void
setContent(ContentType pContent)
If a current object exists (hasAccess() == true) and pContent is not null, the current object is set to pContent.void
toFirst()
Set the current object to the first object.void
toLast()
Set the current object to the last object.String
toString()
-
-
-
Field Detail
-
first
jltk.struc.List.Node<ContentType> first
-
last
jltk.struc.List.Node<ContentType> last
-
current
jltk.struc.List.Node<ContentType> current
-
seperator
public String seperator
-
-
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()
-
concat
public void concat(List<ContentType> pList)
-
-