java.lang.Object
org.eclipse.milo.opcua.stack.core.UriArray<I>
Direct Known Subclasses:
NamespaceTable, ServerTable

public abstract class UriArray<I extends UNumber> extends Object
Manages an array of URIs and provides bidirectional access to the URIs their indices.
  • Constructor Details

    • UriArray

      public UriArray()
  • Method Details

    • add

      public I add(String uri)
      Add a URI and return the index.

      If the URI is not already present the next available index is assigned, otherwise the current index is returned.

      Parameters:
      uri - the namespace URI to add.
      Returns:
      the index assigned to the URI.
    • get

      public String get(Number index)
      Get the URI at index, or null if there isn't one.
      Parameters:
      index - the index of the URI to get.
      Returns:
      the URI at index, or null if there isn't one.
    • get

      public String get(I index)
      Get the URI at index, or null if there isn't one.
      Parameters:
      index - the index of the URI to get.
      Returns:
      the URI at index, or null if there isn't one.
    • getIndex

      public @Nullable I getIndex(String uri)
      Parameters:
      uri - the URI to look up.
      Returns:
      the index of the URI, or null if it is not present.
    • set

      public String set(Number index, String uri)
      Replace the URI at index with uri.
      Parameters:
      index - the index to replace.
      uri - the URI to replace with.
      Returns:
      the previous URI at index, or null if there was none.
    • set

      public String set(I index, String uri)
      Replace the URI at index with uri.
      Parameters:
      index - the index to replace.
      uri - the URI to replace with.
      Returns:
      the previous URI at index, or null if there was none.
    • update

      public void update(Consumer<com.google.common.collect.BiMap<I,String>> uriTableConsumer)
      Update the underlying BiMap.
      Parameters:
      uriTableConsumer - the underlying BiMap instance.
    • toArray

      public String[] toArray()
      Returns:
      an array of registered URIs, ordered by index ascending.
    • create

      protected abstract I create(Number index)
      Create a new index of type UriArray from index.
      Parameters:
      index - the index to create.
      Returns:
      the new index.