Top Description Inners Fields Constructors Methods
org.apache.xerces.impl.xs

public final Class XSModelImpl

extends AbstractList
implements XSModel, XSNamespaceItemList
Class Inheritance
All Implemented Interfaces
org.apache.xerces.xs.XSNamespaceItemList, java.util.List, java.util.SequencedCollection, java.util.Collection, java.lang.Iterable, org.apache.xerces.xs.XSModel
Imports
java.lang.reflect.Array, java.util.AbstractList, .Iterator, .ListIterator, .NoSuchElementException, .Vector, org.apache.xerces.impl.Constants, org.apache.xerces.impl.xs.util.StringListImpl, .XSNamedMap4Types, .XSNamedMapImpl, .XSObjectListImpl, org.apache.xerces.util.SymbolHash, .XMLSymbols, org.apache.xerces.xs.StringList, .XSAttributeDeclaration, .XSAttributeGroupDefinition, .XSConstants, .XSElementDeclaration, .XSIDCDefinition, .XSModel, .XSModelGroupDefinition, .XSNamedMap, .XSNamespaceItem, .XSNamespaceItemList, .XSNotationDeclaration, .XSObject, .XSObjectList, .XSTypeDefinition

Implements XSModel: a read-only interface that represents an XML Schema, which could be components from different namespaces.
Author
Sandy Gao, IBM
Version
$Id: XSModelImpl.java 1024038 2010-10-18 22:06:35Z sandygao $

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class

Field Summary

Modifier and TypeField and Description
private XSObjectList
private final XSNamedMap[]
private final int
private final SchemaGrammar[]
private final SymbolHash
private final boolean
private final String[]
private final StringList
private final XSNamedMap[][]
private final SymbolHash
private static final boolean[]
private static final short
Inherited from java.util.AbstractList:
modCount

Constructor Summary

AccessConstructor and Description
public
XSModelImpl(SchemaGrammar[]
the array of schema grammars
grammars
)

Construct an XSModelImpl, by storing some grammars and grammars imported by them to this object.

public
XSModelImpl(SchemaGrammar[] grammars, short s4sVersion)

Method Summary

Modifier and TypeMethod and Description
private SymbolHash
private SymbolHash
public Object
get(int
index of the element to return
index
)

Implements abstract java.util.AbstractList.get.

Implements java.util.List.get.

Returns the element at the specified position in this list.
public synchronized XSObjectList
getAnnotations()

Implements org.apache.xerces.xs.XSModel.getAnnotations.

[annotations]: a set of annotations if it exists, otherwise an empty XSObjectList.
public XSAttributeDeclaration

Returns:

A top-level attribute declaration or null if such declaration does not exist.
getAttributeDeclaration
(String
The name of the declaration.
name
,
String
The namespace of the definition, otherwise null.
namespace
)

Implements org.apache.xerces.xs.XSModel.getAttributeDeclaration.

Convenience method.
public XSAttributeDeclaration

Returns:

A top-level attribute declaration or null if such declaration does not exist.
getAttributeDeclaration
(String
The name of the declaration.
name
,
String
The namespace of the definition, otherwise null.
namespace
,
String
The schema location where the component was defined
loc
)

Convenience method.

public XSAttributeGroupDefinition

Returns:

A top-level attribute group definition or null if such definition does not exist.
getAttributeGroup
(String
The name of the definition.
name
,
String
The namespace of the definition, otherwise null.
namespace
)

Implements org.apache.xerces.xs.XSModel.getAttributeGroup.

Convenience method.
public XSAttributeGroupDefinition

Returns:

A top-level attribute group definition or null if such definition does not exist.
getAttributeGroup
(String
The name of the definition.
name
,
String
The namespace of the definition, otherwise null.
namespace
,
String
The schema location where the component was defined
loc
)

Convenience method.

public synchronized XSNamedMap

Returns:

A list of top-level definitions of the specified type in objectType or an empty XSNamedMap if no such definitions exist.
getComponents
(short
The type of the declaration, i.e. ELEMENT_DECLARATION. Note that XSTypeDefinition.SIMPLE_TYPE and XSTypeDefinition.COMPLEX_TYPE can also be used as the objectType to retrieve only complex types or simple types, instead of all types.
objectType
)

Implements org.apache.xerces.xs.XSModel.getComponents.

Returns a list of top-level components, i.e. element declarations, attribute declarations, etc.
public synchronized XSNamedMap

Returns:

A list of top-level definitions of the specified type in objectType and defined in the specified namespace or an empty XSNamedMap.
getComponentsByNamespace
(short
The type of the declaration, i.e. ELEMENT_DECLARATION.
objectType
,
String
The namespace to which the declaration belongs or null (for components with no target namespace).
namespace
)

Implements org.apache.xerces.xs.XSModel.getComponentsByNamespace.

Convenience method.
public XSElementDeclaration

Returns:

A top-level element declaration or null if such declaration does not exist.
getElementDeclaration
(String
The name of the declaration.
name
,
String
The namespace of the definition, otherwise null.
namespace
)

Implements org.apache.xerces.xs.XSModel.getElementDeclaration.

Convenience method.
public XSElementDeclaration

Returns:

A top-level element declaration or null if such declaration does not exist.
getElementDeclaration
(String
The name of the declaration.
name
,
String
The namespace of the definition, otherwise null.
namespace
,
String
The schema location where the component was defined
loc
)

Convenience method.

private XSObjectListImpl
public XSIDCDefinition

Returns:

A top-level model group definition definition or null if such definition does not exist.
getIDCDefinition
(String
The name of the definition.
name
,
String
The namespace of the definition, otherwise null.
namespace
)

Implements org.apache.xerces.xs.XSModel.getIDCDefinition.

Convenience method.
public XSIDCDefinition

Returns:

A top-level model group definition definition or null if such definition does not exist.
getIDCDefinition
(String
The name of the definition.
name
,
String
The namespace of the definition, otherwise null.
namespace
,
String
The schema location where the component was defined
loc
)

Convenience method.

public int
getLength()

Implements org.apache.xerces.xs.XSNamespaceItemList.getLength.

The number of XSNamespaceItems in the list.
public XSModelGroupDefinition

Returns:

A top-level model group definition definition or null if such definition does not exist.
getModelGroupDefinition
(String
The name of the definition.
name
,
String
The namespace of the definition, otherwise null.
namespace
)

Implements org.apache.xerces.xs.XSModel.getModelGroupDefinition.

Convenience method.
public XSModelGroupDefinition

Returns:

A top-level model group definition definition or null if such definition does not exist.
getModelGroupDefinition
(String
The name of the definition.
name
,
String
The namespace of the definition, otherwise null.
namespace
,
String
The schema location where the component was defined
loc
)

Convenience method.

public XSNamespaceItemList
getNamespaceItems()

Implements org.apache.xerces.xs.XSModel.getNamespaceItems.

A set of namespace schema information information items (of type XSNamespaceItem), one for each namespace name which appears as the target namespace of any schema component in the schema used for that assessment, and one for absent if any schema component in the schema had no target namespace.
public StringList

Returns:

A list of all namespaces that belong to this schema or null if all components don't have a targetNamespace.
getNamespaces
()

Implements org.apache.xerces.xs.XSModel.getNamespaces.

Convenience method.
public XSNotationDeclaration
getNotationDeclaration(String
The name of the declaration.
name
,
String
The namespace of the declaration, otherwise null.
namespace
)

Implements org.apache.xerces.xs.XSModel.getNotationDeclaration.

Convenience method.
public XSNotationDeclaration
public XSObjectList

Returns:

A list containing the members of the substitution group for the given XSElementDeclaration or an empty XSObjectList if the substitution group contains no members.
getSubstitutionGroup
(XSElementDeclaration
The substitution group head.
head
)

Implements org.apache.xerces.xs.XSModel.getSubstitutionGroup.

Convenience method.
public XSTypeDefinition

Returns:

An XSTypeDefinition or null if such definition does not exist.
getTypeDefinition
(String
The name of the definition.
name
,
String
The namespace of the definition, otherwise null.
namespace
)

Implements org.apache.xerces.xs.XSModel.getTypeDefinition.

Convenience method.
public XSTypeDefinition

Returns:

An XSTypeDefinition or null if such definition does not exist.
getTypeDefinition
(String
The name of the definition.
name
,
String
The namespace of the definition, otherwise null.
namespace
,
String
The schema location where the component was defined
loc
)

Convenience method.

public boolean
hasIDConstraints()

REVISIT: to expose identity constraints from XSModel.

public XSNamespaceItem

Returns:

The XSNamespaceItem at the indexth position in the XSNamespaceItemList, or null if the index specified is not valid.
item
(int
index into the collection.
index
)

Implements org.apache.xerces.xs.XSNamespaceItemList.item.

Returns the indexth item in the collection or null if index is greater than or equal to the number of objects in the list.
public Iterator<E>
iterator()

Overrides java.util.AbstractList.iterator.

Implements java.util.List.iterator, java.util.Collection.iterator.

Returns an iterator over the elements in this list in proper sequence.
public ListIterator<E>
listIterator()

Overrides java.util.AbstractList.listIterator.

Implements java.util.List.listIterator.

Returns a list iterator over the elements in this list (in proper sequence).
public ListIterator<E>
listIterator(int
index of the first element to be returned from the list iterator (by a call to next)
index
)

Overrides java.util.AbstractList.listIterator.

Implements java.util.List.listIterator.

Returns a list iterator over the elements in this list (in proper sequence), starting at the specified position in the list.
private ListIterator<E>
listIterator0(int index)

private static final String
public int
size()

Implements abstract java.util.AbstractCollection.size.

Implements java.util.List.size, java.util.Collection.size.

Returns the number of elements in this list.
public Object[]
toArray()

Overrides java.util.AbstractCollection.toArray.

Implements java.util.List.toArray, java.util.Collection.toArray.

Returns an array containing all of the elements in this list in proper sequence (from first to last element).
public Object[]
toArray(Object[]
the array into which the elements of this list are to be stored, if it is big enough; otherwise, a new array of the same runtime type is allocated for this purpose.
a
)

Overrides java.util.AbstractCollection.toArray.

Implements java.util.List.toArray, java.util.Collection.toArray.

Returns an array containing all of the elements in this list in proper sequence (from first to last element); the runtime type of the returned array is that of the specified array.
private void
Inherited from java.util.AbstractList:
addaddaddAllclearequalshashCodeindexOflastIndexOfremoveremoveRangesetsubList

Field Detail

fAnnotationsback to summary
private XSObjectList fAnnotations
fGlobalComponentsback to summary
private final XSNamedMap[] fGlobalComponents
fGrammarCountback to summary
private final int fGrammarCount
fGrammarListback to summary
private final SchemaGrammar[] fGrammarList
fGrammarMapback to summary
private final SymbolHash fGrammarMap
fHasIDCback to summary
private final boolean fHasIDC
fNamespacesback to summary
private final String[] fNamespaces
fNamespacesListback to summary
private final StringList fNamespacesList
fNSComponentsback to summary
private final XSNamedMap[][] fNSComponents
fSubGroupMapback to summary
private final SymbolHash fSubGroupMap
GLOBAL_COMPback to summary
private static final boolean[] GLOBAL_COMP
MAX_COMP_IDXback to summary
private static final short MAX_COMP_IDX

Constructor Detail

XSModelImplback to summary
public XSModelImpl(SchemaGrammar[] grammars)

Construct an XSModelImpl, by storing some grammars and grammars imported by them to this object.

Parameters
grammars:SchemaGrammar[]

the array of schema grammars

XSModelImplback to summary
public XSModelImpl(SchemaGrammar[] grammars, short s4sVersion)

Method Detail

buildSubGroupsback to summary
private SymbolHash buildSubGroups()
buildSubGroups_Orgback to summary
private SymbolHash buildSubGroups_Org()
getback to summary
public Object get(int index)

Implements abstract java.util.AbstractList.get.

Implements java.util.List.get.

Doc from java.util.List.get.

Returns the element at the specified position in this list.

Parameters
index:int

index of the element to return

Returns:Object

the element at the specified position in this list

getAnnotationsback to summary
public synchronized XSObjectList getAnnotations()

Implements org.apache.xerces.xs.XSModel.getAnnotations.

[annotations]: a set of annotations if it exists, otherwise an empty XSObjectList.

getAttributeDeclarationback to summary
public XSAttributeDeclaration getAttributeDeclaration(String name, String namespace)

Implements org.apache.xerces.xs.XSModel.getAttributeDeclaration.

Convenience method. Returns a top-level attribute declaration.

Parameters
name:String

The name of the declaration.

namespace:String

The namespace of the definition, otherwise null.

Returns:XSAttributeDeclaration

A top-level attribute declaration or null if such declaration does not exist.

getAttributeDeclarationback to summary
public XSAttributeDeclaration getAttributeDeclaration(String name, String namespace, String loc)

Convenience method. Returns a top-level attribute declaration.

Parameters
name:String

The name of the declaration.

namespace:String

The namespace of the definition, otherwise null.

loc:String

The schema location where the component was defined

Returns:XSAttributeDeclaration

A top-level attribute declaration or null if such declaration does not exist.

getAttributeGroupback to summary
public XSAttributeGroupDefinition getAttributeGroup(String name, String namespace)

Implements org.apache.xerces.xs.XSModel.getAttributeGroup.

Convenience method. Returns a top-level attribute group definition.

Parameters
name:String

The name of the definition.

namespace:String

The namespace of the definition, otherwise null.

Returns:XSAttributeGroupDefinition

A top-level attribute group definition or null if such definition does not exist.

getAttributeGroupback to summary
public XSAttributeGroupDefinition getAttributeGroup(String name, String namespace, String loc)

Convenience method. Returns a top-level attribute group definition.

Parameters
name:String

The name of the definition.

namespace:String

The namespace of the definition, otherwise null.

loc:String

The schema location where the component was defined

Returns:XSAttributeGroupDefinition

A top-level attribute group definition or null if such definition does not exist.

getComponentsback to summary
public synchronized XSNamedMap getComponents(short objectType)

Implements org.apache.xerces.xs.XSModel.getComponents.

Returns a list of top-level components, i.e. element declarations, attribute declarations, etc.

Parameters
objectType:short

The type of the declaration, i.e. ELEMENT_DECLARATION. Note that XSTypeDefinition.SIMPLE_TYPE and XSTypeDefinition.COMPLEX_TYPE can also be used as the objectType to retrieve only complex types or simple types, instead of all types.

Returns:XSNamedMap

A list of top-level definitions of the specified type in objectType or an empty XSNamedMap if no such definitions exist.

getComponentsByNamespaceback to summary
public synchronized XSNamedMap getComponentsByNamespace(short objectType, String namespace)

Implements org.apache.xerces.xs.XSModel.getComponentsByNamespace.

Convenience method. Returns a list of top-level component declarations that are defined within the specified namespace, i.e. element declarations, attribute declarations, etc.

Parameters
objectType:short

The type of the declaration, i.e. ELEMENT_DECLARATION.

namespace:String

The namespace to which the declaration belongs or null (for components with no target namespace).

Returns:XSNamedMap

A list of top-level definitions of the specified type in objectType and defined in the specified namespace or an empty XSNamedMap.

getElementDeclarationback to summary
public XSElementDeclaration getElementDeclaration(String name, String namespace)

Implements org.apache.xerces.xs.XSModel.getElementDeclaration.

Convenience method. Returns a top-level element declaration.

Parameters
name:String

The name of the declaration.

namespace:String

The namespace of the definition, otherwise null.

Returns:XSElementDeclaration

A top-level element declaration or null if such declaration does not exist.

getElementDeclarationback to summary
public XSElementDeclaration getElementDeclaration(String name, String namespace, String loc)

Convenience method. Returns a top-level element declaration.

Parameters
name:String

The name of the declaration.

namespace:String

The namespace of the definition, otherwise null.

loc:String

The schema location where the component was defined

Returns:XSElementDeclaration

A top-level element declaration or null if such declaration does not exist.

getGlobalElementsback to summary
private XSObjectListImpl getGlobalElements()
getIDCDefinitionback to summary
public XSIDCDefinition getIDCDefinition(String name, String namespace)

Implements org.apache.xerces.xs.XSModel.getIDCDefinition.

Convenience method. Returns a top-level model group definition.

Parameters
name:String

The name of the definition.

namespace:String

The namespace of the definition, otherwise null.

Returns:XSIDCDefinition

A top-level model group definition definition or null if such definition does not exist.

getIDCDefinitionback to summary
public XSIDCDefinition getIDCDefinition(String name, String namespace, String loc)

Convenience method. Returns a top-level model group definition.

Parameters
name:String

The name of the definition.

namespace:String

The namespace of the definition, otherwise null.

loc:String

The schema location where the component was defined

Returns:XSIDCDefinition

A top-level model group definition definition or null if such definition does not exist.

getLengthback to summary
public int getLength()

Implements org.apache.xerces.xs.XSNamespaceItemList.getLength.

The number of XSNamespaceItems in the list. The range of valid child object indices is 0 to length-1 inclusive.

getModelGroupDefinitionback to summary
public XSModelGroupDefinition getModelGroupDefinition(String name, String namespace)

Implements org.apache.xerces.xs.XSModel.getModelGroupDefinition.

Convenience method. Returns a top-level model group definition.

Parameters
name:String

The name of the definition.

namespace:String

The namespace of the definition, otherwise null.

Returns:XSModelGroupDefinition

A top-level model group definition definition or null if such definition does not exist.

getModelGroupDefinitionback to summary
public XSModelGroupDefinition getModelGroupDefinition(String name, String namespace, String loc)

Convenience method. Returns a top-level model group definition.

Parameters
name:String

The name of the definition.

namespace:String

The namespace of the definition, otherwise null.

loc:String

The schema location where the component was defined

Returns:XSModelGroupDefinition

A top-level model group definition definition or null if such definition does not exist.

getNamespaceItemsback to summary
public XSNamespaceItemList getNamespaceItems()

Implements org.apache.xerces.xs.XSModel.getNamespaceItems.

A set of namespace schema information information items (of type XSNamespaceItem), one for each namespace name which appears as the target namespace of any schema component in the schema used for that assessment, and one for absent if any schema component in the schema had no target namespace. For more information see schema information.

getNamespacesback to summary
public StringList getNamespaces()

Implements org.apache.xerces.xs.XSModel.getNamespaces.

Convenience method. Returns a list of all namespaces that belong to this schema.

Returns:StringList

A list of all namespaces that belong to this schema or null if all components don't have a targetNamespace.

getNotationDeclarationback to summary
public XSNotationDeclaration getNotationDeclaration(String name, String namespace)

Implements org.apache.xerces.xs.XSModel.getNotationDeclaration.

Doc from org.apache.xerces.xs.XSModel.getNotationDeclaration.

Convenience method. Returns a top-level notation declaration.

Parameters
name:String

The name of the declaration.

namespace:String

The namespace of the declaration, otherwise null.

Returns:XSNotationDeclaration

A top-level notation declaration or null if such a declaration does not exist.

See Also
org.apache.xerces.xs.XSModel#getNotationDeclaration(String, String)
getNotationDeclarationback to summary
public XSNotationDeclaration getNotationDeclaration(String name, String namespace, String loc)
getSubstitutionGroupback to summary
public XSObjectList getSubstitutionGroup(XSElementDeclaration head)

Implements org.apache.xerces.xs.XSModel.getSubstitutionGroup.

Convenience method. Returns a list containing the members of the substitution group for the given XSElementDeclaration or an empty XSObjectList if the substitution group contains no members.

Parameters
head:XSElementDeclaration

The substitution group head.

Returns:XSObjectList

A list containing the members of the substitution group for the given XSElementDeclaration or an empty XSObjectList if the substitution group contains no members.

getTypeDefinitionback to summary
public XSTypeDefinition getTypeDefinition(String name, String namespace)

Implements org.apache.xerces.xs.XSModel.getTypeDefinition.

Convenience method. Returns a top-level simple or complex type definition.

Parameters
name:String

The name of the definition.

namespace:String

The namespace of the definition, otherwise null.

Returns:XSTypeDefinition

An XSTypeDefinition or null if such definition does not exist.

getTypeDefinitionback to summary
public XSTypeDefinition getTypeDefinition(String name, String namespace, String loc)

Convenience method. Returns a top-level simple or complex type definition.

Parameters
name:String

The name of the definition.

namespace:String

The namespace of the definition, otherwise null.

loc:String

The schema location where the component was defined

Returns:XSTypeDefinition

An XSTypeDefinition or null if such definition does not exist.

hasIDConstraintsback to summary
public boolean hasIDConstraints()

REVISIT: to expose identity constraints from XSModel. For now, we only expose whether there are any IDCs. We also need to add these methods to the public XSModel interface.

itemback to summary
public XSNamespaceItem item(int index)

Implements org.apache.xerces.xs.XSNamespaceItemList.item.

Returns the indexth item in the collection or null if index is greater than or equal to the number of objects in the list. The index starts at 0.

Parameters
index:int

index into the collection.

Returns:XSNamespaceItem

The XSNamespaceItem at the indexth position in the XSNamespaceItemList, or null if the index specified is not valid.

iteratorback to summary
public Iterator<E> iterator()

Overrides java.util.AbstractList.iterator.

Implements java.util.List.iterator, java.util.Collection.iterator.

Doc from java.util.List.iterator.

Returns an iterator over the elements in this list in proper sequence.

Returns:Iterator<E>

an iterator over the elements in this list in proper sequence

listIteratorback to summary
public ListIterator<E> listIterator()

Overrides java.util.AbstractList.listIterator.

Implements java.util.List.listIterator.

Doc from java.util.List.listIterator.

Returns a list iterator over the elements in this list (in proper sequence).

Returns:ListIterator<E>

a list iterator over the elements in this list (in proper sequence)

listIteratorback to summary
public ListIterator<E> listIterator(int index)

Overrides java.util.AbstractList.listIterator.

Implements java.util.List.listIterator.

Doc from java.util.List.listIterator.

Returns a list iterator over the elements in this list (in proper sequence), starting at the specified position in the list. The specified index indicates the first element that would be returned by an initial call to next. An initial call to previous would return the element with the specified index minus one.

Parameters
index:int

index of the first element to be returned from the list iterator (by a call to next)

Returns:ListIterator<E>

a list iterator over the elements in this list (in proper sequence), starting at the specified position in the list

listIterator0back to summary
private ListIterator<E> listIterator0(int index)
null2EmptyStringback to summary
private static final String null2EmptyString(String str)
sizeback to summary
public int size()

Implements abstract java.util.AbstractCollection.size.

Implements java.util.List.size, java.util.Collection.size.

Doc from java.util.List.size.

Returns the number of elements in this list. If this list contains more than Integer.MAX_VALUE elements, returns Integer.MAX_VALUE.

Returns:int

the number of elements in this list

toArrayback to summary
public Object[] toArray()

Overrides java.util.AbstractCollection.toArray.

Implements java.util.List.toArray, java.util.Collection.toArray.

Doc from java.util.List.toArray.

Returns an array containing all of the elements in this list in proper sequence (from first to last element).

The returned array will be "safe" in that no references to it are maintained by this list. (In other words, this method must allocate a new array even if this list is backed by an array). The caller is thus free to modify the returned array.

This method acts as bridge between array-based and collection-based APIs.

Returns:Object[]

an array containing all of the elements in this list in proper sequence

toArrayback to summary
public Object[] toArray(Object[] a)

Overrides java.util.AbstractCollection.toArray.

Implements java.util.List.toArray, java.util.Collection.toArray.

Doc from java.util.List.toArray.

Returns an array containing all of the elements in this list in proper sequence (from first to last element); the runtime type of the returned array is that of the specified array. If the list fits in the specified array, it is returned therein. Otherwise, a new array is allocated with the runtime type of the specified array and the size of this list.

If the list fits in the specified array with room to spare (i.e., the array has more elements than the list), the element in the array immediately following the end of the list is set to null. (This is useful in determining the length of the list only if the caller knows that the list does not contain any null elements.)

Like the toArray() method, this method acts as bridge between array-based and collection-based APIs. Further, this method allows precise control over the runtime type of the output array, and may, under certain circumstances, be used to save allocation costs.

Suppose x is a list known to contain only strings. The following code can be used to dump the list into a newly allocated array of String:

String[] y = x.toArray(new String[0]);
Note that toArray(new Object[0]) is identical in function to toArray().
Parameters
a:Object[]

the array into which the elements of this list are to be stored, if it is big enough; otherwise, a new array of the same runtime type is allocated for this purpose.

Returns:Object[]

an array containing the elements of this list

toArray0back to summary
private void toArray0(Object[] a)
org.apache.xerces.impl.xs back to summary

private final Class XSModelImpl.XSNamespaceItemListIterator

extends Object
implements ListIterator
Class Inheritance
  • java.lang.Object
  • org.apache.xerces.impl.xs.XSModelImpl.XSNamespaceItemListIterator
All Implemented Interfaces
java.util.ListIterator, java.util.Iterator

Field Summary

Modifier and TypeField and Description
private int

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
add(Object
the element to insert
o
)

Implements java.util.ListIterator.add.

Inserts the specified element into the list (optional operation).
public boolean
hasNext()

Implements java.util.ListIterator.hasNext.

Returns true if this list iterator has more elements when traversing the list in the forward direction.
public boolean
hasPrevious()

Implements java.util.ListIterator.hasPrevious.

Returns true if this list iterator has more elements when traversing the list in the reverse direction.
public Object
next()

Implements java.util.ListIterator.next.

Returns the next element in the list and advances the cursor position.
public int
nextIndex()

Implements java.util.ListIterator.nextIndex.

Returns the index of the element that would be returned by a subsequent call to next.
public Object
previous()

Implements java.util.ListIterator.previous.

Returns the previous element in the list and moves the cursor position backwards.
public int
previousIndex()

Implements java.util.ListIterator.previousIndex.

Returns the index of the element that would be returned by a subsequent call to previous.
public void
remove()

Implements java.util.ListIterator.remove.

Removes from the list the last element that was returned by next or previous (optional operation).
public void
set(Object
the element with which to replace the last element returned by next or previous
o
)

Implements java.util.ListIterator.set.

Replaces the last element returned by next or previous with the specified element (optional operation).
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

indexback to summary
private int index

Constructor Detail

XSNamespaceItemListIteratorback to summary
public XSNamespaceItemListIterator(int index)

Method Detail

addback to summary
public void add(Object o)

Implements java.util.ListIterator.add.

Doc from java.util.ListIterator.add.

Inserts the specified element into the list (optional operation). The element is inserted immediately before the element that would be returned by next, if any, and after the element that would be returned by previous, if any. (If the list contains no elements, the new element becomes the sole element on the list.) The new element is inserted before the implicit cursor: a subsequent call to next would be unaffected, and a subsequent call to previous would return the new element. (This call increases by one the value that would be returned by a call to nextIndex or previousIndex.)

Parameters
o:Object

the element to insert

hasNextback to summary
public boolean hasNext()

Implements java.util.ListIterator.hasNext.

Doc from java.util.ListIterator.hasNext.

Returns true if this list iterator has more elements when traversing the list in the forward direction. (In other words, returns true if next would return an element rather than throwing an exception.)

Returns:boolean

true if the list iterator has more elements when traversing the list in the forward direction

hasPreviousback to summary
public boolean hasPrevious()

Implements java.util.ListIterator.hasPrevious.

Doc from java.util.ListIterator.hasPrevious.

Returns true if this list iterator has more elements when traversing the list in the reverse direction. (In other words, returns true if previous would return an element rather than throwing an exception.)

Returns:boolean

true if the list iterator has more elements when traversing the list in the reverse direction

nextback to summary
public Object next()

Implements java.util.ListIterator.next.

Doc from java.util.ListIterator.next.

Returns the next element in the list and advances the cursor position. This method may be called repeatedly to iterate through the list, or intermixed with calls to previous to go back and forth. (Note that alternating calls to next and previous will return the same element repeatedly.)

Returns:Object

the next element in the list

nextIndexback to summary
public int nextIndex()

Implements java.util.ListIterator.nextIndex.

Doc from java.util.ListIterator.nextIndex.

Returns the index of the element that would be returned by a subsequent call to next. (Returns list size if the list iterator is at the end of the list.)

Returns:int

the index of the element that would be returned by a subsequent call to next, or list size if the list iterator is at the end of the list

previousback to summary
public Object previous()

Implements java.util.ListIterator.previous.

Doc from java.util.ListIterator.previous.

Returns the previous element in the list and moves the cursor position backwards. This method may be called repeatedly to iterate through the list backwards, or intermixed with calls to next to go back and forth. (Note that alternating calls to next and previous will return the same element repeatedly.)

Returns:Object

the previous element in the list

previousIndexback to summary
public int previousIndex()

Implements java.util.ListIterator.previousIndex.

Doc from java.util.ListIterator.previousIndex.

Returns the index of the element that would be returned by a subsequent call to previous. (Returns -1 if the list iterator is at the beginning of the list.)

Returns:int

the index of the element that would be returned by a subsequent call to previous, or -1 if the list iterator is at the beginning of the list

removeback to summary
public void remove()

Implements java.util.ListIterator.remove.

Doc from java.util.ListIterator.remove.

Removes from the list the last element that was returned by next or previous (optional operation). This call can only be made once per call to next or previous. It can be made only if add has not been called after the last call to next or previous.

setback to summary
public void set(Object o)

Implements java.util.ListIterator.set.

Doc from java.util.ListIterator.set.

Replaces the last element returned by next or previous with the specified element (optional operation). This call can be made only if neither remove nor add have been called after the last call to next or previous.

Parameters
o:Object

the element with which to replace the last element returned by next or previous