Class Atts


public final class Atts extends ElementList
Resizable-array implementation for attributes (name/value pairs).
Author:
BaseX Team 2005-21, BSD License, Christian Gruen
  • Field Summary

    Fields inherited from class org.basex.util.list.ElementList

    factor, size
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default constructor.
    Atts(byte[] name, byte[] value)
    Constructor, specifying an initial entry.
  • Method Summary

    Modifier and Type
    Method
    Description
    add(byte[] name, byte[] value)
    Adds the next name/value pair.
    boolean
    contains(byte[] name)
    Checks if the specified name is found.
    Creates a shallow copy which shares all keys and values.
    boolean
     
    int
    get(byte[] name)
    Returns the offset to the specified name.
    byte[]
    name(int index)
    Returns the name at the specified index position.
    remove(int index)
    Removes the element at the specified position.
     
    byte[]
    value(byte[] name)
    Returns the value for the specified name or null.
    byte[]
    value(int index)
    Returns the value at the specified index position.

    Methods inherited from class org.basex.util.list.ElementList

    isEmpty, newCapacity, newCapacity, reset, size, size

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Atts

      public Atts()
      Default constructor.
    • Atts

      public Atts(byte[] name, byte[] value)
      Constructor, specifying an initial entry.
      Parameters:
      name - name to be added
      value - value to be added
  • Method Details

    • add

      public Atts add(byte[] name, byte[] value)
      Adds the next name/value pair.
      Parameters:
      name - name to be added (can be null)
      value - value to be added (can be null)
      Returns:
      self reference
    • remove

      public Atts remove(int index)
      Removes the element at the specified position.
      Parameters:
      index - entry index
      Returns:
      self reference
    • contains

      public boolean contains(byte[] name)
      Checks if the specified name is found.
      Parameters:
      name - name to be found
      Returns:
      result of check
    • get

      public int get(byte[] name)
      Returns the offset to the specified name.
      Parameters:
      name - name to be found
      Returns:
      offset or -1
    • name

      public byte[] name(int index)
      Returns the name at the specified index position.
      Parameters:
      index - index
      Returns:
      name
    • value

      public byte[] value(int index)
      Returns the value at the specified index position.
      Parameters:
      index - index
      Returns:
      value
    • value

      public byte[] value(byte[] name)
      Returns the value for the specified name or null.
      Parameters:
      name - name to be found
      Returns:
      offset or -1
    • copy

      public Atts copy()
      Creates a shallow copy which shares all keys and values.
      Returns:
      shallow copy
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object