id
int32
0
165k
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
55,800
lionsoul2014/jcseg
jcseg-core/src/main/java/org/lionsoul/jcseg/util/StringUtil.java
StringUtil.hwsTofws
public static String hwsTofws( String str ) { char[] chars = str.toCharArray(); for ( int j = 0; j < chars.length; j++ ) { if ( chars[j] == '\u0020' ) { chars[j] = '\u3000'; } else if ( chars[j] < '\177' ) { chars[j] = (char)(chars[j] + 65248);...
java
public static String hwsTofws( String str ) { char[] chars = str.toCharArray(); for ( int j = 0; j < chars.length; j++ ) { if ( chars[j] == '\u0020' ) { chars[j] = '\u3000'; } else if ( chars[j] < '\177' ) { chars[j] = (char)(chars[j] + 65248);...
[ "public", "static", "String", "hwsTofws", "(", "String", "str", ")", "{", "char", "[", "]", "chars", "=", "str", ".", "toCharArray", "(", ")", ";", "for", "(", "int", "j", "=", "0", ";", "j", "<", "chars", ".", "length", ";", "j", "++", ")", "{...
a static method to replace the half-width char to the full-width char in a given string @param str @return String the new String after the replace
[ "a", "static", "method", "to", "replace", "the", "half", "-", "width", "char", "to", "the", "full", "-", "width", "char", "in", "a", "given", "string" ]
7c8a912e3bbcaf4f8de701180b9c24e2e444a94b
https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-core/src/main/java/org/lionsoul/jcseg/util/StringUtil.java#L507-L519
55,801
lionsoul2014/jcseg
jcseg-server/src/main/java/org/lionsoul/jcseg/json/zip/Zipper.java
Zipper.pad
public void pad(int width) throws JSONException { try { this.bitwriter.pad(width); } catch (Throwable e) { throw new JSONException(e); } }
java
public void pad(int width) throws JSONException { try { this.bitwriter.pad(width); } catch (Throwable e) { throw new JSONException(e); } }
[ "public", "void", "pad", "(", "int", "width", ")", "throws", "JSONException", "{", "try", "{", "this", ".", "bitwriter", ".", "pad", "(", "width", ")", ";", "}", "catch", "(", "Throwable", "e", ")", "{", "throw", "new", "JSONException", "(", "e", ")"...
Pad the output to fill an allotment of bits. @param width The size of the bit allotment. A value of 8 will complete and flush the current byte. If you don't pad, then some of the last bits might not be sent to the Output Stream. @throws JSONException
[ "Pad", "the", "output", "to", "fill", "an", "allotment", "of", "bits", "." ]
7c8a912e3bbcaf4f8de701180b9c24e2e444a94b
https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-server/src/main/java/org/lionsoul/jcseg/json/zip/Zipper.java#L124-L130
55,802
lionsoul2014/jcseg
jcseg-server/src/main/java/org/lionsoul/jcseg/json/zip/Zipper.java
Zipper.write
private void write(int integer, int width) throws JSONException { try { this.bitwriter.write(integer, width); if (probe) { log(integer, width); } } catch (Throwable e) { throw new JSONException(e); } }
java
private void write(int integer, int width) throws JSONException { try { this.bitwriter.write(integer, width); if (probe) { log(integer, width); } } catch (Throwable e) { throw new JSONException(e); } }
[ "private", "void", "write", "(", "int", "integer", ",", "int", "width", ")", "throws", "JSONException", "{", "try", "{", "this", ".", "bitwriter", ".", "write", "(", "integer", ",", "width", ")", ";", "if", "(", "probe", ")", "{", "log", "(", "intege...
Write a number, using the number of bits necessary to hold the number. @param integer The value to be encoded. @param width The number of bits to encode the value, between 0 and 32. @throws JSONException
[ "Write", "a", "number", "using", "the", "number", "of", "bits", "necessary", "to", "hold", "the", "number", "." ]
7c8a912e3bbcaf4f8de701180b9c24e2e444a94b
https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-server/src/main/java/org/lionsoul/jcseg/json/zip/Zipper.java#L141-L150
55,803
lionsoul2014/jcseg
jcseg-server/src/main/java/org/lionsoul/jcseg/json/zip/Zipper.java
Zipper.write
private void write(Kim kim, Huff huff, Huff ext) throws JSONException { for (int at = 0; at < kim.length; at += 1) { int c = kim.get(at); write(c, huff); while ((c & 128) == 128) { at += 1; c = kim.get(at); write(c, ext); ...
java
private void write(Kim kim, Huff huff, Huff ext) throws JSONException { for (int at = 0; at < kim.length; at += 1) { int c = kim.get(at); write(c, huff); while ((c & 128) == 128) { at += 1; c = kim.get(at); write(c, ext); ...
[ "private", "void", "write", "(", "Kim", "kim", ",", "Huff", "huff", ",", "Huff", "ext", ")", "throws", "JSONException", "{", "for", "(", "int", "at", "=", "0", ";", "at", "<", "kim", ".", "length", ";", "at", "+=", "1", ")", "{", "int", "c", "=...
Write each of the bytes in a kim with Huffman encoding. @param kim A kim containing the bytes to be written. @param huff The Huffman encoder. @param ext The Huffman encoder for the extended bytes. @throws JSONException
[ "Write", "each", "of", "the", "bytes", "in", "a", "kim", "with", "Huffman", "encoding", "." ]
7c8a912e3bbcaf4f8de701180b9c24e2e444a94b
https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-server/src/main/java/org/lionsoul/jcseg/json/zip/Zipper.java#L177-L187
55,804
lionsoul2014/jcseg
jcseg-server/src/main/java/org/lionsoul/jcseg/json/zip/Zipper.java
Zipper.write
private void write(int integer, Keep keep) throws JSONException { int width = keep.bitsize(); keep.tick(integer); if (probe) { log("\"" + keep.value(integer) + "\""); } write(integer, width); }
java
private void write(int integer, Keep keep) throws JSONException { int width = keep.bitsize(); keep.tick(integer); if (probe) { log("\"" + keep.value(integer) + "\""); } write(integer, width); }
[ "private", "void", "write", "(", "int", "integer", ",", "Keep", "keep", ")", "throws", "JSONException", "{", "int", "width", "=", "keep", ".", "bitsize", "(", ")", ";", "keep", ".", "tick", "(", "integer", ")", ";", "if", "(", "probe", ")", "{", "l...
Write an integer, using the number of bits necessary to hold the number as determined by its keep, and increment its usage count in the keep. @param integer The value to be encoded. @param keep The Keep that the integer is one of. @throws JSONException
[ "Write", "an", "integer", "using", "the", "number", "of", "bits", "necessary", "to", "hold", "the", "number", "as", "determined", "by", "its", "keep", "and", "increment", "its", "usage", "count", "in", "the", "keep", "." ]
7c8a912e3bbcaf4f8de701180b9c24e2e444a94b
https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-server/src/main/java/org/lionsoul/jcseg/json/zip/Zipper.java#L199-L206
55,805
lionsoul2014/jcseg
jcseg-server/src/main/java/org/lionsoul/jcseg/json/zip/Zipper.java
Zipper.write
private void write(JSONArray jsonarray) throws JSONException { // JSONzip has three encodings for arrays: // The array is empty (zipEmptyArray). // First value in the array is a string (zipArrayString). // First value in the array is not a string (zipArrayValue). boolean stringy = false; int length = ...
java
private void write(JSONArray jsonarray) throws JSONException { // JSONzip has three encodings for arrays: // The array is empty (zipEmptyArray). // First value in the array is a string (zipArrayString). // First value in the array is not a string (zipArrayValue). boolean stringy = false; int length = ...
[ "private", "void", "write", "(", "JSONArray", "jsonarray", ")", "throws", "JSONException", "{", "// JSONzip has three encodings for arrays:", "// The array is empty (zipEmptyArray).", "// First value in the array is a string (zipArrayString).", "// First value in the array is not a string ...
Write a JSON Array. @param jsonarray The JSONArray to write. @throws JSONException If the write fails.
[ "Write", "a", "JSON", "Array", "." ]
7c8a912e3bbcaf4f8de701180b9c24e2e444a94b
https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-server/src/main/java/org/lionsoul/jcseg/json/zip/Zipper.java#L214-L260
55,806
lionsoul2014/jcseg
jcseg-server/src/main/java/org/lionsoul/jcseg/json/zip/Zipper.java
Zipper.writeJSON
@SuppressWarnings({ "rawtypes", "unchecked" }) private void writeJSON(Object value) throws JSONException { if (JSONObject.NULL.equals(value)) { write(zipNull, 3); } else if (Boolean.FALSE.equals(value)) { write(zipFalse, 3); } else if (Boolean.TRUE.equals(value)) { ...
java
@SuppressWarnings({ "rawtypes", "unchecked" }) private void writeJSON(Object value) throws JSONException { if (JSONObject.NULL.equals(value)) { write(zipNull, 3); } else if (Boolean.FALSE.equals(value)) { write(zipFalse, 3); } else if (Boolean.TRUE.equals(value)) { ...
[ "@", "SuppressWarnings", "(", "{", "\"rawtypes\"", ",", "\"unchecked\"", "}", ")", "private", "void", "writeJSON", "(", "Object", "value", ")", "throws", "JSONException", "{", "if", "(", "JSONObject", ".", "NULL", ".", "equals", "(", "value", ")", ")", "{"...
Write a JSON value. @param value One of these types: JSONObject, JSONArray (or Map or Collection or array), Number (or Integer or Long or Double), or String, or Boolean, or JSONObject.NULL, or null. @throws JSONException
[ "Write", "a", "JSON", "value", "." ]
7c8a912e3bbcaf4f8de701180b9c24e2e444a94b
https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-server/src/main/java/org/lionsoul/jcseg/json/zip/Zipper.java#L271-L295
55,807
lionsoul2014/jcseg
jcseg-server/src/main/java/org/lionsoul/jcseg/json/zip/Zipper.java
Zipper.writeName
private void writeName(String name) throws JSONException { // If this name has already been registered, then emit its integer and // increment its usage count. Kim kim = new Kim(name); int integer = this.namekeep.find(kim); if (integer != none) { one(); write(integer, t...
java
private void writeName(String name) throws JSONException { // If this name has already been registered, then emit its integer and // increment its usage count. Kim kim = new Kim(name); int integer = this.namekeep.find(kim); if (integer != none) { one(); write(integer, t...
[ "private", "void", "writeName", "(", "String", "name", ")", "throws", "JSONException", "{", "// If this name has already been registered, then emit its integer and", "// increment its usage count.", "Kim", "kim", "=", "new", "Kim", "(", "name", ")", ";", "int", "integer",...
Write the name of an object property. Names have their own Keep and Huffman encoder because they are expected to be a more restricted set. @param name The name string. @throws JSONException
[ "Write", "the", "name", "of", "an", "object", "property", ".", "Names", "have", "their", "own", "Keep", "and", "Huffman", "encoder", "because", "they", "are", "expected", "to", "be", "a", "more", "restricted", "set", "." ]
7c8a912e3bbcaf4f8de701180b9c24e2e444a94b
https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-server/src/main/java/org/lionsoul/jcseg/json/zip/Zipper.java#L304-L323
55,808
lionsoul2014/jcseg
jcseg-server/src/main/java/org/lionsoul/jcseg/json/zip/Zipper.java
Zipper.write
private void write(JSONObject jsonobject) throws JSONException { // JSONzip has two encodings for objects: Empty Objects (zipEmptyObject) and // non-empty objects (zipObject). boolean first = true; Iterator<String> keys = jsonobject.keys(); while (keys.hasNext()) { if (probe) { ...
java
private void write(JSONObject jsonobject) throws JSONException { // JSONzip has two encodings for objects: Empty Objects (zipEmptyObject) and // non-empty objects (zipObject). boolean first = true; Iterator<String> keys = jsonobject.keys(); while (keys.hasNext()) { if (probe) { ...
[ "private", "void", "write", "(", "JSONObject", "jsonobject", ")", "throws", "JSONException", "{", "// JSONzip has two encodings for objects: Empty Objects (zipEmptyObject) and", "// non-empty objects (zipObject).", "boolean", "first", "=", "true", ";", "Iterator", "<", "String"...
Write a JSON object. @param jsonobject The JSONObject to be written. @throws JSONException
[ "Write", "a", "JSON", "object", "." ]
7c8a912e3bbcaf4f8de701180b9c24e2e444a94b
https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-server/src/main/java/org/lionsoul/jcseg/json/zip/Zipper.java#L331-L366
55,809
lionsoul2014/jcseg
jcseg-server/src/main/java/org/lionsoul/jcseg/json/zip/Zipper.java
Zipper.writeValue
private void writeValue(Object value) throws JSONException { if (value instanceof Number) { String string = JSONObject.numberToString((Number) value); int integer = this.valuekeep.find(string); if (integer != none) { write(2, 2); write(integer,...
java
private void writeValue(Object value) throws JSONException { if (value instanceof Number) { String string = JSONObject.numberToString((Number) value); int integer = this.valuekeep.find(string); if (integer != none) { write(2, 2); write(integer,...
[ "private", "void", "writeValue", "(", "Object", "value", ")", "throws", "JSONException", "{", "if", "(", "value", "instanceof", "Number", ")", "{", "String", "string", "=", "JSONObject", ".", "numberToString", "(", "(", "Number", ")", "value", ")", ";", "i...
Write a value. @param value One of these types: Boolean, Number, etc. @throws JSONException
[ "Write", "a", "value", "." ]
7c8a912e3bbcaf4f8de701180b9c24e2e444a94b
https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-server/src/main/java/org/lionsoul/jcseg/json/zip/Zipper.java#L411-L450
55,810
lionsoul2014/jcseg
jcseg-core/src/main/java/org/lionsoul/jcseg/extractor/KeywordsExtractor.java
KeywordsExtractor.filter
protected boolean filter(IWord word) { /* * normally word with length less than 2 will * be something, well could be ignored */ if ( word.getValue().length() < 2 ) { return false; } //type check switch ( word.getType() ) { ...
java
protected boolean filter(IWord word) { /* * normally word with length less than 2 will * be something, well could be ignored */ if ( word.getValue().length() < 2 ) { return false; } //type check switch ( word.getType() ) { ...
[ "protected", "boolean", "filter", "(", "IWord", "word", ")", "{", "/*\n * normally word with length less than 2 will\n * be something, well could be ignored \n */", "if", "(", "word", ".", "getValue", "(", ")", ".", "length", "(", ")", "<", "2", ")"...
word item filter @param word
[ "word", "item", "filter" ]
7c8a912e3bbcaf4f8de701180b9c24e2e444a94b
https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-core/src/main/java/org/lionsoul/jcseg/extractor/KeywordsExtractor.java#L39-L105
55,811
lionsoul2014/jcseg
jcseg-server/src/main/java/org/lionsoul/jcseg/server/core/Controller.java
Controller.init
private void init() { //request.setCharacterEncoding(setting.getCharset()); response.setCharacterEncoding(config.getCharset()); response.setContentType("text/html;charset="+config.getCharset()); response.setStatus(HttpServletResponse.SC_OK); }
java
private void init() { //request.setCharacterEncoding(setting.getCharset()); response.setCharacterEncoding(config.getCharset()); response.setContentType("text/html;charset="+config.getCharset()); response.setStatus(HttpServletResponse.SC_OK); }
[ "private", "void", "init", "(", ")", "{", "//request.setCharacterEncoding(setting.getCharset());", "response", ".", "setCharacterEncoding", "(", "config", ".", "getCharset", "(", ")", ")", ";", "response", ".", "setContentType", "(", "\"text/html;charset=\"", "+", "co...
request initialize work
[ "request", "initialize", "work" ]
7c8a912e3bbcaf4f8de701180b9c24e2e444a94b
https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-server/src/main/java/org/lionsoul/jcseg/server/core/Controller.java#L93-L99
55,812
lionsoul2014/jcseg
jcseg-server/src/main/java/org/lionsoul/jcseg/server/core/Controller.java
Controller.getInt
public int getInt(String name) { int val = 0; try { val = Integer.valueOf(request.getParameter(name)); } catch (NumberFormatException e) {} return val; }
java
public int getInt(String name) { int val = 0; try { val = Integer.valueOf(request.getParameter(name)); } catch (NumberFormatException e) {} return val; }
[ "public", "int", "getInt", "(", "String", "name", ")", "{", "int", "val", "=", "0", ";", "try", "{", "val", "=", "Integer", ".", "valueOf", "(", "request", ".", "getParameter", "(", "name", ")", ")", ";", "}", "catch", "(", "NumberFormatException", "...
get a integer arguments @param name @return int
[ "get", "a", "integer", "arguments" ]
7c8a912e3bbcaf4f8de701180b9c24e2e444a94b
https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-server/src/main/java/org/lionsoul/jcseg/server/core/Controller.java#L146-L154
55,813
lionsoul2014/jcseg
jcseg-server/src/main/java/org/lionsoul/jcseg/server/core/Controller.java
Controller.getFloat
public float getFloat(String name) { float fval = 0F; try { fval = Float.valueOf(request.getParameter(name)); } catch (NumberFormatException e) {} return fval; }
java
public float getFloat(String name) { float fval = 0F; try { fval = Float.valueOf(request.getParameter(name)); } catch (NumberFormatException e) {} return fval; }
[ "public", "float", "getFloat", "(", "String", "name", ")", "{", "float", "fval", "=", "0F", ";", "try", "{", "fval", "=", "Float", ".", "valueOf", "(", "request", ".", "getParameter", "(", "name", ")", ")", ";", "}", "catch", "(", "NumberFormatExceptio...
get a float arguments @param name @return float
[ "get", "a", "float", "arguments" ]
7c8a912e3bbcaf4f8de701180b9c24e2e444a94b
https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-server/src/main/java/org/lionsoul/jcseg/server/core/Controller.java#L169-L177
55,814
lionsoul2014/jcseg
jcseg-server/src/main/java/org/lionsoul/jcseg/server/core/Controller.java
Controller.getLong
public long getLong(String name) { long val = 0; try { val = Long.valueOf(request.getParameter(name)); } catch (NumberFormatException e) {} return val; }
java
public long getLong(String name) { long val = 0; try { val = Long.valueOf(request.getParameter(name)); } catch (NumberFormatException e) {} return val; }
[ "public", "long", "getLong", "(", "String", "name", ")", "{", "long", "val", "=", "0", ";", "try", "{", "val", "=", "Long", ".", "valueOf", "(", "request", ".", "getParameter", "(", "name", ")", ")", ";", "}", "catch", "(", "NumberFormatException", "...
get a long argument @param name @return long
[ "get", "a", "long", "argument" ]
7c8a912e3bbcaf4f8de701180b9c24e2e444a94b
https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-server/src/main/java/org/lionsoul/jcseg/server/core/Controller.java#L192-L200
55,815
lionsoul2014/jcseg
jcseg-server/src/main/java/org/lionsoul/jcseg/server/core/Controller.java
Controller.getDouble
public double getDouble(String name) { double val = 0; try { val = Double.valueOf(request.getParameter(name)); } catch (NumberFormatException e) {} return val; }
java
public double getDouble(String name) { double val = 0; try { val = Double.valueOf(request.getParameter(name)); } catch (NumberFormatException e) {} return val; }
[ "public", "double", "getDouble", "(", "String", "name", ")", "{", "double", "val", "=", "0", ";", "try", "{", "val", "=", "Double", ".", "valueOf", "(", "request", ".", "getParameter", "(", "name", ")", ")", ";", "}", "catch", "(", "NumberFormatExcepti...
get a double argument @param name @return double
[ "get", "a", "double", "argument" ]
7c8a912e3bbcaf4f8de701180b9c24e2e444a94b
https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-server/src/main/java/org/lionsoul/jcseg/server/core/Controller.java#L215-L223
55,816
lionsoul2014/jcseg
jcseg-server/src/main/java/org/lionsoul/jcseg/server/core/Controller.java
Controller.getBoolean
public boolean getBoolean(String name) { boolean val = false; try { val = Boolean.valueOf(request.getParameter(name)); } catch (NumberFormatException e) {} return val; }
java
public boolean getBoolean(String name) { boolean val = false; try { val = Boolean.valueOf(request.getParameter(name)); } catch (NumberFormatException e) {} return val; }
[ "public", "boolean", "getBoolean", "(", "String", "name", ")", "{", "boolean", "val", "=", "false", ";", "try", "{", "val", "=", "Boolean", ".", "valueOf", "(", "request", ".", "getParameter", "(", "name", ")", ")", ";", "}", "catch", "(", "NumberForma...
get a boolean argument @param name @return boolean
[ "get", "a", "boolean", "argument" ]
7c8a912e3bbcaf4f8de701180b9c24e2e444a94b
https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-server/src/main/java/org/lionsoul/jcseg/server/core/Controller.java#L238-L246
55,817
lionsoul2014/jcseg
jcseg-server/src/main/java/org/lionsoul/jcseg/server/core/Controller.java
Controller.getRawData
public byte[] getRawData() throws IOException { int contentLength = request.getContentLength(); if( contentLength<0 ) { return null; } byte[] buffer = new byte[contentLength]; ServletInputStream is = request.getInputStream(); for (int i = 0; i < c...
java
public byte[] getRawData() throws IOException { int contentLength = request.getContentLength(); if( contentLength<0 ) { return null; } byte[] buffer = new byte[contentLength]; ServletInputStream is = request.getInputStream(); for (int i = 0; i < c...
[ "public", "byte", "[", "]", "getRawData", "(", ")", "throws", "IOException", "{", "int", "contentLength", "=", "request", ".", "getContentLength", "(", ")", ";", "if", "(", "contentLength", "<", "0", ")", "{", "return", "null", ";", "}", "byte", "[", "...
get the original raw data @return byte[] @throws IOException
[ "get", "the", "original", "raw", "data" ]
7c8a912e3bbcaf4f8de701180b9c24e2e444a94b
https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-server/src/main/java/org/lionsoul/jcseg/server/core/Controller.java#L274-L293
55,818
lionsoul2014/jcseg
jcseg-server/src/main/java/org/lionsoul/jcseg/server/core/Controller.java
Controller.getRawDataAsString
public String getRawDataAsString() throws IOException { byte[] buffer = getRawData(); if ( buffer == null ) { return null; } String encoding = request.getCharacterEncoding(); if ( encoding == null ) { encoding = "utf-8"; } ...
java
public String getRawDataAsString() throws IOException { byte[] buffer = getRawData(); if ( buffer == null ) { return null; } String encoding = request.getCharacterEncoding(); if ( encoding == null ) { encoding = "utf-8"; } ...
[ "public", "String", "getRawDataAsString", "(", ")", "throws", "IOException", "{", "byte", "[", "]", "buffer", "=", "getRawData", "(", ")", ";", "if", "(", "buffer", "==", "null", ")", "{", "return", "null", ";", "}", "String", "encoding", "=", "request",...
get the original request raw data as String @return String @throws IOException
[ "get", "the", "original", "request", "raw", "data", "as", "String" ]
7c8a912e3bbcaf4f8de701180b9c24e2e444a94b
https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-server/src/main/java/org/lionsoul/jcseg/server/core/Controller.java#L301-L314
55,819
lionsoul2014/jcseg
jcseg-server/src/main/java/org/lionsoul/jcseg/server/core/Controller.java
Controller.getRawDataAsJson
public JSONObject getRawDataAsJson() throws IOException { String input = getRawDataAsString(); if ( input == null ) { return null; } return new JSONObject(input); }
java
public JSONObject getRawDataAsJson() throws IOException { String input = getRawDataAsString(); if ( input == null ) { return null; } return new JSONObject(input); }
[ "public", "JSONObject", "getRawDataAsJson", "(", ")", "throws", "IOException", "{", "String", "input", "=", "getRawDataAsString", "(", ")", ";", "if", "(", "input", "==", "null", ")", "{", "return", "null", ";", "}", "return", "new", "JSONObject", "(", "in...
get the original request raw data as json @return JSONObject @throws IOException
[ "get", "the", "original", "request", "raw", "data", "as", "json" ]
7c8a912e3bbcaf4f8de701180b9c24e2e444a94b
https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-server/src/main/java/org/lionsoul/jcseg/server/core/Controller.java#L322-L330
55,820
lionsoul2014/jcseg
jcseg-server/src/main/java/org/lionsoul/jcseg/json/zip/JSONzip.java
JSONzip.logchar
static void logchar(int integer, int width) { if (integer > ' ' && integer <= '}') { log("'" + (char) integer + "':" + width + " "); } else { log(integer, width); } }
java
static void logchar(int integer, int width) { if (integer > ' ' && integer <= '}') { log("'" + (char) integer + "':" + width + " "); } else { log(integer, width); } }
[ "static", "void", "logchar", "(", "int", "integer", ",", "int", "width", ")", "{", "if", "(", "integer", ">", "'", "'", "&&", "integer", "<=", "'", "'", ")", "{", "log", "(", "\"'\"", "+", "(", "char", ")", "integer", "+", "\"':\"", "+", "width",...
Write a character or its code to the console. @param integer The charcode to be written to the log. @param width The width of the charcode in bits.
[ "Write", "a", "character", "or", "its", "code", "to", "the", "console", "." ]
7c8a912e3bbcaf4f8de701180b9c24e2e444a94b
https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-server/src/main/java/org/lionsoul/jcseg/json/zip/JSONzip.java#L231-L237
55,821
lionsoul2014/jcseg
jcseg-server/src/main/java/org/lionsoul/jcseg/json/zip/JSONzip.java
JSONzip.postMortem
public boolean postMortem(PostMortem pm) { JSONzip that = (JSONzip) pm; return this.namehuff.postMortem(that.namehuff) && this.namekeep.postMortem(that.namekeep) && this.stringkeep.postMortem(that.stringkeep) && this.stringhuff.postMortem(that.stringhuff) ...
java
public boolean postMortem(PostMortem pm) { JSONzip that = (JSONzip) pm; return this.namehuff.postMortem(that.namehuff) && this.namekeep.postMortem(that.namekeep) && this.stringkeep.postMortem(that.stringkeep) && this.stringhuff.postMortem(that.stringhuff) ...
[ "public", "boolean", "postMortem", "(", "PostMortem", "pm", ")", "{", "JSONzip", "that", "=", "(", "JSONzip", ")", "pm", ";", "return", "this", ".", "namehuff", ".", "postMortem", "(", "that", ".", "namehuff", ")", "&&", "this", ".", "namekeep", ".", "...
This method is used for testing the implementation of JSONzip. It is not suitable for any other purpose. It is used to compare a Compressor and a Decompressor, verifying that the data structures that were built during zipping and unzipping were the same. @return true if the structures match.
[ "This", "method", "is", "used", "for", "testing", "the", "implementation", "of", "JSONzip", ".", "It", "is", "not", "suitable", "for", "any", "other", "purpose", ".", "It", "is", "used", "to", "compare", "a", "Compressor", "and", "a", "Decompressor", "veri...
7c8a912e3bbcaf4f8de701180b9c24e2e444a94b
https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-server/src/main/java/org/lionsoul/jcseg/json/zip/JSONzip.java#L247-L254
55,822
lionsoul2014/jcseg
jcseg-server/src/main/java/org/lionsoul/jcseg/json/zip/Huff.java
Huff.postMortem
public boolean postMortem(PostMortem pm) { // Go through every integer in the domain, generating its bit sequence, and // then prove that that bit sequence produces the same integer. for (int integer = 0; integer < this.domain; integer += 1) { if (!postMortem(integer)) { JSONzip.lo...
java
public boolean postMortem(PostMortem pm) { // Go through every integer in the domain, generating its bit sequence, and // then prove that that bit sequence produces the same integer. for (int integer = 0; integer < this.domain; integer += 1) { if (!postMortem(integer)) { JSONzip.lo...
[ "public", "boolean", "postMortem", "(", "PostMortem", "pm", ")", "{", "// Go through every integer in the domain, generating its bit sequence, and", "// then prove that that bit sequence produces the same integer.", "for", "(", "int", "integer", "=", "0", ";", "integer", "<", "...
Compare two Huffman tables.
[ "Compare", "two", "Huffman", "tables", "." ]
7c8a912e3bbcaf4f8de701180b9c24e2e444a94b
https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-server/src/main/java/org/lionsoul/jcseg/json/zip/Huff.java#L302-L315
55,823
lionsoul2014/jcseg
jcseg-server/src/main/java/org/lionsoul/jcseg/json/zip/Huff.java
Huff.read
public int read(BitReader bitreader) throws JSONException { try { this.width = 0; Symbol symbol = this.table; while (symbol.integer == none) { this.width += 1; symbol = bitreader.bit() ? symbol.one : symbol.zero; } tick(...
java
public int read(BitReader bitreader) throws JSONException { try { this.width = 0; Symbol symbol = this.table; while (symbol.integer == none) { this.width += 1; symbol = bitreader.bit() ? symbol.one : symbol.zero; } tick(...
[ "public", "int", "read", "(", "BitReader", "bitreader", ")", "throws", "JSONException", "{", "try", "{", "this", ".", "width", "=", "0", ";", "Symbol", "symbol", "=", "this", ".", "table", ";", "while", "(", "symbol", ".", "integer", "==", "none", ")",...
Read bits until a symbol can be identified. The weight of the read symbol will be incremented. @param bitreader The source of bits. @return The integer value of the symbol. @throws JSONException
[ "Read", "bits", "until", "a", "symbol", "can", "be", "identified", ".", "The", "weight", "of", "the", "read", "symbol", "will", "be", "incremented", "." ]
7c8a912e3bbcaf4f8de701180b9c24e2e444a94b
https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-server/src/main/java/org/lionsoul/jcseg/json/zip/Huff.java#L326-L342
55,824
lionsoul2014/jcseg
jcseg-server/src/main/java/org/lionsoul/jcseg/json/zip/Huff.java
Huff.write
private void write(Symbol symbol, BitWriter bitwriter) throws JSONException { try { Symbol back = symbol.back; if (back != null) { this.width += 1; write(back, bitwriter); if (back.zero == symbol) { bitwriter...
java
private void write(Symbol symbol, BitWriter bitwriter) throws JSONException { try { Symbol back = symbol.back; if (back != null) { this.width += 1; write(back, bitwriter); if (back.zero == symbol) { bitwriter...
[ "private", "void", "write", "(", "Symbol", "symbol", ",", "BitWriter", "bitwriter", ")", "throws", "JSONException", "{", "try", "{", "Symbol", "back", "=", "symbol", ".", "back", ";", "if", "(", "back", "!=", "null", ")", "{", "this", ".", "width", "+=...
Recur from a symbol back, emitting bits. We recur before emitting to make the bits come out in the right order. @param symbol The symbol to write. @param bitwriter The bitwriter to write it to. @throws JSONException
[ "Recur", "from", "a", "symbol", "back", "emitting", "bits", ".", "We", "recur", "before", "emitting", "to", "make", "the", "bits", "come", "out", "in", "the", "right", "order", "." ]
7c8a912e3bbcaf4f8de701180b9c24e2e444a94b
https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-server/src/main/java/org/lionsoul/jcseg/json/zip/Huff.java#L368-L384
55,825
lionsoul2014/jcseg
jcseg-server/src/main/java/org/lionsoul/jcseg/json/zip/Huff.java
Huff.write
public void write(int value, BitWriter bitwriter) throws JSONException { this.width = 0; write(this.symbols[value], bitwriter); tick(value); if (JSONzip.probe) { JSONzip.logchar(value, this.width); } }
java
public void write(int value, BitWriter bitwriter) throws JSONException { this.width = 0; write(this.symbols[value], bitwriter); tick(value); if (JSONzip.probe) { JSONzip.logchar(value, this.width); } }
[ "public", "void", "write", "(", "int", "value", ",", "BitWriter", "bitwriter", ")", "throws", "JSONException", "{", "this", ".", "width", "=", "0", ";", "write", "(", "this", ".", "symbols", "[", "value", "]", ",", "bitwriter", ")", ";", "tick", "(", ...
Write the bits corresponding to a symbol. The weight of the symbol will be incremented. @param value The number of the symbol to write @param bitwriter The destination of the bits. @throws JSONException
[ "Write", "the", "bits", "corresponding", "to", "a", "symbol", ".", "The", "weight", "of", "the", "symbol", "will", "be", "incremented", "." ]
7c8a912e3bbcaf4f8de701180b9c24e2e444a94b
https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-server/src/main/java/org/lionsoul/jcseg/json/zip/Huff.java#L396-L403
55,826
lionsoul2014/jcseg
jcseg-server/src/main/java/org/lionsoul/jcseg/json/zip/Unzipper.java
Unzipper.bit
private boolean bit() throws JSONException { boolean value; try { value = this.bitreader.bit(); if (probe) { log(value ? 1 : 0); } return value; } catch (Throwable e) { throw new JSONException(e); } }
java
private boolean bit() throws JSONException { boolean value; try { value = this.bitreader.bit(); if (probe) { log(value ? 1 : 0); } return value; } catch (Throwable e) { throw new JSONException(e); } }
[ "private", "boolean", "bit", "(", ")", "throws", "JSONException", "{", "boolean", "value", ";", "try", "{", "value", "=", "this", ".", "bitreader", ".", "bit", "(", ")", ";", "if", "(", "probe", ")", "{", "log", "(", "value", "?", "1", ":", "0", ...
Read one bit. @return true if 1, false if 0. @throws JSONException
[ "Read", "one", "bit", "." ]
7c8a912e3bbcaf4f8de701180b9c24e2e444a94b
https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-server/src/main/java/org/lionsoul/jcseg/json/zip/Unzipper.java#L64-L76
55,827
lionsoul2014/jcseg
jcseg-server/src/main/java/org/lionsoul/jcseg/json/zip/Unzipper.java
Unzipper.getAndTick
private Object getAndTick(Keep keep, BitReader bitreader) throws JSONException { try { int width = keep.bitsize(); int integer = bitreader.read(width); Object value = keep.value(integer); if (JSONzip.probe) { JSONzip.log("\"" + value + ...
java
private Object getAndTick(Keep keep, BitReader bitreader) throws JSONException { try { int width = keep.bitsize(); int integer = bitreader.read(width); Object value = keep.value(integer); if (JSONzip.probe) { JSONzip.log("\"" + value + ...
[ "private", "Object", "getAndTick", "(", "Keep", "keep", ",", "BitReader", "bitreader", ")", "throws", "JSONException", "{", "try", "{", "int", "width", "=", "keep", ".", "bitsize", "(", ")", ";", "int", "integer", "=", "bitreader", ".", "read", "(", "wid...
Read enough bits to obtain an integer from the keep, and increase that integer's weight. @param keep The keep providing the context. @param bitreader The bitreader that is the source of bits. @return The value associated with the number. @throws JSONException
[ "Read", "enough", "bits", "to", "obtain", "an", "integer", "from", "the", "keep", "and", "increase", "that", "integer", "s", "weight", "." ]
7c8a912e3bbcaf4f8de701180b9c24e2e444a94b
https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-server/src/main/java/org/lionsoul/jcseg/json/zip/Unzipper.java#L87-L105
55,828
lionsoul2014/jcseg
jcseg-server/src/main/java/org/lionsoul/jcseg/json/zip/Unzipper.java
Unzipper.read
private int read(int width) throws JSONException { try { int value = this.bitreader.read(width); if (probe) { log(value, width); } return value; } catch (Throwable e) { throw new JSONException(e); } }
java
private int read(int width) throws JSONException { try { int value = this.bitreader.read(width); if (probe) { log(value, width); } return value; } catch (Throwable e) { throw new JSONException(e); } }
[ "private", "int", "read", "(", "int", "width", ")", "throws", "JSONException", "{", "try", "{", "int", "value", "=", "this", ".", "bitreader", ".", "read", "(", "width", ")", ";", "if", "(", "probe", ")", "{", "log", "(", "value", ",", "width", ")"...
Read an integer, specifying its width in bits. @param width 0 to 32. @return An unsigned integer. @throws JSONException
[ "Read", "an", "integer", "specifying", "its", "width", "in", "bits", "." ]
7c8a912e3bbcaf4f8de701180b9c24e2e444a94b
https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-server/src/main/java/org/lionsoul/jcseg/json/zip/Unzipper.java#L131-L141
55,829
lionsoul2014/jcseg
jcseg-server/src/main/java/org/lionsoul/jcseg/json/zip/Unzipper.java
Unzipper.read
private String read(Huff huff, Huff ext, Keep keep) throws JSONException { Kim kim; int at = 0; int allocation = 256; byte[] bytes = new byte[allocation]; if (bit()) { return getAndTick(keep, this.bitreader).toString(); } while (true) { if ...
java
private String read(Huff huff, Huff ext, Keep keep) throws JSONException { Kim kim; int at = 0; int allocation = 256; byte[] bytes = new byte[allocation]; if (bit()) { return getAndTick(keep, this.bitreader).toString(); } while (true) { if ...
[ "private", "String", "read", "(", "Huff", "huff", ",", "Huff", "ext", ",", "Keep", "keep", ")", "throws", "JSONException", "{", "Kim", "kim", ";", "int", "at", "=", "0", ";", "int", "allocation", "=", "256", ";", "byte", "[", "]", "bytes", "=", "ne...
Read Huffman encoded characters into a keep. @param huff A Huffman decoder. @param ext A Huffman decoder for the extended bytes. @param keep The keep that will receive the kim. @return The string that was read. @throws JSONException
[ "Read", "Huffman", "encoded", "characters", "into", "a", "keep", "." ]
7c8a912e3bbcaf4f8de701180b9c24e2e444a94b
https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-server/src/main/java/org/lionsoul/jcseg/json/zip/Unzipper.java#L151-L182
55,830
lionsoul2014/jcseg
jcseg-server/src/main/java/org/lionsoul/jcseg/json/zip/Unzipper.java
Unzipper.readArray
private JSONArray readArray(boolean stringy) throws JSONException { JSONArray jsonarray = new JSONArray(); jsonarray.put(stringy ? read(this.stringhuff, this.stringhuffext, this.stringkeep) : readValue()); while (true) { if (probe) { lo...
java
private JSONArray readArray(boolean stringy) throws JSONException { JSONArray jsonarray = new JSONArray(); jsonarray.put(stringy ? read(this.stringhuff, this.stringhuffext, this.stringkeep) : readValue()); while (true) { if (probe) { lo...
[ "private", "JSONArray", "readArray", "(", "boolean", "stringy", ")", "throws", "JSONException", "{", "JSONArray", "jsonarray", "=", "new", "JSONArray", "(", ")", ";", "jsonarray", ".", "put", "(", "stringy", "?", "read", "(", "this", ".", "stringhuff", ",", ...
Read a JSONArray. @param stringy true if the first element is a string. @throws JSONException
[ "Read", "a", "JSONArray", "." ]
7c8a912e3bbcaf4f8de701180b9c24e2e444a94b
https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-server/src/main/java/org/lionsoul/jcseg/json/zip/Unzipper.java#L191-L215
55,831
lionsoul2014/jcseg
jcseg-server/src/main/java/org/lionsoul/jcseg/json/zip/Unzipper.java
Unzipper.readJSON
private Object readJSON() throws JSONException { switch (read(3)) { case zipObject: return readObject(); case zipArrayString: return readArray(true); case zipArrayValue: return readArray(false); case zipEmptyObject: return new JSONO...
java
private Object readJSON() throws JSONException { switch (read(3)) { case zipObject: return readObject(); case zipArrayString: return readArray(true); case zipArrayValue: return readArray(false); case zipEmptyObject: return new JSONO...
[ "private", "Object", "readJSON", "(", ")", "throws", "JSONException", "{", "switch", "(", "read", "(", "3", ")", ")", "{", "case", "zipObject", ":", "return", "readObject", "(", ")", ";", "case", "zipArrayString", ":", "return", "readArray", "(", "true", ...
Read a JSON value. The type of value is determined by the next 3 bits. @return The read value. @throws JSONException
[ "Read", "a", "JSON", "value", ".", "The", "type", "of", "value", "is", "determined", "by", "the", "next", "3", "bits", "." ]
7c8a912e3bbcaf4f8de701180b9c24e2e444a94b
https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-server/src/main/java/org/lionsoul/jcseg/json/zip/Unzipper.java#L223-L242
55,832
lionsoul2014/jcseg
jcseg-core/src/main/java/org/lionsoul/jcseg/util/IntArrayList.java
IntArrayList.add
public void add( int val ) { if ( size == items.length ) resize( items.length * 2 + 1 ); items[size++] = val; }
java
public void add( int val ) { if ( size == items.length ) resize( items.length * 2 + 1 ); items[size++] = val; }
[ "public", "void", "add", "(", "int", "val", ")", "{", "if", "(", "size", "==", "items", ".", "length", ")", "resize", "(", "items", ".", "length", "*", "2", "+", "1", ")", ";", "items", "[", "size", "++", "]", "=", "val", ";", "}" ]
Append a new Integer to the end. @param val
[ "Append", "a", "new", "Integer", "to", "the", "end", "." ]
7c8a912e3bbcaf4f8de701180b9c24e2e444a94b
https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-core/src/main/java/org/lionsoul/jcseg/util/IntArrayList.java#L45-L50
55,833
lionsoul2014/jcseg
jcseg-core/src/main/java/org/lionsoul/jcseg/util/IntArrayList.java
IntArrayList.remove
public void remove( int idx ) { if ( idx < 0 || idx > size ) throw new IndexOutOfBoundsException(); int numMove = size - idx - 1; if ( numMove > 0 ) System.arraycopy(items, idx + 1, items, idx, numMove); size--; }
java
public void remove( int idx ) { if ( idx < 0 || idx > size ) throw new IndexOutOfBoundsException(); int numMove = size - idx - 1; if ( numMove > 0 ) System.arraycopy(items, idx + 1, items, idx, numMove); size--; }
[ "public", "void", "remove", "(", "int", "idx", ")", "{", "if", "(", "idx", "<", "0", "||", "idx", ">", "size", ")", "throw", "new", "IndexOutOfBoundsException", "(", ")", ";", "int", "numMove", "=", "size", "-", "idx", "-", "1", ";", "if", "(", "...
remove the element at the specified position use System.arraycopy instead of a loop may be more efficient @param idx
[ "remove", "the", "element", "at", "the", "specified", "position", "use", "System", ".", "arraycopy", "instead", "of", "a", "loop", "may", "be", "more", "efficient" ]
7c8a912e3bbcaf4f8de701180b9c24e2e444a94b
https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-core/src/main/java/org/lionsoul/jcseg/util/IntArrayList.java#L72-L80
55,834
lionsoul2014/jcseg
jcseg-server/src/main/java/org/lionsoul/jcseg/json/JSONArray.java
JSONArray.put
public JSONArray put(int index, Map<String, Object> value) throws JSONException { this.put(index, new JSONObject(value)); return this; }
java
public JSONArray put(int index, Map<String, Object> value) throws JSONException { this.put(index, new JSONObject(value)); return this; }
[ "public", "JSONArray", "put", "(", "int", "index", ",", "Map", "<", "String", ",", "Object", ">", "value", ")", "throws", "JSONException", "{", "this", ".", "put", "(", "index", ",", "new", "JSONObject", "(", "value", ")", ")", ";", "return", "this", ...
Put a value in the JSONArray, where the value will be a JSONObject that is produced from a Map. @param index The subscript. @param value The Map value. @return this. @throws JSONException If the index is negative or if the the value is an invalid number.
[ "Put", "a", "value", "in", "the", "JSONArray", "where", "the", "value", "will", "be", "a", "JSONObject", "that", "is", "produced", "from", "a", "Map", "." ]
7c8a912e3bbcaf4f8de701180b9c24e2e444a94b
https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-server/src/main/java/org/lionsoul/jcseg/json/JSONArray.java#L770-L773
55,835
lionsoul2014/jcseg
jcseg-server/src/main/java/org/lionsoul/jcseg/json/JSONArray.java
JSONArray.similar
public boolean similar(Object other) { if (!(other instanceof JSONArray)) { return false; } int len = this.length(); if (len != ((JSONArray)other).length()) { return false; } for (int i = 0; i < len; i += 1) { Object valueThis = this.ge...
java
public boolean similar(Object other) { if (!(other instanceof JSONArray)) { return false; } int len = this.length(); if (len != ((JSONArray)other).length()) { return false; } for (int i = 0; i < len; i += 1) { Object valueThis = this.ge...
[ "public", "boolean", "similar", "(", "Object", "other", ")", "{", "if", "(", "!", "(", "other", "instanceof", "JSONArray", ")", ")", "{", "return", "false", ";", "}", "int", "len", "=", "this", ".", "length", "(", ")", ";", "if", "(", "len", "!=", ...
Determine if two JSONArrays are similar. They must contain similar sequences. @param other The other JSONArray @return true if they are equal
[ "Determine", "if", "two", "JSONArrays", "are", "similar", ".", "They", "must", "contain", "similar", "sequences", "." ]
7c8a912e3bbcaf4f8de701180b9c24e2e444a94b
https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-server/src/main/java/org/lionsoul/jcseg/json/JSONArray.java#L828-L852
55,836
lionsoul2014/jcseg
jcseg-server/src/main/java/org/lionsoul/jcseg/json/Kim.java
Kim.copy
public int copy(byte[] bytes, int at) { System.arraycopy(this.bytes, 0, bytes, at, this.length); return at + this.length; }
java
public int copy(byte[] bytes, int at) { System.arraycopy(this.bytes, 0, bytes, at, this.length); return at + this.length; }
[ "public", "int", "copy", "(", "byte", "[", "]", "bytes", ",", "int", "at", ")", "{", "System", ".", "arraycopy", "(", "this", ".", "bytes", ",", "0", ",", "bytes", ",", "at", ",", "this", ".", "length", ")", ";", "return", "at", "+", "this", "....
Copy the contents of this kim to a byte array. @param bytes A byte array of sufficient size. @param at The position within the byte array to take the byes. @return The position immediately after the copy.
[ "Copy", "the", "contents", "of", "this", "kim", "to", "a", "byte", "array", "." ]
7c8a912e3bbcaf4f8de701180b9c24e2e444a94b
https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-server/src/main/java/org/lionsoul/jcseg/json/Kim.java#L292-L295
55,837
lionsoul2014/jcseg
jcseg-server/src/main/java/org/lionsoul/jcseg/json/Kim.java
Kim.get
public int get(int at) throws JSONException { if (at < 0 || at > this.length) { throw new JSONException("Bad character at " + at); } return ((int) this.bytes[at]) & 0xFF; }
java
public int get(int at) throws JSONException { if (at < 0 || at > this.length) { throw new JSONException("Bad character at " + at); } return ((int) this.bytes[at]) & 0xFF; }
[ "public", "int", "get", "(", "int", "at", ")", "throws", "JSONException", "{", "if", "(", "at", "<", "0", "||", "at", ">", "this", ".", "length", ")", "{", "throw", "new", "JSONException", "(", "\"Bad character at \"", "+", "at", ")", ";", "}", "retu...
Get a byte from a kim. @param at The position of the byte. The first byte is at 0. @return The byte. @throws JSONException if there is no byte at that position.
[ "Get", "a", "byte", "from", "a", "kim", "." ]
7c8a912e3bbcaf4f8de701180b9c24e2e444a94b
https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-server/src/main/java/org/lionsoul/jcseg/json/Kim.java#L328-L333
55,838
lionsoul2014/jcseg
jcseg-core/src/main/java/org/lionsoul/jcseg/tokenizer/ASegment.java
ASegment.reset
public void reset( Reader input ) throws IOException { if ( input != null ) { reader = new IPushbackReader(new BufferedReader(input)); } idx = -1; }
java
public void reset( Reader input ) throws IOException { if ( input != null ) { reader = new IPushbackReader(new BufferedReader(input)); } idx = -1; }
[ "public", "void", "reset", "(", "Reader", "input", ")", "throws", "IOException", "{", "if", "(", "input", "!=", "null", ")", "{", "reader", "=", "new", "IPushbackReader", "(", "new", "BufferedReader", "(", "input", ")", ")", ";", "}", "idx", "=", "-", ...
input stream and reader reset. @param input @throws IOException
[ "input", "stream", "and", "reader", "reset", "." ]
7c8a912e3bbcaf4f8de701180b9c24e2e444a94b
https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-core/src/main/java/org/lionsoul/jcseg/tokenizer/ASegment.java#L99-L106
55,839
lionsoul2014/jcseg
jcseg-core/src/main/java/org/lionsoul/jcseg/tokenizer/ASegment.java
ASegment.pushBack
protected void pushBack(String str) { char[] chars = str.toCharArray(); for ( int j = chars.length - 1; j >= 0; j-- ) { reader.unread(chars[j]); } idx -= chars.length; }
java
protected void pushBack(String str) { char[] chars = str.toCharArray(); for ( int j = chars.length - 1; j >= 0; j-- ) { reader.unread(chars[j]); } idx -= chars.length; }
[ "protected", "void", "pushBack", "(", "String", "str", ")", "{", "char", "[", "]", "chars", "=", "str", ".", "toCharArray", "(", ")", ";", "for", "(", "int", "j", "=", "chars", ".", "length", "-", "1", ";", "j", ">=", "0", ";", "j", "--", ")", ...
push back a string to the stream @param str
[ "push", "back", "a", "string", "to", "the", "stream" ]
7c8a912e3bbcaf4f8de701180b9c24e2e444a94b
https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-core/src/main/java/org/lionsoul/jcseg/tokenizer/ASegment.java#L137-L144
55,840
lionsoul2014/jcseg
jcseg-core/src/main/java/org/lionsoul/jcseg/tokenizer/ASegment.java
ASegment.getNextLatinWord
protected IWord getNextLatinWord(int c, int pos) throws IOException { /* * clear or just return the English punctuation as * a single word with PUNCTUATION type and part of speech */ if ( StringUtil.isEnPunctuation( c ) ) { String str = String.valueOf((char)c);...
java
protected IWord getNextLatinWord(int c, int pos) throws IOException { /* * clear or just return the English punctuation as * a single word with PUNCTUATION type and part of speech */ if ( StringUtil.isEnPunctuation( c ) ) { String str = String.valueOf((char)c);...
[ "protected", "IWord", "getNextLatinWord", "(", "int", "c", ",", "int", "pos", ")", "throws", "IOException", "{", "/*\n * clear or just return the English punctuation as\n * a single word with PUNCTUATION type and part of speech \n */", "if", "(", "StringUtil", ...
get the next Latin word from the current position of the input stream @param c @param pos @return IWord could be null and that mean we reached a stop word @throws IOException
[ "get", "the", "next", "Latin", "word", "from", "the", "current", "position", "of", "the", "input", "stream" ]
7c8a912e3bbcaf4f8de701180b9c24e2e444a94b
https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-core/src/main/java/org/lionsoul/jcseg/tokenizer/ASegment.java#L587-L629
55,841
lionsoul2014/jcseg
jcseg-core/src/main/java/org/lionsoul/jcseg/tokenizer/ASegment.java
ASegment.getNextMixedWord
protected IWord getNextMixedWord(char[] chars, int cjkidx) throws IOException { IStringBuffer buff = new IStringBuffer(); buff.clear().append(chars, cjkidx); String tstring = buff.toString(); if ( ! dic.match(ILexicon.MIX_ASSIST_WORD, tstring) ) { return null; } ...
java
protected IWord getNextMixedWord(char[] chars, int cjkidx) throws IOException { IStringBuffer buff = new IStringBuffer(); buff.clear().append(chars, cjkidx); String tstring = buff.toString(); if ( ! dic.match(ILexicon.MIX_ASSIST_WORD, tstring) ) { return null; } ...
[ "protected", "IWord", "getNextMixedWord", "(", "char", "[", "]", "chars", ",", "int", "cjkidx", ")", "throws", "IOException", "{", "IStringBuffer", "buff", "=", "new", "IStringBuffer", "(", ")", ";", "buff", ".", "clear", "(", ")", ".", "append", "(", "c...
get the next mixed word, CJK-English or CJK-English-CJK or whatever @param chars @param cjkidx @return IWord or null for nothing found @throws IOException
[ "get", "the", "next", "mixed", "word", "CJK", "-", "English", "or", "CJK", "-", "English", "-", "CJK", "or", "whatever" ]
7c8a912e3bbcaf4f8de701180b9c24e2e444a94b
https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-core/src/main/java/org/lionsoul/jcseg/tokenizer/ASegment.java#L639-L689
55,842
lionsoul2014/jcseg
jcseg-core/src/main/java/org/lionsoul/jcseg/tokenizer/ASegment.java
ASegment.getNextPunctuationPairWord
protected IWord getNextPunctuationPairWord(int c, int pos) throws IOException { IWord w = null, w2 = null; String text = getPairPunctuationText(c); //handle the punctuation. String str = String.valueOf((char)c); if ( ! ( config.CLEAR_STOPWORD && dic....
java
protected IWord getNextPunctuationPairWord(int c, int pos) throws IOException { IWord w = null, w2 = null; String text = getPairPunctuationText(c); //handle the punctuation. String str = String.valueOf((char)c); if ( ! ( config.CLEAR_STOPWORD && dic....
[ "protected", "IWord", "getNextPunctuationPairWord", "(", "int", "c", ",", "int", "pos", ")", "throws", "IOException", "{", "IWord", "w", "=", "null", ",", "w2", "=", "null", ";", "String", "text", "=", "getPairPunctuationText", "(", "c", ")", ";", "//handl...
get the next punctuation pair word from the current position of the input stream. @param c @param pos @return IWord could be null and that mean we reached a stop word @throws IOException
[ "get", "the", "next", "punctuation", "pair", "word", "from", "the", "current", "position", "of", "the", "input", "stream", "." ]
7c8a912e3bbcaf4f8de701180b9c24e2e444a94b
https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-core/src/main/java/org/lionsoul/jcseg/tokenizer/ASegment.java#L700-L736
55,843
lionsoul2014/jcseg
jcseg-core/src/main/java/org/lionsoul/jcseg/tokenizer/ASegment.java
ASegment.appendWordFeatures
protected void appendWordFeatures( IWord word ) { //add the pinyin to the pool if ( config.APPEND_CJK_PINYIN && config.LOAD_CJK_PINYIN && word.getPinyin() != null ) { IWord pinyin = new Word(word.getPinyin(), IWord.T_CJK_PINYIN); pinyin.setPosition(word.getPo...
java
protected void appendWordFeatures( IWord word ) { //add the pinyin to the pool if ( config.APPEND_CJK_PINYIN && config.LOAD_CJK_PINYIN && word.getPinyin() != null ) { IWord pinyin = new Word(word.getPinyin(), IWord.T_CJK_PINYIN); pinyin.setPosition(word.getPo...
[ "protected", "void", "appendWordFeatures", "(", "IWord", "word", ")", "{", "//add the pinyin to the pool", "if", "(", "config", ".", "APPEND_CJK_PINYIN", "&&", "config", ".", "LOAD_CJK_PINYIN", "&&", "word", ".", "getPinyin", "(", ")", "!=", "null", ")", "{", ...
check and append the pinyin and the synonyms words of the specified word @param word
[ "check", "and", "append", "the", "pinyin", "and", "the", "synonyms", "words", "of", "the", "specified", "word" ]
7c8a912e3bbcaf4f8de701180b9c24e2e444a94b
https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-core/src/main/java/org/lionsoul/jcseg/tokenizer/ASegment.java#L743-L759
55,844
lionsoul2014/jcseg
jcseg-core/src/main/java/org/lionsoul/jcseg/tokenizer/ASegment.java
ASegment.appendLatinSyn
protected void appendLatinSyn( IWord w ) { IWord ew; /* * @added 2014-07-07 * w maybe EC_MIX_WORD, so check its syn first * and make sure it is not a EC_MIX_WORD then check the EN_WORD */ if ( w.getSyn() == null ) { ew = dic.get(ILexic...
java
protected void appendLatinSyn( IWord w ) { IWord ew; /* * @added 2014-07-07 * w maybe EC_MIX_WORD, so check its syn first * and make sure it is not a EC_MIX_WORD then check the EN_WORD */ if ( w.getSyn() == null ) { ew = dic.get(ILexic...
[ "protected", "void", "appendLatinSyn", "(", "IWord", "w", ")", "{", "IWord", "ew", ";", "/*\n * @added 2014-07-07\n * w maybe EC_MIX_WORD, so check its syn first\n * and make sure it is not a EC_MIX_WORD then check the EN_WORD \n */", "if", "(", "w", ".",...
Check and append the synonyms words of specified word included the CJK and basic Latin words All the synonyms words share the same position part of speech, word type with the primitive word @param w
[ "Check", "and", "append", "the", "synonyms", "words", "of", "specified", "word", "included", "the", "CJK", "and", "basic", "Latin", "words", "All", "the", "synonyms", "words", "share", "the", "same", "position", "part", "of", "speech", "word", "type", "with"...
7c8a912e3bbcaf4f8de701180b9c24e2e444a94b
https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-core/src/main/java/org/lionsoul/jcseg/tokenizer/ASegment.java#L767-L786
55,845
lionsoul2014/jcseg
jcseg-core/src/main/java/org/lionsoul/jcseg/tokenizer/ASegment.java
ASegment.getNextMatch
protected IWord[] getNextMatch(char[] chars, int index) { ArrayList<IWord> mList = new ArrayList<IWord>(8); //StringBuilder isb = new StringBuilder(); isb.clear(); char c = chars[index]; isb.append(c); String temp = isb.toString(); if ( dic.match(ILexico...
java
protected IWord[] getNextMatch(char[] chars, int index) { ArrayList<IWord> mList = new ArrayList<IWord>(8); //StringBuilder isb = new StringBuilder(); isb.clear(); char c = chars[index]; isb.append(c); String temp = isb.toString(); if ( dic.match(ILexico...
[ "protected", "IWord", "[", "]", "getNextMatch", "(", "char", "[", "]", "chars", ",", "int", "index", ")", "{", "ArrayList", "<", "IWord", ">", "mList", "=", "new", "ArrayList", "<", "IWord", ">", "(", "8", ")", ";", "//StringBuilder isb = new StringBuilder...
match the next CJK word in the dictionary @param chars @param index @return IWord[]
[ "match", "the", "next", "CJK", "word", "in", "the", "dictionary" ]
7c8a912e3bbcaf4f8de701180b9c24e2e444a94b
https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-core/src/main/java/org/lionsoul/jcseg/tokenizer/ASegment.java#L882-L923
55,846
lionsoul2014/jcseg
jcseg-core/src/main/java/org/lionsoul/jcseg/tokenizer/ASegment.java
ASegment.nextCJKSentence
protected char[] nextCJKSentence( int c ) throws IOException { isb.clear(); int ch; isb.append((char)c); //reset the CE check mask. ctrlMask &= ~ISegment.CHECK_CE_MASk; while ( (ch = readNext()) != -1 ) { if ( StringUtil.isWhitespace(ch)...
java
protected char[] nextCJKSentence( int c ) throws IOException { isb.clear(); int ch; isb.append((char)c); //reset the CE check mask. ctrlMask &= ~ISegment.CHECK_CE_MASk; while ( (ch = readNext()) != -1 ) { if ( StringUtil.isWhitespace(ch)...
[ "protected", "char", "[", "]", "nextCJKSentence", "(", "int", "c", ")", "throws", "IOException", "{", "isb", ".", "clear", "(", ")", ";", "int", "ch", ";", "isb", ".", "append", "(", "(", "char", ")", "c", ")", ";", "//reset the CE check mask.", "ctrlM...
load a CJK char list from the stream start from the current position till the char is not a CJK char @param c @return char[] @throws IOException
[ "load", "a", "CJK", "char", "list", "from", "the", "stream", "start", "from", "the", "current", "position", "till", "the", "char", "is", "not", "a", "CJK", "char" ]
7c8a912e3bbcaf4f8de701180b9c24e2e444a94b
https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-core/src/main/java/org/lionsoul/jcseg/tokenizer/ASegment.java#L1129-L1158
55,847
lionsoul2014/jcseg
jcseg-core/src/main/java/org/lionsoul/jcseg/tokenizer/ASegment.java
ASegment.nextLatinString
protected String nextLatinString(int c) throws IOException { isb.clear(); if ( c > 65280 ) c -= 65248; if ( c >= 65 && c <= 90 ) c += 32; isb.append((char)c); int ch; int _ctype = 0; ctrlMask &= ~ISegment.CHECK_EC_MASK; while ( (ch =...
java
protected String nextLatinString(int c) throws IOException { isb.clear(); if ( c > 65280 ) c -= 65248; if ( c >= 65 && c <= 90 ) c += 32; isb.append((char)c); int ch; int _ctype = 0; ctrlMask &= ~ISegment.CHECK_EC_MASK; while ( (ch =...
[ "protected", "String", "nextLatinString", "(", "int", "c", ")", "throws", "IOException", "{", "isb", ".", "clear", "(", ")", ";", "if", "(", "c", ">", "65280", ")", "c", "-=", "65248", ";", "if", "(", "c", ">=", "65", "&&", "c", "<=", "90", ")", ...
the simple version of the next basic Latin fetch logic Just return the next Latin string with the keep punctuation after it @param c @return String @throws IOException
[ "the", "simple", "version", "of", "the", "next", "basic", "Latin", "fetch", "logic", "Just", "return", "the", "next", "Latin", "string", "with", "the", "keep", "punctuation", "after", "it" ]
7c8a912e3bbcaf4f8de701180b9c24e2e444a94b
https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-core/src/main/java/org/lionsoul/jcseg/tokenizer/ASegment.java#L1425-L1486
55,848
lionsoul2014/jcseg
jcseg-core/src/main/java/org/lionsoul/jcseg/tokenizer/ASegment.java
ASegment.nextLetterNumber
protected String nextLetterNumber( int c ) throws IOException { //StringBuilder isb = new StringBuilder(); isb.clear(); isb.append((char)c); int ch; while ( (ch = readNext()) != -1 ) { if ( StringUtil.isWhitespace(ch) ) { pushBack(ch); ...
java
protected String nextLetterNumber( int c ) throws IOException { //StringBuilder isb = new StringBuilder(); isb.clear(); isb.append((char)c); int ch; while ( (ch = readNext()) != -1 ) { if ( StringUtil.isWhitespace(ch) ) { pushBack(ch); ...
[ "protected", "String", "nextLetterNumber", "(", "int", "c", ")", "throws", "IOException", "{", "//StringBuilder isb = new StringBuilder();", "isb", ".", "clear", "(", ")", ";", "isb", ".", "append", "(", "(", "char", ")", "c", ")", ";", "int", "ch", ";", "...
find the next other letter from the current position find the letter number from the current position count until the char in the specified position is not a letter number or whitespace @param c @return String @throws IOException
[ "find", "the", "next", "other", "letter", "from", "the", "current", "position", "find", "the", "letter", "number", "from", "the", "current", "position", "count", "until", "the", "char", "in", "the", "specified", "position", "is", "not", "a", "letter", "numbe...
7c8a912e3bbcaf4f8de701180b9c24e2e444a94b
https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-core/src/main/java/org/lionsoul/jcseg/tokenizer/ASegment.java#L1497-L1518
55,849
lionsoul2014/jcseg
jcseg-core/src/main/java/org/lionsoul/jcseg/tokenizer/ASegment.java
ASegment.nextOtherNumber
protected String nextOtherNumber( int c ) throws IOException { //StringBuilder isb = new StringBuilder(); isb.clear(); isb.append((char)c); int ch; while ( (ch = readNext()) != -1 ) { if ( StringUtil.isWhitespace(ch) ) { pushBack(ch); ...
java
protected String nextOtherNumber( int c ) throws IOException { //StringBuilder isb = new StringBuilder(); isb.clear(); isb.append((char)c); int ch; while ( (ch = readNext()) != -1 ) { if ( StringUtil.isWhitespace(ch) ) { pushBack(ch); ...
[ "protected", "String", "nextOtherNumber", "(", "int", "c", ")", "throws", "IOException", "{", "//StringBuilder isb = new StringBuilder();", "isb", ".", "clear", "(", ")", ";", "isb", ".", "append", "(", "(", "char", ")", "c", ")", ";", "int", "ch", ";", "w...
find the other number from the current position count until the char in the specified position is not a other number or whitespace @param c @return String @throws IOException
[ "find", "the", "other", "number", "from", "the", "current", "position", "count", "until", "the", "char", "in", "the", "specified", "position", "is", "not", "a", "other", "number", "or", "whitespace" ]
7c8a912e3bbcaf4f8de701180b9c24e2e444a94b
https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-core/src/main/java/org/lionsoul/jcseg/tokenizer/ASegment.java#L1528-L1549
55,850
lionsoul2014/jcseg
jcseg-core/src/main/java/org/lionsoul/jcseg/tokenizer/ASegment.java
ASegment.nextCNNumeric
protected String nextCNNumeric( char[] chars, int index ) throws IOException { //StringBuilder isb = new StringBuilder(); isb.clear(); isb.append( chars[ index ]); ctrlMask &= ~ISegment.CHECK_CF_MASK; //reset the fraction check mask. for ( int j = index + 1; ...
java
protected String nextCNNumeric( char[] chars, int index ) throws IOException { //StringBuilder isb = new StringBuilder(); isb.clear(); isb.append( chars[ index ]); ctrlMask &= ~ISegment.CHECK_CF_MASK; //reset the fraction check mask. for ( int j = index + 1; ...
[ "protected", "String", "nextCNNumeric", "(", "char", "[", "]", "chars", ",", "int", "index", ")", "throws", "IOException", "{", "//StringBuilder isb = new StringBuilder();", "isb", ".", "clear", "(", ")", ";", "isb", ".", "append", "(", "chars", "[", "index", ...
find the Chinese number from the current position count until the char in the specified position is not a other number or whitespace @param chars char array of CJK items @param index @return String[]
[ "find", "the", "Chinese", "number", "from", "the", "current", "position", "count", "until", "the", "char", "in", "the", "specified", "position", "is", "not", "a", "other", "number", "or", "whitespace" ]
7c8a912e3bbcaf4f8de701180b9c24e2e444a94b
https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-core/src/main/java/org/lionsoul/jcseg/tokenizer/ASegment.java#L1559-L1598
55,851
lionsoul2014/jcseg
jcseg-core/src/main/java/org/lionsoul/jcseg/tokenizer/SearchSeg.java
SearchSeg.getNextCJKWord
@Override protected IWord getNextCJKWord(int c, int pos) throws IOException { String key = null; char[] chars = nextCJKSentence(c); int cjkidx = 0, ignidx = 0, mnum = 0; IWord word = null; ArrayList<IWord> mList = new ArrayList<IWord>(8); while ( cjkidx ...
java
@Override protected IWord getNextCJKWord(int c, int pos) throws IOException { String key = null; char[] chars = nextCJKSentence(c); int cjkidx = 0, ignidx = 0, mnum = 0; IWord word = null; ArrayList<IWord> mList = new ArrayList<IWord>(8); while ( cjkidx ...
[ "@", "Override", "protected", "IWord", "getNextCJKWord", "(", "int", "c", ",", "int", "pos", ")", "throws", "IOException", "{", "String", "key", "=", "null", ";", "char", "[", "]", "chars", "=", "nextCJKSentence", "(", "c", ")", ";", "int", "cjkidx", "...
get the next CJK word from the current position of the input stream and this function is the core part the most segmentation implements @see ASegment#getNextCJKWord(int, int) @throws IOException
[ "get", "the", "next", "CJK", "word", "from", "the", "current", "position", "of", "the", "input", "stream", "and", "this", "function", "is", "the", "core", "part", "the", "most", "segmentation", "implements" ]
7c8a912e3bbcaf4f8de701180b9c24e2e444a94b
https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-core/src/main/java/org/lionsoul/jcseg/tokenizer/SearchSeg.java#L40-L113
55,852
lionsoul2014/jcseg
jcseg-server/src/main/java/org/lionsoul/jcseg/server/core/UriEntry.java
UriEntry.process
private void process() { if (requestUri.length() > 1) { parts = new ArrayList<String>(10); for ( int i = 1; i < requestUri.length(); ) { int sIdx = i; int eIdx = requestUri.indexOf('/', sIdx + 1); //not matched or reach...
java
private void process() { if (requestUri.length() > 1) { parts = new ArrayList<String>(10); for ( int i = 1; i < requestUri.length(); ) { int sIdx = i; int eIdx = requestUri.indexOf('/', sIdx + 1); //not matched or reach...
[ "private", "void", "process", "(", ")", "{", "if", "(", "requestUri", ".", "length", "(", ")", ">", "1", ")", "{", "parts", "=", "new", "ArrayList", "<", "String", ">", "(", "10", ")", ";", "for", "(", "int", "i", "=", "1", ";", "i", "<", "re...
do the request uri process
[ "do", "the", "request", "uri", "process" ]
7c8a912e3bbcaf4f8de701180b9c24e2e444a94b
https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-server/src/main/java/org/lionsoul/jcseg/server/core/UriEntry.java#L56-L102
55,853
lionsoul2014/jcseg
jcseg-server/src/main/java/org/lionsoul/jcseg/server/core/UriEntry.java
UriEntry.get
public String get(int idx) { if ( idx < 0 || idx >= parts.size() ) { throw new IndexOutOfBoundsException(); } return parts.get(idx); }
java
public String get(int idx) { if ( idx < 0 || idx >= parts.size() ) { throw new IndexOutOfBoundsException(); } return parts.get(idx); }
[ "public", "String", "get", "(", "int", "idx", ")", "{", "if", "(", "idx", "<", "0", "||", "idx", ">=", "parts", ".", "size", "(", ")", ")", "{", "throw", "new", "IndexOutOfBoundsException", "(", ")", ";", "}", "return", "parts", ".", "get", "(", ...
the specifiled part of the request uri @param idx
[ "the", "specifiled", "part", "of", "the", "request", "uri" ]
7c8a912e3bbcaf4f8de701180b9c24e2e444a94b
https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-server/src/main/java/org/lionsoul/jcseg/server/core/UriEntry.java#L109-L116
55,854
lionsoul2014/jcseg
jcseg-server/src/main/java/org/lionsoul/jcseg/server/core/ContextRouter.java
ContextRouter.getPathEntry
private PathEntry getPathEntry(UriEntry uri) { PathEntry pathEntry = new PathEntry( ContextRouter.MAP_PATH_TYPE, "default"); int length = uri.getLength(); // like /a or / if ( length < 2) return pathEntry; String requestUri = uri.getRequestUri(); ...
java
private PathEntry getPathEntry(UriEntry uri) { PathEntry pathEntry = new PathEntry( ContextRouter.MAP_PATH_TYPE, "default"); int length = uri.getLength(); // like /a or / if ( length < 2) return pathEntry; String requestUri = uri.getRequestUri(); ...
[ "private", "PathEntry", "getPathEntry", "(", "UriEntry", "uri", ")", "{", "PathEntry", "pathEntry", "=", "new", "PathEntry", "(", "ContextRouter", ".", "MAP_PATH_TYPE", ",", "\"default\"", ")", ";", "int", "length", "=", "uri", ".", "getLength", "(", ")", ";...
get the final key with specified path paths : return: /a/b : /a/b /a/* : /a/ /a/b/c : /a/b/c /a/b/* : /a/b/ /a/b/ : /a/b/
[ "get", "the", "final", "key", "with", "specified", "path" ]
7c8a912e3bbcaf4f8de701180b9c24e2e444a94b
https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-server/src/main/java/org/lionsoul/jcseg/server/core/ContextRouter.java#L59-L93
55,855
lionsoul2014/jcseg
jcseg-core/src/main/java/org/lionsoul/jcseg/util/IStringBuffer.java
IStringBuffer.resizeTo
private void resizeTo( int length ) { if ( length <= 0 ) throw new IllegalArgumentException("length <= 0"); if ( length != buff.length ) { int len = ( length > buff.length ) ? buff.length : length; //System.out.println("resize:"+length); char[...
java
private void resizeTo( int length ) { if ( length <= 0 ) throw new IllegalArgumentException("length <= 0"); if ( length != buff.length ) { int len = ( length > buff.length ) ? buff.length : length; //System.out.println("resize:"+length); char[...
[ "private", "void", "resizeTo", "(", "int", "length", ")", "{", "if", "(", "length", "<=", "0", ")", "throw", "new", "IllegalArgumentException", "(", "\"length <= 0\"", ")", ";", "if", "(", "length", "!=", "buff", ".", "length", ")", "{", "int", "len", ...
resize the buffer this will have to copy the old chars from the old buffer to the new buffer @param length
[ "resize", "the", "buffer", "this", "will", "have", "to", "copy", "the", "old", "chars", "from", "the", "old", "buffer", "to", "the", "new", "buffer" ]
7c8a912e3bbcaf4f8de701180b9c24e2e444a94b
https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-core/src/main/java/org/lionsoul/jcseg/util/IStringBuffer.java#L59-L74
55,856
lionsoul2014/jcseg
jcseg-core/src/main/java/org/lionsoul/jcseg/util/IStringBuffer.java
IStringBuffer.append
public IStringBuffer append( String str ) { if ( str == null ) throw new NullPointerException(); //check the necessary to resize the buffer. if ( count + str.length() > buff.length ) { resizeTo( (count + str.length()) * 2 + 1 ); } for ( int j ...
java
public IStringBuffer append( String str ) { if ( str == null ) throw new NullPointerException(); //check the necessary to resize the buffer. if ( count + str.length() > buff.length ) { resizeTo( (count + str.length()) * 2 + 1 ); } for ( int j ...
[ "public", "IStringBuffer", "append", "(", "String", "str", ")", "{", "if", "(", "str", "==", "null", ")", "throw", "new", "NullPointerException", "(", ")", ";", "//check the necessary to resize the buffer.", "if", "(", "count", "+", "str", ".", "length", "(", ...
append a string to the buffer @param str string to append to
[ "append", "a", "string", "to", "the", "buffer" ]
7c8a912e3bbcaf4f8de701180b9c24e2e444a94b
https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-core/src/main/java/org/lionsoul/jcseg/util/IStringBuffer.java#L81-L95
55,857
lionsoul2014/jcseg
jcseg-core/src/main/java/org/lionsoul/jcseg/util/IStringBuffer.java
IStringBuffer.append
public IStringBuffer append( char[] chars, int start, int length ) { if ( chars == null ) throw new NullPointerException(); if ( start < 0 ) throw new IndexOutOfBoundsException(); if ( length <= 0 ) throw new IndexOutOfBoundsException(); if ( start...
java
public IStringBuffer append( char[] chars, int start, int length ) { if ( chars == null ) throw new NullPointerException(); if ( start < 0 ) throw new IndexOutOfBoundsException(); if ( length <= 0 ) throw new IndexOutOfBoundsException(); if ( start...
[ "public", "IStringBuffer", "append", "(", "char", "[", "]", "chars", ",", "int", "start", ",", "int", "length", ")", "{", "if", "(", "chars", "==", "null", ")", "throw", "new", "NullPointerException", "(", ")", ";", "if", "(", "start", "<", "0", ")",...
append parts of the chars to the buffer @param chars @param start the start index @param length length of chars to append to
[ "append", "parts", "of", "the", "chars", "to", "the", "buffer" ]
7c8a912e3bbcaf4f8de701180b9c24e2e444a94b
https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-core/src/main/java/org/lionsoul/jcseg/util/IStringBuffer.java#L104-L125
55,858
lionsoul2014/jcseg
jcseg-core/src/main/java/org/lionsoul/jcseg/util/IStringBuffer.java
IStringBuffer.append
public IStringBuffer append( char[] chars, int start ) { append(chars, start, chars.length - start); return this; }
java
public IStringBuffer append( char[] chars, int start ) { append(chars, start, chars.length - start); return this; }
[ "public", "IStringBuffer", "append", "(", "char", "[", "]", "chars", ",", "int", "start", ")", "{", "append", "(", "chars", ",", "start", ",", "chars", ".", "length", "-", "start", ")", ";", "return", "this", ";", "}" ]
append the rest of the chars to the buffer @param chars @param start the start index @return IStringBuffer
[ "append", "the", "rest", "of", "the", "chars", "to", "the", "buffer" ]
7c8a912e3bbcaf4f8de701180b9c24e2e444a94b
https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-core/src/main/java/org/lionsoul/jcseg/util/IStringBuffer.java#L135-L139
55,859
lionsoul2014/jcseg
jcseg-core/src/main/java/org/lionsoul/jcseg/util/IStringBuffer.java
IStringBuffer.append
public IStringBuffer append( char c ) { if ( count == buff.length ) { resizeTo( buff.length * 2 + 1 ); } buff[count++] = c; return this; }
java
public IStringBuffer append( char c ) { if ( count == buff.length ) { resizeTo( buff.length * 2 + 1 ); } buff[count++] = c; return this; }
[ "public", "IStringBuffer", "append", "(", "char", "c", ")", "{", "if", "(", "count", "==", "buff", ".", "length", ")", "{", "resizeTo", "(", "buff", ".", "length", "*", "2", "+", "1", ")", ";", "}", "buff", "[", "count", "++", "]", "=", "c", ";...
append a char to the buffer @param c the char to append to
[ "append", "a", "char", "to", "the", "buffer" ]
7c8a912e3bbcaf4f8de701180b9c24e2e444a94b
https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-core/src/main/java/org/lionsoul/jcseg/util/IStringBuffer.java#L156-L165
55,860
lionsoul2014/jcseg
jcseg-core/src/main/java/org/lionsoul/jcseg/util/IStringBuffer.java
IStringBuffer.charAt
public char charAt( int idx ) { if ( idx < 0 ) throw new IndexOutOfBoundsException("idx{"+idx+"} < 0"); if ( idx >= count ) throw new IndexOutOfBoundsException("idx{"+idx+"} >= buffer.length"); return buff[idx]; }
java
public char charAt( int idx ) { if ( idx < 0 ) throw new IndexOutOfBoundsException("idx{"+idx+"} < 0"); if ( idx >= count ) throw new IndexOutOfBoundsException("idx{"+idx+"} >= buffer.length"); return buff[idx]; }
[ "public", "char", "charAt", "(", "int", "idx", ")", "{", "if", "(", "idx", "<", "0", ")", "throw", "new", "IndexOutOfBoundsException", "(", "\"idx{\"", "+", "idx", "+", "\"} < 0\"", ")", ";", "if", "(", "idx", ">=", "count", ")", "throw", "new", "Ind...
get the char at a specified position in the buffer
[ "get", "the", "char", "at", "a", "specified", "position", "in", "the", "buffer" ]
7c8a912e3bbcaf4f8de701180b9c24e2e444a94b
https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-core/src/main/java/org/lionsoul/jcseg/util/IStringBuffer.java#L255-L262
55,861
lionsoul2014/jcseg
jcseg-core/src/main/java/org/lionsoul/jcseg/util/IStringBuffer.java
IStringBuffer.deleteCharAt
public IStringBuffer deleteCharAt( int idx ) { if ( idx < 0 ) throw new IndexOutOfBoundsException("idx < 0"); if ( idx >= count ) throw new IndexOutOfBoundsException("idx >= buffer.length"); //here we got a bug for j < count //change over it to count ...
java
public IStringBuffer deleteCharAt( int idx ) { if ( idx < 0 ) throw new IndexOutOfBoundsException("idx < 0"); if ( idx >= count ) throw new IndexOutOfBoundsException("idx >= buffer.length"); //here we got a bug for j < count //change over it to count ...
[ "public", "IStringBuffer", "deleteCharAt", "(", "int", "idx", ")", "{", "if", "(", "idx", "<", "0", ")", "throw", "new", "IndexOutOfBoundsException", "(", "\"idx < 0\"", ")", ";", "if", "(", "idx", ">=", "count", ")", "throw", "new", "IndexOutOfBoundsExcepti...
delete the char at the specified position
[ "delete", "the", "char", "at", "the", "specified", "position" ]
7c8a912e3bbcaf4f8de701180b9c24e2e444a94b
https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-core/src/main/java/org/lionsoul/jcseg/util/IStringBuffer.java#L295-L312
55,862
lionsoul2014/jcseg
jcseg-core/src/main/java/org/lionsoul/jcseg/util/IStringBuffer.java
IStringBuffer.set
public void set(int idx, char chr) { if ( idx < 0 ) throw new IndexOutOfBoundsException("idx < 0"); if ( idx >= count ) throw new IndexOutOfBoundsException("idx >= buffer.length"); buff[idx] = chr; }
java
public void set(int idx, char chr) { if ( idx < 0 ) throw new IndexOutOfBoundsException("idx < 0"); if ( idx >= count ) throw new IndexOutOfBoundsException("idx >= buffer.length"); buff[idx] = chr; }
[ "public", "void", "set", "(", "int", "idx", ",", "char", "chr", ")", "{", "if", "(", "idx", "<", "0", ")", "throw", "new", "IndexOutOfBoundsException", "(", "\"idx < 0\"", ")", ";", "if", "(", "idx", ">=", "count", ")", "throw", "new", "IndexOutOfBound...
set the char at the specified index @param idx @param chr
[ "set", "the", "char", "at", "the", "specified", "index" ]
7c8a912e3bbcaf4f8de701180b9c24e2e444a94b
https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-core/src/main/java/org/lionsoul/jcseg/util/IStringBuffer.java#L320-L328
55,863
lionsoul2014/jcseg
jcseg-core/src/main/java/org/lionsoul/jcseg/tokenizer/NLPSeg.java
NLPSeg.getNextTimeMergedWord
protected IWord getNextTimeMergedWord(IWord word, int eIdx) throws IOException { int pIdx = TimeUtil.getDateTimeIndex(word.getEntity(eIdx)); if ( pIdx == TimeUtil.DATETIME_NONE ) { return null; } IWord[] wMask = TimeUtil.createDateTimePool(); TimeUtil.fillDateTim...
java
protected IWord getNextTimeMergedWord(IWord word, int eIdx) throws IOException { int pIdx = TimeUtil.getDateTimeIndex(word.getEntity(eIdx)); if ( pIdx == TimeUtil.DATETIME_NONE ) { return null; } IWord[] wMask = TimeUtil.createDateTimePool(); TimeUtil.fillDateTim...
[ "protected", "IWord", "getNextTimeMergedWord", "(", "IWord", "word", ",", "int", "eIdx", ")", "throws", "IOException", "{", "int", "pIdx", "=", "TimeUtil", ".", "getDateTimeIndex", "(", "word", ".", "getEntity", "(", "eIdx", ")", ")", ";", "if", "(", "pIdx...
get and return the next time merged date-time word @param word @param eIdx @return IWord @throws IOException
[ "get", "and", "return", "the", "next", "time", "merged", "date", "-", "time", "word" ]
7c8a912e3bbcaf4f8de701180b9c24e2e444a94b
https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-core/src/main/java/org/lionsoul/jcseg/tokenizer/NLPSeg.java#L242-L319
55,864
lionsoul2014/jcseg
jcseg-core/src/main/java/org/lionsoul/jcseg/tokenizer/NLPSeg.java
NLPSeg.getNextDatetimeWord
protected IWord getNextDatetimeWord(IWord word, int entityIdx) throws IOException { IWord dWord = super.next(); if ( dWord == null ) { return null; } String[] entity = dWord.getEntity(); if ( entity == null ) { eWordPool.add(dWord); return...
java
protected IWord getNextDatetimeWord(IWord word, int entityIdx) throws IOException { IWord dWord = super.next(); if ( dWord == null ) { return null; } String[] entity = dWord.getEntity(); if ( entity == null ) { eWordPool.add(dWord); return...
[ "protected", "IWord", "getNextDatetimeWord", "(", "IWord", "word", ",", "int", "entityIdx", ")", "throws", "IOException", "{", "IWord", "dWord", "=", "super", ".", "next", "(", ")", ";", "if", "(", "dWord", "==", "null", ")", "{", "return", "null", ";", ...
get and return the next date-time word @param word @param entityIdx @return IWord @throws IOException
[ "get", "and", "return", "the", "next", "date", "-", "time", "word" ]
7c8a912e3bbcaf4f8de701180b9c24e2e444a94b
https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-core/src/main/java/org/lionsoul/jcseg/tokenizer/NLPSeg.java#L329-L388
55,865
lionsoul2014/jcseg
jcseg-core/src/main/java/org/lionsoul/jcseg/tokenizer/NLPSeg.java
NLPSeg.getNumericUnitComposedWord
private IWord getNumericUnitComposedWord(String numeric, IWord unitWord) { IStringBuffer sb = new IStringBuffer(); sb.clear().append(numeric).append(unitWord.getValue()); IWord wd = new Word(sb.toString(), IWord.T_CJK_WORD); String[] entity = unitWord.getEntity(); int eIdx = ArrayUtil.star...
java
private IWord getNumericUnitComposedWord(String numeric, IWord unitWord) { IStringBuffer sb = new IStringBuffer(); sb.clear().append(numeric).append(unitWord.getValue()); IWord wd = new Word(sb.toString(), IWord.T_CJK_WORD); String[] entity = unitWord.getEntity(); int eIdx = ArrayUtil.star...
[ "private", "IWord", "getNumericUnitComposedWord", "(", "String", "numeric", ",", "IWord", "unitWord", ")", "{", "IStringBuffer", "sb", "=", "new", "IStringBuffer", "(", ")", ";", "sb", ".", "clear", "(", ")", ".", "append", "(", "numeric", ")", ".", "appen...
internal method to define the composed entity for numeric and unit word composed word @param numeric @param unitWord @return IWord
[ "internal", "method", "to", "define", "the", "composed", "entity", "for", "numeric", "and", "unit", "word", "composed", "word" ]
7c8a912e3bbcaf4f8de701180b9c24e2e444a94b
https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-core/src/main/java/org/lionsoul/jcseg/tokenizer/NLPSeg.java#L398-L417
55,866
taskadapter/redmine-java-api
src/main/java/com/taskadapter/redmineapi/IssueManager.java
IssueManager.getIssuesBySummary
public List<Issue> getIssuesBySummary(String projectKey, String summaryField) throws RedmineException { if ((projectKey != null) && (projectKey.length() > 0)) { return transport.getObjectsList(Issue.class, new BasicNameValuePair("subject", summaryField), new B...
java
public List<Issue> getIssuesBySummary(String projectKey, String summaryField) throws RedmineException { if ((projectKey != null) && (projectKey.length() > 0)) { return transport.getObjectsList(Issue.class, new BasicNameValuePair("subject", summaryField), new B...
[ "public", "List", "<", "Issue", ">", "getIssuesBySummary", "(", "String", "projectKey", ",", "String", "summaryField", ")", "throws", "RedmineException", "{", "if", "(", "(", "projectKey", "!=", "null", ")", "&&", "(", "projectKey", ".", "length", "(", ")", ...
There could be several issues with the same summary, so the method returns List. @return empty list if not issues with this summary field exist, never NULL @throws RedmineAuthenticationException invalid or no API access key is used with the server, which requires authorization. Check the constructor arguments. @throws...
[ "There", "could", "be", "several", "issues", "with", "the", "same", "summary", "so", "the", "method", "returns", "List", "." ]
0bb65f27ee806ec3bd4007e1641f3e996261a04e
https://github.com/taskadapter/redmine-java-api/blob/0bb65f27ee806ec3bd4007e1641f3e996261a04e/src/main/java/com/taskadapter/redmineapi/IssueManager.java#L57-L66
55,867
taskadapter/redmine-java-api
src/main/java/com/taskadapter/redmineapi/IssueManager.java
IssueManager.getSavedQueries
public List<SavedQuery> getSavedQueries(String projectKey) throws RedmineException { Set<NameValuePair> params = new HashSet<>(); if ((projectKey != null) && (projectKey.length() > 0)) { params.add(new BasicNameValuePair("project_id", projectKey)); } return transport.getObj...
java
public List<SavedQuery> getSavedQueries(String projectKey) throws RedmineException { Set<NameValuePair> params = new HashSet<>(); if ((projectKey != null) && (projectKey.length() > 0)) { params.add(new BasicNameValuePair("project_id", projectKey)); } return transport.getObj...
[ "public", "List", "<", "SavedQuery", ">", "getSavedQueries", "(", "String", "projectKey", ")", "throws", "RedmineException", "{", "Set", "<", "NameValuePair", ">", "params", "=", "new", "HashSet", "<>", "(", ")", ";", "if", "(", "(", "projectKey", "!=", "n...
Get "saved queries" for the given project available to the current user. <p>This REST API feature was added in Redmine 1.3.0. See http://www.redmine.org/issues/5737</p>
[ "Get", "saved", "queries", "for", "the", "given", "project", "available", "to", "the", "current", "user", "." ]
0bb65f27ee806ec3bd4007e1641f3e996261a04e
https://github.com/taskadapter/redmine-java-api/blob/0bb65f27ee806ec3bd4007e1641f3e996261a04e/src/main/java/com/taskadapter/redmineapi/IssueManager.java#L326-L334
55,868
taskadapter/redmine-java-api
src/main/java/com/taskadapter/redmineapi/internal/json/JsonOutput.java
JsonOutput.addIfNotNull
public static <T> void addIfNotNull(JSONWriter writer, String field, T value, JsonObjectWriter<T> objWriter) throws JSONException { if (value == null) return; writer.key(field); writer.object(); objWriter.write(writer, value); writer.endObject(); }
java
public static <T> void addIfNotNull(JSONWriter writer, String field, T value, JsonObjectWriter<T> objWriter) throws JSONException { if (value == null) return; writer.key(field); writer.object(); objWriter.write(writer, value); writer.endObject(); }
[ "public", "static", "<", "T", ">", "void", "addIfNotNull", "(", "JSONWriter", "writer", ",", "String", "field", ",", "T", "value", ",", "JsonObjectWriter", "<", "T", ">", "objWriter", ")", "throws", "JSONException", "{", "if", "(", "value", "==", "null", ...
Adds an object if object is not null. @param writer object writer. @param field field writer. @param value value writer. @param objWriter object value writer. @throws JSONException if io error occurs.
[ "Adds", "an", "object", "if", "object", "is", "not", "null", "." ]
0bb65f27ee806ec3bd4007e1641f3e996261a04e
https://github.com/taskadapter/redmine-java-api/blob/0bb65f27ee806ec3bd4007e1641f3e996261a04e/src/main/java/com/taskadapter/redmineapi/internal/json/JsonOutput.java#L152-L160
55,869
taskadapter/redmine-java-api
src/main/java/com/taskadapter/redmineapi/internal/json/JsonOutput.java
JsonOutput.addScalarArray
public static <T> void addScalarArray(JSONWriter writer, String field, Collection<T> items, JsonObjectWriter<T> objWriter) throws JSONException { writer.key(field); writer.array(); for (T item : items) { objWriter.write(writer, item); } writer.endArray(); }
java
public static <T> void addScalarArray(JSONWriter writer, String field, Collection<T> items, JsonObjectWriter<T> objWriter) throws JSONException { writer.key(field); writer.array(); for (T item : items) { objWriter.write(writer, item); } writer.endArray(); }
[ "public", "static", "<", "T", ">", "void", "addScalarArray", "(", "JSONWriter", "writer", ",", "String", "field", ",", "Collection", "<", "T", ">", "items", ",", "JsonObjectWriter", "<", "T", ">", "objWriter", ")", "throws", "JSONException", "{", "writer", ...
Adds a list of scalar values. @param writer used writer. @param field field to write. @param items used items. @param objWriter single value writer.
[ "Adds", "a", "list", "of", "scalar", "values", "." ]
0bb65f27ee806ec3bd4007e1641f3e996261a04e
https://github.com/taskadapter/redmine-java-api/blob/0bb65f27ee806ec3bd4007e1641f3e996261a04e/src/main/java/com/taskadapter/redmineapi/internal/json/JsonOutput.java#L174-L183
55,870
taskadapter/redmine-java-api
src/main/java/com/taskadapter/redmineapi/internal/URIConfigurator.java
URIConfigurator.addAPIKey
public URI addAPIKey(String uri) { try { final URIBuilder builder = new URIBuilder(uri); if (apiAccessKey != null) { builder.setParameter("key", apiAccessKey); } return builder.build(); } catch (URISyntaxException e) { throw new...
java
public URI addAPIKey(String uri) { try { final URIBuilder builder = new URIBuilder(uri); if (apiAccessKey != null) { builder.setParameter("key", apiAccessKey); } return builder.build(); } catch (URISyntaxException e) { throw new...
[ "public", "URI", "addAPIKey", "(", "String", "uri", ")", "{", "try", "{", "final", "URIBuilder", "builder", "=", "new", "URIBuilder", "(", "uri", ")", ";", "if", "(", "apiAccessKey", "!=", "null", ")", "{", "builder", ".", "setParameter", "(", "\"key\"",...
Adds API key to URI, if the key is specified @param uri Original URI string @return URI with API key added
[ "Adds", "API", "key", "to", "URI", "if", "the", "key", "is", "specified" ]
0bb65f27ee806ec3bd4007e1641f3e996261a04e
https://github.com/taskadapter/redmine-java-api/blob/0bb65f27ee806ec3bd4007e1641f3e996261a04e/src/main/java/com/taskadapter/redmineapi/internal/URIConfigurator.java#L176-L186
55,871
taskadapter/redmine-java-api
src/main/java/com/taskadapter/redmineapi/internal/comm/betterssl/BetterSSLFactory.java
BetterSSLFactory.createSocketFactory
public static SSLSocketFactory createSocketFactory(Collection<KeyStore> extraStores) throws KeyStoreException, KeyManagementException { final Collection<X509TrustManager> managers = new ArrayList<>(); for (KeyStore ks : extraStores) { addX509Managers(managers, ks); } /* Add default manager. */ addX509Mana...
java
public static SSLSocketFactory createSocketFactory(Collection<KeyStore> extraStores) throws KeyStoreException, KeyManagementException { final Collection<X509TrustManager> managers = new ArrayList<>(); for (KeyStore ks : extraStores) { addX509Managers(managers, ks); } /* Add default manager. */ addX509Mana...
[ "public", "static", "SSLSocketFactory", "createSocketFactory", "(", "Collection", "<", "KeyStore", ">", "extraStores", ")", "throws", "KeyStoreException", ",", "KeyManagementException", "{", "final", "Collection", "<", "X509TrustManager", ">", "managers", "=", "new", ...
Creates a new SSL socket factory which supports both system-installed keys and all additional keys in the provided keystores. @param extraStores extra keystores containing root certificate authorities. @return Socket factory supporting authorization for both system (default) keystores and all the extraStores. @throws ...
[ "Creates", "a", "new", "SSL", "socket", "factory", "which", "supports", "both", "system", "-", "installed", "keys", "and", "all", "additional", "keys", "in", "the", "provided", "keystores", "." ]
0bb65f27ee806ec3bd4007e1641f3e996261a04e
https://github.com/taskadapter/redmine-java-api/blob/0bb65f27ee806ec3bd4007e1641f3e996261a04e/src/main/java/com/taskadapter/redmineapi/internal/comm/betterssl/BetterSSLFactory.java#L37-L53
55,872
taskadapter/redmine-java-api
src/main/java/com/taskadapter/redmineapi/internal/comm/betterssl/BetterSSLFactory.java
BetterSSLFactory.addX509Managers
private static void addX509Managers(final Collection<X509TrustManager> managers, KeyStore ks) throws KeyStoreException, Error { try { final TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); tmf.init(ks); for (TrustManager tm : tmf.getTrustManagers()) { ...
java
private static void addX509Managers(final Collection<X509TrustManager> managers, KeyStore ks) throws KeyStoreException, Error { try { final TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); tmf.init(ks); for (TrustManager tm : tmf.getTrustManagers()) { ...
[ "private", "static", "void", "addX509Managers", "(", "final", "Collection", "<", "X509TrustManager", ">", "managers", ",", "KeyStore", "ks", ")", "throws", "KeyStoreException", ",", "Error", "{", "try", "{", "final", "TrustManagerFactory", "tmf", "=", "TrustManage...
Adds X509 keystore-backed trust manager into the list of managers. @param managers list of the managers to add to. @param ks key store with target keys. @throws KeyStoreException if key store could not be accessed.
[ "Adds", "X509", "keystore", "-", "backed", "trust", "manager", "into", "the", "list", "of", "managers", "." ]
0bb65f27ee806ec3bd4007e1641f3e996261a04e
https://github.com/taskadapter/redmine-java-api/blob/0bb65f27ee806ec3bd4007e1641f3e996261a04e/src/main/java/com/taskadapter/redmineapi/internal/comm/betterssl/BetterSSLFactory.java#L61-L74
55,873
taskadapter/redmine-java-api
src/main/java/com/taskadapter/redmineapi/internal/Transport.java
Transport.addObject
public <T> T addObject(T object, NameValuePair... params) throws RedmineException { final EntityConfig<T> config = getConfig(object.getClass()); if (config.writer == null) { throw new RuntimeException("can't create object: writer is not implemented or is not registered in RedmineJSONBuilder for...
java
public <T> T addObject(T object, NameValuePair... params) throws RedmineException { final EntityConfig<T> config = getConfig(object.getClass()); if (config.writer == null) { throw new RuntimeException("can't create object: writer is not implemented or is not registered in RedmineJSONBuilder for...
[ "public", "<", "T", ">", "T", "addObject", "(", "T", "object", ",", "NameValuePair", "...", "params", ")", "throws", "RedmineException", "{", "final", "EntityConfig", "<", "T", ">", "config", "=", "getConfig", "(", "object", ".", "getClass", "(", ")", ")...
Performs an "add object" request. @param object object to use. @param params name params. @return object to use. @throws RedmineException if something goes wrong.
[ "Performs", "an", "add", "object", "request", "." ]
0bb65f27ee806ec3bd4007e1641f3e996261a04e
https://github.com/taskadapter/redmine-java-api/blob/0bb65f27ee806ec3bd4007e1641f3e996261a04e/src/main/java/com/taskadapter/redmineapi/internal/Transport.java#L220-L233
55,874
taskadapter/redmine-java-api
src/main/java/com/taskadapter/redmineapi/internal/Transport.java
Transport.deleteChildId
public <T> void deleteChildId(Class<?> parentClass, String parentId, T object, Integer value) throws RedmineException { URI uri = getURIConfigurator().getChildIdURI(parentClass, parentId, object.getClass(), value); HttpDelete httpDelete = new HttpDelete(uri); String response = send(httpDelete); ...
java
public <T> void deleteChildId(Class<?> parentClass, String parentId, T object, Integer value) throws RedmineException { URI uri = getURIConfigurator().getChildIdURI(parentClass, parentId, object.getClass(), value); HttpDelete httpDelete = new HttpDelete(uri); String response = send(httpDelete); ...
[ "public", "<", "T", ">", "void", "deleteChildId", "(", "Class", "<", "?", ">", "parentClass", ",", "String", "parentId", ",", "T", "object", ",", "Integer", "value", ")", "throws", "RedmineException", "{", "URI", "uri", "=", "getURIConfigurator", "(", ")",...
Performs "delete child Id" request. @param parentClass parent object id. @param object object to use. @param value child object id. @throws RedmineException if something goes wrong.
[ "Performs", "delete", "child", "Id", "request", "." ]
0bb65f27ee806ec3bd4007e1641f3e996261a04e
https://github.com/taskadapter/redmine-java-api/blob/0bb65f27ee806ec3bd4007e1641f3e996261a04e/src/main/java/com/taskadapter/redmineapi/internal/Transport.java#L311-L316
55,875
taskadapter/redmine-java-api
src/main/java/com/taskadapter/redmineapi/internal/Transport.java
Transport.deleteObject
public <T extends Identifiable> void deleteObject(Class<T> classs, String id) throws RedmineException { final URI uri = getURIConfigurator().getObjectURI(classs, id); final HttpDelete http = new HttpDelete(uri); send(http); }
java
public <T extends Identifiable> void deleteObject(Class<T> classs, String id) throws RedmineException { final URI uri = getURIConfigurator().getObjectURI(classs, id); final HttpDelete http = new HttpDelete(uri); send(http); }
[ "public", "<", "T", "extends", "Identifiable", ">", "void", "deleteObject", "(", "Class", "<", "T", ">", "classs", ",", "String", "id", ")", "throws", "RedmineException", "{", "final", "URI", "uri", "=", "getURIConfigurator", "(", ")", ".", "getObjectURI", ...
Deletes an object. @param classs object class. @param id object id. @throws RedmineException if something goes wrong.
[ "Deletes", "an", "object", "." ]
0bb65f27ee806ec3bd4007e1641f3e996261a04e
https://github.com/taskadapter/redmine-java-api/blob/0bb65f27ee806ec3bd4007e1641f3e996261a04e/src/main/java/com/taskadapter/redmineapi/internal/Transport.java#L328-L333
55,876
taskadapter/redmine-java-api
src/main/java/com/taskadapter/redmineapi/internal/Transport.java
Transport.download
public <R> R download(String uri, ContentHandler<BasicHttpResponse, R> handler) throws RedmineException { final URI requestUri = configurator.addAPIKey(uri); final HttpGet request = new HttpGet(requestUri); if (onBehalfOfUser != null) { request.addHeader("X-Redmine-Switch-User", onBehalfOf...
java
public <R> R download(String uri, ContentHandler<BasicHttpResponse, R> handler) throws RedmineException { final URI requestUri = configurator.addAPIKey(uri); final HttpGet request = new HttpGet(requestUri); if (onBehalfOfUser != null) { request.addHeader("X-Redmine-Switch-User", onBehalfOf...
[ "public", "<", "R", ">", "R", "download", "(", "String", "uri", ",", "ContentHandler", "<", "BasicHttpResponse", ",", "R", ">", "handler", ")", "throws", "RedmineException", "{", "final", "URI", "requestUri", "=", "configurator", ".", "addAPIKey", "(", "uri"...
Downloads redmine content. @param uri target uri. @param handler content handler. @return handler result. @throws RedmineException if something goes wrong.
[ "Downloads", "redmine", "content", "." ]
0bb65f27ee806ec3bd4007e1641f3e996261a04e
https://github.com/taskadapter/redmine-java-api/blob/0bb65f27ee806ec3bd4007e1641f3e996261a04e/src/main/java/com/taskadapter/redmineapi/internal/Transport.java#L370-L379
55,877
taskadapter/redmine-java-api
src/main/java/com/taskadapter/redmineapi/internal/Transport.java
Transport.getChildEntry
public <T> T getChildEntry(Class<?> parentClass, String parentId, Class<T> classs, String childId, NameValuePair... params) throws RedmineException { final EntityConfig<T> config = getConfig(classs); final URI uri = getURIConfigurator().getChildIdURI(parentClass, parentId,...
java
public <T> T getChildEntry(Class<?> parentClass, String parentId, Class<T> classs, String childId, NameValuePair... params) throws RedmineException { final EntityConfig<T> config = getConfig(classs); final URI uri = getURIConfigurator().getChildIdURI(parentClass, parentId,...
[ "public", "<", "T", ">", "T", "getChildEntry", "(", "Class", "<", "?", ">", "parentClass", ",", "String", "parentId", ",", "Class", "<", "T", ">", "classs", ",", "String", "childId", ",", "NameValuePair", "...", "params", ")", "throws", "RedmineException",...
Delivers a single child entry by its identifier.
[ "Delivers", "a", "single", "child", "entry", "by", "its", "identifier", "." ]
0bb65f27ee806ec3bd4007e1641f3e996261a04e
https://github.com/taskadapter/redmine-java-api/blob/0bb65f27ee806ec3bd4007e1641f3e996261a04e/src/main/java/com/taskadapter/redmineapi/internal/Transport.java#L546-L554
55,878
taskadapter/redmine-java-api
src/main/java/com/taskadapter/redmineapi/bean/Project.java
Project.addTrackers
public Project addTrackers(Collection<Tracker> trackers) { if (!storage.isPropertySet(TRACKERS)) //checks because trackers storage is not created for new projects storage.set(TRACKERS, new HashSet<>()); storage.get(TRACKERS).addAll(trackers); return this; }
java
public Project addTrackers(Collection<Tracker> trackers) { if (!storage.isPropertySet(TRACKERS)) //checks because trackers storage is not created for new projects storage.set(TRACKERS, new HashSet<>()); storage.get(TRACKERS).addAll(trackers); return this; }
[ "public", "Project", "addTrackers", "(", "Collection", "<", "Tracker", ">", "trackers", ")", "{", "if", "(", "!", "storage", ".", "isPropertySet", "(", "TRACKERS", ")", ")", "//checks because trackers storage is not created for new projects", "storage", ".", "set", ...
Adds the specified trackers to this project. If this project is created or updated on the redmine server, each tracker id must be a valid tracker on the server.
[ "Adds", "the", "specified", "trackers", "to", "this", "project", ".", "If", "this", "project", "is", "created", "or", "updated", "on", "the", "redmine", "server", "each", "tracker", "id", "must", "be", "a", "valid", "tracker", "on", "the", "server", "." ]
0bb65f27ee806ec3bd4007e1641f3e996261a04e
https://github.com/taskadapter/redmine-java-api/blob/0bb65f27ee806ec3bd4007e1641f3e996261a04e/src/main/java/com/taskadapter/redmineapi/bean/Project.java#L132-L137
55,879
taskadapter/redmine-java-api
src/main/java/com/taskadapter/redmineapi/RedmineManagerFactory.java
RedmineManagerFactory.createUnauthenticated
public static RedmineManager createUnauthenticated(String uri, HttpClient httpClient) { return createWithUserAuth(uri, null, null, httpClient); }
java
public static RedmineManager createUnauthenticated(String uri, HttpClient httpClient) { return createWithUserAuth(uri, null, null, httpClient); }
[ "public", "static", "RedmineManager", "createUnauthenticated", "(", "String", "uri", ",", "HttpClient", "httpClient", ")", "{", "return", "createWithUserAuth", "(", "uri", ",", "null", ",", "null", ",", "httpClient", ")", ";", "}" ]
Creates a non-authenticating redmine manager. @param uri redmine manager URI. @param httpClient you can provide your own pre-configured HttpClient if you want to control connection pooling, manage connections eviction, closing, etc.
[ "Creates", "a", "non", "-", "authenticating", "redmine", "manager", "." ]
0bb65f27ee806ec3bd4007e1641f3e996261a04e
https://github.com/taskadapter/redmine-java-api/blob/0bb65f27ee806ec3bd4007e1641f3e996261a04e/src/main/java/com/taskadapter/redmineapi/RedmineManagerFactory.java#L75-L78
55,880
taskadapter/redmine-java-api
src/main/java/com/taskadapter/redmineapi/RedmineManagerFactory.java
RedmineManagerFactory.createWithUserAuth
public static RedmineManager createWithUserAuth(String uri, String login, String password) { return createWithUserAuth(uri, login, password, createDefaultHttpClient(uri)); }
java
public static RedmineManager createWithUserAuth(String uri, String login, String password) { return createWithUserAuth(uri, login, password, createDefaultHttpClient(uri)); }
[ "public", "static", "RedmineManager", "createWithUserAuth", "(", "String", "uri", ",", "String", "login", ",", "String", "password", ")", "{", "return", "createWithUserAuth", "(", "uri", ",", "login", ",", "password", ",", "createDefaultHttpClient", "(", "uri", ...
Creates a new RedmineManager with user-based authentication. @param uri redmine manager URI. @param login user's name. @param password user's password.
[ "Creates", "a", "new", "RedmineManager", "with", "user", "-", "based", "authentication", "." ]
0bb65f27ee806ec3bd4007e1641f3e996261a04e
https://github.com/taskadapter/redmine-java-api/blob/0bb65f27ee806ec3bd4007e1641f3e996261a04e/src/main/java/com/taskadapter/redmineapi/RedmineManagerFactory.java#L125-L129
55,881
taskadapter/redmine-java-api
src/main/java/com/taskadapter/redmineapi/RedmineManagerFactory.java
RedmineManagerFactory.createWithUserAuth
public static RedmineManager createWithUserAuth(String uri, String login, String password, HttpClient httpClient) { final Transport transport = new Transport( new URIConfigurator(uri, null), httpClient); transport.setCredentials(login, ...
java
public static RedmineManager createWithUserAuth(String uri, String login, String password, HttpClient httpClient) { final Transport transport = new Transport( new URIConfigurator(uri, null), httpClient); transport.setCredentials(login, ...
[ "public", "static", "RedmineManager", "createWithUserAuth", "(", "String", "uri", ",", "String", "login", ",", "String", "password", ",", "HttpClient", "httpClient", ")", "{", "final", "Transport", "transport", "=", "new", "Transport", "(", "new", "URIConfigurator...
Creates a new redmine managen with user-based authentication. @param uri redmine manager URI. @param login user's name. @param password user's password. @param httpClient you can provide your own pre-configured HttpClient if you want to control connection pooling, manage connections eviction, closing, etc.
[ "Creates", "a", "new", "redmine", "managen", "with", "user", "-", "based", "authentication", "." ]
0bb65f27ee806ec3bd4007e1641f3e996261a04e
https://github.com/taskadapter/redmine-java-api/blob/0bb65f27ee806ec3bd4007e1641f3e996261a04e/src/main/java/com/taskadapter/redmineapi/RedmineManagerFactory.java#L140-L146
55,882
taskadapter/redmine-java-api
src/main/java/com/taskadapter/redmineapi/bean/WikiPageDetail.java
WikiPageDetail.update
public void update() throws RedmineException { String urlSafeTitle = getUrlSafeString(getTitle()); transport.updateChildEntry(Project.class, getProjectKey(), this, urlSafeTitle); }
java
public void update() throws RedmineException { String urlSafeTitle = getUrlSafeString(getTitle()); transport.updateChildEntry(Project.class, getProjectKey(), this, urlSafeTitle); }
[ "public", "void", "update", "(", ")", "throws", "RedmineException", "{", "String", "urlSafeTitle", "=", "getUrlSafeString", "(", "getTitle", "(", ")", ")", ";", "transport", ".", "updateChildEntry", "(", "Project", ".", "class", ",", "getProjectKey", "(", ")",...
projectKey must be set before calling this. Version must be set to the latest version of the document.
[ "projectKey", "must", "be", "set", "before", "calling", "this", ".", "Version", "must", "be", "set", "to", "the", "latest", "version", "of", "the", "document", "." ]
0bb65f27ee806ec3bd4007e1641f3e996261a04e
https://github.com/taskadapter/redmine-java-api/blob/0bb65f27ee806ec3bd4007e1641f3e996261a04e/src/main/java/com/taskadapter/redmineapi/bean/WikiPageDetail.java#L140-L143
55,883
taskadapter/redmine-java-api
src/main/java/com/taskadapter/redmineapi/internal/comm/TransportDecoder.java
TransportDecoder.decodeStream
private InputStream decodeStream(String encoding, InputStream initialStream) throws IOException { if (encoding == null) return initialStream; if ("gzip".equals(encoding)) return new GZIPInputStream(initialStream); if ("deflate".equals(encoding)) return new InflaterInputStream(initialStream); throw n...
java
private InputStream decodeStream(String encoding, InputStream initialStream) throws IOException { if (encoding == null) return initialStream; if ("gzip".equals(encoding)) return new GZIPInputStream(initialStream); if ("deflate".equals(encoding)) return new InflaterInputStream(initialStream); throw n...
[ "private", "InputStream", "decodeStream", "(", "String", "encoding", ",", "InputStream", "initialStream", ")", "throws", "IOException", "{", "if", "(", "encoding", "==", "null", ")", "return", "initialStream", ";", "if", "(", "\"gzip\"", ".", "equals", "(", "e...
Decodes a transport stream. @param encoding stream encoding. @param initialStream initial stream. @return decoding stream. @throws IOException
[ "Decodes", "a", "transport", "stream", "." ]
0bb65f27ee806ec3bd4007e1641f3e996261a04e
https://github.com/taskadapter/redmine-java-api/blob/0bb65f27ee806ec3bd4007e1641f3e996261a04e/src/main/java/com/taskadapter/redmineapi/internal/comm/TransportDecoder.java#L48-L57
55,884
taskadapter/redmine-java-api
src/main/java/com/taskadapter/redmineapi/bean/PropertyStorageUtil.java
PropertyStorageUtil.updateCollections
public static void updateCollections(PropertyStorage storage, Transport transport) { storage.getProperties().forEach(e -> { if (Collection.class.isAssignableFrom(e.getKey().getType())) { // found a collection in properties ((Collection) e.getValue()).forEach(i -> { ...
java
public static void updateCollections(PropertyStorage storage, Transport transport) { storage.getProperties().forEach(e -> { if (Collection.class.isAssignableFrom(e.getKey().getType())) { // found a collection in properties ((Collection) e.getValue()).forEach(i -> { ...
[ "public", "static", "void", "updateCollections", "(", "PropertyStorage", "storage", ",", "Transport", "transport", ")", "{", "storage", ".", "getProperties", "(", ")", ".", "forEach", "(", "e", "->", "{", "if", "(", "Collection", ".", "class", ".", "isAssign...
go over all properties in the storage and set `transport` on FluentStyle instances inside collections, if any. only process one level, without recursion - to avoid potential cycles and such.
[ "go", "over", "all", "properties", "in", "the", "storage", "and", "set", "transport", "on", "FluentStyle", "instances", "inside", "collections", "if", "any", ".", "only", "process", "one", "level", "without", "recursion", "-", "to", "avoid", "potential", "cycl...
0bb65f27ee806ec3bd4007e1641f3e996261a04e
https://github.com/taskadapter/redmine-java-api/blob/0bb65f27ee806ec3bd4007e1641f3e996261a04e/src/main/java/com/taskadapter/redmineapi/bean/PropertyStorageUtil.java#L12-L25
55,885
taskadapter/redmine-java-api
src/main/java/com/taskadapter/redmineapi/internal/RedmineJSONBuilder.java
RedmineJSONBuilder.writeProject
public static void writeProject(JSONWriter writer, Project project) throws IllegalArgumentException, JSONException { /* Validate project */ if (project.getName() == null) throw new IllegalArgumentException( "Project name must be set to create a new project"); if (project.getIdentifier() == null) thr...
java
public static void writeProject(JSONWriter writer, Project project) throws IllegalArgumentException, JSONException { /* Validate project */ if (project.getName() == null) throw new IllegalArgumentException( "Project name must be set to create a new project"); if (project.getIdentifier() == null) thr...
[ "public", "static", "void", "writeProject", "(", "JSONWriter", "writer", ",", "Project", "project", ")", "throws", "IllegalArgumentException", ",", "JSONException", "{", "/* Validate project */", "if", "(", "project", ".", "getName", "(", ")", "==", "null", ")", ...
Writes a "create project" request. @param writer project writer. @param project project to create. @throws IllegalArgumentException if some project fields are not configured. @throws JSONException if IO error occurs.
[ "Writes", "a", "create", "project", "request", "." ]
0bb65f27ee806ec3bd4007e1641f3e996261a04e
https://github.com/taskadapter/redmine-java-api/blob/0bb65f27ee806ec3bd4007e1641f3e996261a04e/src/main/java/com/taskadapter/redmineapi/internal/RedmineJSONBuilder.java#L53-L64
55,886
taskadapter/redmine-java-api
src/main/java/com/taskadapter/redmineapi/internal/RedmineJSONBuilder.java
RedmineJSONBuilder.toSimpleJSON
public static <T> String toSimpleJSON(String tag, T object, JsonObjectWriter<T> writer) throws RedmineInternalError { final StringWriter swriter = new StringWriter(); final JSONWriter jsWriter = new JSONWriter(swriter); try { jsWriter.object(); jsWriter.key(tag); jsWriter.object(); writer.write(jsW...
java
public static <T> String toSimpleJSON(String tag, T object, JsonObjectWriter<T> writer) throws RedmineInternalError { final StringWriter swriter = new StringWriter(); final JSONWriter jsWriter = new JSONWriter(swriter); try { jsWriter.object(); jsWriter.key(tag); jsWriter.object(); writer.write(jsW...
[ "public", "static", "<", "T", ">", "String", "toSimpleJSON", "(", "String", "tag", ",", "T", "object", ",", "JsonObjectWriter", "<", "T", ">", "writer", ")", "throws", "RedmineInternalError", "{", "final", "StringWriter", "swriter", "=", "new", "StringWriter",...
Converts object to a "simple" json. @param tag object tag. @param object object to convert. @param writer object writer. @return object String representation. @throws RedmineInternalError if conversion fails.
[ "Converts", "object", "to", "a", "simple", "json", "." ]
0bb65f27ee806ec3bd4007e1641f3e996261a04e
https://github.com/taskadapter/redmine-java-api/blob/0bb65f27ee806ec3bd4007e1641f3e996261a04e/src/main/java/com/taskadapter/redmineapi/internal/RedmineJSONBuilder.java#L118-L134
55,887
scalecube/scalecube-services
services/src/main/java/io/scalecube/services/routing/Routers.java
Routers.getRouter
public static Router getRouter(Class<? extends Router> routerType) { return routers.computeIfAbsent(routerType, Routers::create); }
java
public static Router getRouter(Class<? extends Router> routerType) { return routers.computeIfAbsent(routerType, Routers::create); }
[ "public", "static", "Router", "getRouter", "(", "Class", "<", "?", "extends", "Router", ">", "routerType", ")", "{", "return", "routers", ".", "computeIfAbsent", "(", "routerType", ",", "Routers", "::", "create", ")", ";", "}" ]
Get router instance by a given router class. The class should have a default constructor. Otherwise no router can be created @param routerType the type of the Router. @return instance of the Router.
[ "Get", "router", "instance", "by", "a", "given", "router", "class", ".", "The", "class", "should", "have", "a", "default", "constructor", ".", "Otherwise", "no", "router", "can", "be", "created" ]
76c8de6019e5480a1436d12b37acf163f70eea47
https://github.com/scalecube/scalecube-services/blob/76c8de6019e5480a1436d12b37acf163f70eea47/services/src/main/java/io/scalecube/services/routing/Routers.java#L23-L25
55,888
scalecube/scalecube-services
services-gateway-websocket/src/main/java/io/scalecube/services/gateway/ws/WebsocketSession.java
WebsocketSession.send
public Mono<Void> send(GatewayMessage response) { return Mono.defer( () -> outbound .sendObject(Mono.just(response).map(codec::encode).map(TextWebSocketFrame::new)) .then() .doOnSuccessOrError((avoid, th) -> logSend(response, th))); }
java
public Mono<Void> send(GatewayMessage response) { return Mono.defer( () -> outbound .sendObject(Mono.just(response).map(codec::encode).map(TextWebSocketFrame::new)) .then() .doOnSuccessOrError((avoid, th) -> logSend(response, th))); }
[ "public", "Mono", "<", "Void", ">", "send", "(", "GatewayMessage", "response", ")", "{", "return", "Mono", ".", "defer", "(", "(", ")", "->", "outbound", ".", "sendObject", "(", "Mono", ".", "just", "(", "response", ")", ".", "map", "(", "codec", "::...
Method to send normal response. @param response response @return mono void
[ "Method", "to", "send", "normal", "response", "." ]
76c8de6019e5480a1436d12b37acf163f70eea47
https://github.com/scalecube/scalecube-services/blob/76c8de6019e5480a1436d12b37acf163f70eea47/services-gateway-websocket/src/main/java/io/scalecube/services/gateway/ws/WebsocketSession.java#L82-L89
55,889
scalecube/scalecube-services
services-gateway-websocket/src/main/java/io/scalecube/services/gateway/ws/WebsocketSession.java
WebsocketSession.onClose
public Mono<Void> onClose(Disposable disposable) { return Mono.create( sink -> inbound.withConnection( connection -> connection .onDispose(disposable) .onTerminate() .subscribe(sink::succe...
java
public Mono<Void> onClose(Disposable disposable) { return Mono.create( sink -> inbound.withConnection( connection -> connection .onDispose(disposable) .onTerminate() .subscribe(sink::succe...
[ "public", "Mono", "<", "Void", ">", "onClose", "(", "Disposable", "disposable", ")", "{", "return", "Mono", ".", "create", "(", "sink", "->", "inbound", ".", "withConnection", "(", "connection", "->", "connection", ".", "onDispose", "(", "disposable", ")", ...
Lambda setter for reacting on channel close occurrence. @param disposable function to run when disposable would take place
[ "Lambda", "setter", "for", "reacting", "on", "channel", "close", "occurrence", "." ]
76c8de6019e5480a1436d12b37acf163f70eea47
https://github.com/scalecube/scalecube-services/blob/76c8de6019e5480a1436d12b37acf163f70eea47/services-gateway-websocket/src/main/java/io/scalecube/services/gateway/ws/WebsocketSession.java#L116-L125
55,890
scalecube/scalecube-services
services-gateway-websocket/src/main/java/io/scalecube/services/gateway/ws/WebsocketSession.java
WebsocketSession.dispose
public boolean dispose(Long streamId) { boolean result = false; if (streamId != null) { Disposable disposable = subscriptions.remove(streamId); result = disposable != null; if (result) { LOGGER.debug("Dispose subscription by sid={}, session={}", streamId, id); disposable.dispos...
java
public boolean dispose(Long streamId) { boolean result = false; if (streamId != null) { Disposable disposable = subscriptions.remove(streamId); result = disposable != null; if (result) { LOGGER.debug("Dispose subscription by sid={}, session={}", streamId, id); disposable.dispos...
[ "public", "boolean", "dispose", "(", "Long", "streamId", ")", "{", "boolean", "result", "=", "false", ";", "if", "(", "streamId", "!=", "null", ")", "{", "Disposable", "disposable", "=", "subscriptions", ".", "remove", "(", "streamId", ")", ";", "result", ...
Disposing stored subscription by given stream id. @param streamId stream id @return true of subscription was disposed
[ "Disposing", "stored", "subscription", "by", "given", "stream", "id", "." ]
76c8de6019e5480a1436d12b37acf163f70eea47
https://github.com/scalecube/scalecube-services/blob/76c8de6019e5480a1436d12b37acf163f70eea47/services-gateway-websocket/src/main/java/io/scalecube/services/gateway/ws/WebsocketSession.java#L133-L144
55,891
scalecube/scalecube-services
services-discovery/src/main/java/io/scalecube/services/discovery/ScalecubeServiceDiscovery.java
ScalecubeServiceDiscovery.start
@Override public Mono<ServiceDiscovery> start() { return Mono.defer( () -> { Map<String, String> metadata = endpoint != null ? Collections.singletonMap( endpoint.id(), ClusterMetadataCodec.encodeMetadata(endpoint)) : Collect...
java
@Override public Mono<ServiceDiscovery> start() { return Mono.defer( () -> { Map<String, String> metadata = endpoint != null ? Collections.singletonMap( endpoint.id(), ClusterMetadataCodec.encodeMetadata(endpoint)) : Collect...
[ "@", "Override", "public", "Mono", "<", "ServiceDiscovery", ">", "start", "(", ")", "{", "return", "Mono", ".", "defer", "(", "(", ")", "->", "{", "Map", "<", "String", ",", "String", ">", "metadata", "=", "endpoint", "!=", "null", "?", "Collections", ...
Starts scalecube service discoevery. Joins a cluster with local services as metadata. @return mono result
[ "Starts", "scalecube", "service", "discoevery", ".", "Joins", "a", "cluster", "with", "local", "services", "as", "metadata", "." ]
76c8de6019e5480a1436d12b37acf163f70eea47
https://github.com/scalecube/scalecube-services/blob/76c8de6019e5480a1436d12b37acf163f70eea47/services-discovery/src/main/java/io/scalecube/services/discovery/ScalecubeServiceDiscovery.java#L94-L112
55,892
scalecube/scalecube-services
services-gateway-clientsdk/src/main/java/io/scalecube/services/gateway/clientsdk/Reflect.java
Reflect.parameterizedReturnType
private static Class<?> parameterizedReturnType(Method method) { Type type = method.getGenericReturnType(); if (type instanceof ParameterizedType) { try { return Class.forName( (((ParameterizedType) type).getActualTypeArguments()[0]).getTypeName()); } catch (ClassNotFoundExceptio...
java
private static Class<?> parameterizedReturnType(Method method) { Type type = method.getGenericReturnType(); if (type instanceof ParameterizedType) { try { return Class.forName( (((ParameterizedType) type).getActualTypeArguments()[0]).getTypeName()); } catch (ClassNotFoundExceptio...
[ "private", "static", "Class", "<", "?", ">", "parameterizedReturnType", "(", "Method", "method", ")", "{", "Type", "type", "=", "method", ".", "getGenericReturnType", "(", ")", ";", "if", "(", "type", "instanceof", "ParameterizedType", ")", "{", "try", "{", ...
extract parameterized return value of a method. @param method to extract type from. @return the generic type of the return value or object.
[ "extract", "parameterized", "return", "value", "of", "a", "method", "." ]
76c8de6019e5480a1436d12b37acf163f70eea47
https://github.com/scalecube/scalecube-services/blob/76c8de6019e5480a1436d12b37acf163f70eea47/services-gateway-clientsdk/src/main/java/io/scalecube/services/gateway/clientsdk/Reflect.java#L73-L85
55,893
scalecube/scalecube-services
services-benchmarks/src/main/java/io/scalecube/services/benchmarks/LatencyHelper.java
LatencyHelper.calculate
public void calculate(ServiceMessage message) { // client to service eval( message.header(SERVICE_RECV_TIME), message.header(CLIENT_SEND_TIME), (v1, v2) -> clientToServiceTimer.update(v1 - v2, TimeUnit.MILLISECONDS)); // service to client eval( message.header(CLIENT_RECV...
java
public void calculate(ServiceMessage message) { // client to service eval( message.header(SERVICE_RECV_TIME), message.header(CLIENT_SEND_TIME), (v1, v2) -> clientToServiceTimer.update(v1 - v2, TimeUnit.MILLISECONDS)); // service to client eval( message.header(CLIENT_RECV...
[ "public", "void", "calculate", "(", "ServiceMessage", "message", ")", "{", "// client to service", "eval", "(", "message", ".", "header", "(", "SERVICE_RECV_TIME", ")", ",", "message", ".", "header", "(", "CLIENT_SEND_TIME", ")", ",", "(", "v1", ",", "v2", "...
Calculates latencies by the headers into received message. @param message client message
[ "Calculates", "latencies", "by", "the", "headers", "into", "received", "message", "." ]
76c8de6019e5480a1436d12b37acf163f70eea47
https://github.com/scalecube/scalecube-services/blob/76c8de6019e5480a1436d12b37acf163f70eea47/services-benchmarks/src/main/java/io/scalecube/services/benchmarks/LatencyHelper.java#L36-L48
55,894
scalecube/scalecube-services
services-api/src/main/java/io/scalecube/services/api/ServiceMessage.java
ServiceMessage.from
public static Builder from(ServiceMessage message) { return ServiceMessage.builder().data(message.data()).headers(message.headers()); }
java
public static Builder from(ServiceMessage message) { return ServiceMessage.builder().data(message.data()).headers(message.headers()); }
[ "public", "static", "Builder", "from", "(", "ServiceMessage", "message", ")", "{", "return", "ServiceMessage", ".", "builder", "(", ")", ".", "data", "(", "message", ".", "data", "(", ")", ")", ".", "headers", "(", "message", ".", "headers", "(", ")", ...
Instantiates new message with the same data and headers as at given message. @param message the message to be copied @return a new message, with the same data and headers
[ "Instantiates", "new", "message", "with", "the", "same", "data", "and", "headers", "as", "at", "given", "message", "." ]
76c8de6019e5480a1436d12b37acf163f70eea47
https://github.com/scalecube/scalecube-services/blob/76c8de6019e5480a1436d12b37acf163f70eea47/services-api/src/main/java/io/scalecube/services/api/ServiceMessage.java#L50-L52
55,895
scalecube/scalecube-services
services-api/src/main/java/io/scalecube/services/api/ServiceMessage.java
ServiceMessage.error
public static ServiceMessage error(int errorType, int errorCode, String errorMessage) { return ServiceMessage.builder() .qualifier(Qualifier.asError(errorType)) .data(new ErrorData(errorCode, errorMessage)) .build(); }
java
public static ServiceMessage error(int errorType, int errorCode, String errorMessage) { return ServiceMessage.builder() .qualifier(Qualifier.asError(errorType)) .data(new ErrorData(errorCode, errorMessage)) .build(); }
[ "public", "static", "ServiceMessage", "error", "(", "int", "errorType", ",", "int", "errorCode", ",", "String", "errorMessage", ")", "{", "return", "ServiceMessage", ".", "builder", "(", ")", ".", "qualifier", "(", "Qualifier", ".", "asError", "(", "errorType"...
Instantiates new message with error qualifier for given error type and specified error code and message. @param errorType the error type to be used in message qualifier. @param errorCode the error code. @param errorMessage the error message. @return builder.
[ "Instantiates", "new", "message", "with", "error", "qualifier", "for", "given", "error", "type", "and", "specified", "error", "code", "and", "message", "." ]
76c8de6019e5480a1436d12b37acf163f70eea47
https://github.com/scalecube/scalecube-services/blob/76c8de6019e5480a1436d12b37acf163f70eea47/services-api/src/main/java/io/scalecube/services/api/ServiceMessage.java#L63-L68
55,896
scalecube/scalecube-services
services-api/src/main/java/io/scalecube/services/api/ServiceMessage.java
ServiceMessage.setHeaders
void setHeaders(Map<String, String> headers) { this.headers = Collections.unmodifiableMap(new HashMap<>(headers)); }
java
void setHeaders(Map<String, String> headers) { this.headers = Collections.unmodifiableMap(new HashMap<>(headers)); }
[ "void", "setHeaders", "(", "Map", "<", "String", ",", "String", ">", "headers", ")", "{", "this", ".", "headers", "=", "Collections", ".", "unmodifiableMap", "(", "new", "HashMap", "<>", "(", "headers", ")", ")", ";", "}" ]
Sets headers for deserialization purpose. @param headers headers to set
[ "Sets", "headers", "for", "deserialization", "purpose", "." ]
76c8de6019e5480a1436d12b37acf163f70eea47
https://github.com/scalecube/scalecube-services/blob/76c8de6019e5480a1436d12b37acf163f70eea47/services-api/src/main/java/io/scalecube/services/api/ServiceMessage.java#L93-L95
55,897
scalecube/scalecube-services
services-api/src/main/java/io/scalecube/services/api/ServiceMessage.java
ServiceMessage.header
public String header(String name) { Objects.requireNonNull(name); return headers.get(name); }
java
public String header(String name) { Objects.requireNonNull(name); return headers.get(name); }
[ "public", "String", "header", "(", "String", "name", ")", "{", "Objects", ".", "requireNonNull", "(", "name", ")", ";", "return", "headers", ".", "get", "(", "name", ")", ";", "}" ]
Returns header value by given header name. @param name header name @return the message header by given header name
[ "Returns", "header", "value", "by", "given", "header", "name", "." ]
76c8de6019e5480a1436d12b37acf163f70eea47
https://github.com/scalecube/scalecube-services/blob/76c8de6019e5480a1436d12b37acf163f70eea47/services-api/src/main/java/io/scalecube/services/api/ServiceMessage.java#L112-L115
55,898
scalecube/scalecube-services
services-api/src/main/java/io/scalecube/services/api/ServiceMessage.java
ServiceMessage.isError
public boolean isError() { String qualifier = qualifier(); return qualifier != null && qualifier.contains(Qualifier.ERROR_NAMESPACE); }
java
public boolean isError() { String qualifier = qualifier(); return qualifier != null && qualifier.contains(Qualifier.ERROR_NAMESPACE); }
[ "public", "boolean", "isError", "(", ")", "{", "String", "qualifier", "=", "qualifier", "(", ")", ";", "return", "qualifier", "!=", "null", "&&", "qualifier", ".", "contains", "(", "Qualifier", ".", "ERROR_NAMESPACE", ")", ";", "}" ]
Describes whether the message is an error. @return <code>true</code> if error, otherwise <code>false</code>.
[ "Describes", "whether", "the", "message", "is", "an", "error", "." ]
76c8de6019e5480a1436d12b37acf163f70eea47
https://github.com/scalecube/scalecube-services/blob/76c8de6019e5480a1436d12b37acf163f70eea47/services-api/src/main/java/io/scalecube/services/api/ServiceMessage.java#L176-L179
55,899
scalecube/scalecube-services
services-api/src/main/java/io/scalecube/services/api/ServiceMessage.java
ServiceMessage.errorType
public int errorType() { if (!isError()) { throw new IllegalStateException("Message is not an error"); } try { return Integer.parseInt(Qualifier.getQualifierAction(qualifier())); } catch (NumberFormatException e) { throw new IllegalStateException("Error type must be a number"); } ...
java
public int errorType() { if (!isError()) { throw new IllegalStateException("Message is not an error"); } try { return Integer.parseInt(Qualifier.getQualifierAction(qualifier())); } catch (NumberFormatException e) { throw new IllegalStateException("Error type must be a number"); } ...
[ "public", "int", "errorType", "(", ")", "{", "if", "(", "!", "isError", "(", ")", ")", "{", "throw", "new", "IllegalStateException", "(", "\"Message is not an error\"", ")", ";", "}", "try", "{", "return", "Integer", ".", "parseInt", "(", "Qualifier", ".",...
Returns error type. Error type is an identifier of a group of errors. @return error type.
[ "Returns", "error", "type", ".", "Error", "type", "is", "an", "identifier", "of", "a", "group", "of", "errors", "." ]
76c8de6019e5480a1436d12b37acf163f70eea47
https://github.com/scalecube/scalecube-services/blob/76c8de6019e5480a1436d12b37acf163f70eea47/services-api/src/main/java/io/scalecube/services/api/ServiceMessage.java#L186-L196