|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.saxon.tree.util.NamespaceDeclarationsImpl
public class NamespaceDeclarationsImpl
An implementation of the NamespaceDeclarations interface, based on encapsulating an array of namespace codes.
Constructor Summary | |
---|---|
NamespaceDeclarationsImpl()
Create an uninitialized instance |
|
NamespaceDeclarationsImpl(NamePool pool,
int[] codes)
Construct a set of namespace declarations |
Method Summary | |
---|---|
int |
getNamespaceCode(int index)
Get the n'th declaration in the list in the form of a namespace code. |
int[] |
getNamespaceCodes(int[] buffer)
Get all the namespace codes, as an array. |
int |
getNumberOfNamespaces()
Get the number of declarations (and undeclarations) in this list. |
String |
getPrefix(int index)
Get the prefix of the n'th declaration (or undeclaration) in the list, counting from zero. |
String |
getURI(int index)
Get the namespace URI of the n'th declaration (or undeclaration) in the list, counting from zero. |
void |
setNamePool(NamePool pool)
Set the name pool |
void |
setNamespaceCodes(int[] codes)
Set the namespace codes. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NamespaceDeclarationsImpl()
public NamespaceDeclarationsImpl(NamePool pool, int[] codes)
pool
- the name poolcodes
- an integer array holding the namespace codes. These
codes are allocated by the name pool, and can be used to look up
a prefix and uri in the name pool. If the array contains the integer
-1, this acts as a terminator for the list. This is the format
returned by the method NodeInfo.getDeclaredNamespaces(int[])
.
A value of null is equivalent to supplying an empty array.Method Detail |
---|
public void setNamePool(NamePool pool)
pool
- the NamePoolpublic void setNamespaceCodes(int[] codes)
codes
- an integer array holding the namespace codes. These
codes are allocated by the name pool, and can be used to look up
a prefix and uri in the name pool. If the array contains the integer
-1, this acts as a terminator for the list. This is the format
returned by the method NodeInfo.getDeclaredNamespaces(int[])
.
A value of null is equivalent to supplying an empty array.public int[] getNamespaceCodes(int[] buffer)
getNamespaceCodes
in interface NamespaceDeclarations
buffer
- a sacrificial array that the method is free to use to contain the result.
May be null.
public int getNumberOfNamespaces()
getNumberOfNamespaces
in interface NamespaceDeclarations
public String getPrefix(int index)
getPrefix
in interface NamespaceDeclarations
index
- the index identifying which declaration is required.
IndexOutOfBoundsException
- if the index is out of range.public String getURI(int index)
getURI
in interface NamespaceDeclarations
index
- the index identifying which declaration is required.
IndexOutOfBoundsException
- if the index is out of range.public int getNamespaceCode(int index)
getNamespaceCode
in interface NamespaceDeclarations
index
- the index identifying which declaration is required.
IndexOutOfBoundsException
- if the index is out of range.NamePool.getPrefixFromNamespaceCode(int)
,
NamePool.getURIFromNamespaceCode(int)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |