org.opcfoundation.ua.common
Class UriTable

java.lang.Object
  extended by org.opcfoundation.ua.common.UriTable
Direct Known Subclasses:
NamespaceTable, ServerTable

public class UriTable
extends Object

UriTable class.


Constructor Summary
UriTable()
          Constructor for UriTable.
 
Method Summary
 int add(int index, String uri)
          Add a new uri to the table.
 int add(String uri)
          Add a new uri to the table.
 void addAll(String[] namespaceArray)
          addAll.
 int getIndex(String namespaceUri)
          Finds the index of the namespace URI in the table
 String getUri(int index)
          Finds the URI with index in the table
 void remove(int index)
          Remove the entry for the specified index
 void remove(String uri)
          Remove the entry for the specified uri
 int size()
          size.
 String[] toArray()
          toArray.
 String toString()
          toString.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UriTable

public UriTable()

Constructor for UriTable.

Method Detail

toArray

public String[] toArray()

toArray.

Returns:
an array of String objects.

getUri

public String getUri(int index)
Finds the URI with index in the table

Parameters:
index - the index you are looking for
Returns:
the URI with the index or null, if there is no such index

getIndex

public int getIndex(String namespaceUri)
Finds the index of the namespace URI in the table

Parameters:
namespaceUri - the URI of the namespace you are looking for
Returns:
the index of the URI or -1, if it is not in the table

add

public int add(String uri)
Add a new uri to the table. The uri will be added with a new index, unless it is in the table already, in which case the index is returned.

Parameters:
uri - The URI.
Returns:
a int.

remove

public void remove(int index)
Remove the entry for the specified index

Parameters:
index - a int.

remove

public void remove(String uri)
Remove the entry for the specified uri

Parameters:
uri - a String object.

add

public int add(int index,
               String uri)
Add a new uri to the table.

Parameters:
index - The new index (use -1 to automatically use the next unused index)
uri - The URI.
Returns:
a int.
Throws:
IllegalArgumentException - if the index is already in use

addAll

public void addAll(String[] namespaceArray)

addAll.

Parameters:
namespaceArray - an array of String objects.

toString

public String toString()

toString.

Overrides:
toString in class Object
Returns:
a String object.

size

public int size()

size.

Returns:
a int.


Copyright © 2018. All rights reserved.