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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
101,600 | doubledutch/LazyJSON | src/main/java/me/doubledutch/lazyjson/LazyNode.java | LazyNode.getIntValue | protected int getIntValue() throws LazyException{
int i=startIndex;
boolean sign=false;
int value=0;
if(type==VALUE_FLOAT){
return (int)getDoubleValue();
}else if(type==VALUE_STRING || type==VALUE_ESTRING){
// Attempt to parse as an int, throw if impossible
if(dirty){
if(dirtyBuf.charAt(i)=='-'){... | java | protected int getIntValue() throws LazyException{
int i=startIndex;
boolean sign=false;
int value=0;
if(type==VALUE_FLOAT){
return (int)getDoubleValue();
}else if(type==VALUE_STRING || type==VALUE_ESTRING){
// Attempt to parse as an int, throw if impossible
if(dirty){
if(dirtyBuf.charAt(i)=='-'){... | [
"protected",
"int",
"getIntValue",
"(",
")",
"throws",
"LazyException",
"{",
"int",
"i",
"=",
"startIndex",
";",
"boolean",
"sign",
"=",
"false",
";",
"int",
"value",
"=",
"0",
";",
"if",
"(",
"type",
"==",
"VALUE_FLOAT",
")",
"{",
"return",
"(",
"int"... | Parses the characters of this token and attempts to construct an integer
value from them.
@return the integer value if it could be parsed
@throws LazyException if the value could not be parsed | [
"Parses",
"the",
"characters",
"of",
"this",
"token",
"and",
"attempts",
"to",
"construct",
"an",
"integer",
"value",
"from",
"them",
"."
] | 1a223f57fc0cb9941bc175739697ac95da5618cc | https://github.com/doubledutch/LazyJSON/blob/1a223f57fc0cb9941bc175739697ac95da5618cc/src/main/java/me/doubledutch/lazyjson/LazyNode.java#L226-L295 |
101,601 | doubledutch/LazyJSON | src/main/java/me/doubledutch/lazyjson/LazyNode.java | LazyNode.getDoubleValue | protected double getDoubleValue() throws LazyException{
double d=0.0;
String str=getStringValue();
try{
d=Double.parseDouble(str);
}catch(NumberFormatException nfe){
// This basically can't happen since we already validate the numeric format when parsing
// throw new LazyException("'"+str+"' is not a v... | java | protected double getDoubleValue() throws LazyException{
double d=0.0;
String str=getStringValue();
try{
d=Double.parseDouble(str);
}catch(NumberFormatException nfe){
// This basically can't happen since we already validate the numeric format when parsing
// throw new LazyException("'"+str+"' is not a v... | [
"protected",
"double",
"getDoubleValue",
"(",
")",
"throws",
"LazyException",
"{",
"double",
"d",
"=",
"0.0",
";",
"String",
"str",
"=",
"getStringValue",
"(",
")",
";",
"try",
"{",
"d",
"=",
"Double",
".",
"parseDouble",
"(",
"str",
")",
";",
"}",
"ca... | Parses the characters of this token and attempts to construct a double
value from them.
@return the double value if it could be parsed
@throws LazyException if the value could not be parsed | [
"Parses",
"the",
"characters",
"of",
"this",
"token",
"and",
"attempts",
"to",
"construct",
"a",
"double",
"value",
"from",
"them",
"."
] | 1a223f57fc0cb9941bc175739697ac95da5618cc | https://github.com/doubledutch/LazyJSON/blob/1a223f57fc0cb9941bc175739697ac95da5618cc/src/main/java/me/doubledutch/lazyjson/LazyNode.java#L386-L396 |
101,602 | doubledutch/LazyJSON | src/main/java/me/doubledutch/lazyjson/LazyNode.java | LazyNode.getStringValue | protected String getStringValue(){
if(type==VALUE_NULL){
return null;
}else if(!(type==VALUE_ESTRING||type==EFIELD)){
if(dirty){
return dirtyBuf.substring(startIndex,endIndex);
}
return new String(cbuf,startIndex,endIndex-startIndex);
}else{
StringBuilder buf=new StringBuilder(endIndex-startInd... | java | protected String getStringValue(){
if(type==VALUE_NULL){
return null;
}else if(!(type==VALUE_ESTRING||type==EFIELD)){
if(dirty){
return dirtyBuf.substring(startIndex,endIndex);
}
return new String(cbuf,startIndex,endIndex-startIndex);
}else{
StringBuilder buf=new StringBuilder(endIndex-startInd... | [
"protected",
"String",
"getStringValue",
"(",
")",
"{",
"if",
"(",
"type",
"==",
"VALUE_NULL",
")",
"{",
"return",
"null",
";",
"}",
"else",
"if",
"(",
"!",
"(",
"type",
"==",
"VALUE_ESTRING",
"||",
"type",
"==",
"EFIELD",
")",
")",
"{",
"if",
"(",
... | Extracts a string containing the characters given by this token. If the
token was marked as having escaped characters, they will be unescaped
before the value is returned.
@return the string value held by this token | [
"Extracts",
"a",
"string",
"containing",
"the",
"characters",
"given",
"by",
"this",
"token",
".",
"If",
"the",
"token",
"was",
"marked",
"as",
"having",
"escaped",
"characters",
"they",
"will",
"be",
"unescaped",
"before",
"the",
"value",
"is",
"returned",
... | 1a223f57fc0cb9941bc175739697ac95da5618cc | https://github.com/doubledutch/LazyJSON/blob/1a223f57fc0cb9941bc175739697ac95da5618cc/src/main/java/me/doubledutch/lazyjson/LazyNode.java#L409-L476 |
101,603 | doubledutch/LazyJSON | src/main/java/me/doubledutch/lazyjson/LazyNode.java | LazyNode.addCommaSeparatedChildren | private void addCommaSeparatedChildren(Template template){
LazyNode next=child;
boolean first=true;
while(next!=null){
if(first){
first=false;
}else{
template.addConstant(",");
}
next.addSegments(template);
next=next.next;
}
} | java | private void addCommaSeparatedChildren(Template template){
LazyNode next=child;
boolean first=true;
while(next!=null){
if(first){
first=false;
}else{
template.addConstant(",");
}
next.addSegments(template);
next=next.next;
}
} | [
"private",
"void",
"addCommaSeparatedChildren",
"(",
"Template",
"template",
")",
"{",
"LazyNode",
"next",
"=",
"child",
";",
"boolean",
"first",
"=",
"true",
";",
"while",
"(",
"next",
"!=",
"null",
")",
"{",
"if",
"(",
"first",
")",
"{",
"first",
"=",
... | Functionality for extracting templates | [
"Functionality",
"for",
"extracting",
"templates"
] | 1a223f57fc0cb9941bc175739697ac95da5618cc | https://github.com/doubledutch/LazyJSON/blob/1a223f57fc0cb9941bc175739697ac95da5618cc/src/main/java/me/doubledutch/lazyjson/LazyNode.java#L561-L573 |
101,604 | doubledutch/LazyJSON | src/main/java/me/doubledutch/lazyjson/LazyNode.java | LazyNode.readFromBuffer | protected static LazyNode readFromBuffer(byte[] raw){
ByteBuffer buf=ByteBuffer.wrap(raw);
return readFromBuffer(buf);
} | java | protected static LazyNode readFromBuffer(byte[] raw){
ByteBuffer buf=ByteBuffer.wrap(raw);
return readFromBuffer(buf);
} | [
"protected",
"static",
"LazyNode",
"readFromBuffer",
"(",
"byte",
"[",
"]",
"raw",
")",
"{",
"ByteBuffer",
"buf",
"=",
"ByteBuffer",
".",
"wrap",
"(",
"raw",
")",
";",
"return",
"readFromBuffer",
"(",
"buf",
")",
";",
"}"
] | Functionality for reading and writing LazyNode structures | [
"Functionality",
"for",
"reading",
"and",
"writing",
"LazyNode",
"structures"
] | 1a223f57fc0cb9941bc175739697ac95da5618cc | https://github.com/doubledutch/LazyJSON/blob/1a223f57fc0cb9941bc175739697ac95da5618cc/src/main/java/me/doubledutch/lazyjson/LazyNode.java#L705-L708 |
101,605 | doubledutch/LazyJSON | src/main/java/me/doubledutch/lazyjson/LazyElement.java | LazyElement.parse | public static LazyElement parse(String str) throws LazyException{
int index=0;
while(index<str.length()){
char ch=str.charAt(index);
if(ch=='['){
return new LazyArray(str);
}
if(ch=='{'){
return new LazyObject(str);
}
index++;
}
throw new LazyException("The given string is not a JSON o... | java | public static LazyElement parse(String str) throws LazyException{
int index=0;
while(index<str.length()){
char ch=str.charAt(index);
if(ch=='['){
return new LazyArray(str);
}
if(ch=='{'){
return new LazyObject(str);
}
index++;
}
throw new LazyException("The given string is not a JSON o... | [
"public",
"static",
"LazyElement",
"parse",
"(",
"String",
"str",
")",
"throws",
"LazyException",
"{",
"int",
"index",
"=",
"0",
";",
"while",
"(",
"index",
"<",
"str",
".",
"length",
"(",
")",
")",
"{",
"char",
"ch",
"=",
"str",
".",
"charAt",
"(",
... | Parses a string and returns either a LazyObject or LazyArray
@param str the source json data
@return either a LazyObject or LazyArray instance
@throws LazyException if the string could not be parsed | [
"Parses",
"a",
"string",
"and",
"returns",
"either",
"a",
"LazyObject",
"or",
"LazyArray"
] | 1a223f57fc0cb9941bc175739697ac95da5618cc | https://github.com/doubledutch/LazyJSON/blob/1a223f57fc0cb9941bc175739697ac95da5618cc/src/main/java/me/doubledutch/lazyjson/LazyElement.java#L52-L65 |
101,606 | doubledutch/LazyJSON | src/main/java/me/doubledutch/lazyjson/LazyElement.java | LazyElement.length | public int length(){
if(root.child==null){
return 0;
}
if(length>-1){
return length;
}
length=root.getChildCount();
return length;
} | java | public int length(){
if(root.child==null){
return 0;
}
if(length>-1){
return length;
}
length=root.getChildCount();
return length;
} | [
"public",
"int",
"length",
"(",
")",
"{",
"if",
"(",
"root",
".",
"child",
"==",
"null",
")",
"{",
"return",
"0",
";",
"}",
"if",
"(",
"length",
">",
"-",
"1",
")",
"{",
"return",
"length",
";",
"}",
"length",
"=",
"root",
".",
"getChildCount",
... | Returns the number of fields on this object
@return the number of fields | [
"Returns",
"the",
"number",
"of",
"fields",
"on",
"this",
"object"
] | 1a223f57fc0cb9941bc175739697ac95da5618cc | https://github.com/doubledutch/LazyJSON/blob/1a223f57fc0cb9941bc175739697ac95da5618cc/src/main/java/me/doubledutch/lazyjson/LazyElement.java#L138-L147 |
101,607 | doubledutch/LazyJSON | src/main/java/me/doubledutch/lazyjson/LazyObject.java | LazyObject.getString | public String getString(String key) throws LazyException{
LazyNode token=getFieldToken(key);
return token.getStringValue();
} | java | public String getString(String key) throws LazyException{
LazyNode token=getFieldToken(key);
return token.getStringValue();
} | [
"public",
"String",
"getString",
"(",
"String",
"key",
")",
"throws",
"LazyException",
"{",
"LazyNode",
"token",
"=",
"getFieldToken",
"(",
"key",
")",
";",
"return",
"token",
".",
"getStringValue",
"(",
")",
";",
"}"
] | Returns the string value stored in this object for the given key.
@param key the name of the field on this object
@return the requested string value
@throws LazyException if the value for the given key was not a string. | [
"Returns",
"the",
"string",
"value",
"stored",
"in",
"this",
"object",
"for",
"the",
"given",
"key",
"."
] | 1a223f57fc0cb9941bc175739697ac95da5618cc | https://github.com/doubledutch/LazyJSON/blob/1a223f57fc0cb9941bc175739697ac95da5618cc/src/main/java/me/doubledutch/lazyjson/LazyObject.java#L336-L339 |
101,608 | doubledutch/LazyJSON | src/main/java/me/doubledutch/lazyjson/LazyObject.java | LazyObject.optString | public String optString(String key,String defaultValue){
LazyNode token=getOptionalFieldToken(key);
if(token==null)return defaultValue;
if(token.type==LazyNode.VALUE_NULL)return defaultValue;
return token.getStringValue();
} | java | public String optString(String key,String defaultValue){
LazyNode token=getOptionalFieldToken(key);
if(token==null)return defaultValue;
if(token.type==LazyNode.VALUE_NULL)return defaultValue;
return token.getStringValue();
} | [
"public",
"String",
"optString",
"(",
"String",
"key",
",",
"String",
"defaultValue",
")",
"{",
"LazyNode",
"token",
"=",
"getOptionalFieldToken",
"(",
"key",
")",
";",
"if",
"(",
"token",
"==",
"null",
")",
"return",
"defaultValue",
";",
"if",
"(",
"token... | Returns the string value stored in this object for the given key.
Returns the default value if there is no such key.
@param key the name of the field on this object
@param defaultValue the default value to return
@return the requested string value or the default value if there was no such key | [
"Returns",
"the",
"string",
"value",
"stored",
"in",
"this",
"object",
"for",
"the",
"given",
"key",
".",
"Returns",
"the",
"default",
"value",
"if",
"there",
"is",
"no",
"such",
"key",
"."
] | 1a223f57fc0cb9941bc175739697ac95da5618cc | https://github.com/doubledutch/LazyJSON/blob/1a223f57fc0cb9941bc175739697ac95da5618cc/src/main/java/me/doubledutch/lazyjson/LazyObject.java#L363-L368 |
101,609 | doubledutch/LazyJSON | src/main/java/me/doubledutch/lazyjson/LazyObject.java | LazyObject.getInt | public int getInt(String key) throws LazyException{
LazyNode token=getFieldToken(key);
return token.getIntValue();
} | java | public int getInt(String key) throws LazyException{
LazyNode token=getFieldToken(key);
return token.getIntValue();
} | [
"public",
"int",
"getInt",
"(",
"String",
"key",
")",
"throws",
"LazyException",
"{",
"LazyNode",
"token",
"=",
"getFieldToken",
"(",
"key",
")",
";",
"return",
"token",
".",
"getIntValue",
"(",
")",
";",
"}"
] | Returns the integer value stored in this object for the given key.
@param key the name of the field on this object
@return an integer value
@throws LazyException if the value for the given key was not an integer. | [
"Returns",
"the",
"integer",
"value",
"stored",
"in",
"this",
"object",
"for",
"the",
"given",
"key",
"."
] | 1a223f57fc0cb9941bc175739697ac95da5618cc | https://github.com/doubledutch/LazyJSON/blob/1a223f57fc0cb9941bc175739697ac95da5618cc/src/main/java/me/doubledutch/lazyjson/LazyObject.java#L377-L380 |
101,610 | doubledutch/LazyJSON | src/main/java/me/doubledutch/lazyjson/LazyObject.java | LazyObject.optInt | public int optInt(String key){
LazyNode token=getOptionalFieldToken(key);
if(token==null)return 0;
if(token.type==LazyNode.VALUE_NULL)return 0;
return token.getIntValue();
} | java | public int optInt(String key){
LazyNode token=getOptionalFieldToken(key);
if(token==null)return 0;
if(token.type==LazyNode.VALUE_NULL)return 0;
return token.getIntValue();
} | [
"public",
"int",
"optInt",
"(",
"String",
"key",
")",
"{",
"LazyNode",
"token",
"=",
"getOptionalFieldToken",
"(",
"key",
")",
";",
"if",
"(",
"token",
"==",
"null",
")",
"return",
"0",
";",
"if",
"(",
"token",
".",
"type",
"==",
"LazyNode",
".",
"VA... | Returns the integer value stored in this object for the given key.
Returns 0 if there is no such key.
@param key the name of the field on this object
@return the requested integer value or 0 if there was no such key | [
"Returns",
"the",
"integer",
"value",
"stored",
"in",
"this",
"object",
"for",
"the",
"given",
"key",
".",
"Returns",
"0",
"if",
"there",
"is",
"no",
"such",
"key",
"."
] | 1a223f57fc0cb9941bc175739697ac95da5618cc | https://github.com/doubledutch/LazyJSON/blob/1a223f57fc0cb9941bc175739697ac95da5618cc/src/main/java/me/doubledutch/lazyjson/LazyObject.java#L389-L394 |
101,611 | doubledutch/LazyJSON | src/main/java/me/doubledutch/lazyjson/LazyObject.java | LazyObject.getLong | public long getLong(String key) throws LazyException{
LazyNode token=getFieldToken(key);
return token.getLongValue();
} | java | public long getLong(String key) throws LazyException{
LazyNode token=getFieldToken(key);
return token.getLongValue();
} | [
"public",
"long",
"getLong",
"(",
"String",
"key",
")",
"throws",
"LazyException",
"{",
"LazyNode",
"token",
"=",
"getFieldToken",
"(",
"key",
")",
";",
"return",
"token",
".",
"getLongValue",
"(",
")",
";",
"}"
] | Returns the long value stored in this object for the given key.
@param key the name of the field on this object
@return a boolean value
@throws LazyException if the value for the given key was not a long. | [
"Returns",
"the",
"long",
"value",
"stored",
"in",
"this",
"object",
"for",
"the",
"given",
"key",
"."
] | 1a223f57fc0cb9941bc175739697ac95da5618cc | https://github.com/doubledutch/LazyJSON/blob/1a223f57fc0cb9941bc175739697ac95da5618cc/src/main/java/me/doubledutch/lazyjson/LazyObject.java#L418-L421 |
101,612 | doubledutch/LazyJSON | src/main/java/me/doubledutch/lazyjson/LazyObject.java | LazyObject.optLong | public long optLong(String key){
LazyNode token=getOptionalFieldToken(key);
if(token==null)return 0l;
if(token.type==LazyNode.VALUE_NULL)return 0l;
return token.getLongValue();
} | java | public long optLong(String key){
LazyNode token=getOptionalFieldToken(key);
if(token==null)return 0l;
if(token.type==LazyNode.VALUE_NULL)return 0l;
return token.getLongValue();
} | [
"public",
"long",
"optLong",
"(",
"String",
"key",
")",
"{",
"LazyNode",
"token",
"=",
"getOptionalFieldToken",
"(",
"key",
")",
";",
"if",
"(",
"token",
"==",
"null",
")",
"return",
"0l",
";",
"if",
"(",
"token",
".",
"type",
"==",
"LazyNode",
".",
... | Returns the long value stored in this object for the given key.
Returns 0 if there is no such key.
@param key the name of the field on this object
@return the requested long value or 0 if there was no such key | [
"Returns",
"the",
"long",
"value",
"stored",
"in",
"this",
"object",
"for",
"the",
"given",
"key",
".",
"Returns",
"0",
"if",
"there",
"is",
"no",
"such",
"key",
"."
] | 1a223f57fc0cb9941bc175739697ac95da5618cc | https://github.com/doubledutch/LazyJSON/blob/1a223f57fc0cb9941bc175739697ac95da5618cc/src/main/java/me/doubledutch/lazyjson/LazyObject.java#L430-L435 |
101,613 | doubledutch/LazyJSON | src/main/java/me/doubledutch/lazyjson/LazyObject.java | LazyObject.getDouble | public double getDouble(String key) throws LazyException{
LazyNode token=getFieldToken(key);
return token.getDoubleValue();
} | java | public double getDouble(String key) throws LazyException{
LazyNode token=getFieldToken(key);
return token.getDoubleValue();
} | [
"public",
"double",
"getDouble",
"(",
"String",
"key",
")",
"throws",
"LazyException",
"{",
"LazyNode",
"token",
"=",
"getFieldToken",
"(",
"key",
")",
";",
"return",
"token",
".",
"getDoubleValue",
"(",
")",
";",
"}"
] | Returns the double value stored in this object for the given key.
@param key the name of the field on this object
@return a boolean value
@throws LazyException if the value for the given key was not a double. | [
"Returns",
"the",
"double",
"value",
"stored",
"in",
"this",
"object",
"for",
"the",
"given",
"key",
"."
] | 1a223f57fc0cb9941bc175739697ac95da5618cc | https://github.com/doubledutch/LazyJSON/blob/1a223f57fc0cb9941bc175739697ac95da5618cc/src/main/java/me/doubledutch/lazyjson/LazyObject.java#L459-L462 |
101,614 | doubledutch/LazyJSON | src/main/java/me/doubledutch/lazyjson/LazyObject.java | LazyObject.optDouble | public double optDouble(String key){
LazyNode token=getOptionalFieldToken(key);
if(token==null)return 0.0;
if(token.type==LazyNode.VALUE_NULL)return 0.0;
return token.getDoubleValue();
} | java | public double optDouble(String key){
LazyNode token=getOptionalFieldToken(key);
if(token==null)return 0.0;
if(token.type==LazyNode.VALUE_NULL)return 0.0;
return token.getDoubleValue();
} | [
"public",
"double",
"optDouble",
"(",
"String",
"key",
")",
"{",
"LazyNode",
"token",
"=",
"getOptionalFieldToken",
"(",
"key",
")",
";",
"if",
"(",
"token",
"==",
"null",
")",
"return",
"0.0",
";",
"if",
"(",
"token",
".",
"type",
"==",
"LazyNode",
".... | Returns the double value stored in this object for the given key.
Returns 0.0 if there is no such key.
@param key the name of the field on this object
@return the requested double value or 0.0 if there was no such key | [
"Returns",
"the",
"double",
"value",
"stored",
"in",
"this",
"object",
"for",
"the",
"given",
"key",
".",
"Returns",
"0",
".",
"0",
"if",
"there",
"is",
"no",
"such",
"key",
"."
] | 1a223f57fc0cb9941bc175739697ac95da5618cc | https://github.com/doubledutch/LazyJSON/blob/1a223f57fc0cb9941bc175739697ac95da5618cc/src/main/java/me/doubledutch/lazyjson/LazyObject.java#L471-L476 |
101,615 | doubledutch/LazyJSON | src/main/java/me/doubledutch/lazyjson/LazyObject.java | LazyObject.isNull | public boolean isNull(String key){
LazyNode token=getOptionalFieldToken(key);
if(token==null)return true;
if(token.type==LazyNode.VALUE_NULL)return true;
return false;
} | java | public boolean isNull(String key){
LazyNode token=getOptionalFieldToken(key);
if(token==null)return true;
if(token.type==LazyNode.VALUE_NULL)return true;
return false;
} | [
"public",
"boolean",
"isNull",
"(",
"String",
"key",
")",
"{",
"LazyNode",
"token",
"=",
"getOptionalFieldToken",
"(",
"key",
")",
";",
"if",
"(",
"token",
"==",
"null",
")",
"return",
"true",
";",
"if",
"(",
"token",
".",
"type",
"==",
"LazyNode",
"."... | Returns true if the value stored in this object for the given key is null.
@param key the name of the field on this object
@return true if the value is null, false otherwise
@throws LazyException if no value was set for the given key. | [
"Returns",
"true",
"if",
"the",
"value",
"stored",
"in",
"this",
"object",
"for",
"the",
"given",
"key",
"is",
"null",
"."
] | 1a223f57fc0cb9941bc175739697ac95da5618cc | https://github.com/doubledutch/LazyJSON/blob/1a223f57fc0cb9941bc175739697ac95da5618cc/src/main/java/me/doubledutch/lazyjson/LazyObject.java#L500-L505 |
101,616 | doubledutch/LazyJSON | src/main/java/me/doubledutch/lazyjson/LazyObject.java | LazyObject.getBoolean | public boolean getBoolean(String key){
LazyNode token=getFieldToken(key);
if(token.type==LazyNode.VALUE_STRING || token.type==LazyNode.VALUE_ESTRING){
String str=token.getStringValue().toLowerCase().trim();
if(str.equals("true"))return true;
if(str.equals("false"))return false;
throw new LazyException("... | java | public boolean getBoolean(String key){
LazyNode token=getFieldToken(key);
if(token.type==LazyNode.VALUE_STRING || token.type==LazyNode.VALUE_ESTRING){
String str=token.getStringValue().toLowerCase().trim();
if(str.equals("true"))return true;
if(str.equals("false"))return false;
throw new LazyException("... | [
"public",
"boolean",
"getBoolean",
"(",
"String",
"key",
")",
"{",
"LazyNode",
"token",
"=",
"getFieldToken",
"(",
"key",
")",
";",
"if",
"(",
"token",
".",
"type",
"==",
"LazyNode",
".",
"VALUE_STRING",
"||",
"token",
".",
"type",
"==",
"LazyNode",
".",... | Returns the boolean value stored in this object for the given key.
@param key the name of the field on this object
@return a boolean value
@throws LazyException if the value for the given key was not a boolean. | [
"Returns",
"the",
"boolean",
"value",
"stored",
"in",
"this",
"object",
"for",
"the",
"given",
"key",
"."
] | 1a223f57fc0cb9941bc175739697ac95da5618cc | https://github.com/doubledutch/LazyJSON/blob/1a223f57fc0cb9941bc175739697ac95da5618cc/src/main/java/me/doubledutch/lazyjson/LazyObject.java#L514-L525 |
101,617 | doubledutch/LazyJSON | src/main/java/me/doubledutch/lazyjson/LazyObject.java | LazyObject.optBoolean | public boolean optBoolean(String key){
LazyNode token=getOptionalFieldToken(key);
if(token==null)return false;
if(token.type==LazyNode.VALUE_STRING || token.type==LazyNode.VALUE_ESTRING){
String str=token.getStringValue().toLowerCase().trim();
if(str.equals("true"))return true;
if(str.equals("false"))ret... | java | public boolean optBoolean(String key){
LazyNode token=getOptionalFieldToken(key);
if(token==null)return false;
if(token.type==LazyNode.VALUE_STRING || token.type==LazyNode.VALUE_ESTRING){
String str=token.getStringValue().toLowerCase().trim();
if(str.equals("true"))return true;
if(str.equals("false"))ret... | [
"public",
"boolean",
"optBoolean",
"(",
"String",
"key",
")",
"{",
"LazyNode",
"token",
"=",
"getOptionalFieldToken",
"(",
"key",
")",
";",
"if",
"(",
"token",
"==",
"null",
")",
"return",
"false",
";",
"if",
"(",
"token",
".",
"type",
"==",
"LazyNode",
... | Returns the boolean value stored in this object for the given key.
Returns false if there is no such key.
@param key the name of the field on this object
@return the requested boolean value or false if there was no such key | [
"Returns",
"the",
"boolean",
"value",
"stored",
"in",
"this",
"object",
"for",
"the",
"given",
"key",
".",
"Returns",
"false",
"if",
"there",
"is",
"no",
"such",
"key",
"."
] | 1a223f57fc0cb9941bc175739697ac95da5618cc | https://github.com/doubledutch/LazyJSON/blob/1a223f57fc0cb9941bc175739697ac95da5618cc/src/main/java/me/doubledutch/lazyjson/LazyObject.java#L534-L547 |
101,618 | doubledutch/LazyJSON | src/main/java/me/doubledutch/lazyjson/LazyObject.java | LazyObject.getJSONObject | public LazyObject getJSONObject(String key) throws LazyException{
LazyNode token=getFieldToken(key);
if(token.type!=LazyNode.OBJECT)throw new LazyException("Requested value is not an object",token);
LazyObject obj=new LazyObject(token);
obj.parent=this;
return obj;
} | java | public LazyObject getJSONObject(String key) throws LazyException{
LazyNode token=getFieldToken(key);
if(token.type!=LazyNode.OBJECT)throw new LazyException("Requested value is not an object",token);
LazyObject obj=new LazyObject(token);
obj.parent=this;
return obj;
} | [
"public",
"LazyObject",
"getJSONObject",
"(",
"String",
"key",
")",
"throws",
"LazyException",
"{",
"LazyNode",
"token",
"=",
"getFieldToken",
"(",
"key",
")",
";",
"if",
"(",
"token",
".",
"type",
"!=",
"LazyNode",
".",
"OBJECT",
")",
"throw",
"new",
"Laz... | Returns the JSON object stored in this object for the given key.
@param key the name of the field on this object
@return an array value
@throws LazyException if the value for the given key was not an object. | [
"Returns",
"the",
"JSON",
"object",
"stored",
"in",
"this",
"object",
"for",
"the",
"given",
"key",
"."
] | 1a223f57fc0cb9941bc175739697ac95da5618cc | https://github.com/doubledutch/LazyJSON/blob/1a223f57fc0cb9941bc175739697ac95da5618cc/src/main/java/me/doubledutch/lazyjson/LazyObject.java#L578-L584 |
101,619 | doubledutch/LazyJSON | src/main/java/me/doubledutch/lazyjson/LazyObject.java | LazyObject.optJSONObject | public LazyObject optJSONObject(String key) throws LazyException{
LazyNode token=getOptionalFieldToken(key);
if(token==null)return null;
if(token.type==LazyNode.VALUE_NULL)return null;
if(token.type!=LazyNode.OBJECT)return null;
LazyObject obj=new LazyObject(token);
obj.parent=this;
return obj;
} | java | public LazyObject optJSONObject(String key) throws LazyException{
LazyNode token=getOptionalFieldToken(key);
if(token==null)return null;
if(token.type==LazyNode.VALUE_NULL)return null;
if(token.type!=LazyNode.OBJECT)return null;
LazyObject obj=new LazyObject(token);
obj.parent=this;
return obj;
} | [
"public",
"LazyObject",
"optJSONObject",
"(",
"String",
"key",
")",
"throws",
"LazyException",
"{",
"LazyNode",
"token",
"=",
"getOptionalFieldToken",
"(",
"key",
")",
";",
"if",
"(",
"token",
"==",
"null",
")",
"return",
"null",
";",
"if",
"(",
"token",
"... | Returns the JSON object stored in this object for the given key on null if the key doesn't exist.
@param key the name of the field on this object
@throws LazyException if the value for the given key was not an object.
@return an object value or null if there was no such key | [
"Returns",
"the",
"JSON",
"object",
"stored",
"in",
"this",
"object",
"for",
"the",
"given",
"key",
"on",
"null",
"if",
"the",
"key",
"doesn",
"t",
"exist",
"."
] | 1a223f57fc0cb9941bc175739697ac95da5618cc | https://github.com/doubledutch/LazyJSON/blob/1a223f57fc0cb9941bc175739697ac95da5618cc/src/main/java/me/doubledutch/lazyjson/LazyObject.java#L593-L601 |
101,620 | doubledutch/LazyJSON | src/main/java/me/doubledutch/lazyjson/LazyObject.java | LazyObject.getJSONArray | public LazyArray getJSONArray(String key) throws LazyException{
LazyNode token=getFieldToken(key);
if(token.type!=LazyNode.ARRAY)throw new LazyException("Requested value is not an array",token);
LazyArray arr=new LazyArray(token);
arr.parent=this;
return arr;
} | java | public LazyArray getJSONArray(String key) throws LazyException{
LazyNode token=getFieldToken(key);
if(token.type!=LazyNode.ARRAY)throw new LazyException("Requested value is not an array",token);
LazyArray arr=new LazyArray(token);
arr.parent=this;
return arr;
} | [
"public",
"LazyArray",
"getJSONArray",
"(",
"String",
"key",
")",
"throws",
"LazyException",
"{",
"LazyNode",
"token",
"=",
"getFieldToken",
"(",
"key",
")",
";",
"if",
"(",
"token",
".",
"type",
"!=",
"LazyNode",
".",
"ARRAY",
")",
"throw",
"new",
"LazyEx... | Returns the JSON array stored in this object for the given key.
@param key the name of the field on this object
@return an array value
@throws LazyException if the value for the given key was not an array. | [
"Returns",
"the",
"JSON",
"array",
"stored",
"in",
"this",
"object",
"for",
"the",
"given",
"key",
"."
] | 1a223f57fc0cb9941bc175739697ac95da5618cc | https://github.com/doubledutch/LazyJSON/blob/1a223f57fc0cb9941bc175739697ac95da5618cc/src/main/java/me/doubledutch/lazyjson/LazyObject.java#L610-L616 |
101,621 | doubledutch/LazyJSON | src/main/java/me/doubledutch/lazyjson/LazyObject.java | LazyObject.optJSONArray | public LazyArray optJSONArray(String key) throws LazyException{
LazyNode token=getOptionalFieldToken(key);
if(token==null)return null;
if(token.type==LazyNode.VALUE_NULL)return null;
if(token.type!=LazyNode.ARRAY)return null;
LazyArray arr=new LazyArray(token);
arr.parent=this;
return arr;
} | java | public LazyArray optJSONArray(String key) throws LazyException{
LazyNode token=getOptionalFieldToken(key);
if(token==null)return null;
if(token.type==LazyNode.VALUE_NULL)return null;
if(token.type!=LazyNode.ARRAY)return null;
LazyArray arr=new LazyArray(token);
arr.parent=this;
return arr;
} | [
"public",
"LazyArray",
"optJSONArray",
"(",
"String",
"key",
")",
"throws",
"LazyException",
"{",
"LazyNode",
"token",
"=",
"getOptionalFieldToken",
"(",
"key",
")",
";",
"if",
"(",
"token",
"==",
"null",
")",
"return",
"null",
";",
"if",
"(",
"token",
"."... | Returns the JSON array stored in this object for the given key or null if the key doesn't exist.
@param key the name of the field on this object
@return an array value or null if the key doesn't exist
@throws LazyException if the value for the given key was not an array. | [
"Returns",
"the",
"JSON",
"array",
"stored",
"in",
"this",
"object",
"for",
"the",
"given",
"key",
"or",
"null",
"if",
"the",
"key",
"doesn",
"t",
"exist",
"."
] | 1a223f57fc0cb9941bc175739697ac95da5618cc | https://github.com/doubledutch/LazyJSON/blob/1a223f57fc0cb9941bc175739697ac95da5618cc/src/main/java/me/doubledutch/lazyjson/LazyObject.java#L625-L633 |
101,622 | doubledutch/LazyJSON | src/main/java/me/doubledutch/lazyjson/LazyObject.java | LazyObject.keySet | public Set<String> keySet(){
HashSet<String> set=new HashSet<String>();
Iterator<String> keys=keys();
while(keys.hasNext()){
set.add(keys.next());
}
return set;
} | java | public Set<String> keySet(){
HashSet<String> set=new HashSet<String>();
Iterator<String> keys=keys();
while(keys.hasNext()){
set.add(keys.next());
}
return set;
} | [
"public",
"Set",
"<",
"String",
">",
"keySet",
"(",
")",
"{",
"HashSet",
"<",
"String",
">",
"set",
"=",
"new",
"HashSet",
"<",
"String",
">",
"(",
")",
";",
"Iterator",
"<",
"String",
">",
"keys",
"=",
"keys",
"(",
")",
";",
"while",
"(",
"keys"... | Returns a set containing all keys on this object. If possible, use the keys iterator instead for improved performance.
@return a set containing all keys in this object | [
"Returns",
"a",
"set",
"containing",
"all",
"keys",
"on",
"this",
"object",
".",
"If",
"possible",
"use",
"the",
"keys",
"iterator",
"instead",
"for",
"improved",
"performance",
"."
] | 1a223f57fc0cb9941bc175739697ac95da5618cc | https://github.com/doubledutch/LazyJSON/blob/1a223f57fc0cb9941bc175739697ac95da5618cc/src/main/java/me/doubledutch/lazyjson/LazyObject.java#L649-L656 |
101,623 | doubledutch/LazyJSON | src/main/java/me/doubledutch/lazyjson/LazyObject.java | LazyObject.keyMatch | private boolean keyMatch(String key,LazyNode token){
if(token.type==LazyNode.EFIELD){
String field=token.getStringValue();
return field.equals(key);
}else{
// Quickly check the length first
int length=key.length();
if(token.endIndex-token.startIndex!=length){
return false;
}
// Now go throu... | java | private boolean keyMatch(String key,LazyNode token){
if(token.type==LazyNode.EFIELD){
String field=token.getStringValue();
return field.equals(key);
}else{
// Quickly check the length first
int length=key.length();
if(token.endIndex-token.startIndex!=length){
return false;
}
// Now go throu... | [
"private",
"boolean",
"keyMatch",
"(",
"String",
"key",
",",
"LazyNode",
"token",
")",
"{",
"if",
"(",
"token",
".",
"type",
"==",
"LazyNode",
".",
"EFIELD",
")",
"{",
"String",
"field",
"=",
"token",
".",
"getStringValue",
"(",
")",
";",
"return",
"fi... | Utility method to evaluate wether a given string matches the value
of a field.
@param key the key to compare a token to
@param token the field token
@return true if the key matches, false otherwise | [
"Utility",
"method",
"to",
"evaluate",
"wether",
"a",
"given",
"string",
"matches",
"the",
"value",
"of",
"a",
"field",
"."
] | 1a223f57fc0cb9941bc175739697ac95da5618cc | https://github.com/doubledutch/LazyJSON/blob/1a223f57fc0cb9941bc175739697ac95da5618cc/src/main/java/me/doubledutch/lazyjson/LazyObject.java#L702-L730 |
101,624 | doubledutch/LazyJSON | src/main/java/me/doubledutch/lazyjson/LazyObject.java | LazyObject.has | public boolean has(String key){
LazyNode child=root.child;
while(child!=null){
if(keyMatch(key,child)){
return true;
}
child=child.next;
}
return false;
} | java | public boolean has(String key){
LazyNode child=root.child;
while(child!=null){
if(keyMatch(key,child)){
return true;
}
child=child.next;
}
return false;
} | [
"public",
"boolean",
"has",
"(",
"String",
"key",
")",
"{",
"LazyNode",
"child",
"=",
"root",
".",
"child",
";",
"while",
"(",
"child",
"!=",
"null",
")",
"{",
"if",
"(",
"keyMatch",
"(",
"key",
",",
"child",
")",
")",
"{",
"return",
"true",
";",
... | Returns true if the given key matches a field on this object.
@param key the name of the field to look for
@return true if the key exists, false otherwise | [
"Returns",
"true",
"if",
"the",
"given",
"key",
"matches",
"a",
"field",
"on",
"this",
"object",
"."
] | 1a223f57fc0cb9941bc175739697ac95da5618cc | https://github.com/doubledutch/LazyJSON/blob/1a223f57fc0cb9941bc175739697ac95da5618cc/src/main/java/me/doubledutch/lazyjson/LazyObject.java#L738-L747 |
101,625 | doubledutch/LazyJSON | src/main/java/me/doubledutch/lazyjson/compressor/Segment.java | Segment.read | public String read(ByteBuffer buf,DictionaryCache dict){
StringBuilder out=new StringBuilder();
if(pre!=null)out.append(pre);
if(type==VOID)return out.toString();
if(type==NULL){
out.append("null");
return out.toString();
}
if(type==BYTE){
out.append(buf.get());
return out.toString();
}
if(t... | java | public String read(ByteBuffer buf,DictionaryCache dict){
StringBuilder out=new StringBuilder();
if(pre!=null)out.append(pre);
if(type==VOID)return out.toString();
if(type==NULL){
out.append("null");
return out.toString();
}
if(type==BYTE){
out.append(buf.get());
return out.toString();
}
if(t... | [
"public",
"String",
"read",
"(",
"ByteBuffer",
"buf",
",",
"DictionaryCache",
"dict",
")",
"{",
"StringBuilder",
"out",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"if",
"(",
"pre",
"!=",
"null",
")",
"out",
".",
"append",
"(",
"pre",
")",
";",
"if",
... | Read this segment from a byte buffer using the given dictionary for
lookups. The dictionary may be null if no dictionary values were used
when writing data for this segment.
@param buf the byte buffer holding the raw data
@param dict a dictionary holding lookup values or null if a dictionary was not used for encoding
... | [
"Read",
"this",
"segment",
"from",
"a",
"byte",
"buffer",
"using",
"the",
"given",
"dictionary",
"for",
"lookups",
".",
"The",
"dictionary",
"may",
"be",
"null",
"if",
"no",
"dictionary",
"values",
"were",
"used",
"when",
"writing",
"data",
"for",
"this",
... | 1a223f57fc0cb9941bc175739697ac95da5618cc | https://github.com/doubledutch/LazyJSON/blob/1a223f57fc0cb9941bc175739697ac95da5618cc/src/main/java/me/doubledutch/lazyjson/compressor/Segment.java#L85-L144 |
101,626 | susom/database | src/main/java/com/github/susom/database/DatabaseProvider.java | DatabaseProvider.fromJndi | @CheckReturnValue
public static Builder fromJndi(final Context context, final String lookupKey, Flavor flavor) {
Options options = new OptionsDefault(flavor);
return new BuilderImpl(null, () -> {
DataSource ds;
try {
ds = (DataSource) context.lookup(lookupKey);
} catch (Exception e)... | java | @CheckReturnValue
public static Builder fromJndi(final Context context, final String lookupKey, Flavor flavor) {
Options options = new OptionsDefault(flavor);
return new BuilderImpl(null, () -> {
DataSource ds;
try {
ds = (DataSource) context.lookup(lookupKey);
} catch (Exception e)... | [
"@",
"CheckReturnValue",
"public",
"static",
"Builder",
"fromJndi",
"(",
"final",
"Context",
"context",
",",
"final",
"String",
"lookupKey",
",",
"Flavor",
"flavor",
")",
"{",
"Options",
"options",
"=",
"new",
"OptionsDefault",
"(",
"flavor",
")",
";",
"return... | Builder method to create and initialize an instance of this class using
a JNDI resource. To use this method you must explicitly indicate what
Flavor of database we are dealing with. | [
"Builder",
"method",
"to",
"create",
"and",
"initialize",
"an",
"instance",
"of",
"this",
"class",
"using",
"a",
"JNDI",
"resource",
".",
"To",
"use",
"this",
"method",
"you",
"must",
"explicitly",
"indicate",
"what",
"Flavor",
"of",
"database",
"we",
"are",... | 25add9e08ad863712f9b5e319b6cb826f6f97640 | https://github.com/susom/database/blob/25add9e08ad863712f9b5e319b6cb826f6f97640/src/main/java/com/github/susom/database/DatabaseProvider.java#L221-L238 |
101,627 | susom/database | src/main/java/com/github/susom/database/VertxUtil.java | VertxUtil.mdc | public static <T> Handler<T> mdc(final Handler<T> handler) {
if (handler == null) {
// Throw here instead of getting NPE inside the handler so we can see the stack trace
throw new IllegalArgumentException("handler may not be null");
}
final Map<String, String> mdc = MDC.getCopyOfContextMap();
... | java | public static <T> Handler<T> mdc(final Handler<T> handler) {
if (handler == null) {
// Throw here instead of getting NPE inside the handler so we can see the stack trace
throw new IllegalArgumentException("handler may not be null");
}
final Map<String, String> mdc = MDC.getCopyOfContextMap();
... | [
"public",
"static",
"<",
"T",
">",
"Handler",
"<",
"T",
">",
"mdc",
"(",
"final",
"Handler",
"<",
"T",
">",
"handler",
")",
"{",
"if",
"(",
"handler",
"==",
"null",
")",
"{",
"// Throw here instead of getting NPE inside the handler so we can see the stack trace",
... | Wrap a Handler in a way that will preserve the SLF4J MDC context.
The context from the current thread at the time of this method call
will be cached and restored within the wrapper at the time the
handler is invoked. This version delegates the handler call directly
on the thread that calls it. | [
"Wrap",
"a",
"Handler",
"in",
"a",
"way",
"that",
"will",
"preserve",
"the",
"SLF4J",
"MDC",
"context",
".",
"The",
"context",
"from",
"the",
"current",
"thread",
"at",
"the",
"time",
"of",
"this",
"method",
"call",
"will",
"be",
"cached",
"and",
"restor... | 25add9e08ad863712f9b5e319b6cb826f6f97640 | https://github.com/susom/database/blob/25add9e08ad863712f9b5e319b6cb826f6f97640/src/main/java/com/github/susom/database/VertxUtil.java#L29-L54 |
101,628 | susom/database | src/main/java/com/github/susom/database/Sql.java | Sql.listSeparator | public Sql listSeparator(/*@Untainted*/ String sql) {
if (listFirstItem.peek()) {
listFirstItem.pop();
listFirstItem.push(false);
return this;
} else {
return append(sql);
}
} | java | public Sql listSeparator(/*@Untainted*/ String sql) {
if (listFirstItem.peek()) {
listFirstItem.pop();
listFirstItem.push(false);
return this;
} else {
return append(sql);
}
} | [
"public",
"Sql",
"listSeparator",
"(",
"/*@Untainted*/",
"String",
"sql",
")",
"{",
"if",
"(",
"listFirstItem",
".",
"peek",
"(",
")",
")",
"{",
"listFirstItem",
".",
"pop",
"(",
")",
";",
"listFirstItem",
".",
"push",
"(",
"false",
")",
";",
"return",
... | Appends the passed bit of sql only if a previous item has already been appended,
and notes that the list is not empty. | [
"Appends",
"the",
"passed",
"bit",
"of",
"sql",
"only",
"if",
"a",
"previous",
"item",
"has",
"already",
"been",
"appended",
"and",
"notes",
"that",
"the",
"list",
"is",
"not",
"empty",
"."
] | 25add9e08ad863712f9b5e319b6cb826f6f97640 | https://github.com/susom/database/blob/25add9e08ad863712f9b5e319b6cb826f6f97640/src/main/java/com/github/susom/database/Sql.java#L242-L250 |
101,629 | dlemmermann/PreferencesFX | preferencesfx/src/main/java/com/dlsc/preferencesfx/view/NavigationPresenter.java | NavigationPresenter.getSelectedCategory | public Category getSelectedCategory() {
TreeItem<Category> selectedTreeItem =
navigationView.treeView.getSelectionModel().getSelectedItem();
if (selectedTreeItem != null) {
return navigationView.treeView.getSelectionModel().getSelectedItem().getValue();
}
return null;
} | java | public Category getSelectedCategory() {
TreeItem<Category> selectedTreeItem =
navigationView.treeView.getSelectionModel().getSelectedItem();
if (selectedTreeItem != null) {
return navigationView.treeView.getSelectionModel().getSelectedItem().getValue();
}
return null;
} | [
"public",
"Category",
"getSelectedCategory",
"(",
")",
"{",
"TreeItem",
"<",
"Category",
">",
"selectedTreeItem",
"=",
"navigationView",
".",
"treeView",
".",
"getSelectionModel",
"(",
")",
".",
"getSelectedItem",
"(",
")",
";",
"if",
"(",
"selectedTreeItem",
"!... | Retrieves the currently selected category in the TreeSearchView. | [
"Retrieves",
"the",
"currently",
"selected",
"category",
"in",
"the",
"TreeSearchView",
"."
] | e06a49663ec949c2f7eb56e6b5952c030ed42d33 | https://github.com/dlemmermann/PreferencesFX/blob/e06a49663ec949c2f7eb56e6b5952c030ed42d33/preferencesfx/src/main/java/com/dlsc/preferencesfx/view/NavigationPresenter.java#L126-L133 |
101,630 | dlemmermann/PreferencesFX | preferencesfx/src/main/java/com/dlsc/preferencesfx/formsfx/view/controls/SimpleRadioButtonControl.java | SimpleRadioButtonControl.createRadioButtons | private void createRadioButtons() {
node.getChildren().clear();
radioButtons.clear();
for (int i = 0; i < field.getItems().size(); i++) {
RadioButton rb = new RadioButton();
rb.setText(field.getItems().get(i).toString());
rb.setToggleGroup(toggleGroup);
radioButtons.add(rb);
}... | java | private void createRadioButtons() {
node.getChildren().clear();
radioButtons.clear();
for (int i = 0; i < field.getItems().size(); i++) {
RadioButton rb = new RadioButton();
rb.setText(field.getItems().get(i).toString());
rb.setToggleGroup(toggleGroup);
radioButtons.add(rb);
}... | [
"private",
"void",
"createRadioButtons",
"(",
")",
"{",
"node",
".",
"getChildren",
"(",
")",
".",
"clear",
"(",
")",
";",
"radioButtons",
".",
"clear",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"field",
".",
"getItems",
"(",
... | This method creates radio buttons and adds them to radioButtons
and is used when the itemsProperty on the field changes. | [
"This",
"method",
"creates",
"radio",
"buttons",
"and",
"adds",
"them",
"to",
"radioButtons",
"and",
"is",
"used",
"when",
"the",
"itemsProperty",
"on",
"the",
"field",
"changes",
"."
] | e06a49663ec949c2f7eb56e6b5952c030ed42d33 | https://github.com/dlemmermann/PreferencesFX/blob/e06a49663ec949c2f7eb56e6b5952c030ed42d33/preferencesfx/src/main/java/com/dlsc/preferencesfx/formsfx/view/controls/SimpleRadioButtonControl.java#L124-L142 |
101,631 | dlemmermann/PreferencesFX | preferencesfx/src/main/java/com/dlsc/preferencesfx/formsfx/view/renderer/PreferencesFxGroupRenderer.java | PreferencesFxGroupRenderer.layoutParts | public void layoutParts() {
StringBuilder styleClass = new StringBuilder("group");
// if there are no rows yet, getRowCount returns -1, in this case the next row is 0
int nextRow = PreferencesFxUtils.getRowCount(grid) + 1;
// Only when the preferencesGroup has a title
if (preferencesGroup.getTitle... | java | public void layoutParts() {
StringBuilder styleClass = new StringBuilder("group");
// if there are no rows yet, getRowCount returns -1, in this case the next row is 0
int nextRow = PreferencesFxUtils.getRowCount(grid) + 1;
// Only when the preferencesGroup has a title
if (preferencesGroup.getTitle... | [
"public",
"void",
"layoutParts",
"(",
")",
"{",
"StringBuilder",
"styleClass",
"=",
"new",
"StringBuilder",
"(",
"\"group\"",
")",
";",
"// if there are no rows yet, getRowCount returns -1, in this case the next row is 0",
"int",
"nextRow",
"=",
"PreferencesFxUtils",
".",
"... | Defines the layout of the rendered group. | [
"Defines",
"the",
"layout",
"of",
"the",
"rendered",
"group",
"."
] | e06a49663ec949c2f7eb56e6b5952c030ed42d33 | https://github.com/dlemmermann/PreferencesFX/blob/e06a49663ec949c2f7eb56e6b5952c030ed42d33/preferencesfx/src/main/java/com/dlsc/preferencesfx/formsfx/view/renderer/PreferencesFxGroupRenderer.java#L65-L113 |
101,632 | dlemmermann/PreferencesFX | preferencesfx/src/main/java/com/dlsc/preferencesfx/history/view/HistoryDialog.java | HistoryDialog.setupClose | private void setupClose() {
this.getButtonTypes().add(ButtonType.CLOSE);
Node closeButton = dialog.getDialogPane().lookupButton(ButtonType.CLOSE);
closeButton.managedProperty().bind(closeButton.visibleProperty());
closeButton.setVisible(false);
} | java | private void setupClose() {
this.getButtonTypes().add(ButtonType.CLOSE);
Node closeButton = dialog.getDialogPane().lookupButton(ButtonType.CLOSE);
closeButton.managedProperty().bind(closeButton.visibleProperty());
closeButton.setVisible(false);
} | [
"private",
"void",
"setupClose",
"(",
")",
"{",
"this",
".",
"getButtonTypes",
"(",
")",
".",
"add",
"(",
"ButtonType",
".",
"CLOSE",
")",
";",
"Node",
"closeButton",
"=",
"dialog",
".",
"getDialogPane",
"(",
")",
".",
"lookupButton",
"(",
"ButtonType",
... | Instantiates a close button and makes it invisible.
Dialog requires at least one button to close the dialog window.
@see <a href="https://docs.oracle.com/javase/8/javafx/api/javafx/scene/control/Dialog.html">
javafx.scene.control.Dialog</a>
Chapter: Dialog Closing Rules | [
"Instantiates",
"a",
"close",
"button",
"and",
"makes",
"it",
"invisible",
".",
"Dialog",
"requires",
"at",
"least",
"one",
"button",
"to",
"close",
"the",
"dialog",
"window",
"."
] | e06a49663ec949c2f7eb56e6b5952c030ed42d33 | https://github.com/dlemmermann/PreferencesFX/blob/e06a49663ec949c2f7eb56e6b5952c030ed42d33/preferencesfx/src/main/java/com/dlsc/preferencesfx/history/view/HistoryDialog.java#L79-L84 |
101,633 | dlemmermann/PreferencesFX | preferencesfx/src/main/java/com/dlsc/preferencesfx/history/History.java | History.doWithoutListeners | public void doWithoutListeners(Setting setting, Runnable action) {
LOGGER.trace(String.format("doWithoutListeners: setting: %s", setting));
setListenerActive(false);
LOGGER.trace("removed listener");
action.run();
LOGGER.trace("performed action");
setListenerActive(true);
LOGGER.trace("add l... | java | public void doWithoutListeners(Setting setting, Runnable action) {
LOGGER.trace(String.format("doWithoutListeners: setting: %s", setting));
setListenerActive(false);
LOGGER.trace("removed listener");
action.run();
LOGGER.trace("performed action");
setListenerActive(true);
LOGGER.trace("add l... | [
"public",
"void",
"doWithoutListeners",
"(",
"Setting",
"setting",
",",
"Runnable",
"action",
")",
"{",
"LOGGER",
".",
"trace",
"(",
"String",
".",
"format",
"(",
"\"doWithoutListeners: setting: %s\"",
",",
"setting",
")",
")",
";",
"setListenerActive",
"(",
"fa... | Enables to perform an action, without firing the attached ChangeListener of a Setting.
This is used by undo and redo, since those shouldn't cause a new change to be added.
@param setting the setting, whose ChangeListener should be ignored
@param action the action to be performed | [
"Enables",
"to",
"perform",
"an",
"action",
"without",
"firing",
"the",
"attached",
"ChangeListener",
"of",
"a",
"Setting",
".",
"This",
"is",
"used",
"by",
"undo",
"and",
"redo",
"since",
"those",
"shouldn",
"t",
"cause",
"a",
"new",
"change",
"to",
"be",... | e06a49663ec949c2f7eb56e6b5952c030ed42d33 | https://github.com/dlemmermann/PreferencesFX/blob/e06a49663ec949c2f7eb56e6b5952c030ed42d33/preferencesfx/src/main/java/com/dlsc/preferencesfx/history/History.java#L150-L158 |
101,634 | dlemmermann/PreferencesFX | preferencesfx/src/main/java/com/dlsc/preferencesfx/history/History.java | History.undo | public boolean undo() {
LOGGER.trace("undo, before, size: " + changes.size() + " pos: " + position.get()
+ " validPos: " + validPosition.get());
Change lastChange = prev();
if (lastChange != null) {
doWithoutListeners(lastChange.getSetting(), lastChange::undo);
LOGGER.trace("undo, after,... | java | public boolean undo() {
LOGGER.trace("undo, before, size: " + changes.size() + " pos: " + position.get()
+ " validPos: " + validPosition.get());
Change lastChange = prev();
if (lastChange != null) {
doWithoutListeners(lastChange.getSetting(), lastChange::undo);
LOGGER.trace("undo, after,... | [
"public",
"boolean",
"undo",
"(",
")",
"{",
"LOGGER",
".",
"trace",
"(",
"\"undo, before, size: \"",
"+",
"changes",
".",
"size",
"(",
")",
"+",
"\" pos: \"",
"+",
"position",
".",
"get",
"(",
")",
"+",
"\" validPos: \"",
"+",
"validPosition",
".",
"get",
... | Undos a change in the history.
@return true if successful, false if there are no changes to undo | [
"Undos",
"a",
"change",
"in",
"the",
"history",
"."
] | e06a49663ec949c2f7eb56e6b5952c030ed42d33 | https://github.com/dlemmermann/PreferencesFX/blob/e06a49663ec949c2f7eb56e6b5952c030ed42d33/preferencesfx/src/main/java/com/dlsc/preferencesfx/history/History.java#L165-L176 |
101,635 | dlemmermann/PreferencesFX | preferencesfx/src/main/java/com/dlsc/preferencesfx/history/History.java | History.redo | public boolean redo() {
LOGGER.trace("redo, before, size: " + changes.size() + " pos: " + position.get()
+ " validPos: " + validPosition.get());
Change nextChange = next();
if (nextChange != null) {
doWithoutListeners(nextChange.getSetting(), nextChange::redo);
LOGGER.trace("redo, after,... | java | public boolean redo() {
LOGGER.trace("redo, before, size: " + changes.size() + " pos: " + position.get()
+ " validPos: " + validPosition.get());
Change nextChange = next();
if (nextChange != null) {
doWithoutListeners(nextChange.getSetting(), nextChange::redo);
LOGGER.trace("redo, after,... | [
"public",
"boolean",
"redo",
"(",
")",
"{",
"LOGGER",
".",
"trace",
"(",
"\"redo, before, size: \"",
"+",
"changes",
".",
"size",
"(",
")",
"+",
"\" pos: \"",
"+",
"position",
".",
"get",
"(",
")",
"+",
"\" validPos: \"",
"+",
"validPosition",
".",
"get",
... | Redos a change in the history.
@return true if successful, false if there are no changes to redo | [
"Redos",
"a",
"change",
"in",
"the",
"history",
"."
] | e06a49663ec949c2f7eb56e6b5952c030ed42d33 | https://github.com/dlemmermann/PreferencesFX/blob/e06a49663ec949c2f7eb56e6b5952c030ed42d33/preferencesfx/src/main/java/com/dlsc/preferencesfx/history/History.java#L191-L202 |
101,636 | dlemmermann/PreferencesFX | preferencesfx/src/main/java/com/dlsc/preferencesfx/history/History.java | History.clear | public void clear(boolean undoAll) {
LOGGER.trace("Clear called, with undoAll: " + undoAll);
if (undoAll) {
undoAll();
}
LOGGER.trace("Clearing changes");
changes.clear();
position.set(-1);
validPosition.set(-1);
} | java | public void clear(boolean undoAll) {
LOGGER.trace("Clear called, with undoAll: " + undoAll);
if (undoAll) {
undoAll();
}
LOGGER.trace("Clearing changes");
changes.clear();
position.set(-1);
validPosition.set(-1);
} | [
"public",
"void",
"clear",
"(",
"boolean",
"undoAll",
")",
"{",
"LOGGER",
".",
"trace",
"(",
"\"Clear called, with undoAll: \"",
"+",
"undoAll",
")",
";",
"if",
"(",
"undoAll",
")",
"{",
"undoAll",
"(",
")",
";",
"}",
"LOGGER",
".",
"trace",
"(",
"\"Clea... | Clears the change history.
@param undoAll if true, will undo all changes before clearing | [
"Clears",
"the",
"change",
"history",
"."
] | e06a49663ec949c2f7eb56e6b5952c030ed42d33 | https://github.com/dlemmermann/PreferencesFX/blob/e06a49663ec949c2f7eb56e6b5952c030ed42d33/preferencesfx/src/main/java/com/dlsc/preferencesfx/history/History.java#L239-L248 |
101,637 | dlemmermann/PreferencesFX | preferencesfx/src/main/java/com/dlsc/preferencesfx/formsfx/view/renderer/PreferencesFxGroup.java | PreferencesFxGroup.translate | public void translate() {
if (translationService == null) {
title.setValue(titleKey.getValue());
return;
}
if (!Strings.isNullOrEmpty(titleKey.getValue())) {
title.setValue(translationService.translate(titleKey.get()));
}
} | java | public void translate() {
if (translationService == null) {
title.setValue(titleKey.getValue());
return;
}
if (!Strings.isNullOrEmpty(titleKey.getValue())) {
title.setValue(translationService.translate(titleKey.get()));
}
} | [
"public",
"void",
"translate",
"(",
")",
"{",
"if",
"(",
"translationService",
"==",
"null",
")",
"{",
"title",
".",
"setValue",
"(",
"titleKey",
".",
"getValue",
"(",
")",
")",
";",
"return",
";",
"}",
"if",
"(",
"!",
"Strings",
".",
"isNullOrEmpty",
... | Updates the title based on the titleKey for i18n.
If there is no translationService, the title will be the same as the titleKey.
If there is a translationService, the titleKey will be used to lookup the translated variant
using the translationService and the title is set. | [
"Updates",
"the",
"title",
"based",
"on",
"the",
"titleKey",
"for",
"i18n",
".",
"If",
"there",
"is",
"no",
"translationService",
"the",
"title",
"will",
"be",
"the",
"same",
"as",
"the",
"titleKey",
".",
"If",
"there",
"is",
"a",
"translationService",
"th... | e06a49663ec949c2f7eb56e6b5952c030ed42d33 | https://github.com/dlemmermann/PreferencesFX/blob/e06a49663ec949c2f7eb56e6b5952c030ed42d33/preferencesfx/src/main/java/com/dlsc/preferencesfx/formsfx/view/renderer/PreferencesFxGroup.java#L110-L119 |
101,638 | dlemmermann/PreferencesFX | preferencesfx/src/main/java/com/dlsc/preferencesfx/formsfx/view/controls/SimpleCheckBoxControl.java | SimpleCheckBoxControl.createCheckboxes | private void createCheckboxes() {
node.getChildren().clear();
checkboxes.clear();
for (int i = 0; i < field.getItems().size(); i++) {
CheckBox cb = new CheckBox();
cb.setText(field.getItems().get(i).toString());
cb.setSelected(field.getSelection().contains(field.getItems().get(i)));
... | java | private void createCheckboxes() {
node.getChildren().clear();
checkboxes.clear();
for (int i = 0; i < field.getItems().size(); i++) {
CheckBox cb = new CheckBox();
cb.setText(field.getItems().get(i).toString());
cb.setSelected(field.getSelection().contains(field.getItems().get(i)));
... | [
"private",
"void",
"createCheckboxes",
"(",
")",
"{",
"node",
".",
"getChildren",
"(",
")",
".",
"clear",
"(",
")",
";",
"checkboxes",
".",
"clear",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"field",
".",
"getItems",
"(",
")... | This method creates node and adds them to checkboxes and is
used when the itemsProperty on the field changes. | [
"This",
"method",
"creates",
"node",
"and",
"adds",
"them",
"to",
"checkboxes",
"and",
"is",
"used",
"when",
"the",
"itemsProperty",
"on",
"the",
"field",
"changes",
"."
] | e06a49663ec949c2f7eb56e6b5952c030ed42d33 | https://github.com/dlemmermann/PreferencesFX/blob/e06a49663ec949c2f7eb56e6b5952c030ed42d33/preferencesfx/src/main/java/com/dlsc/preferencesfx/formsfx/view/controls/SimpleCheckBoxControl.java#L123-L137 |
101,639 | dlemmermann/PreferencesFX | preferencesfx/src/main/java/com/dlsc/preferencesfx/formsfx/view/controls/SimpleCheckBoxControl.java | SimpleCheckBoxControl.setupCheckboxBindings | private void setupCheckboxBindings() {
for (CheckBox checkbox : checkboxes) {
checkbox.disableProperty().bind(field.editableProperty().not());
}
} | java | private void setupCheckboxBindings() {
for (CheckBox checkbox : checkboxes) {
checkbox.disableProperty().bind(field.editableProperty().not());
}
} | [
"private",
"void",
"setupCheckboxBindings",
"(",
")",
"{",
"for",
"(",
"CheckBox",
"checkbox",
":",
"checkboxes",
")",
"{",
"checkbox",
".",
"disableProperty",
"(",
")",
".",
"bind",
"(",
"field",
".",
"editableProperty",
"(",
")",
".",
"not",
"(",
")",
... | Sets up bindings for all checkboxes. | [
"Sets",
"up",
"bindings",
"for",
"all",
"checkboxes",
"."
] | e06a49663ec949c2f7eb56e6b5952c030ed42d33 | https://github.com/dlemmermann/PreferencesFX/blob/e06a49663ec949c2f7eb56e6b5952c030ed42d33/preferencesfx/src/main/java/com/dlsc/preferencesfx/formsfx/view/controls/SimpleCheckBoxControl.java#L142-L146 |
101,640 | dlemmermann/PreferencesFX | preferencesfx/src/main/java/com/dlsc/preferencesfx/formsfx/view/controls/SimpleCheckBoxControl.java | SimpleCheckBoxControl.setupCheckboxEventHandlers | private void setupCheckboxEventHandlers() {
for (int i = 0; i < checkboxes.size(); i++) {
final int j = i;
checkboxes.get(i).setOnAction(event -> {
if (checkboxes.get(j).isSelected()) {
field.select(j);
} else {
field.deselect(j);
}
});
}
} | java | private void setupCheckboxEventHandlers() {
for (int i = 0; i < checkboxes.size(); i++) {
final int j = i;
checkboxes.get(i).setOnAction(event -> {
if (checkboxes.get(j).isSelected()) {
field.select(j);
} else {
field.deselect(j);
}
});
}
} | [
"private",
"void",
"setupCheckboxEventHandlers",
"(",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"checkboxes",
".",
"size",
"(",
")",
";",
"i",
"++",
")",
"{",
"final",
"int",
"j",
"=",
"i",
";",
"checkboxes",
".",
"get",
"(",
"i"... | Sets up event handlers for all checkboxes. | [
"Sets",
"up",
"event",
"handlers",
"for",
"all",
"checkboxes",
"."
] | e06a49663ec949c2f7eb56e6b5952c030ed42d33 | https://github.com/dlemmermann/PreferencesFX/blob/e06a49663ec949c2f7eb56e6b5952c030ed42d33/preferencesfx/src/main/java/com/dlsc/preferencesfx/formsfx/view/controls/SimpleCheckBoxControl.java#L151-L163 |
101,641 | dlemmermann/PreferencesFX | preferencesfx/src/main/java/com/dlsc/preferencesfx/view/NavigationView.java | NavigationView.setupTextField | private void setupTextField() {
searchFld = new CustomTextField();
GlyphFont fontAwesome = GlyphFontRegistry.font("FontAwesome");
Glyph glyph = fontAwesome.create(FontAwesome.Glyph.SEARCH).color(Color.GRAY);
glyph.setPadding(new Insets(0, 3, 0, 5));
searchFld.setLeft(glyph);
} | java | private void setupTextField() {
searchFld = new CustomTextField();
GlyphFont fontAwesome = GlyphFontRegistry.font("FontAwesome");
Glyph glyph = fontAwesome.create(FontAwesome.Glyph.SEARCH).color(Color.GRAY);
glyph.setPadding(new Insets(0, 3, 0, 5));
searchFld.setLeft(glyph);
} | [
"private",
"void",
"setupTextField",
"(",
")",
"{",
"searchFld",
"=",
"new",
"CustomTextField",
"(",
")",
";",
"GlyphFont",
"fontAwesome",
"=",
"GlyphFontRegistry",
".",
"font",
"(",
"\"FontAwesome\"",
")",
";",
"Glyph",
"glyph",
"=",
"fontAwesome",
".",
"crea... | Initializes the TextField and sets the search icon. | [
"Initializes",
"the",
"TextField",
"and",
"sets",
"the",
"search",
"icon",
"."
] | e06a49663ec949c2f7eb56e6b5952c030ed42d33 | https://github.com/dlemmermann/PreferencesFX/blob/e06a49663ec949c2f7eb56e6b5952c030ed42d33/preferencesfx/src/main/java/com/dlsc/preferencesfx/view/NavigationView.java#L65-L71 |
101,642 | dlemmermann/PreferencesFX | preferencesfx/src/main/java/com/dlsc/preferencesfx/util/SearchHandler.java | SearchHandler.init | public void init(
PreferencesFxModel model,
StringProperty searchText,
ObjectProperty<TreeItemPredicate<Category>> predicateProperty
) {
this.model = model;
initializeSearch();
initializeSearchText(searchText);
bindFilterPredicate(predicateProperty);
} | java | public void init(
PreferencesFxModel model,
StringProperty searchText,
ObjectProperty<TreeItemPredicate<Category>> predicateProperty
) {
this.model = model;
initializeSearch();
initializeSearchText(searchText);
bindFilterPredicate(predicateProperty);
} | [
"public",
"void",
"init",
"(",
"PreferencesFxModel",
"model",
",",
"StringProperty",
"searchText",
",",
"ObjectProperty",
"<",
"TreeItemPredicate",
"<",
"Category",
">",
">",
"predicateProperty",
")",
"{",
"this",
".",
"model",
"=",
"model",
";",
"initializeSearch... | Initializes the SearchHandler by initially creating all necessary lists
for filtering and setting up the bindings.
@param searchText textProperty of a TextField where the search string is being input
@param predicateProperty of the rootItem of a {@link FilterableTreeItem}
@apiNote Must be called to make the fil... | [
"Initializes",
"the",
"SearchHandler",
"by",
"initially",
"creating",
"all",
"necessary",
"lists",
"for",
"filtering",
"and",
"setting",
"up",
"the",
"bindings",
"."
] | e06a49663ec949c2f7eb56e6b5952c030ed42d33 | https://github.com/dlemmermann/PreferencesFX/blob/e06a49663ec949c2f7eb56e6b5952c030ed42d33/preferencesfx/src/main/java/com/dlsc/preferencesfx/util/SearchHandler.java#L93-L102 |
101,643 | dlemmermann/PreferencesFX | preferencesfx/src/main/java/com/dlsc/preferencesfx/util/SearchHandler.java | SearchHandler.initializeSearchTextListener | private void initializeSearchTextListener() {
searchText.addListener((observable, oldText, newText) -> {
if (newText.equals("")) { // empty search -> doesn't match anything!
resetSearch();
} else {
updateSearch(newText);
}
});
} | java | private void initializeSearchTextListener() {
searchText.addListener((observable, oldText, newText) -> {
if (newText.equals("")) { // empty search -> doesn't match anything!
resetSearch();
} else {
updateSearch(newText);
}
});
} | [
"private",
"void",
"initializeSearchTextListener",
"(",
")",
"{",
"searchText",
".",
"addListener",
"(",
"(",
"observable",
",",
"oldText",
",",
"newText",
")",
"->",
"{",
"if",
"(",
"newText",
".",
"equals",
"(",
"\"\"",
")",
")",
"{",
"// empty search -> d... | Reacts upon changes in the search text.
If the search text is empty, everything will be unmarked, else the search will be updated. | [
"Reacts",
"upon",
"changes",
"in",
"the",
"search",
"text",
".",
"If",
"the",
"search",
"text",
"is",
"empty",
"everything",
"will",
"be",
"unmarked",
"else",
"the",
"search",
"will",
"be",
"updated",
"."
] | e06a49663ec949c2f7eb56e6b5952c030ed42d33 | https://github.com/dlemmermann/PreferencesFX/blob/e06a49663ec949c2f7eb56e6b5952c030ed42d33/preferencesfx/src/main/java/com/dlsc/preferencesfx/util/SearchHandler.java#L124-L132 |
101,644 | dlemmermann/PreferencesFX | preferencesfx/src/main/java/com/dlsc/preferencesfx/util/SearchHandler.java | SearchHandler.bindFilterPredicate | public void bindFilterPredicate(ObjectProperty<TreeItemPredicate<Category>> predicateProperty) {
predicateProperty.bind(Bindings.createObjectBinding(() -> {
if (searchText.get() == null || searchText.get().isEmpty()) {
return null;
}
return TreeItemPredicate.create(filterPredicate);
},... | java | public void bindFilterPredicate(ObjectProperty<TreeItemPredicate<Category>> predicateProperty) {
predicateProperty.bind(Bindings.createObjectBinding(() -> {
if (searchText.get() == null || searchText.get().isEmpty()) {
return null;
}
return TreeItemPredicate.create(filterPredicate);
},... | [
"public",
"void",
"bindFilterPredicate",
"(",
"ObjectProperty",
"<",
"TreeItemPredicate",
"<",
"Category",
">",
">",
"predicateProperty",
")",
"{",
"predicateProperty",
".",
"bind",
"(",
"Bindings",
".",
"createObjectBinding",
"(",
"(",
")",
"->",
"{",
"if",
"("... | Binds the predicateProperty to ensure filtering according to the searchText.
@param predicateProperty of the rootItem of a {@link FilterableTreeItem} | [
"Binds",
"the",
"predicateProperty",
"to",
"ensure",
"filtering",
"according",
"to",
"the",
"searchText",
"."
] | e06a49663ec949c2f7eb56e6b5952c030ed42d33 | https://github.com/dlemmermann/PreferencesFX/blob/e06a49663ec949c2f7eb56e6b5952c030ed42d33/preferencesfx/src/main/java/com/dlsc/preferencesfx/util/SearchHandler.java#L153-L160 |
101,645 | dlemmermann/PreferencesFX | preferencesfx/src/main/java/com/dlsc/preferencesfx/PreferencesFx.java | PreferencesFx.saveSettings | public PreferencesFx saveSettings(boolean save) {
preferencesFxModel.setSaveSettings(save);
// if settings shouldn't be saved, clear them if there are any present
if (!save) {
preferencesFxModel.getStorageHandler().clearPreferences();
}
return this;
} | java | public PreferencesFx saveSettings(boolean save) {
preferencesFxModel.setSaveSettings(save);
// if settings shouldn't be saved, clear them if there are any present
if (!save) {
preferencesFxModel.getStorageHandler().clearPreferences();
}
return this;
} | [
"public",
"PreferencesFx",
"saveSettings",
"(",
"boolean",
"save",
")",
"{",
"preferencesFxModel",
".",
"setSaveSettings",
"(",
"save",
")",
";",
"// if settings shouldn't be saved, clear them if there are any present",
"if",
"(",
"!",
"save",
")",
"{",
"preferencesFxMode... | Defines whether the adjusted settings of the application should be saved or not.
@param save if true, the values of all settings of the application are saved. When the
application is started again, the settings values will be restored to the last
saved state. Defaults to false.
@return this object for fluent API | [
"Defines",
"whether",
"the",
"adjusted",
"settings",
"of",
"the",
"application",
"should",
"be",
"saved",
"or",
"not",
"."
] | e06a49663ec949c2f7eb56e6b5952c030ed42d33 | https://github.com/dlemmermann/PreferencesFX/blob/e06a49663ec949c2f7eb56e6b5952c030ed42d33/preferencesfx/src/main/java/com/dlsc/preferencesfx/PreferencesFx.java#L179-L186 |
101,646 | dlemmermann/PreferencesFX | preferencesfx/src/main/java/com/dlsc/preferencesfx/PreferencesFx.java | PreferencesFx.removeEventHandler | public PreferencesFx removeEventHandler(EventType<PreferencesFxEvent> eventType,
EventHandler<? super PreferencesFxEvent> eventHandler) {
preferencesFxModel.removeEventHandler(eventType, eventHandler);
return this;
} | java | public PreferencesFx removeEventHandler(EventType<PreferencesFxEvent> eventType,
EventHandler<? super PreferencesFxEvent> eventHandler) {
preferencesFxModel.removeEventHandler(eventType, eventHandler);
return this;
} | [
"public",
"PreferencesFx",
"removeEventHandler",
"(",
"EventType",
"<",
"PreferencesFxEvent",
">",
"eventType",
",",
"EventHandler",
"<",
"?",
"super",
"PreferencesFxEvent",
">",
"eventHandler",
")",
"{",
"preferencesFxModel",
".",
"removeEventHandler",
"(",
"eventType"... | Unregisters a previously registered event handler from the model. One handler might have been
registered for different event types, so the caller needs to specify the particular event type
from which to unregister the handler.
@param eventType the event type from which to unregister
@param eventHandler the handler ... | [
"Unregisters",
"a",
"previously",
"registered",
"event",
"handler",
"from",
"the",
"model",
".",
"One",
"handler",
"might",
"have",
"been",
"registered",
"for",
"different",
"event",
"types",
"so",
"the",
"caller",
"needs",
"to",
"specify",
"the",
"particular",
... | e06a49663ec949c2f7eb56e6b5952c030ed42d33 | https://github.com/dlemmermann/PreferencesFX/blob/e06a49663ec949c2f7eb56e6b5952c030ed42d33/preferencesfx/src/main/java/com/dlsc/preferencesfx/PreferencesFx.java#L256-L260 |
101,647 | dlemmermann/PreferencesFX | preferencesfx/src/main/java/com/dlsc/preferencesfx/model/PreferencesFxModel.java | PreferencesFxModel.initializeCategoryTranslation | private void initializeCategoryTranslation() {
flatCategoriesLst.forEach(category -> {
translationServiceProperty().addListener((observable, oldValue, newValue) -> {
category.translate(newValue);
// listen for i18n changes in the TranslationService for this Category
newValue.addListene... | java | private void initializeCategoryTranslation() {
flatCategoriesLst.forEach(category -> {
translationServiceProperty().addListener((observable, oldValue, newValue) -> {
category.translate(newValue);
// listen for i18n changes in the TranslationService for this Category
newValue.addListene... | [
"private",
"void",
"initializeCategoryTranslation",
"(",
")",
"{",
"flatCategoriesLst",
".",
"forEach",
"(",
"category",
"->",
"{",
"translationServiceProperty",
"(",
")",
".",
"addListener",
"(",
"(",
"observable",
",",
"oldValue",
",",
"newValue",
")",
"->",
"... | Sets up a binding of the TranslationService on the model, so that the Category's title gets
translated properly according to the TranslationService used. | [
"Sets",
"up",
"a",
"binding",
"of",
"the",
"TranslationService",
"on",
"the",
"model",
"so",
"that",
"the",
"Category",
"s",
"title",
"gets",
"translated",
"properly",
"according",
"to",
"the",
"TranslationService",
"used",
"."
] | e06a49663ec949c2f7eb56e6b5952c030ed42d33 | https://github.com/dlemmermann/PreferencesFX/blob/e06a49663ec949c2f7eb56e6b5952c030ed42d33/preferencesfx/src/main/java/com/dlsc/preferencesfx/model/PreferencesFxModel.java#L93-L101 |
101,648 | dlemmermann/PreferencesFX | preferencesfx/src/main/java/com/dlsc/preferencesfx/model/PreferencesFxModel.java | PreferencesFxModel.loadSelectedCategory | public Category loadSelectedCategory() {
String breadcrumb = storageHandler.loadSelectedCategory();
Category defaultCategory = getCategories().get(DEFAULT_CATEGORY);
if (breadcrumb == null) {
return defaultCategory;
}
return flatCategoriesLst.stream()
.filter(category -> category.getBr... | java | public Category loadSelectedCategory() {
String breadcrumb = storageHandler.loadSelectedCategory();
Category defaultCategory = getCategories().get(DEFAULT_CATEGORY);
if (breadcrumb == null) {
return defaultCategory;
}
return flatCategoriesLst.stream()
.filter(category -> category.getBr... | [
"public",
"Category",
"loadSelectedCategory",
"(",
")",
"{",
"String",
"breadcrumb",
"=",
"storageHandler",
".",
"loadSelectedCategory",
"(",
")",
";",
"Category",
"defaultCategory",
"=",
"getCategories",
"(",
")",
".",
"get",
"(",
"DEFAULT_CATEGORY",
")",
";",
... | Loads the last selected Category before exiting the Preferences window.
@return last selected Category | [
"Loads",
"the",
"last",
"selected",
"Category",
"before",
"exiting",
"the",
"Preferences",
"window",
"."
] | e06a49663ec949c2f7eb56e6b5952c030ed42d33 | https://github.com/dlemmermann/PreferencesFX/blob/e06a49663ec949c2f7eb56e6b5952c030ed42d33/preferencesfx/src/main/java/com/dlsc/preferencesfx/model/PreferencesFxModel.java#L165-L174 |
101,649 | dlemmermann/PreferencesFX | preferencesfx/src/main/java/com/dlsc/preferencesfx/model/PreferencesFxModel.java | PreferencesFxModel.removeEventHandler | public void removeEventHandler(EventType<PreferencesFxEvent> eventType,
EventHandler<? super PreferencesFxEvent> eventHandler) {
if (eventType == null) {
throw new NullPointerException("Argument eventType must not be null");
}
if (eventHandler == null) {
throw ne... | java | public void removeEventHandler(EventType<PreferencesFxEvent> eventType,
EventHandler<? super PreferencesFxEvent> eventHandler) {
if (eventType == null) {
throw new NullPointerException("Argument eventType must not be null");
}
if (eventHandler == null) {
throw ne... | [
"public",
"void",
"removeEventHandler",
"(",
"EventType",
"<",
"PreferencesFxEvent",
">",
"eventType",
",",
"EventHandler",
"<",
"?",
"super",
"PreferencesFxEvent",
">",
"eventHandler",
")",
"{",
"if",
"(",
"eventType",
"==",
"null",
")",
"{",
"throw",
"new",
... | Unregisters a previously registered event handler. One handler might have been registered for
different event types, so the caller needs to specify the particular event type from which to
unregister the handler.
@param eventType the event type from which to unregister
@param eventHandler the handler to unregister
@thr... | [
"Unregisters",
"a",
"previously",
"registered",
"event",
"handler",
".",
"One",
"handler",
"might",
"have",
"been",
"registered",
"for",
"different",
"event",
"types",
"so",
"the",
"caller",
"needs",
"to",
"specify",
"the",
"particular",
"event",
"type",
"from",... | e06a49663ec949c2f7eb56e6b5952c030ed42d33 | https://github.com/dlemmermann/PreferencesFX/blob/e06a49663ec949c2f7eb56e6b5952c030ed42d33/preferencesfx/src/main/java/com/dlsc/preferencesfx/model/PreferencesFxModel.java#L303-L316 |
101,650 | dlemmermann/PreferencesFX | preferencesfx/src/main/java/com/dlsc/preferencesfx/util/StorageHandlerImpl.java | StorageHandlerImpl.loadObservableList | public ObservableList loadObservableList(
String breadcrumb,
ObservableList defaultObservableList
) {
String json = getSerializedPreferencesValue(breadcrumb, gson.toJson(defaultObservableList));
return FXCollections.observableArrayList(gson.fromJson(json, ArrayList.class));
} | java | public ObservableList loadObservableList(
String breadcrumb,
ObservableList defaultObservableList
) {
String json = getSerializedPreferencesValue(breadcrumb, gson.toJson(defaultObservableList));
return FXCollections.observableArrayList(gson.fromJson(json, ArrayList.class));
} | [
"public",
"ObservableList",
"loadObservableList",
"(",
"String",
"breadcrumb",
",",
"ObservableList",
"defaultObservableList",
")",
"{",
"String",
"json",
"=",
"getSerializedPreferencesValue",
"(",
"breadcrumb",
",",
"gson",
".",
"toJson",
"(",
"defaultObservableList",
... | Searches in the preferences after a serialized ArrayList using the given key,
deserializes and returns it as ObservableArrayList.
When an ObservableList is deserialzed, Gson returns an ArrayList
and needs to be wrapped into an ObservableArrayList. This is only needed for loading.
@param breadcrumb the key w... | [
"Searches",
"in",
"the",
"preferences",
"after",
"a",
"serialized",
"ArrayList",
"using",
"the",
"given",
"key",
"deserializes",
"and",
"returns",
"it",
"as",
"ObservableArrayList",
".",
"When",
"an",
"ObservableList",
"is",
"deserialzed",
"Gson",
"returns",
"an",... | e06a49663ec949c2f7eb56e6b5952c030ed42d33 | https://github.com/dlemmermann/PreferencesFX/blob/e06a49663ec949c2f7eb56e6b5952c030ed42d33/preferencesfx/src/main/java/com/dlsc/preferencesfx/util/StorageHandlerImpl.java#L195-L201 |
101,651 | dlemmermann/PreferencesFX | preferencesfx/src/main/java/com/dlsc/preferencesfx/model/Setting.java | Setting.of | public static <P> Setting of(
String description, ListProperty<P> items, ObjectProperty<P> selection) {
return new Setting<>(
description,
Field.ofSingleSelectionType(items, selection)
.label(description)
.render(new SimpleComboBoxControl<>()),
selection);
} | java | public static <P> Setting of(
String description, ListProperty<P> items, ObjectProperty<P> selection) {
return new Setting<>(
description,
Field.ofSingleSelectionType(items, selection)
.label(description)
.render(new SimpleComboBoxControl<>()),
selection);
} | [
"public",
"static",
"<",
"P",
">",
"Setting",
"of",
"(",
"String",
"description",
",",
"ListProperty",
"<",
"P",
">",
"items",
",",
"ObjectProperty",
"<",
"P",
">",
"selection",
")",
"{",
"return",
"new",
"Setting",
"<>",
"(",
"description",
",",
"Field"... | Creates a combobox with single selection.
@param description the title of this setting
@param items the items which are possible to choose in the combobox, which are shown
in their {@link #toString()} representation
@param selection the currently selected item of the combobox to be bound, saved / loaded and
us... | [
"Creates",
"a",
"combobox",
"with",
"single",
"selection",
"."
] | e06a49663ec949c2f7eb56e6b5952c030ed42d33 | https://github.com/dlemmermann/PreferencesFX/blob/e06a49663ec949c2f7eb56e6b5952c030ed42d33/preferencesfx/src/main/java/com/dlsc/preferencesfx/model/Setting.java#L174-L182 |
101,652 | dlemmermann/PreferencesFX | preferencesfx/src/main/java/com/dlsc/preferencesfx/model/Setting.java | Setting.of | public static <P> Setting of(
String description, ListProperty<P> items, ListProperty<P> selections) {
return new Setting<>(
description,
Field.ofMultiSelectionType(items, selections)
.label(description)
.render(new SimpleListViewControl<>()),
selections);
} | java | public static <P> Setting of(
String description, ListProperty<P> items, ListProperty<P> selections) {
return new Setting<>(
description,
Field.ofMultiSelectionType(items, selections)
.label(description)
.render(new SimpleListViewControl<>()),
selections);
} | [
"public",
"static",
"<",
"P",
">",
"Setting",
"of",
"(",
"String",
"description",
",",
"ListProperty",
"<",
"P",
">",
"items",
",",
"ListProperty",
"<",
"P",
">",
"selections",
")",
"{",
"return",
"new",
"Setting",
"<>",
"(",
"description",
",",
"Field",... | Creates a combobox with multiselection.
At least one element has to be selected at all times.
@param description the title of this setting
@param items the items which are possible to choose in the combobox, which are shown
in their {@link #toString()} representation
@param selections the currently selected ite... | [
"Creates",
"a",
"combobox",
"with",
"multiselection",
".",
"At",
"least",
"one",
"element",
"has",
"to",
"be",
"selected",
"at",
"all",
"times",
"."
] | e06a49663ec949c2f7eb56e6b5952c030ed42d33 | https://github.com/dlemmermann/PreferencesFX/blob/e06a49663ec949c2f7eb56e6b5952c030ed42d33/preferencesfx/src/main/java/com/dlsc/preferencesfx/model/Setting.java#L217-L225 |
101,653 | dlemmermann/PreferencesFX | preferencesfx/src/main/java/com/dlsc/preferencesfx/model/Setting.java | Setting.of | public static <F extends Field<F>, P extends Property> Setting of(
String description, F field, P property) {
return new Setting<>(
description,
field.label(description),
property);
} | java | public static <F extends Field<F>, P extends Property> Setting of(
String description, F field, P property) {
return new Setting<>(
description,
field.label(description),
property);
} | [
"public",
"static",
"<",
"F",
"extends",
"Field",
"<",
"F",
">",
",",
"P",
"extends",
"Property",
">",
"Setting",
"of",
"(",
"String",
"description",
",",
"F",
"field",
",",
"P",
"property",
")",
"{",
"return",
"new",
"Setting",
"<>",
"(",
"description... | Creates a setting of a custom defined field.
@param description the title of this setting
@param field custom Field object from FormsFX
@param property to be bound, saved / loaded and used for undo / redo
@return the constructed setting | [
"Creates",
"a",
"setting",
"of",
"a",
"custom",
"defined",
"field",
"."
] | e06a49663ec949c2f7eb56e6b5952c030ed42d33 | https://github.com/dlemmermann/PreferencesFX/blob/e06a49663ec949c2f7eb56e6b5952c030ed42d33/preferencesfx/src/main/java/com/dlsc/preferencesfx/model/Setting.java#L257-L263 |
101,654 | dlemmermann/PreferencesFX | preferencesfx/src/main/java/com/dlsc/preferencesfx/model/Setting.java | Setting.validate | @SafeVarargs
public final Setting validate(Validator... newValue) {
if (field instanceof DataField) {
((DataField) field).validate(newValue);
} else {
throw new UnsupportedOperationException("Field type must be instance of DataField");
}
return this;
} | java | @SafeVarargs
public final Setting validate(Validator... newValue) {
if (field instanceof DataField) {
((DataField) field).validate(newValue);
} else {
throw new UnsupportedOperationException("Field type must be instance of DataField");
}
return this;
} | [
"@",
"SafeVarargs",
"public",
"final",
"Setting",
"validate",
"(",
"Validator",
"...",
"newValue",
")",
"{",
"if",
"(",
"field",
"instanceof",
"DataField",
")",
"{",
"(",
"(",
"DataField",
")",
"field",
")",
".",
"validate",
"(",
"newValue",
")",
";",
"}... | Sets the list of validators for the current field. This overrides all
validators that have previously been added.
@param newValue The validators that are to be used for validating this
field. Limited to validators that are able to handle the
field's underlying type.
@return the current setting to allow for chaining
@t... | [
"Sets",
"the",
"list",
"of",
"validators",
"for",
"the",
"current",
"field",
".",
"This",
"overrides",
"all",
"validators",
"that",
"have",
"previously",
"been",
"added",
"."
] | e06a49663ec949c2f7eb56e6b5952c030ed42d33 | https://github.com/dlemmermann/PreferencesFX/blob/e06a49663ec949c2f7eb56e6b5952c030ed42d33/preferencesfx/src/main/java/com/dlsc/preferencesfx/model/Setting.java#L275-L283 |
101,655 | dlemmermann/PreferencesFX | preferencesfx/src/main/java/com/dlsc/preferencesfx/model/Setting.java | Setting.mark | public void mark() {
// ensure it's not marked yet - so a control doesn't contain the same styleClass multiple times
if (!marked) {
SimpleControl renderer = (SimpleControl) getField().getRenderer();
Node markNode = renderer.getFieldLabel();
markNode.getStyleClass().add(MARKED_STYLE_CLASS);
... | java | public void mark() {
// ensure it's not marked yet - so a control doesn't contain the same styleClass multiple times
if (!marked) {
SimpleControl renderer = (SimpleControl) getField().getRenderer();
Node markNode = renderer.getFieldLabel();
markNode.getStyleClass().add(MARKED_STYLE_CLASS);
... | [
"public",
"void",
"mark",
"(",
")",
"{",
"// ensure it's not marked yet - so a control doesn't contain the same styleClass multiple times",
"if",
"(",
"!",
"marked",
")",
"{",
"SimpleControl",
"renderer",
"=",
"(",
"SimpleControl",
")",
"getField",
"(",
")",
".",
"getRe... | Marks a setting.
Is used for the search, which marks and unmarks items depending on the match as a form of
visual feedback. | [
"Marks",
"a",
"setting",
".",
"Is",
"used",
"for",
"the",
"search",
"which",
"marks",
"and",
"unmarks",
"items",
"depending",
"on",
"the",
"match",
"as",
"a",
"form",
"of",
"visual",
"feedback",
"."
] | e06a49663ec949c2f7eb56e6b5952c030ed42d33 | https://github.com/dlemmermann/PreferencesFX/blob/e06a49663ec949c2f7eb56e6b5952c030ed42d33/preferencesfx/src/main/java/com/dlsc/preferencesfx/model/Setting.java#L290-L299 |
101,656 | dlemmermann/PreferencesFX | preferencesfx/src/main/java/com/dlsc/preferencesfx/model/Setting.java | Setting.unmark | public void unmark() {
// check if it's marked before removing the style class
if (marked) {
SimpleControl renderer = (SimpleControl) getField().getRenderer();
Node markNode = renderer.getFieldLabel();
markNode.getStyleClass().remove(MARKED_STYLE_CLASS);
markNode.removeEventHandler(Mouse... | java | public void unmark() {
// check if it's marked before removing the style class
if (marked) {
SimpleControl renderer = (SimpleControl) getField().getRenderer();
Node markNode = renderer.getFieldLabel();
markNode.getStyleClass().remove(MARKED_STYLE_CLASS);
markNode.removeEventHandler(Mouse... | [
"public",
"void",
"unmark",
"(",
")",
"{",
"// check if it's marked before removing the style class",
"if",
"(",
"marked",
")",
"{",
"SimpleControl",
"renderer",
"=",
"(",
"SimpleControl",
")",
"getField",
"(",
")",
".",
"getRenderer",
"(",
")",
";",
"Node",
"ma... | Unmarks a setting.
Is used for the search, which marks and unmarks items depending on the match as a form of
visual feedback. | [
"Unmarks",
"a",
"setting",
".",
"Is",
"used",
"for",
"the",
"search",
"which",
"marks",
"and",
"unmarks",
"items",
"depending",
"on",
"the",
"match",
"as",
"a",
"form",
"of",
"visual",
"feedback",
"."
] | e06a49663ec949c2f7eb56e6b5952c030ed42d33 | https://github.com/dlemmermann/PreferencesFX/blob/e06a49663ec949c2f7eb56e6b5952c030ed42d33/preferencesfx/src/main/java/com/dlsc/preferencesfx/model/Setting.java#L306-L315 |
101,657 | dlemmermann/PreferencesFX | preferencesfx/src/main/java/com/dlsc/preferencesfx/view/PreferencesFxDialog.java | PreferencesFxDialog.loadLastWindowState | private void loadLastWindowState() {
if (persistWindowState) {
setPrefSize(storageHandler.loadWindowWidth(), storageHandler.loadWindowHeight());
getScene().getWindow().setX(storageHandler.loadWindowPosX());
getScene().getWindow().setY(storageHandler.loadWindowPosY());
model.setDividerPositio... | java | private void loadLastWindowState() {
if (persistWindowState) {
setPrefSize(storageHandler.loadWindowWidth(), storageHandler.loadWindowHeight());
getScene().getWindow().setX(storageHandler.loadWindowPosX());
getScene().getWindow().setY(storageHandler.loadWindowPosY());
model.setDividerPositio... | [
"private",
"void",
"loadLastWindowState",
"(",
")",
"{",
"if",
"(",
"persistWindowState",
")",
"{",
"setPrefSize",
"(",
"storageHandler",
".",
"loadWindowWidth",
"(",
")",
",",
"storageHandler",
".",
"loadWindowHeight",
"(",
")",
")",
";",
"getScene",
"(",
")"... | Loads last saved size and position of the window. | [
"Loads",
"last",
"saved",
"size",
"and",
"position",
"of",
"the",
"window",
"."
] | e06a49663ec949c2f7eb56e6b5952c030ed42d33 | https://github.com/dlemmermann/PreferencesFX/blob/e06a49663ec949c2f7eb56e6b5952c030ed42d33/preferencesfx/src/main/java/com/dlsc/preferencesfx/view/PreferencesFxDialog.java#L117-L128 |
101,658 | dlemmermann/PreferencesFX | preferencesfx/src/main/java/com/dlsc/preferencesfx/view/CategoryPresenter.java | CategoryPresenter.addI18nListener | private void addI18nListener() {
model.translationServiceProperty().addListener((observable, oldValue, newValue) -> {
if (oldValue != newValue) {
form.i18n(newValue);
newValue.addListener(categoryModel::updateGroupDescriptions);
if (!Objects.equals(breadCrumbPresenter, null)) {
... | java | private void addI18nListener() {
model.translationServiceProperty().addListener((observable, oldValue, newValue) -> {
if (oldValue != newValue) {
form.i18n(newValue);
newValue.addListener(categoryModel::updateGroupDescriptions);
if (!Objects.equals(breadCrumbPresenter, null)) {
... | [
"private",
"void",
"addI18nListener",
"(",
")",
"{",
"model",
".",
"translationServiceProperty",
"(",
")",
".",
"addListener",
"(",
"(",
"observable",
",",
"oldValue",
",",
"newValue",
")",
"->",
"{",
"if",
"(",
"oldValue",
"!=",
"newValue",
")",
"{",
"for... | Updates the internal FormsFX form with the most current TranslationService.
Makes sure the group descriptions are updated with changing locale. | [
"Updates",
"the",
"internal",
"FormsFX",
"form",
"with",
"the",
"most",
"current",
"TranslationService",
".",
"Makes",
"sure",
"the",
"group",
"descriptions",
"are",
"updated",
"with",
"changing",
"locale",
"."
] | e06a49663ec949c2f7eb56e6b5952c030ed42d33 | https://github.com/dlemmermann/PreferencesFX/blob/e06a49663ec949c2f7eb56e6b5952c030ed42d33/preferencesfx/src/main/java/com/dlsc/preferencesfx/view/CategoryPresenter.java#L68-L79 |
101,659 | dlemmermann/PreferencesFX | preferencesfx-demo/src/main/java/com/dlsc/preferencesfx/i18n/DemoView.java | DemoView.translate | public void translate(String language) {
switch (language) {
case "EN":
rootPane.rbs.changeLocale(rootPane.rbEN);
break;
case "DE":
rootPane.rbs.changeLocale(rootPane.rbDE);
break;
default:
throw new IllegalArgumentException("Not a valid locale");
}
} | java | public void translate(String language) {
switch (language) {
case "EN":
rootPane.rbs.changeLocale(rootPane.rbEN);
break;
case "DE":
rootPane.rbs.changeLocale(rootPane.rbDE);
break;
default:
throw new IllegalArgumentException("Not a valid locale");
}
} | [
"public",
"void",
"translate",
"(",
"String",
"language",
")",
"{",
"switch",
"(",
"language",
")",
"{",
"case",
"\"EN\"",
":",
"rootPane",
".",
"rbs",
".",
"changeLocale",
"(",
"rootPane",
".",
"rbEN",
")",
";",
"break",
";",
"case",
"\"DE\"",
":",
"r... | Sets the locale of the form.
@param language The language identifier for the new locale. Either DE or EN. | [
"Sets",
"the",
"locale",
"of",
"the",
"form",
"."
] | e06a49663ec949c2f7eb56e6b5952c030ed42d33 | https://github.com/dlemmermann/PreferencesFX/blob/e06a49663ec949c2f7eb56e6b5952c030ed42d33/preferencesfx-demo/src/main/java/com/dlsc/preferencesfx/i18n/DemoView.java#L165-L176 |
101,660 | dlemmermann/PreferencesFX | preferencesfx/src/main/java/com/dlsc/preferencesfx/model/Group.java | Group.mark | public void mark() {
// ensure it's not marked yet - so a control doesn't contain the same styleClass multiple times
if (!marked) {
preferencesGroup.getRenderer().addStyleClass(MARKED_STYLE_CLASS);
preferencesGroup.getRenderer().getTitleLabel().setOnMouseExited(unmarker);
marked = !marked;
... | java | public void mark() {
// ensure it's not marked yet - so a control doesn't contain the same styleClass multiple times
if (!marked) {
preferencesGroup.getRenderer().addStyleClass(MARKED_STYLE_CLASS);
preferencesGroup.getRenderer().getTitleLabel().setOnMouseExited(unmarker);
marked = !marked;
... | [
"public",
"void",
"mark",
"(",
")",
"{",
"// ensure it's not marked yet - so a control doesn't contain the same styleClass multiple times",
"if",
"(",
"!",
"marked",
")",
"{",
"preferencesGroup",
".",
"getRenderer",
"(",
")",
".",
"addStyleClass",
"(",
"MARKED_STYLE_CLASS",... | Marks this group in the GUI.
Is used for the search, which marks and unmarks items depending on the match as a form of
visual feedback. | [
"Marks",
"this",
"group",
"in",
"the",
"GUI",
".",
"Is",
"used",
"for",
"the",
"search",
"which",
"marks",
"and",
"unmarks",
"items",
"depending",
"on",
"the",
"match",
"as",
"a",
"form",
"of",
"visual",
"feedback",
"."
] | e06a49663ec949c2f7eb56e6b5952c030ed42d33 | https://github.com/dlemmermann/PreferencesFX/blob/e06a49663ec949c2f7eb56e6b5952c030ed42d33/preferencesfx/src/main/java/com/dlsc/preferencesfx/model/Group.java#L98-L105 |
101,661 | dlemmermann/PreferencesFX | preferencesfx/src/main/java/com/dlsc/preferencesfx/model/Group.java | Group.unmark | public void unmark() {
// check if it's marked before removing the style class
if (marked) {
preferencesGroup.getRenderer().removeStyleClass(MARKED_STYLE_CLASS);
preferencesGroup.getRenderer().getTitleLabel().removeEventHandler(
MouseEvent.MOUSE_EXITED, unmarker
);
marked = !ma... | java | public void unmark() {
// check if it's marked before removing the style class
if (marked) {
preferencesGroup.getRenderer().removeStyleClass(MARKED_STYLE_CLASS);
preferencesGroup.getRenderer().getTitleLabel().removeEventHandler(
MouseEvent.MOUSE_EXITED, unmarker
);
marked = !ma... | [
"public",
"void",
"unmark",
"(",
")",
"{",
"// check if it's marked before removing the style class",
"if",
"(",
"marked",
")",
"{",
"preferencesGroup",
".",
"getRenderer",
"(",
")",
".",
"removeStyleClass",
"(",
"MARKED_STYLE_CLASS",
")",
";",
"preferencesGroup",
"."... | Unmarks this group in the GUI.
Is used for the search, which marks and unmarks items depending on the match as a form of
visual feedback. | [
"Unmarks",
"this",
"group",
"in",
"the",
"GUI",
".",
"Is",
"used",
"for",
"the",
"search",
"which",
"marks",
"and",
"unmarks",
"items",
"depending",
"on",
"the",
"match",
"as",
"a",
"form",
"of",
"visual",
"feedback",
"."
] | e06a49663ec949c2f7eb56e6b5952c030ed42d33 | https://github.com/dlemmermann/PreferencesFX/blob/e06a49663ec949c2f7eb56e6b5952c030ed42d33/preferencesfx/src/main/java/com/dlsc/preferencesfx/model/Group.java#L112-L121 |
101,662 | dlemmermann/PreferencesFX | preferencesfx/src/main/java/com/dlsc/preferencesfx/view/CategoryController.java | CategoryController.setView | public boolean setView(final Category category) {
LOGGER.trace("CategoryController, setView: " + category);
CategoryView categoryView = views.get(category);
if (categoryView != null) { // view is loaded
setContent(categoryView);
// Binding for ScrollPane
categoryView.minWidthProperty().bin... | java | public boolean setView(final Category category) {
LOGGER.trace("CategoryController, setView: " + category);
CategoryView categoryView = views.get(category);
if (categoryView != null) { // view is loaded
setContent(categoryView);
// Binding for ScrollPane
categoryView.minWidthProperty().bin... | [
"public",
"boolean",
"setView",
"(",
"final",
"Category",
"category",
")",
"{",
"LOGGER",
".",
"trace",
"(",
"\"CategoryController, setView: \"",
"+",
"category",
")",
";",
"CategoryView",
"categoryView",
"=",
"views",
".",
"get",
"(",
"category",
")",
";",
"i... | Sets the current view to the one of the respective category.
This method can be called in the presenter to switch to a different CategoryView.
Controls the way views are being transitioned from one to another.
@param category of the categoryView that will be set
@return true if successfully loaded, false if view is no... | [
"Sets",
"the",
"current",
"view",
"to",
"the",
"one",
"of",
"the",
"respective",
"category",
".",
"This",
"method",
"can",
"be",
"called",
"in",
"the",
"presenter",
"to",
"switch",
"to",
"a",
"different",
"CategoryView",
".",
"Controls",
"the",
"way",
"vie... | e06a49663ec949c2f7eb56e6b5952c030ed42d33 | https://github.com/dlemmermann/PreferencesFX/blob/e06a49663ec949c2f7eb56e6b5952c030ed42d33/preferencesfx/src/main/java/com/dlsc/preferencesfx/view/CategoryController.java#L66-L80 |
101,663 | dlemmermann/PreferencesFX | preferencesfx/src/main/java/com/dlsc/preferencesfx/view/CategoryController.java | CategoryController.addListener | public void addListener(ReadOnlyObjectProperty<Category> categoryProperty) {
categoryProperty.addListener((observable, oldCategory, newCategory) -> {
setView(newCategory);
});
} | java | public void addListener(ReadOnlyObjectProperty<Category> categoryProperty) {
categoryProperty.addListener((observable, oldCategory, newCategory) -> {
setView(newCategory);
});
} | [
"public",
"void",
"addListener",
"(",
"ReadOnlyObjectProperty",
"<",
"Category",
">",
"categoryProperty",
")",
"{",
"categoryProperty",
".",
"addListener",
"(",
"(",
"observable",
",",
"oldCategory",
",",
"newCategory",
")",
"->",
"{",
"setView",
"(",
"newCategory... | Sets the view according to the current category in categoryProperty.
Must ensure that the category is already loaded, else it will fail.
@param categoryProperty with category to be listened for | [
"Sets",
"the",
"view",
"according",
"to",
"the",
"current",
"category",
"in",
"categoryProperty",
".",
"Must",
"ensure",
"that",
"the",
"category",
"is",
"already",
"loaded",
"else",
"it",
"will",
"fail",
"."
] | e06a49663ec949c2f7eb56e6b5952c030ed42d33 | https://github.com/dlemmermann/PreferencesFX/blob/e06a49663ec949c2f7eb56e6b5952c030ed42d33/preferencesfx/src/main/java/com/dlsc/preferencesfx/view/CategoryController.java#L104-L108 |
101,664 | dlemmermann/PreferencesFX | preferencesfx/src/main/java/com/dlsc/preferencesfx/util/PreferencesFxUtils.java | PreferencesFxUtils.flattenCategories | public static List<Category> flattenCategories(List<Category> categoryLst) {
if (categoryLst == null) {
return null;
}
List<Category> flatCategoryLst = new ArrayList<>();
flattenCategories(flatCategoryLst, categoryLst);
return flatCategoryLst;
} | java | public static List<Category> flattenCategories(List<Category> categoryLst) {
if (categoryLst == null) {
return null;
}
List<Category> flatCategoryLst = new ArrayList<>();
flattenCategories(flatCategoryLst, categoryLst);
return flatCategoryLst;
} | [
"public",
"static",
"List",
"<",
"Category",
">",
"flattenCategories",
"(",
"List",
"<",
"Category",
">",
"categoryLst",
")",
"{",
"if",
"(",
"categoryLst",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"List",
"<",
"Category",
">",
"flatCategoryLst"... | Puts all categories and their respective children recursively flattened into a list.
@param categoryLst list of parent categories
@return list of all parent categories and respective recursive children categories | [
"Puts",
"all",
"categories",
"and",
"their",
"respective",
"children",
"recursively",
"flattened",
"into",
"a",
"list",
"."
] | e06a49663ec949c2f7eb56e6b5952c030ed42d33 | https://github.com/dlemmermann/PreferencesFX/blob/e06a49663ec949c2f7eb56e6b5952c030ed42d33/preferencesfx/src/main/java/com/dlsc/preferencesfx/util/PreferencesFxUtils.java#L167-L174 |
101,665 | dlemmermann/PreferencesFX | preferencesfx/src/main/java/com/dlsc/preferencesfx/util/PreferencesFxUtils.java | PreferencesFxUtils.flattenCategories | private static void flattenCategories(List<Category> flatList, List<Category> categories) {
categories.forEach(category -> {
flatList.add(category);
List<Category> children = category.getChildren();
if (children != null) {
flattenCategories(flatList, children);
}
});
} | java | private static void flattenCategories(List<Category> flatList, List<Category> categories) {
categories.forEach(category -> {
flatList.add(category);
List<Category> children = category.getChildren();
if (children != null) {
flattenCategories(flatList, children);
}
});
} | [
"private",
"static",
"void",
"flattenCategories",
"(",
"List",
"<",
"Category",
">",
"flatList",
",",
"List",
"<",
"Category",
">",
"categories",
")",
"{",
"categories",
".",
"forEach",
"(",
"category",
"->",
"{",
"flatList",
".",
"add",
"(",
"category",
"... | Goes through the list of parent categories and adds each category it visists to the flatList.
@param flatList list to which the categories for the flattened list should be added
@param categories list of parent categories to go through recursively
@implNote Internal helper method for {@link PreferencesFxUtils#flatte... | [
"Goes",
"through",
"the",
"list",
"of",
"parent",
"categories",
"and",
"adds",
"each",
"category",
"it",
"visists",
"to",
"the",
"flatList",
"."
] | e06a49663ec949c2f7eb56e6b5952c030ed42d33 | https://github.com/dlemmermann/PreferencesFX/blob/e06a49663ec949c2f7eb56e6b5952c030ed42d33/preferencesfx/src/main/java/com/dlsc/preferencesfx/util/PreferencesFxUtils.java#L183-L191 |
101,666 | dlemmermann/PreferencesFX | preferencesfx/src/main/java/com/dlsc/preferencesfx/formsfx/view/controls/SimpleControl.java | SimpleControl.toggleTooltip | @Override
protected void toggleTooltip(Node reference) {
if (reference instanceof Control) {
this.toggleTooltip(reference, (Control) reference);
}
} | java | @Override
protected void toggleTooltip(Node reference) {
if (reference instanceof Control) {
this.toggleTooltip(reference, (Control) reference);
}
} | [
"@",
"Override",
"protected",
"void",
"toggleTooltip",
"(",
"Node",
"reference",
")",
"{",
"if",
"(",
"reference",
"instanceof",
"Control",
")",
"{",
"this",
".",
"toggleTooltip",
"(",
"reference",
",",
"(",
"Control",
")",
"reference",
")",
";",
"}",
"}"
... | Sets the error message as tooltip for the matching control and shows
them below the same control.
@param reference The control which gets the tooltip. | [
"Sets",
"the",
"error",
"message",
"as",
"tooltip",
"for",
"the",
"matching",
"control",
"and",
"shows",
"them",
"below",
"the",
"same",
"control",
"."
] | e06a49663ec949c2f7eb56e6b5952c030ed42d33 | https://github.com/dlemmermann/PreferencesFX/blob/e06a49663ec949c2f7eb56e6b5952c030ed42d33/preferencesfx/src/main/java/com/dlsc/preferencesfx/formsfx/view/controls/SimpleControl.java#L148-L153 |
101,667 | dlemmermann/PreferencesFX | preferencesfx/src/main/java/com/dlsc/preferencesfx/formsfx/view/controls/SimpleControl.java | SimpleControl.toggleTooltip | @Override
protected void toggleTooltip(Node reference, Control below) {
String fieldTooltip = field.getTooltip();
if ((reference.isFocused() || reference.isHover())
&& (!fieldTooltip.equals("") || field.getErrorMessages().size() > 0)) {
tooltip.setText((!fieldTooltip.equals("") ? fieldTooltip +... | java | @Override
protected void toggleTooltip(Node reference, Control below) {
String fieldTooltip = field.getTooltip();
if ((reference.isFocused() || reference.isHover())
&& (!fieldTooltip.equals("") || field.getErrorMessages().size() > 0)) {
tooltip.setText((!fieldTooltip.equals("") ? fieldTooltip +... | [
"@",
"Override",
"protected",
"void",
"toggleTooltip",
"(",
"Node",
"reference",
",",
"Control",
"below",
")",
"{",
"String",
"fieldTooltip",
"=",
"field",
".",
"getTooltip",
"(",
")",
";",
"if",
"(",
"(",
"reference",
".",
"isFocused",
"(",
")",
"||",
"... | Sets the error message as tooltip for the matching control.
@param below The control needed for positioning the tooltip.
@param reference The control which gets the tooltip. | [
"Sets",
"the",
"error",
"message",
"as",
"tooltip",
"for",
"the",
"matching",
"control",
"."
] | e06a49663ec949c2f7eb56e6b5952c030ed42d33 | https://github.com/dlemmermann/PreferencesFX/blob/e06a49663ec949c2f7eb56e6b5952c030ed42d33/preferencesfx/src/main/java/com/dlsc/preferencesfx/formsfx/view/controls/SimpleControl.java#L161-L185 |
101,668 | dlemmermann/PreferencesFX | preferencesfx/src/main/java/com/dlsc/preferencesfx/formsfx/view/controls/SimpleControl.java | SimpleControl.updateStyle | @Override
protected void updateStyle(PseudoClass pseudo, boolean newValue) {
if (node != null) {
node.pseudoClassStateChanged(pseudo, newValue);
}
if (fieldLabel != null) {
fieldLabel.pseudoClassStateChanged(pseudo, newValue);
}
} | java | @Override
protected void updateStyle(PseudoClass pseudo, boolean newValue) {
if (node != null) {
node.pseudoClassStateChanged(pseudo, newValue);
}
if (fieldLabel != null) {
fieldLabel.pseudoClassStateChanged(pseudo, newValue);
}
} | [
"@",
"Override",
"protected",
"void",
"updateStyle",
"(",
"PseudoClass",
"pseudo",
",",
"boolean",
"newValue",
")",
"{",
"if",
"(",
"node",
"!=",
"null",
")",
"{",
"node",
".",
"pseudoClassStateChanged",
"(",
"pseudo",
",",
"newValue",
")",
";",
"}",
"if",... | Sets the css style for the defined properties.
@param pseudo The CSS pseudo class to toggle.
@param newValue Determines whether the CSS class should be applied. | [
"Sets",
"the",
"css",
"style",
"for",
"the",
"defined",
"properties",
"."
] | e06a49663ec949c2f7eb56e6b5952c030ed42d33 | https://github.com/dlemmermann/PreferencesFX/blob/e06a49663ec949c2f7eb56e6b5952c030ed42d33/preferencesfx/src/main/java/com/dlsc/preferencesfx/formsfx/view/controls/SimpleControl.java#L193-L201 |
101,669 | dlemmermann/PreferencesFX | preferencesfx/src/main/java/com/dlsc/preferencesfx/history/Change.java | Change.createListToObjectBinding | private Callable createListToObjectBinding(ListProperty<P> listProperty) {
return () -> {
if (!isListChange() && listProperty.get() != null && listProperty.get().size() != 0) {
return listProperty.get().get(0);
}
return null;
};
} | java | private Callable createListToObjectBinding(ListProperty<P> listProperty) {
return () -> {
if (!isListChange() && listProperty.get() != null && listProperty.get().size() != 0) {
return listProperty.get().get(0);
}
return null;
};
} | [
"private",
"Callable",
"createListToObjectBinding",
"(",
"ListProperty",
"<",
"P",
">",
"listProperty",
")",
"{",
"return",
"(",
")",
"->",
"{",
"if",
"(",
"!",
"isListChange",
"(",
")",
"&&",
"listProperty",
".",
"get",
"(",
")",
"!=",
"null",
"&&",
"li... | Creates a function, which handles binding between a ListProperty and an ObjectProperty.
<p>If this change isn't a list change, oldValue and newValue properties will have the single
element inside of the list, for easier usage.
@param listProperty to be bound to the object property
@return Callable function, which bin... | [
"Creates",
"a",
"function",
"which",
"handles",
"binding",
"between",
"a",
"ListProperty",
"and",
"an",
"ObjectProperty",
"."
] | e06a49663ec949c2f7eb56e6b5952c030ed42d33 | https://github.com/dlemmermann/PreferencesFX/blob/e06a49663ec949c2f7eb56e6b5952c030ed42d33/preferencesfx/src/main/java/com/dlsc/preferencesfx/history/Change.java#L114-L121 |
101,670 | dlemmermann/PreferencesFX | preferencesfx/src/main/java/com/dlsc/preferencesfx/history/Change.java | Change.isRedundant | public boolean isRedundant() {
if (isListChange()) {
return Objects.equals(oldList.get(),newList.get());
}
return oldValue.get().equals(newValue.get());
} | java | public boolean isRedundant() {
if (isListChange()) {
return Objects.equals(oldList.get(),newList.get());
}
return oldValue.get().equals(newValue.get());
} | [
"public",
"boolean",
"isRedundant",
"(",
")",
"{",
"if",
"(",
"isListChange",
"(",
")",
")",
"{",
"return",
"Objects",
".",
"equals",
"(",
"oldList",
".",
"get",
"(",
")",
",",
"newList",
".",
"get",
"(",
")",
")",
";",
"}",
"return",
"oldValue",
"... | Compares newValue and oldValue to see if they are the same.
If this is the case, this change is redundant, since it doesn't represent a true change.
This can happen on compounded changes.
@return true if redundant, else if otherwise. | [
"Compares",
"newValue",
"and",
"oldValue",
"to",
"see",
"if",
"they",
"are",
"the",
"same",
".",
"If",
"this",
"is",
"the",
"case",
"this",
"change",
"is",
"redundant",
"since",
"it",
"doesn",
"t",
"represent",
"a",
"true",
"change",
".",
"This",
"can",
... | e06a49663ec949c2f7eb56e6b5952c030ed42d33 | https://github.com/dlemmermann/PreferencesFX/blob/e06a49663ec949c2f7eb56e6b5952c030ed42d33/preferencesfx/src/main/java/com/dlsc/preferencesfx/history/Change.java#L130-L135 |
101,671 | dlemmermann/PreferencesFX | preferencesfx/src/main/java/com/dlsc/preferencesfx/view/BreadCrumbPresenter.java | BreadCrumbPresenter.setupBreadCrumbBar | public void setupBreadCrumbBar() {
String[] stringArr = model.getDisplayedCategory().getBreadcrumb().split(BREADCRUMB_DELIMITER);
Category[] categories = new Category[stringArr.length];
// Collecting all parent categories from the displayed category using the breadcrumb.
// There will always be at leas... | java | public void setupBreadCrumbBar() {
String[] stringArr = model.getDisplayedCategory().getBreadcrumb().split(BREADCRUMB_DELIMITER);
Category[] categories = new Category[stringArr.length];
// Collecting all parent categories from the displayed category using the breadcrumb.
// There will always be at leas... | [
"public",
"void",
"setupBreadCrumbBar",
"(",
")",
"{",
"String",
"[",
"]",
"stringArr",
"=",
"model",
".",
"getDisplayedCategory",
"(",
")",
".",
"getBreadcrumb",
"(",
")",
".",
"split",
"(",
"BREADCRUMB_DELIMITER",
")",
";",
"Category",
"[",
"]",
"categorie... | Sets up the BreadcrumbBar depending on the displayed category. | [
"Sets",
"up",
"the",
"BreadcrumbBar",
"depending",
"on",
"the",
"displayed",
"category",
"."
] | e06a49663ec949c2f7eb56e6b5952c030ed42d33 | https://github.com/dlemmermann/PreferencesFX/blob/e06a49663ec949c2f7eb56e6b5952c030ed42d33/preferencesfx/src/main/java/com/dlsc/preferencesfx/view/BreadCrumbPresenter.java#L52-L69 |
101,672 | dlemmermann/PreferencesFX | preferencesfx/src/main/java/com/dlsc/preferencesfx/view/BreadCrumbPresenter.java | BreadCrumbPresenter.searchCategory | private Category searchCategory(String breadcrumb) {
return model.getFlatCategoriesLst().stream().filter(
cat -> cat.getBreadcrumb().equals(breadcrumb)
).findAny().orElse(null);
} | java | private Category searchCategory(String breadcrumb) {
return model.getFlatCategoriesLst().stream().filter(
cat -> cat.getBreadcrumb().equals(breadcrumb)
).findAny().orElse(null);
} | [
"private",
"Category",
"searchCategory",
"(",
"String",
"breadcrumb",
")",
"{",
"return",
"model",
".",
"getFlatCategoriesLst",
"(",
")",
".",
"stream",
"(",
")",
".",
"filter",
"(",
"cat",
"->",
"cat",
".",
"getBreadcrumb",
"(",
")",
".",
"equals",
"(",
... | Searches in all categories for the category that matches a breadcrumb.
@param breadcrumb the breadcrumb, which the matching category should have
@return a matching category or null if nothing is found | [
"Searches",
"in",
"all",
"categories",
"for",
"the",
"category",
"that",
"matches",
"a",
"breadcrumb",
"."
] | e06a49663ec949c2f7eb56e6b5952c030ed42d33 | https://github.com/dlemmermann/PreferencesFX/blob/e06a49663ec949c2f7eb56e6b5952c030ed42d33/preferencesfx/src/main/java/com/dlsc/preferencesfx/view/BreadCrumbPresenter.java#L77-L81 |
101,673 | dlemmermann/PreferencesFX | preferencesfx/src/main/java/com/dlsc/preferencesfx/model/Category.java | Category.of | public static Category of(String description, Node itemIcon, Group... groups) {
return new Category(description, itemIcon, groups);
} | java | public static Category of(String description, Node itemIcon, Group... groups) {
return new Category(description, itemIcon, groups);
} | [
"public",
"static",
"Category",
"of",
"(",
"String",
"description",
",",
"Node",
"itemIcon",
",",
"Group",
"...",
"groups",
")",
"{",
"return",
"new",
"Category",
"(",
"description",
",",
"itemIcon",
",",
"groups",
")",
";",
"}"
] | Creates a new category from groups.
@param description Category name, for display in {@link CategoryView}
@param itemIcon Icon to be shown next to the category name
@param groups {@link Group} with {@link Setting} to be shown in the {@link CategoryView}
@return initialized Category object | [
"Creates",
"a",
"new",
"category",
"from",
"groups",
"."
] | e06a49663ec949c2f7eb56e6b5952c030ed42d33 | https://github.com/dlemmermann/PreferencesFX/blob/e06a49663ec949c2f7eb56e6b5952c030ed42d33/preferencesfx/src/main/java/com/dlsc/preferencesfx/model/Category.java#L116-L118 |
101,674 | dlemmermann/PreferencesFX | preferencesfx/src/main/java/com/dlsc/preferencesfx/model/Category.java | Category.createBreadcrumbs | public void createBreadcrumbs(List<Category> categories) {
categories.forEach(category -> {
category.setBreadcrumb(getBreadcrumb() + BREADCRUMB_DELIMITER + category.getDescription());
if (!Objects.equals(category.getGroups(), null)) {
category.getGroups().forEach(group -> group.addToBreadcrumb(g... | java | public void createBreadcrumbs(List<Category> categories) {
categories.forEach(category -> {
category.setBreadcrumb(getBreadcrumb() + BREADCRUMB_DELIMITER + category.getDescription());
if (!Objects.equals(category.getGroups(), null)) {
category.getGroups().forEach(group -> group.addToBreadcrumb(g... | [
"public",
"void",
"createBreadcrumbs",
"(",
"List",
"<",
"Category",
">",
"categories",
")",
"{",
"categories",
".",
"forEach",
"(",
"category",
"->",
"{",
"category",
".",
"setBreadcrumb",
"(",
"getBreadcrumb",
"(",
")",
"+",
"BREADCRUMB_DELIMITER",
"+",
"cat... | Creates and defines all of the breadcrumbs for all of the categories.
@param categories the categories to create breadcrumbs for | [
"Creates",
"and",
"defines",
"all",
"of",
"the",
"breadcrumbs",
"for",
"all",
"of",
"the",
"categories",
"."
] | e06a49663ec949c2f7eb56e6b5952c030ed42d33 | https://github.com/dlemmermann/PreferencesFX/blob/e06a49663ec949c2f7eb56e6b5952c030ed42d33/preferencesfx/src/main/java/com/dlsc/preferencesfx/model/Category.java#L148-L158 |
101,675 | dlemmermann/PreferencesFX | preferencesfx/src/main/java/com/dlsc/preferencesfx/model/Category.java | Category.translate | public void translate(TranslationService translationService) {
if (translationService == null) {
description.setValue(descriptionKey.getValue());
return;
}
if (!Strings.isNullOrEmpty(descriptionKey.get())) {
description.setValue(translationService.translate(descriptionKey.get()));
}
... | java | public void translate(TranslationService translationService) {
if (translationService == null) {
description.setValue(descriptionKey.getValue());
return;
}
if (!Strings.isNullOrEmpty(descriptionKey.get())) {
description.setValue(translationService.translate(descriptionKey.get()));
}
... | [
"public",
"void",
"translate",
"(",
"TranslationService",
"translationService",
")",
"{",
"if",
"(",
"translationService",
"==",
"null",
")",
"{",
"description",
".",
"setValue",
"(",
"descriptionKey",
".",
"getValue",
"(",
")",
")",
";",
"return",
";",
"}",
... | This internal method is used as a callback for when the translation
service or its locale changes. Also applies the translation to all
contained sections.
@see com.dlsc.formsfx.model.structure.Group ::translate | [
"This",
"internal",
"method",
"is",
"used",
"as",
"a",
"callback",
"for",
"when",
"the",
"translation",
"service",
"or",
"its",
"locale",
"changes",
".",
"Also",
"applies",
"the",
"translation",
"to",
"all",
"contained",
"sections",
"."
] | e06a49663ec949c2f7eb56e6b5952c030ed42d33 | https://github.com/dlemmermann/PreferencesFX/blob/e06a49663ec949c2f7eb56e6b5952c030ed42d33/preferencesfx/src/main/java/com/dlsc/preferencesfx/model/Category.java#L200-L209 |
101,676 | mkolisnyk/cucumber-reports | cucumber-report-generator/src/main/java/com/github/mkolisnyk/cucumber/reporting/types/OverviewStats.java | OverviewStats.add | public OverviewStats add(OverviewStats other) {
this.addFeaturesFailed(other.getFeaturesFailed());
this.addFeaturesKnown(other.getFeaturesKnown());
this.addFeaturesPassed(other.getFeaturesPassed());
this.addFeaturesUndefined(other.getFeaturesUndefined());
this.addScenariosFailed(... | java | public OverviewStats add(OverviewStats other) {
this.addFeaturesFailed(other.getFeaturesFailed());
this.addFeaturesKnown(other.getFeaturesKnown());
this.addFeaturesPassed(other.getFeaturesPassed());
this.addFeaturesUndefined(other.getFeaturesUndefined());
this.addScenariosFailed(... | [
"public",
"OverviewStats",
"add",
"(",
"OverviewStats",
"other",
")",
"{",
"this",
".",
"addFeaturesFailed",
"(",
"other",
".",
"getFeaturesFailed",
"(",
")",
")",
";",
"this",
".",
"addFeaturesKnown",
"(",
"other",
".",
"getFeaturesKnown",
"(",
")",
")",
";... | Merges 2 overview statistic structures where all corresponding values are
simply added to current object.
@param other the other structure of the {@link OverviewStats} type to add values from.
@return the structure containing the sum of current statistics and the statistics from the parameter. | [
"Merges",
"2",
"overview",
"statistic",
"structures",
"where",
"all",
"corresponding",
"values",
"are",
"simply",
"added",
"to",
"current",
"object",
"."
] | 9c9a32f15f0bf1eb1d3d181a11bae9c5eec84a8e | https://github.com/mkolisnyk/cucumber-reports/blob/9c9a32f15f0bf1eb1d3d181a11bae9c5eec84a8e/cucumber-report-generator/src/main/java/com/github/mkolisnyk/cucumber/reporting/types/OverviewStats.java#L212-L226 |
101,677 | mkolisnyk/cucumber-reports | cucumber-report-generator/src/main/java/com/github/mkolisnyk/cucumber/reporting/types/OverviewStats.java | OverviewStats.valuate | public OverviewStats valuate(CucumberScenarioResult scenario) {
this.reset();
scenario.valuate();
this.addOverallDuration((float) scenario.getDuration());
this.addStepsPassed(scenario.getPassed());
this.addStepsFailed(scenario.getFailed());
this.addStepsKnown(scenario.get... | java | public OverviewStats valuate(CucumberScenarioResult scenario) {
this.reset();
scenario.valuate();
this.addOverallDuration((float) scenario.getDuration());
this.addStepsPassed(scenario.getPassed());
this.addStepsFailed(scenario.getFailed());
this.addStepsKnown(scenario.get... | [
"public",
"OverviewStats",
"valuate",
"(",
"CucumberScenarioResult",
"scenario",
")",
"{",
"this",
".",
"reset",
"(",
")",
";",
"scenario",
".",
"valuate",
"(",
")",
";",
"this",
".",
"addOverallDuration",
"(",
"(",
"float",
")",
"scenario",
".",
"getDuratio... | Calculates overall statistics for specific scenario.
@param scenario the scenario result to calculate statistics for.
@return calculated statistics for specific scenario. | [
"Calculates",
"overall",
"statistics",
"for",
"specific",
"scenario",
"."
] | 9c9a32f15f0bf1eb1d3d181a11bae9c5eec84a8e | https://github.com/mkolisnyk/cucumber-reports/blob/9c9a32f15f0bf1eb1d3d181a11bae9c5eec84a8e/cucumber-report-generator/src/main/java/com/github/mkolisnyk/cucumber/reporting/types/OverviewStats.java#L232-L241 |
101,678 | mkolisnyk/cucumber-reports | cucumber-report-generator/src/main/java/com/github/mkolisnyk/cucumber/reporting/types/OverviewStats.java | OverviewStats.valuate | public OverviewStats valuate(CucumberFeatureResult result) {
this.reset();
result.valuate();
this.addOverallDuration(result.getDuration());
if (result.getStatus().equals("passed")) {
this.addFeaturesPassed(1);
} else if (result.getStatus().equals("failed")) {
... | java | public OverviewStats valuate(CucumberFeatureResult result) {
this.reset();
result.valuate();
this.addOverallDuration(result.getDuration());
if (result.getStatus().equals("passed")) {
this.addFeaturesPassed(1);
} else if (result.getStatus().equals("failed")) {
... | [
"public",
"OverviewStats",
"valuate",
"(",
"CucumberFeatureResult",
"result",
")",
"{",
"this",
".",
"reset",
"(",
")",
";",
"result",
".",
"valuate",
"(",
")",
";",
"this",
".",
"addOverallDuration",
"(",
"result",
".",
"getDuration",
"(",
")",
")",
";",
... | Calculates run statistics for the single feature result.
@param result the feature result data to calculate statistics for.
@return the calculated statistics for the specific feature. | [
"Calculates",
"run",
"statistics",
"for",
"the",
"single",
"feature",
"result",
"."
] | 9c9a32f15f0bf1eb1d3d181a11bae9c5eec84a8e | https://github.com/mkolisnyk/cucumber-reports/blob/9c9a32f15f0bf1eb1d3d181a11bae9c5eec84a8e/cucumber-report-generator/src/main/java/com/github/mkolisnyk/cucumber/reporting/types/OverviewStats.java#L247-L272 |
101,679 | mkolisnyk/cucumber-reports | cucumber-report-generator/src/main/java/com/github/mkolisnyk/cucumber/reporting/types/OverviewStats.java | OverviewStats.valuate | public OverviewStats valuate(CucumberFeatureResult[] results) {
this.reset();
for (CucumberFeatureResult result : results) {
result.valuate();
this.addOverallDuration(result.getDuration());
OverviewStats stats = new OverviewStats();
stats.valuate(result);
... | java | public OverviewStats valuate(CucumberFeatureResult[] results) {
this.reset();
for (CucumberFeatureResult result : results) {
result.valuate();
this.addOverallDuration(result.getDuration());
OverviewStats stats = new OverviewStats();
stats.valuate(result);
... | [
"public",
"OverviewStats",
"valuate",
"(",
"CucumberFeatureResult",
"[",
"]",
"results",
")",
"{",
"this",
".",
"reset",
"(",
")",
";",
"for",
"(",
"CucumberFeatureResult",
"result",
":",
"results",
")",
"{",
"result",
".",
"valuate",
"(",
")",
";",
"this"... | Calculates overall statistics for the group of features.
@param results the list of features to calculate run statistics for.
@return calculated statistics for the specified set of features. | [
"Calculates",
"overall",
"statistics",
"for",
"the",
"group",
"of",
"features",
"."
] | 9c9a32f15f0bf1eb1d3d181a11bae9c5eec84a8e | https://github.com/mkolisnyk/cucumber-reports/blob/9c9a32f15f0bf1eb1d3d181a11bae9c5eec84a8e/cucumber-report-generator/src/main/java/com/github/mkolisnyk/cucumber/reporting/types/OverviewStats.java#L278-L288 |
101,680 | LAW-Unimi/BUbiNG | src/it/unimi/di/law/warc/util/ReorderingBlockingQueue.java | ReorderingBlockingQueue.put | public void put(final E e, final long timeStamp) throws InterruptedException {
final ReentrantLock lock = this.lock;
lock.lockInterruptibly();
try {
// mask is a.length - 1
while(timeStamp - this.timeStamp > mask) newSpaceAvailable.await();
final int timeOffset = (int)(timeStamp - this.timeStamp);
ass... | java | public void put(final E e, final long timeStamp) throws InterruptedException {
final ReentrantLock lock = this.lock;
lock.lockInterruptibly();
try {
// mask is a.length - 1
while(timeStamp - this.timeStamp > mask) newSpaceAvailable.await();
final int timeOffset = (int)(timeStamp - this.timeStamp);
ass... | [
"public",
"void",
"put",
"(",
"final",
"E",
"e",
",",
"final",
"long",
"timeStamp",
")",
"throws",
"InterruptedException",
"{",
"final",
"ReentrantLock",
"lock",
"=",
"this",
".",
"lock",
";",
"lock",
".",
"lockInterruptibly",
"(",
")",
";",
"try",
"{",
... | Inserts an element with given timestamp, waiting for space to become available
if the timestamp of the element minus the current timestamp of the queue exceeds
the queue capacity.
@param e an element.
@param timeStamp the timestamp of {@code e}. | [
"Inserts",
"an",
"element",
"with",
"given",
"timestamp",
"waiting",
"for",
"space",
"to",
"become",
"available",
"if",
"the",
"timestamp",
"of",
"the",
"element",
"minus",
"the",
"current",
"timestamp",
"of",
"the",
"queue",
"exceeds",
"the",
"queue",
"capaci... | e148acc90031a4f3967422705a9fb07ddaf155e4 | https://github.com/LAW-Unimi/BUbiNG/blob/e148acc90031a4f3967422705a9fb07ddaf155e4/src/it/unimi/di/law/warc/util/ReorderingBlockingQueue.java#L77-L92 |
101,681 | LAW-Unimi/BUbiNG | src/it/unimi/di/law/warc/util/ReorderingBlockingQueue.java | ReorderingBlockingQueue.take | public E take() throws InterruptedException {
final ReentrantLock lock = this.lock;
lock.lockInterruptibly();
try {
while (a[start] == null) nextObjectReady.await();
@SuppressWarnings("unchecked")
final E x = (E)a[start];
a[start] = null;
start = start + 1 & mask;
--count;
timeStamp++;
new... | java | public E take() throws InterruptedException {
final ReentrantLock lock = this.lock;
lock.lockInterruptibly();
try {
while (a[start] == null) nextObjectReady.await();
@SuppressWarnings("unchecked")
final E x = (E)a[start];
a[start] = null;
start = start + 1 & mask;
--count;
timeStamp++;
new... | [
"public",
"E",
"take",
"(",
")",
"throws",
"InterruptedException",
"{",
"final",
"ReentrantLock",
"lock",
"=",
"this",
".",
"lock",
";",
"lock",
".",
"lockInterruptibly",
"(",
")",
";",
"try",
"{",
"while",
"(",
"a",
"[",
"start",
"]",
"==",
"null",
")... | Returns the element with the next timestamp, waiting until it is available.
<p>Note that because of the reordering semantics, an invocation of this method
on a {@linkplain #isEmpty() nonempty} queue might block nonetheless.
@return the element with the next timestamp. | [
"Returns",
"the",
"element",
"with",
"the",
"next",
"timestamp",
"waiting",
"until",
"it",
"is",
"available",
"."
] | e148acc90031a4f3967422705a9fb07ddaf155e4 | https://github.com/LAW-Unimi/BUbiNG/blob/e148acc90031a4f3967422705a9fb07ddaf155e4/src/it/unimi/di/law/warc/util/ReorderingBlockingQueue.java#L101-L118 |
101,682 | LAW-Unimi/BUbiNG | src/it/unimi/di/law/bubing/RuntimeConfiguration.java | RuntimeConfiguration.parsersFromSpecs | public static ArrayList<Parser<?>> parsersFromSpecs(String[] specs) throws IllegalArgumentException, ClassNotFoundException, IllegalAccessException, InvocationTargetException, InstantiationException, NoSuchMethodException, IOException {
final ArrayList<Parser<?>> parsers = new ArrayList<>();
for(final String spec :... | java | public static ArrayList<Parser<?>> parsersFromSpecs(String[] specs) throws IllegalArgumentException, ClassNotFoundException, IllegalAccessException, InvocationTargetException, InstantiationException, NoSuchMethodException, IOException {
final ArrayList<Parser<?>> parsers = new ArrayList<>();
for(final String spec :... | [
"public",
"static",
"ArrayList",
"<",
"Parser",
"<",
"?",
">",
">",
"parsersFromSpecs",
"(",
"String",
"[",
"]",
"specs",
")",
"throws",
"IllegalArgumentException",
",",
"ClassNotFoundException",
",",
"IllegalAccessException",
",",
"InvocationTargetException",
",",
... | Given an array of parser specifications, it returns the corresponding list of parsers (only
the correct specifications are put in the list.
@param specs the parser specifications (they will be parsed using {@link ObjectParser}.
@return a list of parsers built according to the specifications (only the parseable items a... | [
"Given",
"an",
"array",
"of",
"parser",
"specifications",
"it",
"returns",
"the",
"corresponding",
"list",
"of",
"parsers",
"(",
"only",
"the",
"correct",
"specifications",
"are",
"put",
"in",
"the",
"list",
"."
] | e148acc90031a4f3967422705a9fb07ddaf155e4 | https://github.com/LAW-Unimi/BUbiNG/blob/e148acc90031a4f3967422705a9fb07ddaf155e4/src/it/unimi/di/law/bubing/RuntimeConfiguration.java#L497-L501 |
101,683 | LAW-Unimi/BUbiNG | src/it/unimi/di/law/bubing/StartupConfiguration.java | StartupConfiguration.append | private static Configuration append(Configuration base, Configuration additional) {
final CompositeConfiguration result = new CompositeConfiguration();
result.addConfiguration(additional);
result.addConfiguration(base);
return result;
} | java | private static Configuration append(Configuration base, Configuration additional) {
final CompositeConfiguration result = new CompositeConfiguration();
result.addConfiguration(additional);
result.addConfiguration(base);
return result;
} | [
"private",
"static",
"Configuration",
"append",
"(",
"Configuration",
"base",
",",
"Configuration",
"additional",
")",
"{",
"final",
"CompositeConfiguration",
"result",
"=",
"new",
"CompositeConfiguration",
"(",
")",
";",
"result",
".",
"addConfiguration",
"(",
"add... | Takes two configuration and returns their union, with the second overriding the first.
@param base the base configuration.
@param additional the additional set of properties, some of which may override those specified in <code>base</code>.
@return the union of the two configurations, as specified above. | [
"Takes",
"two",
"configuration",
"and",
"returns",
"their",
"union",
"with",
"the",
"second",
"overriding",
"the",
"first",
"."
] | e148acc90031a4f3967422705a9fb07ddaf155e4 | https://github.com/LAW-Unimi/BUbiNG/blob/e148acc90031a4f3967422705a9fb07ddaf155e4/src/it/unimi/di/law/bubing/StartupConfiguration.java#L634-L639 |
101,684 | LAW-Unimi/BUbiNG | src/it/unimi/di/law/bubing/util/ConcurrentCountingMap.java | ConcurrentCountingMap.get | public int get(final byte[] array, final int offset, final int length) {
final long hash = MurmurHash3.hash(array, offset, length);
final ReadLock readLock = lock[(int)(hash >>> shift)].readLock();
try {
readLock.lock();
return stripe[(int)(hash >>> shift)].get(array, offset, length, hash);
}
finally {
... | java | public int get(final byte[] array, final int offset, final int length) {
final long hash = MurmurHash3.hash(array, offset, length);
final ReadLock readLock = lock[(int)(hash >>> shift)].readLock();
try {
readLock.lock();
return stripe[(int)(hash >>> shift)].get(array, offset, length, hash);
}
finally {
... | [
"public",
"int",
"get",
"(",
"final",
"byte",
"[",
"]",
"array",
",",
"final",
"int",
"offset",
",",
"final",
"int",
"length",
")",
"{",
"final",
"long",
"hash",
"=",
"MurmurHash3",
".",
"hash",
"(",
"array",
",",
"offset",
",",
"length",
")",
";",
... | Gets the value of the counter associated with a given key.
@param array a byte array.
@param offset the first valid byte in {@code array}.
@param length the number of valid elements in {@code array}.
@return the current value of the counter associated with the specified key. | [
"Gets",
"the",
"value",
"of",
"the",
"counter",
"associated",
"with",
"a",
"given",
"key",
"."
] | e148acc90031a4f3967422705a9fb07ddaf155e4 | https://github.com/LAW-Unimi/BUbiNG/blob/e148acc90031a4f3967422705a9fb07ddaf155e4/src/it/unimi/di/law/bubing/util/ConcurrentCountingMap.java#L85-L95 |
101,685 | LAW-Unimi/BUbiNG | src/it/unimi/di/law/bubing/util/ConcurrentCountingMap.java | ConcurrentCountingMap.addTo | public int addTo(final byte[] array, final int offset, final int length, final int delta) {
final long hash = MurmurHash3.hash(array, offset, length);
final WriteLock writeLock = lock[(int)(hash >>> shift)].writeLock();
try {
writeLock.lock();
return stripe[(int)(hash >>> shift)].addTo(array, offset, length... | java | public int addTo(final byte[] array, final int offset, final int length, final int delta) {
final long hash = MurmurHash3.hash(array, offset, length);
final WriteLock writeLock = lock[(int)(hash >>> shift)].writeLock();
try {
writeLock.lock();
return stripe[(int)(hash >>> shift)].addTo(array, offset, length... | [
"public",
"int",
"addTo",
"(",
"final",
"byte",
"[",
"]",
"array",
",",
"final",
"int",
"offset",
",",
"final",
"int",
"length",
",",
"final",
"int",
"delta",
")",
"{",
"final",
"long",
"hash",
"=",
"MurmurHash3",
".",
"hash",
"(",
"array",
",",
"off... | Adds a value to the counter associated with a given key.
@param array a byte array.
@param offset the first valid byte in {@code array}.
@param length the number of valid elements in {@code array}.
@param delta a value to be added to the counter associated with the specified key.
@return the previous value of the coun... | [
"Adds",
"a",
"value",
"to",
"the",
"counter",
"associated",
"with",
"a",
"given",
"key",
"."
] | e148acc90031a4f3967422705a9fb07ddaf155e4 | https://github.com/LAW-Unimi/BUbiNG/blob/e148acc90031a4f3967422705a9fb07ddaf155e4/src/it/unimi/di/law/bubing/util/ConcurrentCountingMap.java#L115-L125 |
101,686 | LAW-Unimi/BUbiNG | src/it/unimi/di/law/bubing/util/ConcurrentCountingMap.java | ConcurrentCountingMap.put | public int put(final byte[] array, final int offset, final int length, final int value) {
final long hash = MurmurHash3.hash(array, offset, length);
final WriteLock writeLock = lock[(int)(hash >>> shift)].writeLock();
try {
writeLock.lock();
return stripe[(int)(hash >>> shift)].put(array, offset, length, ha... | java | public int put(final byte[] array, final int offset, final int length, final int value) {
final long hash = MurmurHash3.hash(array, offset, length);
final WriteLock writeLock = lock[(int)(hash >>> shift)].writeLock();
try {
writeLock.lock();
return stripe[(int)(hash >>> shift)].put(array, offset, length, ha... | [
"public",
"int",
"put",
"(",
"final",
"byte",
"[",
"]",
"array",
",",
"final",
"int",
"offset",
",",
"final",
"int",
"length",
",",
"final",
"int",
"value",
")",
"{",
"final",
"long",
"hash",
"=",
"MurmurHash3",
".",
"hash",
"(",
"array",
",",
"offse... | Sets the value associated with a given key.
@param array a byte array.
@param offset the first valid byte in {@code array}.
@param length the number of valid elements in {@code array}.
@param value a value to be associated with the specified key.
@return the previous value of the counter associated with the specified ... | [
"Sets",
"the",
"value",
"associated",
"with",
"a",
"given",
"key",
"."
] | e148acc90031a4f3967422705a9fb07ddaf155e4 | https://github.com/LAW-Unimi/BUbiNG/blob/e148acc90031a4f3967422705a9fb07ddaf155e4/src/it/unimi/di/law/bubing/util/ConcurrentCountingMap.java#L145-L155 |
101,687 | LAW-Unimi/BUbiNG | src/it/unimi/di/law/bubing/frontier/WorkbenchEntry.java | WorkbenchEntry.add | public synchronized void add(VisitState visitState) {
final boolean wasEntirelyBroken = isEntirelyBroken();
if (visitState.lastExceptionClass != null) brokenVisitStates++;
visitStates.add(visitState);
assert brokenVisitStates <= visitStates.size();
if (wasEntirelyBroken && ! isEntirelyBroken()) workbenchBroke... | java | public synchronized void add(VisitState visitState) {
final boolean wasEntirelyBroken = isEntirelyBroken();
if (visitState.lastExceptionClass != null) brokenVisitStates++;
visitStates.add(visitState);
assert brokenVisitStates <= visitStates.size();
if (wasEntirelyBroken && ! isEntirelyBroken()) workbenchBroke... | [
"public",
"synchronized",
"void",
"add",
"(",
"VisitState",
"visitState",
")",
"{",
"final",
"boolean",
"wasEntirelyBroken",
"=",
"isEntirelyBroken",
"(",
")",
";",
"if",
"(",
"visitState",
".",
"lastExceptionClass",
"!=",
"null",
")",
"brokenVisitStates",
"++",
... | Adds the given visit state to the visit-state queue.
<p>This method is used for deserialization only.
@param visitState the visit state that must be added to the visit-state queue.
@see PriorityQueue#add(Object) | [
"Adds",
"the",
"given",
"visit",
"state",
"to",
"the",
"visit",
"-",
"state",
"queue",
"."
] | e148acc90031a4f3967422705a9fb07ddaf155e4 | https://github.com/LAW-Unimi/BUbiNG/blob/e148acc90031a4f3967422705a9fb07ddaf155e4/src/it/unimi/di/law/bubing/frontier/WorkbenchEntry.java#L97-L104 |
101,688 | LAW-Unimi/BUbiNG | src/it/unimi/di/law/bubing/frontier/VisitState.java | VisitState.setWorkbenchEntry | public synchronized void setWorkbenchEntry(final WorkbenchEntry workbenchEntry) {
assert ! acquired : this;
this.workbenchEntry = workbenchEntry;
if (! isEmpty()) workbenchEntry.add(this, frontier.workbench);
} | java | public synchronized void setWorkbenchEntry(final WorkbenchEntry workbenchEntry) {
assert ! acquired : this;
this.workbenchEntry = workbenchEntry;
if (! isEmpty()) workbenchEntry.add(this, frontier.workbench);
} | [
"public",
"synchronized",
"void",
"setWorkbenchEntry",
"(",
"final",
"WorkbenchEntry",
"workbenchEntry",
")",
"{",
"assert",
"!",
"acquired",
":",
"this",
";",
"this",
".",
"workbenchEntry",
"=",
"workbenchEntry",
";",
"if",
"(",
"!",
"isEmpty",
"(",
")",
")",... | Sets the workbench entry and put this visit state in its entry if it is nonempty.
<ul>
<li>Preconditions: not {{@link #acquired}}.
</ul> | [
"Sets",
"the",
"workbench",
"entry",
"and",
"put",
"this",
"visit",
"state",
"in",
"its",
"entry",
"if",
"it",
"is",
"nonempty",
"."
] | e148acc90031a4f3967422705a9fb07ddaf155e4 | https://github.com/LAW-Unimi/BUbiNG/blob/e148acc90031a4f3967422705a9fb07ddaf155e4/src/it/unimi/di/law/bubing/frontier/VisitState.java#L147-L151 |
101,689 | LAW-Unimi/BUbiNG | src/it/unimi/di/law/bubing/frontier/VisitState.java | VisitState.putInEntryIfNotEmpty | public synchronized void putInEntryIfNotEmpty() {
assert workbenchEntry != null : this;
assert acquired : this;
assert workbenchEntry.acquired : workbenchEntry;
if (! isEmpty()) workbenchEntry.add(this);
acquired = false;
} | java | public synchronized void putInEntryIfNotEmpty() {
assert workbenchEntry != null : this;
assert acquired : this;
assert workbenchEntry.acquired : workbenchEntry;
if (! isEmpty()) workbenchEntry.add(this);
acquired = false;
} | [
"public",
"synchronized",
"void",
"putInEntryIfNotEmpty",
"(",
")",
"{",
"assert",
"workbenchEntry",
"!=",
"null",
":",
"this",
";",
"assert",
"acquired",
":",
"this",
";",
"assert",
"workbenchEntry",
".",
"acquired",
":",
"workbenchEntry",
";",
"if",
"(",
"!"... | Puts this visit state in its entry, if it not empty.
<p>This method is called only by {@link Workbench#release(VisitState)}.
Note that the associated entry is <em>not</em> put back on the workbench. Use
{@link WorkbenchEntry#putOnWorkbenchIfNotEmpty(Workbench)} for that purpose.
<ul>
<li>Preconditions: {@link #workbe... | [
"Puts",
"this",
"visit",
"state",
"in",
"its",
"entry",
"if",
"it",
"not",
"empty",
"."
] | e148acc90031a4f3967422705a9fb07ddaf155e4 | https://github.com/LAW-Unimi/BUbiNG/blob/e148acc90031a4f3967422705a9fb07ddaf155e4/src/it/unimi/di/law/bubing/frontier/VisitState.java#L177-L183 |
101,690 | LAW-Unimi/BUbiNG | src/it/unimi/di/law/bubing/frontier/VisitState.java | VisitState.enqueuePathQuery | public void enqueuePathQuery(final byte[] pathQuery) {
synchronized (this) {
if (nextFetch == Long.MAX_VALUE) return;
final boolean wasEmpty = pathQueries.isEmpty();
pathQueries.enqueue(pathQuery);
if (wasEmpty) putInEntryIfNotAcquired();
}
frontier.pathQueriesInQueues.incrementAndGet();
frontier.we... | java | public void enqueuePathQuery(final byte[] pathQuery) {
synchronized (this) {
if (nextFetch == Long.MAX_VALUE) return;
final boolean wasEmpty = pathQueries.isEmpty();
pathQueries.enqueue(pathQuery);
if (wasEmpty) putInEntryIfNotAcquired();
}
frontier.pathQueriesInQueues.incrementAndGet();
frontier.we... | [
"public",
"void",
"enqueuePathQuery",
"(",
"final",
"byte",
"[",
"]",
"pathQuery",
")",
"{",
"synchronized",
"(",
"this",
")",
"{",
"if",
"(",
"nextFetch",
"==",
"Long",
".",
"MAX_VALUE",
")",
"return",
";",
"final",
"boolean",
"wasEmpty",
"=",
"pathQuerie... | Enqueues a path+query in byte-array representation, possibly putting this visit state in its
entry.
<p>Note that if you enqueue more than once the same URL to a visit state using
this method, it will be fetched twice. Thus, this method should be called only
by the {@linkplain NewFlowReceiver receiver of new flows from... | [
"Enqueues",
"a",
"path",
"+",
"query",
"in",
"byte",
"-",
"array",
"representation",
"possibly",
"putting",
"this",
"visit",
"state",
"in",
"its",
"entry",
"."
] | e148acc90031a4f3967422705a9fb07ddaf155e4 | https://github.com/LAW-Unimi/BUbiNG/blob/e148acc90031a4f3967422705a9fb07ddaf155e4/src/it/unimi/di/law/bubing/frontier/VisitState.java#L265-L274 |
101,691 | LAW-Unimi/BUbiNG | src/it/unimi/di/law/bubing/frontier/VisitState.java | VisitState.dequeue | public byte[] dequeue() {
final byte[] array;
synchronized (this) {
array = pathQueries.dequeue();
}
if (array != ROBOTS_PATH) {
frontier.pathQueriesInQueues.decrementAndGet();
frontier.weightOfpathQueriesInQueues.addAndGet(-BURL.memoryUsageOf(array));
}
return array;
} | java | public byte[] dequeue() {
final byte[] array;
synchronized (this) {
array = pathQueries.dequeue();
}
if (array != ROBOTS_PATH) {
frontier.pathQueriesInQueues.decrementAndGet();
frontier.weightOfpathQueriesInQueues.addAndGet(-BURL.memoryUsageOf(array));
}
return array;
} | [
"public",
"byte",
"[",
"]",
"dequeue",
"(",
")",
"{",
"final",
"byte",
"[",
"]",
"array",
";",
"synchronized",
"(",
"this",
")",
"{",
"array",
"=",
"pathQueries",
".",
"dequeue",
"(",
")",
";",
"}",
"if",
"(",
"array",
"!=",
"ROBOTS_PATH",
")",
"{"... | Removes the first path in the queue.
@return the first path in the queue.
@throws NoSuchElementException if the queue of path+queries is empty. | [
"Removes",
"the",
"first",
"path",
"in",
"the",
"queue",
"."
] | e148acc90031a4f3967422705a9fb07ddaf155e4 | https://github.com/LAW-Unimi/BUbiNG/blob/e148acc90031a4f3967422705a9fb07ddaf155e4/src/it/unimi/di/law/bubing/frontier/VisitState.java#L293-L304 |
101,692 | LAW-Unimi/BUbiNG | src/it/unimi/di/law/bubing/frontier/VisitState.java | VisitState.pathQueryLimit | public int pathQueryLimit() {
/* We first compute the ratio beween the delay for scheme+authorities and the IP delay.
* It is usually greater than one and it expresses the number of scheme+authorities
* that can "fit" the IP delay. */
final double delayRatio = Math.max(1 , (frontier.rc.schemeAuthorityDelay + ... | java | public int pathQueryLimit() {
/* We first compute the ratio beween the delay for scheme+authorities and the IP delay.
* It is usually greater than one and it expresses the number of scheme+authorities
* that can "fit" the IP delay. */
final double delayRatio = Math.max(1 , (frontier.rc.schemeAuthorityDelay + ... | [
"public",
"int",
"pathQueryLimit",
"(",
")",
"{",
"/* We first compute the ratio beween the delay for scheme+authorities and the IP delay.\n\t\t * It is usually greater than one and it expresses the number of scheme+authorities\n\t\t * that can \"fit\" the IP delay. */",
"final",
"double",
"delayR... | Returns an estimate of the number of path+queries that this visit state should keep in memory.
@return an estimate of the number of path+queries that this visit state should keep in memory. | [
"Returns",
"an",
"estimate",
"of",
"the",
"number",
"of",
"path",
"+",
"queries",
"that",
"this",
"visit",
"state",
"should",
"keep",
"in",
"memory",
"."
] | e148acc90031a4f3967422705a9fb07ddaf155e4 | https://github.com/LAW-Unimi/BUbiNG/blob/e148acc90031a4f3967422705a9fb07ddaf155e4/src/it/unimi/di/law/bubing/frontier/VisitState.java#L400-L419 |
101,693 | LAW-Unimi/BUbiNG | src/it/unimi/di/law/bubing/parser/BinaryParser.java | BinaryParser.forName | @SuppressWarnings("deprecation")
public final static HashFunction forName(final String messageDigest) throws NoSuchAlgorithmException {
if ("".equals(messageDigest)) return null;
if ("MD5".equalsIgnoreCase(messageDigest)) return Hashing.md5();
if ("MurmurHash3".equalsIgnoreCase(messageDigest)) return Hashing.mur... | java | @SuppressWarnings("deprecation")
public final static HashFunction forName(final String messageDigest) throws NoSuchAlgorithmException {
if ("".equals(messageDigest)) return null;
if ("MD5".equalsIgnoreCase(messageDigest)) return Hashing.md5();
if ("MurmurHash3".equalsIgnoreCase(messageDigest)) return Hashing.mur... | [
"@",
"SuppressWarnings",
"(",
"\"deprecation\"",
")",
"public",
"final",
"static",
"HashFunction",
"forName",
"(",
"final",
"String",
"messageDigest",
")",
"throws",
"NoSuchAlgorithmException",
"{",
"if",
"(",
"\"\"",
".",
"equals",
"(",
"messageDigest",
")",
")",... | Return the hash function corresponding to a given message-digest algorithm given by name.
@param messageDigest a message-digest algorithm (e.g., <code>MurmurHash3</code> or <code>MD5</code>); {@code null} if {@code messageDigest} is the empty string. | [
"Return",
"the",
"hash",
"function",
"corresponding",
"to",
"a",
"given",
"message",
"-",
"digest",
"algorithm",
"given",
"by",
"name",
"."
] | e148acc90031a4f3967422705a9fb07ddaf155e4 | https://github.com/LAW-Unimi/BUbiNG/blob/e148acc90031a4f3967422705a9fb07ddaf155e4/src/it/unimi/di/law/bubing/parser/BinaryParser.java#L44-L50 |
101,694 | LAW-Unimi/BUbiNG | src/it/unimi/di/law/warc/io/gzarc/GZIPArchiveWriter.java | GZIPArchiveWriter.writeEntry | protected void writeEntry(final GZIPArchive.Entry entry) throws IOException {
// ID1 ID2 CM FLG
this.output.write(GZIPArchive.GZIP_START);
// MTIME
writeLEInt(this.output, entry.mtime);
// XFL OS
this.output.write(GZIPArchive.XFL_OS);
/* EXTRA begin */
// XLEN
writeLEShort(this.output, GZIPAr... | java | protected void writeEntry(final GZIPArchive.Entry entry) throws IOException {
// ID1 ID2 CM FLG
this.output.write(GZIPArchive.GZIP_START);
// MTIME
writeLEInt(this.output, entry.mtime);
// XFL OS
this.output.write(GZIPArchive.XFL_OS);
/* EXTRA begin */
// XLEN
writeLEShort(this.output, GZIPAr... | [
"protected",
"void",
"writeEntry",
"(",
"final",
"GZIPArchive",
".",
"Entry",
"entry",
")",
"throws",
"IOException",
"{",
"// ID1 ID2 CM FLG",
"this",
".",
"output",
".",
"write",
"(",
"GZIPArchive",
".",
"GZIP_START",
")",
";",
"// MTIME",
"writeLEInt",
"(",
... | Writes the entry on the underlying stream.
More precisely, it writes the GZIP header, the content of the (bufferized) deflater stream and then the CZIP trailer. | [
"Writes",
"the",
"entry",
"on",
"the",
"underlying",
"stream",
"."
] | e148acc90031a4f3967422705a9fb07ddaf155e4 | https://github.com/LAW-Unimi/BUbiNG/blob/e148acc90031a4f3967422705a9fb07ddaf155e4/src/it/unimi/di/law/warc/io/gzarc/GZIPArchiveWriter.java#L54-L114 |
101,695 | LAW-Unimi/BUbiNG | src/it/unimi/di/law/warc/io/gzarc/GZIPArchiveWriter.java | GZIPArchiveWriter.getEntry | public GZIPArchive.WriteEntry getEntry(final String name, final String comment, final Date creationDate) {
crc.reset();
deflater.reset();
deflaterStream.reset();
final GZIPArchive.WriteEntry entry = new GZIPArchive.WriteEntry();
entry.setName(name);
entry.setComment(comment);
entry.deflater = new Filter... | java | public GZIPArchive.WriteEntry getEntry(final String name, final String comment, final Date creationDate) {
crc.reset();
deflater.reset();
deflaterStream.reset();
final GZIPArchive.WriteEntry entry = new GZIPArchive.WriteEntry();
entry.setName(name);
entry.setComment(comment);
entry.deflater = new Filter... | [
"public",
"GZIPArchive",
".",
"WriteEntry",
"getEntry",
"(",
"final",
"String",
"name",
",",
"final",
"String",
"comment",
",",
"final",
"Date",
"creationDate",
")",
"{",
"crc",
".",
"reset",
"(",
")",
";",
"deflater",
".",
"reset",
"(",
")",
";",
"defla... | Returns an object that can be used to write an entry in the GZIP archive.
In order to write the actual entry, one must write the entry content on the {@link GZIPArchive.WriteEntry#deflater} and,
at the end, call its <code>close()</code> method (to actually write the compressed content).
@param name the name of the en... | [
"Returns",
"an",
"object",
"that",
"can",
"be",
"used",
"to",
"write",
"an",
"entry",
"in",
"the",
"GZIP",
"archive",
"."
] | e148acc90031a4f3967422705a9fb07ddaf155e4 | https://github.com/LAW-Unimi/BUbiNG/blob/e148acc90031a4f3967422705a9fb07ddaf155e4/src/it/unimi/di/law/warc/io/gzarc/GZIPArchiveWriter.java#L127-L171 |
101,696 | LAW-Unimi/BUbiNG | src/it/unimi/di/law/warc/io/gzarc/GZIPArchiveWriter.java | GZIPArchiveWriter.writeLEInt | private static void writeLEInt(OutputStream out, int i) throws IOException {
out.write((byte)i);
out.write((byte)((i >> 8) & 0xFF));
out.write((byte)((i >> 16) & 0xFF));
out.write((byte)((i >> 24) & 0xFF));
} | java | private static void writeLEInt(OutputStream out, int i) throws IOException {
out.write((byte)i);
out.write((byte)((i >> 8) & 0xFF));
out.write((byte)((i >> 16) & 0xFF));
out.write((byte)((i >> 24) & 0xFF));
} | [
"private",
"static",
"void",
"writeLEInt",
"(",
"OutputStream",
"out",
",",
"int",
"i",
")",
"throws",
"IOException",
"{",
"out",
".",
"write",
"(",
"(",
"byte",
")",
"i",
")",
";",
"out",
".",
"write",
"(",
"(",
"byte",
")",
"(",
"(",
"i",
">>",
... | Writes the given integer in little-endian on the stream. | [
"Writes",
"the",
"given",
"integer",
"in",
"little",
"-",
"endian",
"on",
"the",
"stream",
"."
] | e148acc90031a4f3967422705a9fb07ddaf155e4 | https://github.com/LAW-Unimi/BUbiNG/blob/e148acc90031a4f3967422705a9fb07ddaf155e4/src/it/unimi/di/law/warc/io/gzarc/GZIPArchiveWriter.java#L174-L179 |
101,697 | LAW-Unimi/BUbiNG | src/it/unimi/di/law/warc/io/gzarc/GZIPArchiveWriter.java | GZIPArchiveWriter.writeLEShort | private static void writeLEShort(OutputStream out, short s) throws IOException {
out.write((byte)s);
out.write((byte)((s >> 8) & 0xFF));
} | java | private static void writeLEShort(OutputStream out, short s) throws IOException {
out.write((byte)s);
out.write((byte)((s >> 8) & 0xFF));
} | [
"private",
"static",
"void",
"writeLEShort",
"(",
"OutputStream",
"out",
",",
"short",
"s",
")",
"throws",
"IOException",
"{",
"out",
".",
"write",
"(",
"(",
"byte",
")",
"s",
")",
";",
"out",
".",
"write",
"(",
"(",
"byte",
")",
"(",
"(",
"s",
">>... | Writes the given short in little-endian on the stream. | [
"Writes",
"the",
"given",
"short",
"in",
"little",
"-",
"endian",
"on",
"the",
"stream",
"."
] | e148acc90031a4f3967422705a9fb07ddaf155e4 | https://github.com/LAW-Unimi/BUbiNG/blob/e148acc90031a4f3967422705a9fb07ddaf155e4/src/it/unimi/di/law/warc/io/gzarc/GZIPArchiveWriter.java#L182-L185 |
101,698 | LAW-Unimi/BUbiNG | src/it/unimi/di/law/bubing/util/ObjectDiskQueue.java | ObjectDiskQueue.createNew | public static <T> ObjectDiskQueue<T> createNew(final File file, final int bufferSize, final boolean direct) throws IOException {
return new ObjectDiskQueue<>(ByteDiskQueue.createNew(file, bufferSize, direct));
} | java | public static <T> ObjectDiskQueue<T> createNew(final File file, final int bufferSize, final boolean direct) throws IOException {
return new ObjectDiskQueue<>(ByteDiskQueue.createNew(file, bufferSize, direct));
} | [
"public",
"static",
"<",
"T",
">",
"ObjectDiskQueue",
"<",
"T",
">",
"createNew",
"(",
"final",
"File",
"file",
",",
"final",
"int",
"bufferSize",
",",
"final",
"boolean",
"direct",
")",
"throws",
"IOException",
"{",
"return",
"new",
"ObjectDiskQueue",
"<>",... | Creates a new disk-based queue of objects.
@param file the file that will be used to dump the queue on disk.
@param bufferSize the number of items in the circular buffer (will be possibly decreased so to be a power of two).
@param direct whether the {@link ByteBuffer} used by this queue should be {@linkplain ByteBuffe... | [
"Creates",
"a",
"new",
"disk",
"-",
"based",
"queue",
"of",
"objects",
"."
] | e148acc90031a4f3967422705a9fb07ddaf155e4 | https://github.com/LAW-Unimi/BUbiNG/blob/e148acc90031a4f3967422705a9fb07ddaf155e4/src/it/unimi/di/law/bubing/util/ObjectDiskQueue.java#L69-L71 |
101,699 | LAW-Unimi/BUbiNG | src/it/unimi/di/law/bubing/util/ObjectDiskQueue.java | ObjectDiskQueue.createFromFile | public static <T> ObjectDiskQueue<T> createFromFile(final long size, final File file, final int bufferSize, final boolean direct) throws IOException {
final ObjectDiskQueue<T> byteArrayDiskQueue = new ObjectDiskQueue<>(ByteDiskQueue.createFromFile(file, bufferSize, direct));
byteArrayDiskQueue.size = size;
return... | java | public static <T> ObjectDiskQueue<T> createFromFile(final long size, final File file, final int bufferSize, final boolean direct) throws IOException {
final ObjectDiskQueue<T> byteArrayDiskQueue = new ObjectDiskQueue<>(ByteDiskQueue.createFromFile(file, bufferSize, direct));
byteArrayDiskQueue.size = size;
return... | [
"public",
"static",
"<",
"T",
">",
"ObjectDiskQueue",
"<",
"T",
">",
"createFromFile",
"(",
"final",
"long",
"size",
",",
"final",
"File",
"file",
",",
"final",
"int",
"bufferSize",
",",
"final",
"boolean",
"direct",
")",
"throws",
"IOException",
"{",
"fin... | Creates a new disk-based queue of objects using an existing file.
<p>Note that you have to supply the correct number of objects contained in the dump file of
the underlying {@link ByteDiskQueue}. Failure to do so will cause unpredictable behaviour.
@param size the number of objects contained in {@code file}.
@param f... | [
"Creates",
"a",
"new",
"disk",
"-",
"based",
"queue",
"of",
"objects",
"using",
"an",
"existing",
"file",
"."
] | e148acc90031a4f3967422705a9fb07ddaf155e4 | https://github.com/LAW-Unimi/BUbiNG/blob/e148acc90031a4f3967422705a9fb07ddaf155e4/src/it/unimi/di/law/bubing/util/ObjectDiskQueue.java#L84-L88 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.