case Axis.CHILD: if (children == null) { return EmptyIterator.getInstance(); } else { return new NodeArrayIterator(children); case Axis.FOLLOWING_SIBLING: if (parent == null || siblingPosition == parent.children.length - 1) { return EmptyIterator.getInstance(); } else { return new NodeArrayIterator(parent.children, siblingPosition + 1, parent.children.length); case Axis.PRECEDING_SIBLING: if (parent == null || siblingPosition == 0) { return EmptyIterator.getInstance(); } else { return new NodeArrayIterator(parent.children, 0, siblingPosition);
/** * Return an iteration over the sequence */ public SequenceIterator iterate() { return EmptyIterator.getInstance(); }
/** * Return an iteration over the sequence */ public SequenceIterator iterate() { return EmptyIterator.getInstance(); }
/** * Return an iteration over the sequence */ public SequenceIterator iterate() { return EmptyIterator.getInstance(); }
/** * Get an iterator over the sequence of items that has been constructed */ public SequenceIterator iterate() { if (list.isEmpty()) { return EmptyIterator.getInstance(); } else { return new ListIterator(list); } }
/** * Get an iterator over the sequence of items that has been constructed */ public SequenceIterator iterate() { if (list.size() == 0) { return EmptyIterator.getInstance(); } else { return new ListIterator(list); } }
/** * Use this regular expression to tokenize an input string. * * @param input the string to be tokenized * @return a SequenceIterator containing the resulting tokens, as objects of type StringValue */ public SequenceIterator tokenize(CharSequence input) { if (input.length() == 0) { return EmptyIterator.getInstance(); } return new JTokenIterator(input, pattern); }
/** * Use this regular expression to tokenize an input string. * * @param input the string to be tokenized * @return a SequenceIterator containing the resulting tokens, as objects of type StringValue */ public SequenceIterator tokenize(CharSequence input) { if (input.length() == 0) { return EmptyIterator.getInstance(); } return new JTokenIterator(input, pattern); }
/** * Get an iterator over the sequence of items that has been constructed */ public SequenceIterator iterate() { if (list.size() == 0) { return EmptyIterator.getInstance(); } else { return new ListIterator(list); } }
/** * Factory method. * @param item the item to iterate over * @return a SingletonIterator over the supplied item, or an EmptyIterator * if the supplied item is null. */ public static UnfailingIterator makeIterator(Item item) { if (item==null) { return EmptyIterator.getInstance(); } else { return new SingletonIterator(item); } }
/** * Factory method. * @param item the item to iterate over * @return a SingletonIterator over the supplied item, or an EmptyIterator * if the supplied item is null. */ public static AxisIterator makeIterator(NodeInfo item) { if (item==null) { return EmptyIterator.getInstance(); } else { return new SingleNodeIterator(item); } }
/** * Factory method. * @param item the item to iterate over * @return a SingletonIterator over the supplied item, or an EmptyIterator * if the supplied item is null. */ public static AxisIterator makeIterator(NodeInfo item) { if (item==null) { return EmptyIterator.getInstance(); } else { return new SingleNodeIterator(item); } }
/** * Factory method. * @param item the item to iterate over * @return a SingletonIterator over the supplied item, or an EmptyIterator * if the supplied item is null. */ public static UnfailingIterator makeIterator(Item item) { if (item==null) { return EmptyIterator.getInstance(); } else { return new SingletonIterator(item); } }
public SequenceIterator iterate(XPathContext c) throws XPathException { Item item = argument[0].evaluateItem(c); if (item==null) { return EmptyIterator.getInstance(); } return ((StringValue)item).iterateCharacters(); }
/** * Iterate over the results of all the child expressions */ public SequenceIterator iterate(XPathContext context) throws XPathException { if (children==null || children.length == 0) { return EmptyIterator.getInstance(); } else if (children.length == 1) { return children[0].iterate(context); } else { return new BlockIterator(children, context); } }
public SequenceIterator iterate(XPathContext c) throws XPathException { Item item = argument[0].evaluateItem(c); if (item==null) { return EmptyIterator.getInstance(); } return ((StringValue)item).iterateCharacters(); }
/** * Iterate over the results of all the child expressions */ public SequenceIterator iterate(XPathContext context) throws XPathException { if (children==null || children.length == 0) { return EmptyIterator.getInstance(); } else if (children.length == 1) { return children[0].iterate(context); } else { return new BlockIterator(children, context); } }
public SequenceIterator iterate(XPathContext c) throws XPathException { Item item = argument[0].evaluateItem(c); if (item==null) { return EmptyIterator.getInstance(); } return ((StringValue)item).iterateCharacters(); }
/** * Return an iteration over the result sequence */ public SequenceIterator iterate(XPathContext c) throws XPathException { if (operation==CURRENT_GROUP) { GroupIterator gi = c.getCurrentGroupIterator(); if (gi==null) { return EmptyIterator.getInstance(); } return gi.iterateCurrentGroup(); } else { return super.iterate(c); } }
/** * Return an iteration over the result sequence */ public SequenceIterator iterate(XPathContext c) throws XPathException { if (operation==CURRENT_GROUP) { GroupIterator gi = c.getCurrentGroupIterator(); if (gi==null) { return EmptyIterator.getInstance(); } return gi.iterateCurrentGroup(); } else { return super.iterate(c); } }