1. /*
  2. * Copyright (c) 2004 World Wide Web Consortium,
  3. *
  4. * (Massachusetts Institute of Technology, European Research Consortium for
  5. * Informatics and Mathematics, Keio University). All Rights Reserved. This
  6. * work is distributed under the W3C(r) Software License [1] in the hope that
  7. * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
  8. * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  9. *
  10. * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
  11. */
  12. package org.w3c.dom;
  13. /**
  14. * The <code>NameList</code> interface provides the abstraction of an ordered
  15. * collection of parallel pairs of name and namespace values (which could be
  16. * null values), without defining or constraining how this collection is
  17. * implemented. The items in the <code>NameList</code> are accessible via an
  18. * integral index, starting from 0.
  19. * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
  20. * @since DOM Level 3
  21. */
  22. public interface NameList {
  23. /**
  24. * Returns the <code>index</code>th name item in the collection.
  25. * @param index Index into the collection.
  26. * @return The name at the <code>index</code>th position in the
  27. * <code>NameList</code>, or <code>null</code> if there is no name for
  28. * the specified index or if the index is out of range.
  29. */
  30. public String getName(int index);
  31. /**
  32. * Returns the <code>index</code>th namespaceURI item in the collection.
  33. * @param index Index into the collection.
  34. * @return The namespace URI at the <code>index</code>th position in the
  35. * <code>NameList</code>, or <code>null</code> if there is no name for
  36. * the specified index or if the index is out of range.
  37. */
  38. public String getNamespaceURI(int index);
  39. /**
  40. * The number of pairs (name and namespaceURI) in the list. The range of
  41. * valid child node indices is 0 to <code>length-1</code> inclusive.
  42. */
  43. public int getLength();
  44. /**
  45. * Test if a name is part of this <code>NameList</code>.
  46. * @param str The name to look for.
  47. * @return <code>true</code> if the name has been found,
  48. * <code>false</code> otherwise.
  49. */
  50. public boolean contains(String str);
  51. /**
  52. * Test if the pair namespaceURI/name is part of this
  53. * <code>NameList</code>.
  54. * @param namespaceURI The namespace URI to look for.
  55. * @param name The name to look for.
  56. * @return <code>true</code> if the pair namespaceURI/name has been
  57. * found, <code>false</code> otherwise.
  58. */
  59. public boolean containsNS(String namespaceURI,
  60. String name);
  61. }