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.
- Mark Little (email@example.com)
- $Id: RecordList.java 2342 2006-03-30 13:06:17Z $
- JTS 1.0.
Remove and return the element at the front of the list.
- the front element.
Remove and return the element at the tail of the list.
- the last element.
Insert the entry at the head of the list.
Explicit push onto front of list.
Explicit push onto rear of list.
- the number of items in the current list.
This is a variation on ordered insertion. Insertion obeys the following
algorithm. Starting at the record indicated by 'startat' examine each
entry in the list in turn and perform the following code 1) If the new
record should be merged with the old, call nr.merge passing the old
record as an argument and then INSERT the new record IN PLACE OF the old
and exit 2) If the new record should replace the old then INSERT the new
record IN PLACE OF the old and exit 3) If the new record should be added
in addition to the old then INSERT the new record BEFORE the old and exit
4) If the two records are the same (determined by the == operator) simply
exit 5) Otherwise determine if the new record should be added here
regardless due to the ordering constraints on the list and if so add and
exit, otherwise step on to the next element and repeat all the steps.
Steps 1-4 effectively ensure that information maintained in any two
records for the same object is current either by merging in new
information, replacing the old with new, adding in new, or leaving the
old alone. Step 5 ensures that if no existing record exists insertion
takes place at the correct point
true if insertion/replacement took place,
" and "+current.type()+" for "+newRecord.order());
" and "+newRecord.type()+" for "+newRecord.order());
tsLogger.logger.trace("RecordList::insert("+this+") : adding extra record of type "+
newRecord.type()+" before "+current.type()+" for "+newRecord.order());
newRecord.type()+" for "+newRecord.order()+" before "+current.type());
" before "+current.type()+" for "+current.order());
Insert the first parameter before the second in the list.