1 package org.unicode.cldr.util; 2 3 import java.util.Map; 4 5 /** This is an interface for a read-only XPath. */ 6 public interface XPathValue { 7 /** How many elements are in this xpath? */ size()8 int size(); 9 10 /** Get the nth element. Negative values are from end */ getElement(int i)11 String getElement(int i); 12 13 /** See if the xpath contains an element */ containsElement(String element)14 public boolean containsElement(String element); 15 16 /** 17 * Get the attributes for the nth element (negative index is from end). Returns null or an empty 18 * map if there's nothing. PROBLEM: exposes internal map 19 */ getAttributes(int elementIndex)20 public Map<String, String> getAttributes(int elementIndex); 21 22 /** 23 * Get the attributeValue for the attrbute at the nth element (negative index is from end). 24 * Returns null if there's nothing. 25 */ getAttributeValue(int i, String string)26 String getAttributeValue(int i, String string); 27 28 /** Does this xpath contain the attribute at all? */ containsAttribute(String attribute)29 public boolean containsAttribute(String attribute); 30 31 /** return the original string */ toString()32 public String toString(); 33 } 34