java.lang.Object org.apache.xerces.impl.xpath.regex.Token org.apache.xerces.impl.xpath.regex.Token$ConditionToken
All Implemented Interfaces: Serializable
ConditionToken(int refno, Token cond, Token yespat, Token nopat) { super(Token.CONDITION); this.refNumber = refno; this.condition = cond; this.yes = yespat; this.no = nopat; }
{ super(Token.CONDITION); this.refNumber = refno; this.condition = cond; this.yes = yespat; this.no = nopat; }
Token getChild(int index) { if (index == 0) return this.yes; if (index == 1) return this.no; throw new RuntimeException("Internal Error: "+index); }
{ if (index == 0) return this.yes; if (index == 1) return this.no; throw new RuntimeException("Internal Error: "+index); }
int size() { return this.no == null ? 1 : 2; }
{ return this.no == null ? 1 : 2; }
public String toString(int options) { String ret; if (refNumber > 0) { ret = "(?("+refNumber+")"; } else if (this.condition.type == Token.ANCHOR) { ret = "(?("+this.condition+")"; } else { ret = "(?"+this.condition; } if (this.no == null) { ret += this.yes+")"; } else { ret += this.yes+"|"+this.no+")"; } return ret; }
{ String ret; if (refNumber > 0) { ret = "(?("+refNumber+")"; } else if (this.condition.type == Token.ANCHOR) { ret = "(?("+this.condition+")"; } else { ret = "(?"+this.condition; } if (this.no == null) { ret += this.yes+")"; } else { ret += this.yes+"|"+this.no+")"; } return ret; }