Package javolution.text

Examples of javolution.text.CharArray


         * @return the <code>boolean</code> value for the specified attribute or
         *         the default value if the attribute is not found.
         */
        public boolean getAttribute(String name, boolean defaultValue)
                throws XMLStreamException {
            CharArray value = getAttribute(name);
            return (value != null) ? value.toBoolean() : defaultValue;
        }
View Full Code Here


         * @return the <code>char</code> value for the specified attribute or
         *         the default value if the attribute is not found.
         */
        public char getAttribute(String name, char defaultValue)
                throws XMLStreamException {
            CharArray value = getAttribute(name);
            if (value == null)
                return defaultValue;
            if (value.length() != 1)
                throw new XMLStreamException(
                        "Single character expected (read '" + value + "')");
            return value.charAt(0);
        }
View Full Code Here

         * @return the <code>byte</code> value for the specified attribute or
         *         the default value if the attribute is not found.
         */
        public byte getAttribute(String name, byte defaultValue)
                throws XMLStreamException {
            CharArray value = getAttribute(name);
            return (value != null) ? (byte) value.toInt() : defaultValue;
        }
View Full Code Here

         * @return the <code>short</code> value for the specified attribute or
         *         the default value if the attribute is not found.
         */
        public short getAttribute(String name, short defaultValue)
                throws XMLStreamException {
            CharArray value = getAttribute(name);
            return (value != null) ? (short) value.toInt() : defaultValue;
        }
View Full Code Here

         * @return the <code>int</code> value for the specified attribute or
         *         the default value if the attribute is not found.
         */
        public int getAttribute(String name, int defaultValue)
                throws XMLStreamException {
            CharArray value = getAttribute(name);
            return (value != null) ? value.toInt() : defaultValue;
        }
View Full Code Here

         * @return the <code>long</code> value for the specified attribute or
         *         the default value if the attribute is not found.
         */
        public long getAttribute(String name, long defaultValue)
                throws XMLStreamException {
            CharArray value = getAttribute(name);
            return (value != null) ? value.toLong() : defaultValue;
        }
View Full Code Here

         * @return the <code>float</code> value for the specified attribute or
         *         the default value if the attribute is not found.
         */
        public float getAttribute(String name, float defaultValue)
                throws XMLStreamException {
            CharArray value = getAttribute(name);
            return (value != null) ? value.toFloat() : defaultValue;
        }
View Full Code Here

         * @return the <code>double</code> value for the specified attribute or
         *         the default value if the attribute is not found.
         */
        public double getAttribute(String name, double defaultValue)
                throws XMLStreamException {
            CharArray value = getAttribute(name);
            return (value != null) ? value.toDouble() : defaultValue;
        }
View Full Code Here

         * @return the parse value for the specified attribute or
         *         the default value if the attribute is not found.
         */
        public <T> T getAttribute(String name, T defaultValue)
                throws XMLStreamException {
            CharArray value = getAttribute(name);
            if (value == null)
                return defaultValue;
            // Parses attribute value.
            Class<?> type = defaultValue.getClass();
            TextFormat<?> format = TextContext.getFormat(type);
View Full Code Here

     * @param namespaceURI the URI reference or <code>null</code> if none.
     * @param localName the local name.
     * @param toString the string representation.
     */
    private QName(String namespaceURI, String localName, String toString) {
        _namespaceURI = (namespaceURI == null) ? null : new CharArray(
                namespaceURI);
        _localName = new CharArray(localName);
        _toString = toString;
    }
View Full Code Here

TOP

Related Classes of javolution.text.CharArray

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.