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.util
Class Set

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

Direct Known Subclasses:
  FNIndex, Map, Names, Namespaces, TokenMap

    public class Set

extends java.lang.Object

This is a simple hash set, storing keys in byte arrays. The `TokenMap` class extends it to a hash map.

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

Constructor Summary
`Set()` Empty Constructor.

Method Summary
`int` | `add(byte[] key)` Indexes the specified key.
`int` | `delete(byte[] key)` Deletes the specified key.
`int` | `id(byte[] key)` Returns the id of the specified key or 0 if key was not found.
`byte[]` | `key(int p)` Returns the specified key.
`byte[][]` | `keys()` Returns the hash keys.
`int` | `size()` Returns number of entries.

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

Constructor Detail

### Set

    public Set()

  Empty Constructor.

Method Detail

### add

    public int add(byte[] key)

  Indexes the specified key.

  Parameters:
    `key` - key
  Returns:
    offset of added key, negative offset otherwise

### delete

    public final int delete(byte[] key)

  Deletes the specified key.

  Parameters:
    `key` - key
  Returns:
    deleted key or 0

### id

    public final int id(byte[] key)

  Returns the id of the specified key or 0 if key was not found.

  Parameters:
    `key` - key to be found
  Returns:
    id or 0 if nothing was found

### key

    public final byte[] key(int p)

  Returns the specified key.

  Parameters:
    `p` - key index
  Returns:
    key

### keys

    public final byte[][] keys()

  Returns the hash keys.

  Returns:
    keys

### size

    public int size()

  Returns number of entries.

  Returns:
    number of entries.

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