repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
partition
stringclasses
1 value
amzn/ion-java
src/com/amazon/ion/Timestamp.java
Timestamp.addDay
public final Timestamp addDay(int amount) { long delta = (long) amount * 24 * 60 * 60 * 1000; return addMillisForPrecision(delta, Precision.DAY, false); }
java
public final Timestamp addDay(int amount) { long delta = (long) amount * 24 * 60 * 60 * 1000; return addMillisForPrecision(delta, Precision.DAY, false); }
[ "public", "final", "Timestamp", "addDay", "(", "int", "amount", ")", "{", "long", "delta", "=", "(", "long", ")", "amount", "*", "24", "*", "60", "*", "60", "*", "1000", ";", "return", "addMillisForPrecision", "(", "delta", ",", "Precision", ".", "DAY"...
Returns a timestamp relative to this one by the given number of days. @param amount a number of days.
[ "Returns", "a", "timestamp", "relative", "to", "this", "one", "by", "the", "given", "number", "of", "days", "." ]
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/Timestamp.java#L2443-L2447
train
amzn/ion-java
src/com/amazon/ion/util/IonTextUtils.java
IonTextUtils.printStringCodePoint
public static void printStringCodePoint(Appendable out, int codePoint) throws IOException { printCodePoint(out, codePoint, EscapeMode.ION_STRING); }
java
public static void printStringCodePoint(Appendable out, int codePoint) throws IOException { printCodePoint(out, codePoint, EscapeMode.ION_STRING); }
[ "public", "static", "void", "printStringCodePoint", "(", "Appendable", "out", ",", "int", "codePoint", ")", "throws", "IOException", "{", "printCodePoint", "(", "out", ",", "codePoint", ",", "EscapeMode", ".", "ION_STRING", ")", ";", "}" ]
Prints a single Unicode code point for use in an ASCII-safe Ion string. @param out the stream to receive the data. @param codePoint a Unicode code point.
[ "Prints", "a", "single", "Unicode", "code", "point", "for", "use", "in", "an", "ASCII", "-", "safe", "Ion", "string", "." ]
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/util/IonTextUtils.java#L200-L204
train
amzn/ion-java
src/com/amazon/ion/util/IonTextUtils.java
IonTextUtils.printSymbolCodePoint
public static void printSymbolCodePoint(Appendable out, int codePoint) throws IOException { printCodePoint(out, codePoint, EscapeMode.ION_SYMBOL); }
java
public static void printSymbolCodePoint(Appendable out, int codePoint) throws IOException { printCodePoint(out, codePoint, EscapeMode.ION_SYMBOL); }
[ "public", "static", "void", "printSymbolCodePoint", "(", "Appendable", "out", ",", "int", "codePoint", ")", "throws", "IOException", "{", "printCodePoint", "(", "out", ",", "codePoint", ",", "EscapeMode", ".", "ION_SYMBOL", ")", ";", "}" ]
Prints a single Unicode code point for use in an ASCII-safe Ion symbol. @param out the stream to receive the data. @param codePoint a Unicode code point.
[ "Prints", "a", "single", "Unicode", "code", "point", "for", "use", "in", "an", "ASCII", "-", "safe", "Ion", "symbol", "." ]
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/util/IonTextUtils.java#L212-L216
train
amzn/ion-java
src/com/amazon/ion/util/IonTextUtils.java
IonTextUtils.printJsonCodePoint
public static void printJsonCodePoint(Appendable out, int codePoint) throws IOException { // JSON only allows double-quote strings. printCodePoint(out, codePoint, EscapeMode.JSON); }
java
public static void printJsonCodePoint(Appendable out, int codePoint) throws IOException { // JSON only allows double-quote strings. printCodePoint(out, codePoint, EscapeMode.JSON); }
[ "public", "static", "void", "printJsonCodePoint", "(", "Appendable", "out", ",", "int", "codePoint", ")", "throws", "IOException", "{", "// JSON only allows double-quote strings.", "printCodePoint", "(", "out", ",", "codePoint", ",", "EscapeMode", ".", "JSON", ")", ...
Prints a single Unicode code point for use in an ASCII-safe JSON string. @param out the stream to receive the data. @param codePoint a Unicode code point.
[ "Prints", "a", "single", "Unicode", "code", "point", "for", "use", "in", "an", "ASCII", "-", "safe", "JSON", "string", "." ]
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/util/IonTextUtils.java#L224-L229
train
amzn/ion-java
src/com/amazon/ion/util/IonTextUtils.java
IonTextUtils.printCodePoint
private static void printCodePoint(Appendable out, int c, EscapeMode mode) throws IOException { // JSON only allows uHHHH numeric escapes. switch (c) { case 0: out.append(mode == EscapeMode.JSON ? "\\u0000" : "\\0"); return; case '\t': ...
java
private static void printCodePoint(Appendable out, int c, EscapeMode mode) throws IOException { // JSON only allows uHHHH numeric escapes. switch (c) { case 0: out.append(mode == EscapeMode.JSON ? "\\u0000" : "\\0"); return; case '\t': ...
[ "private", "static", "void", "printCodePoint", "(", "Appendable", "out", ",", "int", "c", ",", "EscapeMode", "mode", ")", "throws", "IOException", "{", "// JSON only allows uHHHH numeric escapes.", "switch", "(", "c", ")", "{", "case", "0", ":", "out", ".", "a...
Prints a single code point, ASCII safe.
[ "Prints", "a", "single", "code", "point", "ASCII", "safe", "." ]
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/util/IonTextUtils.java#L235-L331
train
amzn/ion-java
src/com/amazon/ion/util/IonTextUtils.java
IonTextUtils.printCodePointAsString
public static String printCodePointAsString(int codePoint) { StringBuilder builder = new StringBuilder(12); builder.append('"'); try { printStringCodePoint(builder, codePoint); } catch (IOException e) { // Shouldn't happen t...
java
public static String printCodePointAsString(int codePoint) { StringBuilder builder = new StringBuilder(12); builder.append('"'); try { printStringCodePoint(builder, codePoint); } catch (IOException e) { // Shouldn't happen t...
[ "public", "static", "String", "printCodePointAsString", "(", "int", "codePoint", ")", "{", "StringBuilder", "builder", "=", "new", "StringBuilder", "(", "12", ")", ";", "builder", ".", "append", "(", "'", "'", ")", ";", "try", "{", "printStringCodePoint", "(...
Builds a String denoting an ASCII-encoded Ion string, with double-quotes surrounding a single Unicode code point. @param codePoint a Unicode code point.
[ "Builds", "a", "String", "denoting", "an", "ASCII", "-", "encoded", "Ion", "string", "with", "double", "-", "quotes", "surrounding", "a", "single", "Unicode", "code", "point", "." ]
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/util/IonTextUtils.java#L547-L562
train
amzn/ion-java
src/com/amazon/ion/impl/bin/WriteBuffer.java
WriteBuffer.truncate
public void truncate(final long position) { final int index = index(position); final int offset = offset(position); final Block block = blocks.get(index); this.index = index; block.limit = offset; current = block; }
java
public void truncate(final long position) { final int index = index(position); final int offset = offset(position); final Block block = blocks.get(index); this.index = index; block.limit = offset; current = block; }
[ "public", "void", "truncate", "(", "final", "long", "position", ")", "{", "final", "int", "index", "=", "index", "(", "position", ")", ";", "final", "int", "offset", "=", "offset", "(", "position", ")", ";", "final", "Block", "block", "=", "blocks", "....
Resets the write buffer to a particular point.
[ "Resets", "the", "write", "buffer", "to", "a", "particular", "point", "." ]
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/bin/WriteBuffer.java#L85-L93
train
amzn/ion-java
src/com/amazon/ion/impl/bin/WriteBuffer.java
WriteBuffer.getUInt8At
public int getUInt8At(final long position) { final int index = index(position); final int offset = offset(position); final Block block = blocks.get(index); return block.data[offset] & OCTET_MASK; }
java
public int getUInt8At(final long position) { final int index = index(position); final int offset = offset(position); final Block block = blocks.get(index); return block.data[offset] & OCTET_MASK; }
[ "public", "int", "getUInt8At", "(", "final", "long", "position", ")", "{", "final", "int", "index", "=", "index", "(", "position", ")", ";", "final", "int", "offset", "=", "offset", "(", "position", ")", ";", "final", "Block", "block", "=", "blocks", "...
Returns the octet at the logical position given.
[ "Returns", "the", "octet", "at", "the", "logical", "position", "given", "." ]
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/bin/WriteBuffer.java#L110-L116
train
amzn/ion-java
src/com/amazon/ion/impl/bin/WriteBuffer.java
WriteBuffer.writeByte
public void writeByte(final byte octet) { if (remaining() < 1) { if (index == blocks.size() - 1) { allocateNewBlock(); } index++; current = blocks.get(index); } final Block block = current; block.data...
java
public void writeByte(final byte octet) { if (remaining() < 1) { if (index == blocks.size() - 1) { allocateNewBlock(); } index++; current = blocks.get(index); } final Block block = current; block.data...
[ "public", "void", "writeByte", "(", "final", "byte", "octet", ")", "{", "if", "(", "remaining", "(", ")", "<", "1", ")", "{", "if", "(", "index", "==", "blocks", ".", "size", "(", ")", "-", "1", ")", "{", "allocateNewBlock", "(", ")", ";", "}", ...
Writes a single octet to the buffer, expanding if necessary.
[ "Writes", "a", "single", "octet", "to", "the", "buffer", "expanding", "if", "necessary", "." ]
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/bin/WriteBuffer.java#L119-L133
train
amzn/ion-java
src/com/amazon/ion/impl/bin/WriteBuffer.java
WriteBuffer.writeBytesSlow
private void writeBytesSlow(final byte[] bytes, int off, int len) { while (len > 0) { final Block block = current; final int amount = Math.min(len, block.remaining()); System.arraycopy(bytes, off, block.data, block.limit, amount); block.limit += amount...
java
private void writeBytesSlow(final byte[] bytes, int off, int len) { while (len > 0) { final Block block = current; final int amount = Math.min(len, block.remaining()); System.arraycopy(bytes, off, block.data, block.limit, amount); block.limit += amount...
[ "private", "void", "writeBytesSlow", "(", "final", "byte", "[", "]", "bytes", ",", "int", "off", ",", "int", "len", ")", "{", "while", "(", "len", ">", "0", ")", "{", "final", "Block", "block", "=", "current", ";", "final", "int", "amount", "=", "M...
slow in the sense that we do all kind of block boundary checking
[ "slow", "in", "the", "sense", "that", "we", "do", "all", "kind", "of", "block", "boundary", "checking" ]
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/bin/WriteBuffer.java#L136-L157
train
amzn/ion-java
src/com/amazon/ion/impl/bin/WriteBuffer.java
WriteBuffer.writeBytes
public void writeBytes(final byte[] bytes, final int off, final int len) { if (len > remaining()) { writeBytesSlow(bytes, off, len); return; } final Block block = current; System.arraycopy(bytes, off, block.data, block.limit, len); block.limit...
java
public void writeBytes(final byte[] bytes, final int off, final int len) { if (len > remaining()) { writeBytesSlow(bytes, off, len); return; } final Block block = current; System.arraycopy(bytes, off, block.data, block.limit, len); block.limit...
[ "public", "void", "writeBytes", "(", "final", "byte", "[", "]", "bytes", ",", "final", "int", "off", ",", "final", "int", "len", ")", "{", "if", "(", "len", ">", "remaining", "(", ")", ")", "{", "writeBytesSlow", "(", "bytes", ",", "off", ",", "len...
Writes an array of bytes to the buffer expanding if necessary.
[ "Writes", "an", "array", "of", "bytes", "to", "the", "buffer", "expanding", "if", "necessary", "." ]
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/bin/WriteBuffer.java#L160-L171
train
amzn/ion-java
src/com/amazon/ion/impl/bin/WriteBuffer.java
WriteBuffer.writeUTF8Slow
private int writeUTF8Slow(final CharSequence chars, int off, int len) { int octets = 0; while (len > 0) { final char ch = chars.charAt(off); if (ch >= LOW_SURROGATE_FIRST && ch <= LOW_SURROGATE_LAST) { throw new IllegalArgumentException("Un...
java
private int writeUTF8Slow(final CharSequence chars, int off, int len) { int octets = 0; while (len > 0) { final char ch = chars.charAt(off); if (ch >= LOW_SURROGATE_FIRST && ch <= LOW_SURROGATE_LAST) { throw new IllegalArgumentException("Un...
[ "private", "int", "writeUTF8Slow", "(", "final", "CharSequence", "chars", ",", "int", "off", ",", "int", "len", ")", "{", "int", "octets", "=", "0", ";", "while", "(", "len", ">", "0", ")", "{", "final", "char", "ch", "=", "chars", ".", "charAt", "...
slow in the sense that we deal with any kind of UTF-8 sequence and block boundaries
[ "slow", "in", "the", "sense", "that", "we", "deal", "with", "any", "kind", "of", "UTF", "-", "8", "sequence", "and", "block", "boundaries" ]
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/bin/WriteBuffer.java#L205-L262
train
amzn/ion-java
src/com/amazon/ion/impl/bin/WriteBuffer.java
WriteBuffer.writeTo
public void writeTo(final OutputStream out) throws IOException { for (int i = 0; i <= index; i++) { Block block = blocks.get(i); out.write(block.data, 0, block.limit); } }
java
public void writeTo(final OutputStream out) throws IOException { for (int i = 0; i <= index; i++) { Block block = blocks.get(i); out.write(block.data, 0, block.limit); } }
[ "public", "void", "writeTo", "(", "final", "OutputStream", "out", ")", "throws", "IOException", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<=", "index", ";", "i", "++", ")", "{", "Block", "block", "=", "blocks", ".", "get", "(", "i", ")", ...
Write the entire buffer to output stream.
[ "Write", "the", "entire", "buffer", "to", "output", "stream", "." ]
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/bin/WriteBuffer.java#L1073-L1080
train
amzn/ion-java
src/com/amazon/ion/impl/bin/WriteBuffer.java
WriteBuffer.writeTo
public void writeTo(final OutputStream out, long position, long length) throws IOException { while (length > 0) { final int index = index(position); final int offset = offset(position); final Block block = blocks.get(index); final int amount = (int) Ma...
java
public void writeTo(final OutputStream out, long position, long length) throws IOException { while (length > 0) { final int index = index(position); final int offset = offset(position); final Block block = blocks.get(index); final int amount = (int) Ma...
[ "public", "void", "writeTo", "(", "final", "OutputStream", "out", ",", "long", "position", ",", "long", "length", ")", "throws", "IOException", "{", "while", "(", "length", ">", "0", ")", "{", "final", "int", "index", "=", "index", "(", "position", ")", ...
Write a specific segment of data from the buffer to a stream.
[ "Write", "a", "specific", "segment", "of", "data", "from", "the", "buffer", "to", "a", "stream", "." ]
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/bin/WriteBuffer.java#L1083-L1096
train
amzn/ion-java
src/com/amazon/ion/impl/_Private_IonTextAppender.java
_Private_IonTextAppender.forAppendable
public static _Private_IonTextAppender forAppendable(Appendable out) { _Private_FastAppendable fast = new AppendableFastAppendable(out); boolean escapeNonAscii = false; return new _Private_IonTextAppender(fast, escapeNonAscii); }
java
public static _Private_IonTextAppender forAppendable(Appendable out) { _Private_FastAppendable fast = new AppendableFastAppendable(out); boolean escapeNonAscii = false; return new _Private_IonTextAppender(fast, escapeNonAscii); }
[ "public", "static", "_Private_IonTextAppender", "forAppendable", "(", "Appendable", "out", ")", "{", "_Private_FastAppendable", "fast", "=", "new", "AppendableFastAppendable", "(", "out", ")", ";", "boolean", "escapeNonAscii", "=", "false", ";", "return", "new", "_P...
Doesn't escape non-ASCII characters.
[ "Doesn", "t", "escape", "non", "-", "ASCII", "characters", "." ]
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/_Private_IonTextAppender.java#L259-L264
train
amzn/ion-java
src/com/amazon/ion/impl/_Private_IonTextAppender.java
_Private_IonTextAppender.printString
public final void printString(CharSequence text) throws IOException { if (text == null) { appendAscii("null.string"); } else { appendAscii('"'); printCodePoints(text, STRING_ESCAPE_CODES); appendAscii('"'); } ...
java
public final void printString(CharSequence text) throws IOException { if (text == null) { appendAscii("null.string"); } else { appendAscii('"'); printCodePoints(text, STRING_ESCAPE_CODES); appendAscii('"'); } ...
[ "public", "final", "void", "printString", "(", "CharSequence", "text", ")", "throws", "IOException", "{", "if", "(", "text", "==", "null", ")", "{", "appendAscii", "(", "\"null.string\"", ")", ";", "}", "else", "{", "appendAscii", "(", "'", "'", ")", ";"...
Print an Ion String type @param text @throws IOException
[ "Print", "an", "Ion", "String", "type" ]
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/_Private_IonTextAppender.java#L342-L355
train
amzn/ion-java
src/com/amazon/ion/impl/_Private_IonTextAppender.java
_Private_IonTextAppender.printLongString
public final void printLongString(CharSequence text) throws IOException { if (text == null) { appendAscii("null.string"); } else { appendAscii(TRIPLE_QUOTES); printCodePoints(text, LONG_STRING_ESCAPE_CODES); appendAscii(...
java
public final void printLongString(CharSequence text) throws IOException { if (text == null) { appendAscii("null.string"); } else { appendAscii(TRIPLE_QUOTES); printCodePoints(text, LONG_STRING_ESCAPE_CODES); appendAscii(...
[ "public", "final", "void", "printLongString", "(", "CharSequence", "text", ")", "throws", "IOException", "{", "if", "(", "text", "==", "null", ")", "{", "appendAscii", "(", "\"null.string\"", ")", ";", "}", "else", "{", "appendAscii", "(", "TRIPLE_QUOTES", "...
Print an Ion triple-quoted string @param text @throws IOException
[ "Print", "an", "Ion", "triple", "-", "quoted", "string" ]
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/_Private_IonTextAppender.java#L362-L375
train
amzn/ion-java
src/com/amazon/ion/impl/_Private_IonTextAppender.java
_Private_IonTextAppender.printJsonString
public final void printJsonString(CharSequence text) throws IOException { if (text == null) { appendAscii("null"); } else { appendAscii('"'); printCodePoints(text, JSON_ESCAPE_CODES); appendAscii('"'); } }
java
public final void printJsonString(CharSequence text) throws IOException { if (text == null) { appendAscii("null"); } else { appendAscii('"'); printCodePoints(text, JSON_ESCAPE_CODES); appendAscii('"'); } }
[ "public", "final", "void", "printJsonString", "(", "CharSequence", "text", ")", "throws", "IOException", "{", "if", "(", "text", "==", "null", ")", "{", "appendAscii", "(", "\"null\"", ")", ";", "}", "else", "{", "appendAscii", "(", "'", "'", ")", ";", ...
Print a JSON string @param text @throws IOException
[ "Print", "a", "JSON", "string" ]
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/_Private_IonTextAppender.java#L382-L395
train
amzn/ion-java
src/com/amazon/ion/impl/_Private_IonTextAppender.java
_Private_IonTextAppender.printSymbol
public final void printSymbol(CharSequence text) throws IOException { if (text == null) { appendAscii("null.symbol"); } else if (symbolNeedsQuoting(text, true)) { appendAscii('\''); printCodePoints(text, SYMBOL_ESCAPE_CODES); ap...
java
public final void printSymbol(CharSequence text) throws IOException { if (text == null) { appendAscii("null.symbol"); } else if (symbolNeedsQuoting(text, true)) { appendAscii('\''); printCodePoints(text, SYMBOL_ESCAPE_CODES); ap...
[ "public", "final", "void", "printSymbol", "(", "CharSequence", "text", ")", "throws", "IOException", "{", "if", "(", "text", "==", "null", ")", "{", "appendAscii", "(", "\"null.symbol\"", ")", ";", "}", "else", "if", "(", "symbolNeedsQuoting", "(", "text", ...
Print an Ion Symbol type. This method will check if symbol needs quoting @param text @throws IOException
[ "Print", "an", "Ion", "Symbol", "type", ".", "This", "method", "will", "check", "if", "symbol", "needs", "quoting" ]
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/_Private_IonTextAppender.java#L535-L551
train
amzn/ion-java
src/com/amazon/ion/impl/_Private_IonTextAppender.java
_Private_IonTextAppender.printQuotedSymbol
public final void printQuotedSymbol(CharSequence text) throws IOException { if (text == null) { appendAscii("null.symbol"); } else { appendAscii('\''); printCodePoints(text, SYMBOL_ESCAPE_CODES); appendAscii('\''); ...
java
public final void printQuotedSymbol(CharSequence text) throws IOException { if (text == null) { appendAscii("null.symbol"); } else { appendAscii('\''); printCodePoints(text, SYMBOL_ESCAPE_CODES); appendAscii('\''); ...
[ "public", "final", "void", "printQuotedSymbol", "(", "CharSequence", "text", ")", "throws", "IOException", "{", "if", "(", "text", "==", "null", ")", "{", "appendAscii", "(", "\"null.symbol\"", ")", ";", "}", "else", "{", "appendAscii", "(", "'", "'", ")",...
Print single-quoted Ion Symbol type @param text @throws IOException
[ "Print", "single", "-", "quoted", "Ion", "Symbol", "type" ]
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/_Private_IonTextAppender.java#L558-L571
train
amzn/ion-java
src/com/amazon/ion/impl/IonReaderTextSystemX.java
IonReaderTextSystemX.getSymbolTable
@Override public SymbolTable getSymbolTable() { SymbolTable symtab = super.getSymbolTable(); if (symtab == null) { symtab = _system_symtab; } return symtab; }
java
@Override public SymbolTable getSymbolTable() { SymbolTable symtab = super.getSymbolTable(); if (symtab == null) { symtab = _system_symtab; } return symtab; }
[ "@", "Override", "public", "SymbolTable", "getSymbolTable", "(", ")", "{", "SymbolTable", "symtab", "=", "super", ".", "getSymbolTable", "(", ")", ";", "if", "(", "symtab", "==", "null", ")", "{", "symtab", "=", "_system_symtab", ";", "}", "return", "symta...
Horrible temporary hack. @return not null.
[ "Horrible", "temporary", "hack", "." ]
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/IonReaderTextSystemX.java#L605-L614
train
amzn/ion-java
src/com/amazon/ion/impl/bin/_Private_IonManagedBinaryWriterBuilder.java
_Private_IonManagedBinaryWriterBuilder.withFlatImports
public _Private_IonManagedBinaryWriterBuilder withFlatImports(final SymbolTable... tables) { if (tables != null) { return withFlatImports(Arrays.asList(tables)); } return this; }
java
public _Private_IonManagedBinaryWriterBuilder withFlatImports(final SymbolTable... tables) { if (tables != null) { return withFlatImports(Arrays.asList(tables)); } return this; }
[ "public", "_Private_IonManagedBinaryWriterBuilder", "withFlatImports", "(", "final", "SymbolTable", "...", "tables", ")", "{", "if", "(", "tables", "!=", "null", ")", "{", "return", "withFlatImports", "(", "Arrays", ".", "asList", "(", "tables", ")", ")", ";", ...
Adds imports, flattening them to make lookup more efficient. This is particularly useful when a builder instance is long lived.
[ "Adds", "imports", "flattening", "them", "to", "make", "lookup", "more", "efficient", ".", "This", "is", "particularly", "useful", "when", "a", "builder", "instance", "is", "long", "lived", "." ]
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/bin/_Private_IonManagedBinaryWriterBuilder.java#L152-L159
train
amzn/ion-java
src/com/amazon/ion/impl/_Private_IonWriterBase.java
_Private_IonWriterBase.writeValue
public void writeValue(IonReader reader) throws IOException { // TODO this should do symtab optimization as per writeValues() IonType type = reader.getType(); writeValueRecursively(type, reader); }
java
public void writeValue(IonReader reader) throws IOException { // TODO this should do symtab optimization as per writeValues() IonType type = reader.getType(); writeValueRecursively(type, reader); }
[ "public", "void", "writeValue", "(", "IonReader", "reader", ")", "throws", "IOException", "{", "// TODO this should do symtab optimization as per writeValues()", "IonType", "type", "=", "reader", ".", "getType", "(", ")", ";", "writeValueRecursively", "(", "type", ",", ...
Overrides can optimize special cases.
[ "Overrides", "can", "optimize", "special", "cases", "." ]
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/_Private_IonWriterBase.java#L355-L360
train
amzn/ion-java
src/com/amazon/ion/impl/lite/IonValueLite.java
IonValueLite.attemptClearSymbolIDValues
boolean attemptClearSymbolIDValues() { boolean sidsRemain = false; if (_fieldName != null) { _fieldId = UNKNOWN_SYMBOL_ID; } else if (_fieldId > UNKNOWN_SYMBOL_ID) { // retaining the field SID, as it couldn't be cleared due to loss of context ...
java
boolean attemptClearSymbolIDValues() { boolean sidsRemain = false; if (_fieldName != null) { _fieldId = UNKNOWN_SYMBOL_ID; } else if (_fieldId > UNKNOWN_SYMBOL_ID) { // retaining the field SID, as it couldn't be cleared due to loss of context ...
[ "boolean", "attemptClearSymbolIDValues", "(", ")", "{", "boolean", "sidsRemain", "=", "false", ";", "if", "(", "_fieldName", "!=", "null", ")", "{", "_fieldId", "=", "UNKNOWN_SYMBOL_ID", ";", "}", "else", "if", "(", "_fieldId", ">", "UNKNOWN_SYMBOL_ID", ")", ...
Sets this value's symbol table to null, and erases any SIDs here and recursively. @return true if all SID's have been successfully removed, otherwise false
[ "Sets", "this", "value", "s", "symbol", "table", "to", "null", "and", "erases", "any", "SIDs", "here", "and", "recursively", "." ]
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/lite/IonValueLite.java#L538-L571
train
amzn/ion-java
src/com/amazon/ion/impl/lite/IonValueLite.java
IonValueLite.setFieldNameSymbol
final void setFieldNameSymbol(SymbolToken name) { assert _fieldId == UNKNOWN_SYMBOL_ID && _fieldName == null; _fieldName = name.getText(); _fieldId = name.getSid(); // if a SID has been added by this operation to a previously SID-less node we have to mark upwards // toward...
java
final void setFieldNameSymbol(SymbolToken name) { assert _fieldId == UNKNOWN_SYMBOL_ID && _fieldName == null; _fieldName = name.getText(); _fieldId = name.getSid(); // if a SID has been added by this operation to a previously SID-less node we have to mark upwards // toward...
[ "final", "void", "setFieldNameSymbol", "(", "SymbolToken", "name", ")", "{", "assert", "_fieldId", "==", "UNKNOWN_SYMBOL_ID", "&&", "_fieldName", "==", "null", ";", "_fieldName", "=", "name", ".", "getText", "(", ")", ";", "_fieldId", "=", "name", ".", "getS...
Sets the field name and ID based on a SymbolToken. Both parts of the SymbolToken are trusted! @param name is not retained by this value, but both fields are copied.
[ "Sets", "the", "field", "name", "and", "ID", "based", "on", "a", "SymbolToken", ".", "Both", "parts", "of", "the", "SymbolToken", "are", "trusted!" ]
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/lite/IonValueLite.java#L598-L609
train
amzn/ion-java
src/com/amazon/ion/impl/lite/IonValueLite.java
IonValueLite.detachFromContainer
final void detachFromContainer() // throws IOException { checkForLock(); clearSymbolIDValues(); _context = ContainerlessContext.wrap(getSystem()); _fieldName = null; _fieldId = UNKNOWN_SYMBOL_ID; _elementid(0); }
java
final void detachFromContainer() // throws IOException { checkForLock(); clearSymbolIDValues(); _context = ContainerlessContext.wrap(getSystem()); _fieldName = null; _fieldId = UNKNOWN_SYMBOL_ID; _elementid(0); }
[ "final", "void", "detachFromContainer", "(", ")", "// throws IOException", "{", "checkForLock", "(", ")", ";", "clearSymbolIDValues", "(", ")", ";", "_context", "=", "ContainerlessContext", ".", "wrap", "(", "getSystem", "(", ")", ")", ";", "_fieldName", "=", ...
Removes this value from its container, ensuring that all data stays available. Dirties this value and it's original container.
[ "Removes", "this", "value", "from", "its", "container", "ensuring", "that", "all", "data", "stays", "available", ".", "Dirties", "this", "value", "and", "it", "s", "original", "container", "." ]
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/lite/IonValueLite.java#L1080-L1090
train
amzn/ion-java
src/com/amazon/ion/impl/IonUTF8.java
IonUTF8.convertToUTF8Bytes
public final static int convertToUTF8Bytes(int unicodeScalar, byte[] outputBytes, int offset, int maxLength) { int dst = offset; int end = offset + maxLength; switch (getUTF8ByteCount(unicodeScalar)) { case 1: if (dst >= end) throw new ArrayIndexOutOfBoundsException(); ...
java
public final static int convertToUTF8Bytes(int unicodeScalar, byte[] outputBytes, int offset, int maxLength) { int dst = offset; int end = offset + maxLength; switch (getUTF8ByteCount(unicodeScalar)) { case 1: if (dst >= end) throw new ArrayIndexOutOfBoundsException(); ...
[ "public", "final", "static", "int", "convertToUTF8Bytes", "(", "int", "unicodeScalar", ",", "byte", "[", "]", "outputBytes", ",", "int", "offset", ",", "int", "maxLength", ")", "{", "int", "dst", "=", "offset", ";", "int", "end", "=", "offset", "+", "max...
this helper converts the unicodeScalar to a sequence of utf8 bytes and copies those bytes into the supplied outputBytes array. If there is insufficient room in the array to hold the generated bytes it will throw an ArrayIndexOutOfBoundsException. It does not check for the validity of the passed in unicodeScalar thoro...
[ "this", "helper", "converts", "the", "unicodeScalar", "to", "a", "sequence", "of", "utf8", "bytes", "and", "copies", "those", "bytes", "into", "the", "supplied", "outputBytes", "array", ".", "If", "there", "is", "insufficient", "room", "in", "the", "array", ...
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/IonUTF8.java#L209-L239
train
amzn/ion-java
src/com/amazon/ion/impl/SimpleByteBuffer.java
SimpleByteBuffer.getBytes
public byte[] getBytes() { int length = _eob - _start; byte[] copy = new byte[length]; System.arraycopy(_bytes, _start, copy, 0, length); return copy; }
java
public byte[] getBytes() { int length = _eob - _start; byte[] copy = new byte[length]; System.arraycopy(_bytes, _start, copy, 0, length); return copy; }
[ "public", "byte", "[", "]", "getBytes", "(", ")", "{", "int", "length", "=", "_eob", "-", "_start", ";", "byte", "[", "]", "copy", "=", "new", "byte", "[", "length", "]", ";", "System", ".", "arraycopy", "(", "_bytes", ",", "_start", ",", "copy", ...
Makes a copy of the internal byte array.
[ "Makes", "a", "copy", "of", "the", "internal", "byte", "array", "." ]
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/SimpleByteBuffer.java#L90-L96
train
amzn/ion-java
src/com/amazon/ion/impl/bin/IonRawBinaryWriter.java
IonRawBinaryWriter.prepareValue
private void prepareValue() { if (isInStruct() && currentFieldSid == null) { throw new IllegalStateException("IonWriter.setFieldName() must be called before writing a value into a struct."); } if (currentFieldSid != null) { checkSid(currentFieldSid); ...
java
private void prepareValue() { if (isInStruct() && currentFieldSid == null) { throw new IllegalStateException("IonWriter.setFieldName() must be called before writing a value into a struct."); } if (currentFieldSid != null) { checkSid(currentFieldSid); ...
[ "private", "void", "prepareValue", "(", ")", "{", "if", "(", "isInStruct", "(", ")", "&&", "currentFieldSid", "==", "null", ")", "{", "throw", "new", "IllegalStateException", "(", "\"IonWriter.setFieldName() must be called before writing a value into a struct.\"", ")", ...
prepare to write values with field name and annotations.
[ "prepare", "to", "write", "values", "with", "field", "name", "and", "annotations", "." ]
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/bin/IonRawBinaryWriter.java#L780-L825
train
amzn/ion-java
src/com/amazon/ion/impl/bin/IonRawBinaryWriter.java
IonRawBinaryWriter.finishValue
private void finishValue() { final ContainerInfo current = currentContainer(); if (current != null && current.type == ContainerType.ANNOTATION) { // close out and patch the length popContainer(); } hasWrittenValuesSinceFinished = true; hasWritt...
java
private void finishValue() { final ContainerInfo current = currentContainer(); if (current != null && current.type == ContainerType.ANNOTATION) { // close out and patch the length popContainer(); } hasWrittenValuesSinceFinished = true; hasWritt...
[ "private", "void", "finishValue", "(", ")", "{", "final", "ContainerInfo", "current", "=", "currentContainer", "(", ")", ";", "if", "(", "current", "!=", "null", "&&", "current", ".", "type", "==", "ContainerType", ".", "ANNOTATION", ")", "{", "// close out ...
Closes out annotations.
[ "Closes", "out", "annotations", "." ]
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/bin/IonRawBinaryWriter.java#L828-L838
train
amzn/ion-java
src/com/amazon/ion/impl/bin/Symbols.java
Symbols.symbol
public static SymbolToken symbol(final String name, final int val) { if (name == null) { throw new NullPointerException(); } if (val <= 0) { throw new IllegalArgumentException("Symbol value must be positive: " + val); } return new SymbolToken() { public String getText() ...
java
public static SymbolToken symbol(final String name, final int val) { if (name == null) { throw new NullPointerException(); } if (val <= 0) { throw new IllegalArgumentException("Symbol value must be positive: " + val); } return new SymbolToken() { public String getText() ...
[ "public", "static", "SymbolToken", "symbol", "(", "final", "String", "name", ",", "final", "int", "val", ")", "{", "if", "(", "name", "==", "null", ")", "{", "throw", "new", "NullPointerException", "(", ")", ";", "}", "if", "(", "val", "<=", "0", ")"...
Constructs a token with a non-null name and positive value.
[ "Constructs", "a", "token", "with", "a", "non", "-", "null", "name", "and", "positive", "value", "." ]
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/bin/Symbols.java#L59-L87
train
amzn/ion-java
src/com/amazon/ion/impl/bin/Symbols.java
Symbols.symbolNameIterator
public static Iterator<String> symbolNameIterator(final Iterator<SymbolToken> tokenIter) { return new Iterator<String>() { public boolean hasNext() { return tokenIter.hasNext(); } public String next() { retu...
java
public static Iterator<String> symbolNameIterator(final Iterator<SymbolToken> tokenIter) { return new Iterator<String>() { public boolean hasNext() { return tokenIter.hasNext(); } public String next() { retu...
[ "public", "static", "Iterator", "<", "String", ">", "symbolNameIterator", "(", "final", "Iterator", "<", "SymbolToken", ">", "tokenIter", ")", "{", "return", "new", "Iterator", "<", "String", ">", "(", ")", "{", "public", "boolean", "hasNext", "(", ")", "{...
Lazy iterator over the symbol names of an iterator of symbol tokens.
[ "Lazy", "iterator", "over", "the", "symbol", "names", "of", "an", "iterator", "of", "symbol", "tokens", "." ]
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/bin/Symbols.java#L90-L109
train
amzn/ion-java
src/com/amazon/ion/impl/bin/Symbols.java
Symbols.systemSymbol
public static SymbolToken systemSymbol(final int sid) { if (sid < 1 || sid > ION_1_0_MAX_ID) { throw new IllegalArgumentException("No such system SID: " + sid); } return SYSTEM_TOKENS.get(sid - 1); }
java
public static SymbolToken systemSymbol(final int sid) { if (sid < 1 || sid > ION_1_0_MAX_ID) { throw new IllegalArgumentException("No such system SID: " + sid); } return SYSTEM_TOKENS.get(sid - 1); }
[ "public", "static", "SymbolToken", "systemSymbol", "(", "final", "int", "sid", ")", "{", "if", "(", "sid", "<", "1", "||", "sid", ">", "ION_1_0_MAX_ID", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"No such system SID: \"", "+", "sid", ")", "...
Returns a symbol token for a system SID.
[ "Returns", "a", "symbol", "token", "for", "a", "system", "SID", "." ]
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/bin/Symbols.java#L126-L132
train
amzn/ion-java
src/com/amazon/ion/impl/bin/Symbols.java
Symbols.unknownSharedSymbolTable
public static SymbolTable unknownSharedSymbolTable(final String name, final int version, final int maxId) { return new AbstractSymbolTable(name, version) { public Iterator<Strin...
java
public static SymbolTable unknownSharedSymbolTable(final String name, final int version, final int maxId) { return new AbstractSymbolTable(name, version) { public Iterator<Strin...
[ "public", "static", "SymbolTable", "unknownSharedSymbolTable", "(", "final", "String", "name", ",", "final", "int", "version", ",", "final", "int", "maxId", ")", "{", "return", "new", "AbstractSymbolTable", "(", "name", ",", "version", ")", "{", "public", "Ite...
Returns a substitute shared symbol table where none of the symbols are known.
[ "Returns", "a", "substitute", "shared", "symbol", "table", "where", "none", "of", "the", "symbols", "are", "known", "." ]
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/bin/Symbols.java#L239-L338
train
amzn/ion-java
src/com/amazon/ion/impl/_Private_CommandLine.java
_Private_CommandLine.main
public static void main(String[] args) throws IOException { process_command_line(args); info = new JarInfo(); if (printVersion) { doPrintVersion(); } if (printHelp) { doPrintHelp(); } }
java
public static void main(String[] args) throws IOException { process_command_line(args); info = new JarInfo(); if (printVersion) { doPrintVersion(); } if (printHelp) { doPrintHelp(); } }
[ "public", "static", "void", "main", "(", "String", "[", "]", "args", ")", "throws", "IOException", "{", "process_command_line", "(", "args", ")", ";", "info", "=", "new", "JarInfo", "(", ")", ";", "if", "(", "printVersion", ")", "{", "doPrintVersion", "(...
This main simply prints the version information to allow users to identify the build version of the Jar. @param args user command line flags
[ "This", "main", "simply", "prints", "the", "version", "information", "to", "allow", "users", "to", "identify", "the", "build", "version", "of", "the", "Jar", "." ]
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/_Private_CommandLine.java#L45-L57
train
amzn/ion-java
src/com/amazon/ion/system/SystemFactory.java
SystemFactory.newSystem
@Deprecated public static IonSystem newSystem(IonCatalog catalog) { return IonSystemBuilder.standard().withCatalog(catalog).build(); }
java
@Deprecated public static IonSystem newSystem(IonCatalog catalog) { return IonSystemBuilder.standard().withCatalog(catalog).build(); }
[ "@", "Deprecated", "public", "static", "IonSystem", "newSystem", "(", "IonCatalog", "catalog", ")", "{", "return", "IonSystemBuilder", ".", "standard", "(", ")", ".", "withCatalog", "(", "catalog", ")", ".", "build", "(", ")", ";", "}" ]
Constructs a new system instance with the given catalog. @param catalog the catalog to use in the new system. If null, a new {@link SimpleCatalog} will be used. @return a new {@link IonSystem} instance; not null. @deprecated Use {@link IonSystemBuilder IonSystemBuilder.standard().withCatalog(catalog).build()} instead...
[ "Constructs", "a", "new", "system", "instance", "with", "the", "given", "catalog", "." ]
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/system/SystemFactory.java#L61-L65
train
amzn/ion-java
src/com/amazon/ion/impl/IonReaderTextRawX.java
IonReaderTextRawX.tokenValueIsFinished
protected void tokenValueIsFinished() { _scanner.tokenIsFinished(); if (IonType.BLOB.equals(_value_type) || IonType.CLOB.equals(_value_type)) { int state_after_scalar = get_state_after_value(); set_state(state_after_scalar); } }
java
protected void tokenValueIsFinished() { _scanner.tokenIsFinished(); if (IonType.BLOB.equals(_value_type) || IonType.CLOB.equals(_value_type)) { int state_after_scalar = get_state_after_value(); set_state(state_after_scalar); } }
[ "protected", "void", "tokenValueIsFinished", "(", ")", "{", "_scanner", ".", "tokenIsFinished", "(", ")", ";", "if", "(", "IonType", ".", "BLOB", ".", "equals", "(", "_value_type", ")", "||", "IonType", ".", "CLOB", ".", "equals", "(", "_value_type", ")", ...
called by super classes to tell us that the current token has been consumed.
[ "called", "by", "super", "classes", "to", "tell", "us", "that", "the", "current", "token", "has", "been", "consumed", "." ]
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/IonReaderTextRawX.java#L1181-L1189
train
amzn/ion-java
src/com/amazon/ion/impl/IonReaderTextRawX.java
IonReaderTextRawX.isInStruct
public boolean isInStruct() { boolean in_struct = false; IonType container = getContainerType(); if (IonType.STRUCT.equals(container)) { if (getDepth() > 0) { in_struct = true; } else { assert(IonType.STRUCT.equals(_nesting_...
java
public boolean isInStruct() { boolean in_struct = false; IonType container = getContainerType(); if (IonType.STRUCT.equals(container)) { if (getDepth() > 0) { in_struct = true; } else { assert(IonType.STRUCT.equals(_nesting_...
[ "public", "boolean", "isInStruct", "(", ")", "{", "boolean", "in_struct", "=", "false", ";", "IonType", "container", "=", "getContainerType", "(", ")", ";", "if", "(", "IonType", ".", "STRUCT", ".", "equals", "(", "container", ")", ")", "{", "if", "(", ...
we're not really in a struct, we at the top level
[ "we", "re", "not", "really", "in", "a", "struct", "we", "at", "the", "top", "level" ]
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/IonReaderTextRawX.java#L1226-L1239
train
amzn/ion-java
src/com/amazon/ion/impl/IonReaderTextRawX.java
IonReaderTextRawX.is_in_struct_internal
private boolean is_in_struct_internal() { boolean in_struct = false; IonType container = getContainerType(); if (IonType.STRUCT.equals(container)) { in_struct = true; } return in_struct; }
java
private boolean is_in_struct_internal() { boolean in_struct = false; IonType container = getContainerType(); if (IonType.STRUCT.equals(container)) { in_struct = true; } return in_struct; }
[ "private", "boolean", "is_in_struct_internal", "(", ")", "{", "boolean", "in_struct", "=", "false", ";", "IonType", "container", "=", "getContainerType", "(", ")", ";", "if", "(", "IonType", ".", "STRUCT", ".", "equals", "(", "container", ")", ")", "{", "i...
have to ignore
[ "have", "to", "ignore" ]
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/IonReaderTextRawX.java#L1244-L1252
train
amzn/ion-java
src/com/amazon/ion/impl/UnifiedInputStreamX.java
UnifiedInputStreamX.getPosition
public long getPosition() { long file_pos = 0; UnifiedDataPageX page = _buffer.getCurrentPage(); if (page != null) { file_pos = page.getFilePosition(_pos); } return file_pos; }
java
public long getPosition() { long file_pos = 0; UnifiedDataPageX page = _buffer.getCurrentPage(); if (page != null) { file_pos = page.getFilePosition(_pos); } return file_pos; }
[ "public", "long", "getPosition", "(", ")", "{", "long", "file_pos", "=", "0", ";", "UnifiedDataPageX", "page", "=", "_buffer", ".", "getCurrentPage", "(", ")", ";", "if", "(", "page", "!=", "null", ")", "{", "file_pos", "=", "page", ".", "getFilePosition...
used to find the current position of this stream in the input source. @return current "file" position
[ "used", "to", "find", "the", "current", "position", "of", "this", "stream", "in", "the", "input", "source", "." ]
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/UnifiedInputStreamX.java#L148-L155
train
amzn/ion-java
src/com/amazon/ion/impl/UnifiedInputStreamX.java
UnifiedInputStreamX.read
public final int read(byte[] dst, int offset, int length) throws IOException { if (!is_byte_data()) { throw new IOException("byte read is not support over character sources"); } int remaining = length; while (remaining > 0 && !isEOF()) { int ready = _limit - _...
java
public final int read(byte[] dst, int offset, int length) throws IOException { if (!is_byte_data()) { throw new IOException("byte read is not support over character sources"); } int remaining = length; while (remaining > 0 && !isEOF()) { int ready = _limit - _...
[ "public", "final", "int", "read", "(", "byte", "[", "]", "dst", ",", "int", "offset", ",", "int", "length", ")", "throws", "IOException", "{", "if", "(", "!", "is_byte_data", "(", ")", ")", "{", "throw", "new", "IOException", "(", "\"byte read is not sup...
It is unclear what the implication to the rest of the system to make it 'conform'
[ "It", "is", "unclear", "what", "the", "implication", "to", "the", "rest", "of", "the", "system", "to", "make", "it", "conform" ]
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/UnifiedInputStreamX.java#L365-L385
train
amzn/ion-java
src/com/amazon/ion/impl/UnifiedInputStreamX.java
UnifiedInputStreamX.refill
protected int refill() throws IOException { UnifiedDataPageX curr = _buffer.getCurrentPage(); SavePoint sp = _save_points.savePointActiveTop(); if (!can_fill_new_page()) { // aka: there can be only one! // (and it's used up) return refill_is_eof(); ...
java
protected int refill() throws IOException { UnifiedDataPageX curr = _buffer.getCurrentPage(); SavePoint sp = _save_points.savePointActiveTop(); if (!can_fill_new_page()) { // aka: there can be only one! // (and it's used up) return refill_is_eof(); ...
[ "protected", "int", "refill", "(", ")", "throws", "IOException", "{", "UnifiedDataPageX", "curr", "=", "_buffer", ".", "getCurrentPage", "(", ")", ";", "SavePoint", "sp", "=", "_save_points", ".", "savePointActiveTop", "(", ")", ";", "if", "(", "!", "can_fil...
the refill method is the key override that is filled in by the various subclasses. It fills either the byte or char array with a block of data from the input source. As this is a virtual function the right version will get called for each source type. Since it is only called once per block, and from then on the fina...
[ "the", "refill", "method", "is", "the", "key", "override", "that", "is", "filled", "in", "by", "the", "various", "subclasses", ".", "It", "fills", "either", "the", "byte", "or", "char", "array", "with", "a", "block", "of", "data", "from", "the", "input",...
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/UnifiedInputStreamX.java#L412-L492
train
amzn/ion-java
src/com/amazon/ion/impl/BlockedBuffer.java
BlockedBuffer.init
private bbBlock init(int initialSize, bbBlock initialBlock) { this._lastCapacity = BlockedBuffer._defaultBlockSizeMin; this._blockSizeUpperLimit = BlockedBuffer._defaultBlockSizeUpperLimit; while (this._lastCapacity < initialSize && this._lastCapacity < this._blockSizeUpperLim...
java
private bbBlock init(int initialSize, bbBlock initialBlock) { this._lastCapacity = BlockedBuffer._defaultBlockSizeMin; this._blockSizeUpperLimit = BlockedBuffer._defaultBlockSizeUpperLimit; while (this._lastCapacity < initialSize && this._lastCapacity < this._blockSizeUpperLim...
[ "private", "bbBlock", "init", "(", "int", "initialSize", ",", "bbBlock", "initialBlock", ")", "{", "this", ".", "_lastCapacity", "=", "BlockedBuffer", ".", "_defaultBlockSizeMin", ";", "this", ".", "_blockSizeUpperLimit", "=", "BlockedBuffer", ".", "_defaultBlockSiz...
Initializes the various members such as the block arraylist the initial block and the various values like the block size upper limit. @param initialSize or 0 @param initialBlock or null @return bbBlock the initial current block
[ "Initializes", "the", "various", "members", "such", "as", "the", "block", "arraylist", "the", "initial", "block", "and", "the", "various", "values", "like", "the", "block", "size", "upper", "limit", "." ]
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/BlockedBuffer.java#L205-L233
train
amzn/ion-java
src/com/amazon/ion/impl/BlockedBuffer.java
BlockedBuffer.clear
private void clear(Object caller, int version) { assert mutation_in_progress(caller, version); _buf_limit = 0; for (int ii=0; ii<_blocks.size(); ii++) { _blocks.get(ii).clearBlock(); // _blocks.get(ii)._idx = -1; this is done in clearBlock() } bbBlock firs...
java
private void clear(Object caller, int version) { assert mutation_in_progress(caller, version); _buf_limit = 0; for (int ii=0; ii<_blocks.size(); ii++) { _blocks.get(ii).clearBlock(); // _blocks.get(ii)._idx = -1; this is done in clearBlock() } bbBlock firs...
[ "private", "void", "clear", "(", "Object", "caller", ",", "int", "version", ")", "{", "assert", "mutation_in_progress", "(", "caller", ",", "version", ")", ";", "_buf_limit", "=", "0", ";", "for", "(", "int", "ii", "=", "0", ";", "ii", "<", "_blocks", ...
empties the entire contents of the buffer
[ "empties", "the", "entire", "contents", "of", "the", "buffer" ]
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/BlockedBuffer.java#L244-L257
train
amzn/ion-java
src/com/amazon/ion/impl/BlockedBuffer.java
BlockedBuffer.truncate
bbBlock truncate(Object caller, int version, int pos) { assert mutation_in_progress(caller, version); if (0 > pos || pos > this._buf_limit ) throw new IllegalArgumentException(); // clear out all the blocks in use from the last in use // to the block where the eof will be loc...
java
bbBlock truncate(Object caller, int version, int pos) { assert mutation_in_progress(caller, version); if (0 > pos || pos > this._buf_limit ) throw new IllegalArgumentException(); // clear out all the blocks in use from the last in use // to the block where the eof will be loc...
[ "bbBlock", "truncate", "(", "Object", "caller", ",", "int", "version", ",", "int", "pos", ")", "{", "assert", "mutation_in_progress", "(", "caller", ",", "version", ")", ";", "if", "(", "0", ">", "pos", "||", "pos", ">", "this", ".", "_buf_limit", ")",...
treat the limit as the end of file
[ "treat", "the", "limit", "as", "the", "end", "of", "file" ]
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/BlockedBuffer.java#L261-L284
train
amzn/ion-java
src/com/amazon/ion/impl/BlockedBuffer.java
BlockedBuffer.insert
int insert(Object caller, int version, bbBlock curr, int pos, int len) { assert mutation_in_progress(caller, version); // DEBUG: int amountMoved = 0; // DEBUG: int before = this._buf_limit; // DEBUG: assert _validate(); // if there's room in the current block - just /...
java
int insert(Object caller, int version, bbBlock curr, int pos, int len) { assert mutation_in_progress(caller, version); // DEBUG: int amountMoved = 0; // DEBUG: int before = this._buf_limit; // DEBUG: assert _validate(); // if there's room in the current block - just /...
[ "int", "insert", "(", "Object", "caller", ",", "int", "version", ",", "bbBlock", "curr", ",", "int", "pos", ",", "int", "len", ")", "{", "assert", "mutation_in_progress", "(", "caller", ",", "version", ")", ";", "// DEBUG: int amountMoved = 0;", "// DEBUG: int...
dispatcher for the various forms of insert we encounter calls one of the four helpers depending on the case that is needed to inser here @param len number of bytes to make space for @return int number of bytes inserted
[ "dispatcher", "for", "the", "various", "forms", "of", "insert", "we", "encounter", "calls", "one", "of", "the", "four", "helpers", "depending", "on", "the", "case", "that", "is", "needed", "to", "inser", "here" ]
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/BlockedBuffer.java#L486-L559
train
amzn/ion-java
src/com/amazon/ion/impl/BlockedBuffer.java
BlockedBuffer.insertInCurrOnly
private int insertInCurrOnly(Object caller, int version, bbBlock curr, int pos, int len) { assert mutation_in_progress(caller, version); // the space we need is available right in the block assert curr.unusedBlockCapacity() >= len; System.arraycopy(curr._buffer, curr.blockOffsetFromA...
java
private int insertInCurrOnly(Object caller, int version, bbBlock curr, int pos, int len) { assert mutation_in_progress(caller, version); // the space we need is available right in the block assert curr.unusedBlockCapacity() >= len; System.arraycopy(curr._buffer, curr.blockOffsetFromA...
[ "private", "int", "insertInCurrOnly", "(", "Object", "caller", ",", "int", "version", ",", "bbBlock", "curr", ",", "int", "pos", ",", "int", "len", ")", "{", "assert", "mutation_in_progress", "(", "caller", ",", "version", ")", ";", "// the space we need is av...
this handles insert when there's enough room in the current block
[ "this", "handles", "insert", "when", "there", "s", "enough", "room", "in", "the", "current", "block" ]
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/BlockedBuffer.java#L564-L575
train
amzn/ion-java
src/com/amazon/ion/impl/IonReaderBinaryRawX.java
IonReaderBinaryRawX.readVarInt
private int readVarInt(int firstByte) throws IOException { // VarInt uses the high-order bit of the last octet as a marker; some (but not all) 5-byte VarInts can fit // into a Java int. // To validate overflows we accumulate the VarInt in a long and then check if it can be represented by an int ...
java
private int readVarInt(int firstByte) throws IOException { // VarInt uses the high-order bit of the last octet as a marker; some (but not all) 5-byte VarInts can fit // into a Java int. // To validate overflows we accumulate the VarInt in a long and then check if it can be represented by an int ...
[ "private", "int", "readVarInt", "(", "int", "firstByte", ")", "throws", "IOException", "{", "// VarInt uses the high-order bit of the last octet as a marker; some (but not all) 5-byte VarInts can fit", "// into a Java int.", "// To validate overflows we accumulate the VarInt in a long and th...
reads a varInt after the first byte was read. The first byte is used to specify the sign and -0 has different representation on the protected API that was called @param firstByte last varInt octet
[ "reads", "a", "varInt", "after", "the", "first", "byte", "was", "read", ".", "The", "first", "byte", "is", "used", "to", "specify", "the", "sign", "and", "-", "0", "has", "different", "representation", "on", "the", "protected", "API", "that", "was", "cal...
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/IonReaderBinaryRawX.java#L929-L983
train
amzn/ion-java
src/com/amazon/ion/impl/IonTokenReader.java
IonTokenReader.next
public Type next(boolean is_in_expression) throws IOException { inQuotedContent = false; int c = this.readIgnoreWhitespace(); return next(c, is_in_expression); }
java
public Type next(boolean is_in_expression) throws IOException { inQuotedContent = false; int c = this.readIgnoreWhitespace(); return next(c, is_in_expression); }
[ "public", "Type", "next", "(", "boolean", "is_in_expression", ")", "throws", "IOException", "{", "inQuotedContent", "=", "false", ";", "int", "c", "=", "this", ".", "readIgnoreWhitespace", "(", ")", ";", "return", "next", "(", "c", ",", "is_in_expression", "...
Java handles the tail optimization)
[ "Java", "handles", "the", "tail", "optimization", ")" ]
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/IonTokenReader.java#L464-L468
train
amzn/ion-java
src/com/amazon/ion/impl/IonTokenReader.java
IonTokenReader.twoMoreSingleQuotes
private boolean twoMoreSingleQuotes() throws IOException { int c = read(); if (c == '\'') { int c2 = read(); if (c2 == '\'') { return true; } unread(c2); } unread(c); return false; }
java
private boolean twoMoreSingleQuotes() throws IOException { int c = read(); if (c == '\'') { int c2 = read(); if (c2 == '\'') { return true; } unread(c2); } unread(c); return false; }
[ "private", "boolean", "twoMoreSingleQuotes", "(", ")", "throws", "IOException", "{", "int", "c", "=", "read", "(", ")", ";", "if", "(", "c", "==", "'", "'", ")", "{", "int", "c2", "=", "read", "(", ")", ";", "if", "(", "c2", "==", "'", "'", ")"...
If two single quotes are next on the input, consume them and return true. Otherwise, leave them on the input and return false. @return true when there are two pending single quotes. @throws IOException
[ "If", "two", "single", "quotes", "are", "next", "on", "the", "input", "consume", "them", "and", "return", "true", ".", "Otherwise", "leave", "them", "on", "the", "input", "and", "return", "false", "." ]
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/IonTokenReader.java#L1065-L1077
train
amzn/ion-java
src/com/amazon/ion/impl/IonTokenConstsX.java
IonTokenConstsX.typeNameKeyWordFromMask
public final static int typeNameKeyWordFromMask(int possible_names, int length) { int kw = KEYWORD_unrecognized; if (possible_names != IonTokenConstsX.KW_ALL_BITS) { for (int ii=0; ii<typeNameBits.length; ii++) { int tb = typeNameBits[ii]; if (tb == possible_n...
java
public final static int typeNameKeyWordFromMask(int possible_names, int length) { int kw = KEYWORD_unrecognized; if (possible_names != IonTokenConstsX.KW_ALL_BITS) { for (int ii=0; ii<typeNameBits.length; ii++) { int tb = typeNameBits[ii]; if (tb == possible_n...
[ "public", "final", "static", "int", "typeNameKeyWordFromMask", "(", "int", "possible_names", ",", "int", "length", ")", "{", "int", "kw", "=", "KEYWORD_unrecognized", ";", "if", "(", "possible_names", "!=", "IonTokenConstsX", ".", "KW_ALL_BITS", ")", "{", "for",...
this can be faster but it's pretty unusual to be called.
[ "this", "can", "be", "faster", "but", "it", "s", "pretty", "unusual", "to", "be", "called", "." ]
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/IonTokenConstsX.java#L814-L828
train
amzn/ion-java
src/com/amazon/ion/system/IonTextWriterBuilder.java
IonTextWriterBuilder.withIvmMinimizing
public final IonTextWriterBuilder withIvmMinimizing(IvmMinimizing minimizing) { IonTextWriterBuilder b = mutable(); b.setIvmMinimizing(minimizing); return b; }
java
public final IonTextWriterBuilder withIvmMinimizing(IvmMinimizing minimizing) { IonTextWriterBuilder b = mutable(); b.setIvmMinimizing(minimizing); return b; }
[ "public", "final", "IonTextWriterBuilder", "withIvmMinimizing", "(", "IvmMinimizing", "minimizing", ")", "{", "IonTextWriterBuilder", "b", "=", "mutable", "(", ")", ";", "b", ".", "setIvmMinimizing", "(", "minimizing", ")", ";", "return", "b", ";", "}" ]
Declares the strategy for reducing or eliminating non-initial Ion version markers, returning a new mutable builder if this is immutable. When null, IVMs are emitted as they are written. @param minimizing the IVM minimization strategy. Null indicates that all explicitly-written IVMs will be emitted. @return this insta...
[ "Declares", "the", "strategy", "for", "reducing", "or", "eliminating", "non", "-", "initial", "Ion", "version", "markers", "returning", "a", "new", "mutable", "builder", "if", "this", "is", "immutable", ".", "When", "null", "IVMs", "are", "emitted", "as", "t...
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/system/IonTextWriterBuilder.java#L500-L506
train
amzn/ion-java
src/com/amazon/ion/system/IonTextWriterBuilder.java
IonTextWriterBuilder.withLongStringThreshold
public final IonTextWriterBuilder withLongStringThreshold(int threshold) { IonTextWriterBuilder b = mutable(); b.setLongStringThreshold(threshold); return b; }
java
public final IonTextWriterBuilder withLongStringThreshold(int threshold) { IonTextWriterBuilder b = mutable(); b.setLongStringThreshold(threshold); return b; }
[ "public", "final", "IonTextWriterBuilder", "withLongStringThreshold", "(", "int", "threshold", ")", "{", "IonTextWriterBuilder", "b", "=", "mutable", "(", ")", ";", "b", ".", "setLongStringThreshold", "(", "threshold", ")", ";", "return", "b", ";", "}" ]
Declares the length beyond which string and clob content will be rendered as triple-quoted "long strings". At present, such content will only line-break on extant newlines. @param threshold the new threshold; zero means none. @see #getLongStringThreshold() @see #setLongStringThreshold(int) @return this instance, if ...
[ "Declares", "the", "length", "beyond", "which", "string", "and", "clob", "content", "will", "be", "rendered", "as", "triple", "-", "quoted", "long", "strings", ".", "At", "present", "such", "content", "will", "only", "line", "-", "break", "on", "extant", "...
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/system/IonTextWriterBuilder.java#L619-L624
train
amzn/ion-java
src/com/amazon/ion/impl/bin/IonManagedBinaryWriter.java
IonManagedBinaryWriter.startLocalSymbolTableIfNeeded
private void startLocalSymbolTableIfNeeded(final boolean writeIVM) throws IOException { if (symbolState == SymbolState.SYSTEM_SYMBOLS) { if (writeIVM) { symbols.writeIonVersionMarker(); } symbols.addTypeAnnotationSymbol(systemSymbol(ION...
java
private void startLocalSymbolTableIfNeeded(final boolean writeIVM) throws IOException { if (symbolState == SymbolState.SYSTEM_SYMBOLS) { if (writeIVM) { symbols.writeIonVersionMarker(); } symbols.addTypeAnnotationSymbol(systemSymbol(ION...
[ "private", "void", "startLocalSymbolTableIfNeeded", "(", "final", "boolean", "writeIVM", ")", "throws", "IOException", "{", "if", "(", "symbolState", "==", "SymbolState", ".", "SYSTEM_SYMBOLS", ")", "{", "if", "(", "writeIVM", ")", "{", "symbols", ".", "writeIon...
Symbol Table Management
[ "Symbol", "Table", "Management" ]
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/bin/IonManagedBinaryWriter.java#L741-L775
train
amzn/ion-java
src/com/amazon/ion/impl/bin/IonManagedBinaryWriter.java
IonManagedBinaryWriter.setFieldName
public void setFieldName(final String name) { if (!isInStruct()) { throw new IllegalStateException("IonWriter.setFieldName() must be called before writing a value into a struct."); } if (name == null) { throw new NullPointerException("Null field name i...
java
public void setFieldName(final String name) { if (!isInStruct()) { throw new IllegalStateException("IonWriter.setFieldName() must be called before writing a value into a struct."); } if (name == null) { throw new NullPointerException("Null field name i...
[ "public", "void", "setFieldName", "(", "final", "String", "name", ")", "{", "if", "(", "!", "isInStruct", "(", ")", ")", "{", "throw", "new", "IllegalStateException", "(", "\"IonWriter.setFieldName() must be called before writing a value into a struct.\"", ")", ";", "...
Current Value Meta
[ "Current", "Value", "Meta" ]
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/bin/IonManagedBinaryWriter.java#L870-L882
train
amzn/ion-java
src/com/amazon/ion/system/SimpleCatalog.java
SimpleCatalog.removeTable
public SymbolTable removeTable(String name, int version) { SymbolTable removed = null; synchronized (myTablesByName) { TreeMap<Integer,SymbolTable> versions = myTablesByName.get(name); if (versions != null) { synchronized (...
java
public SymbolTable removeTable(String name, int version) { SymbolTable removed = null; synchronized (myTablesByName) { TreeMap<Integer,SymbolTable> versions = myTablesByName.get(name); if (versions != null) { synchronized (...
[ "public", "SymbolTable", "removeTable", "(", "String", "name", ",", "int", "version", ")", "{", "SymbolTable", "removed", "=", "null", ";", "synchronized", "(", "myTablesByName", ")", "{", "TreeMap", "<", "Integer", ",", "SymbolTable", ">", "versions", "=", ...
Removes a symbol table from this catalog. @return the removed table, or <code>null</code> if this catalog has no matching table.
[ "Removes", "a", "symbol", "table", "from", "this", "catalog", "." ]
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/system/SimpleCatalog.java#L181-L205
train
amzn/ion-java
src/com/amazon/ion/system/SimpleCatalog.java
SimpleCatalog.iterator
public Iterator<SymbolTable> iterator() { ArrayList<SymbolTable> tables; synchronized (myTablesByName) { tables = new ArrayList<SymbolTable>(myTablesByName.size()); // I don't think we can shorten the synchronization block // because HashMap.values() res...
java
public Iterator<SymbolTable> iterator() { ArrayList<SymbolTable> tables; synchronized (myTablesByName) { tables = new ArrayList<SymbolTable>(myTablesByName.size()); // I don't think we can shorten the synchronization block // because HashMap.values() res...
[ "public", "Iterator", "<", "SymbolTable", ">", "iterator", "(", ")", "{", "ArrayList", "<", "SymbolTable", ">", "tables", ";", "synchronized", "(", "myTablesByName", ")", "{", "tables", "=", "new", "ArrayList", "<", "SymbolTable", ">", "(", "myTablesByName", ...
Constructs an iterator that enumerates all of the shared symbol tables in this catalog, at the time of method invocation. The result represents a snapshot of the state of this catalog. @return a non-null, but potentially empty, iterator.
[ "Constructs", "an", "iterator", "that", "enumerates", "all", "of", "the", "shared", "symbol", "tables", "in", "this", "catalog", "at", "the", "time", "of", "method", "invocation", ".", "The", "result", "represents", "a", "snapshot", "of", "the", "state", "of...
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/system/SimpleCatalog.java#L215-L238
train
amzn/ion-java
src/com/amazon/ion/impl/lite/IonContainerLite.java
IonContainerLite.validateNewChild
void validateNewChild(IonValue child) throws ContainedValueException, NullPointerException, IllegalArgumentException { if (child.getContainer() != null) // Also checks for null. { throw new ContainedValueException(); } if (child.isReadOn...
java
void validateNewChild(IonValue child) throws ContainedValueException, NullPointerException, IllegalArgumentException { if (child.getContainer() != null) // Also checks for null. { throw new ContainedValueException(); } if (child.isReadOn...
[ "void", "validateNewChild", "(", "IonValue", "child", ")", "throws", "ContainedValueException", ",", "NullPointerException", ",", "IllegalArgumentException", "{", "if", "(", "child", ".", "getContainer", "(", ")", "!=", "null", ")", "// Also checks for null.", "{", ...
Ensures that a potential new child is non-null, has no container, is not read-only, and is not a datagram. @throws NullPointerException if {@code child} is {@code null}. @throws ContainedValueException if {@code child} is already part of a container. @throws ReadOnlyValueException if {@code child} is read only. @throw...
[ "Ensures", "that", "a", "potential", "new", "child", "is", "non", "-", "null", "has", "no", "container", "is", "not", "read", "-", "only", "and", "is", "not", "a", "datagram", "." ]
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/lite/IonContainerLite.java#L506-L529
train
amzn/ion-java
src/com/amazon/ion/impl/lite/IonContainerLite.java
IonContainerLite.add_child
protected int add_child(int idx, IonValueLite child) { _isNullValue(false); // if we add children we're not null anymore child.setContext(this.getContextForIndex(child, idx)); if (_children == null || _child_count >= _children.length) { int old_len = (_children == null) ? 0 : _ch...
java
protected int add_child(int idx, IonValueLite child) { _isNullValue(false); // if we add children we're not null anymore child.setContext(this.getContextForIndex(child, idx)); if (_children == null || _child_count >= _children.length) { int old_len = (_children == null) ? 0 : _ch...
[ "protected", "int", "add_child", "(", "int", "idx", ",", "IonValueLite", "child", ")", "{", "_isNullValue", "(", "false", ")", ";", "// if we add children we're not null anymore", "child", ".", "setContext", "(", "this", ".", "getContextForIndex", "(", "child", ",...
Does not validate the child or check locks.
[ "Does", "not", "validate", "the", "child", "or", "check", "locks", "." ]
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/lite/IonContainerLite.java#L673-L702
train
amzn/ion-java
src/com/amazon/ion/impl/lite/IonContainerLite.java
IonContainerLite.remove_child
void remove_child(int idx) { assert(idx >=0); assert(idx < get_child_count()); // this also asserts child count > 0 assert get_child(idx) != null : "No child at index " + idx; _children[idx].detachFromContainer(); int children_to_move = _child_count - idx - 1; if (ch...
java
void remove_child(int idx) { assert(idx >=0); assert(idx < get_child_count()); // this also asserts child count > 0 assert get_child(idx) != null : "No child at index " + idx; _children[idx].detachFromContainer(); int children_to_move = _child_count - idx - 1; if (ch...
[ "void", "remove_child", "(", "int", "idx", ")", "{", "assert", "(", "idx", ">=", "0", ")", ";", "assert", "(", "idx", "<", "get_child_count", "(", ")", ")", ";", "// this also asserts child count > 0", "assert", "get_child", "(", "idx", ")", "!=", "null", ...
Does not check locks.
[ "Does", "not", "check", "locks", "." ]
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/lite/IonContainerLite.java#L712-L726
train
amzn/ion-java
src/com/amazon/ion/impl/lite/IonStructLite.java
IonStructLite.put
public void put(String fieldName, IonValue value) { checkForLock(); validateFieldName(fieldName); if (value != null) validateNewChild(value); int lowestRemovedIndex = get_child_count(); boolean any_removed = false; // first we remove the any existing fields ...
java
public void put(String fieldName, IonValue value) { checkForLock(); validateFieldName(fieldName); if (value != null) validateNewChild(value); int lowestRemovedIndex = get_child_count(); boolean any_removed = false; // first we remove the any existing fields ...
[ "public", "void", "put", "(", "String", "fieldName", ",", "IonValue", "value", ")", "{", "checkForLock", "(", ")", ";", "validateFieldName", "(", "fieldName", ")", ";", "if", "(", "value", "!=", "null", ")", "validateNewChild", "(", "value", ")", ";", "i...
put is "make this value the one and only value associated with this fieldName". The side effect is that if there were multiple fields with this name when put is complete there will only be the one value in the collection.
[ "put", "is", "make", "this", "value", "the", "one", "and", "only", "value", "associated", "with", "this", "fieldName", ".", "The", "side", "effect", "is", "that", "if", "there", "were", "multiple", "fields", "with", "this", "name", "when", "put", "is", "...
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/lite/IonStructLite.java#L560-L629
train
amzn/ion-java
src/com/amazon/ion/impl/lite/IonLobLite.java
IonLobLite.lobHashCode
protected int lobHashCode(int seed, SymbolTableProvider symbolTableProvider) { int result = seed; if (!isNullValue()) { CRC32 crc = new CRC32(); crc.update(getBytes()); result ^= (int) crc.getValue(); } return hashTypeAnnotations(result, symbolT...
java
protected int lobHashCode(int seed, SymbolTableProvider symbolTableProvider) { int result = seed; if (!isNullValue()) { CRC32 crc = new CRC32(); crc.update(getBytes()); result ^= (int) crc.getValue(); } return hashTypeAnnotations(result, symbolT...
[ "protected", "int", "lobHashCode", "(", "int", "seed", ",", "SymbolTableProvider", "symbolTableProvider", ")", "{", "int", "result", "=", "seed", ";", "if", "(", "!", "isNullValue", "(", ")", ")", "{", "CRC32", "crc", "=", "new", "CRC32", "(", ")", ";", ...
Calculate LOB hash code as XOR of seed with CRC-32 of the LOB data. This distinguishes BLOBs from CLOBs @param seed Seed value @return hash code
[ "Calculate", "LOB", "hash", "code", "as", "XOR", "of", "seed", "with", "CRC", "-", "32", "of", "the", "LOB", "data", ".", "This", "distinguishes", "BLOBs", "from", "CLOBs" ]
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/lite/IonLobLite.java#L55-L66
train
amzn/ion-java
src/com/amazon/ion/impl/IonReaderTextRawTokensX.java
IonReaderTextRawTokensX.skipDoubleColon
public final boolean skipDoubleColon() throws IOException { int c = skip_over_whitespace(); if (c != ':') { unread_char(c); return false; } c = read_char(); if (c != ':') { unread_char(c); unread_char(':'); return fa...
java
public final boolean skipDoubleColon() throws IOException { int c = skip_over_whitespace(); if (c != ':') { unread_char(c); return false; } c = read_char(); if (c != ':') { unread_char(c); unread_char(':'); return fa...
[ "public", "final", "boolean", "skipDoubleColon", "(", ")", "throws", "IOException", "{", "int", "c", "=", "skip_over_whitespace", "(", ")", ";", "if", "(", "c", "!=", "'", "'", ")", "{", "unread_char", "(", "c", ")", ";", "return", "false", ";", "}", ...
peeks into the input stream to see if the next token would be a double colon. If indeed this is the case it skips the two colons and returns true. If not it unreads the 1 or 2 real characters it read and return false. It always consumes any preceding whitespace. @return true if the next token is a double colon, false...
[ "peeks", "into", "the", "input", "stream", "to", "see", "if", "the", "next", "token", "would", "be", "a", "double", "colon", ".", "If", "indeed", "this", "is", "the", "case", "it", "skips", "the", "two", "colons", "and", "returns", "true", ".", "If", ...
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/IonReaderTextRawTokensX.java#L336-L350
train
amzn/ion-java
src/com/amazon/ion/impl/IonReaderTextRawTokensX.java
IonReaderTextRawTokensX.peekNullTypeSymbol
public final int peekNullTypeSymbol() throws IOException { // the '.' has to follow the 'null' immediately int c = read_char(); if (c != '.') { unread_char(c); return IonTokenConstsX.KEYWORD_none; } // we have a dot, start reading through the followin...
java
public final int peekNullTypeSymbol() throws IOException { // the '.' has to follow the 'null' immediately int c = read_char(); if (c != '.') { unread_char(c); return IonTokenConstsX.KEYWORD_none; } // we have a dot, start reading through the followin...
[ "public", "final", "int", "peekNullTypeSymbol", "(", ")", "throws", "IOException", "{", "// the '.' has to follow the 'null' immediately", "int", "c", "=", "read_char", "(", ")", ";", "if", "(", "c", "!=", "'", "'", ")", "{", "unread_char", "(", "c", ")", ";...
peeks into the input stream to see if we have an unquoted symbol that resolves to one of the ion types. If it does it consumes the input and returns the type keyword id. If not is unreads the non-whitespace characters and the dot, which the input argument 'c' should be.
[ "peeks", "into", "the", "input", "stream", "to", "see", "if", "we", "have", "an", "unquoted", "symbol", "that", "resolves", "to", "one", "of", "the", "ion", "types", ".", "If", "it", "does", "it", "consumes", "the", "input", "and", "returns", "the", "t...
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/IonReaderTextRawTokensX.java#L361-L418
train
amzn/ion-java
src/com/amazon/ion/impl/IonReaderTextRawTokensX.java
IonReaderTextRawTokensX.peekLobStartPunctuation
public final int peekLobStartPunctuation() throws IOException { int c = skip_over_lob_whitespace(); if (c == '"') { //unread_char(c); return IonTokenConstsX.TOKEN_STRING_DOUBLE_QUOTE; } if (c != '\'') { unread_char(c); return IonTokenCo...
java
public final int peekLobStartPunctuation() throws IOException { int c = skip_over_lob_whitespace(); if (c == '"') { //unread_char(c); return IonTokenConstsX.TOKEN_STRING_DOUBLE_QUOTE; } if (c != '\'') { unread_char(c); return IonTokenCo...
[ "public", "final", "int", "peekLobStartPunctuation", "(", ")", "throws", "IOException", "{", "int", "c", "=", "skip_over_lob_whitespace", "(", ")", ";", "if", "(", "c", "==", "'", "'", ")", "{", "//unread_char(c);", "return", "IonTokenConstsX", ".", "TOKEN_STR...
peeks into the input stream to see what non-whitespace character is coming up. If it is a double quote or a triple quote this returns true as either distinguished the contents of a lob as distinctly a clob. Otherwise it returns false. In either case it unreads whatever non-whitespace it read to decide. @return true i...
[ "peeks", "into", "the", "input", "stream", "to", "see", "what", "non", "-", "whitespace", "character", "is", "coming", "up", ".", "If", "it", "is", "a", "double", "quote", "or", "a", "triple", "quote", "this", "returns", "true", "as", "either", "distingu...
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/IonReaderTextRawTokensX.java#L443-L468
train
amzn/ion-java
src/com/amazon/ion/impl/IonReaderTextRawTokensX.java
IonReaderTextRawTokensX.skip_clob_close_punctuation
protected final void skip_clob_close_punctuation() throws IOException { int c = skip_over_clob_whitespace(); if (c == '}') { c = read_char(); if (c == '}') { return; } unread_char(c); c = '}'; } unread_char(c); ...
java
protected final void skip_clob_close_punctuation() throws IOException { int c = skip_over_clob_whitespace(); if (c == '}') { c = read_char(); if (c == '}') { return; } unread_char(c); c = '}'; } unread_char(c); ...
[ "protected", "final", "void", "skip_clob_close_punctuation", "(", ")", "throws", "IOException", "{", "int", "c", "=", "skip_over_clob_whitespace", "(", ")", ";", "if", "(", "c", "==", "'", "'", ")", "{", "c", "=", "read_char", "(", ")", ";", "if", "(", ...
Expects optional whitespace then }}
[ "Expects", "optional", "whitespace", "then", "}}" ]
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/IonReaderTextRawTokensX.java#L471-L483
train
amzn/ion-java
src/com/amazon/ion/impl/IonReaderTextRawTokensX.java
IonReaderTextRawTokensX.skip_whitespace
private final boolean skip_whitespace(CommentStrategy commentStrategy) throws IOException { boolean any_whitespace = false; int c; loop: for (;;) { c = read_char(); switch (c) { case -1: break loop; case ' ': case '...
java
private final boolean skip_whitespace(CommentStrategy commentStrategy) throws IOException { boolean any_whitespace = false; int c; loop: for (;;) { c = read_char(); switch (c) { case -1: break loop; case ' ': case '...
[ "private", "final", "boolean", "skip_whitespace", "(", "CommentStrategy", "commentStrategy", ")", "throws", "IOException", "{", "boolean", "any_whitespace", "=", "false", ";", "int", "c", ";", "loop", ":", "for", "(", ";", ";", ")", "{", "c", "=", "read_char...
Skips whitespace and applies the given CommentStrategy to any comments found. Finishes at the starting position of the next token. @param commentStrategy @return true if whitespace was skipped and/or comments ignored @throws IOException
[ "Skips", "whitespace", "and", "applies", "the", "given", "CommentStrategy", "to", "any", "comments", "found", ".", "Finishes", "at", "the", "starting", "position", "of", "the", "next", "token", "." ]
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/IonReaderTextRawTokensX.java#L876-L910
train
amzn/ion-java
src/com/amazon/ion/impl/IonReaderTextRawTokensX.java
IonReaderTextRawTokensX.is_2_single_quotes_helper
private final boolean is_2_single_quotes_helper() throws IOException { int c = read_char(); if (c != '\'') { unread_char(c); return false; } c = read_char(); if (c != '\'') { unread_char(c); unread_char('\''); return...
java
private final boolean is_2_single_quotes_helper() throws IOException { int c = read_char(); if (c != '\'') { unread_char(c); return false; } c = read_char(); if (c != '\'') { unread_char(c); unread_char('\''); return...
[ "private", "final", "boolean", "is_2_single_quotes_helper", "(", ")", "throws", "IOException", "{", "int", "c", "=", "read_char", "(", ")", ";", "if", "(", "c", "!=", "'", "'", ")", "{", "unread_char", "(", "c", ")", ";", "return", "false", ";", "}", ...
this peeks ahead to see if the next two characters are single quotes. this would finish off a triple quote when the first quote has been read. if it succeeds it "consumes" the two quotes it reads. if it fails it unreads @return true if the next two characters are single quotes @throws IOException
[ "this", "peeks", "ahead", "to", "see", "if", "the", "next", "two", "characters", "are", "single", "quotes", ".", "this", "would", "finish", "off", "a", "triple", "quote", "when", "the", "first", "quote", "has", "been", "read", ".", "if", "it", "succeeds"...
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/IonReaderTextRawTokensX.java#L968-L982
train
amzn/ion-java
src/com/amazon/ion/impl/IonReaderTextRawTokensX.java
IonReaderTextRawTokensX.scan_negative_for_numeric_type
private final int scan_negative_for_numeric_type(int c) throws IOException { assert(c == '-'); c = read_char(); int t = scan_for_numeric_type(c); if (t == IonTokenConstsX.TOKEN_TIMESTAMP) { bad_token(c); } unread_char(c); // and the caller need to unread t...
java
private final int scan_negative_for_numeric_type(int c) throws IOException { assert(c == '-'); c = read_char(); int t = scan_for_numeric_type(c); if (t == IonTokenConstsX.TOKEN_TIMESTAMP) { bad_token(c); } unread_char(c); // and the caller need to unread t...
[ "private", "final", "int", "scan_negative_for_numeric_type", "(", "int", "c", ")", "throws", "IOException", "{", "assert", "(", "c", "==", "'", "'", ")", ";", "c", "=", "read_char", "(", ")", ";", "int", "t", "=", "scan_for_numeric_type", "(", "c", ")", ...
variant of scan_numeric_type where the passed in start character was preceded by a minus sign. this will also unread the minus sign. @param c first char of number read by caller @return numeric token type @throws IOException
[ "variant", "of", "scan_numeric_type", "where", "the", "passed", "in", "start", "character", "was", "preceded", "by", "a", "minus", "sign", ".", "this", "will", "also", "unread", "the", "minus", "sign", "." ]
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/IonReaderTextRawTokensX.java#L1146-L1156
train
amzn/ion-java
src/com/amazon/ion/impl/IonReaderTextRawTokensX.java
IonReaderTextRawTokensX.load_raw_characters
protected void load_raw_characters(StringBuilder sb) throws IOException { int c = read_char(); for (;;) { c = read_char(); switch (c) { case CharacterSequence.CHAR_SEQ_ESCAPED_NEWLINE_SEQUENCE_1: case CharacterSequence.CHAR_SEQ_ESCAPED_NEWLINE_SEQUENCE...
java
protected void load_raw_characters(StringBuilder sb) throws IOException { int c = read_char(); for (;;) { c = read_char(); switch (c) { case CharacterSequence.CHAR_SEQ_ESCAPED_NEWLINE_SEQUENCE_1: case CharacterSequence.CHAR_SEQ_ESCAPED_NEWLINE_SEQUENCE...
[ "protected", "void", "load_raw_characters", "(", "StringBuilder", "sb", ")", "throws", "IOException", "{", "int", "c", "=", "read_char", "(", ")", ";", "for", "(", ";", ";", ")", "{", "c", "=", "read_char", "(", ")", ";", "switch", "(", "c", ")", "{"...
this is used to load a previously marked set of bytes into the StringBuilder without escaping. It expects the caller to have set a save point so that the EOF will stop us at the right time. This does handle UTF8 decoding and surrogate encoding as the bytes are transfered.
[ "this", "is", "used", "to", "load", "a", "previously", "marked", "set", "of", "bytes", "into", "the", "StringBuilder", "without", "escaping", ".", "It", "expects", "the", "caller", "to", "have", "set", "a", "save", "point", "so", "that", "the", "EOF", "w...
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/IonReaderTextRawTokensX.java#L1171-L1195
train
amzn/ion-java
src/com/amazon/ion/impl/IonReaderTextRawTokensX.java
IonReaderTextRawTokensX.skip_timestamp_past_digits
private final int skip_timestamp_past_digits(int min, int max) throws IOException { int c; // scan the first min characters insuring they're digits while (min > 0) { c = read_char(); if (!IonTokenConstsX.isDigit(c)) { error("invalid character ...
java
private final int skip_timestamp_past_digits(int min, int max) throws IOException { int c; // scan the first min characters insuring they're digits while (min > 0) { c = read_char(); if (!IonTokenConstsX.isDigit(c)) { error("invalid character ...
[ "private", "final", "int", "skip_timestamp_past_digits", "(", "int", "min", ",", "int", "max", ")", "throws", "IOException", "{", "int", "c", ";", "// scan the first min characters insuring they're digits", "while", "(", "min", ">", "0", ")", "{", "c", "=", "rea...
Helper method for skipping embedded digits inside a timestamp value This overload skips at least min and at most max digits, and errors if a non-digit is encountered in the first min characters read
[ "Helper", "method", "for", "skipping", "embedded", "digits", "inside", "a", "timestamp", "value", "This", "overload", "skips", "at", "least", "min", "and", "at", "most", "max", "digits", "and", "errors", "if", "a", "non", "-", "digit", "is", "encountered", ...
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/IonReaderTextRawTokensX.java#L1504-L1528
train
amzn/ion-java
src/com/amazon/ion/impl/IonReaderTextRawTokensX.java
IonReaderTextRawTokensX.load_exponent
private final int load_exponent(StringBuilder sb) throws IOException { int c = read_char(); if (c == '-' || c == '+') { sb.append((char)c); c = read_char(); } c = load_digits(sb, c); if (c == '.') { sb.append((char)c); c = read...
java
private final int load_exponent(StringBuilder sb) throws IOException { int c = read_char(); if (c == '-' || c == '+') { sb.append((char)c); c = read_char(); } c = load_digits(sb, c); if (c == '.') { sb.append((char)c); c = read...
[ "private", "final", "int", "load_exponent", "(", "StringBuilder", "sb", ")", "throws", "IOException", "{", "int", "c", "=", "read_char", "(", ")", ";", "if", "(", "c", "==", "'", "'", "||", "c", "==", "'", "'", ")", "{", "sb", ".", "append", "(", ...
can unread it
[ "can", "unread", "it" ]
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/IonReaderTextRawTokensX.java#L1657-L1672
train
amzn/ion-java
src/com/amazon/ion/impl/IonReaderTextRawTokensX.java
IonReaderTextRawTokensX.load_digits
private final int load_digits(StringBuilder sb, int c) throws IOException { if (!IonTokenConstsX.isDigit(c)) { return c; } sb.append((char) c); return readNumeric(sb, Radix.DECIMAL, NumericState.DIGIT); }
java
private final int load_digits(StringBuilder sb, int c) throws IOException { if (!IonTokenConstsX.isDigit(c)) { return c; } sb.append((char) c); return readNumeric(sb, Radix.DECIMAL, NumericState.DIGIT); }
[ "private", "final", "int", "load_digits", "(", "StringBuilder", "sb", ",", "int", "c", ")", "throws", "IOException", "{", "if", "(", "!", "IonTokenConstsX", ".", "isDigit", "(", "c", ")", ")", "{", "return", "c", ";", "}", "sb", ".", "append", "(", "...
Accumulates digits into the buffer, starting with the given character. @return the first non-digit character on the input. Could be the given character if its not a digit. @see IonTokenConstsX#isDigit(int)
[ "Accumulates", "digits", "into", "the", "buffer", "starting", "with", "the", "given", "character", "." ]
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/IonReaderTextRawTokensX.java#L1682-L1691
train
amzn/ion-java
src/com/amazon/ion/impl/IonReaderTextRawTokensX.java
IonReaderTextRawTokensX.skip_over_lob
protected void skip_over_lob(int lobToken, SavePoint sp) throws IOException { switch(lobToken) { case IonTokenConstsX.TOKEN_STRING_DOUBLE_QUOTE: skip_double_quoted_string(sp); skip_clob_close_punctuation(); break; case IonTokenConstsX.TOKEN_STRING_TRIPLE_QUOTE...
java
protected void skip_over_lob(int lobToken, SavePoint sp) throws IOException { switch(lobToken) { case IonTokenConstsX.TOKEN_STRING_DOUBLE_QUOTE: skip_double_quoted_string(sp); skip_clob_close_punctuation(); break; case IonTokenConstsX.TOKEN_STRING_TRIPLE_QUOTE...
[ "protected", "void", "skip_over_lob", "(", "int", "lobToken", ",", "SavePoint", "sp", ")", "throws", "IOException", "{", "switch", "(", "lobToken", ")", "{", "case", "IonTokenConstsX", ".", "TOKEN_STRING_DOUBLE_QUOTE", ":", "skip_double_quoted_string", "(", "sp", ...
Skips over the closing }} too.
[ "Skips", "over", "the", "closing", "}}", "too", "." ]
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/IonReaderTextRawTokensX.java#L2270-L2287
train
amzn/ion-java
src/com/amazon/ion/impl/IonWriterSystemBinary.java
IonWriterSystemBinary.writeRaw
public void writeRaw(byte[] value, int start, int len) throws IOException { startValue(TID_RAW); _writer.write(value, start, len); _patch.patchValue(len); closeValue(); }
java
public void writeRaw(byte[] value, int start, int len) throws IOException { startValue(TID_RAW); _writer.write(value, start, len); _patch.patchValue(len); closeValue(); }
[ "public", "void", "writeRaw", "(", "byte", "[", "]", "value", ",", "int", "start", ",", "int", "len", ")", "throws", "IOException", "{", "startValue", "(", "TID_RAW", ")", ";", "_writer", ".", "write", "(", "value", ",", "start", ",", "len", ")", ";"...
just transfer the bytes into the current patch as 'proper' ion binary serialization
[ "just", "transfer", "the", "bytes", "into", "the", "current", "patch", "as", "proper", "ion", "binary", "serialization" ]
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/IonWriterSystemBinary.java#L808-L814
train
amzn/ion-java
src/com/amazon/ion/impl/IonWriterSystemBinary.java
IonWriterSystemBinary.writeBytes
int writeBytes(OutputStream userstream) throws IOException { if (_patch.getParent() != null) { throw new IllegalStateException("Tried to flush while not on top-level"); } try { BlockedByteInputStream datastream = new BlockedByteInputStream(_manager.buffer...
java
int writeBytes(OutputStream userstream) throws IOException { if (_patch.getParent() != null) { throw new IllegalStateException("Tried to flush while not on top-level"); } try { BlockedByteInputStream datastream = new BlockedByteInputStream(_manager.buffer...
[ "int", "writeBytes", "(", "OutputStream", "userstream", ")", "throws", "IOException", "{", "if", "(", "_patch", ".", "getParent", "(", ")", "!=", "null", ")", "{", "throw", "new", "IllegalStateException", "(", "\"Tried to flush while not on top-level\"", ")", ";",...
Writes everything we've got into the output stream, performing all necessary patches along the way. This implements {@link com.amazon.ion.IonBinaryWriter#writeBytes(OutputStream)} via our subclass {@link IonWriterBinaryCompatibility.System}.
[ "Writes", "everything", "we", "ve", "got", "into", "the", "output", "stream", "performing", "all", "necessary", "patches", "along", "the", "way", "." ]
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/IonWriterSystemBinary.java#L896-L909
train
amzn/ion-java
src/com/amazon/ion/impl/lite/IonLoaderLite.java
IonLoaderLite.load_helper
private IonDatagramLite load_helper(IonReader reader) throws IOException { IonDatagramLite datagram = new IonDatagramLite(_system, _catalog); IonWriter writer = _Private_IonWriterFactory.makeWriter(datagram); writer.writeValues(reader); return datagram; }
java
private IonDatagramLite load_helper(IonReader reader) throws IOException { IonDatagramLite datagram = new IonDatagramLite(_system, _catalog); IonWriter writer = _Private_IonWriterFactory.makeWriter(datagram); writer.writeValues(reader); return datagram; }
[ "private", "IonDatagramLite", "load_helper", "(", "IonReader", "reader", ")", "throws", "IOException", "{", "IonDatagramLite", "datagram", "=", "new", "IonDatagramLite", "(", "_system", ",", "_catalog", ")", ";", "IonWriter", "writer", "=", "_Private_IonWriterFactory"...
This doesn't wrap IOException because some callers need to propagate it. @return a new datagram; not null.
[ "This", "doesn", "t", "wrap", "IOException", "because", "some", "callers", "need", "to", "propagate", "it", "." ]
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/lite/IonLoaderLite.java#L76-L83
train
amzn/ion-java
src/com/amazon/ion/impl/LocalSymbolTableAsStruct.java
LocalSymbolTableAsStruct.getIonRepresentation
IonStruct getIonRepresentation() { synchronized (this) { IonStruct image = myImage; if (image == null) { // Start a new image from scratch myImage = image = makeIonRepresentation(myImageFactory); } return i...
java
IonStruct getIonRepresentation() { synchronized (this) { IonStruct image = myImage; if (image == null) { // Start a new image from scratch myImage = image = makeIonRepresentation(myImageFactory); } return i...
[ "IonStruct", "getIonRepresentation", "(", ")", "{", "synchronized", "(", "this", ")", "{", "IonStruct", "image", "=", "myImage", ";", "if", "(", "image", "==", "null", ")", "{", "// Start a new image from scratch", "myImage", "=", "image", "=", "makeIonRepresent...
Only valid on local symtabs that already have an _image_factory set. @return Not null.
[ "Only", "valid", "on", "local", "symtabs", "that", "already", "have", "an", "_image_factory", "set", "." ]
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/LocalSymbolTableAsStruct.java#L173-L187
train
amzn/ion-java
src/com/amazon/ion/impl/LocalSymbolTableAsStruct.java
LocalSymbolTableAsStruct.makeIonRepresentation
private IonStruct makeIonRepresentation(ValueFactory factory) { IonStruct ionRep = factory.newEmptyStruct(); ionRep.addTypeAnnotation(ION_SYMBOL_TABLE); SymbolTable[] importedTables = getImportedTablesNoCopy(); if (importedTables.length > 1) { IonList importsLi...
java
private IonStruct makeIonRepresentation(ValueFactory factory) { IonStruct ionRep = factory.newEmptyStruct(); ionRep.addTypeAnnotation(ION_SYMBOL_TABLE); SymbolTable[] importedTables = getImportedTablesNoCopy(); if (importedTables.length > 1) { IonList importsLi...
[ "private", "IonStruct", "makeIonRepresentation", "(", "ValueFactory", "factory", ")", "{", "IonStruct", "ionRep", "=", "factory", ".", "newEmptyStruct", "(", ")", ";", "ionRep", ".", "addTypeAnnotation", "(", "ION_SYMBOL_TABLE", ")", ";", "SymbolTable", "[", "]", ...
NOT SYNCHRONIZED! Call only from a synch'd method. @return a new struct, not null.
[ "NOT", "SYNCHRONIZED!", "Call", "only", "from", "a", "synch", "d", "method", "." ]
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/LocalSymbolTableAsStruct.java#L194-L233
train
amzn/ion-java
src/com/amazon/ion/impl/LocalSymbolTableAsStruct.java
LocalSymbolTableAsStruct.recordLocalSymbolInIonRep
private void recordLocalSymbolInIonRep(IonStruct ionRep, String symbolName, int sid) { assert sid >= myFirstLocalSid; ValueFactory sys = ionRep.getSystem(); // TODO this is crazy inefficient and not as re...
java
private void recordLocalSymbolInIonRep(IonStruct ionRep, String symbolName, int sid) { assert sid >= myFirstLocalSid; ValueFactory sys = ionRep.getSystem(); // TODO this is crazy inefficient and not as re...
[ "private", "void", "recordLocalSymbolInIonRep", "(", "IonStruct", "ionRep", ",", "String", "symbolName", ",", "int", "sid", ")", "{", "assert", "sid", ">=", "myFirstLocalSid", ";", "ValueFactory", "sys", "=", "ionRep", ".", "getSystem", "(", ")", ";", "// TODO...
NOT SYNCHRONIZED! Call within constructor or from synched method. @param symbolName can be null when there's a gap in the local symbols list.
[ "NOT", "SYNCHRONIZED!", "Call", "within", "constructor", "or", "from", "synched", "method", "." ]
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/LocalSymbolTableAsStruct.java#L239-L264
train
amzn/ion-java
src/com/amazon/ion/impl/IonCharacterReader.java
IonCharacterReader.read
@Override public int read() throws IOException { int nextChar = super.read(); // process the character if ( nextChar != -1 ) { if ( nextChar == '\n' ) { m_line++; pushColumn( m_column ); m_column = 0; } else...
java
@Override public int read() throws IOException { int nextChar = super.read(); // process the character if ( nextChar != -1 ) { if ( nextChar == '\n' ) { m_line++; pushColumn( m_column ); m_column = 0; } else...
[ "@", "Override", "public", "int", "read", "(", ")", "throws", "IOException", "{", "int", "nextChar", "=", "super", ".", "read", "(", ")", ";", "// process the character", "if", "(", "nextChar", "!=", "-", "1", ")", "{", "if", "(", "nextChar", "==", "'"...
Uses the push back implementation but normalizes newlines to "\n".
[ "Uses", "the", "push", "back", "implementation", "but", "normalizes", "newlines", "to", "\\", "n", "." ]
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/IonCharacterReader.java#L132-L165
train
amzn/ion-java
src/com/amazon/ion/impl/IonCharacterReader.java
IonCharacterReader.unreadImpl
private void unreadImpl(int c, boolean updateCounts ) throws IOException { if ( c != -1 ) { if ( updateCounts ) { if ( c == '\n' ) { m_line--; m_column = popColumn(); } else { m_column--; } ...
java
private void unreadImpl(int c, boolean updateCounts ) throws IOException { if ( c != -1 ) { if ( updateCounts ) { if ( c == '\n' ) { m_line--; m_column = popColumn(); } else { m_column--; } ...
[ "private", "void", "unreadImpl", "(", "int", "c", ",", "boolean", "updateCounts", ")", "throws", "IOException", "{", "if", "(", "c", "!=", "-", "1", ")", "{", "if", "(", "updateCounts", ")", "{", "if", "(", "c", "==", "'", "'", ")", "{", "m_line", ...
Performs ths actual unread operation. @param c the character to unread. @param updateCounts Whether or not we actually update the line number.
[ "Performs", "ths", "actual", "unread", "operation", "." ]
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/IonCharacterReader.java#L269-L282
train
amzn/ion-java
src/com/amazon/ion/impl/IonBinary.java
IonBinary.verifyBinaryVersionMarker
public static void verifyBinaryVersionMarker(Reader reader) throws IonException { try { int pos = reader.position(); //reader.sync(); //reader.setPosition(0); byte[] bvm = new byte[BINARY_VERSION_MARKER_SIZE]; int len = readFully(re...
java
public static void verifyBinaryVersionMarker(Reader reader) throws IonException { try { int pos = reader.position(); //reader.sync(); //reader.setPosition(0); byte[] bvm = new byte[BINARY_VERSION_MARKER_SIZE]; int len = readFully(re...
[ "public", "static", "void", "verifyBinaryVersionMarker", "(", "Reader", "reader", ")", "throws", "IonException", "{", "try", "{", "int", "pos", "=", "reader", ".", "position", "(", ")", ";", "//reader.sync();", "//reader.setPosition(0);", "byte", "[", "]", "bvm"...
Verifies that a reader starts with a valid Ion cookie, throwing an exception if it does not. @param reader must not be null. @throws IonException if there's a problem reading the cookie, or if the data does not start with {@link _Private_IonConstants#BINARY_VERSION_MARKER_1_0}.
[ "Verifies", "that", "a", "reader", "starts", "with", "a", "valid", "Ion", "cookie", "throwing", "an", "exception", "if", "it", "does", "not", "." ]
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/IonBinary.java#L76-L116
train
amzn/ion-java
src/com/amazon/ion/impl/IonBinary.java
IonBinary.lenVarUInt
public static int lenVarUInt(long longVal) { assert longVal >= 0; if (longVal < (1L << (7 * 1))) return 1; // 7 bits if (longVal < (1L << (7 * 2))) return 2; // 14 bits if (longVal < (1L << (7 * 3))) return 3; // 21 bits if (longVal < (1L << (7 * 4))) return 4; // 28 bits ...
java
public static int lenVarUInt(long longVal) { assert longVal >= 0; if (longVal < (1L << (7 * 1))) return 1; // 7 bits if (longVal < (1L << (7 * 2))) return 2; // 14 bits if (longVal < (1L << (7 * 3))) return 3; // 21 bits if (longVal < (1L << (7 * 4))) return 4; // 28 bits ...
[ "public", "static", "int", "lenVarUInt", "(", "long", "longVal", ")", "{", "assert", "longVal", ">=", "0", ";", "if", "(", "longVal", "<", "(", "1L", "<<", "(", "7", "*", "1", ")", ")", ")", "return", "1", ";", "// 7 bits", "if", "(", "longVal", ...
Variable-length, high-bit-terminating integer, 7 data bits per byte.
[ "Variable", "-", "length", "high", "-", "bit", "-", "terminating", "integer", "7", "data", "bits", "per", "byte", "." ]
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/IonBinary.java#L444-L456
train
amzn/ion-java
src/com/amazon/ion/impl/IonBinary.java
IonBinary.lenIonTimestamp
public static int lenIonTimestamp(Timestamp di) { if (di == null) return 0; int len = 0; switch (di.getPrecision()) { case FRACTION: case SECOND: { BigDecimal fraction = di.getFractionalSecond(); if (fraction != null) { ...
java
public static int lenIonTimestamp(Timestamp di) { if (di == null) return 0; int len = 0; switch (di.getPrecision()) { case FRACTION: case SECOND: { BigDecimal fraction = di.getFractionalSecond(); if (fraction != null) { ...
[ "public", "static", "int", "lenIonTimestamp", "(", "Timestamp", "di", ")", "{", "if", "(", "di", "==", "null", ")", "return", "0", ";", "int", "len", "=", "0", ";", "switch", "(", "di", ".", "getPrecision", "(", ")", ")", "{", "case", "FRACTION", "...
this method computes the output length of this timestamp value in the Ion binary format. It does not include the length of the typedesc byte that preceeds the actual value. The output length of a null value is 0, as a result this this. @param di may be null
[ "this", "method", "computes", "the", "output", "length", "of", "this", "timestamp", "value", "in", "the", "Ion", "binary", "format", ".", "It", "does", "not", "include", "the", "length", "of", "the", "typedesc", "byte", "that", "preceeds", "the", "actual", ...
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/IonBinary.java#L678-L723
train
amzn/ion-java
src/com/amazon/ion/impl/SymbolTableReader.java
SymbolTableReader.stateFirstInStruct
private final int stateFirstInStruct() { int new_state; if (hasName()) { new_state = S_NAME; } else if (hasMaxId()) { new_state = S_MAX_ID; } else if (hasImports()) { new_state = S_IMPORT_LIST; } else if (hasLocalSy...
java
private final int stateFirstInStruct() { int new_state; if (hasName()) { new_state = S_NAME; } else if (hasMaxId()) { new_state = S_MAX_ID; } else if (hasImports()) { new_state = S_IMPORT_LIST; } else if (hasLocalSy...
[ "private", "final", "int", "stateFirstInStruct", "(", ")", "{", "int", "new_state", ";", "if", "(", "hasName", "(", ")", ")", "{", "new_state", "=", "S_NAME", ";", "}", "else", "if", "(", "hasMaxId", "(", ")", ")", "{", "new_state", "=", "S_MAX_ID", ...
details of the symbol table we're reading.
[ "details", "of", "the", "symbol", "table", "we", "re", "reading", "." ]
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/SymbolTableReader.java#L667-L687
train
amzn/ion-java
src/com/amazon/ion/impl/SymbolTableReader.java
SymbolTableReader.next
public IonType next() { if (has_next_helper() == false) { return null; } int new_state; switch (_current_state) { case S_BOF: new_state = S_STRUCT; break; case S_STRUCT: new_state = S_EOF; break; ...
java
public IonType next() { if (has_next_helper() == false) { return null; } int new_state; switch (_current_state) { case S_BOF: new_state = S_STRUCT; break; case S_STRUCT: new_state = S_EOF; break; ...
[ "public", "IonType", "next", "(", ")", "{", "if", "(", "has_next_helper", "(", ")", "==", "false", ")", "{", "return", "null", ";", "}", "int", "new_state", ";", "switch", "(", "_current_state", ")", "{", "case", "S_BOF", ":", "new_state", "=", "S_STRU...
this computes the actual move to the next state It does take into account the existence or absence of various properties, such as the symbol table name which is only present in some symbol tables. This also fills in a variety of current state variables that are used to return correct values by the "get" methods.
[ "this", "computes", "the", "actual", "move", "to", "the", "next", "state" ]
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/SymbolTableReader.java#L761-L904
train
amzn/ion-java
src/com/amazon/ion/impl/lite/ReverseBinaryEncoder.java
ReverseBinaryEncoder.growBuffer
private int growBuffer(int offset) { assert offset < 0; byte[] oldBuf = myBuffer; int oldLen = oldBuf.length; byte[] newBuf = new byte[(-offset + oldLen) << 1]; // Double the buffer int oldBegin = newBuf.length - oldLen; System.arraycopy(oldBuf, 0, newBuf, oldBegin, o...
java
private int growBuffer(int offset) { assert offset < 0; byte[] oldBuf = myBuffer; int oldLen = oldBuf.length; byte[] newBuf = new byte[(-offset + oldLen) << 1]; // Double the buffer int oldBegin = newBuf.length - oldLen; System.arraycopy(oldBuf, 0, newBuf, oldBegin, o...
[ "private", "int", "growBuffer", "(", "int", "offset", ")", "{", "assert", "offset", "<", "0", ";", "byte", "[", "]", "oldBuf", "=", "myBuffer", ";", "int", "oldLen", "=", "oldBuf", ".", "length", ";", "byte", "[", "]", "newBuf", "=", "new", "byte", ...
Grows the current buffer and returns the updated offset. @param offset the original offset @return the updated offset
[ "Grows", "the", "current", "buffer", "and", "returns", "the", "updated", "offset", "." ]
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/lite/ReverseBinaryEncoder.java#L283-L294
train
amzn/ion-java
src/com/amazon/ion/impl/lite/ReverseBinaryEncoder.java
ReverseBinaryEncoder.writeIonValue
private void writeIonValue(IonValue value) throws IonException { final int valueOffset = myBuffer.length - myOffset; switch (value.getType()) { // scalars case BLOB: writeIonBlobContent((IonBlob) value); break; case BOOL: writ...
java
private void writeIonValue(IonValue value) throws IonException { final int valueOffset = myBuffer.length - myOffset; switch (value.getType()) { // scalars case BLOB: writeIonBlobContent((IonBlob) value); break; case BOOL: writ...
[ "private", "void", "writeIonValue", "(", "IonValue", "value", ")", "throws", "IonException", "{", "final", "int", "valueOffset", "=", "myBuffer", ".", "length", "-", "myOffset", ";", "switch", "(", "value", ".", "getType", "(", ")", ")", "{", "// scalars", ...
Writes the IonValue and its nested values recursively, including annotations. @param value @throws IonException
[ "Writes", "the", "IonValue", "and", "its", "nested", "values", "recursively", "including", "annotations", "." ]
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/lite/ReverseBinaryEncoder.java#L303-L332
train
amzn/ion-java
src/com/amazon/ion/impl/lite/ReverseBinaryEncoder.java
ReverseBinaryEncoder.writeSymbolsField
private void writeSymbolsField(SymbolTable symTab) { // SymbolTable's APIs doesn't expose an Iterator to traverse declared // symbol strings in reverse order. As such, we utilize these two // indexes to traverse the strings in reverse. int importedMaxId = symTab.getImportedMaxId(); ...
java
private void writeSymbolsField(SymbolTable symTab) { // SymbolTable's APIs doesn't expose an Iterator to traverse declared // symbol strings in reverse order. As such, we utilize these two // indexes to traverse the strings in reverse. int importedMaxId = symTab.getImportedMaxId(); ...
[ "private", "void", "writeSymbolsField", "(", "SymbolTable", "symTab", ")", "{", "// SymbolTable's APIs doesn't expose an Iterator to traverse declared", "// symbol strings in reverse order. As such, we utilize these two", "// indexes to traverse the strings in reverse.", "int", "importedMaxI...
Write declared local symbol names if any exists. @param symTab the local symbol table, not shared, not system
[ "Write", "declared", "local", "symbol", "names", "if", "any", "exists", "." ]
4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/lite/ReverseBinaryEncoder.java#L1437-L1464
train
elastic/elasticsearch-metrics-reporter-java
src/main/java/org/elasticsearch/metrics/ElasticsearchReporter.java
ElasticsearchReporter.getPercolationMatches
private List<String> getPercolationMatches(JsonMetric jsonMetric) throws IOException { HttpURLConnection connection = openConnection("/" + currentIndexName + "/" + jsonMetric.type() + "/_percolate", "POST"); if (connection == null) { LOGGER.error("Could not connect to any configured elastics...
java
private List<String> getPercolationMatches(JsonMetric jsonMetric) throws IOException { HttpURLConnection connection = openConnection("/" + currentIndexName + "/" + jsonMetric.type() + "/_percolate", "POST"); if (connection == null) { LOGGER.error("Could not connect to any configured elastics...
[ "private", "List", "<", "String", ">", "getPercolationMatches", "(", "JsonMetric", "jsonMetric", ")", "throws", "IOException", "{", "HttpURLConnection", "connection", "=", "openConnection", "(", "\"/\"", "+", "currentIndexName", "+", "\"/\"", "+", "jsonMetric", ".",...
Execute a percolation request for the specified metric
[ "Execute", "a", "percolation", "request", "for", "the", "specified", "metric" ]
4018eaef6fc7721312f7440b2bf5a19699a6cb56
https://github.com/elastic/elasticsearch-metrics-reporter-java/blob/4018eaef6fc7721312f7440b2bf5a19699a6cb56/src/main/java/org/elasticsearch/metrics/ElasticsearchReporter.java#L352-L380
train
elastic/elasticsearch-metrics-reporter-java
src/main/java/org/elasticsearch/metrics/ElasticsearchReporter.java
ElasticsearchReporter.addJsonMetricToPercolationIfMatching
private void addJsonMetricToPercolationIfMatching(JsonMetric<? extends Metric> jsonMetric, List<JsonMetric> percolationMetrics) { if (percolationFilter != null && percolationFilter.matches(jsonMetric.name(), jsonMetric.value())) { percolationMetrics.add(jsonMetric); } }
java
private void addJsonMetricToPercolationIfMatching(JsonMetric<? extends Metric> jsonMetric, List<JsonMetric> percolationMetrics) { if (percolationFilter != null && percolationFilter.matches(jsonMetric.name(), jsonMetric.value())) { percolationMetrics.add(jsonMetric); } }
[ "private", "void", "addJsonMetricToPercolationIfMatching", "(", "JsonMetric", "<", "?", "extends", "Metric", ">", "jsonMetric", ",", "List", "<", "JsonMetric", ">", "percolationMetrics", ")", "{", "if", "(", "percolationFilter", "!=", "null", "&&", "percolationFilte...
Add metric to list of matched percolation if needed
[ "Add", "metric", "to", "list", "of", "matched", "percolation", "if", "needed" ]
4018eaef6fc7721312f7440b2bf5a19699a6cb56
https://github.com/elastic/elasticsearch-metrics-reporter-java/blob/4018eaef6fc7721312f7440b2bf5a19699a6cb56/src/main/java/org/elasticsearch/metrics/ElasticsearchReporter.java#L385-L389
train
elastic/elasticsearch-metrics-reporter-java
src/main/java/org/elasticsearch/metrics/ElasticsearchReporter.java
ElasticsearchReporter.createNewConnectionIfBulkSizeReached
private HttpURLConnection createNewConnectionIfBulkSizeReached(HttpURLConnection connection, int entriesWritten) throws IOException { if (entriesWritten % bulkSize == 0) { closeConnection(connection); return openConnection("/_bulk", "POST"); } return connection; }
java
private HttpURLConnection createNewConnectionIfBulkSizeReached(HttpURLConnection connection, int entriesWritten) throws IOException { if (entriesWritten % bulkSize == 0) { closeConnection(connection); return openConnection("/_bulk", "POST"); } return connection; }
[ "private", "HttpURLConnection", "createNewConnectionIfBulkSizeReached", "(", "HttpURLConnection", "connection", ",", "int", "entriesWritten", ")", "throws", "IOException", "{", "if", "(", "entriesWritten", "%", "bulkSize", "==", "0", ")", "{", "closeConnection", "(", ...
Create a new connection when the bulk size has hit the limit Checked on every write of a metric
[ "Create", "a", "new", "connection", "when", "the", "bulk", "size", "has", "hit", "the", "limit", "Checked", "on", "every", "write", "of", "a", "metric" ]
4018eaef6fc7721312f7440b2bf5a19699a6cb56
https://github.com/elastic/elasticsearch-metrics-reporter-java/blob/4018eaef6fc7721312f7440b2bf5a19699a6cb56/src/main/java/org/elasticsearch/metrics/ElasticsearchReporter.java#L412-L419
train
elastic/elasticsearch-metrics-reporter-java
src/main/java/org/elasticsearch/metrics/ElasticsearchReporter.java
ElasticsearchReporter.writeJsonMetric
private void writeJsonMetric(JsonMetric jsonMetric, ObjectWriter writer, OutputStream out) throws IOException { writer.writeValue(out, new BulkIndexOperationHeader(currentIndexName, jsonMetric.type())); out.write("\n".getBytes()); writer.writeValue(out, jsonMetric); out.write("\n".getByt...
java
private void writeJsonMetric(JsonMetric jsonMetric, ObjectWriter writer, OutputStream out) throws IOException { writer.writeValue(out, new BulkIndexOperationHeader(currentIndexName, jsonMetric.type())); out.write("\n".getBytes()); writer.writeValue(out, jsonMetric); out.write("\n".getByt...
[ "private", "void", "writeJsonMetric", "(", "JsonMetric", "jsonMetric", ",", "ObjectWriter", "writer", ",", "OutputStream", "out", ")", "throws", "IOException", "{", "writer", ".", "writeValue", "(", "out", ",", "new", "BulkIndexOperationHeader", "(", "currentIndexNa...
serialize a JSON metric over the outputstream in a bulk request
[ "serialize", "a", "JSON", "metric", "over", "the", "outputstream", "in", "a", "bulk", "request" ]
4018eaef6fc7721312f7440b2bf5a19699a6cb56
https://github.com/elastic/elasticsearch-metrics-reporter-java/blob/4018eaef6fc7721312f7440b2bf5a19699a6cb56/src/main/java/org/elasticsearch/metrics/ElasticsearchReporter.java#L424-L431
train
elastic/elasticsearch-metrics-reporter-java
src/main/java/org/elasticsearch/metrics/ElasticsearchReporter.java
ElasticsearchReporter.openConnection
private HttpURLConnection openConnection(String uri, String method) { for (String host : hosts) { try { URL templateUrl = new URL("http://" + host + uri); HttpURLConnection connection = ( HttpURLConnection ) templateUrl.openConnection(); connection.se...
java
private HttpURLConnection openConnection(String uri, String method) { for (String host : hosts) { try { URL templateUrl = new URL("http://" + host + uri); HttpURLConnection connection = ( HttpURLConnection ) templateUrl.openConnection(); connection.se...
[ "private", "HttpURLConnection", "openConnection", "(", "String", "uri", ",", "String", "method", ")", "{", "for", "(", "String", "host", ":", "hosts", ")", "{", "try", "{", "URL", "templateUrl", "=", "new", "URL", "(", "\"http://\"", "+", "host", "+", "u...
Open a new HttpUrlConnection, in case it fails it tries for the next host in the configured list
[ "Open", "a", "new", "HttpUrlConnection", "in", "case", "it", "fails", "it", "tries", "for", "the", "next", "host", "in", "the", "configured", "list" ]
4018eaef6fc7721312f7440b2bf5a19699a6cb56
https://github.com/elastic/elasticsearch-metrics-reporter-java/blob/4018eaef6fc7721312f7440b2bf5a19699a6cb56/src/main/java/org/elasticsearch/metrics/ElasticsearchReporter.java#L436-L456
train
elastic/elasticsearch-metrics-reporter-java
src/main/java/org/elasticsearch/metrics/ElasticsearchReporter.java
ElasticsearchReporter.checkForIndexTemplate
private void checkForIndexTemplate() { try { HttpURLConnection connection = openConnection( "/_template/metrics_template", "HEAD"); if (connection == null) { LOGGER.error("Could not connect to any configured elasticsearch instances: {}", Arrays.asList(hosts)); ...
java
private void checkForIndexTemplate() { try { HttpURLConnection connection = openConnection( "/_template/metrics_template", "HEAD"); if (connection == null) { LOGGER.error("Could not connect to any configured elasticsearch instances: {}", Arrays.asList(hosts)); ...
[ "private", "void", "checkForIndexTemplate", "(", ")", "{", "try", "{", "HttpURLConnection", "connection", "=", "openConnection", "(", "\"/_template/metrics_template\"", ",", "\"HEAD\"", ")", ";", "if", "(", "connection", "==", "null", ")", "{", "LOGGER", ".", "e...
This index template is automatically applied to all indices which start with the index name The index template simply configures the name not to be analyzed
[ "This", "index", "template", "is", "automatically", "applied", "to", "all", "indices", "which", "start", "with", "the", "index", "name", "The", "index", "template", "simply", "configures", "the", "name", "not", "to", "be", "analyzed" ]
4018eaef6fc7721312f7440b2bf5a19699a6cb56
https://github.com/elastic/elasticsearch-metrics-reporter-java/blob/4018eaef6fc7721312f7440b2bf5a19699a6cb56/src/main/java/org/elasticsearch/metrics/ElasticsearchReporter.java#L462-L512
train
cloudant/sync-android
cloudant-sync-datastore-core/src/main/java/com/cloudant/sync/event/EventBus.java
EventBus.post
public void post(Notification event) { for (Map.Entry<Object, List<SubscriberMethod>> entry : listeners.entrySet()) { for (SubscriberMethod method : entry.getValue()) { if (method.eventTypeToInvokeOn.isInstance(event)) { try { method.method...
java
public void post(Notification event) { for (Map.Entry<Object, List<SubscriberMethod>> entry : listeners.entrySet()) { for (SubscriberMethod method : entry.getValue()) { if (method.eventTypeToInvokeOn.isInstance(event)) { try { method.method...
[ "public", "void", "post", "(", "Notification", "event", ")", "{", "for", "(", "Map", ".", "Entry", "<", "Object", ",", "List", "<", "SubscriberMethod", ">", ">", "entry", ":", "listeners", ".", "entrySet", "(", ")", ")", "{", "for", "(", "SubscriberMet...
Post an event to the bus. All subscribers to the event class type posted will be notified. @param event to post to subscribers
[ "Post", "an", "event", "to", "the", "bus", ".", "All", "subscribers", "to", "the", "event", "class", "type", "posted", "will", "be", "notified", "." ]
5f1416ed1bd9ab05d7a4b8736480c8ae68bd7383
https://github.com/cloudant/sync-android/blob/5f1416ed1bd9ab05d7a4b8736480c8ae68bd7383/cloudant-sync-datastore-core/src/main/java/com/cloudant/sync/event/EventBus.java#L53-L72
train
cloudant/sync-android
cloudant-sync-datastore-core/src/main/java/com/cloudant/sync/internal/documentstore/callables/PickWinningRevisionCallable.java
PickWinningRevisionCallable.call
@Override public Void call(SQLDatabase db) throws DocumentStoreException { /* Pick winner and mark the appropriate revision with the 'current' flag set - There can only be one winner in a tree (or set of trees - if there is no common root) at any one time, so if there is a new...
java
@Override public Void call(SQLDatabase db) throws DocumentStoreException { /* Pick winner and mark the appropriate revision with the 'current' flag set - There can only be one winner in a tree (or set of trees - if there is no common root) at any one time, so if there is a new...
[ "@", "Override", "public", "Void", "call", "(", "SQLDatabase", "db", ")", "throws", "DocumentStoreException", "{", "/*\n Pick winner and mark the appropriate revision with the 'current' flag set\n - There can only be one winner in a tree (or set of trees - if there is no comm...
Execute the callable, selecting and marking the new winning revision. @param db the database to execute the callable against @throws DocumentStoreException
[ "Execute", "the", "callable", "selecting", "and", "marking", "the", "new", "winning", "revision", "." ]
5f1416ed1bd9ab05d7a4b8736480c8ae68bd7383
https://github.com/cloudant/sync-android/blob/5f1416ed1bd9ab05d7a4b8736480c8ae68bd7383/cloudant-sync-datastore-core/src/main/java/com/cloudant/sync/internal/documentstore/callables/PickWinningRevisionCallable.java#L68-L133
train
cloudant/sync-android
cloudant-sync-datastore-android-encryption/src/main/java/com/cloudant/sync/datastore/encryption/DPKEncryptionUtil.java
DPKEncryptionUtil.encryptAES
public static byte[] encryptAES(SecretKey key, byte[] iv, byte[] unencryptedBytes) throws NoSuchPaddingException, NoSuchAlgorithmException, InvalidAlgorithmParameterException, InvalidKeyException, BadPaddingException, IllegalBlockSizeException { Cipher aesCipher = Cipher.getInstance("AES...
java
public static byte[] encryptAES(SecretKey key, byte[] iv, byte[] unencryptedBytes) throws NoSuchPaddingException, NoSuchAlgorithmException, InvalidAlgorithmParameterException, InvalidKeyException, BadPaddingException, IllegalBlockSizeException { Cipher aesCipher = Cipher.getInstance("AES...
[ "public", "static", "byte", "[", "]", "encryptAES", "(", "SecretKey", "key", ",", "byte", "[", "]", "iv", ",", "byte", "[", "]", "unencryptedBytes", ")", "throws", "NoSuchPaddingException", ",", "NoSuchAlgorithmException", ",", "InvalidAlgorithmParameterException", ...
AES Encrypt a byte array @param key The encryption key @param iv The iv @param unencryptedBytes The data to encrypt @return The encrypted data @throws NoSuchPaddingException @throws NoSuchAlgorithmException @throws InvalidAlgorithmParameterException @throws InvalidKeyException @throws BadPad...
[ "AES", "Encrypt", "a", "byte", "array" ]
5f1416ed1bd9ab05d7a4b8736480c8ae68bd7383
https://github.com/cloudant/sync-android/blob/5f1416ed1bd9ab05d7a4b8736480c8ae68bd7383/cloudant-sync-datastore-android-encryption/src/main/java/com/cloudant/sync/datastore/encryption/DPKEncryptionUtil.java#L73-L82
train
cloudant/sync-android
cloudant-sync-datastore-android-encryption/src/main/java/com/cloudant/sync/datastore/encryption/DPKEncryptionUtil.java
DPKEncryptionUtil.decryptAES
public static byte[] decryptAES(SecretKey key, byte[] iv, byte[] encryptedBytes) throws NoSuchPaddingException, NoSuchAlgorithmException, InvalidAlgorithmParameterException, InvalidKeyException, BadPaddingException, IllegalBlockSizeException { Cipher aesCipher = Cipher.getInstance("AES/C...
java
public static byte[] decryptAES(SecretKey key, byte[] iv, byte[] encryptedBytes) throws NoSuchPaddingException, NoSuchAlgorithmException, InvalidAlgorithmParameterException, InvalidKeyException, BadPaddingException, IllegalBlockSizeException { Cipher aesCipher = Cipher.getInstance("AES/C...
[ "public", "static", "byte", "[", "]", "decryptAES", "(", "SecretKey", "key", ",", "byte", "[", "]", "iv", ",", "byte", "[", "]", "encryptedBytes", ")", "throws", "NoSuchPaddingException", ",", "NoSuchAlgorithmException", ",", "InvalidAlgorithmParameterException", ...
Decrypt an AES encrypted byte array @param key The encryption key @param iv The iv @param encryptedBytes The data to decrypt @return The decrypted data @throws NoSuchPaddingException @throws NoSuchAlgorithmException @throws InvalidAlgorithmParameterException @throws InvalidKeyException @throws B...
[ "Decrypt", "an", "AES", "encrypted", "byte", "array" ]
5f1416ed1bd9ab05d7a4b8736480c8ae68bd7383
https://github.com/cloudant/sync-android/blob/5f1416ed1bd9ab05d7a4b8736480c8ae68bd7383/cloudant-sync-datastore-android-encryption/src/main/java/com/cloudant/sync/datastore/encryption/DPKEncryptionUtil.java#L98-L107
train