Examples of CharArray


Examples of javolution.text.CharArray

            if (((_isRepairingNamespaces && (i < i1) && !_namespaces._prefixesWritten[i]))
                    || ((i >= i1) && _namespaces._prefixesWritten[i])) { // Write namespace.

                // In repairing mode, removes redondancy.
                if (_isRepairingNamespaces) {
                    CharArray prefix = _namespaces.getPrefix(
                            _namespaces._namespaces[i], i);
                    if (_namespaces._prefixes[i].equals(prefix))
                        continue; // Not necessary.
                } // Direct mode, just write them as requested (no check).
View Full Code Here

Examples of javolution.text.CharArray

    }

    // Returns the prefix for the specified namespace.
    private CharSequence getRepairedPrefix(CharSequence prefix,
            CharSequence namespaceURI) throws XMLStreamException {
        CharArray prefixForURI = _namespaces.getPrefix(namespaceURI);
        if ((prefixForURI != null)
                && ((prefix == null) || prefixForURI.equals(prefix)))
            return prefixForURI; // No repair needed.
        if ((prefix == null) || (prefix.length() == 0)) { // Creates new prefix.
            prefix = _autoPrefix.clear().append(_repairingPrefix).append(
                    _autoNSCount++);
        }
View Full Code Here

Examples of javolution.text.CharArray

                uri, _namespacesCount[_nesting]);
    }

    CharArray getPrefix(CharSequence uri, int count) {
        for (int i = count; --i >= 0;) {
            CharArray prefix = _prefixes[i];
            CharArray namespace = _namespaces[i];
            if (namespace.equals(uri)) { // Find matching uri.
                // Checks that the prefix has not been overwriten after being set.
                boolean isPrefixOverwritten = false;
                for (int j = i + 1; j < count; j++) {
                    if (prefix.equals(_prefixes[j])) {
                        isPrefixOverwritten = true;
View Full Code Here

Examples of javolution.text.CharArray

    void setPrefix(final CharSequence prefix, CharSequence uri,
            boolean isWritten) {
        final int index = _namespacesCount[_nesting];
        _prefixesWritten[index] = isWritten;
        final int prefixLength = prefix.length();
        CharArray prefixTmp = _prefixesTmp[index];
        if ((prefixTmp == null)
                || (prefixTmp.array().length < prefixLength)) {
            MemoryArea.getMemoryArea(this).executeInArea(new Runnable() {
                public void run() {
                    _prefixesTmp[index] = new CharArray().setArray(new char[prefixLength + 32], 0, 0);
                }
            });
            prefixTmp = _prefixesTmp[index];
        }
        for (int i = 0; i < prefixLength; i++) {
            prefixTmp.array()[i] = prefix.charAt(i);
        }
        prefixTmp.setArray(prefixTmp.array(), 0, prefixLength);

        final int uriLength = uri.length();
        CharArray namespaceTmp = _namespacesTmp[index];
        if ((namespaceTmp == null)
                || (namespaceTmp.array().length < uriLength)) {
            MemoryArea.getMemoryArea(this).executeInArea(new Runnable() {
                public void run() {
                    _namespacesTmp[index] = new CharArray().setArray(new char[uriLength + 32], 0, 0);
                }
            });
            namespaceTmp = _namespacesTmp[index];
        }
        for (int i = 0; i < uriLength; i++) {
            namespaceTmp.array()[i] = uri.charAt(i);
        }
        namespaceTmp.setArray(namespaceTmp.array(), 0, uriLength);
       
        // Sets the prefix using CharArray instances.
        setPrefix(prefixTmp, namespaceTmp);
    }
View Full Code Here

Examples of javolution.text.CharArray

        if (uri == null)
            throw new IllegalArgumentException(
                    "null namespace URI is not allowed");
        for (int i = 0; i < _length; i++) {
            if (_localNames[i].equals(localName)) {
                CharArray ns = _namespaces.getNamespaceURINullAllowed(_prefixes[i]);
                if ((ns != null) && ns.equals(uri))
                    return i;
            }
        }
        return -1;
    }
View Full Code Here

Examples of net.imglib2.img.basictypeaccess.array.CharArray

  }

  @Override
  public CellImg< T, CharArray, DefaultCell< CharArray > > createCharInstance( final long[] dimensions, final Fraction entitiesPerPixel )
  {
    return createInstance( new CharArray( 1 ), dimensions, entitiesPerPixel );
  }
View Full Code Here

Examples of net.imglib2.img.basictypeaccess.array.CharArray

  }

  @Override
  public NativeImg< T, CharArray > createCharInstance( final long[] dimensions, final Fraction entitiesPerPixel )
  {
    return new PlanarImg< T, CharArray >( new CharArray( 1 ), dimensions, entitiesPerPixel );
  }
View Full Code Here

Examples of net.imglib2.img.basictypeaccess.array.CharArray

  @Override
  public ArrayImg< T, CharArray> createCharInstance( final long[] dimensions, final Fraction entitiesPerPixel )
  {
    final int numEntities = numEntitiesRangeCheck( dimensions, entitiesPerPixel );

    return new ArrayImg< T, CharArray >( new CharArray( numEntities ), dimensions, entitiesPerPixel );
  }
View Full Code Here

Examples of net.imglib2.img.basictypeaccess.array.CharArray

  // this is the constructor if you want it to be a variable
  public BasePairCharType( final Base value )
  {
    img = null;
    dataAccess = new CharArray( 1 );
    set( value );
  }
View Full Code Here

Examples of net.imglib2.img.basictypeaccess.array.CharArray

  // this is the constructor if you want it to be a variable
  public BasePairCharType( final char value )
  {
    img = null;
    dataAccess = new CharArray( 1 );
    setChar( value );
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.