/** * Compares this string to the specified object. * The result is <code>true</code> if and only if the argument is not * <code>null</code> and is a <code>String</code> object that represents * the same sequence of characters as this object. * * @param obj2 the object to compare this <code>String</code> * against. * @return <code>true</code> if the <code>String </code>are equal; * <code>false</code> otherwise. * @see java.lang.String#compareTo(java.lang.String) * @see java.lang.String#equalsIgnoreCase(java.lang.String) */ public boolean equals(XMLString obj2) { if (obj2 != null) { if (!obj2.hasString()) { return obj2.equals(str()); } else { return str().equals(obj2.toString()); } } return false; }
/** * @param nodeHandle * @param ch * @param normalize * * @throws org.xml.sax.SAXException */ public void dispatchCharactersEvents( int nodeHandle, ContentHandler ch, boolean normalize )throws org.xml.sax.SAXException { if (DEBUG) { System.out.println("dispatchCharacterEvents(" + nodeHandle + "," + ch + "," + normalize + ")"); } if(normalize) { XMLString str = getStringValue(nodeHandle); str = str.fixWhiteSpace(true, true, false); str.dispatchCharactersEvents(ch); } else { Node node = getNode(nodeHandle); dispatchNodeData(node, ch, 0); } }
/** * Execute the function. The function must return * a valid object. * @param xctxt The current execution context. * @return A valid XObject. * * @throws javax.xml.transform.TransformerException */ public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { XMLString s1 = m_arg0.execute(xctxt).xstr(); XMLString s2 = m_arg1.execute(xctxt).xstr(); int index = s1.indexOf(s2); return (-1 == index) ? XString.EMPTYSTRING : (XString)s1.substring(index + s2.length()); } }
/** * Compares two strings lexicographically. * * @param anotherString the <code>String</code> to be compared. * @return the value <code>0</code> if the argument string is equal to * this string; a value less than <code>0</code> if this string * is lexicographically less than the string argument; and a * value greater than <code>0</code> if this string is * lexicographically greater than the string argument. * @exception java.lang.NullPointerException if <code>anotherString</code> * is <code>null</code>. */ public int compareTo(XMLString anotherString) { return m_str.compareTo(anotherString.toString()); }
data.dispatchAsComment(lh);
/** * Execute the function. The function must return * a valid object. * @param xctxt The current execution context. * @return A valid XObject. * * @throws javax.xml.transform.TransformerException */ public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { return m_arg0.execute(xctxt).xstr().startsWith(m_arg1.execute(xctxt).xstr()) ? XBoolean.S_TRUE : XBoolean.S_FALSE; } }
/** * Compare two strings for equality. * * * @param s1 First string to compare * @param s2 Second String to compare * * @return true if s1 is equal to s2 */ boolean compareStrings(XMLString s1, XMLString s2) { return s1.equals(s2); }
/** * Directly call the * characters method on the passed ContentHandler for the * string-value. Multiple calls to the * ContentHandler's characters methods may well occur for a single call to * this method. * * @param ch A non-null reference to a ContentHandler. * * @throws org.xml.sax.SAXException */ public void dispatchCharactersEvents(org.xml.sax.ContentHandler ch) throws org.xml.sax.SAXException { xstr().dispatchCharactersEvents(ch); }
/** * Execute the function. The function must return * a valid object. * @param xctxt The current execution context. * @return A valid XObject. * * @throws javax.xml.transform.TransformerException */ public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { XMLString s1 = getArg0AsString(xctxt); return (XString)s1.fixWhiteSpace(true, true, false); }
/** * Execute the function. The function must return * a valid object. * @param xctxt The current execution context. * @return A valid XObject. * * @throws javax.xml.transform.TransformerException */ public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { return new XNumber(getArg0AsString(xctxt).length()); } }
/** * Execute the function. The function must return * a valid object. * @param xctxt The current execution context. * @return A valid XObject. * * @throws javax.xml.transform.TransformerException */ public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { XMLString s1 = m_arg0.execute(xctxt).xstr(); XMLString s2 = m_arg1.execute(xctxt).xstr(); int index = s1.indexOf(s2); return (-1 == index) ? XString.EMPTYSTRING : (XString)s1.substring(index + s2.length()); } }
/** * Compares this string to the specified object. * The result is <code>true</code> if and only if the argument is not * <code>null</code> and is a <code>String</code> object that represents * the same sequence of characters as this object. * * @param anObject the object to compare this <code>String</code> * against. * @return <code>true</code> if the <code>String </code>are equal; * <code>false</code> otherwise. * @see java.lang.String#compareTo(java.lang.String) * @see java.lang.String#equalsIgnoreCase(java.lang.String) */ public boolean equals(XMLString anObject) { return m_str.equals(anObject.toString()); }
data.dispatchAsComment(lh);
/** * Execute the function. The function must return * a valid object. * @param xctxt The current execution context. * @return A valid XObject. * * @throws javax.xml.transform.TransformerException */ public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { return m_arg0.execute(xctxt).xstr().startsWith(m_arg1.execute(xctxt).xstr()) ? XBoolean.S_TRUE : XBoolean.S_FALSE; } }
/** * Compare two strings for non-equality. * * * @param s1 First string to compare * @param s2 Second String to compare * * @return true if s1 is not equal to s2 */ boolean compareStrings(XMLString s1, XMLString s2) { return !s1.equals(s2); }
/** * Directly call the * characters method on the passed ContentHandler for the * string-value. Multiple calls to the * ContentHandler's characters methods may well occur for a single call to * this method. * * @param ch A non-null reference to a ContentHandler. * * @throws org.xml.sax.SAXException */ public void dispatchCharactersEvents(org.xml.sax.ContentHandler ch) throws org.xml.sax.SAXException { xstr().dispatchCharactersEvents(ch); }