模块  java.xml
软件包  org.w3c.dom

Interface NameList


  • public interface NameList
    NameList接口提供了名称和命名空间值(可以是空值)的并行线对的有序集合的抽象,而不定义或约束此集合的实现方式。 NameList中的项目可通过整数索引访问,从0开始。

    另见Document Object Model (DOM) Level 3 Core Specification

    从以下版本开始:
    1.5,DOM Level 3
    • 方法详细信息

      • getName

        String getName​(int index)
        返回集合中的 index名称项。
        参数
        index - 集合索引。
        结果
        index位置的 NameList ,如果指定索引没有名称或索引超出范围, null
      • getNamespaceURI

        String getNamespaceURI​(int index)
        返回集合中的 index namespaceURI项。
        参数
        index - 索引到集合中。
        结果
        在该命名空间URI index在个位置 NameList ,或 null如果不存在用于指定的索引,如果索引超出范围没有名字。
      • getLength

        int getLength()
        列表中的对(名称和namespaceURI)的数量。 有效子节点索引的范围是0到length-1含)。
      • contains

        boolean contains​(String str)
        测试名称是否属于此 NameList一部分。
        参数
        str - 要查找的名称。
        结果
        true如果找到了名字,另有 false
      • containsNS

        boolean containsNS​(String namespaceURI,
                           String name)
        测试对namespaceURI / name是否为此 NameList一部分。
        参数
        namespaceURI - 要查找的名称空间URI。
        name - 要查找的名称。
        结果
        true如果找到了对namespaceURI / name, false