Package org.basex.util
Class Atts
java.lang.Object
org.basex.util.list.ElementList
org.basex.util.Atts
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 -
Method Summary
Modifier and TypeMethodDescriptionadd(byte[] name, byte[] value) Adds the next name/value pair.booleancontains(byte[] name) Checks if the specified name is found.copy()Creates a shallow copy which shares all keys and values.booleanintget(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.toString()byte[]value(byte[] name) Returns the value for the specified name ornull.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
-
Constructor Details
-
Atts
public Atts()Default constructor. -
Atts
public Atts(byte[] name, byte[] value) Constructor, specifying an initial entry.- Parameters:
name- name to be addedvalue- value to be added
-
-
Method Details
-
add
Adds the next name/value pair.- Parameters:
name- name to be added (can benull)value- value to be added (can benull)- Returns:
- self reference
-
remove
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 ornull.- Parameters:
name- name to be found- Returns:
- offset or -1
-
copy
Creates a shallow copy which shares all keys and values.- Returns:
- shallow copy
-
equals
-
toString
-