Class RecordList
- java.lang.Object
-
- com.arjuna.ats.arjuna.coordinator.RecordList
-
public class RecordList extends Object
This class manages instances of the classes derived from AbstractRecord in the form of an ordered doubly-linked list. The ordering and insertion criteria are not particularly standard - see the comment on 'insert' for the actual algorithm used in insertion. The algorithm assumes that one or more different record type instances (LockRecords, RecoveryRecords, etc.) will be inserted into the list at different times. Each such record contains specific information managing certain properties of any particular object. As execution progresses newly created records may need to be merged with, replace entirely, or be added to existing records that relate to an object. Note, the methods of this class do not need to be synchronized because instances of this class are only used from within synchronized classes. Applications should not use this class.- Since:
- JTS 1.0.
- Version:
- $Id: RecordList.java 2342 2006-03-30 13:06:17Z $
- Author:
- Mark Little (mark@arjuna.com)
-
-
Field Summary
Fields Modifier and Type Field Description protected AbstractRecordlistHead
-
Constructor Summary
Constructors Constructor Description RecordList()RecordList(RecordList copy)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AbstractRecordgetFront()Remove and return the element at the front of the list.AbstractRecordgetNext(AbstractRecord current)AbstractRecordgetRear()Remove and return the element at the tail of the list.booleaninsert(AbstractRecord newRecord)Insert the entry at the head of the list.AbstractRecordpeekFront()AbstractRecordpeekNext(AbstractRecord curr)AbstractRecordpeekRear()voidprint(PrintWriter strm)voidputFront(AbstractRecord newRecord)Explicit push onto front of list.voidputRear(AbstractRecord newRecord)Explicit push onto rear of list.booleanremove(AbstractRecord oldRecord)intsize()StringtoString()
-
-
-
Field Detail
-
listHead
protected AbstractRecord listHead
-
-
Constructor Detail
-
RecordList
public RecordList()
-
RecordList
public RecordList(RecordList copy)
-
-
Method Detail
-
getFront
public final AbstractRecord getFront()
Remove and return the element at the front of the list.- Returns:
- the front element.
-
getRear
public final AbstractRecord getRear()
Remove and return the element at the tail of the list.- Returns:
- the last element.
-
getNext
public AbstractRecord getNext(AbstractRecord current)
-
insert
public final boolean insert(AbstractRecord newRecord)
Insert the entry at the head of the list.
-
print
public final void print(PrintWriter strm)
-
putFront
public final void putFront(AbstractRecord newRecord)
Explicit push onto front of list.
-
putRear
public final void putRear(AbstractRecord newRecord)
Explicit push onto rear of list.
-
peekFront
public final AbstractRecord peekFront()
-
peekRear
public final AbstractRecord peekRear()
-
peekNext
public final AbstractRecord peekNext(AbstractRecord curr)
-
remove
public final boolean remove(AbstractRecord oldRecord)
-
size
public final int size()
- Returns:
- the number of items in the current list.
-
-