Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.basex.data
Class Namespaces

    java.lang.Object
      org.basex.util.Set
          org.basex.data.Namespaces

    public final class Namespaces

extends Set

This class organizes the namespaces of a database.

Author:
  Workgroup DBIS, University of Konstanz 2005-09, ISC License, Christian Gruen

Constructor Summary
`Namespaces()` Default Constructor.
`Namespaces(DataInput in)` Constructor, specifying an input file.

Method Summary
`void` | `add(byte[] p, byte[] u)` Adds the specified namespace.
`void` | `close(int p)` Closes a node.
`int` | `get(byte[] n)` Returns the namespace for the specified qname.
`int` | `get(byte[] n, int p)` Returns the namespace for the specified qname and pre value.
`int[]` | `get(int p)` Returns the namespace keys and values for the specified pre value.
`boolean` | `open(int p)` Opens a node.
`void` | `print(PrintOutput out, int s)` Prints the namespace structure to the specified output stream.
`void` | `write(DataOutput out)` Writes the namespaces to disk.

Methods inherited from class org.basex.util.Set
`add, delete, id, key, keys, size`

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### Namespaces

    public Namespaces()

  Default Constructor.

### Namespaces

    public Namespaces(DataInput in)
               throws java.io.IOException

  Constructor, specifying an input file.

  Parameters:
    `in` - input stream
  Throws:
    `java.io.IOException` - I/O exception

Method Detail

### write

    public void write(DataOutput out)
               throws java.io.IOException

  Writes the namespaces to disk.

  Parameters:
    `out` - output stream
  Throws:
    `java.io.IOException` - I/O exception

### open

    public boolean open(int p)

  Opens a node.

  Parameters:
    `p` - current pre value
  Returns:
    true if namespaces have been registered

### close

    public void close(int p)

  Closes a node.

  Parameters:
    `p` - current pre value

### add

    public void add(byte[] p,
                    byte[] u)

  Adds the specified namespace.

  Parameters:
    `p` - namespace prefix
    `u` - namespace uri

### get

    public int get(byte[] n,
                   int p)

  Returns the namespace for the specified qname and pre value.

  Parameters:
    `n` - tag/attribute name
    `p` - pre value
  Returns:
    namespace reference or 0 if no namespace was found

### get

    public int[] get(int p)

  Returns the namespace keys and values for the specified pre value.

  Parameters:
    `p` - pre value
  Returns:
    namespace reference or 0 if no namespace was found

### get

    public int get(byte[] n)

  Returns the namespace for the specified qname.

  Parameters:
    `n` - tag/attribute name
  Returns:
    namespace

### print

    public void print(PrintOutput out,
                      int s)
               throws java.io.IOException

  Prints the namespace structure to the specified output stream.

  Parameters:
    `out` - output stream
    `s` - space for pre value
  Throws:
    `java.io.IOException` - I/O exception

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD