Package javolution.util

Examples of javolution.util.Index


     * @return <code>true</code> if a reference is written;
     *         <code>false</code> if a new identifier is written.
     */
    public boolean writeReference(Object obj, XMLFormat.OutputElement xml)
            throws XMLStreamException {
        Index id = (Index) _objectToId.get(obj);
        if (id == null) { // New identifier.
            id = Index.valueOf(_counter++);
            _objectToId.put(obj, id);
            _tmp.clear().append(id.intValue());
            if (_idURI == null) {
                xml.getStreamWriter().writeAttribute(toCsq(_idName),
                        _tmp);
            } else {
                xml.getStreamWriter().writeAttribute(toCsq(_idURI),
                        toCsq(_idName), _tmp);
            }
            return false;
        }
        _tmp.clear().append(id.intValue());
        if (_refURI == null) {
            xml._writer
                    .writeAttribute(toCsq(_refName), _tmp);
        } else {
            xml._writer.writeAttribute(toCsq(_refURI),
View Full Code Here


     * @return <code>true</code> if a reference is written;
     *         <code>false</code> if a new identifier is written.
     */
    public boolean writeReference(Object obj, XMLFormat.OutputElement xml)
            throws XMLStreamException {
        Index id = (Index) _objectToId.get(obj);
        if (id == null) { // New identifier.
            id = Index.of(_counter++);
            _objectToId.put(obj, id);
            _tmp.clear().append(id.intValue());
            if (_idURI == null) {
                xml.getStreamWriter().writeAttribute(_idName, _tmp);
            } else {
                xml.getStreamWriter().writeAttribute(_idURI, _idName, _tmp);
            }
            return false;
        }
        _tmp.clear().append(id.intValue());
        if (_refURI == null) {
            xml._writer.writeAttribute(_refName, _tmp);
        } else {
            xml._writer.writeAttribute(_refURI, _refName, _tmp);
        }
View Full Code Here

TOP

Related Classes of javolution.util.Index

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.