com.sun.xml.internal.fastinfoset.util.ContiguousCharArrayArray Java Examples

The following examples show how to use com.sun.xml.internal.fastinfoset.util.ContiguousCharArrayArray. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: PrintTable.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public static void printArray(String title, ContiguousCharArrayArray a) {
    System.out.println(title);

    for (int i = 0; i < a.getSize(); i++) {
        System.out.println("" + (i + 1) + ": " + a.getString(i));
    }
}
 
Example #2
Source File: PrintTable.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public static void printArray(String title, ContiguousCharArrayArray a) {
    System.out.println(title);

    for (int i = 0; i < a.getSize(); i++) {
        System.out.println("" + (i + 1) + ": " + a.getString(i));
    }
}
 
Example #3
Source File: ParserVocabulary.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/** Creates a new instance of ParserVocabulary */
public ParserVocabulary() {
    namespaceName = new StringArray(ValueArray.DEFAULT_CAPACITY, IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS, false);
    prefix = new PrefixArray(ValueArray.DEFAULT_CAPACITY, IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS);
    localName = new StringArray(ValueArray.DEFAULT_CAPACITY, IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS, false);
    otherNCName = new StringArray(ValueArray.DEFAULT_CAPACITY, IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS, false);
    otherURI = new StringArray(ValueArray.DEFAULT_CAPACITY, IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS, true);
    attributeValue = new StringArray(ValueArray.DEFAULT_CAPACITY, NON_IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS, true);
    otherString = new CharArrayArray(ValueArray.DEFAULT_CAPACITY, NON_IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS);

    characterContentChunk = new ContiguousCharArrayArray(ValueArray.DEFAULT_CAPACITY,
            NON_IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS,
            ContiguousCharArrayArray.INITIAL_CHARACTER_SIZE,
            NON_IDENTIFYING_STRING_TABLE_MAXIMUM_CHARACTERS);

    elementName = new QualifiedNameArray(ValueArray.DEFAULT_CAPACITY, IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS);
    attributeName = new QualifiedNameArray(ValueArray.DEFAULT_CAPACITY, IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS);

    tables[RESTRICTED_ALPHABET] = restrictedAlphabet;
    tables[ENCODING_ALGORITHM] = encodingAlgorithm;
    tables[PREFIX] = prefix;
    tables[NAMESPACE_NAME] = namespaceName;
    tables[LOCAL_NAME] = localName;
    tables[OTHER_NCNAME] = otherNCName;
    tables[OTHER_URI] = otherURI;
    tables[ATTRIBUTE_VALUE] = attributeValue;
    tables[OTHER_STRING] = otherString;
    tables[CHARACTER_CONTENT_CHUNK] = characterContentChunk;
    tables[ELEMENT_NAME] = elementName;
    tables[ATTRIBUTE_NAME] = attributeName;
}
 
Example #4
Source File: ParserVocabulary.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private void addToTable(String s, ContiguousCharArrayArray a) {
    if (s.length() == 0) {
        return;
    }

    char[] c = s.toCharArray();
    a.add(c, c.length);
}
 
Example #5
Source File: Decoder.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private void decodeTableItems(ContiguousCharArrayArray array) throws FastInfosetException, IOException {
    final int noOfItems = decodeNumberOfItemsOfSequence();

    for (int i = 0; i < noOfItems; i++) {
        switch(decodeNonIdentifyingStringOnFirstBit()) {
            case NISTRING_STRING:
                array.add(_charBuffer, _charBufferLength);
                break;
            default:
                throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.illegalState"));
        }
    }
}
 
Example #6
Source File: PrintTable.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public static void printArray(String title, ContiguousCharArrayArray a) {
    System.out.println(title);

    for (int i = 0; i < a.getSize(); i++) {
        System.out.println("" + (i + 1) + ": " + a.getString(i));
    }
}
 
Example #7
Source File: ParserVocabulary.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/** Creates a new instance of ParserVocabulary */
public ParserVocabulary() {
    namespaceName = new StringArray(ValueArray.DEFAULT_CAPACITY, IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS, false);
    prefix = new PrefixArray(ValueArray.DEFAULT_CAPACITY, IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS);
    localName = new StringArray(ValueArray.DEFAULT_CAPACITY, IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS, false);
    otherNCName = new StringArray(ValueArray.DEFAULT_CAPACITY, IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS, false);
    otherURI = new StringArray(ValueArray.DEFAULT_CAPACITY, IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS, true);
    attributeValue = new StringArray(ValueArray.DEFAULT_CAPACITY, NON_IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS, true);
    otherString = new CharArrayArray(ValueArray.DEFAULT_CAPACITY, NON_IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS);

    characterContentChunk = new ContiguousCharArrayArray(ValueArray.DEFAULT_CAPACITY,
            NON_IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS,
            ContiguousCharArrayArray.INITIAL_CHARACTER_SIZE,
            NON_IDENTIFYING_STRING_TABLE_MAXIMUM_CHARACTERS);

    elementName = new QualifiedNameArray(ValueArray.DEFAULT_CAPACITY, IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS);
    attributeName = new QualifiedNameArray(ValueArray.DEFAULT_CAPACITY, IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS);

    tables[RESTRICTED_ALPHABET] = restrictedAlphabet;
    tables[ENCODING_ALGORITHM] = encodingAlgorithm;
    tables[PREFIX] = prefix;
    tables[NAMESPACE_NAME] = namespaceName;
    tables[LOCAL_NAME] = localName;
    tables[OTHER_NCNAME] = otherNCName;
    tables[OTHER_URI] = otherURI;
    tables[ATTRIBUTE_VALUE] = attributeValue;
    tables[OTHER_STRING] = otherString;
    tables[CHARACTER_CONTENT_CHUNK] = characterContentChunk;
    tables[ELEMENT_NAME] = elementName;
    tables[ATTRIBUTE_NAME] = attributeName;
}
 
Example #8
Source File: ParserVocabulary.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private void addToTable(String s, ContiguousCharArrayArray a) {
    if (s.length() == 0) {
        return;
    }

    char[] c = s.toCharArray();
    a.add(c, c.length);
}
 
Example #9
Source File: Decoder.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private void decodeTableItems(ContiguousCharArrayArray array) throws FastInfosetException, IOException {
    final int noOfItems = decodeNumberOfItemsOfSequence();

    for (int i = 0; i < noOfItems; i++) {
        switch(decodeNonIdentifyingStringOnFirstBit()) {
            case NISTRING_STRING:
                array.add(_charBuffer, _charBufferLength);
                break;
            default:
                throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.illegalState"));
        }
    }
}
 
Example #10
Source File: ParserVocabulary.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/** Creates a new instance of ParserVocabulary */
public ParserVocabulary() {
    namespaceName = new StringArray(ValueArray.DEFAULT_CAPACITY, IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS, false);
    prefix = new PrefixArray(ValueArray.DEFAULT_CAPACITY, IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS);
    localName = new StringArray(ValueArray.DEFAULT_CAPACITY, IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS, false);
    otherNCName = new StringArray(ValueArray.DEFAULT_CAPACITY, IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS, false);
    otherURI = new StringArray(ValueArray.DEFAULT_CAPACITY, IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS, true);
    attributeValue = new StringArray(ValueArray.DEFAULT_CAPACITY, NON_IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS, true);
    otherString = new CharArrayArray(ValueArray.DEFAULT_CAPACITY, NON_IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS);

    characterContentChunk = new ContiguousCharArrayArray(ValueArray.DEFAULT_CAPACITY,
            NON_IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS,
            ContiguousCharArrayArray.INITIAL_CHARACTER_SIZE,
            NON_IDENTIFYING_STRING_TABLE_MAXIMUM_CHARACTERS);

    elementName = new QualifiedNameArray(ValueArray.DEFAULT_CAPACITY, IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS);
    attributeName = new QualifiedNameArray(ValueArray.DEFAULT_CAPACITY, IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS);

    tables[RESTRICTED_ALPHABET] = restrictedAlphabet;
    tables[ENCODING_ALGORITHM] = encodingAlgorithm;
    tables[PREFIX] = prefix;
    tables[NAMESPACE_NAME] = namespaceName;
    tables[LOCAL_NAME] = localName;
    tables[OTHER_NCNAME] = otherNCName;
    tables[OTHER_URI] = otherURI;
    tables[ATTRIBUTE_VALUE] = attributeValue;
    tables[OTHER_STRING] = otherString;
    tables[CHARACTER_CONTENT_CHUNK] = characterContentChunk;
    tables[ELEMENT_NAME] = elementName;
    tables[ATTRIBUTE_NAME] = attributeName;
}
 
Example #11
Source File: ParserVocabulary.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/** Creates a new instance of ParserVocabulary */
public ParserVocabulary() {
    namespaceName = new StringArray(ValueArray.DEFAULT_CAPACITY, IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS, false);
    prefix = new PrefixArray(ValueArray.DEFAULT_CAPACITY, IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS);
    localName = new StringArray(ValueArray.DEFAULT_CAPACITY, IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS, false);
    otherNCName = new StringArray(ValueArray.DEFAULT_CAPACITY, IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS, false);
    otherURI = new StringArray(ValueArray.DEFAULT_CAPACITY, IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS, true);
    attributeValue = new StringArray(ValueArray.DEFAULT_CAPACITY, NON_IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS, true);
    otherString = new CharArrayArray(ValueArray.DEFAULT_CAPACITY, NON_IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS);

    characterContentChunk = new ContiguousCharArrayArray(ValueArray.DEFAULT_CAPACITY,
            NON_IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS,
            ContiguousCharArrayArray.INITIAL_CHARACTER_SIZE,
            NON_IDENTIFYING_STRING_TABLE_MAXIMUM_CHARACTERS);

    elementName = new QualifiedNameArray(ValueArray.DEFAULT_CAPACITY, IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS);
    attributeName = new QualifiedNameArray(ValueArray.DEFAULT_CAPACITY, IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS);

    tables[RESTRICTED_ALPHABET] = restrictedAlphabet;
    tables[ENCODING_ALGORITHM] = encodingAlgorithm;
    tables[PREFIX] = prefix;
    tables[NAMESPACE_NAME] = namespaceName;
    tables[LOCAL_NAME] = localName;
    tables[OTHER_NCNAME] = otherNCName;
    tables[OTHER_URI] = otherURI;
    tables[ATTRIBUTE_VALUE] = attributeValue;
    tables[OTHER_STRING] = otherString;
    tables[CHARACTER_CONTENT_CHUNK] = characterContentChunk;
    tables[ELEMENT_NAME] = elementName;
    tables[ATTRIBUTE_NAME] = attributeName;
}
 
Example #12
Source File: ParserVocabulary.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private void addToTable(String s, ContiguousCharArrayArray a) {
    if (s.length() == 0) {
        return;
    }

    char[] c = s.toCharArray();
    a.add(c, c.length);
}
 
Example #13
Source File: Decoder.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private void decodeTableItems(ContiguousCharArrayArray array) throws FastInfosetException, IOException {
    final int noOfItems = decodeNumberOfItemsOfSequence();

    for (int i = 0; i < noOfItems; i++) {
        switch(decodeNonIdentifyingStringOnFirstBit()) {
            case NISTRING_STRING:
                array.add(_charBuffer, _charBufferLength);
                break;
            default:
                throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.illegalState"));
        }
    }
}
 
Example #14
Source File: PrintTable.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public static void printArray(String title, ContiguousCharArrayArray a) {
    System.out.println(title);

    for (int i = 0; i < a.getSize(); i++) {
        System.out.println("" + (i + 1) + ": " + a.getString(i));
    }
}
 
Example #15
Source File: ParserVocabulary.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/** Creates a new instance of ParserVocabulary */
public ParserVocabulary() {
    namespaceName = new StringArray(ValueArray.DEFAULT_CAPACITY, IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS, false);
    prefix = new PrefixArray(ValueArray.DEFAULT_CAPACITY, IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS);
    localName = new StringArray(ValueArray.DEFAULT_CAPACITY, IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS, false);
    otherNCName = new StringArray(ValueArray.DEFAULT_CAPACITY, IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS, false);
    otherURI = new StringArray(ValueArray.DEFAULT_CAPACITY, IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS, true);
    attributeValue = new StringArray(ValueArray.DEFAULT_CAPACITY, NON_IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS, true);
    otherString = new CharArrayArray(ValueArray.DEFAULT_CAPACITY, NON_IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS);

    characterContentChunk = new ContiguousCharArrayArray(ValueArray.DEFAULT_CAPACITY,
            NON_IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS,
            ContiguousCharArrayArray.INITIAL_CHARACTER_SIZE,
            NON_IDENTIFYING_STRING_TABLE_MAXIMUM_CHARACTERS);

    elementName = new QualifiedNameArray(ValueArray.DEFAULT_CAPACITY, IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS);
    attributeName = new QualifiedNameArray(ValueArray.DEFAULT_CAPACITY, IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS);

    tables[RESTRICTED_ALPHABET] = restrictedAlphabet;
    tables[ENCODING_ALGORITHM] = encodingAlgorithm;
    tables[PREFIX] = prefix;
    tables[NAMESPACE_NAME] = namespaceName;
    tables[LOCAL_NAME] = localName;
    tables[OTHER_NCNAME] = otherNCName;
    tables[OTHER_URI] = otherURI;
    tables[ATTRIBUTE_VALUE] = attributeValue;
    tables[OTHER_STRING] = otherString;
    tables[CHARACTER_CONTENT_CHUNK] = characterContentChunk;
    tables[ELEMENT_NAME] = elementName;
    tables[ATTRIBUTE_NAME] = attributeName;
}
 
Example #16
Source File: ParserVocabulary.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private void addToTable(String s, ContiguousCharArrayArray a) {
    if (s.length() == 0) {
        return;
    }

    char[] c = s.toCharArray();
    a.add(c, c.length);
}
 
Example #17
Source File: Decoder.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private void decodeTableItems(ContiguousCharArrayArray array) throws FastInfosetException, IOException {
    final int noOfItems = decodeNumberOfItemsOfSequence();

    for (int i = 0; i < noOfItems; i++) {
        switch(decodeNonIdentifyingStringOnFirstBit()) {
            case NISTRING_STRING:
                array.add(_charBuffer, _charBufferLength);
                break;
            default:
                throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.illegalState"));
        }
    }
}
 
Example #18
Source File: PrintTable.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public static void printArray(String title, ContiguousCharArrayArray a) {
    System.out.println(title);

    for (int i = 0; i < a.getSize(); i++) {
        System.out.println("" + (i + 1) + ": " + a.getString(i));
    }
}
 
Example #19
Source File: ParserVocabulary.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
private void addToTable(String s, ContiguousCharArrayArray a) {
    if (s.length() == 0) {
        return;
    }

    char[] c = s.toCharArray();
    a.add(c, c.length);
}
 
Example #20
Source File: ParserVocabulary.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private void addToTable(String s, ContiguousCharArrayArray a) {
    if (s.length() == 0) {
        return;
    }

    char[] c = s.toCharArray();
    a.add(c, c.length);
}
 
Example #21
Source File: Decoder.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private void decodeTableItems(ContiguousCharArrayArray array) throws FastInfosetException, IOException {
    final int noOfItems = decodeNumberOfItemsOfSequence();

    for (int i = 0; i < noOfItems; i++) {
        switch(decodeNonIdentifyingStringOnFirstBit()) {
            case NISTRING_STRING:
                array.add(_charBuffer, _charBufferLength);
                break;
            default:
                throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.illegalState"));
        }
    }
}
 
Example #22
Source File: PrintTable.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public static void printArray(String title, ContiguousCharArrayArray a) {
    System.out.println(title);

    for (int i = 0; i < a.getSize(); i++) {
        System.out.println("" + (i + 1) + ": " + a.getString(i));
    }
}
 
Example #23
Source File: ParserVocabulary.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/** Creates a new instance of ParserVocabulary */
public ParserVocabulary() {
    namespaceName = new StringArray(ValueArray.DEFAULT_CAPACITY, IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS, false);
    prefix = new PrefixArray(ValueArray.DEFAULT_CAPACITY, IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS);
    localName = new StringArray(ValueArray.DEFAULT_CAPACITY, IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS, false);
    otherNCName = new StringArray(ValueArray.DEFAULT_CAPACITY, IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS, false);
    otherURI = new StringArray(ValueArray.DEFAULT_CAPACITY, IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS, true);
    attributeValue = new StringArray(ValueArray.DEFAULT_CAPACITY, NON_IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS, true);
    otherString = new CharArrayArray(ValueArray.DEFAULT_CAPACITY, NON_IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS);

    characterContentChunk = new ContiguousCharArrayArray(ValueArray.DEFAULT_CAPACITY,
            NON_IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS,
            ContiguousCharArrayArray.INITIAL_CHARACTER_SIZE,
            NON_IDENTIFYING_STRING_TABLE_MAXIMUM_CHARACTERS);

    elementName = new QualifiedNameArray(ValueArray.DEFAULT_CAPACITY, IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS);
    attributeName = new QualifiedNameArray(ValueArray.DEFAULT_CAPACITY, IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS);

    tables[RESTRICTED_ALPHABET] = restrictedAlphabet;
    tables[ENCODING_ALGORITHM] = encodingAlgorithm;
    tables[PREFIX] = prefix;
    tables[NAMESPACE_NAME] = namespaceName;
    tables[LOCAL_NAME] = localName;
    tables[OTHER_NCNAME] = otherNCName;
    tables[OTHER_URI] = otherURI;
    tables[ATTRIBUTE_VALUE] = attributeValue;
    tables[OTHER_STRING] = otherString;
    tables[CHARACTER_CONTENT_CHUNK] = characterContentChunk;
    tables[ELEMENT_NAME] = elementName;
    tables[ATTRIBUTE_NAME] = attributeName;
}
 
Example #24
Source File: ParserVocabulary.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
private void addToTable(String s, ContiguousCharArrayArray a) {
    if (s.length() == 0) {
        return;
    }

    char[] c = s.toCharArray();
    a.add(c, c.length);
}
 
Example #25
Source File: Decoder.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
private void decodeTableItems(ContiguousCharArrayArray array) throws FastInfosetException, IOException {
    final int noOfItems = decodeNumberOfItemsOfSequence();

    for (int i = 0; i < noOfItems; i++) {
        switch(decodeNonIdentifyingStringOnFirstBit()) {
            case NISTRING_STRING:
                array.add(_charBuffer, _charBufferLength);
                break;
            default:
                throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.illegalState"));
        }
    }
}
 
Example #26
Source File: PrintTable.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public static void printArray(String title, ContiguousCharArrayArray a) {
    System.out.println(title);

    for (int i = 0; i < a.getSize(); i++) {
        System.out.println("" + (i + 1) + ": " + a.getString(i));
    }
}
 
Example #27
Source File: ParserVocabulary.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/** Creates a new instance of ParserVocabulary */
public ParserVocabulary() {
    namespaceName = new StringArray(ValueArray.DEFAULT_CAPACITY, IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS, false);
    prefix = new PrefixArray(ValueArray.DEFAULT_CAPACITY, IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS);
    localName = new StringArray(ValueArray.DEFAULT_CAPACITY, IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS, false);
    otherNCName = new StringArray(ValueArray.DEFAULT_CAPACITY, IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS, false);
    otherURI = new StringArray(ValueArray.DEFAULT_CAPACITY, IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS, true);
    attributeValue = new StringArray(ValueArray.DEFAULT_CAPACITY, NON_IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS, true);
    otherString = new CharArrayArray(ValueArray.DEFAULT_CAPACITY, NON_IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS);

    characterContentChunk = new ContiguousCharArrayArray(ValueArray.DEFAULT_CAPACITY,
            NON_IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS,
            ContiguousCharArrayArray.INITIAL_CHARACTER_SIZE,
            NON_IDENTIFYING_STRING_TABLE_MAXIMUM_CHARACTERS);

    elementName = new QualifiedNameArray(ValueArray.DEFAULT_CAPACITY, IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS);
    attributeName = new QualifiedNameArray(ValueArray.DEFAULT_CAPACITY, IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS);

    tables[RESTRICTED_ALPHABET] = restrictedAlphabet;
    tables[ENCODING_ALGORITHM] = encodingAlgorithm;
    tables[PREFIX] = prefix;
    tables[NAMESPACE_NAME] = namespaceName;
    tables[LOCAL_NAME] = localName;
    tables[OTHER_NCNAME] = otherNCName;
    tables[OTHER_URI] = otherURI;
    tables[ATTRIBUTE_VALUE] = attributeValue;
    tables[OTHER_STRING] = otherString;
    tables[CHARACTER_CONTENT_CHUNK] = characterContentChunk;
    tables[ELEMENT_NAME] = elementName;
    tables[ATTRIBUTE_NAME] = attributeName;
}
 
Example #28
Source File: ParserVocabulary.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private void addToTable(String s, ContiguousCharArrayArray a) {
    if (s.length() == 0) {
        return;
    }

    char[] c = s.toCharArray();
    a.add(c, c.length);
}
 
Example #29
Source File: Decoder.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private void decodeTableItems(ContiguousCharArrayArray array) throws FastInfosetException, IOException {
    final int noOfItems = decodeNumberOfItemsOfSequence();

    for (int i = 0; i < noOfItems; i++) {
        switch(decodeNonIdentifyingStringOnFirstBit()) {
            case NISTRING_STRING:
                array.add(_charBuffer, _charBufferLength);
                break;
            default:
                throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.illegalState"));
        }
    }
}
 
Example #30
Source File: PrintTable.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public static void printArray(String title, ContiguousCharArrayArray a) {
    System.out.println(title);

    for (int i = 0; i < a.getSize(); i++) {
        System.out.println("" + (i + 1) + ": " + a.getString(i));
    }
}