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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
102,200 | sculptor/sculptor | sculptor-examples/DDDSample/src/main/java/org/sculptor/dddsample/cargo/domain/Itinerary.java | Itinerary.isExpected | public boolean isExpected(final HandlingEvent event) {
if (getLegs().isEmpty()) {
return true;
}
if (event.getType() == Type.RECEIVE) {
// Check that the first leg's origin is the event's location
final Leg leg = getLegs().get(0);
return (leg.getFrom().equals(event.getLocation()));
}
if (event.g... | java | public boolean isExpected(final HandlingEvent event) {
if (getLegs().isEmpty()) {
return true;
}
if (event.getType() == Type.RECEIVE) {
// Check that the first leg's origin is the event's location
final Leg leg = getLegs().get(0);
return (leg.getFrom().equals(event.getLocation()));
}
if (event.g... | [
"public",
"boolean",
"isExpected",
"(",
"final",
"HandlingEvent",
"event",
")",
"{",
"if",
"(",
"getLegs",
"(",
")",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"true",
";",
"}",
"if",
"(",
"event",
".",
"getType",
"(",
")",
"==",
"Type",
".",
"R... | Test if the given handling event is expected when executing this
itinerary.
@param event
Event to test.
@return <code>true</code> if the event is expected | [
"Test",
"if",
"the",
"given",
"handling",
"event",
"is",
"expected",
"when",
"executing",
"this",
"itinerary",
"."
] | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-examples/DDDSample/src/main/java/org/sculptor/dddsample/cargo/domain/Itinerary.java#L47-L91 |
102,201 | sculptor/sculptor | sculptor-examples/DDDSample/src/main/java/org/sculptor/dddsample/cargo/domain/Cargo.java | Cargo.attachItinerary | public void attachItinerary(final Itinerary itinerary) {
Validate.notNull(itinerary);
// Decouple the old itinerary from this cargo
itinerary().setCargo(null);
// Couple this cargo and the new itinerary
setItinerary(itinerary);
itinerary().setCargo(this);
} | java | public void attachItinerary(final Itinerary itinerary) {
Validate.notNull(itinerary);
// Decouple the old itinerary from this cargo
itinerary().setCargo(null);
// Couple this cargo and the new itinerary
setItinerary(itinerary);
itinerary().setCargo(this);
} | [
"public",
"void",
"attachItinerary",
"(",
"final",
"Itinerary",
"itinerary",
")",
"{",
"Validate",
".",
"notNull",
"(",
"itinerary",
")",
";",
"// Decouple the old itinerary from this cargo",
"itinerary",
"(",
")",
".",
"setCargo",
"(",
"null",
")",
";",
"// Coupl... | Attach a new itinerary to this cargo.
@param itinerary
an itinerary. May not be null. | [
"Attach",
"a",
"new",
"itinerary",
"to",
"this",
"cargo",
"."
] | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-examples/DDDSample/src/main/java/org/sculptor/dddsample/cargo/domain/Cargo.java#L86-L94 |
102,202 | sculptor/sculptor | sculptor-examples/DDDSample/src/main/java/org/sculptor/dddsample/cargo/domain/Cargo.java | Cargo.nullSafe | private <T> T nullSafe(T actual, T safe) {
return actual == null ? safe : actual;
} | java | private <T> T nullSafe(T actual, T safe) {
return actual == null ? safe : actual;
} | [
"private",
"<",
"T",
">",
"T",
"nullSafe",
"(",
"T",
"actual",
",",
"T",
"safe",
")",
"{",
"return",
"actual",
"==",
"null",
"?",
"safe",
":",
"actual",
";",
"}"
] | Utility for Null Object Pattern - should be moved out of this class | [
"Utility",
"for",
"Null",
"Object",
"Pattern",
"-",
"should",
"be",
"moved",
"out",
"of",
"this",
"class"
] | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-examples/DDDSample/src/main/java/org/sculptor/dddsample/cargo/domain/Cargo.java#L141-L143 |
102,203 | sculptor/sculptor | sculptor-framework/sculptor-framework-main/src/main/java/org/sculptor/framework/domain/JodaAuditListener.java | JodaAuditListener.changeAuditInformation | @PreUpdate
@PrePersist
private void changeAuditInformation(JodaAuditable auditableEntity) {
DateTime lastUpdated = new DateTime();
auditableEntity.setLastUpdated(lastUpdated);
String lastUpdatedBy = ServiceContextStore.getCurrentUser();
auditableEntity.setLastUpdatedBy(lastUpd... | java | @PreUpdate
@PrePersist
private void changeAuditInformation(JodaAuditable auditableEntity) {
DateTime lastUpdated = new DateTime();
auditableEntity.setLastUpdated(lastUpdated);
String lastUpdatedBy = ServiceContextStore.getCurrentUser();
auditableEntity.setLastUpdatedBy(lastUpd... | [
"@",
"PreUpdate",
"@",
"PrePersist",
"private",
"void",
"changeAuditInformation",
"(",
"JodaAuditable",
"auditableEntity",
")",
"{",
"DateTime",
"lastUpdated",
"=",
"new",
"DateTime",
"(",
")",
";",
"auditableEntity",
".",
"setLastUpdated",
"(",
"lastUpdated",
")",
... | set audit informations, doesn't modify createdDate and createdBy once
set. Only works with DomainObjects that implement the JodaAuditable
interface. In other cases a IllegalArgumentException is thrown.
@param entity
@return | [
"set",
"audit",
"informations",
"doesn",
"t",
"modify",
"createdDate",
"and",
"createdBy",
"once",
"set",
".",
"Only",
"works",
"with",
"DomainObjects",
"that",
"implement",
"the",
"JodaAuditable",
"interface",
".",
"In",
"other",
"cases",
"a",
"IllegalArgumentExc... | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-framework/sculptor-framework-main/src/main/java/org/sculptor/framework/domain/JodaAuditListener.java#L47-L58 |
102,204 | sculptor/sculptor | sculptor-maven/sculptor-maven-plugin/src/main/java/org/sculptor/maven/plugin/AbstractLogOutputStream.java | AbstractLogOutputStream.processLine | @Override
protected final void processLine(String line, int level) {
boolean isError = doProcessLine(line, level);
if (isErrorStream || isError) {
errorCount++;
}
lineCount++;
} | java | @Override
protected final void processLine(String line, int level) {
boolean isError = doProcessLine(line, level);
if (isErrorStream || isError) {
errorCount++;
}
lineCount++;
} | [
"@",
"Override",
"protected",
"final",
"void",
"processLine",
"(",
"String",
"line",
",",
"int",
"level",
")",
"{",
"boolean",
"isError",
"=",
"doProcessLine",
"(",
"line",
",",
"level",
")",
";",
"if",
"(",
"isErrorStream",
"||",
"isError",
")",
"{",
"e... | Depending on stream type the given line is logged and the correspondig
counter is increased. | [
"Depending",
"on",
"stream",
"type",
"the",
"given",
"line",
"is",
"logged",
"and",
"the",
"correspondig",
"counter",
"is",
"increased",
"."
] | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-maven/sculptor-maven-plugin/src/main/java/org/sculptor/maven/plugin/AbstractLogOutputStream.java#L59-L66 |
102,205 | sculptor/sculptor | sculptor-framework/sculptor-framework-main/src/main/java/org/sculptor/framework/errorhandling/ErrorHandlingInterceptor.java | ErrorHandlingInterceptor.afterThrowing | public void afterThrowing(Method m, Object[] args, Object target, ConstraintViolationException e) {
Logger log = LoggerFactory.getLogger(target.getClass());
StringBuilder logText = new StringBuilder(excMessage(e));
if (e.getConstraintViolations() != null && e.getConstraintViolations().siz... | java | public void afterThrowing(Method m, Object[] args, Object target, ConstraintViolationException e) {
Logger log = LoggerFactory.getLogger(target.getClass());
StringBuilder logText = new StringBuilder(excMessage(e));
if (e.getConstraintViolations() != null && e.getConstraintViolations().siz... | [
"public",
"void",
"afterThrowing",
"(",
"Method",
"m",
",",
"Object",
"[",
"]",
"args",
",",
"Object",
"target",
",",
"ConstraintViolationException",
"e",
")",
"{",
"Logger",
"log",
"=",
"LoggerFactory",
".",
"getLogger",
"(",
"target",
".",
"getClass",
"(",... | Handles validation exception | [
"Handles",
"validation",
"exception"
] | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-framework/sculptor-framework-main/src/main/java/org/sculptor/framework/errorhandling/ErrorHandlingInterceptor.java#L96-L126 |
102,206 | sculptor/sculptor | sculptor-generator/sculptor-generator-core/src/main/java/org/sculptor/generator/util/HelperBase.java | HelperBase.getCollectionInterfaceType | public String getCollectionInterfaceType(Reference ref) {
String collectionType = getRefCollectionType(ref);
return getCollectionInterfaceType(collectionType);
} | java | public String getCollectionInterfaceType(Reference ref) {
String collectionType = getRefCollectionType(ref);
return getCollectionInterfaceType(collectionType);
} | [
"public",
"String",
"getCollectionInterfaceType",
"(",
"Reference",
"ref",
")",
"{",
"String",
"collectionType",
"=",
"getRefCollectionType",
"(",
"ref",
")",
";",
"return",
"getCollectionInterfaceType",
"(",
"collectionType",
")",
";",
"}"
] | Java interface for the collection type.
@see #getCollectionType(sculptormetamodel.Reference) | [
"Java",
"interface",
"for",
"the",
"collection",
"type",
"."
] | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-generator/sculptor-generator-core/src/main/java/org/sculptor/generator/util/HelperBase.java#L430-L433 |
102,207 | sculptor/sculptor | sculptor-generator/sculptor-generator-core/src/main/java/org/sculptor/generator/util/HelperBase.java | HelperBase.getCollectionImplType | public String getCollectionImplType(Reference ref) {
String collectionType = getRefCollectionType(ref);
return getCollectionImplType(collectionType);
} | java | public String getCollectionImplType(Reference ref) {
String collectionType = getRefCollectionType(ref);
return getCollectionImplType(collectionType);
} | [
"public",
"String",
"getCollectionImplType",
"(",
"Reference",
"ref",
")",
"{",
"String",
"collectionType",
"=",
"getRefCollectionType",
"(",
"ref",
")",
";",
"return",
"getCollectionImplType",
"(",
"collectionType",
")",
";",
"}"
] | Java implementation class for the collection type.
@see #getCollectionType(sculptormetamodel.Reference) | [
"Java",
"implementation",
"class",
"for",
"the",
"collection",
"type",
"."
] | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-generator/sculptor-generator-core/src/main/java/org/sculptor/generator/util/HelperBase.java#L448-L451 |
102,208 | sculptor/sculptor | sculptor-generator/sculptor-generator-core/src/main/java/org/sculptor/generator/util/HelperBase.java | HelperBase.getRefCollectionType | public String getRefCollectionType(Reference ref) {
String type = ref.getCollectionType();
return (type == null ? "set" : type.toLowerCase());
} | java | public String getRefCollectionType(Reference ref) {
String type = ref.getCollectionType();
return (type == null ? "set" : type.toLowerCase());
} | [
"public",
"String",
"getRefCollectionType",
"(",
"Reference",
"ref",
")",
"{",
"String",
"type",
"=",
"ref",
".",
"getCollectionType",
"(",
")",
";",
"return",
"(",
"type",
"==",
"null",
"?",
"\"set\"",
":",
"type",
".",
"toLowerCase",
"(",
")",
")",
";"... | Collection type can be set, list, bag or map. It corresponds to the
Hibernate collection types. | [
"Collection",
"type",
"can",
"be",
"set",
"list",
"bag",
"or",
"map",
".",
"It",
"corresponds",
"to",
"the",
"Hibernate",
"collection",
"types",
"."
] | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-generator/sculptor-generator-core/src/main/java/org/sculptor/generator/util/HelperBase.java#L465-L468 |
102,209 | sculptor/sculptor | sculptor-generator/sculptor-generator-core/src/main/java/org/sculptor/generator/util/HelperBase.java | HelperBase.getGetAccessor | public String getGetAccessor(TypedElement e, String prefix) {
String capName = toFirstUpper(e.getName());
if (prefix != null) {
capName = toFirstUpper(prefix) + capName;
}
// Note that Boolean object type is not named with is prefix (according
// to java beans spec)
String result = isBooleanPrimitiveType... | java | public String getGetAccessor(TypedElement e, String prefix) {
String capName = toFirstUpper(e.getName());
if (prefix != null) {
capName = toFirstUpper(prefix) + capName;
}
// Note that Boolean object type is not named with is prefix (according
// to java beans spec)
String result = isBooleanPrimitiveType... | [
"public",
"String",
"getGetAccessor",
"(",
"TypedElement",
"e",
",",
"String",
"prefix",
")",
"{",
"String",
"capName",
"=",
"toFirstUpper",
"(",
"e",
".",
"getName",
"(",
")",
")",
";",
"if",
"(",
"prefix",
"!=",
"null",
")",
"{",
"capName",
"=",
"toF... | Get-accessor method name of a property, according to JavaBeans naming
conventions. | [
"Get",
"-",
"accessor",
"method",
"name",
"of",
"a",
"property",
"according",
"to",
"JavaBeans",
"naming",
"conventions",
"."
] | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-generator/sculptor-generator-core/src/main/java/org/sculptor/generator/util/HelperBase.java#L479-L488 |
102,210 | sculptor/sculptor | sculptor-generator/sculptor-generator-core/src/main/java/org/sculptor/generator/util/HelperBase.java | HelperBase.toFirstUpper | public String toFirstUpper(String name) {
if (name.length() == 0) {
return name;
} else {
return name.substring(0, 1).toUpperCase() + name.substring(1);
}
} | java | public String toFirstUpper(String name) {
if (name.length() == 0) {
return name;
} else {
return name.substring(0, 1).toUpperCase() + name.substring(1);
}
} | [
"public",
"String",
"toFirstUpper",
"(",
"String",
"name",
")",
"{",
"if",
"(",
"name",
".",
"length",
"(",
")",
"==",
"0",
")",
"{",
"return",
"name",
";",
"}",
"else",
"{",
"return",
"name",
".",
"substring",
"(",
"0",
",",
"1",
")",
".",
"toUp... | First character to upper case. | [
"First",
"character",
"to",
"upper",
"case",
"."
] | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-generator/sculptor-generator-core/src/main/java/org/sculptor/generator/util/HelperBase.java#L493-L499 |
102,211 | sculptor/sculptor | sculptor-generator/sculptor-generator-core/src/main/java/org/sculptor/generator/util/HelperBase.java | HelperBase.toFirstLower | public String toFirstLower(String name) {
if (name.length() == 0) {
return name;
} else {
return name.substring(0, 1).toLowerCase() + name.substring(1);
}
} | java | public String toFirstLower(String name) {
if (name.length() == 0) {
return name;
} else {
return name.substring(0, 1).toLowerCase() + name.substring(1);
}
} | [
"public",
"String",
"toFirstLower",
"(",
"String",
"name",
")",
"{",
"if",
"(",
"name",
".",
"length",
"(",
")",
"==",
"0",
")",
"{",
"return",
"name",
";",
"}",
"else",
"{",
"return",
"name",
".",
"substring",
"(",
"0",
",",
"1",
")",
".",
"toLo... | First character to lower case. | [
"First",
"character",
"to",
"lower",
"case",
"."
] | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-generator/sculptor-generator-core/src/main/java/org/sculptor/generator/util/HelperBase.java#L504-L510 |
102,212 | sculptor/sculptor | sculptor-generator/sculptor-generator-core/src/main/java/org/sculptor/generator/util/HelperBase.java | HelperBase.substringBefore | public String substringBefore(String string, String pattern) {
if (string == null || pattern == null) {
return string;
}
int pos = string.indexOf(pattern);
if (pos != -1) {
return string.substring(0, pos);
}
return null;
} | java | public String substringBefore(String string, String pattern) {
if (string == null || pattern == null) {
return string;
}
int pos = string.indexOf(pattern);
if (pos != -1) {
return string.substring(0, pos);
}
return null;
} | [
"public",
"String",
"substringBefore",
"(",
"String",
"string",
",",
"String",
"pattern",
")",
"{",
"if",
"(",
"string",
"==",
"null",
"||",
"pattern",
"==",
"null",
")",
"{",
"return",
"string",
";",
"}",
"int",
"pos",
"=",
"string",
".",
"indexOf",
"... | Gets the substring before a given pattern
@param string
original string
@param pattern
pattern to check
@return substring before the pattern | [
"Gets",
"the",
"substring",
"before",
"a",
"given",
"pattern"
] | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-generator/sculptor-generator-core/src/main/java/org/sculptor/generator/util/HelperBase.java#L567-L576 |
102,213 | sculptor/sculptor | sculptor-generator/sculptor-generator-core/src/main/java/org/sculptor/generator/util/HelperBase.java | HelperBase.addDefaultValues | public void addDefaultValues(Service service) {
for (ServiceOperation op : (List<ServiceOperation>) service.getOperations()) {
addDefaultValues(op);
}
} | java | public void addDefaultValues(Service service) {
for (ServiceOperation op : (List<ServiceOperation>) service.getOperations()) {
addDefaultValues(op);
}
} | [
"public",
"void",
"addDefaultValues",
"(",
"Service",
"service",
")",
"{",
"for",
"(",
"ServiceOperation",
"op",
":",
"(",
"List",
"<",
"ServiceOperation",
">",
")",
"service",
".",
"getOperations",
"(",
")",
")",
"{",
"addDefaultValues",
"(",
"op",
")",
"... | Fill in parameters and return values for operations that delegate to
Repository. | [
"Fill",
"in",
"parameters",
"and",
"return",
"values",
"for",
"operations",
"that",
"delegate",
"to",
"Repository",
"."
] | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-generator/sculptor-generator-core/src/main/java/org/sculptor/generator/util/HelperBase.java#L804-L808 |
102,214 | sculptor/sculptor | sculptor-generator/sculptor-generator-core/src/main/java/org/sculptor/generator/util/HelperBase.java | HelperBase.addDefaultValues | private void addDefaultValues(ServiceOperation operation) {
if (operation.getDelegate() != null) {
copyFromDelegate(operation, operation.getDelegate(), true);
} else if (operation.getServiceDelegate() != null) {
// make sure that the service delegate has been populated first
addDefaultValues(operation.getS... | java | private void addDefaultValues(ServiceOperation operation) {
if (operation.getDelegate() != null) {
copyFromDelegate(operation, operation.getDelegate(), true);
} else if (operation.getServiceDelegate() != null) {
// make sure that the service delegate has been populated first
addDefaultValues(operation.getS... | [
"private",
"void",
"addDefaultValues",
"(",
"ServiceOperation",
"operation",
")",
"{",
"if",
"(",
"operation",
".",
"getDelegate",
"(",
")",
"!=",
"null",
")",
"{",
"copyFromDelegate",
"(",
"operation",
",",
"operation",
".",
"getDelegate",
"(",
")",
",",
"t... | Copy values from delegate RepositoryOperation to this ServiceOperation | [
"Copy",
"values",
"from",
"delegate",
"RepositoryOperation",
"to",
"this",
"ServiceOperation"
] | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-generator/sculptor-generator-core/src/main/java/org/sculptor/generator/util/HelperBase.java#L813-L823 |
102,215 | sculptor/sculptor | sculptor-generator/sculptor-generator-core/src/main/java/org/sculptor/generator/util/HelperBase.java | HelperBase.addDefaultValues | private void addDefaultValues(ResourceOperation operation) {
if (operation.getDelegate() != null) {
copyFromDelegate(operation, operation.getDelegate(), false);
}
} | java | private void addDefaultValues(ResourceOperation operation) {
if (operation.getDelegate() != null) {
copyFromDelegate(operation, operation.getDelegate(), false);
}
} | [
"private",
"void",
"addDefaultValues",
"(",
"ResourceOperation",
"operation",
")",
"{",
"if",
"(",
"operation",
".",
"getDelegate",
"(",
")",
"!=",
"null",
")",
"{",
"copyFromDelegate",
"(",
"operation",
",",
"operation",
".",
"getDelegate",
"(",
")",
",",
"... | Copy values from delegate ServiceOperation to this ResourceOperation | [
"Copy",
"values",
"from",
"delegate",
"ServiceOperation",
"to",
"this",
"ResourceOperation"
] | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-generator/sculptor-generator-core/src/main/java/org/sculptor/generator/util/HelperBase.java#L828-L832 |
102,216 | sculptor/sculptor | sculptor-generator/sculptor-generator-core/src/main/java/org/sculptor/generator/util/HelperBase.java | HelperBase.handleValidationAnnotations | private String handleValidationAnnotations(String validate) {
if (validate == null)
return "";
if (validate.length() > 15) {
@SuppressWarnings("unused")
boolean baa = true;
}
// parsing the validate string is simple text replacement
validate = validate.replaceAll("&&", " ");
validate = validate.... | java | private String handleValidationAnnotations(String validate) {
if (validate == null)
return "";
if (validate.length() > 15) {
@SuppressWarnings("unused")
boolean baa = true;
}
// parsing the validate string is simple text replacement
validate = validate.replaceAll("&&", " ");
validate = validate.... | [
"private",
"String",
"handleValidationAnnotations",
"(",
"String",
"validate",
")",
"{",
"if",
"(",
"validate",
"==",
"null",
")",
"return",
"\"\"",
";",
"if",
"(",
"validate",
".",
"length",
"(",
")",
">",
"15",
")",
"{",
"@",
"SuppressWarnings",
"(",
"... | Parses the given validation string and tries to map annotations from
properties.
@param validate
String with validation information
@return validation annotations | [
"Parses",
"the",
"given",
"validation",
"string",
"and",
"tries",
"to",
"map",
"annotations",
"from",
"properties",
"."
] | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-generator/sculptor-generator-core/src/main/java/org/sculptor/generator/util/HelperBase.java#L1045-L1066 |
102,217 | sculptor/sculptor | sculptor-generator/sculptor-generator-core/src/main/java/org/sculptor/generator/util/DbHelperBase.java | DbHelperBase.isRefInverse | public boolean isRefInverse(Reference ref) {
if (ref.isInverse()) {
return true;
}
if (!ref.isInverse() && (ref.getOpposite() != null) && ref.getOpposite().isInverse()) {
return false;
}
if (ref.getOpposite() == null) {
return false;
}
// inverse not defined on any side, use this algori... | java | public boolean isRefInverse(Reference ref) {
if (ref.isInverse()) {
return true;
}
if (!ref.isInverse() && (ref.getOpposite() != null) && ref.getOpposite().isInverse()) {
return false;
}
if (ref.getOpposite() == null) {
return false;
}
// inverse not defined on any side, use this algori... | [
"public",
"boolean",
"isRefInverse",
"(",
"Reference",
"ref",
")",
"{",
"if",
"(",
"ref",
".",
"isInverse",
"(",
")",
")",
"{",
"return",
"true",
";",
"}",
"if",
"(",
"!",
"ref",
".",
"isInverse",
"(",
")",
"&&",
"(",
"ref",
".",
"getOpposite",
"("... | Inverse attribute for many-to-many associations. | [
"Inverse",
"attribute",
"for",
"many",
"-",
"to",
"-",
"many",
"associations",
"."
] | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-generator/sculptor-generator-core/src/main/java/org/sculptor/generator/util/DbHelperBase.java#L619-L637 |
102,218 | sculptor/sculptor | sculptor-generator/sculptor-generator-core/src/main/java/org/sculptor/generator/util/DbHelperBase.java | DbHelperBase.getAllManyReferences | private List<Reference> getAllManyReferences(DomainObject domainObject) {
List<Reference> allReferences = domainObject.getReferences();
List<Reference> allManyReferences = new ArrayList<Reference>();
for (Reference ref : allReferences) {
if (ref.isMany()) {
allManyReferences.add(ref);
}
}
re... | java | private List<Reference> getAllManyReferences(DomainObject domainObject) {
List<Reference> allReferences = domainObject.getReferences();
List<Reference> allManyReferences = new ArrayList<Reference>();
for (Reference ref : allReferences) {
if (ref.isMany()) {
allManyReferences.add(ref);
}
}
re... | [
"private",
"List",
"<",
"Reference",
">",
"getAllManyReferences",
"(",
"DomainObject",
"domainObject",
")",
"{",
"List",
"<",
"Reference",
">",
"allReferences",
"=",
"domainObject",
".",
"getReferences",
"(",
")",
";",
"List",
"<",
"Reference",
">",
"allManyRefe... | List of references with multiplicity > 1 | [
"List",
"of",
"references",
"with",
"multiplicity",
">",
"1"
] | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-generator/sculptor-generator-core/src/main/java/org/sculptor/generator/util/DbHelperBase.java#L642-L651 |
102,219 | sculptor/sculptor | sculptor-generator/sculptor-generator-core/src/main/java/org/sculptor/generator/util/DbHelperBase.java | DbHelperBase.getAllOneReferences | private List<Reference> getAllOneReferences(DomainObject domainObject) {
List<Reference> allReferences = domainObject.getReferences();
List<Reference> allOneReferences = new ArrayList<Reference>();
for (Reference ref : allReferences) {
if (!ref.isMany()) {
allOneReferences.add(ref);
}
}
retu... | java | private List<Reference> getAllOneReferences(DomainObject domainObject) {
List<Reference> allReferences = domainObject.getReferences();
List<Reference> allOneReferences = new ArrayList<Reference>();
for (Reference ref : allReferences) {
if (!ref.isMany()) {
allOneReferences.add(ref);
}
}
retu... | [
"private",
"List",
"<",
"Reference",
">",
"getAllOneReferences",
"(",
"DomainObject",
"domainObject",
")",
"{",
"List",
"<",
"Reference",
">",
"allReferences",
"=",
"domainObject",
".",
"getReferences",
"(",
")",
";",
"List",
"<",
"Reference",
">",
"allOneRefere... | List of references with multiplicity = 1 | [
"List",
"of",
"references",
"with",
"multiplicity",
"=",
"1"
] | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-generator/sculptor-generator-core/src/main/java/org/sculptor/generator/util/DbHelperBase.java#L656-L665 |
102,220 | sculptor/sculptor | sculptor-framework/sculptor-framework-main/src/main/java/org/sculptor/framework/propertyeditor/DateTimeEditor.java | DateTimeEditor.getAsText | public String getAsText() {
DateTime value = (DateTime) getValue();
return (value != null ? value.toString(this.formatter) : "");
} | java | public String getAsText() {
DateTime value = (DateTime) getValue();
return (value != null ? value.toString(this.formatter) : "");
} | [
"public",
"String",
"getAsText",
"(",
")",
"{",
"DateTime",
"value",
"=",
"(",
"DateTime",
")",
"getValue",
"(",
")",
";",
"return",
"(",
"value",
"!=",
"null",
"?",
"value",
".",
"toString",
"(",
"this",
".",
"formatter",
")",
":",
"\"\"",
")",
";",... | Format the DateTime as String, using the specified format. | [
"Format",
"the",
"DateTime",
"as",
"String",
"using",
"the",
"specified",
"format",
"."
] | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-framework/sculptor-framework-main/src/main/java/org/sculptor/framework/propertyeditor/DateTimeEditor.java#L75-L78 |
102,221 | sculptor/sculptor | sculptor-generator/sculptor-generator-core/src/main/java/org/sculptor/generator/util/GenericAccessObjectManager.java | GenericAccessObjectManager.getGenericType | public String getGenericType(RepositoryOperation op) {
GenericAccessObjectStrategy strategy = genericAccessObjectStrategies.get(op.getName());
if (strategy == null) {
return "";
} else {
return strategy.getGenericType(op);
}
} | java | public String getGenericType(RepositoryOperation op) {
GenericAccessObjectStrategy strategy = genericAccessObjectStrategies.get(op.getName());
if (strategy == null) {
return "";
} else {
return strategy.getGenericType(op);
}
} | [
"public",
"String",
"getGenericType",
"(",
"RepositoryOperation",
"op",
")",
"{",
"GenericAccessObjectStrategy",
"strategy",
"=",
"genericAccessObjectStrategies",
".",
"get",
"(",
"op",
".",
"getName",
"(",
")",
")",
";",
"if",
"(",
"strategy",
"==",
"null",
")"... | Get the generic type declaration for generic access objects. | [
"Get",
"the",
"generic",
"type",
"declaration",
"for",
"generic",
"access",
"objects",
"."
] | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-generator/sculptor-generator-core/src/main/java/org/sculptor/generator/util/GenericAccessObjectManager.java#L106-L113 |
102,222 | sculptor/sculptor | sculptor-framework/sculptor-framework-main/src/main/java/org/sculptor/framework/domain/AbstractDomainObject.java | AbstractDomainObject.acceptToString | protected boolean acceptToString(Field field) {
return acceptedToStringTypes.contains(field.getType())
|| acceptedToStringTypes.contains(field.getType().getName());
} | java | protected boolean acceptToString(Field field) {
return acceptedToStringTypes.contains(field.getType())
|| acceptedToStringTypes.contains(field.getType().getName());
} | [
"protected",
"boolean",
"acceptToString",
"(",
"Field",
"field",
")",
"{",
"return",
"acceptedToStringTypes",
".",
"contains",
"(",
"field",
".",
"getType",
"(",
")",
")",
"||",
"acceptedToStringTypes",
".",
"contains",
"(",
"field",
".",
"getType",
"(",
")",
... | Subclasses may override this method to include or exclude some properties
in toString. By default only "simple" types will be included in toString.
Relations to other domain objects can not be included since we don't know
if they are fetched and we don't wont toString to fetch them.
@param field
the field to include i... | [
"Subclasses",
"may",
"override",
"this",
"method",
"to",
"include",
"or",
"exclude",
"some",
"properties",
"in",
"toString",
".",
"By",
"default",
"only",
"simple",
"types",
"will",
"be",
"included",
"in",
"toString",
".",
"Relations",
"to",
"other",
"domain",... | 38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5 | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-framework/sculptor-framework-main/src/main/java/org/sculptor/framework/domain/AbstractDomainObject.java#L113-L116 |
102,223 | jOOQ/jOOU | jOOU-java-6/src/main/java/org/joou/UByte.java | UByte.mkValues | private static final UByte[] mkValues() {
UByte[] ret = new UByte[256];
for (int i = Byte.MIN_VALUE; i <= Byte.MAX_VALUE; i++)
ret[i & MAX_VALUE] = new UByte((byte) i);
return ret;
} | java | private static final UByte[] mkValues() {
UByte[] ret = new UByte[256];
for (int i = Byte.MIN_VALUE; i <= Byte.MAX_VALUE; i++)
ret[i & MAX_VALUE] = new UByte((byte) i);
return ret;
} | [
"private",
"static",
"final",
"UByte",
"[",
"]",
"mkValues",
"(",
")",
"{",
"UByte",
"[",
"]",
"ret",
"=",
"new",
"UByte",
"[",
"256",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"Byte",
".",
"MIN_VALUE",
";",
"i",
"<=",
"Byte",
".",
"MAX_VALUE",
";",... | Generate a cached value for each byte value.
@return Array of cached values for UByte. | [
"Generate",
"a",
"cached",
"value",
"for",
"each",
"byte",
"value",
"."
] | 096ee65b1114e2e93e2eeb28b9328314c5eb273f | https://github.com/jOOQ/jOOU/blob/096ee65b1114e2e93e2eeb28b9328314c5eb273f/jOOU-java-6/src/main/java/org/joou/UByte.java#L74-L81 |
102,224 | jOOQ/jOOU | jOOU-java-6/src/main/java/org/joou/UInteger.java | UInteger.mkValues | private static final UInteger[] mkValues() {
int precacheSize = getPrecacheSize();
UInteger[] ret;
if (precacheSize <= 0)
return null;
ret = new UInteger[precacheSize];
for (int i = 0; i < precacheSize; i++)
ret[i] = new UInteger(i);
return ret;... | java | private static final UInteger[] mkValues() {
int precacheSize = getPrecacheSize();
UInteger[] ret;
if (precacheSize <= 0)
return null;
ret = new UInteger[precacheSize];
for (int i = 0; i < precacheSize; i++)
ret[i] = new UInteger(i);
return ret;... | [
"private",
"static",
"final",
"UInteger",
"[",
"]",
"mkValues",
"(",
")",
"{",
"int",
"precacheSize",
"=",
"getPrecacheSize",
"(",
")",
";",
"UInteger",
"[",
"]",
"ret",
";",
"if",
"(",
"precacheSize",
"<=",
"0",
")",
"return",
"null",
";",
"ret",
"=",... | Generate a cached value for initial unsigned integer values.
@return Array of cached values for UInteger | [
"Generate",
"a",
"cached",
"value",
"for",
"initial",
"unsigned",
"integer",
"values",
"."
] | 096ee65b1114e2e93e2eeb28b9328314c5eb273f | https://github.com/jOOQ/jOOU/blob/096ee65b1114e2e93e2eeb28b9328314c5eb273f/jOOU-java-6/src/main/java/org/joou/UInteger.java#L137-L149 |
102,225 | jOOQ/jOOU | jOOU-java-6/src/main/java/org/joou/UInteger.java | UInteger.getCached | private static UInteger getCached(long value) {
if (VALUES != null && value < VALUES.length)
return VALUES[(int) value];
return null;
} | java | private static UInteger getCached(long value) {
if (VALUES != null && value < VALUES.length)
return VALUES[(int) value];
return null;
} | [
"private",
"static",
"UInteger",
"getCached",
"(",
"long",
"value",
")",
"{",
"if",
"(",
"VALUES",
"!=",
"null",
"&&",
"value",
"<",
"VALUES",
".",
"length",
")",
"return",
"VALUES",
"[",
"(",
"int",
")",
"value",
"]",
";",
"return",
"null",
";",
"}"... | Retrieve a cached value.
@param value Cached value to retrieve
@return Cached value if one exists. Null otherwise. | [
"Retrieve",
"a",
"cached",
"value",
"."
] | 096ee65b1114e2e93e2eeb28b9328314c5eb273f | https://github.com/jOOQ/jOOU/blob/096ee65b1114e2e93e2eeb28b9328314c5eb273f/jOOU-java-6/src/main/java/org/joou/UInteger.java#L170-L175 |
102,226 | jOOQ/jOOU | jOOU-java-6/src/main/java/org/joou/UInteger.java | UInteger.valueOfUnchecked | private static UInteger valueOfUnchecked(long value) {
UInteger cached;
if ((cached = getCached(value)) != null)
return cached;
return new UInteger(value, true);
} | java | private static UInteger valueOfUnchecked(long value) {
UInteger cached;
if ((cached = getCached(value)) != null)
return cached;
return new UInteger(value, true);
} | [
"private",
"static",
"UInteger",
"valueOfUnchecked",
"(",
"long",
"value",
")",
"{",
"UInteger",
"cached",
";",
"if",
"(",
"(",
"cached",
"=",
"getCached",
"(",
"value",
")",
")",
"!=",
"null",
")",
"return",
"cached",
";",
"return",
"new",
"UInteger",
"... | Get the value of a long without checking the value. | [
"Get",
"the",
"value",
"of",
"a",
"long",
"without",
"checking",
"the",
"value",
"."
] | 096ee65b1114e2e93e2eeb28b9328314c5eb273f | https://github.com/jOOQ/jOOU/blob/096ee65b1114e2e93e2eeb28b9328314c5eb273f/jOOU-java-6/src/main/java/org/joou/UInteger.java#L180-L187 |
102,227 | jOOQ/jOOU | jOOU/src/main/java/org/joou/UInteger.java | UInteger.getPrecacheSize | private static final int getPrecacheSize() {
String prop = null;
long propParsed;
try {
prop = System.getProperty(PRECACHE_PROPERTY);
}
catch (SecurityException e) {
// security manager stopped us so use default
// FIXME: should we lo... | java | private static final int getPrecacheSize() {
String prop = null;
long propParsed;
try {
prop = System.getProperty(PRECACHE_PROPERTY);
}
catch (SecurityException e) {
// security manager stopped us so use default
// FIXME: should we lo... | [
"private",
"static",
"final",
"int",
"getPrecacheSize",
"(",
")",
"{",
"String",
"prop",
"=",
"null",
";",
"long",
"propParsed",
";",
"try",
"{",
"prop",
"=",
"System",
".",
"getProperty",
"(",
"PRECACHE_PROPERTY",
")",
";",
"}",
"catch",
"(",
"SecurityExc... | Figure out the size of the precache.
@return The parsed value of the system property
{@link #PRECACHE_PROPERTY} or {@link #DEFAULT_PRECACHE_SIZE} if
the property is not set, not a number or retrieving results in a
{@link SecurityException}. If the parsed value is zero or
negative no cache will be created. If the value... | [
"Figure",
"out",
"the",
"size",
"of",
"the",
"precache",
"."
] | 096ee65b1114e2e93e2eeb28b9328314c5eb273f | https://github.com/jOOQ/jOOU/blob/096ee65b1114e2e93e2eeb28b9328314c5eb273f/jOOU/src/main/java/org/joou/UInteger.java#L92-L130 |
102,228 | jOOQ/jOOU | jOOU/src/main/java/org/joou/UInteger.java | UInteger.readResolve | private Object readResolve() throws ObjectStreamException {
UInteger cached;
// the value read could be invalid so check it
rangeCheck(value);
if ((cached = getCached(value)) != null)
return cached;
return this;
} | java | private Object readResolve() throws ObjectStreamException {
UInteger cached;
// the value read could be invalid so check it
rangeCheck(value);
if ((cached = getCached(value)) != null)
return cached;
return this;
} | [
"private",
"Object",
"readResolve",
"(",
")",
"throws",
"ObjectStreamException",
"{",
"UInteger",
"cached",
";",
"// the value read could be invalid so check it\r",
"rangeCheck",
"(",
"value",
")",
";",
"if",
"(",
"(",
"cached",
"=",
"getCached",
"(",
"value",
")",
... | Replace version read through deserialization with cached version.
@return cached instance of this object's value if one exists, otherwise
this object
@throws ObjectStreamException | [
"Replace",
"version",
"read",
"through",
"deserialization",
"with",
"cached",
"version",
"."
] | 096ee65b1114e2e93e2eeb28b9328314c5eb273f | https://github.com/jOOQ/jOOU/blob/096ee65b1114e2e93e2eeb28b9328314c5eb273f/jOOU/src/main/java/org/joou/UInteger.java#L268-L277 |
102,229 | adessoAG/wicked-charts | highcharts-wrapper/src/main/java/de/adesso/wickedcharts/highcharts/options/color/ColorReference.java | ColorReference.brighten | public ColorReference brighten(final Float brightness) {
ColorReference copy = copy();
if (copy.brightness == null) {
copy.brightness = brightness;
} else {
copy.brightness += brightness;
}
return copy;
} | java | public ColorReference brighten(final Float brightness) {
ColorReference copy = copy();
if (copy.brightness == null) {
copy.brightness = brightness;
} else {
copy.brightness += brightness;
}
return copy;
} | [
"public",
"ColorReference",
"brighten",
"(",
"final",
"Float",
"brightness",
")",
"{",
"ColorReference",
"copy",
"=",
"copy",
"(",
")",
";",
"if",
"(",
"copy",
".",
"brightness",
"==",
"null",
")",
"{",
"copy",
".",
"brightness",
"=",
"brightness",
";",
... | Brightens this color by the amount given. Returns a copy of this color
object not this object itself.
@param brightness
the amount to brighten (between 0 and 1).
@return a copy of this color object, brightened by the given amount. | [
"Brightens",
"this",
"color",
"by",
"the",
"amount",
"given",
".",
"Returns",
"a",
"copy",
"of",
"this",
"color",
"object",
"not",
"this",
"object",
"itself",
"."
] | 498aceff025f612e22ba5135b26531afeabac03c | https://github.com/adessoAG/wicked-charts/blob/498aceff025f612e22ba5135b26531afeabac03c/highcharts-wrapper/src/main/java/de/adesso/wickedcharts/highcharts/options/color/ColorReference.java#L43-L51 |
102,230 | adessoAG/wicked-charts | highcharts-wrapper/src/main/java/de/adesso/wickedcharts/highcharts/options/series/PointSeries.java | PointSeries.addNumberPoint | public PointSeries addNumberPoint(final Number y) {
Point point = new Point(y);
addPoint(point);
return this;
} | java | public PointSeries addNumberPoint(final Number y) {
Point point = new Point(y);
addPoint(point);
return this;
} | [
"public",
"PointSeries",
"addNumberPoint",
"(",
"final",
"Number",
"y",
")",
"{",
"Point",
"point",
"=",
"new",
"Point",
"(",
"y",
")",
";",
"addPoint",
"(",
"point",
")",
";",
"return",
"this",
";",
"}"
] | Adds a point with only a number.
@param y
the number.
@return a PointSeries object with the new Point added | [
"Adds",
"a",
"point",
"with",
"only",
"a",
"number",
"."
] | 498aceff025f612e22ba5135b26531afeabac03c | https://github.com/adessoAG/wicked-charts/blob/498aceff025f612e22ba5135b26531afeabac03c/highcharts-wrapper/src/main/java/de/adesso/wickedcharts/highcharts/options/series/PointSeries.java#L40-L44 |
102,231 | adessoAG/wicked-charts | highcharts-wrapper/src/main/java/de/adesso/wickedcharts/highcharts/options/series/PointSeries.java | PointSeries.addNumbers | public PointSeries addNumbers(final List<Number> values) {
for (Number number : values) {
addNumberPoint(number);
}
return this;
} | java | public PointSeries addNumbers(final List<Number> values) {
for (Number number : values) {
addNumberPoint(number);
}
return this;
} | [
"public",
"PointSeries",
"addNumbers",
"(",
"final",
"List",
"<",
"Number",
">",
"values",
")",
"{",
"for",
"(",
"Number",
"number",
":",
"values",
")",
"{",
"addNumberPoint",
"(",
"number",
")",
";",
"}",
"return",
"this",
";",
"}"
] | Adds a list of point with only numbers.
@param values
the number values to add.
@return a PointSeries object with the new points added to it | [
"Adds",
"a",
"list",
"of",
"point",
"with",
"only",
"numbers",
"."
] | 498aceff025f612e22ba5135b26531afeabac03c | https://github.com/adessoAG/wicked-charts/blob/498aceff025f612e22ba5135b26531afeabac03c/highcharts-wrapper/src/main/java/de/adesso/wickedcharts/highcharts/options/series/PointSeries.java#L54-L59 |
102,232 | adessoAG/wicked-charts | showcase/wicked-charts-showcase-wicket14/src/main/java/de/adesso/wickedcharts/showcase/HomepageHighcharts.java | HomepageHighcharts.addCodeContainer | private void addCodeContainer(Chart chart) {
Label codeContainer = new Label("code", new StringFromResourceModel(
chart.getOptions().getClass(), chart.getOptions().getClass().getSimpleName()
+ ".java"));
codeContainer.setOutputMarkupId(true);
add(codeContainer);
... | java | private void addCodeContainer(Chart chart) {
Label codeContainer = new Label("code", new StringFromResourceModel(
chart.getOptions().getClass(), chart.getOptions().getClass().getSimpleName()
+ ".java"));
codeContainer.setOutputMarkupId(true);
add(codeContainer);
... | [
"private",
"void",
"addCodeContainer",
"(",
"Chart",
"chart",
")",
"{",
"Label",
"codeContainer",
"=",
"new",
"Label",
"(",
"\"code\"",
",",
"new",
"StringFromResourceModel",
"(",
"chart",
".",
"getOptions",
"(",
")",
".",
"getClass",
"(",
")",
",",
"chart",... | Adds a code container corresponding to the current chart
@param chart The currently selected chart | [
"Adds",
"a",
"code",
"container",
"corresponding",
"to",
"the",
"current",
"chart"
] | 498aceff025f612e22ba5135b26531afeabac03c | https://github.com/adessoAG/wicked-charts/blob/498aceff025f612e22ba5135b26531afeabac03c/showcase/wicked-charts-showcase-wicket14/src/main/java/de/adesso/wickedcharts/showcase/HomepageHighcharts.java#L114-L120 |
102,233 | adessoAG/wicked-charts | wicket/wicked-charts-wicket8/src/main/java/de/adesso/wickedcharts/wicket8/highcharts/Chart.java | Chart.setTheme | public void setTheme(final Theme theme) {
if (this.themeReference != null || this.themeUrl != null) {
throw new IllegalStateException(
"A theme can only be defined once. Calling different setTheme methods is not allowed!");
}
this.theme = theme;
} | java | public void setTheme(final Theme theme) {
if (this.themeReference != null || this.themeUrl != null) {
throw new IllegalStateException(
"A theme can only be defined once. Calling different setTheme methods is not allowed!");
}
this.theme = theme;
} | [
"public",
"void",
"setTheme",
"(",
"final",
"Theme",
"theme",
")",
"{",
"if",
"(",
"this",
".",
"themeReference",
"!=",
"null",
"||",
"this",
".",
"themeUrl",
"!=",
"null",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"A theme can only be defined ... | Sets the theme for this chart by specifying a theme class.
A theme can only be set via one setTheme method. An
{@link IllegalStateException} will be thrown if you call two setTheme
methods.
@param theme the theme class. | [
"Sets",
"the",
"theme",
"for",
"this",
"chart",
"by",
"specifying",
"a",
"theme",
"class",
"."
] | 498aceff025f612e22ba5135b26531afeabac03c | https://github.com/adessoAG/wicked-charts/blob/498aceff025f612e22ba5135b26531afeabac03c/wicket/wicked-charts-wicket8/src/main/java/de/adesso/wickedcharts/wicket8/highcharts/Chart.java#L149-L155 |
102,234 | adessoAG/wicked-charts | wicket/wicked-charts-wicket6/src/main/java/de/adesso/wickedcharts/wicket6/JavaScriptExpressionSendingAjaxBehavior.java | JavaScriptExpressionSendingAjaxBehavior.getVariableValue | protected StringValue getVariableValue(String parameterName) {
RequestCycle cycle = RequestCycle.get();
WebRequest webRequest = (WebRequest) cycle.getRequest();
StringValue value = webRequest.getRequestParameters().getParameterValue(parameterName);
return value;
} | java | protected StringValue getVariableValue(String parameterName) {
RequestCycle cycle = RequestCycle.get();
WebRequest webRequest = (WebRequest) cycle.getRequest();
StringValue value = webRequest.getRequestParameters().getParameterValue(parameterName);
return value;
} | [
"protected",
"StringValue",
"getVariableValue",
"(",
"String",
"parameterName",
")",
"{",
"RequestCycle",
"cycle",
"=",
"RequestCycle",
".",
"get",
"(",
")",
";",
"WebRequest",
"webRequest",
"=",
"(",
"WebRequest",
")",
"cycle",
".",
"getRequest",
"(",
")",
";... | Reads the value of the given javascript variable from the AJAX request.
@param parameterName the parameter name of the javascript expression whose value to
read. The parameterName must have been specified earlier when
calling {@link #addJavaScriptValue(String, String)}.
@return the string representation of the javascr... | [
"Reads",
"the",
"value",
"of",
"the",
"given",
"javascript",
"variable",
"from",
"the",
"AJAX",
"request",
"."
] | 498aceff025f612e22ba5135b26531afeabac03c | https://github.com/adessoAG/wicked-charts/blob/498aceff025f612e22ba5135b26531afeabac03c/wicket/wicked-charts-wicket6/src/main/java/de/adesso/wickedcharts/wicket6/JavaScriptExpressionSendingAjaxBehavior.java#L44-L49 |
102,235 | adessoAG/wicked-charts | highcharts-wrapper/src/main/java/de/adesso/wickedcharts/highcharts/options/CssStyle.java | CssStyle.setProperty | public CssStyle setProperty(final String key, final String value) {
if (this.properties == null) {
this.properties = new HashMap<String, String>();
}
this.properties.put(sanitizeCssPropertyName(key), value);
return this;
} | java | public CssStyle setProperty(final String key, final String value) {
if (this.properties == null) {
this.properties = new HashMap<String, String>();
}
this.properties.put(sanitizeCssPropertyName(key), value);
return this;
} | [
"public",
"CssStyle",
"setProperty",
"(",
"final",
"String",
"key",
",",
"final",
"String",
"value",
")",
"{",
"if",
"(",
"this",
".",
"properties",
"==",
"null",
")",
"{",
"this",
".",
"properties",
"=",
"new",
"HashMap",
"<",
"String",
",",
"String",
... | Sets a CSS property.
@param key
the name of the property. Note that hyphen notation ("-") is
automatically converted into camel case notation since the
property name is used as key in a JSON object. Highcharts will
evaluate it as if it were hyphen notation.
@param value
the value of the CSS property.
@return this for ... | [
"Sets",
"a",
"CSS",
"property",
"."
] | 498aceff025f612e22ba5135b26531afeabac03c | https://github.com/adessoAG/wicked-charts/blob/498aceff025f612e22ba5135b26531afeabac03c/highcharts-wrapper/src/main/java/de/adesso/wickedcharts/highcharts/options/CssStyle.java#L66-L72 |
102,236 | adessoAG/wicked-charts | highcharts-wrapper/src/main/java/de/adesso/wickedcharts/highcharts/options/CssStyle.java | CssStyle.sanitizeCssPropertyName | private String sanitizeCssPropertyName(final String propertyName) {
if (!propertyName.contains("-")) {
return propertyName;
} else {
String sanitized = propertyName;
int index = sanitized.indexOf('-');
while (index != -1) {
String charToBeReplaced = sanitized.substring(index + 1,... | java | private String sanitizeCssPropertyName(final String propertyName) {
if (!propertyName.contains("-")) {
return propertyName;
} else {
String sanitized = propertyName;
int index = sanitized.indexOf('-');
while (index != -1) {
String charToBeReplaced = sanitized.substring(index + 1,... | [
"private",
"String",
"sanitizeCssPropertyName",
"(",
"final",
"String",
"propertyName",
")",
"{",
"if",
"(",
"!",
"propertyName",
".",
"contains",
"(",
"\"-\"",
")",
")",
"{",
"return",
"propertyName",
";",
"}",
"else",
"{",
"String",
"sanitized",
"=",
"prop... | Replaces hyphen notation with camel case notation.
@param propertyName
the name of the CSS property to sanitize
@return the sanitized CSS property name | [
"Replaces",
"hyphen",
"notation",
"with",
"camel",
"case",
"notation",
"."
] | 498aceff025f612e22ba5135b26531afeabac03c | https://github.com/adessoAG/wicked-charts/blob/498aceff025f612e22ba5135b26531afeabac03c/highcharts-wrapper/src/main/java/de/adesso/wickedcharts/highcharts/options/CssStyle.java#L81-L95 |
102,237 | adessoAG/wicked-charts | showcase/wicked-charts-showcase-wicket15/src/main/java/de/adesso/wickedcharts/showcase/HomepageHighcharts.java | HomepageHighcharts.getSelectedTab | private int getSelectedTab() {
String theme = "default";
List<PageParameters.NamedPair> pairs = getPageParameters().getAllNamed();
theme = pairs.get(0).getValue();
if ("grid".equals(theme)) {
return 1;
} else if ("skies".equals(theme)) {
return 2;
... | java | private int getSelectedTab() {
String theme = "default";
List<PageParameters.NamedPair> pairs = getPageParameters().getAllNamed();
theme = pairs.get(0).getValue();
if ("grid".equals(theme)) {
return 1;
} else if ("skies".equals(theme)) {
return 2;
... | [
"private",
"int",
"getSelectedTab",
"(",
")",
"{",
"String",
"theme",
"=",
"\"default\"",
";",
"List",
"<",
"PageParameters",
".",
"NamedPair",
">",
"pairs",
"=",
"getPageParameters",
"(",
")",
".",
"getAllNamed",
"(",
")",
";",
"theme",
"=",
"pairs",
".",... | Used in the renderHead method to highlight the currently
selected theme tab
@return the index of the currently selected theme tab | [
"Used",
"in",
"the",
"renderHead",
"method",
"to",
"highlight",
"the",
"currently",
"selected",
"theme",
"tab"
] | 498aceff025f612e22ba5135b26531afeabac03c | https://github.com/adessoAG/wicked-charts/blob/498aceff025f612e22ba5135b26531afeabac03c/showcase/wicked-charts-showcase-wicket15/src/main/java/de/adesso/wickedcharts/showcase/HomepageHighcharts.java#L412-L429 |
102,238 | adessoAG/wicked-charts | showcase/wicked-charts-showcase-options/src/main/java/de/adesso/wickedcharts/showcase/options/highcharts/base/DonutOptions.java | DonutOptions.getBrowserData | private List<BrowserUsageData> getBrowserData() {
List<BrowserUsageData> browserData = new ArrayList<BrowserUsageData>();
browserData
.add(getMSIEUsageData());
browserData
.add(getFirefoxUsageData());
browserData
.add(getChromeUsageData());
browserData
.add(getSafariU... | java | private List<BrowserUsageData> getBrowserData() {
List<BrowserUsageData> browserData = new ArrayList<BrowserUsageData>();
browserData
.add(getMSIEUsageData());
browserData
.add(getFirefoxUsageData());
browserData
.add(getChromeUsageData());
browserData
.add(getSafariU... | [
"private",
"List",
"<",
"BrowserUsageData",
">",
"getBrowserData",
"(",
")",
"{",
"List",
"<",
"BrowserUsageData",
">",
"browserData",
"=",
"new",
"ArrayList",
"<",
"BrowserUsageData",
">",
"(",
")",
";",
"browserData",
".",
"add",
"(",
"getMSIEUsageData",
"("... | Creates the data displayed in the donut chart. | [
"Creates",
"the",
"data",
"displayed",
"in",
"the",
"donut",
"chart",
"."
] | 498aceff025f612e22ba5135b26531afeabac03c | https://github.com/adessoAG/wicked-charts/blob/498aceff025f612e22ba5135b26531afeabac03c/showcase/wicked-charts-showcase-options/src/main/java/de/adesso/wickedcharts/showcase/options/highcharts/base/DonutOptions.java#L181-L194 |
102,239 | adessoAG/wicked-charts | showcase/wicked-charts-showcase-options/src/main/java/de/adesso/wickedcharts/showcase/options/highcharts/base/DonutOptions.java | DonutOptions.getChromeUsageData | private BrowserUsageData getChromeUsageData() {
BrowserUsageData data = new BrowserUsageData();
data
.setBrowserName("Chrome");
data
.setMarketShare(11.94f);
ColorReference chromeColor = new HighchartsColor(2);
data
.setColor(chromeColor);
data
.getVersionUsageDat... | java | private BrowserUsageData getChromeUsageData() {
BrowserUsageData data = new BrowserUsageData();
data
.setBrowserName("Chrome");
data
.setMarketShare(11.94f);
ColorReference chromeColor = new HighchartsColor(2);
data
.setColor(chromeColor);
data
.getVersionUsageDat... | [
"private",
"BrowserUsageData",
"getChromeUsageData",
"(",
")",
"{",
"BrowserUsageData",
"data",
"=",
"new",
"BrowserUsageData",
"(",
")",
";",
"data",
".",
"setBrowserName",
"(",
"\"Chrome\"",
")",
";",
"data",
".",
"setMarketShare",
"(",
"11.94f",
")",
";",
"... | Creates the Chrome data. | [
"Creates",
"the",
"Chrome",
"data",
"."
] | 498aceff025f612e22ba5135b26531afeabac03c | https://github.com/adessoAG/wicked-charts/blob/498aceff025f612e22ba5135b26531afeabac03c/showcase/wicked-charts-showcase-options/src/main/java/de/adesso/wickedcharts/showcase/options/highcharts/base/DonutOptions.java#L199-L249 |
102,240 | adessoAG/wicked-charts | showcase/wicked-charts-showcase-options/src/main/java/de/adesso/wickedcharts/showcase/options/highcharts/base/DonutOptions.java | DonutOptions.getFirefoxUsageData | private BrowserUsageData getFirefoxUsageData() {
BrowserUsageData data = new BrowserUsageData();
data
.setBrowserName("Firefox");
data
.setMarketShare(21.63f);
ColorReference ffColor = new HighchartsColor(1);
data
.setColor(ffColor);
data
.getVersionUsageData()
... | java | private BrowserUsageData getFirefoxUsageData() {
BrowserUsageData data = new BrowserUsageData();
data
.setBrowserName("Firefox");
data
.setMarketShare(21.63f);
ColorReference ffColor = new HighchartsColor(1);
data
.setColor(ffColor);
data
.getVersionUsageData()
... | [
"private",
"BrowserUsageData",
"getFirefoxUsageData",
"(",
")",
"{",
"BrowserUsageData",
"data",
"=",
"new",
"BrowserUsageData",
"(",
")",
";",
"data",
".",
"setBrowserName",
"(",
"\"Firefox\"",
")",
";",
"data",
".",
"setMarketShare",
"(",
"21.63f",
")",
";",
... | Creates the Firefox data. | [
"Creates",
"the",
"Firefox",
"data",
"."
] | 498aceff025f612e22ba5135b26531afeabac03c | https://github.com/adessoAG/wicked-charts/blob/498aceff025f612e22ba5135b26531afeabac03c/showcase/wicked-charts-showcase-options/src/main/java/de/adesso/wickedcharts/showcase/options/highcharts/base/DonutOptions.java#L254-L281 |
102,241 | adessoAG/wicked-charts | showcase/wicked-charts-showcase-options/src/main/java/de/adesso/wickedcharts/showcase/options/highcharts/base/DonutOptions.java | DonutOptions.getMSIEUsageData | private BrowserUsageData getMSIEUsageData() {
BrowserUsageData data = new BrowserUsageData();
data
.setBrowserName("MSIE");
data
.setMarketShare(55.11f);
ColorReference ieColor = new HighchartsColor(0);
data
.setColor(ieColor);
data
.getVersionUsageData()
... | java | private BrowserUsageData getMSIEUsageData() {
BrowserUsageData data = new BrowserUsageData();
data
.setBrowserName("MSIE");
data
.setMarketShare(55.11f);
ColorReference ieColor = new HighchartsColor(0);
data
.setColor(ieColor);
data
.getVersionUsageData()
... | [
"private",
"BrowserUsageData",
"getMSIEUsageData",
"(",
")",
"{",
"BrowserUsageData",
"data",
"=",
"new",
"BrowserUsageData",
"(",
")",
";",
"data",
".",
"setBrowserName",
"(",
"\"MSIE\"",
")",
";",
"data",
".",
"setMarketShare",
"(",
"55.11f",
")",
";",
"Colo... | Creates the Internet Explorer data. | [
"Creates",
"the",
"Internet",
"Explorer",
"data",
"."
] | 498aceff025f612e22ba5135b26531afeabac03c | https://github.com/adessoAG/wicked-charts/blob/498aceff025f612e22ba5135b26531afeabac03c/showcase/wicked-charts-showcase-options/src/main/java/de/adesso/wickedcharts/showcase/options/highcharts/base/DonutOptions.java#L286-L308 |
102,242 | adessoAG/wicked-charts | showcase/wicked-charts-showcase-options/src/main/java/de/adesso/wickedcharts/showcase/options/highcharts/base/DonutOptions.java | DonutOptions.getOperaUsageData | private BrowserUsageData getOperaUsageData() {
BrowserUsageData data = new BrowserUsageData();
data
.setBrowserName("Opera");
data
.setMarketShare(2.14f);
ColorReference operaColor = new HighchartsColor(4);
data
.setColor(operaColor);
data
.getVersionUsageData()
... | java | private BrowserUsageData getOperaUsageData() {
BrowserUsageData data = new BrowserUsageData();
data
.setBrowserName("Opera");
data
.setMarketShare(2.14f);
ColorReference operaColor = new HighchartsColor(4);
data
.setColor(operaColor);
data
.getVersionUsageData()
... | [
"private",
"BrowserUsageData",
"getOperaUsageData",
"(",
")",
"{",
"BrowserUsageData",
"data",
"=",
"new",
"BrowserUsageData",
"(",
")",
";",
"data",
".",
"setBrowserName",
"(",
"\"Opera\"",
")",
";",
"data",
".",
"setMarketShare",
"(",
"2.14f",
")",
";",
"Col... | Creates the Opera data. | [
"Creates",
"the",
"Opera",
"data",
"."
] | 498aceff025f612e22ba5135b26531afeabac03c | https://github.com/adessoAG/wicked-charts/blob/498aceff025f612e22ba5135b26531afeabac03c/showcase/wicked-charts-showcase-options/src/main/java/de/adesso/wickedcharts/showcase/options/highcharts/base/DonutOptions.java#L313-L338 |
102,243 | adessoAG/wicked-charts | showcase/wicked-charts-showcase-options/src/main/java/de/adesso/wickedcharts/showcase/options/highcharts/base/DonutOptions.java | DonutOptions.getSafariUsageData | private BrowserUsageData getSafariUsageData() {
BrowserUsageData data = new BrowserUsageData();
data
.setBrowserName("Safari");
data
.setMarketShare(7.15f);
ColorReference safariColor = new HighchartsColor(3);
data
.setColor(safariColor);
data
.getVersionUsageData... | java | private BrowserUsageData getSafariUsageData() {
BrowserUsageData data = new BrowserUsageData();
data
.setBrowserName("Safari");
data
.setMarketShare(7.15f);
ColorReference safariColor = new HighchartsColor(3);
data
.setColor(safariColor);
data
.getVersionUsageData... | [
"private",
"BrowserUsageData",
"getSafariUsageData",
"(",
")",
"{",
"BrowserUsageData",
"data",
"=",
"new",
"BrowserUsageData",
"(",
")",
";",
"data",
".",
"setBrowserName",
"(",
"\"Safari\"",
")",
";",
"data",
".",
"setMarketShare",
"(",
"7.15f",
")",
";",
"C... | Creates the Safari data. | [
"Creates",
"the",
"Safari",
"data",
"."
] | 498aceff025f612e22ba5135b26531afeabac03c | https://github.com/adessoAG/wicked-charts/blob/498aceff025f612e22ba5135b26531afeabac03c/showcase/wicked-charts-showcase-options/src/main/java/de/adesso/wickedcharts/showcase/options/highcharts/base/DonutOptions.java#L343-L388 |
102,244 | adessoAG/wicked-charts | showcase/wicked-charts-showcase-wicket7/src/main/java/de/adesso/wickedcharts/showcase/HomepageHighcharts.java | HomepageHighcharts.renderHead | @Override
public void renderHead(final IHeaderResponse response) {
// select bootstrap tab for current theme selected
int selectedTab = this.getSelectedTab();
response.render(OnDomReadyHeaderItem.forScript("$('#themes li:eq("
+ selectedTab + ") a').tab('show');"));
} | java | @Override
public void renderHead(final IHeaderResponse response) {
// select bootstrap tab for current theme selected
int selectedTab = this.getSelectedTab();
response.render(OnDomReadyHeaderItem.forScript("$('#themes li:eq("
+ selectedTab + ") a').tab('show');"));
} | [
"@",
"Override",
"public",
"void",
"renderHead",
"(",
"final",
"IHeaderResponse",
"response",
")",
"{",
"// select bootstrap tab for current theme selected",
"int",
"selectedTab",
"=",
"this",
".",
"getSelectedTab",
"(",
")",
";",
"response",
".",
"render",
"(",
"On... | Highlights the currently selected theme tab
@param response . | [
"Highlights",
"the",
"currently",
"selected",
"theme",
"tab"
] | 498aceff025f612e22ba5135b26531afeabac03c | https://github.com/adessoAG/wicked-charts/blob/498aceff025f612e22ba5135b26531afeabac03c/showcase/wicked-charts-showcase-wicket7/src/main/java/de/adesso/wickedcharts/showcase/HomepageHighcharts.java#L452-L458 |
102,245 | adessoAG/wicked-charts | highcharts-wrapper/src/main/java/de/adesso/wickedcharts/highcharts/jackson/JsonRenderer.java | JsonRenderer.addSerializer | public <T> void addSerializer(final Class<T> clazz, final JsonSerializer<T> serializer) {
this.jacksonModule.addSerializer(clazz, serializer);
} | java | public <T> void addSerializer(final Class<T> clazz, final JsonSerializer<T> serializer) {
this.jacksonModule.addSerializer(clazz, serializer);
} | [
"public",
"<",
"T",
">",
"void",
"addSerializer",
"(",
"final",
"Class",
"<",
"T",
">",
"clazz",
",",
"final",
"JsonSerializer",
"<",
"T",
">",
"serializer",
")",
"{",
"this",
".",
"jacksonModule",
".",
"addSerializer",
"(",
"clazz",
",",
"serializer",
"... | This method gives the opportunity to add a custom serializer to serializer
one of the highchart option classes. It may be neccessary to serialize
certain option classes differently for different web frameworks.
@param clazz the option class
@param serializer the serializer responsible for serializing objects of t... | [
"This",
"method",
"gives",
"the",
"opportunity",
"to",
"add",
"a",
"custom",
"serializer",
"to",
"serializer",
"one",
"of",
"the",
"highchart",
"option",
"classes",
".",
"It",
"may",
"be",
"neccessary",
"to",
"serialize",
"certain",
"option",
"classes",
"diffe... | 498aceff025f612e22ba5135b26531afeabac03c | https://github.com/adessoAG/wicked-charts/blob/498aceff025f612e22ba5135b26531afeabac03c/highcharts-wrapper/src/main/java/de/adesso/wickedcharts/highcharts/jackson/JsonRenderer.java#L65-L67 |
102,246 | adessoAG/wicked-charts | highcharts-wrapper/src/main/java/de/adesso/wickedcharts/highcharts/options/series/Series.java | Series.addPoint | public Series<D> addPoint(final D point) {
if (this.data == null) {
this.data = new ArrayList<D>();
}
this.data.add(point);
return this;
} | java | public Series<D> addPoint(final D point) {
if (this.data == null) {
this.data = new ArrayList<D>();
}
this.data.add(point);
return this;
} | [
"public",
"Series",
"<",
"D",
">",
"addPoint",
"(",
"final",
"D",
"point",
")",
"{",
"if",
"(",
"this",
".",
"data",
"==",
"null",
")",
"{",
"this",
".",
"data",
"=",
"new",
"ArrayList",
"<",
"D",
">",
"(",
")",
";",
"}",
"this",
".",
"data",
... | Adds a point to this series.
@param point
the point to add.
@return a Series of points with the new point added to it | [
"Adds",
"a",
"point",
"to",
"this",
"series",
"."
] | 498aceff025f612e22ba5135b26531afeabac03c | https://github.com/adessoAG/wicked-charts/blob/498aceff025f612e22ba5135b26531afeabac03c/highcharts-wrapper/src/main/java/de/adesso/wickedcharts/highcharts/options/series/Series.java#L112-L118 |
102,247 | adessoAG/wicked-charts | highcharts-wrapper/src/main/java/de/adesso/wickedcharts/highcharts/options/util/OptionsUtil.java | OptionsUtil.setRenderTo | public void setRenderTo(final Options options, final String renderTo) {
if (options.getChartOptions() == null) {
options.setChartOptions(new ChartOptions());
}
options.getChartOptions().setRenderTo(renderTo);
} | java | public void setRenderTo(final Options options, final String renderTo) {
if (options.getChartOptions() == null) {
options.setChartOptions(new ChartOptions());
}
options.getChartOptions().setRenderTo(renderTo);
} | [
"public",
"void",
"setRenderTo",
"(",
"final",
"Options",
"options",
",",
"final",
"String",
"renderTo",
")",
"{",
"if",
"(",
"options",
".",
"getChartOptions",
"(",
")",
"==",
"null",
")",
"{",
"options",
".",
"setChartOptions",
"(",
"new",
"ChartOptions",
... | Null-safe setter for the renderTo configuration.
@param options the Options object to set the renderTo of
@param renderTo the render target | [
"Null",
"-",
"safe",
"setter",
"for",
"the",
"renderTo",
"configuration",
"."
] | 498aceff025f612e22ba5135b26531afeabac03c | https://github.com/adessoAG/wicked-charts/blob/498aceff025f612e22ba5135b26531afeabac03c/highcharts-wrapper/src/main/java/de/adesso/wickedcharts/highcharts/options/util/OptionsUtil.java#L56-L61 |
102,248 | adessoAG/wicked-charts | highcharts-wrapper/src/main/java/de/adesso/wickedcharts/highcharts/options/util/OptionsUtil.java | OptionsUtil.needsFunnelJs | public static boolean needsFunnelJs(final Options options) {
return
options.getChart() != null &&
(options.getChart().getType() == SeriesType.FUNNEL ||
options.getChart().getType() == SeriesType.PYRAMID);
} | java | public static boolean needsFunnelJs(final Options options) {
return
options.getChart() != null &&
(options.getChart().getType() == SeriesType.FUNNEL ||
options.getChart().getType() == SeriesType.PYRAMID);
} | [
"public",
"static",
"boolean",
"needsFunnelJs",
"(",
"final",
"Options",
"options",
")",
"{",
"return",
"options",
".",
"getChart",
"(",
")",
"!=",
"null",
"&&",
"(",
"options",
".",
"getChart",
"(",
")",
".",
"getType",
"(",
")",
"==",
"SeriesType",
"."... | Checks if the specified Options object needs the javascript file
"funnel.js" to work properly. This method can be called by GUI
components to determine whether the javascript file has to be included in
the page or not.
@param options the {@link Options} object to analyze
@return true, if "funnel.js" is needed to rende... | [
"Checks",
"if",
"the",
"specified",
"Options",
"object",
"needs",
"the",
"javascript",
"file",
"funnel",
".",
"js",
"to",
"work",
"properly",
".",
"This",
"method",
"can",
"be",
"called",
"by",
"GUI",
"components",
"to",
"determine",
"whether",
"the",
"javas... | 498aceff025f612e22ba5135b26531afeabac03c | https://github.com/adessoAG/wicked-charts/blob/498aceff025f612e22ba5135b26531afeabac03c/highcharts-wrapper/src/main/java/de/adesso/wickedcharts/highcharts/options/util/OptionsUtil.java#L102-L107 |
102,249 | adessoAG/wicked-charts | highcharts-wrapper/src/main/java/de/adesso/wickedcharts/highcharts/options/util/OptionsUtil.java | OptionsUtil.needsHeatmapJs | public static boolean needsHeatmapJs(final Options options) {
return
options.getChart() != null &&
(options.getChart().getType() == SeriesType.HEATMAP);
} | java | public static boolean needsHeatmapJs(final Options options) {
return
options.getChart() != null &&
(options.getChart().getType() == SeriesType.HEATMAP);
} | [
"public",
"static",
"boolean",
"needsHeatmapJs",
"(",
"final",
"Options",
"options",
")",
"{",
"return",
"options",
".",
"getChart",
"(",
")",
"!=",
"null",
"&&",
"(",
"options",
".",
"getChart",
"(",
")",
".",
"getType",
"(",
")",
"==",
"SeriesType",
".... | Checks if the specified Options object needs the javascript file
"heatmap.js" to work properly. This method can be called by GUI
components to determine whether the javascript file has to be included in
the page or not.
@param options the {@link Options} object to analyze
@return true, if "funnel.js" is needed to rend... | [
"Checks",
"if",
"the",
"specified",
"Options",
"object",
"needs",
"the",
"javascript",
"file",
"heatmap",
".",
"js",
"to",
"work",
"properly",
".",
"This",
"method",
"can",
"be",
"called",
"by",
"GUI",
"components",
"to",
"determine",
"whether",
"the",
"java... | 498aceff025f612e22ba5135b26531afeabac03c | https://github.com/adessoAG/wicked-charts/blob/498aceff025f612e22ba5135b26531afeabac03c/highcharts-wrapper/src/main/java/de/adesso/wickedcharts/highcharts/options/util/OptionsUtil.java#L119-L123 |
102,250 | adessoAG/wicked-charts | highcharts-wrapper/src/main/java/de/adesso/wickedcharts/highcharts/options/util/OptionsUtil.java | OptionsUtil.needsExportingJs | public static boolean needsExportingJs(final Options options) {
// when no ExportingOptions are set, they are enabled by default, hence
// return true when they are null
return options.getExporting() == null
|| (options.getExporting().getEnabled() != null && options.getExporting(... | java | public static boolean needsExportingJs(final Options options) {
// when no ExportingOptions are set, they are enabled by default, hence
// return true when they are null
return options.getExporting() == null
|| (options.getExporting().getEnabled() != null && options.getExporting(... | [
"public",
"static",
"boolean",
"needsExportingJs",
"(",
"final",
"Options",
"options",
")",
"{",
"// when no ExportingOptions are set, they are enabled by default, hence",
"// return true when they are null",
"return",
"options",
".",
"getExporting",
"(",
")",
"==",
"null",
"... | Checks if the specified Options object needs the javascript file
"exporting.js" to work properly. This method can be called by GUI
components to determine whether the javascript file has to be included in
the page or not.
@param options the {@link Options} object to analyze
@return true, if "exporting.js" is needed to... | [
"Checks",
"if",
"the",
"specified",
"Options",
"object",
"needs",
"the",
"javascript",
"file",
"exporting",
".",
"js",
"to",
"work",
"properly",
".",
"This",
"method",
"can",
"be",
"called",
"by",
"GUI",
"components",
"to",
"determine",
"whether",
"the",
"ja... | 498aceff025f612e22ba5135b26531afeabac03c | https://github.com/adessoAG/wicked-charts/blob/498aceff025f612e22ba5135b26531afeabac03c/highcharts-wrapper/src/main/java/de/adesso/wickedcharts/highcharts/options/util/OptionsUtil.java#L135-L140 |
102,251 | adessoAG/wicked-charts | showcase/wicked-charts-showcase-wicket8/src/main/java/de/adesso/wickedcharts/showcase/HomepageChartJs.java | HomepageChartJs.addCharts | private void addCharts(PageParameters parameters){
List<Chart> charts = getChartFromParams(parameters);
//If we have more than one chart - use SmallComponents
if(charts.size() > 1){
List<SmallChartComponent> components = new ArrayList<>();
for(Chart i : charts){
... | java | private void addCharts(PageParameters parameters){
List<Chart> charts = getChartFromParams(parameters);
//If we have more than one chart - use SmallComponents
if(charts.size() > 1){
List<SmallChartComponent> components = new ArrayList<>();
for(Chart i : charts){
... | [
"private",
"void",
"addCharts",
"(",
"PageParameters",
"parameters",
")",
"{",
"List",
"<",
"Chart",
">",
"charts",
"=",
"getChartFromParams",
"(",
"parameters",
")",
";",
"//If we have more than one chart - use SmallComponents",
"if",
"(",
"charts",
".",
"size",
"(... | Gets the charts and the code containers from the page parameters,
constructs Wicket componenets from them and
adds them to a Wicket ListView.
@param parameters the page parameters from the page URI | [
"Gets",
"the",
"charts",
"and",
"the",
"code",
"containers",
"from",
"the",
"page",
"parameters",
"constructs",
"Wicket",
"componenets",
"from",
"them",
"and",
"adds",
"them",
"to",
"a",
"Wicket",
"ListView",
"."
] | 498aceff025f612e22ba5135b26531afeabac03c | https://github.com/adessoAG/wicked-charts/blob/498aceff025f612e22ba5135b26531afeabac03c/showcase/wicked-charts-showcase-wicket8/src/main/java/de/adesso/wickedcharts/showcase/HomepageChartJs.java#L67-L106 |
102,252 | andrewoma/dexx | collection/src/main/java/com/github/andrewoma/dexx/collection/internal/redblack/RedBlackTree.java | RedBlackTree.compareDepth | @SuppressWarnings("unchecked")
private Zipper<K, V> compareDepth(Tree<K, V> left, Tree<K, V> right) {
return unzipBoth(left, right, (List<Tree<K, V>>) Collections.EMPTY_LIST, (List<Tree<K, V>>) Collections.EMPTY_LIST, 0);
} | java | @SuppressWarnings("unchecked")
private Zipper<K, V> compareDepth(Tree<K, V> left, Tree<K, V> right) {
return unzipBoth(left, right, (List<Tree<K, V>>) Collections.EMPTY_LIST, (List<Tree<K, V>>) Collections.EMPTY_LIST, 0);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"Zipper",
"<",
"K",
",",
"V",
">",
"compareDepth",
"(",
"Tree",
"<",
"K",
",",
"V",
">",
"left",
",",
"Tree",
"<",
"K",
",",
"V",
">",
"right",
")",
"{",
"return",
"unzipBoth",
"(",
"le... | If the trees were balanced, returns an empty zipper | [
"If",
"the",
"trees",
"were",
"balanced",
"returns",
"an",
"empty",
"zipper"
] | 96755b325e90c84ffa006365dde9ddf89c83c6ca | https://github.com/andrewoma/dexx/blob/96755b325e90c84ffa006365dde9ddf89c83c6ca/collection/src/main/java/com/github/andrewoma/dexx/collection/internal/redblack/RedBlackTree.java#L466-L469 |
102,253 | andrewoma/dexx | collection/src/main/java/com/github/andrewoma/dexx/collection/internal/redblack/RedBlackTree.java | RedBlackTree.unzip | private List<Tree<K, V>> unzip(List<Tree<K, V>> zipper, boolean leftMost) {
Tree<K, V> next = leftMost ? zipper.get(0).getLeft() : zipper.get(0).getRight();
if (next == null)
return zipper;
return unzip(cons(next, zipper), leftMost);
} | java | private List<Tree<K, V>> unzip(List<Tree<K, V>> zipper, boolean leftMost) {
Tree<K, V> next = leftMost ? zipper.get(0).getLeft() : zipper.get(0).getRight();
if (next == null)
return zipper;
return unzip(cons(next, zipper), leftMost);
} | [
"private",
"List",
"<",
"Tree",
"<",
"K",
",",
"V",
">",
">",
"unzip",
"(",
"List",
"<",
"Tree",
"<",
"K",
",",
"V",
">",
">",
"zipper",
",",
"boolean",
"leftMost",
")",
"{",
"Tree",
"<",
"K",
",",
"V",
">",
"next",
"=",
"leftMost",
"?",
"zip... | Once a side is found to be deeper, unzip it to the bottom | [
"Once",
"a",
"side",
"is",
"found",
"to",
"be",
"deeper",
"unzip",
"it",
"to",
"the",
"bottom"
] | 96755b325e90c84ffa006365dde9ddf89c83c6ca | https://github.com/andrewoma/dexx/blob/96755b325e90c84ffa006365dde9ddf89c83c6ca/collection/src/main/java/com/github/andrewoma/dexx/collection/internal/redblack/RedBlackTree.java#L472-L478 |
102,254 | andrewoma/dexx | collection/src/main/java/com/github/andrewoma/dexx/collection/internal/redblack/RedBlackTree.java | RedBlackTree.unzipBoth | @SuppressWarnings("unchecked")
private Zipper<K, V> unzipBoth(Tree<K, V> left, Tree<K, V> right, List<Tree<K, V>> leftZipper, List<Tree<K, V>> rightZipper, int smallerDepth) {
if (isBlackTree(left) && isBlackTree(right)) {
return unzipBoth(left.getRight(), right.getLeft(), cons(left, leftZipper)... | java | @SuppressWarnings("unchecked")
private Zipper<K, V> unzipBoth(Tree<K, V> left, Tree<K, V> right, List<Tree<K, V>> leftZipper, List<Tree<K, V>> rightZipper, int smallerDepth) {
if (isBlackTree(left) && isBlackTree(right)) {
return unzipBoth(left.getRight(), right.getLeft(), cons(left, leftZipper)... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"Zipper",
"<",
"K",
",",
"V",
">",
"unzipBoth",
"(",
"Tree",
"<",
"K",
",",
"V",
">",
"left",
",",
"Tree",
"<",
"K",
",",
"V",
">",
"right",
",",
"List",
"<",
"Tree",
"<",
"K",
",",
... | found to be deeper, or the bottom is reached | [
"found",
"to",
"be",
"deeper",
"or",
"the",
"bottom",
"is",
"reached"
] | 96755b325e90c84ffa006365dde9ddf89c83c6ca | https://github.com/andrewoma/dexx/blob/96755b325e90c84ffa006365dde9ddf89c83c6ca/collection/src/main/java/com/github/andrewoma/dexx/collection/internal/redblack/RedBlackTree.java#L490-L509 |
102,255 | andrewoma/dexx | collection/src/main/java/com/github/andrewoma/dexx/collection/Vector.java | Vector.get | @Override
public E get(int index) {
int idx = checkRangeConvert(index);
return pointer.getElem(idx, idx ^ focus);
} | java | @Override
public E get(int index) {
int idx = checkRangeConvert(index);
return pointer.getElem(idx, idx ^ focus);
} | [
"@",
"Override",
"public",
"E",
"get",
"(",
"int",
"index",
")",
"{",
"int",
"idx",
"=",
"checkRangeConvert",
"(",
"index",
")",
";",
"return",
"pointer",
".",
"getElem",
"(",
"idx",
",",
"idx",
"^",
"focus",
")",
";",
"}"
] | with local variables exclusively. But we're not quite there yet ... | [
"with",
"local",
"variables",
"exclusively",
".",
"But",
"we",
"re",
"not",
"quite",
"there",
"yet",
"..."
] | 96755b325e90c84ffa006365dde9ddf89c83c6ca | https://github.com/andrewoma/dexx/blob/96755b325e90c84ffa006365dde9ddf89c83c6ca/collection/src/main/java/com/github/andrewoma/dexx/collection/Vector.java#L109-L113 |
102,256 | andrewoma/dexx | collection/src/main/java/com/github/andrewoma/dexx/collection/Vector.java | Vector.cleanLeftEdge | private void cleanLeftEdge(int cutIndex) {
if (cutIndex < (1 << 5)) {
zeroLeft(pointer.display0, cutIndex);
} else if (cutIndex < (1 << 10)) {
zeroLeft(pointer.display0, cutIndex & 0x1f);
pointer.display1 = copyRight(pointer.display1, (cutIndex >>> 5));
} else... | java | private void cleanLeftEdge(int cutIndex) {
if (cutIndex < (1 << 5)) {
zeroLeft(pointer.display0, cutIndex);
} else if (cutIndex < (1 << 10)) {
zeroLeft(pointer.display0, cutIndex & 0x1f);
pointer.display1 = copyRight(pointer.display1, (cutIndex >>> 5));
} else... | [
"private",
"void",
"cleanLeftEdge",
"(",
"int",
"cutIndex",
")",
"{",
"if",
"(",
"cutIndex",
"<",
"(",
"1",
"<<",
"5",
")",
")",
"{",
"zeroLeft",
"(",
"pointer",
".",
"display0",
",",
"cutIndex",
")",
";",
"}",
"else",
"if",
"(",
"cutIndex",
"<",
"... | requires structure is at index cutIndex and writable at level 0 | [
"requires",
"structure",
"is",
"at",
"index",
"cutIndex",
"and",
"writable",
"at",
"level",
"0"
] | 96755b325e90c84ffa006365dde9ddf89c83c6ca | https://github.com/andrewoma/dexx/blob/96755b325e90c84ffa006365dde9ddf89c83c6ca/collection/src/main/java/com/github/andrewoma/dexx/collection/Vector.java#L447-L478 |
102,257 | andrewoma/dexx | collection/src/main/java/com/github/andrewoma/dexx/collection/Vector.java | VectorPointer.getElem | @SuppressWarnings("unchecked")
public E getElem(int index, int xor) {
if (xor < (1 << 5)) { // level = 0
return (E) display0[index & 31];
} else if (xor < (1 << 10)) { // level = 1
return (E) ((Object[]) display1[(index >> 5) & 31])[index & 31];
} else if (xor < (1 <<... | java | @SuppressWarnings("unchecked")
public E getElem(int index, int xor) {
if (xor < (1 << 5)) { // level = 0
return (E) display0[index & 31];
} else if (xor < (1 << 10)) { // level = 1
return (E) ((Object[]) display1[(index >> 5) & 31])[index & 31];
} else if (xor < (1 <<... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"E",
"getElem",
"(",
"int",
"index",
",",
"int",
"xor",
")",
"{",
"if",
"(",
"xor",
"<",
"(",
"1",
"<<",
"5",
")",
")",
"{",
"// level = 0",
"return",
"(",
"E",
")",
"display0",
"[",
"in... | requires structure is at pos oldIndex = xor ^ index | [
"requires",
"structure",
"is",
"at",
"pos",
"oldIndex",
"=",
"xor",
"^",
"index"
] | 96755b325e90c84ffa006365dde9ddf89c83c6ca | https://github.com/andrewoma/dexx/blob/96755b325e90c84ffa006365dde9ddf89c83c6ca/collection/src/main/java/com/github/andrewoma/dexx/collection/Vector.java#L671-L688 |
102,258 | andrewoma/dexx | collection/src/main/java/com/github/andrewoma/dexx/collection/Vector.java | VectorPointer.stabilize | public void stabilize(int index) {
switch (depth - 1) {
case 5:
display5 = copyOf(display5);
display4 = copyOf(display4);
display3 = copyOf(display3);
display2 = copyOf(display2);
display1 = copyOf(display1);
... | java | public void stabilize(int index) {
switch (depth - 1) {
case 5:
display5 = copyOf(display5);
display4 = copyOf(display4);
display3 = copyOf(display3);
display2 = copyOf(display2);
display1 = copyOf(display1);
... | [
"public",
"void",
"stabilize",
"(",
"int",
"index",
")",
"{",
"switch",
"(",
"depth",
"-",
"1",
")",
"{",
"case",
"5",
":",
"display5",
"=",
"copyOf",
"(",
"display5",
")",
";",
"display4",
"=",
"copyOf",
"(",
"display4",
")",
";",
"display3",
"=",
... | ensures structure is clean and at pos index and writable at all levels except 0 | [
"ensures",
"structure",
"is",
"clean",
"and",
"at",
"pos",
"index",
"and",
"writable",
"at",
"all",
"levels",
"except",
"0"
] | 96755b325e90c84ffa006365dde9ddf89c83c6ca | https://github.com/andrewoma/dexx/blob/96755b325e90c84ffa006365dde9ddf89c83c6ca/collection/src/main/java/com/github/andrewoma/dexx/collection/Vector.java#L834-L879 |
102,259 | andrewoma/dexx | collection/src/main/java/com/github/andrewoma/dexx/collection/Vector.java | VectorPointer.copyRange | public Object[] copyRange(Object[] array, int oldLeft, int newLeft) {
Object[] elems = new Object[32];
System.arraycopy(array, oldLeft, elems, newLeft, 32 - Math.max(newLeft, oldLeft));
return elems;
} | java | public Object[] copyRange(Object[] array, int oldLeft, int newLeft) {
Object[] elems = new Object[32];
System.arraycopy(array, oldLeft, elems, newLeft, 32 - Math.max(newLeft, oldLeft));
return elems;
} | [
"public",
"Object",
"[",
"]",
"copyRange",
"(",
"Object",
"[",
"]",
"array",
",",
"int",
"oldLeft",
",",
"int",
"newLeft",
")",
"{",
"Object",
"[",
"]",
"elems",
"=",
"new",
"Object",
"[",
"32",
"]",
";",
"System",
".",
"arraycopy",
"(",
"array",
"... | USED IN DROP | [
"USED",
"IN",
"DROP"
] | 96755b325e90c84ffa006365dde9ddf89c83c6ca | https://github.com/andrewoma/dexx/blob/96755b325e90c84ffa006365dde9ddf89c83c6ca/collection/src/main/java/com/github/andrewoma/dexx/collection/Vector.java#L987-L991 |
102,260 | f2prateek/progressbutton | progressbutton-samples/src/main/java/com/f2prateek/progressbutton/samples/MainActivity.java | MainActivity.updateProgressButton | private void updateProgressButton(ProgressButton progressButton, SeekBar progressSeekBar) {
progressButton.setProgress(progressSeekBar.getProgress());
updatePinProgressContentDescription(progressButton);
} | java | private void updateProgressButton(ProgressButton progressButton, SeekBar progressSeekBar) {
progressButton.setProgress(progressSeekBar.getProgress());
updatePinProgressContentDescription(progressButton);
} | [
"private",
"void",
"updateProgressButton",
"(",
"ProgressButton",
"progressButton",
",",
"SeekBar",
"progressSeekBar",
")",
"{",
"progressButton",
".",
"setProgress",
"(",
"progressSeekBar",
".",
"getProgress",
"(",
")",
")",
";",
"updatePinProgressContentDescription",
... | Helper method to update the progressButton's progress and it's
content description. | [
"Helper",
"method",
"to",
"update",
"the",
"progressButton",
"s",
"progress",
"and",
"it",
"s",
"content",
"description",
"."
] | ca47a9676173cdab5b2d8063a947ed2cc3c7641d | https://github.com/f2prateek/progressbutton/blob/ca47a9676173cdab5b2d8063a947ed2cc3c7641d/progressbutton-samples/src/main/java/com/f2prateek/progressbutton/samples/MainActivity.java#L149-L152 |
102,261 | f2prateek/progressbutton | progressbutton-samples/src/main/java/com/f2prateek/progressbutton/samples/MainActivity.java | MainActivity.updatePinProgressContentDescription | private void updatePinProgressContentDescription(ProgressButton button) {
int progress = button.getProgress();
if (progress <= 0) {
button.setContentDescription(getString(
button.isChecked() ? R.string.content_desc_pinned_not_downloaded
: R.string.content_desc_unpinned_not_download... | java | private void updatePinProgressContentDescription(ProgressButton button) {
int progress = button.getProgress();
if (progress <= 0) {
button.setContentDescription(getString(
button.isChecked() ? R.string.content_desc_pinned_not_downloaded
: R.string.content_desc_unpinned_not_download... | [
"private",
"void",
"updatePinProgressContentDescription",
"(",
"ProgressButton",
"button",
")",
"{",
"int",
"progress",
"=",
"button",
".",
"getProgress",
"(",
")",
";",
"if",
"(",
"progress",
"<=",
"0",
")",
"{",
"button",
".",
"setContentDescription",
"(",
"... | Helper method to update the progressButton's content description. | [
"Helper",
"method",
"to",
"update",
"the",
"progressButton",
"s",
"content",
"description",
"."
] | ca47a9676173cdab5b2d8063a947ed2cc3c7641d | https://github.com/f2prateek/progressbutton/blob/ca47a9676173cdab5b2d8063a947ed2cc3c7641d/progressbutton-samples/src/main/java/com/f2prateek/progressbutton/samples/MainActivity.java#L157-L172 |
102,262 | f2prateek/progressbutton | progressbutton-samples/src/main/java/com/f2prateek/progressbutton/samples/MainActivity.java | MainActivity.addProgressButton | private ProgressButton addProgressButton(LinearLayout container) {
final LinearLayout.LayoutParams layoutParams =
new LinearLayout.LayoutParams(0, LinearLayout.LayoutParams.WRAP_CONTENT, 1.0f);
final ProgressButton progressButton = new ProgressButton(this);
progressButton.setLayoutParams(layoutParam... | java | private ProgressButton addProgressButton(LinearLayout container) {
final LinearLayout.LayoutParams layoutParams =
new LinearLayout.LayoutParams(0, LinearLayout.LayoutParams.WRAP_CONTENT, 1.0f);
final ProgressButton progressButton = new ProgressButton(this);
progressButton.setLayoutParams(layoutParam... | [
"private",
"ProgressButton",
"addProgressButton",
"(",
"LinearLayout",
"container",
")",
"{",
"final",
"LinearLayout",
".",
"LayoutParams",
"layoutParams",
"=",
"new",
"LinearLayout",
".",
"LayoutParams",
"(",
"0",
",",
"LinearLayout",
".",
"LayoutParams",
".",
"WRA... | Helper function that creates a new progress button, adds it to the given layout.
Returns a reference to the progress button for customization. | [
"Helper",
"function",
"that",
"creates",
"a",
"new",
"progress",
"button",
"adds",
"it",
"to",
"the",
"given",
"layout",
".",
"Returns",
"a",
"reference",
"to",
"the",
"progress",
"button",
"for",
"customization",
"."
] | ca47a9676173cdab5b2d8063a947ed2cc3c7641d | https://github.com/f2prateek/progressbutton/blob/ca47a9676173cdab5b2d8063a947ed2cc3c7641d/progressbutton-samples/src/main/java/com/f2prateek/progressbutton/samples/MainActivity.java#L178-L185 |
102,263 | f2prateek/progressbutton | progressbutton/src/main/java/com/f2prateek/progressbutton/ProgressButton.java | ProgressButton.setMax | public void setMax(int max) {
if (max <= 0 || max < mProgress) {
throw new IllegalArgumentException(
String.format("Max (%d) must be > 0 and >= %d", max, mProgress));
}
mMax = max;
invalidate();
} | java | public void setMax(int max) {
if (max <= 0 || max < mProgress) {
throw new IllegalArgumentException(
String.format("Max (%d) must be > 0 and >= %d", max, mProgress));
}
mMax = max;
invalidate();
} | [
"public",
"void",
"setMax",
"(",
"int",
"max",
")",
"{",
"if",
"(",
"max",
"<=",
"0",
"||",
"max",
"<",
"mProgress",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"String",
".",
"format",
"(",
"\"Max (%d) must be > 0 and >= %d\"",
",",
"max",
... | Sets the maximum progress value. Defaults to 100. | [
"Sets",
"the",
"maximum",
"progress",
"value",
".",
"Defaults",
"to",
"100",
"."
] | ca47a9676173cdab5b2d8063a947ed2cc3c7641d | https://github.com/f2prateek/progressbutton/blob/ca47a9676173cdab5b2d8063a947ed2cc3c7641d/progressbutton/src/main/java/com/f2prateek/progressbutton/ProgressButton.java#L191-L198 |
102,264 | f2prateek/progressbutton | progressbutton/src/main/java/com/f2prateek/progressbutton/ProgressButton.java | ProgressButton.setProgressAndMax | public void setProgressAndMax(int progress, int max) {
if (progress > max || progress < 0) {
throw new IllegalArgumentException(
String.format("Progress (%d) must be between %d and %d", progress, 0, max));
} else if (max <= 0) {
throw new IllegalArgumentException(String.format("Max (%d) mu... | java | public void setProgressAndMax(int progress, int max) {
if (progress > max || progress < 0) {
throw new IllegalArgumentException(
String.format("Progress (%d) must be between %d and %d", progress, 0, max));
} else if (max <= 0) {
throw new IllegalArgumentException(String.format("Max (%d) mu... | [
"public",
"void",
"setProgressAndMax",
"(",
"int",
"progress",
",",
"int",
"max",
")",
"{",
"if",
"(",
"progress",
">",
"max",
"||",
"progress",
"<",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"String",
".",
"format",
"(",
"\"Progress ... | Sets the current progress and maximum progress value, both of which
must be valid values.
@see #setMax(int)
@see #setProgress(int) | [
"Sets",
"the",
"current",
"progress",
"and",
"maximum",
"progress",
"value",
"both",
"of",
"which",
"must",
"be",
"valid",
"values",
"."
] | ca47a9676173cdab5b2d8063a947ed2cc3c7641d | https://github.com/f2prateek/progressbutton/blob/ca47a9676173cdab5b2d8063a947ed2cc3c7641d/progressbutton/src/main/java/com/f2prateek/progressbutton/ProgressButton.java#L226-L237 |
102,265 | simplifycom/ink-android | ink/src/main/java/com/simplify/ink/InkView.java | InkView.setMaxStrokeWidth | public void setMaxStrokeWidth(float width) {
maxStrokeWidth = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, width, getResources().getDisplayMetrics());
} | java | public void setMaxStrokeWidth(float width) {
maxStrokeWidth = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, width, getResources().getDisplayMetrics());
} | [
"public",
"void",
"setMaxStrokeWidth",
"(",
"float",
"width",
")",
"{",
"maxStrokeWidth",
"=",
"TypedValue",
".",
"applyDimension",
"(",
"TypedValue",
".",
"COMPLEX_UNIT_DIP",
",",
"width",
",",
"getResources",
"(",
")",
".",
"getDisplayMetrics",
"(",
")",
")",
... | Sets the maximum stroke width
@param width The width (in dp) | [
"Sets",
"the",
"maximum",
"stroke",
"width"
] | 1a365e656b496554e7ee2e735bb775367f5eac0b | https://github.com/simplifycom/ink-android/blob/1a365e656b496554e7ee2e735bb775367f5eac0b/ink/src/main/java/com/simplify/ink/InkView.java#L343-L345 |
102,266 | simplifycom/ink-android | ink/src/main/java/com/simplify/ink/InkView.java | InkView.setMinStrokeWidth | public void setMinStrokeWidth(float width) {
minStrokeWidth = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, width, getResources().getDisplayMetrics());
} | java | public void setMinStrokeWidth(float width) {
minStrokeWidth = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, width, getResources().getDisplayMetrics());
} | [
"public",
"void",
"setMinStrokeWidth",
"(",
"float",
"width",
")",
"{",
"minStrokeWidth",
"=",
"TypedValue",
".",
"applyDimension",
"(",
"TypedValue",
".",
"COMPLEX_UNIT_DIP",
",",
"width",
",",
"getResources",
"(",
")",
".",
"getDisplayMetrics",
"(",
")",
")",
... | Sets the minimum stroke width
@param width The width (in dp) | [
"Sets",
"the",
"minimum",
"stroke",
"width"
] | 1a365e656b496554e7ee2e735bb775367f5eac0b | https://github.com/simplifycom/ink-android/blob/1a365e656b496554e7ee2e735bb775367f5eac0b/ink/src/main/java/com/simplify/ink/InkView.java#L352-L354 |
102,267 | simplifycom/ink-android | ink/src/main/java/com/simplify/ink/InkView.java | InkView.clear | public void clear() {
// clean up existing bitmap
if (bitmap != null) {
bitmap.recycle();
}
// init bitmap cache
bitmap = Bitmap.createBitmap(getWidth(), getHeight(), Bitmap.Config.ARGB_8888);
canvas = new Canvas(bitmap);
// notify listeners
... | java | public void clear() {
// clean up existing bitmap
if (bitmap != null) {
bitmap.recycle();
}
// init bitmap cache
bitmap = Bitmap.createBitmap(getWidth(), getHeight(), Bitmap.Config.ARGB_8888);
canvas = new Canvas(bitmap);
// notify listeners
... | [
"public",
"void",
"clear",
"(",
")",
"{",
"// clean up existing bitmap",
"if",
"(",
"bitmap",
"!=",
"null",
")",
"{",
"bitmap",
".",
"recycle",
"(",
")",
";",
"}",
"// init bitmap cache",
"bitmap",
"=",
"Bitmap",
".",
"createBitmap",
"(",
"getWidth",
"(",
... | Clears the view | [
"Clears",
"the",
"view"
] | 1a365e656b496554e7ee2e735bb775367f5eac0b | https://github.com/simplifycom/ink-android/blob/1a365e656b496554e7ee2e735bb775367f5eac0b/ink/src/main/java/com/simplify/ink/InkView.java#L387-L404 |
102,268 | simplifycom/ink-android | ink/src/main/java/com/simplify/ink/InkView.java | InkView.getBitmap | public Bitmap getBitmap(int backgroundColor) {
// create new bitmap
Bitmap bitmap = Bitmap.createBitmap(getWidth(), getHeight(), Bitmap.Config.ARGB_8888);
Canvas bitmapCanvas = new Canvas(bitmap);
// draw background if not transparent
if (backgroundColor != 0) {
bitm... | java | public Bitmap getBitmap(int backgroundColor) {
// create new bitmap
Bitmap bitmap = Bitmap.createBitmap(getWidth(), getHeight(), Bitmap.Config.ARGB_8888);
Canvas bitmapCanvas = new Canvas(bitmap);
// draw background if not transparent
if (backgroundColor != 0) {
bitm... | [
"public",
"Bitmap",
"getBitmap",
"(",
"int",
"backgroundColor",
")",
"{",
"// create new bitmap",
"Bitmap",
"bitmap",
"=",
"Bitmap",
".",
"createBitmap",
"(",
"getWidth",
"(",
")",
",",
"getHeight",
"(",
")",
",",
"Bitmap",
".",
"Config",
".",
"ARGB_8888",
"... | Returns the bitmap of the drawing with the specified background color
@param backgroundColor The background color for the bitmap
@return The bitmap | [
"Returns",
"the",
"bitmap",
"of",
"the",
"drawing",
"with",
"the",
"specified",
"background",
"color"
] | 1a365e656b496554e7ee2e735bb775367f5eac0b | https://github.com/simplifycom/ink-android/blob/1a365e656b496554e7ee2e735bb775367f5eac0b/ink/src/main/java/com/simplify/ink/InkView.java#L421-L435 |
102,269 | jsurfer/JsonSurfer | jsurfer-core/src/main/java/org/jsfr/json/JsonSurfer.java | JsonSurfer.createNonBlockingParser | public NonBlockingParser createNonBlockingParser(SurfingConfiguration configuration) {
ensureSetting(configuration);
return jsonParserAdapter.createNonBlockingParser(new SurfingContext(configuration));
} | java | public NonBlockingParser createNonBlockingParser(SurfingConfiguration configuration) {
ensureSetting(configuration);
return jsonParserAdapter.createNonBlockingParser(new SurfingContext(configuration));
} | [
"public",
"NonBlockingParser",
"createNonBlockingParser",
"(",
"SurfingConfiguration",
"configuration",
")",
"{",
"ensureSetting",
"(",
"configuration",
")",
";",
"return",
"jsonParserAdapter",
".",
"createNonBlockingParser",
"(",
"new",
"SurfingContext",
"(",
"configuratio... | Create non-blocking parser
@param configuration
@return | [
"Create",
"non",
"-",
"blocking",
"parser"
] | 52bd75a453338b86e115092803da140bf99cee62 | https://github.com/jsurfer/JsonSurfer/blob/52bd75a453338b86e115092803da140bf99cee62/jsurfer-core/src/main/java/org/jsfr/json/JsonSurfer.java#L249-L252 |
102,270 | orientechnologies/orientdb-gremlin | driver/src/main/java/org/apache/tinkerpop/gremlin/orientdb/OrientGraphFactory.java | OrientGraphFactory.setupPool | public OrientGraphBaseFactory setupPool(final int max) {
pool = new OPartitionedReCreatableDatabasePool(this.factory, dbName, user, password, max);
return this;
} | java | public OrientGraphBaseFactory setupPool(final int max) {
pool = new OPartitionedReCreatableDatabasePool(this.factory, dbName, user, password, max);
return this;
} | [
"public",
"OrientGraphBaseFactory",
"setupPool",
"(",
"final",
"int",
"max",
")",
"{",
"pool",
"=",
"new",
"OPartitionedReCreatableDatabasePool",
"(",
"this",
".",
"factory",
",",
"dbName",
",",
"user",
",",
"password",
",",
"max",
")",
";",
"return",
"this",
... | Setting up the factory to use database pool instead of creation a new
instance of database connection each time. | [
"Setting",
"up",
"the",
"factory",
"to",
"use",
"database",
"pool",
"instead",
"of",
"creation",
"a",
"new",
"instance",
"of",
"database",
"connection",
"each",
"time",
"."
] | 94549ee82431dd3b4c53a1aedb4b5107e4763b71 | https://github.com/orientechnologies/orientdb-gremlin/blob/94549ee82431dd3b4c53a1aedb4b5107e4763b71/driver/src/main/java/org/apache/tinkerpop/gremlin/orientdb/OrientGraphFactory.java#L196-L199 |
102,271 | orientechnologies/orientdb-gremlin | driver/src/main/java/org/apache/tinkerpop/gremlin/orientdb/OrientGraphFactory.java | OrientGraphFactory.close | public void close() {
if (pool != null)
pool.close();
pool = null;
if (shouldCloseOrientDB) {
factory.close();
}
} | java | public void close() {
if (pool != null)
pool.close();
pool = null;
if (shouldCloseOrientDB) {
factory.close();
}
} | [
"public",
"void",
"close",
"(",
")",
"{",
"if",
"(",
"pool",
"!=",
"null",
")",
"pool",
".",
"close",
"(",
")",
";",
"pool",
"=",
"null",
";",
"if",
"(",
"shouldCloseOrientDB",
")",
"{",
"factory",
".",
"close",
"(",
")",
";",
"}",
"}"
] | Closes all pooled databases and clear the pool. | [
"Closes",
"all",
"pooled",
"databases",
"and",
"clear",
"the",
"pool",
"."
] | 94549ee82431dd3b4c53a1aedb4b5107e4763b71 | https://github.com/orientechnologies/orientdb-gremlin/blob/94549ee82431dd3b4c53a1aedb4b5107e4763b71/driver/src/main/java/org/apache/tinkerpop/gremlin/orientdb/OrientGraphFactory.java#L213-L221 |
102,272 | orientechnologies/orientdb-gremlin | driver/src/main/java/org/apache/tinkerpop/gremlin/orientdb/traversal/step/sideEffect/OrientGraphStep.java | OrientGraphStep.findClassLabelsInHasContainers | private Set<String> findClassLabelsInHasContainers() {
Set<String> classLabels = new HashSet<>();
HasContainer container = this.hasContainers.stream().filter(hasContainer -> isLabelKey(hasContainer.getKey())).findFirst()
.orElseGet(() -> {
String defaultClass = Vertex.class.isAssignableFrom(g... | java | private Set<String> findClassLabelsInHasContainers() {
Set<String> classLabels = new HashSet<>();
HasContainer container = this.hasContainers.stream().filter(hasContainer -> isLabelKey(hasContainer.getKey())).findFirst()
.orElseGet(() -> {
String defaultClass = Vertex.class.isAssignableFrom(g... | [
"private",
"Set",
"<",
"String",
">",
"findClassLabelsInHasContainers",
"(",
")",
"{",
"Set",
"<",
"String",
">",
"classLabels",
"=",
"new",
"HashSet",
"<>",
"(",
")",
";",
"HasContainer",
"container",
"=",
"this",
".",
"hasContainers",
".",
"stream",
"(",
... | if one of the HasContainers is a label matching predicate, then return those labels | [
"if",
"one",
"of",
"the",
"HasContainers",
"is",
"a",
"label",
"matching",
"predicate",
"then",
"return",
"those",
"labels"
] | 94549ee82431dd3b4c53a1aedb4b5107e4763b71 | https://github.com/orientechnologies/orientdb-gremlin/blob/94549ee82431dd3b4c53a1aedb4b5107e4763b71/driver/src/main/java/org/apache/tinkerpop/gremlin/orientdb/traversal/step/sideEffect/OrientGraphStep.java#L104-L124 |
102,273 | orientechnologies/orientdb-gremlin | driver/src/main/java/org/apache/tinkerpop/gremlin/orientdb/traversal/step/sideEffect/OrientGraphStep.java | OrientGraphStep.getValueIterator | private Iterator<Object> getValueIterator(HasContainer c) {
return c.getPredicate().getBiPredicate() == Contains.within ?
((Iterable<Object>) c.getValue()).iterator() :
IteratorUtils.of(c.getValue());
} | java | private Iterator<Object> getValueIterator(HasContainer c) {
return c.getPredicate().getBiPredicate() == Contains.within ?
((Iterable<Object>) c.getValue()).iterator() :
IteratorUtils.of(c.getValue());
} | [
"private",
"Iterator",
"<",
"Object",
">",
"getValueIterator",
"(",
"HasContainer",
"c",
")",
"{",
"return",
"c",
".",
"getPredicate",
"(",
")",
".",
"getBiPredicate",
"(",
")",
"==",
"Contains",
".",
"within",
"?",
"(",
"(",
"Iterable",
"<",
"Object",
"... | gets the requested values from the Has step. If it's a single value, wrap it in an array, otherwise return the array | [
"gets",
"the",
"requested",
"values",
"from",
"the",
"Has",
"step",
".",
"If",
"it",
"s",
"a",
"single",
"value",
"wrap",
"it",
"in",
"an",
"array",
"otherwise",
"return",
"the",
"array"
] | 94549ee82431dd3b4c53a1aedb4b5107e4763b71 | https://github.com/orientechnologies/orientdb-gremlin/blob/94549ee82431dd3b4c53a1aedb4b5107e4763b71/driver/src/main/java/org/apache/tinkerpop/gremlin/orientdb/traversal/step/sideEffect/OrientGraphStep.java#L177-L181 |
102,274 | nvanbenschoten/motion | motion/src/main/java/com/nvanbenschoten/motion/ParallaxImageView.java | ParallaxImageView.registerSensorManager | public void registerSensorManager(int samplingPeriodUs) {
if (getContext() == null || mSensorManager != null) return;
// Acquires a sensor manager
mSensorManager = (SensorManager) getContext().getSystemService(Context.SENSOR_SERVICE);
if (mSensorManager != null) {
mSensorMa... | java | public void registerSensorManager(int samplingPeriodUs) {
if (getContext() == null || mSensorManager != null) return;
// Acquires a sensor manager
mSensorManager = (SensorManager) getContext().getSystemService(Context.SENSOR_SERVICE);
if (mSensorManager != null) {
mSensorMa... | [
"public",
"void",
"registerSensorManager",
"(",
"int",
"samplingPeriodUs",
")",
"{",
"if",
"(",
"getContext",
"(",
")",
"==",
"null",
"||",
"mSensorManager",
"!=",
"null",
")",
"return",
";",
"// Acquires a sensor manager",
"mSensorManager",
"=",
"(",
"SensorManag... | Registers a sensor manager with the parallax ImageView. Should be called in onResume
or onStart lifecycle callbacks from an Activity or Fragment.
@param samplingPeriodUs the sensor sampling period rate | [
"Registers",
"a",
"sensor",
"manager",
"with",
"the",
"parallax",
"ImageView",
".",
"Should",
"be",
"called",
"in",
"onResume",
"or",
"onStart",
"lifecycle",
"callbacks",
"from",
"an",
"Activity",
"or",
"Fragment",
"."
] | 152208310d5e61009416b7c2f48ff8ca2464942f | https://github.com/nvanbenschoten/motion/blob/152208310d5e61009416b7c2f48ff8ca2464942f/motion/src/main/java/com/nvanbenschoten/motion/ParallaxImageView.java#L145-L156 |
102,275 | nvanbenschoten/motion | motion/src/main/java/com/nvanbenschoten/motion/ParallaxImageView.java | ParallaxImageView.unregisterSensorManager | public void unregisterSensorManager(boolean resetTranslation) {
if (mSensorManager == null || mSensorInterpreter == null) return;
mSensorManager.unregisterListener(this);
mSensorManager = null;
mSensorInterpreter.reset();
if (resetTranslation) {
setTranslate(0, 0);
... | java | public void unregisterSensorManager(boolean resetTranslation) {
if (mSensorManager == null || mSensorInterpreter == null) return;
mSensorManager.unregisterListener(this);
mSensorManager = null;
mSensorInterpreter.reset();
if (resetTranslation) {
setTranslate(0, 0);
... | [
"public",
"void",
"unregisterSensorManager",
"(",
"boolean",
"resetTranslation",
")",
"{",
"if",
"(",
"mSensorManager",
"==",
"null",
"||",
"mSensorInterpreter",
"==",
"null",
")",
"return",
";",
"mSensorManager",
".",
"unregisterListener",
"(",
"this",
")",
";",
... | Unregisters the ParallaxImageView's SensorManager. Should be called in onPause from
an Activity or Fragment to avoid continuing sensor usage.
@param resetTranslation if the image translation should be reset to the origin | [
"Unregisters",
"the",
"ParallaxImageView",
"s",
"SensorManager",
".",
"Should",
"be",
"called",
"in",
"onPause",
"from",
"an",
"Activity",
"or",
"Fragment",
"to",
"avoid",
"continuing",
"sensor",
"usage",
"."
] | 152208310d5e61009416b7c2f48ff8ca2464942f | https://github.com/nvanbenschoten/motion/blob/152208310d5e61009416b7c2f48ff8ca2464942f/motion/src/main/java/com/nvanbenschoten/motion/ParallaxImageView.java#L172-L182 |
102,276 | nvanbenschoten/motion | motion/src/main/java/com/nvanbenschoten/motion/ParallaxImageView.java | ParallaxImageView.setTranslate | private void setTranslate(float x, float y) {
if (Math.abs(x) > 1 || Math.abs(y) > 1) {
throw new IllegalArgumentException("Parallax effect cannot translate more than 100% of its off-screen size");
}
float xScale, yScale;
if (mScaledIntensities) {
// Set both sc... | java | private void setTranslate(float x, float y) {
if (Math.abs(x) > 1 || Math.abs(y) > 1) {
throw new IllegalArgumentException("Parallax effect cannot translate more than 100% of its off-screen size");
}
float xScale, yScale;
if (mScaledIntensities) {
// Set both sc... | [
"private",
"void",
"setTranslate",
"(",
"float",
"x",
",",
"float",
"y",
")",
"{",
"if",
"(",
"Math",
".",
"abs",
"(",
"x",
")",
">",
"1",
"||",
"Math",
".",
"abs",
"(",
"y",
")",
">",
"1",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(... | Sets the image view's translation coordinates. These values must be between -1 and 1,
representing the transaction percentage from the center.
@param x the horizontal translation
@param y the vertical translation | [
"Sets",
"the",
"image",
"view",
"s",
"translation",
"coordinates",
".",
"These",
"values",
"must",
"be",
"between",
"-",
"1",
"and",
"1",
"representing",
"the",
"transaction",
"percentage",
"from",
"the",
"center",
"."
] | 152208310d5e61009416b7c2f48ff8ca2464942f | https://github.com/nvanbenschoten/motion/blob/152208310d5e61009416b7c2f48ff8ca2464942f/motion/src/main/java/com/nvanbenschoten/motion/ParallaxImageView.java#L237-L275 |
102,277 | nvanbenschoten/motion | motion/src/main/java/com/nvanbenschoten/motion/ParallaxImageView.java | ParallaxImageView.configureMatrix | private void configureMatrix() {
if (getDrawable() == null || getWidth() == 0 || getHeight() == 0) return;
int dWidth = getDrawable().getIntrinsicWidth();
int dHeight = getDrawable().getIntrinsicHeight();
int vWidth = getWidth();
int vHeight = getHeight();
float scale;
... | java | private void configureMatrix() {
if (getDrawable() == null || getWidth() == 0 || getHeight() == 0) return;
int dWidth = getDrawable().getIntrinsicWidth();
int dHeight = getDrawable().getIntrinsicHeight();
int vWidth = getWidth();
int vHeight = getHeight();
float scale;
... | [
"private",
"void",
"configureMatrix",
"(",
")",
"{",
"if",
"(",
"getDrawable",
"(",
")",
"==",
"null",
"||",
"getWidth",
"(",
")",
"==",
"0",
"||",
"getHeight",
"(",
")",
"==",
"0",
")",
"return",
";",
"int",
"dWidth",
"=",
"getDrawable",
"(",
")",
... | Configures the ImageView's imageMatrix to allow for movement of the
source image. | [
"Configures",
"the",
"ImageView",
"s",
"imageMatrix",
"to",
"allow",
"for",
"movement",
"of",
"the",
"source",
"image",
"."
] | 152208310d5e61009416b7c2f48ff8ca2464942f | https://github.com/nvanbenschoten/motion/blob/152208310d5e61009416b7c2f48ff8ca2464942f/motion/src/main/java/com/nvanbenschoten/motion/ParallaxImageView.java#L281-L309 |
102,278 | TomasMikula/EasyBind | src/main/java/org/fxmisc/easybind/EasyBind.java | EasyBind.monadic | public static <T> MonadicObservableValue<T> monadic(ObservableValue<T> o) {
if(o instanceof MonadicObservableValue) {
return (MonadicObservableValue<T>) o;
} else {
return new MonadicWrapper<>(o);
}
} | java | public static <T> MonadicObservableValue<T> monadic(ObservableValue<T> o) {
if(o instanceof MonadicObservableValue) {
return (MonadicObservableValue<T>) o;
} else {
return new MonadicWrapper<>(o);
}
} | [
"public",
"static",
"<",
"T",
">",
"MonadicObservableValue",
"<",
"T",
">",
"monadic",
"(",
"ObservableValue",
"<",
"T",
">",
"o",
")",
"{",
"if",
"(",
"o",
"instanceof",
"MonadicObservableValue",
")",
"{",
"return",
"(",
"MonadicObservableValue",
"<",
"T",
... | Creates a thin wrapper around an observable value to make it monadic.
@param o ObservableValue to wrap
@return {@code o} if {@code o} is already monadic, or a thin monadic
wrapper around {@code o} otherwise. | [
"Creates",
"a",
"thin",
"wrapper",
"around",
"an",
"observable",
"value",
"to",
"make",
"it",
"monadic",
"."
] | 516947dec9de4977d8a817b7d1dfd320cc644298 | https://github.com/TomasMikula/EasyBind/blob/516947dec9de4977d8a817b7d1dfd320cc644298/src/main/java/org/fxmisc/easybind/EasyBind.java#L53-L59 |
102,279 | hypercube1024/firefly | firefly/src/main/java/com/firefly/codec/http2/model/MimeTypes.java | MimeTypes.getDefaultMimeByExtension | public static String getDefaultMimeByExtension(String filename) {
String type = null;
if (filename != null) {
int i = -1;
while (type == null) {
i = filename.indexOf(".", i + 1);
if (i < 0 || i >= filename.length())
break;
... | java | public static String getDefaultMimeByExtension(String filename) {
String type = null;
if (filename != null) {
int i = -1;
while (type == null) {
i = filename.indexOf(".", i + 1);
if (i < 0 || i >= filename.length())
break;
... | [
"public",
"static",
"String",
"getDefaultMimeByExtension",
"(",
"String",
"filename",
")",
"{",
"String",
"type",
"=",
"null",
";",
"if",
"(",
"filename",
"!=",
"null",
")",
"{",
"int",
"i",
"=",
"-",
"1",
";",
"while",
"(",
"type",
"==",
"null",
")",
... | Get the MIME type by filename extension.
Lookup only the static default mime map.
@param filename A file name
@return MIME type matching the longest dot extension of the
file name. | [
"Get",
"the",
"MIME",
"type",
"by",
"filename",
"extension",
".",
"Lookup",
"only",
"the",
"static",
"default",
"mime",
"map",
"."
] | ed3fc75b7c54a65b1e7d8141d01b49144bb423a3 | https://github.com/hypercube1024/firefly/blob/ed3fc75b7c54a65b1e7d8141d01b49144bb423a3/firefly/src/main/java/com/firefly/codec/http2/model/MimeTypes.java#L244-L265 |
102,280 | hypercube1024/firefly | firefly/src/main/java/com/firefly/codec/http2/model/HttpURI.java | HttpURI.createHttpURI | public static HttpURI createHttpURI(String scheme, String host, int port, String path, String param, String query, String fragment) {
if (port == 80 && HttpScheme.HTTP.is(scheme))
port = 0;
if (port == 443 && HttpScheme.HTTPS.is(scheme))
port = 0;
return new HttpURI(schem... | java | public static HttpURI createHttpURI(String scheme, String host, int port, String path, String param, String query, String fragment) {
if (port == 80 && HttpScheme.HTTP.is(scheme))
port = 0;
if (port == 443 && HttpScheme.HTTPS.is(scheme))
port = 0;
return new HttpURI(schem... | [
"public",
"static",
"HttpURI",
"createHttpURI",
"(",
"String",
"scheme",
",",
"String",
"host",
",",
"int",
"port",
",",
"String",
"path",
",",
"String",
"param",
",",
"String",
"query",
",",
"String",
"fragment",
")",
"{",
"if",
"(",
"port",
"==",
"80",... | Construct a normalized URI.
Port is not set if it is the default port.
@param scheme the URI scheme
@param host the URI hose
@param port the URI port
@param path the URI path
@param param the URI param
@param query the URI query
@param fragment the URI fragment
@return the normalized URI | [
"Construct",
"a",
"normalized",
"URI",
".",
"Port",
"is",
"not",
"set",
"if",
"it",
"is",
"the",
"default",
"port",
"."
] | ed3fc75b7c54a65b1e7d8141d01b49144bb423a3 | https://github.com/hypercube1024/firefly/blob/ed3fc75b7c54a65b1e7d8141d01b49144bb423a3/firefly/src/main/java/com/firefly/codec/http2/model/HttpURI.java#L74-L80 |
102,281 | hypercube1024/firefly | firefly/src/main/java/com/firefly/codec/http2/encode/UrlEncoded.java | UrlEncoded.encode | public static String encode(MultiMap<String> map, Charset charset, boolean equalsForNullValue) {
if (charset == null)
charset = ENCODING;
StringBuilder result = new StringBuilder(128);
boolean delim = false;
for (Map.Entry<String, List<String>> entry : map.entrySet()) {
... | java | public static String encode(MultiMap<String> map, Charset charset, boolean equalsForNullValue) {
if (charset == null)
charset = ENCODING;
StringBuilder result = new StringBuilder(128);
boolean delim = false;
for (Map.Entry<String, List<String>> entry : map.entrySet()) {
... | [
"public",
"static",
"String",
"encode",
"(",
"MultiMap",
"<",
"String",
">",
"map",
",",
"Charset",
"charset",
",",
"boolean",
"equalsForNullValue",
")",
"{",
"if",
"(",
"charset",
"==",
"null",
")",
"charset",
"=",
"ENCODING",
";",
"StringBuilder",
"result"... | Encode MultiMap with % encoding.
@param map the map to encode
@param charset the charset to use for encoding (uses default encoding if null)
@param equalsForNullValue if True, then an '=' is always used, even
for parameters without a value. e.g. <code>"blah?a=&b=&c="</code>.
@return t... | [
"Encode",
"MultiMap",
"with",
"%",
"encoding",
"."
] | ed3fc75b7c54a65b1e7d8141d01b49144bb423a3 | https://github.com/hypercube1024/firefly/blob/ed3fc75b7c54a65b1e7d8141d01b49144bb423a3/firefly/src/main/java/com/firefly/codec/http2/encode/UrlEncoded.java#L126-L166 |
102,282 | hypercube1024/firefly | firefly/src/main/java/com/firefly/codec/http2/encode/UrlEncoded.java | UrlEncoded.decode88591To | public static void decode88591To(InputStream in, MultiMap<String> map, int maxLength, int maxKeys)
throws IOException {
synchronized (map) {
StringBuffer buffer = new StringBuffer();
String key = null;
String value = null;
int b;
int tota... | java | public static void decode88591To(InputStream in, MultiMap<String> map, int maxLength, int maxKeys)
throws IOException {
synchronized (map) {
StringBuffer buffer = new StringBuffer();
String key = null;
String value = null;
int b;
int tota... | [
"public",
"static",
"void",
"decode88591To",
"(",
"InputStream",
"in",
",",
"MultiMap",
"<",
"String",
">",
"map",
",",
"int",
"maxLength",
",",
"int",
"maxKeys",
")",
"throws",
"IOException",
"{",
"synchronized",
"(",
"map",
")",
"{",
"StringBuffer",
"buffe... | Decoded parameters to MultiMap, using ISO8859-1 encodings.
@param in InputSteam to read
@param map MultiMap to add parameters to
@param maxLength maximum length of form to read
@param maxKeys maximum number of keys to read or -1 for no limit
@throws IOException if unable to decode inputstream as ISO8859... | [
"Decoded",
"parameters",
"to",
"MultiMap",
"using",
"ISO8859",
"-",
"1",
"encodings",
"."
] | ed3fc75b7c54a65b1e7d8141d01b49144bb423a3 | https://github.com/hypercube1024/firefly/blob/ed3fc75b7c54a65b1e7d8141d01b49144bb423a3/firefly/src/main/java/com/firefly/codec/http2/encode/UrlEncoded.java#L330-L391 |
102,283 | hypercube1024/firefly | firefly-common/src/main/java/com/firefly/utils/io/InputStreamResource.java | InputStreamResource.getInputStream | @Override
public InputStream getInputStream() throws IOException, IllegalStateException {
if (this.read) {
throw new IllegalStateException("InputStream has already been read - " +
"do not use InputStreamResource if a stream needs to be read multiple times");
}
... | java | @Override
public InputStream getInputStream() throws IOException, IllegalStateException {
if (this.read) {
throw new IllegalStateException("InputStream has already been read - " +
"do not use InputStreamResource if a stream needs to be read multiple times");
}
... | [
"@",
"Override",
"public",
"InputStream",
"getInputStream",
"(",
")",
"throws",
"IOException",
",",
"IllegalStateException",
"{",
"if",
"(",
"this",
".",
"read",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"InputStream has already been read - \"",
"+",
... | This implementation throws IllegalStateException if attempting to
read the underlying stream multiple times. | [
"This",
"implementation",
"throws",
"IllegalStateException",
"if",
"attempting",
"to",
"read",
"the",
"underlying",
"stream",
"multiple",
"times",
"."
] | ed3fc75b7c54a65b1e7d8141d01b49144bb423a3 | https://github.com/hypercube1024/firefly/blob/ed3fc75b7c54a65b1e7d8141d01b49144bb423a3/firefly-common/src/main/java/com/firefly/utils/io/InputStreamResource.java#L76-L84 |
102,284 | hypercube1024/firefly | firefly-db/src/main/java/com/firefly/db/jdbc/helper/DefaultBeanProcessor.java | DefaultBeanProcessor.createBean | private <T> T createBean(ResultSet rs, Class<T> type,
PropertyDescriptor[] props, int[] columnToProperty)
throws SQLException {
T bean = this.newInstance(type);
return populateBean(rs, bean, props, columnToProperty);
} | java | private <T> T createBean(ResultSet rs, Class<T> type,
PropertyDescriptor[] props, int[] columnToProperty)
throws SQLException {
T bean = this.newInstance(type);
return populateBean(rs, bean, props, columnToProperty);
} | [
"private",
"<",
"T",
">",
"T",
"createBean",
"(",
"ResultSet",
"rs",
",",
"Class",
"<",
"T",
">",
"type",
",",
"PropertyDescriptor",
"[",
"]",
"props",
",",
"int",
"[",
"]",
"columnToProperty",
")",
"throws",
"SQLException",
"{",
"T",
"bean",
"=",
"thi... | Creates a new object and initializes its fields from the ResultSet.
@param <T> The type of bean to create
@param rs The result set.
@param type The bean type (the return type of the object).
@param props The property descriptors.
@param columnToProperty The column indi... | [
"Creates",
"a",
"new",
"object",
"and",
"initializes",
"its",
"fields",
"from",
"the",
"ResultSet",
"."
] | ed3fc75b7c54a65b1e7d8141d01b49144bb423a3 | https://github.com/hypercube1024/firefly/blob/ed3fc75b7c54a65b1e7d8141d01b49144bb423a3/firefly-db/src/main/java/com/firefly/db/jdbc/helper/DefaultBeanProcessor.java#L93-L99 |
102,285 | hypercube1024/firefly | firefly-db/src/main/java/com/firefly/db/jdbc/helper/DefaultBeanProcessor.java | DefaultBeanProcessor.populateBean | @Override
public <T> T populateBean(ResultSet rs, T bean) throws SQLException {
Class<?> type = bean.getClass();
PropertyDescriptor[] props = this.propertyDescriptors(type);
int[] columnToProperty = this.mapColumnsToProperties(rs.getMetaData(), props, type);
return populateBean(rs, b... | java | @Override
public <T> T populateBean(ResultSet rs, T bean) throws SQLException {
Class<?> type = bean.getClass();
PropertyDescriptor[] props = this.propertyDescriptors(type);
int[] columnToProperty = this.mapColumnsToProperties(rs.getMetaData(), props, type);
return populateBean(rs, b... | [
"@",
"Override",
"public",
"<",
"T",
">",
"T",
"populateBean",
"(",
"ResultSet",
"rs",
",",
"T",
"bean",
")",
"throws",
"SQLException",
"{",
"Class",
"<",
"?",
">",
"type",
"=",
"bean",
".",
"getClass",
"(",
")",
";",
"PropertyDescriptor",
"[",
"]",
... | Initializes the fields of the provided bean from the ResultSet.
@param <T> The type of bean
@param rs The result set.
@param bean The bean to be populated.
@return An initialized object.
@throws SQLException if a database error occurs. | [
"Initializes",
"the",
"fields",
"of",
"the",
"provided",
"bean",
"from",
"the",
"ResultSet",
"."
] | ed3fc75b7c54a65b1e7d8141d01b49144bb423a3 | https://github.com/hypercube1024/firefly/blob/ed3fc75b7c54a65b1e7d8141d01b49144bb423a3/firefly-db/src/main/java/com/firefly/db/jdbc/helper/DefaultBeanProcessor.java#L110-L116 |
102,286 | hypercube1024/firefly | firefly-db/src/main/java/com/firefly/db/jdbc/helper/DefaultBeanProcessor.java | DefaultBeanProcessor.populateBean | private <T> T populateBean(ResultSet rs, T bean,
PropertyDescriptor[] props, int[] columnToProperty)
throws SQLException {
for (int i = 1; i < columnToProperty.length; i++) {
if (columnToProperty[i] == PROPERTY_NOT_FOUND) {
continue;
... | java | private <T> T populateBean(ResultSet rs, T bean,
PropertyDescriptor[] props, int[] columnToProperty)
throws SQLException {
for (int i = 1; i < columnToProperty.length; i++) {
if (columnToProperty[i] == PROPERTY_NOT_FOUND) {
continue;
... | [
"private",
"<",
"T",
">",
"T",
"populateBean",
"(",
"ResultSet",
"rs",
",",
"T",
"bean",
",",
"PropertyDescriptor",
"[",
"]",
"props",
",",
"int",
"[",
"]",
"columnToProperty",
")",
"throws",
"SQLException",
"{",
"for",
"(",
"int",
"i",
"=",
"1",
";",
... | This method populates a bean from the ResultSet based upon the underlying meta-data.
@param <T> The type of bean
@param rs The result set.
@param bean The bean to be populated.
@param props The property descriptors.
@param columnToProperty The column indices in the res... | [
"This",
"method",
"populates",
"a",
"bean",
"from",
"the",
"ResultSet",
"based",
"upon",
"the",
"underlying",
"meta",
"-",
"data",
"."
] | ed3fc75b7c54a65b1e7d8141d01b49144bb423a3 | https://github.com/hypercube1024/firefly/blob/ed3fc75b7c54a65b1e7d8141d01b49144bb423a3/firefly-db/src/main/java/com/firefly/db/jdbc/helper/DefaultBeanProcessor.java#L129-L155 |
102,287 | hypercube1024/firefly | firefly-db/src/main/java/com/firefly/db/jdbc/helper/DefaultBeanProcessor.java | DefaultBeanProcessor.callSetter | private void callSetter(Object target, PropertyDescriptor prop, Object value)
throws SQLException {
Method setter = getWriteMethod(target, prop, value);
if (setter == null || setter.getParameterTypes().length != 1) {
return;
}
try {
Class<?> firstPa... | java | private void callSetter(Object target, PropertyDescriptor prop, Object value)
throws SQLException {
Method setter = getWriteMethod(target, prop, value);
if (setter == null || setter.getParameterTypes().length != 1) {
return;
}
try {
Class<?> firstPa... | [
"private",
"void",
"callSetter",
"(",
"Object",
"target",
",",
"PropertyDescriptor",
"prop",
",",
"Object",
"value",
")",
"throws",
"SQLException",
"{",
"Method",
"setter",
"=",
"getWriteMethod",
"(",
"target",
",",
"prop",
",",
"value",
")",
";",
"if",
"(",... | Calls the setter method on the target object for the given property.
If no setter method exists for the property, this method does nothing.
@param target The object to set the property on.
@param prop The property to set.
@param value The value to pass into the setter.
@throws SQLException if an error occurs settin... | [
"Calls",
"the",
"setter",
"method",
"on",
"the",
"target",
"object",
"for",
"the",
"given",
"property",
".",
"If",
"no",
"setter",
"method",
"exists",
"for",
"the",
"property",
"this",
"method",
"does",
"nothing",
"."
] | ed3fc75b7c54a65b1e7d8141d01b49144bb423a3 | https://github.com/hypercube1024/firefly/blob/ed3fc75b7c54a65b1e7d8141d01b49144bb423a3/firefly-db/src/main/java/com/firefly/db/jdbc/helper/DefaultBeanProcessor.java#L166-L206 |
102,288 | hypercube1024/firefly | firefly-common/src/main/java/com/firefly/utils/lang/StringParser.java | StringParser.setString | public void setString(String string) {
this.string = string;
if (string != null) {
this.length = string.length();
chars = this.string.toCharArray();
} else {
this.length = 0;
chars = new char[0];
}
reset();
} | java | public void setString(String string) {
this.string = string;
if (string != null) {
this.length = string.length();
chars = this.string.toCharArray();
} else {
this.length = 0;
chars = new char[0];
}
reset();
} | [
"public",
"void",
"setString",
"(",
"String",
"string",
")",
"{",
"this",
".",
"string",
"=",
"string",
";",
"if",
"(",
"string",
"!=",
"null",
")",
"{",
"this",
".",
"length",
"=",
"string",
".",
"length",
"(",
")",
";",
"chars",
"=",
"this",
".",... | Set the String we are currently parsing. The parser state is also reset
to begin at the start of this string.
@param string The string to be parsed. | [
"Set",
"the",
"String",
"we",
"are",
"currently",
"parsing",
".",
"The",
"parser",
"state",
"is",
"also",
"reset",
"to",
"begin",
"at",
"the",
"start",
"of",
"this",
"string",
"."
] | ed3fc75b7c54a65b1e7d8141d01b49144bb423a3 | https://github.com/hypercube1024/firefly/blob/ed3fc75b7c54a65b1e7d8141d01b49144bb423a3/firefly-common/src/main/java/com/firefly/utils/lang/StringParser.java#L145-L157 |
102,289 | hypercube1024/firefly | firefly-common/src/main/java/com/firefly/utils/lang/StringParser.java | StringParser.extract | public String extract(int start, int end) {
if ((start < 0) || (start >= end) || (end > length))
return ("");
else
return (string.substring(start, end));
} | java | public String extract(int start, int end) {
if ((start < 0) || (start >= end) || (end > length))
return ("");
else
return (string.substring(start, end));
} | [
"public",
"String",
"extract",
"(",
"int",
"start",
",",
"int",
"end",
")",
"{",
"if",
"(",
"(",
"start",
"<",
"0",
")",
"||",
"(",
"start",
">=",
"end",
")",
"||",
"(",
"end",
">",
"length",
")",
")",
"return",
"(",
"\"\"",
")",
";",
"else",
... | Extract and return a substring that starts at the specified position,
and ends at the character before the specified position. If this is
not possible, a zero-length string is returned.
@param start Starting index, zero relative, inclusive
@param end Ending index, zero relative, exclusive
@return The result string ... | [
"Extract",
"and",
"return",
"a",
"substring",
"that",
"starts",
"at",
"the",
"specified",
"position",
"and",
"ends",
"at",
"the",
"character",
"before",
"the",
"specified",
"position",
".",
"If",
"this",
"is",
"not",
"possible",
"a",
"zero",
"-",
"length",
... | ed3fc75b7c54a65b1e7d8141d01b49144bb423a3 | https://github.com/hypercube1024/firefly/blob/ed3fc75b7c54a65b1e7d8141d01b49144bb423a3/firefly-common/src/main/java/com/firefly/utils/lang/StringParser.java#L202-L209 |
102,290 | hypercube1024/firefly | firefly-db/src/main/java/com/firefly/db/jdbc/helper/DefaultBeanMapHandler.java | DefaultBeanMapHandler.createKey | @SuppressWarnings("unchecked")
@Override
protected K createKey(ResultSet rs) throws SQLException {
return (columnName == null) ?
(K) rs.getObject(columnIndex) :
(K) rs.getObject(columnName);
} | java | @SuppressWarnings("unchecked")
@Override
protected K createKey(ResultSet rs) throws SQLException {
return (columnName == null) ?
(K) rs.getObject(columnIndex) :
(K) rs.getObject(columnName);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"@",
"Override",
"protected",
"K",
"createKey",
"(",
"ResultSet",
"rs",
")",
"throws",
"SQLException",
"{",
"return",
"(",
"columnName",
"==",
"null",
")",
"?",
"(",
"K",
")",
"rs",
".",
"getObject",
"(",... | so getObject will return the appropriate type and the cast will succeed. | [
"so",
"getObject",
"will",
"return",
"the",
"appropriate",
"type",
"and",
"the",
"cast",
"will",
"succeed",
"."
] | ed3fc75b7c54a65b1e7d8141d01b49144bb423a3 | https://github.com/hypercube1024/firefly/blob/ed3fc75b7c54a65b1e7d8141d01b49144bb423a3/firefly-db/src/main/java/com/firefly/db/jdbc/helper/DefaultBeanMapHandler.java#L76-L82 |
102,291 | hypercube1024/firefly | firefly-common/src/main/java/com/firefly/utils/collection/ConcurrentLinkedHashMap.java | ConcurrentLinkedHashMap.segmentFor | private LinkedHashMapSegment<K, V> segmentFor(int hash) {
int h = hash(hash);
return segments[(h >>> segmentShift) & segmentMask];
} | java | private LinkedHashMapSegment<K, V> segmentFor(int hash) {
int h = hash(hash);
return segments[(h >>> segmentShift) & segmentMask];
} | [
"private",
"LinkedHashMapSegment",
"<",
"K",
",",
"V",
">",
"segmentFor",
"(",
"int",
"hash",
")",
"{",
"int",
"h",
"=",
"hash",
"(",
"hash",
")",
";",
"return",
"segments",
"[",
"(",
"h",
">>>",
"segmentShift",
")",
"&",
"segmentMask",
"]",
";",
"}"... | Returns the segment that should be used for key with given hash
@param hash the hash code for the key
@return the segment | [
"Returns",
"the",
"segment",
"that",
"should",
"be",
"used",
"for",
"key",
"with",
"given",
"hash"
] | ed3fc75b7c54a65b1e7d8141d01b49144bb423a3 | https://github.com/hypercube1024/firefly/blob/ed3fc75b7c54a65b1e7d8141d01b49144bb423a3/firefly-common/src/main/java/com/firefly/utils/collection/ConcurrentLinkedHashMap.java#L225-L228 |
102,292 | hypercube1024/firefly | firefly-common/src/main/java/com/firefly/utils/collection/ConcurrentLinkedHashMap.java | ConcurrentLinkedHashMap.size | @Override
public int size() {
try {
lockAllSegments();
int size = 0;
for (LinkedHashMapSegment<K, V> seg : segments) {
size += seg.size();
}
return size;
} finally {
unlockAllSegments();
}
} | java | @Override
public int size() {
try {
lockAllSegments();
int size = 0;
for (LinkedHashMapSegment<K, V> seg : segments) {
size += seg.size();
}
return size;
} finally {
unlockAllSegments();
}
} | [
"@",
"Override",
"public",
"int",
"size",
"(",
")",
"{",
"try",
"{",
"lockAllSegments",
"(",
")",
";",
"int",
"size",
"=",
"0",
";",
"for",
"(",
"LinkedHashMapSegment",
"<",
"K",
",",
"V",
">",
"seg",
":",
"segments",
")",
"{",
"size",
"+=",
"seg",... | Gets the entry's total number.
@return entry's number | [
"Gets",
"the",
"entry",
"s",
"total",
"number",
"."
] | ed3fc75b7c54a65b1e7d8141d01b49144bb423a3 | https://github.com/hypercube1024/firefly/blob/ed3fc75b7c54a65b1e7d8141d01b49144bb423a3/firefly-common/src/main/java/com/firefly/utils/collection/ConcurrentLinkedHashMap.java#L245-L257 |
102,293 | hypercube1024/firefly | firefly-common/src/main/java/com/firefly/utils/collection/ConcurrentLinkedHashMap.java | ConcurrentLinkedHashMap.get | @SuppressWarnings("unchecked")
@Override
public V get(Object key) {
LinkedHashMapSegment<K, V> seg = segmentFor(key.hashCode());
try {
seg.lock.lock();
return mapEventListener.onGetEntry((K) key, seg.get(key));
} finally {
seg.lock.unlock();
}
... | java | @SuppressWarnings("unchecked")
@Override
public V get(Object key) {
LinkedHashMapSegment<K, V> seg = segmentFor(key.hashCode());
try {
seg.lock.lock();
return mapEventListener.onGetEntry((K) key, seg.get(key));
} finally {
seg.lock.unlock();
}
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"@",
"Override",
"public",
"V",
"get",
"(",
"Object",
"key",
")",
"{",
"LinkedHashMapSegment",
"<",
"K",
",",
"V",
">",
"seg",
"=",
"segmentFor",
"(",
"key",
".",
"hashCode",
"(",
")",
")",
";",
"try"... | Returns a value which the specified key is mapped.
At the same time, this method will call the callback interface, the getting entry event will be triggered.
@param key the key whose associated value is to be returned
@return the value which the specified key is mapped, or
{@code null} if this map contains no mapping ... | [
"Returns",
"a",
"value",
"which",
"the",
"specified",
"key",
"is",
"mapped",
".",
"At",
"the",
"same",
"time",
"this",
"method",
"will",
"call",
"the",
"callback",
"interface",
"the",
"getting",
"entry",
"event",
"will",
"be",
"triggered",
"."
] | ed3fc75b7c54a65b1e7d8141d01b49144bb423a3 | https://github.com/hypercube1024/firefly/blob/ed3fc75b7c54a65b1e7d8141d01b49144bb423a3/firefly-common/src/main/java/com/firefly/utils/collection/ConcurrentLinkedHashMap.java#L316-L327 |
102,294 | hypercube1024/firefly | firefly-common/src/main/java/com/firefly/utils/collection/ConcurrentLinkedHashMap.java | ConcurrentLinkedHashMap.put | @Override
public V put(K key, V value) {
LinkedHashMapSegment<K, V> seg = segmentFor(key.hashCode());
try {
seg.lock.lock();
return mapEventListener.onPutEntry(key, value, seg.put(key, value));
} finally {
seg.lock.unlock();
}
} | java | @Override
public V put(K key, V value) {
LinkedHashMapSegment<K, V> seg = segmentFor(key.hashCode());
try {
seg.lock.lock();
return mapEventListener.onPutEntry(key, value, seg.put(key, value));
} finally {
seg.lock.unlock();
}
} | [
"@",
"Override",
"public",
"V",
"put",
"(",
"K",
"key",
",",
"V",
"value",
")",
"{",
"LinkedHashMapSegment",
"<",
"K",
",",
"V",
">",
"seg",
"=",
"segmentFor",
"(",
"key",
".",
"hashCode",
"(",
")",
")",
";",
"try",
"{",
"seg",
".",
"lock",
".",
... | Associates the specified value with the specified key in this map.
If the key existed in the map, the entry will be replaced by specified entry.
This method will call the putting entry event when the method is called.
@param key key with which the specified value is to be associated
@param value value to be associat... | [
"Associates",
"the",
"specified",
"value",
"with",
"the",
"specified",
"key",
"in",
"this",
"map",
".",
"If",
"the",
"key",
"existed",
"in",
"the",
"map",
"the",
"entry",
"will",
"be",
"replaced",
"by",
"specified",
"entry",
".",
"This",
"method",
"will",
... | ed3fc75b7c54a65b1e7d8141d01b49144bb423a3 | https://github.com/hypercube1024/firefly/blob/ed3fc75b7c54a65b1e7d8141d01b49144bb423a3/firefly-common/src/main/java/com/firefly/utils/collection/ConcurrentLinkedHashMap.java#L342-L351 |
102,295 | hypercube1024/firefly | firefly-common/src/main/java/com/firefly/utils/collection/ConcurrentLinkedHashMap.java | ConcurrentLinkedHashMap.remove | @SuppressWarnings("unchecked")
@Override
public V remove(Object key) {
LinkedHashMapSegment<K, V> seg = segmentFor(key.hashCode());
try {
seg.lock.lock();
return mapEventListener.onRemoveEntry((K) key, seg.remove(key));
} finally {
seg.lock.unlock();
... | java | @SuppressWarnings("unchecked")
@Override
public V remove(Object key) {
LinkedHashMapSegment<K, V> seg = segmentFor(key.hashCode());
try {
seg.lock.lock();
return mapEventListener.onRemoveEntry((K) key, seg.remove(key));
} finally {
seg.lock.unlock();
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"@",
"Override",
"public",
"V",
"remove",
"(",
"Object",
"key",
")",
"{",
"LinkedHashMapSegment",
"<",
"K",
",",
"V",
">",
"seg",
"=",
"segmentFor",
"(",
"key",
".",
"hashCode",
"(",
")",
")",
";",
"t... | Remove a entry from this map. The removing event will be called.
@param key key whose mapping is to be removed from the map
@return the previous value associated with <tt>key</tt>, or
<tt>null</tt> if there was no mapping for <tt>key</tt>. | [
"Remove",
"a",
"entry",
"from",
"this",
"map",
".",
"The",
"removing",
"event",
"will",
"be",
"called",
"."
] | ed3fc75b7c54a65b1e7d8141d01b49144bb423a3 | https://github.com/hypercube1024/firefly/blob/ed3fc75b7c54a65b1e7d8141d01b49144bb423a3/firefly-common/src/main/java/com/firefly/utils/collection/ConcurrentLinkedHashMap.java#L360-L370 |
102,296 | hypercube1024/firefly | firefly-common/src/main/java/com/firefly/utils/collection/ConcurrentLinkedHashMap.java | ConcurrentLinkedHashMap.clear | @Override
public void clear() {
try {
lockAllSegments();
for (LinkedHashMapSegment<K, V> seg : segments) {
seg.clear();
}
} finally {
unlockAllSegments();
}
} | java | @Override
public void clear() {
try {
lockAllSegments();
for (LinkedHashMapSegment<K, V> seg : segments) {
seg.clear();
}
} finally {
unlockAllSegments();
}
} | [
"@",
"Override",
"public",
"void",
"clear",
"(",
")",
"{",
"try",
"{",
"lockAllSegments",
"(",
")",
";",
"for",
"(",
"LinkedHashMapSegment",
"<",
"K",
",",
"V",
">",
"seg",
":",
"segments",
")",
"{",
"seg",
".",
"clear",
"(",
")",
";",
"}",
"}",
... | clear all map's entries, but it dosen't trigger the remove callback method | [
"clear",
"all",
"map",
"s",
"entries",
"but",
"it",
"dosen",
"t",
"trigger",
"the",
"remove",
"callback",
"method"
] | ed3fc75b7c54a65b1e7d8141d01b49144bb423a3 | https://github.com/hypercube1024/firefly/blob/ed3fc75b7c54a65b1e7d8141d01b49144bb423a3/firefly-common/src/main/java/com/firefly/utils/collection/ConcurrentLinkedHashMap.java#L387-L397 |
102,297 | hypercube1024/firefly | firefly-common/src/main/java/com/firefly/utils/collection/ConcurrentLinkedHashMap.java | ConcurrentLinkedHashMap.keySet | @Override
public Set<K> keySet() {
try {
lockAllSegments();
Set<K> set = new HashSet<>();
for (LinkedHashMapSegment<K, V> seg : segments) {
set.addAll(seg.keySet());
}
return set;
} finally {
unlockAllSegments();... | java | @Override
public Set<K> keySet() {
try {
lockAllSegments();
Set<K> set = new HashSet<>();
for (LinkedHashMapSegment<K, V> seg : segments) {
set.addAll(seg.keySet());
}
return set;
} finally {
unlockAllSegments();... | [
"@",
"Override",
"public",
"Set",
"<",
"K",
">",
"keySet",
"(",
")",
"{",
"try",
"{",
"lockAllSegments",
"(",
")",
";",
"Set",
"<",
"K",
">",
"set",
"=",
"new",
"HashSet",
"<>",
"(",
")",
";",
"for",
"(",
"LinkedHashMapSegment",
"<",
"K",
",",
"V... | Gets the all key in this map.
@return a set view of the keys contained in this map | [
"Gets",
"the",
"all",
"key",
"in",
"this",
"map",
"."
] | ed3fc75b7c54a65b1e7d8141d01b49144bb423a3 | https://github.com/hypercube1024/firefly/blob/ed3fc75b7c54a65b1e7d8141d01b49144bb423a3/firefly-common/src/main/java/com/firefly/utils/collection/ConcurrentLinkedHashMap.java#L404-L416 |
102,298 | hypercube1024/firefly | firefly-common/src/main/java/com/firefly/utils/io/IO.java | IO.copy | public static void copy(File from, File to) throws IOException {
if (from.isDirectory())
copyDir(from, to);
else
copyFile(from, to);
} | java | public static void copy(File from, File to) throws IOException {
if (from.isDirectory())
copyDir(from, to);
else
copyFile(from, to);
} | [
"public",
"static",
"void",
"copy",
"(",
"File",
"from",
",",
"File",
"to",
")",
"throws",
"IOException",
"{",
"if",
"(",
"from",
".",
"isDirectory",
"(",
")",
")",
"copyDir",
"(",
"from",
",",
"to",
")",
";",
"else",
"copyFile",
"(",
"from",
",",
... | Copy files or directories
@param from the file to copy
@param to the destination to copy to
@throws IOException if unable to copy | [
"Copy",
"files",
"or",
"directories"
] | ed3fc75b7c54a65b1e7d8141d01b49144bb423a3 | https://github.com/hypercube1024/firefly/blob/ed3fc75b7c54a65b1e7d8141d01b49144bb423a3/firefly-common/src/main/java/com/firefly/utils/io/IO.java#L168-L173 |
102,299 | hypercube1024/firefly | firefly-common/src/main/java/com/firefly/utils/lang/ArrayUtils.java | ArrayUtils.addToArray | public static <T> T[] addToArray(T[] array, T item, Class<?> type) {
if (array == null) {
if (type == null && item != null) {
type = item.getClass();
}
@SuppressWarnings("unchecked")
T[] na = (T[]) Array.newInstance(type, 1);
na[0] = it... | java | public static <T> T[] addToArray(T[] array, T item, Class<?> type) {
if (array == null) {
if (type == null && item != null) {
type = item.getClass();
}
@SuppressWarnings("unchecked")
T[] na = (T[]) Array.newInstance(type, 1);
na[0] = it... | [
"public",
"static",
"<",
"T",
">",
"T",
"[",
"]",
"addToArray",
"(",
"T",
"[",
"]",
"array",
",",
"T",
"item",
",",
"Class",
"<",
"?",
">",
"type",
")",
"{",
"if",
"(",
"array",
"==",
"null",
")",
"{",
"if",
"(",
"type",
"==",
"null",
"&&",
... | Add element to an array
@param array The array to add to (or null)
@param item The item to add
@param type The type of the array (in case of null array)
@param <T> the array entry type
@return new array with contents of array plus item | [
"Add",
"element",
"to",
"an",
"array"
] | ed3fc75b7c54a65b1e7d8141d01b49144bb423a3 | https://github.com/hypercube1024/firefly/blob/ed3fc75b7c54a65b1e7d8141d01b49144bb423a3/firefly-common/src/main/java/com/firefly/utils/lang/ArrayUtils.java#L120-L134 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.