Main Page   Packages   Namespace List   Class Hierarchy   Compound List   Compound Members  

ContentList Class Reference

List of all members.

Public Methods

void add (int index, Object obj)
boolean addAll (Collection collection)
boolean addAll (int index, Collection collection)
Object get (int index)
Object remove (int index)
Object set (int index, Object obj)
int size ()
String toString ()

Protected Methods

 ContentList (Document document)
 ContentList (Element parent)
void add (int index, Element element)
void add (int index, Comment comment)
void add (int index, ProcessingInstruction pi)
void add (int index, CDATA cdata)
void add (int index, Text text)
void add (int index, EntityRef entity)
void clearAndSet (Collection collection)
void ensureCapacity (int minCapacity)
List getView (Filter filter)
int indexOfFirstElement ()

Protected Attributes

ArrayList list
Object parent

Detailed Description

ContentList represents valid JDOM content, including content for Documents or Elements. This class is NOT PUBLIC; users should see it as a simple List implementation.

Author:
Alex Rosen , Philippe Riand , Bradley S. Huffman
Version:
Revision:
1.3
,
Date:
2002/02/13 16:58:47
See also:
CDATA , Comment , Element , EntityRef , ProcessingInstruction , Text


Constructor & Destructor Documentation

ContentList::ContentList Document    document [inline, protected]
 

Create a new instance of the ContentList representing Document content

ContentList::ContentList Element    parent [inline, protected]
 

Create a new instance of the ContentList representing Element content


Member Function Documentation

void ContentList::add int    index,
EntityRef    entity
[inline, protected]
 

Check and add the EntityRef to this list at the given index.

Parameters:
index  index where to add Entity
entity  Entity to add

void ContentList::add int    index,
Text    text
[inline, protected]
 

Check and add the Text to this list at the given index.

Parameters:
index  index where to add Text
text  Text to add

void ContentList::add int    index,
CDATA    cdata
[inline, protected]
 

Check and add the CDATA to this list at the given index.

Parameters:
index  index where to add CDATA
cdata  CDATA to add

void ContentList::add int    index,
ProcessingInstruction    pi
[inline, protected]
 

Check and add the ProcessingInstruction to this list at the given index.

Parameters:
index  index where to add ProcessingInstruction
pi  ProcessingInstruction to add

void ContentList::add int    index,
Comment    comment
[inline, protected]
 

Check and add the Comment to this list at the given index.

Parameters:
index  index where to add Comment
comment  Comment to add

void ContentList::add int    index,
Element    element
[inline, protected]
 

Check and add the Element to this list at the given index.

Parameters:
index  index where to add Element
element  Element to add

void ContentList::add int    index,
Object    obj
[inline]
 

Inserts the specified object at the specified position in this list. Shifts the object currently at that position (if any) and any subsequent objects to the right (adds one to their indices).

Parameters:
index  The location to set the value to.
obj  The object to insert into the list. throws IndexOutOfBoundsException if index < 0 || index > size()

boolean ContentList::addAll int    index,
Collection    collection
[inline]
 

Inserts the specified collecton at the specified position in this list. Shifts the object currently at that position (if any) and any subsequent objects to the right (adds one to their indices).

Parameters:
index  The offset to start adding the data in the collection
collection  The collection to insert into the list.
Returns:
true if the list was modified as a result of the add. throws IndexOutOfBoundsException if index < 0 || index > size()

boolean ContentList::addAll Collection    collection [inline]
 

Add the specified collecton to the end of this list.

Parameters:
collection  The collection to add to the list.
Returns:
true if the list was modified as a result of the add.

void ContentList::clearAndSet Collection    collection [inline, protected]
 

Clear the current list and set it to the contents of the Collection. object.

Parameters:
collection  The collection to use.

void ContentList::ensureCapacity int    minCapacity [inline, protected]
 

Increases the capacity of this ContentList instance, if necessary, to ensure that it can hold at least the number of items specified by the minimum capacity argument.

Parameters:
minCapacity  the desired minimum capacity.

Object ContentList::get int    index [inline]
 

Return the object at the specified offset.

Parameters:
index  The offset of the object.
Returns:
The Object which was returned.

List ContentList::getView Filter    filter [inline, protected]
 

Return a view of this list based on the given filter.

Parameters:
filter  Filter for this view.
Returns:
a list representing the rules of the Filter.

int ContentList::indexOfFirstElement   [inline, protected]
 

Return the index of the first Element in the list. If the parent is a Document then the element is the root element. If the list contains no Elements, it returns -1.

Returns:
index of first element, or -1 if one doesn't exist

Object ContentList::remove int    index [inline]
 

Remove the object at the specified offset.

Parameters:
index  The offset of the object.
Returns:
The Object which was removed.

Object ContentList::set int    index,
Object    obj
[inline]
 

Set the object at the specified location to the supplied object.

Parameters:
index  The location to set the value to.
obj  The location to set the value to.
Returns:
The object which was replaced. throws IndexOutOfBoundsException if index < 0 || index >= size()

int ContentList::size   [inline]
 

Return the number of items in this list

Returns:
The number of items in this list.

String ContentList::toString   [inline]
 

Return this list as a String

Returns:
The number of items in this list.


Member Data Documentation

ArrayList ContentList::list [protected]
 

Our backing list

Object ContentList::parent [protected]
 

Document or Element this list belongs to


The documentation for this class was generated from the following file:
Generated on Sat Mar 30 18:53:03 2002 for JDOM by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001