|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.AbstractSequentialList<E>
java.util.LinkedList
org.lastbamboo.common.sdp.GenericObjectList
public abstract class GenericObjectList
Implements a homogenous consistent linked list. All the objects in the linked list must derive from the same root class. This is a useful constraint to place on our code as this property is invariant.The list is created with the superclass which can be specified as either a class name or a Class.
| Field Summary | |
|---|---|
protected static String |
AND
|
protected static String |
AT
|
protected static String |
COLON
|
protected static String |
COMMA
|
protected static String |
DOT
|
protected static String |
DOUBLE_QUOTE
|
protected static String |
EQUALS
|
protected static String |
GREATER_THAN
|
protected static String |
HT
|
protected int |
indentation
|
protected static String |
LESS_THAN
|
protected String |
listName
|
protected static String |
LPAREN
|
protected Class |
myClass
|
protected static String |
NEWLINE
|
protected static String |
PERCENT
|
protected static String |
POUND
|
protected static String |
QUESTION
|
protected static String |
QUOTE
|
protected static String |
RETURN
|
protected static String |
RPAREN
|
protected static String |
SEMICOLON
|
protected String |
separator
|
protected static String |
SLASH
|
protected static String |
SP
|
protected static String |
STAR
|
| Fields inherited from class java.util.AbstractList |
|---|
modCount |
| Constructor Summary | |
|---|---|
protected |
GenericObjectList()
|
protected |
GenericObjectList(String lname)
|
protected |
GenericObjectList(String lname,
Class objclass)
A Constructor which takes a list name and a class (for assertion checking). |
| Method Summary | |
|---|---|
protected void |
add(GenericObject obj)
Type checked add operation. |
boolean |
add(Object obj)
|
void |
addFirst(Object objToAdd)
|
Object |
clone()
Makes a deep clone of this list. |
protected void |
concatenate(GenericObjectList objList)
Concatenate two compatible header lists, adding the argument to the tail end of this list. |
protected void |
concatenate(GenericObjectList objList,
boolean topFlag)
Concatenate two compatible header lists, adding the argument either to the beginning or the tail end of this list. |
String |
debugDump()
Convert this list of headers to a formatted string. |
String |
debugDump(int indent)
Convert this list of headers to a string (for printing) with an indentation given. |
String |
encode()
Encode the list in semicolon separated form. |
boolean |
equals(Object other)
Equality checking predicate. |
protected GenericObject |
first()
This is the default list iterator.This will not handle nested list traversal. |
protected String |
getIndentation()
|
Iterator |
getIterator()
Get the list iterator for this list. |
Class |
getMyClass()
Sets the class that all our elements derive from. |
protected static boolean |
isCloneable(Object obj)
Return true if this supports reflection based cloning. |
static boolean |
isMySubclass(Class other)
|
boolean |
match(Object other)
Match with a template (return true if we have a superset of the given template. |
void |
mergeObjects(GenericObjectList mergeList)
Do a merge of the GenericObjects contained in this list with the GenericObjects in the mergeList. |
protected GenericObject |
next()
Fetch the next object from the list based on the default list iterator |
protected GenericObject |
next(ListIterator iterator)
Traverse the list given a list iterator |
void |
replace(Match regexp,
GenericObject replacementObject)
Do a find and replace of objects in this list. |
void |
replace(Match regexp,
GenericObjectList replacementObject)
Do a find and replace of objects in this list. |
void |
replace(String objectText,
GenericObject replacementObject,
boolean matchSubstring)
Do a find and replace of objects in this list. |
void |
replace(String objectText,
GenericObjectList replacementObject,
boolean matchSubstring)
Do a find and replace of objects in this list. |
void |
setMyClass(Class cl)
|
void |
setSeparator(String sep)
Set the separator (for encoding the list) |
String |
toString()
Alias for the encode function above. |
| Methods inherited from class java.util.LinkedList |
|---|
add, addAll, addAll, addLast, clear, contains, descendingIterator, element, get, getFirst, getLast, indexOf, lastIndexOf, listIterator, offer, offerFirst, offerLast, peek, peekFirst, peekLast, poll, pollFirst, pollLast, pop, push, remove, remove, remove, removeFirst, removeFirstOccurrence, removeLast, removeLastOccurrence, set, size, toArray, toArray |
| Methods inherited from class java.util.AbstractSequentialList |
|---|
iterator |
| Methods inherited from class java.util.AbstractList |
|---|
hashCode, listIterator, removeRange, subList |
| Methods inherited from class java.util.AbstractCollection |
|---|
containsAll, isEmpty, removeAll, retainAll |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.List |
|---|
containsAll, hashCode, isEmpty, iterator, listIterator, removeAll, retainAll, subList |
| Methods inherited from interface java.util.Deque |
|---|
iterator |
| Field Detail |
|---|
protected static final String SEMICOLON
protected static final String COLON
protected static final String COMMA
protected static final String SLASH
protected static final String SP
protected static final String EQUALS
protected static final String STAR
protected static final String NEWLINE
protected static final String RETURN
protected static final String LESS_THAN
protected static final String GREATER_THAN
protected static final String AT
protected static final String DOT
protected static final String QUESTION
protected static final String POUND
protected static final String AND
protected static final String LPAREN
protected static final String RPAREN
protected static final String DOUBLE_QUOTE
protected static final String QUOTE
protected static final String HT
protected static final String PERCENT
protected int indentation
protected String listName
protected Class myClass
protected String separator
| Constructor Detail |
|---|
protected GenericObjectList()
protected GenericObjectList(String lname)
protected GenericObjectList(String lname,
Class objclass)
| Method Detail |
|---|
protected String getIndentation()
protected static boolean isCloneable(Object obj)
public static boolean isMySubclass(Class other)
public Object clone()
clone in class LinkedListpublic Class getMyClass()
public void setMyClass(Class cl)
protected GenericObject next(ListIterator iterator)
protected GenericObject first()
protected GenericObject next()
protected void concatenate(GenericObjectList objList)
var - topFlag set to true to add items to top of list
protected void concatenate(GenericObjectList objList,
boolean topFlag)
var - topFlag set to true to add items to top of
list else add them to the tail end of the list.public Iterator getIterator()
public String debugDump()
public String debugDump(int indent)
public boolean add(Object obj)
add in interface Collectionadd in interface Dequeadd in interface Listadd in interface Queueadd in class LinkedListpublic void addFirst(Object objToAdd)
addFirst in interface DequeaddFirst in class LinkedListprotected void add(GenericObject obj)
public void replace(String objectText,
GenericObject replacementObject,
boolean matchSubstring)
throws IllegalArgumentException
objectText - text of the object to find.replacementObject - object to replace the target with (
in case a target is found).matchSubstring - boolean that indicates whether to flag a
match when objectText is a substring of a candidate object's
encoded text.
IllegalArgumentException
public void replace(String objectText,
GenericObjectList replacementObject,
boolean matchSubstring)
throws IllegalArgumentException
objectText - text of the object to find.replacementObject - object to replace the target with (in
case a target is found).matchSubstring - boolean that indicates whether to flag a
match when objectText is a substring of a candidate object's
encoded text.
IllegalArgumentException
public void replace(Match regexp,
GenericObjectList replacementObject)
throws IllegalArgumentException
regexp - regular expression to match with the canonical
text we want to replace.replacementObject - object to replace the target with (in
case a target is found).
IllegalArgumentException
public void replace(Match regexp,
GenericObject replacementObject)
throws IllegalArgumentException
regexp - match regular expression of the object to find.
this is generated using the org.apache.regexp package.replacementObject - object to replace the target with (
in case a target is found).
IllegalArgumentExceptionpublic void mergeObjects(GenericObjectList mergeList)
mergeList - is the list of Generic objects that we want to do
an object by object merge with. Note that no new objects are
added to this list.public String encode()
public String toString()
toString in class AbstractCollectionpublic void setSeparator(String sep)
sep - is the new seperator (default is semicolon)public boolean equals(Object other)
equals in interface Collectionequals in interface Listequals in class AbstractListother - is the object to compare ourselves to.
public boolean match(Object other)
other - template object to compare against.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||