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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
148,900 | hypfvieh/java-utils | src/main/java/com/github/hypfvieh/classloader/ClassLoaderWithRegistry.java | ClassLoaderWithRegistry.isIncluded | private boolean isIncluded(String _fqcn) {
if (includePackageNames.contains(_fqcn)) {
return true;
}
String packageName = _fqcn.substring(0, _fqcn.lastIndexOf('.') + 1);
for (String str : includePackageNames) {
if (packageName.startsWith(str)) {
r... | java | private boolean isIncluded(String _fqcn) {
if (includePackageNames.contains(_fqcn)) {
return true;
}
String packageName = _fqcn.substring(0, _fqcn.lastIndexOf('.') + 1);
for (String str : includePackageNames) {
if (packageName.startsWith(str)) {
r... | [
"private",
"boolean",
"isIncluded",
"(",
"String",
"_fqcn",
")",
"{",
"if",
"(",
"includePackageNames",
".",
"contains",
"(",
"_fqcn",
")",
")",
"{",
"return",
"true",
";",
"}",
"String",
"packageName",
"=",
"_fqcn",
".",
"substring",
"(",
"0",
",",
"_fq... | Check if a certain class is included.
@param _fqcn
@return | [
"Check",
"if",
"a",
"certain",
"class",
"is",
"included",
"."
] | 407c32d6b485596d4d2b644f5f7fc7a02d0169c6 | https://github.com/hypfvieh/java-utils/blob/407c32d6b485596d4d2b644f5f7fc7a02d0169c6/src/main/java/com/github/hypfvieh/classloader/ClassLoaderWithRegistry.java#L75-L88 |
148,901 | eurekaclinical/protempa | protempa-framework/src/main/java/org/protempa/SliceDefinition.java | SliceDefinition.add | public boolean add(TemporalExtendedPropositionDefinition tepd) {
if (tepd != null) {
boolean result = this.abstractedFrom.add(tepd);
if (result) {
recalculateChildren();
}
return result;
} else {
return false;
}
} | java | public boolean add(TemporalExtendedPropositionDefinition tepd) {
if (tepd != null) {
boolean result = this.abstractedFrom.add(tepd);
if (result) {
recalculateChildren();
}
return result;
} else {
return false;
}
} | [
"public",
"boolean",
"add",
"(",
"TemporalExtendedPropositionDefinition",
"tepd",
")",
"{",
"if",
"(",
"tepd",
"!=",
"null",
")",
"{",
"boolean",
"result",
"=",
"this",
".",
"abstractedFrom",
".",
"add",
"(",
"tepd",
")",
";",
"if",
"(",
"result",
")",
"... | Adds a proposition id from which this slice definition is abstracted.
@param propId
a proposition id <code>String</code> for an abstract
parameter definition. | [
"Adds",
"a",
"proposition",
"id",
"from",
"which",
"this",
"slice",
"definition",
"is",
"abstracted",
"."
] | 5a620d1a407c7a5426d1cf17d47b97717cf71634 | https://github.com/eurekaclinical/protempa/blob/5a620d1a407c7a5426d1cf17d47b97717cf71634/protempa-framework/src/main/java/org/protempa/SliceDefinition.java#L141-L151 |
148,902 | hypfvieh/java-utils | src/main/java/com/github/hypfvieh/util/CompressionUtil.java | CompressionUtil.extractFileGzip | public static File extractFileGzip(String _compressedFile, String _outputFileName) {
return decompress(CompressionMethod.GZIP, _compressedFile, _outputFileName);
} | java | public static File extractFileGzip(String _compressedFile, String _outputFileName) {
return decompress(CompressionMethod.GZIP, _compressedFile, _outputFileName);
} | [
"public",
"static",
"File",
"extractFileGzip",
"(",
"String",
"_compressedFile",
",",
"String",
"_outputFileName",
")",
"{",
"return",
"decompress",
"(",
"CompressionMethod",
".",
"GZIP",
",",
"_compressedFile",
",",
"_outputFileName",
")",
";",
"}"
] | Extracts a GZIP compressed file to the given outputfile.
@param _compressedFile
@param _outputFileName
@return file-object with outputfile or null on any error. | [
"Extracts",
"a",
"GZIP",
"compressed",
"file",
"to",
"the",
"given",
"outputfile",
"."
] | 407c32d6b485596d4d2b644f5f7fc7a02d0169c6 | https://github.com/hypfvieh/java-utils/blob/407c32d6b485596d4d2b644f5f7fc7a02d0169c6/src/main/java/com/github/hypfvieh/util/CompressionUtil.java#L42-L44 |
148,903 | hypfvieh/java-utils | src/main/java/com/github/hypfvieh/util/CompressionUtil.java | CompressionUtil.compressFileGzip | public static File compressFileGzip(String _sourceFile, String _outputFileName) {
return compress(CompressionMethod.GZIP, _sourceFile, _outputFileName);
} | java | public static File compressFileGzip(String _sourceFile, String _outputFileName) {
return compress(CompressionMethod.GZIP, _sourceFile, _outputFileName);
} | [
"public",
"static",
"File",
"compressFileGzip",
"(",
"String",
"_sourceFile",
",",
"String",
"_outputFileName",
")",
"{",
"return",
"compress",
"(",
"CompressionMethod",
".",
"GZIP",
",",
"_sourceFile",
",",
"_outputFileName",
")",
";",
"}"
] | Compresses the given file with GZIP and writes the compressed file to outputFileName.
@param _sourceFile
@param _outputFileName
@return new File object with the compressed file or null on error | [
"Compresses",
"the",
"given",
"file",
"with",
"GZIP",
"and",
"writes",
"the",
"compressed",
"file",
"to",
"outputFileName",
"."
] | 407c32d6b485596d4d2b644f5f7fc7a02d0169c6 | https://github.com/hypfvieh/java-utils/blob/407c32d6b485596d4d2b644f5f7fc7a02d0169c6/src/main/java/com/github/hypfvieh/util/CompressionUtil.java#L52-L54 |
148,904 | rolfl/MicroBench | src/main/java/net/tuis/ubench/UReport.java | UReport.title | public static void title(Writer writer, String title) throws IOException {
if (title == null || title.isEmpty()) {
return;
}
String out = String.format("%s\n%s\n\n", title,
Stream.generate(() -> "=").limit(title.length()).collect(Collectors.joining()));
writer... | java | public static void title(Writer writer, String title) throws IOException {
if (title == null || title.isEmpty()) {
return;
}
String out = String.format("%s\n%s\n\n", title,
Stream.generate(() -> "=").limit(title.length()).collect(Collectors.joining()));
writer... | [
"public",
"static",
"void",
"title",
"(",
"Writer",
"writer",
",",
"String",
"title",
")",
"throws",
"IOException",
"{",
"if",
"(",
"title",
"==",
"null",
"||",
"title",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
";",
"}",
"String",
"out",
"=",
"S... | Simple helper method that prints the specified title, underlined with '='
characters.
@param writer
the writer to write the title to.
@param title
the title to print (null or empty titles will be ignored).
@throws IOException
if the writer fails. | [
"Simple",
"helper",
"method",
"that",
"prints",
"the",
"specified",
"title",
"underlined",
"with",
"=",
"characters",
"."
] | f2bfa92dacd7ea0d6b8eae4d4fe2975139d317ce | https://github.com/rolfl/MicroBench/blob/f2bfa92dacd7ea0d6b8eae4d4fe2975139d317ce/src/main/java/net/tuis/ubench/UReport.java#L107-L114 |
148,905 | openbase/jul | visual/javafx/src/main/java/org/openbase/jul/visual/javafx/geometry/Ray3D.java | Ray3D.VecToPoint | private Point3D VecToPoint(final Vec3DFloat vector) {
return new Point3D(vector.getX(), vector.getY(), vector.getZ());
} | java | private Point3D VecToPoint(final Vec3DFloat vector) {
return new Point3D(vector.getX(), vector.getY(), vector.getZ());
} | [
"private",
"Point3D",
"VecToPoint",
"(",
"final",
"Vec3DFloat",
"vector",
")",
"{",
"return",
"new",
"Point3D",
"(",
"vector",
".",
"getX",
"(",
")",
",",
"vector",
".",
"getY",
"(",
")",
",",
"vector",
".",
"getZ",
"(",
")",
")",
";",
"}"
] | Transforms a Vec3DFloat object to a Point3D object.
@param vector The Vec3DFloat object.
@return The transformed Point3D. | [
"Transforms",
"a",
"Vec3DFloat",
"object",
"to",
"a",
"Point3D",
"object",
"."
] | 662e98c3a853085e475be54c3be3deb72193c72d | https://github.com/openbase/jul/blob/662e98c3a853085e475be54c3be3deb72193c72d/visual/javafx/src/main/java/org/openbase/jul/visual/javafx/geometry/Ray3D.java#L57-L59 |
148,906 | openbase/jul | visual/javafx/src/main/java/org/openbase/jul/visual/javafx/geometry/Ray3D.java | Ray3D.update | public void update(final Ray3DFloat ray) {
final Point3D origin = VecToPoint(ray.getOrigin());
final Point3D direction = VecToPoint(ray.getDirection());
final Point3D end = origin.add(direction.normalize().multiply(rayLength));
super.setStartEndPoints(origin, end);
} | java | public void update(final Ray3DFloat ray) {
final Point3D origin = VecToPoint(ray.getOrigin());
final Point3D direction = VecToPoint(ray.getDirection());
final Point3D end = origin.add(direction.normalize().multiply(rayLength));
super.setStartEndPoints(origin, end);
} | [
"public",
"void",
"update",
"(",
"final",
"Ray3DFloat",
"ray",
")",
"{",
"final",
"Point3D",
"origin",
"=",
"VecToPoint",
"(",
"ray",
".",
"getOrigin",
"(",
")",
")",
";",
"final",
"Point3D",
"direction",
"=",
"VecToPoint",
"(",
"ray",
".",
"getDirection",... | Updates the ray orientation and position to the specified data.
@param ray Ray3DFloat object defining the placement data of the ray. | [
"Updates",
"the",
"ray",
"orientation",
"and",
"position",
"to",
"the",
"specified",
"data",
"."
] | 662e98c3a853085e475be54c3be3deb72193c72d | https://github.com/openbase/jul/blob/662e98c3a853085e475be54c3be3deb72193c72d/visual/javafx/src/main/java/org/openbase/jul/visual/javafx/geometry/Ray3D.java#L87-L92 |
148,907 | eurekaclinical/protempa | protempa-ksb-protege/src/main/java/org/protempa/backend/ksb/protege/ProtegeKnowledgeSourceBackend.java | ProtegeKnowledgeSourceBackend.readClass | private Cls readClass(String name, String superClass)
throws KnowledgeSourceReadException {
Cls cls = this.cm.getCls(name);
Cls superCls = this.cm.getCls(superClass);
if (cls != null && cls.hasSuperclass(superCls)) {
return cls;
} else {
return null;
... | java | private Cls readClass(String name, String superClass)
throws KnowledgeSourceReadException {
Cls cls = this.cm.getCls(name);
Cls superCls = this.cm.getCls(superClass);
if (cls != null && cls.hasSuperclass(superCls)) {
return cls;
} else {
return null;
... | [
"private",
"Cls",
"readClass",
"(",
"String",
"name",
",",
"String",
"superClass",
")",
"throws",
"KnowledgeSourceReadException",
"{",
"Cls",
"cls",
"=",
"this",
".",
"cm",
".",
"getCls",
"(",
"name",
")",
";",
"Cls",
"superCls",
"=",
"this",
".",
"cm",
... | Returns the Cls from Protege if a matching Cls is found with the given
ancestor
@param name Name of the class to fetch
@param superClass name of the anscestor
@return A Cls containing the given class name
@throws KnowledgeSourceReadException | [
"Returns",
"the",
"Cls",
"from",
"Protege",
"if",
"a",
"matching",
"Cls",
"is",
"found",
"with",
"the",
"given",
"ancestor"
] | 5a620d1a407c7a5426d1cf17d47b97717cf71634 | https://github.com/eurekaclinical/protempa/blob/5a620d1a407c7a5426d1cf17d47b97717cf71634/protempa-ksb-protege/src/main/java/org/protempa/backend/ksb/protege/ProtegeKnowledgeSourceBackend.java#L222-L231 |
148,908 | netkicorp/java-wns-resolver | src/main/java/com/netki/tlsa/TLSAValidator.java | TLSAValidator.validateTLSA | public boolean validateTLSA(URL url) throws ValidSelfSignedCertException {
TLSARecord tlsaRecord = getTLSARecord(url);
if(tlsaRecord == null) {
return false;
}
List<Certificate> certs = getUrlCerts(url);
if(certs == null || certs.size() == 0) {
return fa... | java | public boolean validateTLSA(URL url) throws ValidSelfSignedCertException {
TLSARecord tlsaRecord = getTLSARecord(url);
if(tlsaRecord == null) {
return false;
}
List<Certificate> certs = getUrlCerts(url);
if(certs == null || certs.size() == 0) {
return fa... | [
"public",
"boolean",
"validateTLSA",
"(",
"URL",
"url",
")",
"throws",
"ValidSelfSignedCertException",
"{",
"TLSARecord",
"tlsaRecord",
"=",
"getTLSARecord",
"(",
"url",
")",
";",
"if",
"(",
"tlsaRecord",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
... | Validates a URL's TLSA Record
If the TLSA Record for the URL does not exist, validation fails.
@param url URL Root to Generate TLSA record query
@return TLSA Validated or not (boolean)
@throws ValidSelfSignedCertException Return Matching Self Signed Cert for Inclusion into CertStore | [
"Validates",
"a",
"URL",
"s",
"TLSA",
"Record"
] | a7aad04d96c03feb05536aef189617beb4f011bc | https://github.com/netkicorp/java-wns-resolver/blob/a7aad04d96c03feb05536aef189617beb4f011bc/src/main/java/com/netki/tlsa/TLSAValidator.java#L69-L110 |
148,909 | netkicorp/java-wns-resolver | src/main/java/com/netki/tlsa/TLSAValidator.java | TLSAValidator.isValidCertChain | public boolean isValidCertChain(Certificate targetCert, List<Certificate> certs) {
try {
KeyStore cacerts = this.caCertService.getCaCertKeystore();
for (Certificate cert : certs) {
if (cert == targetCert) continue;
cacerts.setCertificateEntry(((X509Certif... | java | public boolean isValidCertChain(Certificate targetCert, List<Certificate> certs) {
try {
KeyStore cacerts = this.caCertService.getCaCertKeystore();
for (Certificate cert : certs) {
if (cert == targetCert) continue;
cacerts.setCertificateEntry(((X509Certif... | [
"public",
"boolean",
"isValidCertChain",
"(",
"Certificate",
"targetCert",
",",
"List",
"<",
"Certificate",
">",
"certs",
")",
"{",
"try",
"{",
"KeyStore",
"cacerts",
"=",
"this",
".",
"caCertService",
".",
"getCaCertKeystore",
"(",
")",
";",
"for",
"(",
"Ce... | Validate whether the target cert is valid using the CA Certificate KeyStore and any included intermediate certificates
@param targetCert Target certificate to validate
@param certs Intermediate certificates to using during validation
@return isCertChainValid? | [
"Validate",
"whether",
"the",
"target",
"cert",
"is",
"valid",
"using",
"the",
"CA",
"Certificate",
"KeyStore",
"and",
"any",
"included",
"intermediate",
"certificates"
] | a7aad04d96c03feb05536aef189617beb4f011bc | https://github.com/netkicorp/java-wns-resolver/blob/a7aad04d96c03feb05536aef189617beb4f011bc/src/main/java/com/netki/tlsa/TLSAValidator.java#L118-L131 |
148,910 | netkicorp/java-wns-resolver | src/main/java/com/netki/tlsa/TLSAValidator.java | TLSAValidator.getMatchingCert | public Certificate getMatchingCert(TLSARecord tlsaRecord, List<Certificate> certs) {
for (Certificate cert : certs) {
byte[] digestMatch = new byte[0];
byte[] selectorData = new byte[0];
try {
// Get Selector Value
switch (tlsaRecord.getSele... | java | public Certificate getMatchingCert(TLSARecord tlsaRecord, List<Certificate> certs) {
for (Certificate cert : certs) {
byte[] digestMatch = new byte[0];
byte[] selectorData = new byte[0];
try {
// Get Selector Value
switch (tlsaRecord.getSele... | [
"public",
"Certificate",
"getMatchingCert",
"(",
"TLSARecord",
"tlsaRecord",
",",
"List",
"<",
"Certificate",
">",
"certs",
")",
"{",
"for",
"(",
"Certificate",
"cert",
":",
"certs",
")",
"{",
"byte",
"[",
"]",
"digestMatch",
"=",
"new",
"byte",
"[",
"0",
... | Returns the certificate matching the TLSA record from the given certs
@param tlsaRecord TLSARecord type describing the TLSA Record to be validated
@param certs All certs retrieved from the URL's SSL/TLS connection
@return Matching certificate or null | [
"Returns",
"the",
"certificate",
"matching",
"the",
"TLSA",
"record",
"from",
"the",
"given",
"certs"
] | a7aad04d96c03feb05536aef189617beb4f011bc | https://github.com/netkicorp/java-wns-resolver/blob/a7aad04d96c03feb05536aef189617beb4f011bc/src/main/java/com/netki/tlsa/TLSAValidator.java#L140-L181 |
148,911 | netkicorp/java-wns-resolver | src/main/java/com/netki/tlsa/TLSAValidator.java | TLSAValidator.getUrlCerts | public List<Certificate> getUrlCerts(URL url) {
SSLSocket socket = null;
TrustManager trm = new X509TrustManager() {
public X509Certificate[] getAcceptedIssuers() {
return null;
}
public void checkClientTrusted(X509Certificate[] certs, String authTy... | java | public List<Certificate> getUrlCerts(URL url) {
SSLSocket socket = null;
TrustManager trm = new X509TrustManager() {
public X509Certificate[] getAcceptedIssuers() {
return null;
}
public void checkClientTrusted(X509Certificate[] certs, String authTy... | [
"public",
"List",
"<",
"Certificate",
">",
"getUrlCerts",
"(",
"URL",
"url",
")",
"{",
"SSLSocket",
"socket",
"=",
"null",
";",
"TrustManager",
"trm",
"=",
"new",
"X509TrustManager",
"(",
")",
"{",
"public",
"X509Certificate",
"[",
"]",
"getAcceptedIssuers",
... | Gets all certificates from an HTTPS endpoint URL
@param url URL to get certificates from
@return List of certificates retrieves from SSL/TLS endpoint | [
"Gets",
"all",
"certificates",
"from",
"an",
"HTTPS",
"endpoint",
"URL"
] | a7aad04d96c03feb05536aef189617beb4f011bc | https://github.com/netkicorp/java-wns-resolver/blob/a7aad04d96c03feb05536aef189617beb4f011bc/src/main/java/com/netki/tlsa/TLSAValidator.java#L189-L227 |
148,912 | netkicorp/java-wns-resolver | src/main/java/com/netki/tlsa/TLSAValidator.java | TLSAValidator.getTLSARecord | public TLSARecord getTLSARecord(URL url) {
String recordValue;
int port = url.getPort();
if (port == -1) {
port = url.getDefaultPort();
}
String tlsaRecordName = String.format("_%s._tcp.%s", port, DNSUtil.ensureDot(url.getHost()));
try {
recordVa... | java | public TLSARecord getTLSARecord(URL url) {
String recordValue;
int port = url.getPort();
if (port == -1) {
port = url.getDefaultPort();
}
String tlsaRecordName = String.format("_%s._tcp.%s", port, DNSUtil.ensureDot(url.getHost()));
try {
recordVa... | [
"public",
"TLSARecord",
"getTLSARecord",
"(",
"URL",
"url",
")",
"{",
"String",
"recordValue",
";",
"int",
"port",
"=",
"url",
".",
"getPort",
"(",
")",
";",
"if",
"(",
"port",
"==",
"-",
"1",
")",
"{",
"port",
"=",
"url",
".",
"getDefaultPort",
"(",... | Handle DNSSEC resolution for the URL's associated TLSA record
@param url URL to get TLSA record for
@return TLSARecord is it exists or null | [
"Handle",
"DNSSEC",
"resolution",
"for",
"the",
"URL",
"s",
"associated",
"TLSA",
"record"
] | a7aad04d96c03feb05536aef189617beb4f011bc | https://github.com/netkicorp/java-wns-resolver/blob/a7aad04d96c03feb05536aef189617beb4f011bc/src/main/java/com/netki/tlsa/TLSAValidator.java#L235-L268 |
148,913 | eurekaclinical/protempa | protempa-framework/src/main/java/org/protempa/HorizontalTemporalInference.java | HorizontalTemporalInference.execute | <T extends TemporalProposition> boolean execute(
PropositionDefinition propDef, Segment<T> tp1, Segment<T> tp2) {
if (tp1 == null || tp2 == null) {
return false;
}
return executeInternal(propDef, tp1.getInterval(), tp2.getInterval());
} | java | <T extends TemporalProposition> boolean execute(
PropositionDefinition propDef, Segment<T> tp1, Segment<T> tp2) {
if (tp1 == null || tp2 == null) {
return false;
}
return executeInternal(propDef, tp1.getInterval(), tp2.getInterval());
} | [
"<",
"T",
"extends",
"TemporalProposition",
">",
"boolean",
"execute",
"(",
"PropositionDefinition",
"propDef",
",",
"Segment",
"<",
"T",
">",
"tp1",
",",
"Segment",
"<",
"T",
">",
"tp2",
")",
"{",
"if",
"(",
"tp1",
"==",
"null",
"||",
"tp2",
"==",
"nu... | Computes whether the union of two segments of temporal propositions
should be taken.
We assume that
<code>tp1</code> is before or at the same time as
<code>tp2</code>, and that
<code>tp1</code> and
<code>tp2</code> are instances of
<code>propDef</code>.
@param propDef a {@link PropositionDefinition}.
@param tp1 a {@l... | [
"Computes",
"whether",
"the",
"union",
"of",
"two",
"segments",
"of",
"temporal",
"propositions",
"should",
"be",
"taken",
"."
] | 5a620d1a407c7a5426d1cf17d47b97717cf71634 | https://github.com/eurekaclinical/protempa/blob/5a620d1a407c7a5426d1cf17d47b97717cf71634/protempa-framework/src/main/java/org/protempa/HorizontalTemporalInference.java#L62-L69 |
148,914 | eurekaclinical/protempa | protempa-dsb-relationaldb/src/main/java/org/protempa/backend/dsb/relationaldb/ColumnSpec.java | ColumnSpec.getTarget | String getTarget(Object source) {
if (this.mappings != null) {
return this.mappings.getTarget(source);
} else {
return null;
}
} | java | String getTarget(Object source) {
if (this.mappings != null) {
return this.mappings.getTarget(source);
} else {
return null;
}
} | [
"String",
"getTarget",
"(",
"Object",
"source",
")",
"{",
"if",
"(",
"this",
".",
"mappings",
"!=",
"null",
")",
"{",
"return",
"this",
".",
"mappings",
".",
"getTarget",
"(",
"source",
")",
";",
"}",
"else",
"{",
"return",
"null",
";",
"}",
"}"
] | Returns the proposition id corresponding to a specified value in this
column spec's column.
@param source
the value.
@return a proposition id {@link String} or <code>null</code> if a value
is specified that is not in this column spec's mappings from
proposition ids to values ({@link #getMappings() }
). | [
"Returns",
"the",
"proposition",
"id",
"corresponding",
"to",
"a",
"specified",
"value",
"in",
"this",
"column",
"spec",
"s",
"column",
"."
] | 5a620d1a407c7a5426d1cf17d47b97717cf71634 | https://github.com/eurekaclinical/protempa/blob/5a620d1a407c7a5426d1cf17d47b97717cf71634/protempa-dsb-relationaldb/src/main/java/org/protempa/backend/dsb/relationaldb/ColumnSpec.java#L338-L344 |
148,915 | eurekaclinical/protempa | protempa-dsb-relationaldb/src/main/java/org/protempa/backend/dsb/relationaldb/ColumnSpec.java | ColumnSpec.getLastSpec | public ColumnSpec getLastSpec() {
if (this.joinSpec == null) {
return this;
} else {
List<ColumnSpec> l = asList();
return l.get(l.size() - 1);
}
} | java | public ColumnSpec getLastSpec() {
if (this.joinSpec == null) {
return this;
} else {
List<ColumnSpec> l = asList();
return l.get(l.size() - 1);
}
} | [
"public",
"ColumnSpec",
"getLastSpec",
"(",
")",
"{",
"if",
"(",
"this",
".",
"joinSpec",
"==",
"null",
")",
"{",
"return",
"this",
";",
"}",
"else",
"{",
"List",
"<",
"ColumnSpec",
">",
"l",
"=",
"asList",
"(",
")",
";",
"return",
"l",
".",
"get",... | Gets the last column spec in the chain of column specs and joins.
@return a {@link ColumnSpec} | [
"Gets",
"the",
"last",
"column",
"spec",
"in",
"the",
"chain",
"of",
"column",
"specs",
"and",
"joins",
"."
] | 5a620d1a407c7a5426d1cf17d47b97717cf71634 | https://github.com/eurekaclinical/protempa/blob/5a620d1a407c7a5426d1cf17d47b97717cf71634/protempa-dsb-relationaldb/src/main/java/org/protempa/backend/dsb/relationaldb/ColumnSpec.java#L414-L421 |
148,916 | eurekaclinical/protempa | protempa-framework/src/main/java/org/protempa/proposition/value/AbsoluteTimeGranularity.java | AbsoluteTimeGranularity.toSQLString | public static String toSQLString(Long position) {
java.util.Date date = AbsoluteTimeGranularityUtil.asDate(position);
return new Timestamp(date.getTime()).toString();
} | java | public static String toSQLString(Long position) {
java.util.Date date = AbsoluteTimeGranularityUtil.asDate(position);
return new Timestamp(date.getTime()).toString();
} | [
"public",
"static",
"String",
"toSQLString",
"(",
"Long",
"position",
")",
"{",
"java",
".",
"util",
".",
"Date",
"date",
"=",
"AbsoluteTimeGranularityUtil",
".",
"asDate",
"(",
"position",
")",
";",
"return",
"new",
"Timestamp",
"(",
"date",
".",
"getTime",... | Convenience method to translate a timestamp into the format expected by
SQL.
@param position a date/time in milliseconds since the epoch.
@return a {@link String} in JDBC timestamp escape format. | [
"Convenience",
"method",
"to",
"translate",
"a",
"timestamp",
"into",
"the",
"format",
"expected",
"by",
"SQL",
"."
] | 5a620d1a407c7a5426d1cf17d47b97717cf71634 | https://github.com/eurekaclinical/protempa/blob/5a620d1a407c7a5426d1cf17d47b97717cf71634/protempa-framework/src/main/java/org/protempa/proposition/value/AbsoluteTimeGranularity.java#L585-L588 |
148,917 | openbase/jul | visual/javafx/src/main/java/org/openbase/jul/visual/javafx/geometry/svg/SVGIcon.java | SVGIcon.fadeForegroundIconColorFromOpaqueToTransparent | public void fadeForegroundIconColorFromOpaqueToTransparent(final int cycleCount) {
stopForegroundIconColorFadeAnimation();
foregroundColorFadeAnimation = Animations.createFadeTransition(foregroundIcon, JFXConstants.TRANSPARENCY_NONE, JFXConstants.TRANSPARENCY_FULLY, cycleCount, JFXConstants.ANIMATION_DU... | java | public void fadeForegroundIconColorFromOpaqueToTransparent(final int cycleCount) {
stopForegroundIconColorFadeAnimation();
foregroundColorFadeAnimation = Animations.createFadeTransition(foregroundIcon, JFXConstants.TRANSPARENCY_NONE, JFXConstants.TRANSPARENCY_FULLY, cycleCount, JFXConstants.ANIMATION_DU... | [
"public",
"void",
"fadeForegroundIconColorFromOpaqueToTransparent",
"(",
"final",
"int",
"cycleCount",
")",
"{",
"stopForegroundIconColorFadeAnimation",
"(",
")",
";",
"foregroundColorFadeAnimation",
"=",
"Animations",
".",
"createFadeTransition",
"(",
"foregroundIcon",
",",
... | Apply and play a FadeTransition on the icon in the foregroundIcon.
This Transition modifies the opacity of the foregroundIcon from opaque to fully transparent.
@param cycleCount the number of times the animation should be played (use Animation.INDEFINITE for endless) | [
"Apply",
"and",
"play",
"a",
"FadeTransition",
"on",
"the",
"icon",
"in",
"the",
"foregroundIcon",
".",
"This",
"Transition",
"modifies",
"the",
"opacity",
"of",
"the",
"foregroundIcon",
"from",
"opaque",
"to",
"fully",
"transparent",
"."
] | 662e98c3a853085e475be54c3be3deb72193c72d | https://github.com/openbase/jul/blob/662e98c3a853085e475be54c3be3deb72193c72d/visual/javafx/src/main/java/org/openbase/jul/visual/javafx/geometry/svg/SVGIcon.java#L189-L194 |
148,918 | openbase/jul | visual/javafx/src/main/java/org/openbase/jul/visual/javafx/geometry/svg/SVGIcon.java | SVGIcon.fadeBackgroundIconColorFromTransparentToOpaque | public void fadeBackgroundIconColorFromTransparentToOpaque(final int cycleCount) {
stopBackgroundIconColorFadeAnimation();
backgroundIconColorFadeAnimation = Animations.createFadeTransition(backgroundIcon, JFXConstants.TRANSPARENCY_FULLY, JFXConstants.TRANSPARENCY_NONE, 1, JFXConstants.ANIMATION_DURATIO... | java | public void fadeBackgroundIconColorFromTransparentToOpaque(final int cycleCount) {
stopBackgroundIconColorFadeAnimation();
backgroundIconColorFadeAnimation = Animations.createFadeTransition(backgroundIcon, JFXConstants.TRANSPARENCY_FULLY, JFXConstants.TRANSPARENCY_NONE, 1, JFXConstants.ANIMATION_DURATIO... | [
"public",
"void",
"fadeBackgroundIconColorFromTransparentToOpaque",
"(",
"final",
"int",
"cycleCount",
")",
"{",
"stopBackgroundIconColorFadeAnimation",
"(",
")",
";",
"backgroundIconColorFadeAnimation",
"=",
"Animations",
".",
"createFadeTransition",
"(",
"backgroundIcon",
"... | Apply and play a FadeTransition on the icon in the foregroundIcon.
This Transition modifies the opacity of the foregroundIcon from fully transparent to opaque.
@param cycleCount the number of times the animation should be played (use Animation.INDEFINITE for endless) | [
"Apply",
"and",
"play",
"a",
"FadeTransition",
"on",
"the",
"icon",
"in",
"the",
"foregroundIcon",
".",
"This",
"Transition",
"modifies",
"the",
"opacity",
"of",
"the",
"foregroundIcon",
"from",
"fully",
"transparent",
"to",
"opaque",
"."
] | 662e98c3a853085e475be54c3be3deb72193c72d | https://github.com/openbase/jul/blob/662e98c3a853085e475be54c3be3deb72193c72d/visual/javafx/src/main/java/org/openbase/jul/visual/javafx/geometry/svg/SVGIcon.java#L202-L207 |
148,919 | openbase/jul | visual/javafx/src/main/java/org/openbase/jul/visual/javafx/geometry/svg/SVGIcon.java | SVGIcon.startBackgroundIconColorFadeAnimation | public void startBackgroundIconColorFadeAnimation(final int cycleCount) {
if (backgroundIcon == null) {
LOGGER.warn("Background animation skipped because background icon not set!");
return;
}
backgroundIconColorFadeAnimation = Animations.createFadeTransition(backgroundIco... | java | public void startBackgroundIconColorFadeAnimation(final int cycleCount) {
if (backgroundIcon == null) {
LOGGER.warn("Background animation skipped because background icon not set!");
return;
}
backgroundIconColorFadeAnimation = Animations.createFadeTransition(backgroundIco... | [
"public",
"void",
"startBackgroundIconColorFadeAnimation",
"(",
"final",
"int",
"cycleCount",
")",
"{",
"if",
"(",
"backgroundIcon",
"==",
"null",
")",
"{",
"LOGGER",
".",
"warn",
"(",
"\"Background animation skipped because background icon not set!\"",
")",
";",
"retur... | Method starts the fade animation of the background icon color.
@param cycleCount the number of times the animation should be played (use Animation.INDEFINITE for endless) | [
"Method",
"starts",
"the",
"fade",
"animation",
"of",
"the",
"background",
"icon",
"color",
"."
] | 662e98c3a853085e475be54c3be3deb72193c72d | https://github.com/openbase/jul/blob/662e98c3a853085e475be54c3be3deb72193c72d/visual/javafx/src/main/java/org/openbase/jul/visual/javafx/geometry/svg/SVGIcon.java#L238-L246 |
148,920 | openbase/jul | visual/javafx/src/main/java/org/openbase/jul/visual/javafx/geometry/svg/SVGIcon.java | SVGIcon.startForegroundIconRotateAnimation | public void startForegroundIconRotateAnimation(final double fromAngle, final double toAngle, final int cycleCount, final double duration, final Interpolator interpolator, final boolean autoReverse) {
stopForegroundIconRotateAnimation();
foregroundRotateAnimation = Animations.createRotateTransition(foreg... | java | public void startForegroundIconRotateAnimation(final double fromAngle, final double toAngle, final int cycleCount, final double duration, final Interpolator interpolator, final boolean autoReverse) {
stopForegroundIconRotateAnimation();
foregroundRotateAnimation = Animations.createRotateTransition(foreg... | [
"public",
"void",
"startForegroundIconRotateAnimation",
"(",
"final",
"double",
"fromAngle",
",",
"final",
"double",
"toAngle",
",",
"final",
"int",
"cycleCount",
",",
"final",
"double",
"duration",
",",
"final",
"Interpolator",
"interpolator",
",",
"final",
"boolea... | Method starts the rotate animation of the foreground icon.
@param fromAngle the rotation angle where the transition should start.
@param toAngle the rotation angle where the transition should end.
@param cycleCount the number of times the animation should be played (use Animation.INDEFINITE for endless).
@pa... | [
"Method",
"starts",
"the",
"rotate",
"animation",
"of",
"the",
"foreground",
"icon",
"."
] | 662e98c3a853085e475be54c3be3deb72193c72d | https://github.com/openbase/jul/blob/662e98c3a853085e475be54c3be3deb72193c72d/visual/javafx/src/main/java/org/openbase/jul/visual/javafx/geometry/svg/SVGIcon.java#L359-L364 |
148,921 | openbase/jul | visual/javafx/src/main/java/org/openbase/jul/visual/javafx/geometry/svg/SVGIcon.java | SVGIcon.startBackgroundIconRotateAnimation | public void startBackgroundIconRotateAnimation(final double fromAngle, final double toAngle, final int cycleCount, final double duration, final Interpolator interpolator, final boolean autoReverse) {
stopBackgroundIconRotateAnimation();
backgroundRotateAnimation = Animations.createRotateTransition(backg... | java | public void startBackgroundIconRotateAnimation(final double fromAngle, final double toAngle, final int cycleCount, final double duration, final Interpolator interpolator, final boolean autoReverse) {
stopBackgroundIconRotateAnimation();
backgroundRotateAnimation = Animations.createRotateTransition(backg... | [
"public",
"void",
"startBackgroundIconRotateAnimation",
"(",
"final",
"double",
"fromAngle",
",",
"final",
"double",
"toAngle",
",",
"final",
"int",
"cycleCount",
",",
"final",
"double",
"duration",
",",
"final",
"Interpolator",
"interpolator",
",",
"final",
"boolea... | Method starts the rotate animation of the background icon.
@param fromAngle the rotation angle where the transition should start.
@param toAngle the rotation angle where the transition should end.
@param cycleCount the number of times the animation should be played (use Animation.INDEFINITE for endless).
@pa... | [
"Method",
"starts",
"the",
"rotate",
"animation",
"of",
"the",
"background",
"icon",
"."
] | 662e98c3a853085e475be54c3be3deb72193c72d | https://github.com/openbase/jul/blob/662e98c3a853085e475be54c3be3deb72193c72d/visual/javafx/src/main/java/org/openbase/jul/visual/javafx/geometry/svg/SVGIcon.java#L376-L381 |
148,922 | openbase/jul | visual/javafx/src/main/java/org/openbase/jul/visual/javafx/geometry/svg/SVGIcon.java | SVGIcon.setForegroundIconColorDefault | public void setForegroundIconColorDefault() {
stopForegroundIconColorFadeAnimation();
foregroundIcon.getStyleClass().clear();
foregroundIcon.getStyleClass().add(JFXConstants.CSS_ICON);
foregroundFadeIcon.setFill(Color.TRANSPARENT);
} | java | public void setForegroundIconColorDefault() {
stopForegroundIconColorFadeAnimation();
foregroundIcon.getStyleClass().clear();
foregroundIcon.getStyleClass().add(JFXConstants.CSS_ICON);
foregroundFadeIcon.setFill(Color.TRANSPARENT);
} | [
"public",
"void",
"setForegroundIconColorDefault",
"(",
")",
"{",
"stopForegroundIconColorFadeAnimation",
"(",
")",
";",
"foregroundIcon",
".",
"getStyleClass",
"(",
")",
".",
"clear",
"(",
")",
";",
"foregroundIcon",
".",
"getStyleClass",
"(",
")",
".",
"add",
... | Reset the current foreground icon color to default. | [
"Reset",
"the",
"current",
"foreground",
"icon",
"color",
"to",
"default",
"."
] | 662e98c3a853085e475be54c3be3deb72193c72d | https://github.com/openbase/jul/blob/662e98c3a853085e475be54c3be3deb72193c72d/visual/javafx/src/main/java/org/openbase/jul/visual/javafx/geometry/svg/SVGIcon.java#L488-L493 |
148,923 | openbase/jul | visual/javafx/src/main/java/org/openbase/jul/visual/javafx/geometry/svg/SVGIcon.java | SVGIcon.setBackgroundIconColorDefault | public void setBackgroundIconColorDefault() {
if (backgroundIcon == null) {
LOGGER.warn("Background modification skipped because background icon not set!");
return;
}
stopBackgroundIconColorFadeAnimation();
backgroundIcon.getStyleClass().clear();
backgroun... | java | public void setBackgroundIconColorDefault() {
if (backgroundIcon == null) {
LOGGER.warn("Background modification skipped because background icon not set!");
return;
}
stopBackgroundIconColorFadeAnimation();
backgroundIcon.getStyleClass().clear();
backgroun... | [
"public",
"void",
"setBackgroundIconColorDefault",
"(",
")",
"{",
"if",
"(",
"backgroundIcon",
"==",
"null",
")",
"{",
"LOGGER",
".",
"warn",
"(",
"\"Background modification skipped because background icon not set!\"",
")",
";",
"return",
";",
"}",
"stopBackgroundIconCo... | Reset the current background icon color to default. | [
"Reset",
"the",
"current",
"background",
"icon",
"color",
"to",
"default",
"."
] | 662e98c3a853085e475be54c3be3deb72193c72d | https://github.com/openbase/jul/blob/662e98c3a853085e475be54c3be3deb72193c72d/visual/javafx/src/main/java/org/openbase/jul/visual/javafx/geometry/svg/SVGIcon.java#L498-L507 |
148,924 | byoutline/CachedField | cachedfield/src/main/java/com/byoutline/cachedfield/internal/ValueLoader.java | ValueLoader.loadValue | public synchronized void loadValue(final ARG_TYPE arg) {
if (fetchFuture != null) {
// Cancel thread if it was not yet starter.
fetchFuture.cancel(false);
// If thread was cancelled before it was started inform error listeners.
if (fetchThread != null) {
... | java | public synchronized void loadValue(final ARG_TYPE arg) {
if (fetchFuture != null) {
// Cancel thread if it was not yet starter.
fetchFuture.cancel(false);
// If thread was cancelled before it was started inform error listeners.
if (fetchThread != null) {
... | [
"public",
"synchronized",
"void",
"loadValue",
"(",
"final",
"ARG_TYPE",
"arg",
")",
"{",
"if",
"(",
"fetchFuture",
"!=",
"null",
")",
"{",
"// Cancel thread if it was not yet starter.",
"fetchFuture",
".",
"cancel",
"(",
"false",
")",
";",
"// If thread was cancell... | Loads value in separate thread. | [
"Loads",
"value",
"in",
"separate",
"thread",
"."
] | 73d83072cdca22d2b3f5b3d60a93b8a26d9513e6 | https://github.com/byoutline/CachedField/blob/73d83072cdca22d2b3f5b3d60a93b8a26d9513e6/cachedfield/src/main/java/com/byoutline/cachedfield/internal/ValueLoader.java#L39-L54 |
148,925 | openbase/jul | extension/type/processing/src/main/java/org/openbase/jul/extension/type/processing/MetaConfigProcessor.java | MetaConfigProcessor.getValue | public static String getValue(final MetaConfig metaConfig, final String key) throws NotAvailableException {
for (EntryType.Entry entry : metaConfig.getEntryList()) {
if (entry.getKey().equals(key)) {
if (!entry.getValue().isEmpty()) {
return entry.getValue();
... | java | public static String getValue(final MetaConfig metaConfig, final String key) throws NotAvailableException {
for (EntryType.Entry entry : metaConfig.getEntryList()) {
if (entry.getKey().equals(key)) {
if (!entry.getValue().isEmpty()) {
return entry.getValue();
... | [
"public",
"static",
"String",
"getValue",
"(",
"final",
"MetaConfig",
"metaConfig",
",",
"final",
"String",
"key",
")",
"throws",
"NotAvailableException",
"{",
"for",
"(",
"EntryType",
".",
"Entry",
"entry",
":",
"metaConfig",
".",
"getEntryList",
"(",
")",
")... | Resolves the key to the value entry of the given meta config.
@param metaConfig key value set
@param key the key to resolve
@return the related value of the given key.
@throws org.openbase.jul.exception.NotAvailableException si thrown if not value for the given key could be resolved. | [
"Resolves",
"the",
"key",
"to",
"the",
"value",
"entry",
"of",
"the",
"given",
"meta",
"config",
"."
] | 662e98c3a853085e475be54c3be3deb72193c72d | https://github.com/openbase/jul/blob/662e98c3a853085e475be54c3be3deb72193c72d/extension/type/processing/src/main/java/org/openbase/jul/extension/type/processing/MetaConfigProcessor.java#L46-L55 |
148,926 | jbundle/jcalendarbutton | src/main/java/org/jbundle/util/jcalendarbutton/JTimePopup.java | JTimePopup.init | public void init(String strDateParam, Date timeTarget, String strLanguage)
{
if (strDateParam != null)
m_strDateParam = strDateParam; // Property name
timeNow = new Date();
if (timeTarget == null)
timeTarget = timeNow;
selectedTime = timeTarget;
... | java | public void init(String strDateParam, Date timeTarget, String strLanguage)
{
if (strDateParam != null)
m_strDateParam = strDateParam; // Property name
timeNow = new Date();
if (timeTarget == null)
timeTarget = timeNow;
selectedTime = timeTarget;
... | [
"public",
"void",
"init",
"(",
"String",
"strDateParam",
",",
"Date",
"timeTarget",
",",
"String",
"strLanguage",
")",
"{",
"if",
"(",
"strDateParam",
"!=",
"null",
")",
"m_strDateParam",
"=",
"strDateParam",
";",
"// Property name",
"timeNow",
"=",
"new",
"Da... | Creates new form TimePopup.
@param strDateParam The name of the date property (defaults to "date").
@param date The initial date for this button.
@param strLanguage The language to use. | [
"Creates",
"new",
"form",
"TimePopup",
"."
] | 2944e6a0b634b83768d5c0b7b4a2898176421403 | https://github.com/jbundle/jcalendarbutton/blob/2944e6a0b634b83768d5c0b7b4a2898176421403/src/main/java/org/jbundle/util/jcalendarbutton/JTimePopup.java#L120-L143 |
148,927 | jbundle/jcalendarbutton | src/main/java/org/jbundle/util/jcalendarbutton/JTimePopup.java | JTimePopup.valueChanged | public void valueChanged(ListSelectionEvent e)
{
int index = this.getSelectedIndex();
if (index != -1)
{
int hour = index / 2;
int minute = (int)(((float)index / 2 - hour) * 60);
calendar.setTime(targetTime);
calendar.set(Calendar.HOUR_OF_DAY, hour);
calendar.... | java | public void valueChanged(ListSelectionEvent e)
{
int index = this.getSelectedIndex();
if (index != -1)
{
int hour = index / 2;
int minute = (int)(((float)index / 2 - hour) * 60);
calendar.setTime(targetTime);
calendar.set(Calendar.HOUR_OF_DAY, hour);
calendar.... | [
"public",
"void",
"valueChanged",
"(",
"ListSelectionEvent",
"e",
")",
"{",
"int",
"index",
"=",
"this",
".",
"getSelectedIndex",
"(",
")",
";",
"if",
"(",
"index",
"!=",
"-",
"1",
")",
"{",
"int",
"hour",
"=",
"index",
"/",
"2",
";",
"int",
"minute"... | Called whenever the value of the selection changes.
@param e the event that characterizes the change. | [
"Called",
"whenever",
"the",
"value",
"of",
"the",
"selection",
"changes",
"."
] | 2944e6a0b634b83768d5c0b7b4a2898176421403 | https://github.com/jbundle/jcalendarbutton/blob/2944e6a0b634b83768d5c0b7b4a2898176421403/src/main/java/org/jbundle/util/jcalendarbutton/JTimePopup.java#L255-L283 |
148,928 | eurekaclinical/protempa | protempa-framework/src/main/java/org/protempa/proposition/AbstractProposition.java | AbstractProposition.initializeAbstractProposition | protected final void initializeAbstractProposition(String id,
UniqueId uniqueId) {
this.uniqueId = uniqueId;
if (id == null) {
this.id = "";
} else {
this.id = id.intern();
}
} | java | protected final void initializeAbstractProposition(String id,
UniqueId uniqueId) {
this.uniqueId = uniqueId;
if (id == null) {
this.id = "";
} else {
this.id = id.intern();
}
} | [
"protected",
"final",
"void",
"initializeAbstractProposition",
"(",
"String",
"id",
",",
"UniqueId",
"uniqueId",
")",
"{",
"this",
".",
"uniqueId",
"=",
"uniqueId",
";",
"if",
"(",
"id",
"==",
"null",
")",
"{",
"this",
".",
"id",
"=",
"\"\"",
";",
"}",
... | Assigns fields specified in the constructor. This is pulled into a method
so that deserialization can initialize those fields correctly.
@param id the proposition id.
@param uniqueId the proposition's unique id. | [
"Assigns",
"fields",
"specified",
"in",
"the",
"constructor",
".",
"This",
"is",
"pulled",
"into",
"a",
"method",
"so",
"that",
"deserialization",
"can",
"initialize",
"those",
"fields",
"correctly",
"."
] | 5a620d1a407c7a5426d1cf17d47b97717cf71634 | https://github.com/eurekaclinical/protempa/blob/5a620d1a407c7a5426d1cf17d47b97717cf71634/protempa-framework/src/main/java/org/protempa/proposition/AbstractProposition.java#L96-L104 |
148,929 | rolfl/MicroBench | src/main/java/net/tuis/ubench/scale/MathEquation.java | MathEquation.getDescription | public String getDescription() {
Object[] params = new Object[parameters.length];
for (int i = 0; i < parameters.length; i++) {
params[i] = parameters[i];
}
return String.format(format, params);
} | java | public String getDescription() {
Object[] params = new Object[parameters.length];
for (int i = 0; i < parameters.length; i++) {
params[i] = parameters[i];
}
return String.format(format, params);
} | [
"public",
"String",
"getDescription",
"(",
")",
"{",
"Object",
"[",
"]",
"params",
"=",
"new",
"Object",
"[",
"parameters",
".",
"length",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"parameters",
".",
"length",
";",
"i",
"++",
")",
... | Get a text-based description of this equation
@return the string version of this equation | [
"Get",
"a",
"text",
"-",
"based",
"description",
"of",
"this",
"equation"
] | f2bfa92dacd7ea0d6b8eae4d4fe2975139d317ce | https://github.com/rolfl/MicroBench/blob/f2bfa92dacd7ea0d6b8eae4d4fe2975139d317ce/src/main/java/net/tuis/ubench/scale/MathEquation.java#L51-L57 |
148,930 | rolfl/MicroBench | src/main/java/net/tuis/ubench/scale/MathEquation.java | MathEquation.toJSONString | public String toJSONString() {
String parms = DoubleStream.of(parameters)
.mapToObj(d -> String.format("%f", d))
.collect(Collectors.joining(", ", "[", "]"));
String desc = String.format(format, DoubleStream.of(parameters).mapToObj(Double::valueOf).toArray());
re... | java | public String toJSONString() {
String parms = DoubleStream.of(parameters)
.mapToObj(d -> String.format("%f", d))
.collect(Collectors.joining(", ", "[", "]"));
String desc = String.format(format, DoubleStream.of(parameters).mapToObj(Double::valueOf).toArray());
re... | [
"public",
"String",
"toJSONString",
"(",
")",
"{",
"String",
"parms",
"=",
"DoubleStream",
".",
"of",
"(",
"parameters",
")",
".",
"mapToObj",
"(",
"d",
"->",
"String",
".",
"format",
"(",
"\"%f\"",
",",
"d",
")",
")",
".",
"collect",
"(",
"Collectors"... | Convert this equation in to a JSON string representing the vital
statistics of the equation.
@return a JSON interpretation of this equation. | [
"Convert",
"this",
"equation",
"in",
"to",
"a",
"JSON",
"string",
"representing",
"the",
"vital",
"statistics",
"of",
"the",
"equation",
"."
] | f2bfa92dacd7ea0d6b8eae4d4fe2975139d317ce | https://github.com/rolfl/MicroBench/blob/f2bfa92dacd7ea0d6b8eae4d4fe2975139d317ce/src/main/java/net/tuis/ubench/scale/MathEquation.java#L117-L126 |
148,931 | rolfl/MicroBench | src/main/java/net/tuis/ubench/scale/MathEquation.java | MathEquation.isValid | public boolean isValid() {
return Math.abs(parameters[0]) >= 0.001 && rSquared != Double.NEGATIVE_INFINITY && !Double.isNaN(rSquared);
} | java | public boolean isValid() {
return Math.abs(parameters[0]) >= 0.001 && rSquared != Double.NEGATIVE_INFINITY && !Double.isNaN(rSquared);
} | [
"public",
"boolean",
"isValid",
"(",
")",
"{",
"return",
"Math",
".",
"abs",
"(",
"parameters",
"[",
"0",
"]",
")",
">=",
"0.001",
"&&",
"rSquared",
"!=",
"Double",
".",
"NEGATIVE_INFINITY",
"&&",
"!",
"Double",
".",
"isNaN",
"(",
"rSquared",
")",
";",... | Indicate whether this equation is a suitable match against the actual
data.
@return true if this equation is useful when representing the actual
data's scalability | [
"Indicate",
"whether",
"this",
"equation",
"is",
"a",
"suitable",
"match",
"against",
"the",
"actual",
"data",
"."
] | f2bfa92dacd7ea0d6b8eae4d4fe2975139d317ce | https://github.com/rolfl/MicroBench/blob/f2bfa92dacd7ea0d6b8eae4d4fe2975139d317ce/src/main/java/net/tuis/ubench/scale/MathEquation.java#L135-L137 |
148,932 | openbase/jul | extension/protobuf/src/main/java/org/openbase/jul/extension/protobuf/processing/ProtoBufJSonProcessor.java | ProtoBufJSonProcessor.serialize | public String serialize(final Object serviceState) throws InvalidStateException, CouldNotPerformException {
String jsonStringRep;
if (serviceState instanceof Message) {
try {
jsonStringRep = jsonFormat.printToString((Message) serviceState);
} catch (Exception ex) ... | java | public String serialize(final Object serviceState) throws InvalidStateException, CouldNotPerformException {
String jsonStringRep;
if (serviceState instanceof Message) {
try {
jsonStringRep = jsonFormat.printToString((Message) serviceState);
} catch (Exception ex) ... | [
"public",
"String",
"serialize",
"(",
"final",
"Object",
"serviceState",
")",
"throws",
"InvalidStateException",
",",
"CouldNotPerformException",
"{",
"String",
"jsonStringRep",
";",
"if",
"(",
"serviceState",
"instanceof",
"Message",
")",
"{",
"try",
"{",
"jsonStri... | Serialize a serviceState which can be a proto message, enumeration or
a java primitive to string. If its a primitive toString is called while
messages or enumerations will be serialized into JSon
@param serviceState
@return
@throws org.openbase.jul.exception.InvalidStateException in case the given service argument d... | [
"Serialize",
"a",
"serviceState",
"which",
"can",
"be",
"a",
"proto",
"message",
"enumeration",
"or",
"a",
"java",
"primitive",
"to",
"string",
".",
"If",
"its",
"a",
"primitive",
"toString",
"is",
"called",
"while",
"messages",
"or",
"enumerations",
"will",
... | 662e98c3a853085e475be54c3be3deb72193c72d | https://github.com/openbase/jul/blob/662e98c3a853085e475be54c3be3deb72193c72d/extension/protobuf/src/main/java/org/openbase/jul/extension/protobuf/processing/ProtoBufJSonProcessor.java#L66-L79 |
148,933 | openbase/jul | extension/protobuf/src/main/java/org/openbase/jul/extension/protobuf/processing/ProtoBufJSonProcessor.java | ProtoBufJSonProcessor.getServiceStateClassName | public String getServiceStateClassName(final Object serviceState) throws CouldNotPerformException {
// todo: move to dal or any bco component. Jul should be independent from bco architecture.
if (serviceState.getClass().getName().startsWith("org.openbase.type")) {
return serviceState.getClas... | java | public String getServiceStateClassName(final Object serviceState) throws CouldNotPerformException {
// todo: move to dal or any bco component. Jul should be independent from bco architecture.
if (serviceState.getClass().getName().startsWith("org.openbase.type")) {
return serviceState.getClas... | [
"public",
"String",
"getServiceStateClassName",
"(",
"final",
"Object",
"serviceState",
")",
"throws",
"CouldNotPerformException",
"{",
"// todo: move to dal or any bco component. Jul should be independent from bco architecture.",
"if",
"(",
"serviceState",
".",
"getClass",
"(",
... | Get the string representation for a given serviceState which can be a
proto message, enumeration or a java primitive.
@param serviceState the serviceState
@return a string representation of the serviceState type
@throws CouldNotPerformException | [
"Get",
"the",
"string",
"representation",
"for",
"a",
"given",
"serviceState",
"which",
"can",
"be",
"a",
"proto",
"message",
"enumeration",
"or",
"a",
"java",
"primitive",
"."
] | 662e98c3a853085e475be54c3be3deb72193c72d | https://github.com/openbase/jul/blob/662e98c3a853085e475be54c3be3deb72193c72d/extension/protobuf/src/main/java/org/openbase/jul/extension/protobuf/processing/ProtoBufJSonProcessor.java#L91-L111 |
148,934 | ebean-orm/querybean-agent-now-merged-into-ebean-agent- | src/main/java/io/ebean/typequery/agent/TypeQueryClassAdapter.java | TypeQueryClassAdapter.hasEntityBeanInterface | private boolean hasEntityBeanInterface(String[] interfaces) {
for (int i = 0; i < interfaces.length; i++) {
if (interfaces[i].equals(C_ENTITYBEAN)) {
return true;
}
}
return false;
} | java | private boolean hasEntityBeanInterface(String[] interfaces) {
for (int i = 0; i < interfaces.length; i++) {
if (interfaces[i].equals(C_ENTITYBEAN)) {
return true;
}
}
return false;
} | [
"private",
"boolean",
"hasEntityBeanInterface",
"(",
"String",
"[",
"]",
"interfaces",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"interfaces",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
"(",
"interfaces",
"[",
"i",
"]",
".",
"e... | Return true if this case the EntityBean interface. | [
"Return",
"true",
"if",
"this",
"case",
"the",
"EntityBean",
"interface",
"."
] | a063554fabdbed15ff5e10ad0a0b53b67e039006 | https://github.com/ebean-orm/querybean-agent-now-merged-into-ebean-agent-/blob/a063554fabdbed15ff5e10ad0a0b53b67e039006/src/main/java/io/ebean/typequery/agent/TypeQueryClassAdapter.java#L46-L53 |
148,935 | ebean-orm/querybean-agent-now-merged-into-ebean-agent- | src/main/java/io/ebean/typequery/agent/TypeQueryClassAdapter.java | TypeQueryClassAdapter.getDomainClass | protected String getDomainClass() {
int posStart = signature.indexOf('<');
int posEnd = signature.indexOf(';', posStart + 1);
return signature.substring(posStart + 2, posEnd);
} | java | protected String getDomainClass() {
int posStart = signature.indexOf('<');
int posEnd = signature.indexOf(';', posStart + 1);
return signature.substring(posStart + 2, posEnd);
} | [
"protected",
"String",
"getDomainClass",
"(",
")",
"{",
"int",
"posStart",
"=",
"signature",
".",
"indexOf",
"(",
"'",
"'",
")",
";",
"int",
"posEnd",
"=",
"signature",
".",
"indexOf",
"(",
"'",
"'",
",",
"posStart",
"+",
"1",
")",
";",
"return",
"si... | Extract and return the associated entity bean class from the signature. | [
"Extract",
"and",
"return",
"the",
"associated",
"entity",
"bean",
"class",
"from",
"the",
"signature",
"."
] | a063554fabdbed15ff5e10ad0a0b53b67e039006 | https://github.com/ebean-orm/querybean-agent-now-merged-into-ebean-agent-/blob/a063554fabdbed15ff5e10ad0a0b53b67e039006/src/main/java/io/ebean/typequery/agent/TypeQueryClassAdapter.java#L58-L62 |
148,936 | ebean-orm/querybean-agent-now-merged-into-ebean-agent- | src/main/java/io/ebean/typequery/agent/TypeQueryClassAdapter.java | TypeQueryClassAdapter.visitAnnotation | @Override
public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
classInfo.checkTypeQueryAnnotation(desc);
return super.visitAnnotation(desc, visible);
} | java | @Override
public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
classInfo.checkTypeQueryAnnotation(desc);
return super.visitAnnotation(desc, visible);
} | [
"@",
"Override",
"public",
"AnnotationVisitor",
"visitAnnotation",
"(",
"String",
"desc",
",",
"boolean",
"visible",
")",
"{",
"classInfo",
".",
"checkTypeQueryAnnotation",
"(",
"desc",
")",
";",
"return",
"super",
".",
"visitAnnotation",
"(",
"desc",
",",
"visi... | Look for TypeQueryBean annotation. | [
"Look",
"for",
"TypeQueryBean",
"annotation",
"."
] | a063554fabdbed15ff5e10ad0a0b53b67e039006 | https://github.com/ebean-orm/querybean-agent-now-merged-into-ebean-agent-/blob/a063554fabdbed15ff5e10ad0a0b53b67e039006/src/main/java/io/ebean/typequery/agent/TypeQueryClassAdapter.java#L67-L71 |
148,937 | ebean-orm/querybean-agent-now-merged-into-ebean-agent- | src/main/java/io/ebean/typequery/agent/TypeQueryClassAdapter.java | TypeQueryClassAdapter.handleAssocBeanConstructor | private MethodVisitor handleAssocBeanConstructor(int access, String name, String desc, String signature, String[] exceptions) {
if (desc.equals(ASSOC_BEAN_BASIC_CONSTRUCTOR_DESC)) {
classInfo.setHasBasicConstructor();
return new TypeQueryAssocBasicConstructor(classInfo, cv, desc, signature);
}
... | java | private MethodVisitor handleAssocBeanConstructor(int access, String name, String desc, String signature, String[] exceptions) {
if (desc.equals(ASSOC_BEAN_BASIC_CONSTRUCTOR_DESC)) {
classInfo.setHasBasicConstructor();
return new TypeQueryAssocBasicConstructor(classInfo, cv, desc, signature);
}
... | [
"private",
"MethodVisitor",
"handleAssocBeanConstructor",
"(",
"int",
"access",
",",
"String",
"name",
",",
"String",
"desc",
",",
"String",
"signature",
",",
"String",
"[",
"]",
"exceptions",
")",
"{",
"if",
"(",
"desc",
".",
"equals",
"(",
"ASSOC_BEAN_BASIC_... | Handle the constructors for assoc type query beans. | [
"Handle",
"the",
"constructors",
"for",
"assoc",
"type",
"query",
"beans",
"."
] | a063554fabdbed15ff5e10ad0a0b53b67e039006 | https://github.com/ebean-orm/querybean-agent-now-merged-into-ebean-agent-/blob/a063554fabdbed15ff5e10ad0a0b53b67e039006/src/main/java/io/ebean/typequery/agent/TypeQueryClassAdapter.java#L129-L141 |
148,938 | ebean-orm/querybean-agent-now-merged-into-ebean-agent- | src/main/java/io/ebean/typequery/agent/TypeQueryClassAdapter.java | TypeQueryClassAdapter.addMarkerAnnotation | private void addMarkerAnnotation() {
if (isLog(4)) {
log("... adding marker annotation");
}
AnnotationVisitor av = cv.visitAnnotation(ANNOTATION_ALREADY_ENHANCED_MARKER, true);
if (av != null) {
av.visitEnd();
}
} | java | private void addMarkerAnnotation() {
if (isLog(4)) {
log("... adding marker annotation");
}
AnnotationVisitor av = cv.visitAnnotation(ANNOTATION_ALREADY_ENHANCED_MARKER, true);
if (av != null) {
av.visitEnd();
}
} | [
"private",
"void",
"addMarkerAnnotation",
"(",
")",
"{",
"if",
"(",
"isLog",
"(",
"4",
")",
")",
"{",
"log",
"(",
"\"... adding marker annotation\"",
")",
";",
"}",
"AnnotationVisitor",
"av",
"=",
"cv",
".",
"visitAnnotation",
"(",
"ANNOTATION_ALREADY_ENHANCED_M... | Add the marker annotation so that we don't enhance the type query bean twice. | [
"Add",
"the",
"marker",
"annotation",
"so",
"that",
"we",
"don",
"t",
"enhance",
"the",
"type",
"query",
"bean",
"twice",
"."
] | a063554fabdbed15ff5e10ad0a0b53b67e039006 | https://github.com/ebean-orm/querybean-agent-now-merged-into-ebean-agent-/blob/a063554fabdbed15ff5e10ad0a0b53b67e039006/src/main/java/io/ebean/typequery/agent/TypeQueryClassAdapter.java#L166-L175 |
148,939 | zmarko/sss | src/main/java/rs/in/zivanovic/sss/ShamirSecretSharing.java | ShamirSecretSharing.split | public static List<SecretShare> split(BigInteger secret, BigInteger[] coefficients, int total, int threshold,
BigInteger prime) {
if (secret.compareTo(BigInteger.ZERO) <= 0) {
throw new IllegalArgumentException("secret must be positive integer");
}
if (prime.compareTo(s... | java | public static List<SecretShare> split(BigInteger secret, BigInteger[] coefficients, int total, int threshold,
BigInteger prime) {
if (secret.compareTo(BigInteger.ZERO) <= 0) {
throw new IllegalArgumentException("secret must be positive integer");
}
if (prime.compareTo(s... | [
"public",
"static",
"List",
"<",
"SecretShare",
">",
"split",
"(",
"BigInteger",
"secret",
",",
"BigInteger",
"[",
"]",
"coefficients",
",",
"int",
"total",
",",
"int",
"threshold",
",",
"BigInteger",
"prime",
")",
"{",
"if",
"(",
"secret",
".",
"compareTo... | Split the secret into the specified total number of shares. Specified minimum threshold of shares will need to be
present in order to join them back into the secret.
@param secret number to split into shares
@param coefficients random coefficients of the underlying polynomial
@param total number of shares to generate
... | [
"Split",
"the",
"secret",
"into",
"the",
"specified",
"total",
"number",
"of",
"shares",
".",
"Specified",
"minimum",
"threshold",
"of",
"shares",
"will",
"need",
"to",
"be",
"present",
"in",
"order",
"to",
"join",
"them",
"back",
"into",
"the",
"secret",
... | a41d9d39ca9a4ca1a2719c441c88e209ffc511f5 | https://github.com/zmarko/sss/blob/a41d9d39ca9a4ca1a2719c441c88e209ffc511f5/src/main/java/rs/in/zivanovic/sss/ShamirSecretSharing.java#L80-L111 |
148,940 | zmarko/sss | src/main/java/rs/in/zivanovic/sss/ShamirSecretSharing.java | ShamirSecretSharing.join | public static BigInteger join(List<SecretShare> shares) {
if (!checkSamePrimes(shares)) {
throw new IllegalArgumentException("shares not from the same series");
}
BigInteger res = BigInteger.ZERO;
for (int i = 0; i < shares.size(); i++) {
BigInteger n = BigInteger... | java | public static BigInteger join(List<SecretShare> shares) {
if (!checkSamePrimes(shares)) {
throw new IllegalArgumentException("shares not from the same series");
}
BigInteger res = BigInteger.ZERO;
for (int i = 0; i < shares.size(); i++) {
BigInteger n = BigInteger... | [
"public",
"static",
"BigInteger",
"join",
"(",
"List",
"<",
"SecretShare",
">",
"shares",
")",
"{",
"if",
"(",
"!",
"checkSamePrimes",
"(",
"shares",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"shares not from the same series\"",
")",
";",... | Join shares back into the secret.
@param shares to join
@return secret number | [
"Join",
"shares",
"back",
"into",
"the",
"secret",
"."
] | a41d9d39ca9a4ca1a2719c441c88e209ffc511f5 | https://github.com/zmarko/sss/blob/a41d9d39ca9a4ca1a2719c441c88e209ffc511f5/src/main/java/rs/in/zivanovic/sss/ShamirSecretSharing.java#L129-L150 |
148,941 | zmarko/sss | src/main/java/rs/in/zivanovic/sss/ShamirSecretSharing.java | ShamirSecretSharing.checkSamePrimes | private static boolean checkSamePrimes(List<SecretShare> shares) {
boolean ret = true;
BigInteger prime = null;
for (SecretShare share : shares) {
if (prime == null) {
prime = share.getPrime();
} else if (!prime.equals(share.getPrime())) {
... | java | private static boolean checkSamePrimes(List<SecretShare> shares) {
boolean ret = true;
BigInteger prime = null;
for (SecretShare share : shares) {
if (prime == null) {
prime = share.getPrime();
} else if (!prime.equals(share.getPrime())) {
... | [
"private",
"static",
"boolean",
"checkSamePrimes",
"(",
"List",
"<",
"SecretShare",
">",
"shares",
")",
"{",
"boolean",
"ret",
"=",
"true",
";",
"BigInteger",
"prime",
"=",
"null",
";",
"for",
"(",
"SecretShare",
"share",
":",
"shares",
")",
"{",
"if",
"... | Verify if all shares have the same prime. If they do not, then they are not from the same series and cannot
possibly be joined.
@param shares to check
@return true if all shares have the same prime, false if not. | [
"Verify",
"if",
"all",
"shares",
"have",
"the",
"same",
"prime",
".",
"If",
"they",
"do",
"not",
"then",
"they",
"are",
"not",
"from",
"the",
"same",
"series",
"and",
"cannot",
"possibly",
"be",
"joined",
"."
] | a41d9d39ca9a4ca1a2719c441c88e209ffc511f5 | https://github.com/zmarko/sss/blob/a41d9d39ca9a4ca1a2719c441c88e209ffc511f5/src/main/java/rs/in/zivanovic/sss/ShamirSecretSharing.java#L159-L171 |
148,942 | eurekaclinical/protempa | protempa-dsb-relationaldb/src/main/java/org/protempa/backend/dsb/relationaldb/PropositionResultSetIterator.java | PropositionResultSetIterator.handleKeyId | final void handleKeyId(String kId) {
String oldKeyId = getKeyId();
if (oldKeyId != null && !oldKeyId.equals(kId)) {
createDataStreamingEvent(oldKeyId, this.props);
}
this.keyId = kId;
} | java | final void handleKeyId(String kId) {
String oldKeyId = getKeyId();
if (oldKeyId != null && !oldKeyId.equals(kId)) {
createDataStreamingEvent(oldKeyId, this.props);
}
this.keyId = kId;
} | [
"final",
"void",
"handleKeyId",
"(",
"String",
"kId",
")",
"{",
"String",
"oldKeyId",
"=",
"getKeyId",
"(",
")",
";",
"if",
"(",
"oldKeyId",
"!=",
"null",
"&&",
"!",
"oldKeyId",
".",
"equals",
"(",
"kId",
")",
")",
"{",
"createDataStreamingEvent",
"(",
... | For recording the key id of the current record.
@param kId the key id {@link String}. | [
"For",
"recording",
"the",
"key",
"id",
"of",
"the",
"current",
"record",
"."
] | 5a620d1a407c7a5426d1cf17d47b97717cf71634 | https://github.com/eurekaclinical/protempa/blob/5a620d1a407c7a5426d1cf17d47b97717cf71634/protempa-dsb-relationaldb/src/main/java/org/protempa/backend/dsb/relationaldb/PropositionResultSetIterator.java#L128-L134 |
148,943 | eurekaclinical/protempa | protempa-framework/src/main/java/org/protempa/TopologicalSortComparator.java | TopologicalSortComparator.compare | @Override
public int compare(TemporalPropositionDefinition a1,
TemporalPropositionDefinition a2) {
if (a1 == a2) {
return 0;
} else {
Integer index1 = rule2Index.get(a1.getId());
Integer index2 = rule2Index.get(a2.getId());
return index1.c... | java | @Override
public int compare(TemporalPropositionDefinition a1,
TemporalPropositionDefinition a2) {
if (a1 == a2) {
return 0;
} else {
Integer index1 = rule2Index.get(a1.getId());
Integer index2 = rule2Index.get(a2.getId());
return index1.c... | [
"@",
"Override",
"public",
"int",
"compare",
"(",
"TemporalPropositionDefinition",
"a1",
",",
"TemporalPropositionDefinition",
"a2",
")",
"{",
"if",
"(",
"a1",
"==",
"a2",
")",
"{",
"return",
"0",
";",
"}",
"else",
"{",
"Integer",
"index1",
"=",
"rule2Index"... | Compares two temporal proposition definitions topologically according to
the inverse of their abstractedFrom or inducedBy relationships.
@param a1 an {@link TemporalPropositionDefinition}.
@param a2 another {@link TemporalPropositionDefinition}.
@return a negative integer, zero, or a positive integer as the first
argu... | [
"Compares",
"two",
"temporal",
"proposition",
"definitions",
"topologically",
"according",
"to",
"the",
"inverse",
"of",
"their",
"abstractedFrom",
"or",
"inducedBy",
"relationships",
"."
] | 5a620d1a407c7a5426d1cf17d47b97717cf71634 | https://github.com/eurekaclinical/protempa/blob/5a620d1a407c7a5426d1cf17d47b97717cf71634/protempa-framework/src/main/java/org/protempa/TopologicalSortComparator.java#L145-L155 |
148,944 | kevoree/kevoree-library | docker-node/src/main/java/org/kevoree/library/DockerNode.java | DockerNode.updateModelAccordingToDocker | private void updateModelAccordingToDocker() {
try {
final ModelHelper modelHelper = new ModelHelper(context.getNodeName(), docker, factory);
final ContainerRoot dockerModel = modelHelper.docker2model(modelService.getCurrentModel());
modelService.update(dockerModel, e -> {
... | java | private void updateModelAccordingToDocker() {
try {
final ModelHelper modelHelper = new ModelHelper(context.getNodeName(), docker, factory);
final ContainerRoot dockerModel = modelHelper.docker2model(modelService.getCurrentModel());
modelService.update(dockerModel, e -> {
... | [
"private",
"void",
"updateModelAccordingToDocker",
"(",
")",
"{",
"try",
"{",
"final",
"ModelHelper",
"modelHelper",
"=",
"new",
"ModelHelper",
"(",
"context",
".",
"getNodeName",
"(",
")",
",",
"docker",
",",
"factory",
")",
";",
"final",
"ContainerRoot",
"do... | Converts the currentModel state of the Docker engine to a Kevoree model.
This model is then merged with the currentModel in-use model and deployed.
Calling this method subsequently triggers a call to plan(currentModel, targetModel) | [
"Converts",
"the",
"currentModel",
"state",
"of",
"the",
"Docker",
"engine",
"to",
"a",
"Kevoree",
"model",
".",
"This",
"model",
"is",
"then",
"merged",
"with",
"the",
"currentModel",
"in",
"-",
"use",
"model",
"and",
"deployed",
"."
] | 617460e6c5881902ebc488a31ecdea179024d8f1 | https://github.com/kevoree/kevoree-library/blob/617460e6c5881902ebc488a31ecdea179024d8f1/docker-node/src/main/java/org/kevoree/library/DockerNode.java#L100-L114 |
148,945 | kevoree/kevoree-library | docker-node/src/main/java/org/kevoree/library/DockerNode.java | DockerNode.plan | @Override
public List<AdaptationCommand> plan(ContainerRoot currentModel, ContainerRoot targetModel)
throws KevoreeAdaptationException {
final List<AdaptationCommand> commands = super.plan(currentModel, targetModel);
final List<AdaptationCommand> dockerCommands = new ModelHelper(context.... | java | @Override
public List<AdaptationCommand> plan(ContainerRoot currentModel, ContainerRoot targetModel)
throws KevoreeAdaptationException {
final List<AdaptationCommand> commands = super.plan(currentModel, targetModel);
final List<AdaptationCommand> dockerCommands = new ModelHelper(context.... | [
"@",
"Override",
"public",
"List",
"<",
"AdaptationCommand",
">",
"plan",
"(",
"ContainerRoot",
"currentModel",
",",
"ContainerRoot",
"targetModel",
")",
"throws",
"KevoreeAdaptationException",
"{",
"final",
"List",
"<",
"AdaptationCommand",
">",
"commands",
"=",
"s... | This is called when the node has to adapt from currentModel to targetModel.
The goal of this method is to return a list of executable adaptation commands according to
the delta between currentModel and targetModel.
@param currentModel the currently in-use model
@param targetModel the model that we want to converge to
... | [
"This",
"is",
"called",
"when",
"the",
"node",
"has",
"to",
"adapt",
"from",
"currentModel",
"to",
"targetModel",
".",
"The",
"goal",
"of",
"this",
"method",
"is",
"to",
"return",
"a",
"list",
"of",
"executable",
"adaptation",
"commands",
"according",
"to",
... | 617460e6c5881902ebc488a31ecdea179024d8f1 | https://github.com/kevoree/kevoree-library/blob/617460e6c5881902ebc488a31ecdea179024d8f1/docker-node/src/main/java/org/kevoree/library/DockerNode.java#L126-L137 |
148,946 | ebean-orm/querybean-agent-now-merged-into-ebean-agent- | src/main/java/io/ebean/typequery/agent/ArgParser.java | ArgParser.parse | public static HashMap<String,String> parse(String args){
HashMap<String,String> map = new HashMap<>();
if (args != null){
String[] split = args.split(";");
for (String nameValuePair : split) {
String[] nameValue = nameValuePair.split("=");
if (nameValue.length == 2){
map.put(nameValue[0].to... | java | public static HashMap<String,String> parse(String args){
HashMap<String,String> map = new HashMap<>();
if (args != null){
String[] split = args.split(";");
for (String nameValuePair : split) {
String[] nameValue = nameValuePair.split("=");
if (nameValue.length == 2){
map.put(nameValue[0].to... | [
"public",
"static",
"HashMap",
"<",
"String",
",",
"String",
">",
"parse",
"(",
"String",
"args",
")",
"{",
"HashMap",
"<",
"String",
",",
"String",
">",
"map",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"if",
"(",
"args",
"!=",
"null",
")",
"{",
... | Parse the args returning as name value pairs. | [
"Parse",
"the",
"args",
"returning",
"as",
"name",
"value",
"pairs",
"."
] | a063554fabdbed15ff5e10ad0a0b53b67e039006 | https://github.com/ebean-orm/querybean-agent-now-merged-into-ebean-agent-/blob/a063554fabdbed15ff5e10ad0a0b53b67e039006/src/main/java/io/ebean/typequery/agent/ArgParser.java#L13-L28 |
148,947 | jboss/jboss-common-beans | src/main/java/org/jboss/common/beans/property/BooleanEditor.java | BooleanEditor.setAsText | @Override
public void setAsText(final String text) {
if (BeanUtils.isNull(text)) {
setValue(null);
return;
}
Object newValue = Boolean.valueOf(text);
setValue(newValue);
} | java | @Override
public void setAsText(final String text) {
if (BeanUtils.isNull(text)) {
setValue(null);
return;
}
Object newValue = Boolean.valueOf(text);
setValue(newValue);
} | [
"@",
"Override",
"public",
"void",
"setAsText",
"(",
"final",
"String",
"text",
")",
"{",
"if",
"(",
"BeanUtils",
".",
"isNull",
"(",
"text",
")",
")",
"{",
"setValue",
"(",
"null",
")",
";",
"return",
";",
"}",
"Object",
"newValue",
"=",
"Boolean",
... | Map the argument text into Boolean.TRUE or Boolean.FALSE using Boolean.valueOf. | [
"Map",
"the",
"argument",
"text",
"into",
"Boolean",
".",
"TRUE",
"or",
"Boolean",
".",
"FALSE",
"using",
"Boolean",
".",
"valueOf",
"."
] | ffb48b1719762534bf92d762eadf91d1815f6748 | https://github.com/jboss/jboss-common-beans/blob/ffb48b1719762534bf92d762eadf91d1815f6748/src/main/java/org/jboss/common/beans/property/BooleanEditor.java#L40-L48 |
148,948 | kevoree/kevoree-library | mqttServer/src/main/java/org/dna/mqtt/moquette/parser/netty/SubscribeDecoder.java | SubscribeDecoder.decodeSubscription | private void decodeSubscription(ByteBuf in, SubscribeMessage message) throws UnsupportedEncodingException {
String topic = Utils.decodeString(in);
byte qos = (byte)(in.readByte() & 0x03);
message.addSubscription(new SubscribeMessage.Couple(qos, topic));
} | java | private void decodeSubscription(ByteBuf in, SubscribeMessage message) throws UnsupportedEncodingException {
String topic = Utils.decodeString(in);
byte qos = (byte)(in.readByte() & 0x03);
message.addSubscription(new SubscribeMessage.Couple(qos, topic));
} | [
"private",
"void",
"decodeSubscription",
"(",
"ByteBuf",
"in",
",",
"SubscribeMessage",
"message",
")",
"throws",
"UnsupportedEncodingException",
"{",
"String",
"topic",
"=",
"Utils",
".",
"decodeString",
"(",
"in",
")",
";",
"byte",
"qos",
"=",
"(",
"byte",
"... | Populate the message with couple of Qos, topic | [
"Populate",
"the",
"message",
"with",
"couple",
"of",
"Qos",
"topic"
] | 617460e6c5881902ebc488a31ecdea179024d8f1 | https://github.com/kevoree/kevoree-library/blob/617460e6c5881902ebc488a31ecdea179024d8f1/mqttServer/src/main/java/org/dna/mqtt/moquette/parser/netty/SubscribeDecoder.java#L62-L66 |
148,949 | openbase/jul | pattern/default/src/main/java/org/openbase/jul/pattern/CompletableFutureLite.java | CompletableFutureLite.cancel | @Override
public boolean cancel(final boolean mayInterruptIfRunning) {
synchronized (lock) {
if (isDone()) {
return false;
}
throwable = new CancellationException();
lock.notifyAll();
return true;
}
} | java | @Override
public boolean cancel(final boolean mayInterruptIfRunning) {
synchronized (lock) {
if (isDone()) {
return false;
}
throwable = new CancellationException();
lock.notifyAll();
return true;
}
} | [
"@",
"Override",
"public",
"boolean",
"cancel",
"(",
"final",
"boolean",
"mayInterruptIfRunning",
")",
"{",
"synchronized",
"(",
"lock",
")",
"{",
"if",
"(",
"isDone",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"throwable",
"=",
"new",
"CancellationE... | Method cancels the future without delivering any specific reason.
@param mayInterruptIfRunning this flag is ignored since this implementation does not use its own computation thread.
@return if this invocation caused this CompletableFuture to be canceled, than {@code true} is returned. Otherwise {@code false} is retu... | [
"Method",
"cancels",
"the",
"future",
"without",
"delivering",
"any",
"specific",
"reason",
"."
] | 662e98c3a853085e475be54c3be3deb72193c72d | https://github.com/openbase/jul/blob/662e98c3a853085e475be54c3be3deb72193c72d/pattern/default/src/main/java/org/openbase/jul/pattern/CompletableFutureLite.java#L99-L109 |
148,950 | ebean-orm/querybean-agent-now-merged-into-ebean-agent- | src/main/java/io/ebean/typequery/agent/TypeQueryConstructorForAlias.java | TypeQueryConstructorForAlias.visitCode | @Override
public void visitCode() {
mv = cv.visitMethod(ACC_PRIVATE, "<init>", "(Z)V", null, null);
mv.visitCode();
Label l0 = new Label();
mv.visitLabel(l0);
mv.visitLineNumber(1, l0);
mv.visitVarInsn(ALOAD, 0);
mv.visitVarInsn(ILOAD, 1);
mv.visitMethodInsn(INVOKESPECIAL, TQ_ROOT_BEA... | java | @Override
public void visitCode() {
mv = cv.visitMethod(ACC_PRIVATE, "<init>", "(Z)V", null, null);
mv.visitCode();
Label l0 = new Label();
mv.visitLabel(l0);
mv.visitLineNumber(1, l0);
mv.visitVarInsn(ALOAD, 0);
mv.visitVarInsn(ILOAD, 1);
mv.visitMethodInsn(INVOKESPECIAL, TQ_ROOT_BEA... | [
"@",
"Override",
"public",
"void",
"visitCode",
"(",
")",
"{",
"mv",
"=",
"cv",
".",
"visitMethod",
"(",
"ACC_PRIVATE",
",",
"\"<init>\"",
",",
"\"(Z)V\"",
",",
"null",
",",
"null",
")",
";",
"mv",
".",
"visitCode",
"(",
")",
";",
"Label",
"l0",
"=",... | Write the constructor initialising all the fields eagerly. | [
"Write",
"the",
"constructor",
"initialising",
"all",
"the",
"fields",
"eagerly",
"."
] | a063554fabdbed15ff5e10ad0a0b53b67e039006 | https://github.com/ebean-orm/querybean-agent-now-merged-into-ebean-agent-/blob/a063554fabdbed15ff5e10ad0a0b53b67e039006/src/main/java/io/ebean/typequery/agent/TypeQueryConstructorForAlias.java#L30-L67 |
148,951 | hypfvieh/java-utils | src/main/java/com/github/hypfvieh/util/SystemUtil.java | SystemUtil.getHostName | public static String getHostName() {
try {
return java.net.InetAddress.getLocalHost().getHostName();
} catch (java.net.UnknownHostException _ex) {
return null;
}
} | java | public static String getHostName() {
try {
return java.net.InetAddress.getLocalHost().getHostName();
} catch (java.net.UnknownHostException _ex) {
return null;
}
} | [
"public",
"static",
"String",
"getHostName",
"(",
")",
"{",
"try",
"{",
"return",
"java",
".",
"net",
".",
"InetAddress",
".",
"getLocalHost",
"(",
")",
".",
"getHostName",
"(",
")",
";",
"}",
"catch",
"(",
"java",
".",
"net",
".",
"UnknownHostException"... | Gets the host name of the local machine.
@return host name | [
"Gets",
"the",
"host",
"name",
"of",
"the",
"local",
"machine",
"."
] | 407c32d6b485596d4d2b644f5f7fc7a02d0169c6 | https://github.com/hypfvieh/java-utils/blob/407c32d6b485596d4d2b644f5f7fc7a02d0169c6/src/main/java/com/github/hypfvieh/util/SystemUtil.java#L61-L67 |
148,952 | hypfvieh/java-utils | src/main/java/com/github/hypfvieh/util/SystemUtil.java | SystemUtil.getJavaVersion | public static String getJavaVersion() {
String[] sysPropParms = new String[] {"java.runtime.version", "java.version"};
for (int i = 0; i < sysPropParms.length; i++) {
String val = System.getProperty(sysPropParms[i]);
if (!StringUtil.isEmpty(val)) {
return val;
... | java | public static String getJavaVersion() {
String[] sysPropParms = new String[] {"java.runtime.version", "java.version"};
for (int i = 0; i < sysPropParms.length; i++) {
String val = System.getProperty(sysPropParms[i]);
if (!StringUtil.isEmpty(val)) {
return val;
... | [
"public",
"static",
"String",
"getJavaVersion",
"(",
")",
"{",
"String",
"[",
"]",
"sysPropParms",
"=",
"new",
"String",
"[",
"]",
"{",
"\"java.runtime.version\"",
",",
"\"java.version\"",
"}",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"sysPr... | Determines the Java version of the executing JVM.
@return Java version | [
"Determines",
"the",
"Java",
"version",
"of",
"the",
"executing",
"JVM",
"."
] | 407c32d6b485596d4d2b644f5f7fc7a02d0169c6 | https://github.com/hypfvieh/java-utils/blob/407c32d6b485596d4d2b644f5f7fc7a02d0169c6/src/main/java/com/github/hypfvieh/util/SystemUtil.java#L97-L106 |
148,953 | hypfvieh/java-utils | src/main/java/com/github/hypfvieh/util/SystemUtil.java | SystemUtil.concatFilePath | public static String concatFilePath(boolean _includeTrailingDelimiter, String..._parts) {
if (_parts == null) {
return null;
}
StringBuilder allParts = new StringBuilder();
for (int i = 0; i < _parts.length; i++) {
if (_parts[i] == null) {
continu... | java | public static String concatFilePath(boolean _includeTrailingDelimiter, String..._parts) {
if (_parts == null) {
return null;
}
StringBuilder allParts = new StringBuilder();
for (int i = 0; i < _parts.length; i++) {
if (_parts[i] == null) {
continu... | [
"public",
"static",
"String",
"concatFilePath",
"(",
"boolean",
"_includeTrailingDelimiter",
",",
"String",
"...",
"_parts",
")",
"{",
"if",
"(",
"_parts",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"StringBuilder",
"allParts",
"=",
"new",
"StringBuil... | Concats a path from all given parts, using the path delimiter for the currently used platform.
@param _includeTrailingDelimiter include delimiter after last token
@param _parts parts to concat
@return concatinated string | [
"Concats",
"a",
"path",
"from",
"all",
"given",
"parts",
"using",
"the",
"path",
"delimiter",
"for",
"the",
"currently",
"used",
"platform",
"."
] | 407c32d6b485596d4d2b644f5f7fc7a02d0169c6 | https://github.com/hypfvieh/java-utils/blob/407c32d6b485596d4d2b644f5f7fc7a02d0169c6/src/main/java/com/github/hypfvieh/util/SystemUtil.java#L129-L151 |
148,954 | hypfvieh/java-utils | src/main/java/com/github/hypfvieh/util/SystemUtil.java | SystemUtil.appendTrailingDelimiter | public static String appendTrailingDelimiter(String _filePath) {
if (_filePath == null) {
return null;
}
if (!_filePath.endsWith(File.separator)) {
_filePath += File.separator;
}
return _filePath;
} | java | public static String appendTrailingDelimiter(String _filePath) {
if (_filePath == null) {
return null;
}
if (!_filePath.endsWith(File.separator)) {
_filePath += File.separator;
}
return _filePath;
} | [
"public",
"static",
"String",
"appendTrailingDelimiter",
"(",
"String",
"_filePath",
")",
"{",
"if",
"(",
"_filePath",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"!",
"_filePath",
".",
"endsWith",
"(",
"File",
".",
"separator",
")",
"... | Appends the OS specific path delimiter to the end of the String, if it is missing.
@param _filePath file path
@return String | [
"Appends",
"the",
"OS",
"specific",
"path",
"delimiter",
"to",
"the",
"end",
"of",
"the",
"String",
"if",
"it",
"is",
"missing",
"."
] | 407c32d6b485596d4d2b644f5f7fc7a02d0169c6 | https://github.com/hypfvieh/java-utils/blob/407c32d6b485596d4d2b644f5f7fc7a02d0169c6/src/main/java/com/github/hypfvieh/util/SystemUtil.java#L183-L191 |
148,955 | hypfvieh/java-utils | src/main/java/com/github/hypfvieh/util/SystemUtil.java | SystemUtil.createTempDirectory | public static File createTempDirectory(String _path, String _name, boolean _deleteOnExit) {
File outputDir = new File(concatFilePath(_path, _name));
if (!outputDir.exists()) {
try {
Files.createDirectory(Paths.get(outputDir.toString()));
} catch (IOException _ex)... | java | public static File createTempDirectory(String _path, String _name, boolean _deleteOnExit) {
File outputDir = new File(concatFilePath(_path, _name));
if (!outputDir.exists()) {
try {
Files.createDirectory(Paths.get(outputDir.toString()));
} catch (IOException _ex)... | [
"public",
"static",
"File",
"createTempDirectory",
"(",
"String",
"_path",
",",
"String",
"_name",
",",
"boolean",
"_deleteOnExit",
")",
"{",
"File",
"outputDir",
"=",
"new",
"File",
"(",
"concatFilePath",
"(",
"_path",
",",
"_name",
")",
")",
";",
"if",
"... | Creates a new temporary directory in the given path.
@param _path path
@param _name directory name
@param _deleteOnExit delete directory on jvm shutdown
@return created Directory, null if directory/file was already existing | [
"Creates",
"a",
"new",
"temporary",
"directory",
"in",
"the",
"given",
"path",
"."
] | 407c32d6b485596d4d2b644f5f7fc7a02d0169c6 | https://github.com/hypfvieh/java-utils/blob/407c32d6b485596d4d2b644f5f7fc7a02d0169c6/src/main/java/com/github/hypfvieh/util/SystemUtil.java#L200-L216 |
148,956 | hypfvieh/java-utils | src/main/java/com/github/hypfvieh/util/SystemUtil.java | SystemUtil.createTempDirectory | public static File createTempDirectory(String _path, String _prefix, int _length, boolean _timestamp, boolean _deleteOnExit) {
SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd_HHmmss-SSS");
String randomStr = StringUtil.randomString(_length);
StringBuilder fileName = new StringBuilde... | java | public static File createTempDirectory(String _path, String _prefix, int _length, boolean _timestamp, boolean _deleteOnExit) {
SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd_HHmmss-SSS");
String randomStr = StringUtil.randomString(_length);
StringBuilder fileName = new StringBuilde... | [
"public",
"static",
"File",
"createTempDirectory",
"(",
"String",
"_path",
",",
"String",
"_prefix",
",",
"int",
"_length",
",",
"boolean",
"_timestamp",
",",
"boolean",
"_deleteOnExit",
")",
"{",
"SimpleDateFormat",
"formatter",
"=",
"new",
"SimpleDateFormat",
"(... | Creates a temporary directory in the given path.
You can specify certain files to get a random unique name.
@param _path where to place the temp folder
@param _prefix prefix of the folder
@param _length length of random chars
@param _timestamp add timestamp (yyyyMMdd_HHmmss-SSS) to directory name
@param _deleteOnExit ... | [
"Creates",
"a",
"temporary",
"directory",
"in",
"the",
"given",
"path",
".",
"You",
"can",
"specify",
"certain",
"files",
"to",
"get",
"a",
"random",
"unique",
"name",
"."
] | 407c32d6b485596d4d2b644f5f7fc7a02d0169c6 | https://github.com/hypfvieh/java-utils/blob/407c32d6b485596d4d2b644f5f7fc7a02d0169c6/src/main/java/com/github/hypfvieh/util/SystemUtil.java#L228-L247 |
148,957 | hypfvieh/java-utils | src/main/java/com/github/hypfvieh/util/SystemUtil.java | SystemUtil.isDebuggingEnabled | public static boolean isDebuggingEnabled() {
boolean debuggingEnabled = false;
if (ManagementFactory.getRuntimeMXBean().getInputArguments().toString().indexOf("-agentlib:jdwp") > 0) {
debuggingEnabled = true;
} else if (ManagementFactory.getRuntimeMXBean().getInputArguments().contain... | java | public static boolean isDebuggingEnabled() {
boolean debuggingEnabled = false;
if (ManagementFactory.getRuntimeMXBean().getInputArguments().toString().indexOf("-agentlib:jdwp") > 0) {
debuggingEnabled = true;
} else if (ManagementFactory.getRuntimeMXBean().getInputArguments().contain... | [
"public",
"static",
"boolean",
"isDebuggingEnabled",
"(",
")",
"{",
"boolean",
"debuggingEnabled",
"=",
"false",
";",
"if",
"(",
"ManagementFactory",
".",
"getRuntimeMXBean",
"(",
")",
".",
"getInputArguments",
"(",
")",
".",
"toString",
"(",
")",
".",
"indexO... | Examines some system properties to determine whether the process is likely being debugged
in an IDE or remotely.
@return true if being debugged, false otherwise | [
"Examines",
"some",
"system",
"properties",
"to",
"determine",
"whether",
"the",
"process",
"is",
"likely",
"being",
"debugged",
"in",
"an",
"IDE",
"or",
"remotely",
"."
] | 407c32d6b485596d4d2b644f5f7fc7a02d0169c6 | https://github.com/hypfvieh/java-utils/blob/407c32d6b485596d4d2b644f5f7fc7a02d0169c6/src/main/java/com/github/hypfvieh/util/SystemUtil.java#L254-L264 |
148,958 | hypfvieh/java-utils | src/main/java/com/github/hypfvieh/util/SystemUtil.java | SystemUtil.formatBytesHumanReadable | public static String formatBytesHumanReadable(long _bytes, boolean _use1000BytesPerMb) {
int unit = _use1000BytesPerMb ? 1000 : 1024;
if (_bytes < unit) {
return _bytes + " B";
}
int exp = (int) (Math.log(_bytes) / Math.log(unit));
String pre = (_use1000BytesPerMb ? ... | java | public static String formatBytesHumanReadable(long _bytes, boolean _use1000BytesPerMb) {
int unit = _use1000BytesPerMb ? 1000 : 1024;
if (_bytes < unit) {
return _bytes + " B";
}
int exp = (int) (Math.log(_bytes) / Math.log(unit));
String pre = (_use1000BytesPerMb ? ... | [
"public",
"static",
"String",
"formatBytesHumanReadable",
"(",
"long",
"_bytes",
",",
"boolean",
"_use1000BytesPerMb",
")",
"{",
"int",
"unit",
"=",
"_use1000BytesPerMb",
"?",
"1000",
":",
"1024",
";",
"if",
"(",
"_bytes",
"<",
"unit",
")",
"{",
"return",
"_... | Formats a file size given in byte to something human readable.
@param _bytes size in bytes
@param _use1000BytesPerMb use 1000 bytes per MByte instead of 1024
@return String | [
"Formats",
"a",
"file",
"size",
"given",
"in",
"byte",
"to",
"something",
"human",
"readable",
"."
] | 407c32d6b485596d4d2b644f5f7fc7a02d0169c6 | https://github.com/hypfvieh/java-utils/blob/407c32d6b485596d4d2b644f5f7fc7a02d0169c6/src/main/java/com/github/hypfvieh/util/SystemUtil.java#L329-L337 |
148,959 | hypfvieh/java-utils | src/main/java/com/github/hypfvieh/util/SystemUtil.java | SystemUtil.getApplicationVersionFromJar | public static String getApplicationVersionFromJar(Class<?> _class, String _default) {
try {
Enumeration<URL> resources = _class.getClassLoader().getResources("META-INF/MANIFEST.MF");
while (resources.hasMoreElements()) {
Manifest manifest = new Manifest(resources.nextEle... | java | public static String getApplicationVersionFromJar(Class<?> _class, String _default) {
try {
Enumeration<URL> resources = _class.getClassLoader().getResources("META-INF/MANIFEST.MF");
while (resources.hasMoreElements()) {
Manifest manifest = new Manifest(resources.nextEle... | [
"public",
"static",
"String",
"getApplicationVersionFromJar",
"(",
"Class",
"<",
"?",
">",
"_class",
",",
"String",
"_default",
")",
"{",
"try",
"{",
"Enumeration",
"<",
"URL",
">",
"resources",
"=",
"_class",
".",
"getClassLoader",
"(",
")",
".",
"getResour... | Read the JARs manifest and try to get the current program version from it.
@param _class class to use as entry point
@param _default default string to use if version could not be found
@return version or null | [
"Read",
"the",
"JARs",
"manifest",
"and",
"try",
"to",
"get",
"the",
"current",
"program",
"version",
"from",
"it",
"."
] | 407c32d6b485596d4d2b644f5f7fc7a02d0169c6 | https://github.com/hypfvieh/java-utils/blob/407c32d6b485596d4d2b644f5f7fc7a02d0169c6/src/main/java/com/github/hypfvieh/util/SystemUtil.java#L345-L368 |
148,960 | hypfvieh/java-utils | src/main/java/com/github/hypfvieh/util/SystemUtil.java | SystemUtil.normalizePath | public static String normalizePath(String _path, boolean _appendFinalSeparator) {
if (_path == null) {
return _path;
}
String path = _path
.replace("\\", FILE_SEPARATOR)
.replace("/", FILE_SEPARATOR);
if (_appendFinalSeparator && !path.endsWith(FILE_S... | java | public static String normalizePath(String _path, boolean _appendFinalSeparator) {
if (_path == null) {
return _path;
}
String path = _path
.replace("\\", FILE_SEPARATOR)
.replace("/", FILE_SEPARATOR);
if (_appendFinalSeparator && !path.endsWith(FILE_S... | [
"public",
"static",
"String",
"normalizePath",
"(",
"String",
"_path",
",",
"boolean",
"_appendFinalSeparator",
")",
"{",
"if",
"(",
"_path",
"==",
"null",
")",
"{",
"return",
"_path",
";",
"}",
"String",
"path",
"=",
"_path",
".",
"replace",
"(",
"\"\\\\\... | Normalize a file system path expression for the current OS.
Replaces path separators by this OS's path separator.
Appends a final path separator if parameter is set
and if not yet present.
@param _path path
@param _appendFinalSeparator controls appendix of separator at the end
@return normalized path | [
"Normalize",
"a",
"file",
"system",
"path",
"expression",
"for",
"the",
"current",
"OS",
".",
"Replaces",
"path",
"separators",
"by",
"this",
"OS",
"s",
"path",
"separator",
".",
"Appends",
"a",
"final",
"path",
"separator",
"if",
"parameter",
"is",
"set",
... | 407c32d6b485596d4d2b644f5f7fc7a02d0169c6 | https://github.com/hypfvieh/java-utils/blob/407c32d6b485596d4d2b644f5f7fc7a02d0169c6/src/main/java/com/github/hypfvieh/util/SystemUtil.java#L409-L421 |
148,961 | eurekaclinical/protempa | protempa-ksb-protege/src/main/java/org/protempa/backend/ksb/protege/ConnectionManager.java | ConnectionManager.init | void init() throws KnowledgeSourceBackendInitializationException {
if (this.project == null) {
Util.logger().log(Level.FINE, "Opening Protege project {0}",
this.projectIdentifier);
this.project = initProject();
if (this.project == null) {
t... | java | void init() throws KnowledgeSourceBackendInitializationException {
if (this.project == null) {
Util.logger().log(Level.FINE, "Opening Protege project {0}",
this.projectIdentifier);
this.project = initProject();
if (this.project == null) {
t... | [
"void",
"init",
"(",
")",
"throws",
"KnowledgeSourceBackendInitializationException",
"{",
"if",
"(",
"this",
".",
"project",
"==",
"null",
")",
"{",
"Util",
".",
"logger",
"(",
")",
".",
"log",
"(",
"Level",
".",
"FINE",
",",
"\"Opening Protege project {0}\"",... | Opens the project.
@throws KnowledgeSourceBackendInitializationException if an error
occurs. | [
"Opens",
"the",
"project",
"."
] | 5a620d1a407c7a5426d1cf17d47b97717cf71634 | https://github.com/eurekaclinical/protempa/blob/5a620d1a407c7a5426d1cf17d47b97717cf71634/protempa-ksb-protege/src/main/java/org/protempa/backend/ksb/protege/ConnectionManager.java#L83-L98 |
148,962 | eurekaclinical/protempa | protempa-ksb-protege/src/main/java/org/protempa/backend/ksb/protege/ConnectionManager.java | ConnectionManager.close | void close() {
if (this.project != null) {
Util.logger().log(Level.FINE, "Closing Protege project {0}",
this.projectIdentifier);
for (Iterator<ProjectListener> itr =
this.projectListeners.iterator(); itr.hasNext(); ) {
this.pr... | java | void close() {
if (this.project != null) {
Util.logger().log(Level.FINE, "Closing Protege project {0}",
this.projectIdentifier);
for (Iterator<ProjectListener> itr =
this.projectListeners.iterator(); itr.hasNext(); ) {
this.pr... | [
"void",
"close",
"(",
")",
"{",
"if",
"(",
"this",
".",
"project",
"!=",
"null",
")",
"{",
"Util",
".",
"logger",
"(",
")",
".",
"log",
"(",
"Level",
".",
"FINE",
",",
"\"Closing Protege project {0}\"",
",",
"this",
".",
"projectIdentifier",
")",
";",
... | Closes the project. | [
"Closes",
"the",
"project",
"."
] | 5a620d1a407c7a5426d1cf17d47b97717cf71634 | https://github.com/eurekaclinical/protempa/blob/5a620d1a407c7a5426d1cf17d47b97717cf71634/protempa-ksb-protege/src/main/java/org/protempa/backend/ksb/protege/ConnectionManager.java#L111-L139 |
148,963 | eurekaclinical/protempa | protempa-ksb-protege/src/main/java/org/protempa/backend/ksb/protege/ConnectionManager.java | ConnectionManager.getFromProtege | private <S, T> S getFromProtege(T obj, ProtegeCommand<S, T> getter)
throws KnowledgeSourceReadException {
if (protegeKnowledgeBase != null && getter != null) {
int tries = TRIES;
Exception lastException = null;
do {
try {
return... | java | private <S, T> S getFromProtege(T obj, ProtegeCommand<S, T> getter)
throws KnowledgeSourceReadException {
if (protegeKnowledgeBase != null && getter != null) {
int tries = TRIES;
Exception lastException = null;
do {
try {
return... | [
"private",
"<",
"S",
",",
"T",
">",
"S",
"getFromProtege",
"(",
"T",
"obj",
",",
"ProtegeCommand",
"<",
"S",
",",
"T",
">",
"getter",
")",
"throws",
"KnowledgeSourceReadException",
"{",
"if",
"(",
"protegeKnowledgeBase",
"!=",
"null",
"&&",
"getter",
"!=",... | Executes a command upon the Protege knowledge base, retrying if needed.
@param <S> The type of what is returned by the getter.
@param <T> The type of what is passed to protege as a parameter.
@param obj What is passed to Protege as a parameter.
@param getter the <code>ProtegeCommand</code>.
@return what is re... | [
"Executes",
"a",
"command",
"upon",
"the",
"Protege",
"knowledge",
"base",
"retrying",
"if",
"needed",
"."
] | 5a620d1a407c7a5426d1cf17d47b97717cf71634 | https://github.com/eurekaclinical/protempa/blob/5a620d1a407c7a5426d1cf17d47b97717cf71634/protempa-ksb-protege/src/main/java/org/protempa/backend/ksb/protege/ConnectionManager.java#L233-L264 |
148,964 | eurekaclinical/protempa | protempa-ksb-protege/src/main/java/org/protempa/backend/ksb/protege/ConnectionManager.java | ConnectionManager.createInstance | Instance createInstance(String name, Cls cls)
throws KnowledgeSourceReadException {
return getFromProtege(new InstanceSpec(name, cls), INSTANCE_CREATOR);
} | java | Instance createInstance(String name, Cls cls)
throws KnowledgeSourceReadException {
return getFromProtege(new InstanceSpec(name, cls), INSTANCE_CREATOR);
} | [
"Instance",
"createInstance",
"(",
"String",
"name",
",",
"Cls",
"cls",
")",
"throws",
"KnowledgeSourceReadException",
"{",
"return",
"getFromProtege",
"(",
"new",
"InstanceSpec",
"(",
"name",
",",
"cls",
")",
",",
"INSTANCE_CREATOR",
")",
";",
"}"
] | Creates a new instance in the knowledge base.
@param name the name <code>String</code> of the instance.
@param cls the <code>Cls</code> of the instance.
@return a new <code>Instance</code>, or <code>null</code> if an
invalid class specification was provided.
@see ConnectionManager#INSTANCE_CREATOR | [
"Creates",
"a",
"new",
"instance",
"in",
"the",
"knowledge",
"base",
"."
] | 5a620d1a407c7a5426d1cf17d47b97717cf71634 | https://github.com/eurekaclinical/protempa/blob/5a620d1a407c7a5426d1cf17d47b97717cf71634/protempa-ksb-protege/src/main/java/org/protempa/backend/ksb/protege/ConnectionManager.java#L475-L478 |
148,965 | hypfvieh/java-utils | src/main/java/com/github/hypfvieh/util/ConverterUtil.java | ConverterUtil.strToInt | public static Integer strToInt(String _str, Integer _default) {
if (_str == null) {
return _default;
}
if (TypeUtil.isInteger(_str, true)) {
return Integer.valueOf(_str);
} else {
return _default;
}
} | java | public static Integer strToInt(String _str, Integer _default) {
if (_str == null) {
return _default;
}
if (TypeUtil.isInteger(_str, true)) {
return Integer.valueOf(_str);
} else {
return _default;
}
} | [
"public",
"static",
"Integer",
"strToInt",
"(",
"String",
"_str",
",",
"Integer",
"_default",
")",
"{",
"if",
"(",
"_str",
"==",
"null",
")",
"{",
"return",
"_default",
";",
"}",
"if",
"(",
"TypeUtil",
".",
"isInteger",
"(",
"_str",
",",
"true",
")",
... | Convert given String to Integer, returns _default if String is not an integer.
@param _str
@param _default
@return _str as Integer or _default value | [
"Convert",
"given",
"String",
"to",
"Integer",
"returns",
"_default",
"if",
"String",
"is",
"not",
"an",
"integer",
"."
] | 407c32d6b485596d4d2b644f5f7fc7a02d0169c6 | https://github.com/hypfvieh/java-utils/blob/407c32d6b485596d4d2b644f5f7fc7a02d0169c6/src/main/java/com/github/hypfvieh/util/ConverterUtil.java#L25-L34 |
148,966 | hypfvieh/java-utils | src/main/java/com/github/hypfvieh/util/ConverterUtil.java | ConverterUtil.toProperties | public static Properties toProperties(Map<?, ?> _map) {
Properties props = new Properties();
props.putAll(_map);
return props;
} | java | public static Properties toProperties(Map<?, ?> _map) {
Properties props = new Properties();
props.putAll(_map);
return props;
} | [
"public",
"static",
"Properties",
"toProperties",
"(",
"Map",
"<",
"?",
",",
"?",
">",
"_map",
")",
"{",
"Properties",
"props",
"=",
"new",
"Properties",
"(",
")",
";",
"props",
".",
"putAll",
"(",
"_map",
")",
";",
"return",
"props",
";",
"}"
] | Convertes a map to a Properties object.
@param _map
@return Properties object | [
"Convertes",
"a",
"map",
"to",
"a",
"Properties",
"object",
"."
] | 407c32d6b485596d4d2b644f5f7fc7a02d0169c6 | https://github.com/hypfvieh/java-utils/blob/407c32d6b485596d4d2b644f5f7fc7a02d0169c6/src/main/java/com/github/hypfvieh/util/ConverterUtil.java#L60-L64 |
148,967 | udoprog/tiny-serializer-java | tiny-serializer-core/src/main/java/eu/toolchain/serializer/TinySerializer.java | TinySerializer.nullable | @Override
public <T> Serializer<T> nullable(Serializer<T> serializer) {
return new NullSerializer<T>(serializer);
} | java | @Override
public <T> Serializer<T> nullable(Serializer<T> serializer) {
return new NullSerializer<T>(serializer);
} | [
"@",
"Override",
"public",
"<",
"T",
">",
"Serializer",
"<",
"T",
">",
"nullable",
"(",
"Serializer",
"<",
"T",
">",
"serializer",
")",
"{",
"return",
"new",
"NullSerializer",
"<",
"T",
">",
"(",
"serializer",
")",
";",
"}"
] | Build a serializer that is capable of serializing null values.
@return | [
"Build",
"a",
"serializer",
"that",
"is",
"capable",
"of",
"serializing",
"null",
"values",
"."
] | e2a7d9e7eb9125a51a17ba3abad0b291a97f9c6f | https://github.com/udoprog/tiny-serializer-java/blob/e2a7d9e7eb9125a51a17ba3abad0b291a97f9c6f/tiny-serializer-core/src/main/java/eu/toolchain/serializer/TinySerializer.java#L189-L192 |
148,968 | hypfvieh/java-utils | src/main/java/com/github/hypfvieh/util/FileIoUtil.java | FileIoUtil.readProperties | public static Properties readProperties(File _file) {
if (_file.exists()) {
try {
return readProperties(new FileInputStream(_file));
} catch (FileNotFoundException _ex) {
LOGGER.info("Could not load properties file: " + _file, _ex);
}
}... | java | public static Properties readProperties(File _file) {
if (_file.exists()) {
try {
return readProperties(new FileInputStream(_file));
} catch (FileNotFoundException _ex) {
LOGGER.info("Could not load properties file: " + _file, _ex);
}
}... | [
"public",
"static",
"Properties",
"readProperties",
"(",
"File",
"_file",
")",
"{",
"if",
"(",
"_file",
".",
"exists",
"(",
")",
")",
"{",
"try",
"{",
"return",
"readProperties",
"(",
"new",
"FileInputStream",
"(",
"_file",
")",
")",
";",
"}",
"catch",
... | Trys to read a properties file.
Returns null if properties file could not be loaded
@param _file
@return Properties Object or null | [
"Trys",
"to",
"read",
"a",
"properties",
"file",
".",
"Returns",
"null",
"if",
"properties",
"file",
"could",
"not",
"be",
"loaded"
] | 407c32d6b485596d4d2b644f5f7fc7a02d0169c6 | https://github.com/hypfvieh/java-utils/blob/407c32d6b485596d4d2b644f5f7fc7a02d0169c6/src/main/java/com/github/hypfvieh/util/FileIoUtil.java#L39-L48 |
148,969 | hypfvieh/java-utils | src/main/java/com/github/hypfvieh/util/FileIoUtil.java | FileIoUtil.readProperties | public static Properties readProperties(InputStream _stream) {
Properties props = new Properties();
if (_stream == null) {
return null;
}
try {
props.load(_stream);
return props;
} catch (IOException | NumberFormatException _ex) {
... | java | public static Properties readProperties(InputStream _stream) {
Properties props = new Properties();
if (_stream == null) {
return null;
}
try {
props.load(_stream);
return props;
} catch (IOException | NumberFormatException _ex) {
... | [
"public",
"static",
"Properties",
"readProperties",
"(",
"InputStream",
"_stream",
")",
"{",
"Properties",
"props",
"=",
"new",
"Properties",
"(",
")",
";",
"if",
"(",
"_stream",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"try",
"{",
"props",
".... | Tries to read a properties file from an inputstream.
@param _stream
@return properties object/null | [
"Tries",
"to",
"read",
"a",
"properties",
"file",
"from",
"an",
"inputstream",
"."
] | 407c32d6b485596d4d2b644f5f7fc7a02d0169c6 | https://github.com/hypfvieh/java-utils/blob/407c32d6b485596d4d2b644f5f7fc7a02d0169c6/src/main/java/com/github/hypfvieh/util/FileIoUtil.java#L55-L68 |
148,970 | hypfvieh/java-utils | src/main/java/com/github/hypfvieh/util/FileIoUtil.java | FileIoUtil.writeProperties | public static boolean writeProperties(File _file, Properties _props) {
LOGGER.debug("Trying to write Properties to file: " + _file);
try (FileOutputStream out = new FileOutputStream(_file)) {
_props.store(out, _file.getName());
LOGGER.debug("Successfully wrote properties to file:... | java | public static boolean writeProperties(File _file, Properties _props) {
LOGGER.debug("Trying to write Properties to file: " + _file);
try (FileOutputStream out = new FileOutputStream(_file)) {
_props.store(out, _file.getName());
LOGGER.debug("Successfully wrote properties to file:... | [
"public",
"static",
"boolean",
"writeProperties",
"(",
"File",
"_file",
",",
"Properties",
"_props",
")",
"{",
"LOGGER",
".",
"debug",
"(",
"\"Trying to write Properties to file: \"",
"+",
"_file",
")",
";",
"try",
"(",
"FileOutputStream",
"out",
"=",
"new",
"Fi... | Writes a properties Object to file.
Returns true on success, false otherwise.
@param _file
@param _props
@return true on success, false otherwise | [
"Writes",
"a",
"properties",
"Object",
"to",
"file",
".",
"Returns",
"true",
"on",
"success",
"false",
"otherwise",
"."
] | 407c32d6b485596d4d2b644f5f7fc7a02d0169c6 | https://github.com/hypfvieh/java-utils/blob/407c32d6b485596d4d2b644f5f7fc7a02d0169c6/src/main/java/com/github/hypfvieh/util/FileIoUtil.java#L98-L108 |
148,971 | hypfvieh/java-utils | src/main/java/com/github/hypfvieh/util/FileIoUtil.java | FileIoUtil.readPropertiesBoolean | public static boolean readPropertiesBoolean(Properties _props, String _property) {
if (_props.containsKey(_property)) {
if (_props.getProperty(_property).matches("(?i)(1|yes|true|enabled|on|y)")) {
return true;
}
}
return false;
} | java | public static boolean readPropertiesBoolean(Properties _props, String _property) {
if (_props.containsKey(_property)) {
if (_props.getProperty(_property).matches("(?i)(1|yes|true|enabled|on|y)")) {
return true;
}
}
return false;
} | [
"public",
"static",
"boolean",
"readPropertiesBoolean",
"(",
"Properties",
"_props",
",",
"String",
"_property",
")",
"{",
"if",
"(",
"_props",
".",
"containsKey",
"(",
"_property",
")",
")",
"{",
"if",
"(",
"_props",
".",
"getProperty",
"(",
"_property",
")... | Reads a property as boolean from an properties object.
Returns true if read property matches 1, yes, true, enabled, on, y
@param _props
@param _property
@return | [
"Reads",
"a",
"property",
"as",
"boolean",
"from",
"an",
"properties",
"object",
".",
"Returns",
"true",
"if",
"read",
"property",
"matches",
"1",
"yes",
"true",
"enabled",
"on",
"y"
] | 407c32d6b485596d4d2b644f5f7fc7a02d0169c6 | https://github.com/hypfvieh/java-utils/blob/407c32d6b485596d4d2b644f5f7fc7a02d0169c6/src/main/java/com/github/hypfvieh/util/FileIoUtil.java#L129-L136 |
148,972 | hypfvieh/java-utils | src/main/java/com/github/hypfvieh/util/FileIoUtil.java | FileIoUtil.readFileToString | public static String readFileToString(String _file) {
List<String> localText = getTextfileFromUrl(_file);
if (localText == null) {
return null;
}
return StringUtil.join(guessLineTerminatorOfFile(_file), localText);
} | java | public static String readFileToString(String _file) {
List<String> localText = getTextfileFromUrl(_file);
if (localText == null) {
return null;
}
return StringUtil.join(guessLineTerminatorOfFile(_file), localText);
} | [
"public",
"static",
"String",
"readFileToString",
"(",
"String",
"_file",
")",
"{",
"List",
"<",
"String",
">",
"localText",
"=",
"getTextfileFromUrl",
"(",
"_file",
")",
";",
"if",
"(",
"localText",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"r... | Reads a file and returns it's content as string.
@param _file
@return | [
"Reads",
"a",
"file",
"and",
"returns",
"it",
"s",
"content",
"as",
"string",
"."
] | 407c32d6b485596d4d2b644f5f7fc7a02d0169c6 | https://github.com/hypfvieh/java-utils/blob/407c32d6b485596d4d2b644f5f7fc7a02d0169c6/src/main/java/com/github/hypfvieh/util/FileIoUtil.java#L240-L247 |
148,973 | hypfvieh/java-utils | src/main/java/com/github/hypfvieh/util/FileIoUtil.java | FileIoUtil.readFileFromClassPath | public static String readFileFromClassPath(String _fileName) {
StringBuilder sb = new StringBuilder();
for (String string : readFileFromClassPathAsList(_fileName)) {
sb.append(string).append("\n");
}
return sb.length() == 0 ? null : sb.toString();
} | java | public static String readFileFromClassPath(String _fileName) {
StringBuilder sb = new StringBuilder();
for (String string : readFileFromClassPathAsList(_fileName)) {
sb.append(string).append("\n");
}
return sb.length() == 0 ? null : sb.toString();
} | [
"public",
"static",
"String",
"readFileFromClassPath",
"(",
"String",
"_fileName",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"String",
"string",
":",
"readFileFromClassPathAsList",
"(",
"_fileName",
")",
")",
"{",
... | Reads a file from classpath to String.
@param _fileName
@return file contents as String or null | [
"Reads",
"a",
"file",
"from",
"classpath",
"to",
"String",
"."
] | 407c32d6b485596d4d2b644f5f7fc7a02d0169c6 | https://github.com/hypfvieh/java-utils/blob/407c32d6b485596d4d2b644f5f7fc7a02d0169c6/src/main/java/com/github/hypfvieh/util/FileIoUtil.java#L351-L357 |
148,974 | hypfvieh/java-utils | src/main/java/com/github/hypfvieh/util/FileIoUtil.java | FileIoUtil.readFileFromClassPathAsList | public static List<String> readFileFromClassPathAsList(String _fileName) {
List<String> result = readFileFromClassPathAsList(_fileName, Charset.defaultCharset(), false);
return result == null ? new ArrayList<String>() : result;
} | java | public static List<String> readFileFromClassPathAsList(String _fileName) {
List<String> result = readFileFromClassPathAsList(_fileName, Charset.defaultCharset(), false);
return result == null ? new ArrayList<String>() : result;
} | [
"public",
"static",
"List",
"<",
"String",
">",
"readFileFromClassPathAsList",
"(",
"String",
"_fileName",
")",
"{",
"List",
"<",
"String",
">",
"result",
"=",
"readFileFromClassPathAsList",
"(",
"_fileName",
",",
"Charset",
".",
"defaultCharset",
"(",
")",
",",... | Reads a file from classpath to a list of String using default charset and log any exception.
@param _fileName
@return file contents or empty list | [
"Reads",
"a",
"file",
"from",
"classpath",
"to",
"a",
"list",
"of",
"String",
"using",
"default",
"charset",
"and",
"log",
"any",
"exception",
"."
] | 407c32d6b485596d4d2b644f5f7fc7a02d0169c6 | https://github.com/hypfvieh/java-utils/blob/407c32d6b485596d4d2b644f5f7fc7a02d0169c6/src/main/java/com/github/hypfvieh/util/FileIoUtil.java#L365-L368 |
148,975 | hypfvieh/java-utils | src/main/java/com/github/hypfvieh/util/FileIoUtil.java | FileIoUtil.readFileFromClassPathAsList | public static List<String> readFileFromClassPathAsList(String _fileName, Charset _charset, boolean _silent) {
List<String> contents = new ArrayList<>();
if (StringUtil.isBlank(_fileName)) {
return contents;
}
InputStream inputStream = FileIoUtil.class.getClassLoader().getReso... | java | public static List<String> readFileFromClassPathAsList(String _fileName, Charset _charset, boolean _silent) {
List<String> contents = new ArrayList<>();
if (StringUtil.isBlank(_fileName)) {
return contents;
}
InputStream inputStream = FileIoUtil.class.getClassLoader().getReso... | [
"public",
"static",
"List",
"<",
"String",
">",
"readFileFromClassPathAsList",
"(",
"String",
"_fileName",
",",
"Charset",
"_charset",
",",
"boolean",
"_silent",
")",
"{",
"List",
"<",
"String",
">",
"contents",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
... | Reads a file from classpath to a list of String with the given charset.
Will optionally suppress any exception logging.
@param _fileName file to read
@param _charset charset to use for reading
@param _silent true to suppress error logging, false otherwise
@return file contents or null on exception | [
"Reads",
"a",
"file",
"from",
"classpath",
"to",
"a",
"list",
"of",
"String",
"with",
"the",
"given",
"charset",
".",
"Will",
"optionally",
"suppress",
"any",
"exception",
"logging",
"."
] | 407c32d6b485596d4d2b644f5f7fc7a02d0169c6 | https://github.com/hypfvieh/java-utils/blob/407c32d6b485596d4d2b644f5f7fc7a02d0169c6/src/main/java/com/github/hypfvieh/util/FileIoUtil.java#L379-L406 |
148,976 | hypfvieh/java-utils | src/main/java/com/github/hypfvieh/util/FileIoUtil.java | FileIoUtil.writeTextFile | public static boolean writeTextFile(String _fileName, String _fileContent, Charset _charset, boolean _append) {
if (StringUtil.isBlank(_fileName)) {
return false;
}
String allText = "";
if (_append) {
File file = new File(_fileName);
if (file.exists())... | java | public static boolean writeTextFile(String _fileName, String _fileContent, Charset _charset, boolean _append) {
if (StringUtil.isBlank(_fileName)) {
return false;
}
String allText = "";
if (_append) {
File file = new File(_fileName);
if (file.exists())... | [
"public",
"static",
"boolean",
"writeTextFile",
"(",
"String",
"_fileName",
",",
"String",
"_fileContent",
",",
"Charset",
"_charset",
",",
"boolean",
"_append",
")",
"{",
"if",
"(",
"StringUtil",
".",
"isBlank",
"(",
"_fileName",
")",
")",
"{",
"return",
"f... | Write String to file with the given charset.
Optionally appends the data to the file.
@param _fileName the file to write
@param _fileContent the content to write
@param _charset the charset to use
@param _append append content to file, if false file will be overwritten if existing
@return true on successful write, fa... | [
"Write",
"String",
"to",
"file",
"with",
"the",
"given",
"charset",
".",
"Optionally",
"appends",
"the",
"data",
"to",
"the",
"file",
"."
] | 407c32d6b485596d4d2b644f5f7fc7a02d0169c6 | https://github.com/hypfvieh/java-utils/blob/407c32d6b485596d4d2b644f5f7fc7a02d0169c6/src/main/java/com/github/hypfvieh/util/FileIoUtil.java#L419-L451 |
148,977 | hypfvieh/java-utils | src/main/java/com/github/hypfvieh/util/FileIoUtil.java | FileIoUtil.readFileFrom | public static List<String> readFileFrom(String _fileName, Charset _charset, SearchOrder... _searchOrder) {
InputStream stream = openInputStreamForFile(_fileName, _searchOrder);
if (stream != null) {
return readTextFileFromStream(stream, _charset, true);
}
return null;
} | java | public static List<String> readFileFrom(String _fileName, Charset _charset, SearchOrder... _searchOrder) {
InputStream stream = openInputStreamForFile(_fileName, _searchOrder);
if (stream != null) {
return readTextFileFromStream(stream, _charset, true);
}
return null;
} | [
"public",
"static",
"List",
"<",
"String",
">",
"readFileFrom",
"(",
"String",
"_fileName",
",",
"Charset",
"_charset",
",",
"SearchOrder",
"...",
"_searchOrder",
")",
"{",
"InputStream",
"stream",
"=",
"openInputStreamForFile",
"(",
"_fileName",
",",
"_searchOrde... | Read a file from different sources depending on _searchOrder.
Will return the first successfully read file which can be loaded either from custom path, classpath or system path.
@param _fileName file to read
@param _charset charset used for reading
@param _searchOrder search order
@return List of String with file cont... | [
"Read",
"a",
"file",
"from",
"different",
"sources",
"depending",
"on",
"_searchOrder",
".",
"Will",
"return",
"the",
"first",
"successfully",
"read",
"file",
"which",
"can",
"be",
"loaded",
"either",
"from",
"custom",
"path",
"classpath",
"or",
"system",
"pat... | 407c32d6b485596d4d2b644f5f7fc7a02d0169c6 | https://github.com/hypfvieh/java-utils/blob/407c32d6b485596d4d2b644f5f7fc7a02d0169c6/src/main/java/com/github/hypfvieh/util/FileIoUtil.java#L476-L482 |
148,978 | eurekaclinical/protempa | protempa-ksb-protege/src/main/java/org/protempa/backend/ksb/protege/RemoteConnectionManager.java | RemoteConnectionManager.initProject | protected Project initProject() {
return RemoteProjectManager.getInstance().getProject(host, username,
password, getProjectIdentifier(), false);
} | java | protected Project initProject() {
return RemoteProjectManager.getInstance().getProject(host, username,
password, getProjectIdentifier(), false);
} | [
"protected",
"Project",
"initProject",
"(",
")",
"{",
"return",
"RemoteProjectManager",
".",
"getInstance",
"(",
")",
".",
"getProject",
"(",
"host",
",",
"username",
",",
"password",
",",
"getProjectIdentifier",
"(",
")",
",",
"false",
")",
";",
"}"
] | Connects to the project specified in the constructor. Throws an
undocumented runtime exception
from within Protege if something bad happens.
@return a Protege {@link Project}. | [
"Connects",
"to",
"the",
"project",
"specified",
"in",
"the",
"constructor",
".",
"Throws",
"an",
"undocumented",
"runtime",
"exception",
"from",
"within",
"Protege",
"if",
"something",
"bad",
"happens",
"."
] | 5a620d1a407c7a5426d1cf17d47b97717cf71634 | https://github.com/eurekaclinical/protempa/blob/5a620d1a407c7a5426d1cf17d47b97717cf71634/protempa-ksb-protege/src/main/java/org/protempa/backend/ksb/protege/RemoteConnectionManager.java#L68-L71 |
148,979 | rolfl/MicroBench | src/main/java/net/tuis/ubench/UUtils.java | UUtils.getLogger | public static Logger getLogger(final Class<?> clazz) {
if (!clazz.getPackage().getName().startsWith(LOGGER.getName())) {
throw new IllegalArgumentException(String.format("Class %s is not a child of the package %s",
clazz.getName(), LOGGER.getName()));
}
LOGGER.fin... | java | public static Logger getLogger(final Class<?> clazz) {
if (!clazz.getPackage().getName().startsWith(LOGGER.getName())) {
throw new IllegalArgumentException(String.format("Class %s is not a child of the package %s",
clazz.getName(), LOGGER.getName()));
}
LOGGER.fin... | [
"public",
"static",
"Logger",
"getLogger",
"(",
"final",
"Class",
"<",
"?",
">",
"clazz",
")",
"{",
"if",
"(",
"!",
"clazz",
".",
"getPackage",
"(",
")",
".",
"getName",
"(",
")",
".",
"startsWith",
"(",
"LOGGER",
".",
"getName",
"(",
")",
")",
")"... | Simple wrapper that forces initialization of the package-level LOGGER
instance.
@param clazz
The class to be logged.
@return A Logger using the name of the class as its hierarchy. | [
"Simple",
"wrapper",
"that",
"forces",
"initialization",
"of",
"the",
"package",
"-",
"level",
"LOGGER",
"instance",
"."
] | f2bfa92dacd7ea0d6b8eae4d4fe2975139d317ce | https://github.com/rolfl/MicroBench/blob/f2bfa92dacd7ea0d6b8eae4d4fe2975139d317ce/src/main/java/net/tuis/ubench/UUtils.java#L40-L47 |
148,980 | rolfl/MicroBench | src/main/java/net/tuis/ubench/UUtils.java | UUtils.setStandaloneLogging | public static void setStandaloneLogging(Level level) {
LOGGER.setUseParentHandlers(false);
for (Handler h : LOGGER.getHandlers()) {
LOGGER.removeHandler(h);
}
StdoutHandler handler = new StdoutHandler();
handler.setFormatter(new InlineFormatter());
LOGGER.addH... | java | public static void setStandaloneLogging(Level level) {
LOGGER.setUseParentHandlers(false);
for (Handler h : LOGGER.getHandlers()) {
LOGGER.removeHandler(h);
}
StdoutHandler handler = new StdoutHandler();
handler.setFormatter(new InlineFormatter());
LOGGER.addH... | [
"public",
"static",
"void",
"setStandaloneLogging",
"(",
"Level",
"level",
")",
"{",
"LOGGER",
".",
"setUseParentHandlers",
"(",
"false",
")",
";",
"for",
"(",
"Handler",
"h",
":",
"LOGGER",
".",
"getHandlers",
"(",
")",
")",
"{",
"LOGGER",
".",
"removeHan... | Enable regular logging for all UBench code at the specified level.
@param level
the level to log for. | [
"Enable",
"regular",
"logging",
"for",
"all",
"UBench",
"code",
"at",
"the",
"specified",
"level",
"."
] | f2bfa92dacd7ea0d6b8eae4d4fe2975139d317ce | https://github.com/rolfl/MicroBench/blob/f2bfa92dacd7ea0d6b8eae4d4fe2975139d317ce/src/main/java/net/tuis/ubench/UUtils.java#L55-L73 |
148,981 | rolfl/MicroBench | src/main/java/net/tuis/ubench/UUtils.java | UUtils.setLogLevel | public static void setLogLevel(Level level) {
// all other ubench loggers inherit from here.
LOGGER.finer("Changing logging from " + LOGGER.getLevel());
LOGGER.setLevel(level);
if (!LOGGER.getUseParentHandlers()) {
LOGGER.setLevel(level);
Stream.of(LOGGER.getHandl... | java | public static void setLogLevel(Level level) {
// all other ubench loggers inherit from here.
LOGGER.finer("Changing logging from " + LOGGER.getLevel());
LOGGER.setLevel(level);
if (!LOGGER.getUseParentHandlers()) {
LOGGER.setLevel(level);
Stream.of(LOGGER.getHandl... | [
"public",
"static",
"void",
"setLogLevel",
"(",
"Level",
"level",
")",
"{",
"// all other ubench loggers inherit from here.",
"LOGGER",
".",
"finer",
"(",
"\"Changing logging from \"",
"+",
"LOGGER",
".",
"getLevel",
"(",
")",
")",
";",
"LOGGER",
".",
"setLevel",
... | Enable the specified debug level messages to be output. Note that both
this Logger and whatever Handler you use, have to be set to enable the
required log level for the handler to output the messages. If this UBench
code is logging 'stand alone' then this method will also change the
output level of the log handlers.
@... | [
"Enable",
"the",
"specified",
"debug",
"level",
"messages",
"to",
"be",
"output",
".",
"Note",
"that",
"both",
"this",
"Logger",
"and",
"whatever",
"Handler",
"you",
"use",
"have",
"to",
"be",
"set",
"to",
"enable",
"the",
"required",
"log",
"level",
"for"... | f2bfa92dacd7ea0d6b8eae4d4fe2975139d317ce | https://github.com/rolfl/MicroBench/blob/f2bfa92dacd7ea0d6b8eae4d4fe2975139d317ce/src/main/java/net/tuis/ubench/UUtils.java#L84-L93 |
148,982 | rolfl/MicroBench | src/main/java/net/tuis/ubench/UUtils.java | UUtils.readResource | public static String readResource(String path) {
final long start = System.nanoTime();
try (InputStream is = UScale.class.getClassLoader().getResourceAsStream(path);) {
int len = 0;
byte[] buffer = new byte[2048];
ByteArrayOutputStream baos = new ByteArrayOutputStream... | java | public static String readResource(String path) {
final long start = System.nanoTime();
try (InputStream is = UScale.class.getClassLoader().getResourceAsStream(path);) {
int len = 0;
byte[] buffer = new byte[2048];
ByteArrayOutputStream baos = new ByteArrayOutputStream... | [
"public",
"static",
"String",
"readResource",
"(",
"String",
"path",
")",
"{",
"final",
"long",
"start",
"=",
"System",
".",
"nanoTime",
"(",
")",
";",
"try",
"(",
"InputStream",
"is",
"=",
"UScale",
".",
"class",
".",
"getClassLoader",
"(",
")",
".",
... | Load a resource stored in the classpath, as a String.
@param path
the system resource to read
@return the resource as a String. | [
"Load",
"a",
"resource",
"stored",
"in",
"the",
"classpath",
"as",
"a",
"String",
"."
] | f2bfa92dacd7ea0d6b8eae4d4fe2975139d317ce | https://github.com/rolfl/MicroBench/blob/f2bfa92dacd7ea0d6b8eae4d4fe2975139d317ce/src/main/java/net/tuis/ubench/UUtils.java#L138-L158 |
148,983 | ebean-orm/querybean-agent-now-merged-into-ebean-agent- | src/main/java/io/ebean/typequery/agent/TypeQueryAddMethods.java | TypeQueryAddMethods.add | public static void add(ClassVisitor cw, ClassInfo classInfo, boolean typeQueryRootBean) {
List<FieldInfo> fields = classInfo.getFields();
if (fields != null) {
for (FieldInfo field : fields) {
field.writeMethod(cw, typeQueryRootBean);
}
}
} | java | public static void add(ClassVisitor cw, ClassInfo classInfo, boolean typeQueryRootBean) {
List<FieldInfo> fields = classInfo.getFields();
if (fields != null) {
for (FieldInfo field : fields) {
field.writeMethod(cw, typeQueryRootBean);
}
}
} | [
"public",
"static",
"void",
"add",
"(",
"ClassVisitor",
"cw",
",",
"ClassInfo",
"classInfo",
",",
"boolean",
"typeQueryRootBean",
")",
"{",
"List",
"<",
"FieldInfo",
">",
"fields",
"=",
"classInfo",
".",
"getFields",
"(",
")",
";",
"if",
"(",
"fields",
"!=... | Add the generated 'property access' methods. | [
"Add",
"the",
"generated",
"property",
"access",
"methods",
"."
] | a063554fabdbed15ff5e10ad0a0b53b67e039006 | https://github.com/ebean-orm/querybean-agent-now-merged-into-ebean-agent-/blob/a063554fabdbed15ff5e10ad0a0b53b67e039006/src/main/java/io/ebean/typequery/agent/TypeQueryAddMethods.java#L16-L25 |
148,984 | hypfvieh/java-utils | src/main/java/com/github/hypfvieh/util/NetUtil.java | NetUtil.getHostName | public static String getHostName(String _ipAddress) {
try {
InetAddress addr = InetAddress.getByName(_ipAddress);
return addr.getHostName();
} catch (Exception _ex) {
return _ipAddress;
}
} | java | public static String getHostName(String _ipAddress) {
try {
InetAddress addr = InetAddress.getByName(_ipAddress);
return addr.getHostName();
} catch (Exception _ex) {
return _ipAddress;
}
} | [
"public",
"static",
"String",
"getHostName",
"(",
"String",
"_ipAddress",
")",
"{",
"try",
"{",
"InetAddress",
"addr",
"=",
"InetAddress",
".",
"getByName",
"(",
"_ipAddress",
")",
";",
"return",
"addr",
".",
"getHostName",
"(",
")",
";",
"}",
"catch",
"("... | Get the host name of a local address, if available.
@param _ipAddress the IP address
@return the host name, or the original IP if name not available | [
"Get",
"the",
"host",
"name",
"of",
"a",
"local",
"address",
"if",
"available",
"."
] | 407c32d6b485596d4d2b644f5f7fc7a02d0169c6 | https://github.com/hypfvieh/java-utils/blob/407c32d6b485596d4d2b644f5f7fc7a02d0169c6/src/main/java/com/github/hypfvieh/util/NetUtil.java#L21-L28 |
148,985 | hypfvieh/java-utils | src/main/java/com/github/hypfvieh/util/NetUtil.java | NetUtil.isIPv4orIPv6Address | public static boolean isIPv4orIPv6Address(String _ipAddress) {
return IPV4_PATTERN.matcher(_ipAddress).matches() || IPV6_PATTERN.matcher(_ipAddress).matches();
} | java | public static boolean isIPv4orIPv6Address(String _ipAddress) {
return IPV4_PATTERN.matcher(_ipAddress).matches() || IPV6_PATTERN.matcher(_ipAddress).matches();
} | [
"public",
"static",
"boolean",
"isIPv4orIPv6Address",
"(",
"String",
"_ipAddress",
")",
"{",
"return",
"IPV4_PATTERN",
".",
"matcher",
"(",
"_ipAddress",
")",
".",
"matches",
"(",
")",
"||",
"IPV6_PATTERN",
".",
"matcher",
"(",
"_ipAddress",
")",
".",
"matches... | Checks if given String is either a valid IPv4 or IPv6 address.
@param _ipAddress
@return true if valid address, false otherwise | [
"Checks",
"if",
"given",
"String",
"is",
"either",
"a",
"valid",
"IPv4",
"or",
"IPv6",
"address",
"."
] | 407c32d6b485596d4d2b644f5f7fc7a02d0169c6 | https://github.com/hypfvieh/java-utils/blob/407c32d6b485596d4d2b644f5f7fc7a02d0169c6/src/main/java/com/github/hypfvieh/util/NetUtil.java#L56-L58 |
148,986 | eurekaclinical/protempa | protempa-framework/src/main/java/org/protempa/proposition/value/OrdinalValue.java | OrdinalValue.compare | @Override
public ValueComparator compare(Value o) {
if (o == null) {
return ValueComparator.NOT_EQUAL_TO;
}
switch (o.getType()) {
case ORDINALVALUE:
OrdinalValue other = (OrdinalValue) o;
if (val == null || other.val == null) {
... | java | @Override
public ValueComparator compare(Value o) {
if (o == null) {
return ValueComparator.NOT_EQUAL_TO;
}
switch (o.getType()) {
case ORDINALVALUE:
OrdinalValue other = (OrdinalValue) o;
if (val == null || other.val == null) {
... | [
"@",
"Override",
"public",
"ValueComparator",
"compare",
"(",
"Value",
"o",
")",
"{",
"if",
"(",
"o",
"==",
"null",
")",
"{",
"return",
"ValueComparator",
".",
"NOT_EQUAL_TO",
";",
"}",
"switch",
"(",
"o",
".",
"getType",
"(",
")",
")",
"{",
"case",
... | Compares this value and another according to the defined order, or
checks this number value for membership in a value list.
@param o a {@link Value}.
@return If the provided value is an {@link OrdinalValue}, returns
{@link ValueComparator#GREATER_THAN},
{@link ValueComparator#LESS_THAN} or {@link ValueComparator#EQUAL... | [
"Compares",
"this",
"value",
"and",
"another",
"according",
"to",
"the",
"defined",
"order",
"or",
"checks",
"this",
"number",
"value",
"for",
"membership",
"in",
"a",
"value",
"list",
"."
] | 5a620d1a407c7a5426d1cf17d47b97717cf71634 | https://github.com/eurekaclinical/protempa/blob/5a620d1a407c7a5426d1cf17d47b97717cf71634/protempa-framework/src/main/java/org/protempa/proposition/value/OrdinalValue.java#L114-L141 |
148,987 | ops4j/org.ops4j.pax.wicket | service/src/main/java/org/ops4j/pax/wicket/internal/injection/BundleAnalysingComponentInstantiationListener.java | BundleAnalysingComponentInstantiationListener.getGenericTypeArgument | public static Class<?> getGenericTypeArgument(Field field) {
// TODO Might this better be located under SPI in an "InjectionUtil" class or something?
Type genericType = field.getGenericType();
if (genericType instanceof ParameterizedType) {
ParameterizedType parameterizedType = (Para... | java | public static Class<?> getGenericTypeArgument(Field field) {
// TODO Might this better be located under SPI in an "InjectionUtil" class or something?
Type genericType = field.getGenericType();
if (genericType instanceof ParameterizedType) {
ParameterizedType parameterizedType = (Para... | [
"public",
"static",
"Class",
"<",
"?",
">",
"getGenericTypeArgument",
"(",
"Field",
"field",
")",
"{",
"// TODO Might this better be located under SPI in an \"InjectionUtil\" class or something?",
"Type",
"genericType",
"=",
"field",
".",
"getGenericType",
"(",
")",
";",
... | Takes a field and returns the type argument for this
@param field a {@link java.lang.reflect.Field} object.
@return the type of the generic parameter of that field | [
"Takes",
"a",
"field",
"and",
"returns",
"the",
"type",
"argument",
"for",
"this"
] | ef7cb4bdf918e9e61ec69789b9c690567616faa9 | https://github.com/ops4j/org.ops4j.pax.wicket/blob/ef7cb4bdf918e9e61ec69789b9c690567616faa9/service/src/main/java/org/ops4j/pax/wicket/internal/injection/BundleAnalysingComponentInstantiationListener.java#L188-L216 |
148,988 | eurekaclinical/protempa | protempa-framework/src/main/java/org/protempa/Protempa.java | Protempa.validateDataSourceBackendData | public DataValidationEvent[] validateDataSourceBackendData()
throws DataSourceFailedDataValidationException,
DataSourceValidationIncompleteException {
KnowledgeSource knowledgeSource = getKnowledgeSource();
List<DataValidationEvent> validationEvents = new ArrayList<>();
t... | java | public DataValidationEvent[] validateDataSourceBackendData()
throws DataSourceFailedDataValidationException,
DataSourceValidationIncompleteException {
KnowledgeSource knowledgeSource = getKnowledgeSource();
List<DataValidationEvent> validationEvents = new ArrayList<>();
t... | [
"public",
"DataValidationEvent",
"[",
"]",
"validateDataSourceBackendData",
"(",
")",
"throws",
"DataSourceFailedDataValidationException",
",",
"DataSourceValidationIncompleteException",
"{",
"KnowledgeSource",
"knowledgeSource",
"=",
"getKnowledgeSource",
"(",
")",
";",
"List"... | Runs each data source backend's data validation routine.
@throws DataSourceFailedDataValidationException if validation failed.
@throws DataSourceValidationIncompleteException if an error occurred
during validation that prevented its completion. | [
"Runs",
"each",
"data",
"source",
"backend",
"s",
"data",
"validation",
"routine",
"."
] | 5a620d1a407c7a5426d1cf17d47b97717cf71634 | https://github.com/eurekaclinical/protempa/blob/5a620d1a407c7a5426d1cf17d47b97717cf71634/protempa-framework/src/main/java/org/protempa/Protempa.java#L256-L274 |
148,989 | eurekaclinical/protempa | protempa-framework/src/main/java/org/protempa/Protempa.java | Protempa.clear | public void clear() {
this.abstractionFinder.getAlgorithmSource().clear();
this.abstractionFinder.getDataSource().clear();
this.abstractionFinder.getKnowledgeSource().clear();
LOGGER.fine("Protempa cleared");
} | java | public void clear() {
this.abstractionFinder.getAlgorithmSource().clear();
this.abstractionFinder.getDataSource().clear();
this.abstractionFinder.getKnowledgeSource().clear();
LOGGER.fine("Protempa cleared");
} | [
"public",
"void",
"clear",
"(",
")",
"{",
"this",
".",
"abstractionFinder",
".",
"getAlgorithmSource",
"(",
")",
".",
"clear",
"(",
")",
";",
"this",
".",
"abstractionFinder",
".",
"getDataSource",
"(",
")",
".",
"clear",
"(",
")",
";",
"this",
".",
"a... | Clears resources created by this object and the data source, knowledge
source and algorithm source. | [
"Clears",
"resources",
"created",
"by",
"this",
"object",
"and",
"the",
"data",
"source",
"knowledge",
"source",
"and",
"algorithm",
"source",
"."
] | 5a620d1a407c7a5426d1cf17d47b97717cf71634 | https://github.com/eurekaclinical/protempa/blob/5a620d1a407c7a5426d1cf17d47b97717cf71634/protempa-framework/src/main/java/org/protempa/Protempa.java#L293-L298 |
148,990 | eurekaclinical/protempa | protempa-framework/src/main/java/org/protempa/PropositionDefinitionCache.java | PropositionDefinitionCache.merge | public void merge(PropositionDefinitionCache otherCache) {
if (otherCache != null) {
for (Map.Entry<String, PropositionDefinition> me : otherCache.cache.entrySet()) {
this.cache.putIfAbsent(me.getKey(), me.getValue());
}
}
} | java | public void merge(PropositionDefinitionCache otherCache) {
if (otherCache != null) {
for (Map.Entry<String, PropositionDefinition> me : otherCache.cache.entrySet()) {
this.cache.putIfAbsent(me.getKey(), me.getValue());
}
}
} | [
"public",
"void",
"merge",
"(",
"PropositionDefinitionCache",
"otherCache",
")",
"{",
"if",
"(",
"otherCache",
"!=",
"null",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"PropositionDefinition",
">",
"me",
":",
"otherCache",
".",
"cache",
... | Merges the given cache into this one. Any proposition definitions that
are not in this cache will be added.
@param otherCache another proposition definition cache. | [
"Merges",
"the",
"given",
"cache",
"into",
"this",
"one",
".",
"Any",
"proposition",
"definitions",
"that",
"are",
"not",
"in",
"this",
"cache",
"will",
"be",
"added",
"."
] | 5a620d1a407c7a5426d1cf17d47b97717cf71634 | https://github.com/eurekaclinical/protempa/blob/5a620d1a407c7a5426d1cf17d47b97717cf71634/protempa-framework/src/main/java/org/protempa/PropositionDefinitionCache.java#L54-L60 |
148,991 | eurekaclinical/protempa | protempa-framework/src/main/java/org/protempa/proposition/TemporalProposition.java | TemporalProposition.setInterval | public void setInterval(Interval interval) {
if (interval == null) {
interval = INTERVAL_FACTORY.getInstance();
}
this.interval = interval;
} | java | public void setInterval(Interval interval) {
if (interval == null) {
interval = INTERVAL_FACTORY.getInstance();
}
this.interval = interval;
} | [
"public",
"void",
"setInterval",
"(",
"Interval",
"interval",
")",
"{",
"if",
"(",
"interval",
"==",
"null",
")",
"{",
"interval",
"=",
"INTERVAL_FACTORY",
".",
"getInstance",
"(",
")",
";",
"}",
"this",
".",
"interval",
"=",
"interval",
";",
"}"
] | Sets the valid interval.
@param interval an <code>Interval</code>. | [
"Sets",
"the",
"valid",
"interval",
"."
] | 5a620d1a407c7a5426d1cf17d47b97717cf71634 | https://github.com/eurekaclinical/protempa/blob/5a620d1a407c7a5426d1cf17d47b97717cf71634/protempa-framework/src/main/java/org/protempa/proposition/TemporalProposition.java#L93-L98 |
148,992 | eurekaclinical/protempa | protempa-framework/src/main/java/org/protempa/proposition/TemporalProposition.java | TemporalProposition.getStartFormattedLong | public final String getStartFormattedLong() {
Granularity startGran = this.interval.getStartGranularity();
return formatStart(startGran != null ? startGran.getLongFormat() : null);
} | java | public final String getStartFormattedLong() {
Granularity startGran = this.interval.getStartGranularity();
return formatStart(startGran != null ? startGran.getLongFormat() : null);
} | [
"public",
"final",
"String",
"getStartFormattedLong",
"(",
")",
"{",
"Granularity",
"startGran",
"=",
"this",
".",
"interval",
".",
"getStartGranularity",
"(",
")",
";",
"return",
"formatStart",
"(",
"startGran",
"!=",
"null",
"?",
"startGran",
".",
"getLongForm... | Returns the earliest valid time of this proposition as a long string.
@return a <code>String</code>. | [
"Returns",
"the",
"earliest",
"valid",
"time",
"of",
"this",
"proposition",
"as",
"a",
"long",
"string",
"."
] | 5a620d1a407c7a5426d1cf17d47b97717cf71634 | https://github.com/eurekaclinical/protempa/blob/5a620d1a407c7a5426d1cf17d47b97717cf71634/protempa-framework/src/main/java/org/protempa/proposition/TemporalProposition.java#L105-L108 |
148,993 | eurekaclinical/protempa | protempa-framework/src/main/java/org/protempa/proposition/TemporalProposition.java | TemporalProposition.getFinishFormattedLong | public final String getFinishFormattedLong() {
Granularity finishGran = this.interval.getFinishGranularity();
return formatFinish(finishGran != null ? finishGran.getLongFormat()
: null);
} | java | public final String getFinishFormattedLong() {
Granularity finishGran = this.interval.getFinishGranularity();
return formatFinish(finishGran != null ? finishGran.getLongFormat()
: null);
} | [
"public",
"final",
"String",
"getFinishFormattedLong",
"(",
")",
"{",
"Granularity",
"finishGran",
"=",
"this",
".",
"interval",
".",
"getFinishGranularity",
"(",
")",
";",
"return",
"formatFinish",
"(",
"finishGran",
"!=",
"null",
"?",
"finishGran",
".",
"getLo... | Returns the latest valid time of this proposition as a long string.
@return a <code>String</code>. | [
"Returns",
"the",
"latest",
"valid",
"time",
"of",
"this",
"proposition",
"as",
"a",
"long",
"string",
"."
] | 5a620d1a407c7a5426d1cf17d47b97717cf71634 | https://github.com/eurekaclinical/protempa/blob/5a620d1a407c7a5426d1cf17d47b97717cf71634/protempa-framework/src/main/java/org/protempa/proposition/TemporalProposition.java#L133-L137 |
148,994 | eurekaclinical/protempa | protempa-framework/src/main/java/org/protempa/proposition/TemporalProposition.java | TemporalProposition.readTemporalProposition | protected void readTemporalProposition(ObjectInputStream s)
throws IOException, ClassNotFoundException {
int mode = s.readChar();
try {
switch (mode) {
case 0:
setInterval(INTERVAL_FACTORY.getInstance(s.readLong(),
(... | java | protected void readTemporalProposition(ObjectInputStream s)
throws IOException, ClassNotFoundException {
int mode = s.readChar();
try {
switch (mode) {
case 0:
setInterval(INTERVAL_FACTORY.getInstance(s.readLong(),
(... | [
"protected",
"void",
"readTemporalProposition",
"(",
"ObjectInputStream",
"s",
")",
"throws",
"IOException",
",",
"ClassNotFoundException",
"{",
"int",
"mode",
"=",
"s",
".",
"readChar",
"(",
")",
";",
"try",
"{",
"switch",
"(",
"mode",
")",
"{",
"case",
"0"... | Called while deserializing a temporal proposition.
@param s an {@link ObjectInputStream}.
@throws IOException input/output error during deserialization.
@throws ClassNotFoundException class of a serialized object cannot be
found. | [
"Called",
"while",
"deserializing",
"a",
"temporal",
"proposition",
"."
] | 5a620d1a407c7a5426d1cf17d47b97717cf71634 | https://github.com/eurekaclinical/protempa/blob/5a620d1a407c7a5426d1cf17d47b97717cf71634/protempa-framework/src/main/java/org/protempa/proposition/TemporalProposition.java#L323-L352 |
148,995 | jarekratajski/badass | badass/src/main/java/pl/setblack/badass/Politician.java | Politician.beatAroundTheBush | public static <R> R beatAroundTheBush(Callable<R> callable) {
try {
return callable.call();
} catch (Exception e) {
throw new RuntimeException(e);
}
} | java | public static <R> R beatAroundTheBush(Callable<R> callable) {
try {
return callable.call();
} catch (Exception e) {
throw new RuntimeException(e);
}
} | [
"public",
"static",
"<",
"R",
">",
"R",
"beatAroundTheBush",
"(",
"Callable",
"<",
"R",
">",
"callable",
")",
"{",
"try",
"{",
"return",
"callable",
".",
"call",
"(",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"throw",
"new",
"RuntimeEx... | If exception happens during callable automatically wrap it in
RuntimeException. | [
"If",
"exception",
"happens",
"during",
"callable",
"automatically",
"wrap",
"it",
"in",
"RuntimeException",
"."
] | ced39171044d60340e03a6c1ea7a0e2c483df558 | https://github.com/jarekratajski/badass/blob/ced39171044d60340e03a6c1ea7a0e2c483df558/badass/src/main/java/pl/setblack/badass/Politician.java#L20-L26 |
148,996 | kevoree/kevoree-library | mqttServer/src/main/java/org/dna/mqtt/moquette/messaging/spi/impl/HawtDBStorageService.java | HawtDBStorageService.initInflightMessageStore | private void initInflightMessageStore() {
BTreeIndexFactory<String, StoredPublishEvent> indexFactory = new BTreeIndexFactory<String, StoredPublishEvent>();
indexFactory.setKeyCodec(StringCodec.INSTANCE);
m_inflightStore = (SortedIndex<String, StoredPublishEvent>) m_multiIndexFactory.openOrCreat... | java | private void initInflightMessageStore() {
BTreeIndexFactory<String, StoredPublishEvent> indexFactory = new BTreeIndexFactory<String, StoredPublishEvent>();
indexFactory.setKeyCodec(StringCodec.INSTANCE);
m_inflightStore = (SortedIndex<String, StoredPublishEvent>) m_multiIndexFactory.openOrCreat... | [
"private",
"void",
"initInflightMessageStore",
"(",
")",
"{",
"BTreeIndexFactory",
"<",
"String",
",",
"StoredPublishEvent",
">",
"indexFactory",
"=",
"new",
"BTreeIndexFactory",
"<",
"String",
",",
"StoredPublishEvent",
">",
"(",
")",
";",
"indexFactory",
".",
"s... | Initialize the message store used to handle the temporary storage of QoS 1,2
messages in flight. | [
"Initialize",
"the",
"message",
"store",
"used",
"to",
"handle",
"the",
"temporary",
"storage",
"of",
"QoS",
"1",
"2",
"messages",
"in",
"flight",
"."
] | 617460e6c5881902ebc488a31ecdea179024d8f1 | https://github.com/kevoree/kevoree-library/blob/617460e6c5881902ebc488a31ecdea179024d8f1/mqttServer/src/main/java/org/dna/mqtt/moquette/messaging/spi/impl/HawtDBStorageService.java#L137-L142 |
148,997 | eurekaclinical/protempa | protempa-framework/src/main/java/org/protempa/JBossRuleCreator.java | JBossRuleCreator.visit | @Override
public void visit(LowLevelAbstractionDefinition def) throws ProtempaException {
LOGGER.log(Level.FINER, "Creating rule for {0}", def);
try {
/*
* If there are no value definitions defined, we might still have an
* inverseIsA relationship with another l... | java | @Override
public void visit(LowLevelAbstractionDefinition def) throws ProtempaException {
LOGGER.log(Level.FINER, "Creating rule for {0}", def);
try {
/*
* If there are no value definitions defined, we might still have an
* inverseIsA relationship with another l... | [
"@",
"Override",
"public",
"void",
"visit",
"(",
"LowLevelAbstractionDefinition",
"def",
")",
"throws",
"ProtempaException",
"{",
"LOGGER",
".",
"log",
"(",
"Level",
".",
"FINER",
",",
"\"Creating rule for {0}\"",
",",
"def",
")",
";",
"try",
"{",
"/*\n ... | Translates a low-level abstraction definition into rules.
@param def a {@link LowLevelAbstractionDefinition}. Cannot be
<code>null</code>.
@throws KnowledgeSourceReadException if an error occurs accessing the
knowledge source during rule creation. | [
"Translates",
"a",
"low",
"-",
"level",
"abstraction",
"definition",
"into",
"rules",
"."
] | 5a620d1a407c7a5426d1cf17d47b97717cf71634 | https://github.com/eurekaclinical/protempa/blob/5a620d1a407c7a5426d1cf17d47b97717cf71634/protempa-framework/src/main/java/org/protempa/JBossRuleCreator.java#L160-L209 |
148,998 | eurekaclinical/protempa | protempa-framework/src/main/java/org/protempa/JBossRuleCreator.java | JBossRuleCreator.visit | @Override
public void visit(HighLevelAbstractionDefinition def) throws ProtempaException {
LOGGER.log(Level.FINER, "Creating rule for {0}", def);
try {
Set<ExtendedPropositionDefinition> epdsC = def
.getExtendedPropositionDefinitions();
/*
* ... | java | @Override
public void visit(HighLevelAbstractionDefinition def) throws ProtempaException {
LOGGER.log(Level.FINER, "Creating rule for {0}", def);
try {
Set<ExtendedPropositionDefinition> epdsC = def
.getExtendedPropositionDefinitions();
/*
* ... | [
"@",
"Override",
"public",
"void",
"visit",
"(",
"HighLevelAbstractionDefinition",
"def",
")",
"throws",
"ProtempaException",
"{",
"LOGGER",
".",
"log",
"(",
"Level",
".",
"FINER",
",",
"\"Creating rule for {0}\"",
",",
"def",
")",
";",
"try",
"{",
"Set",
"<",... | Translates a high-level abstraction definition into rules.
@param def a {@link HighLevelAbstractionDefinition}. Cannot be
<code>null</code>.
@throws KnowledgeSourceReadException if an error occurs accessing the
knowledge source during rule creation. | [
"Translates",
"a",
"high",
"-",
"level",
"abstraction",
"definition",
"into",
"rules",
"."
] | 5a620d1a407c7a5426d1cf17d47b97717cf71634 | https://github.com/eurekaclinical/protempa/blob/5a620d1a407c7a5426d1cf17d47b97717cf71634/protempa-framework/src/main/java/org/protempa/JBossRuleCreator.java#L253-L290 |
148,999 | eurekaclinical/protempa | protempa-framework/src/main/java/org/protempa/JBossRuleCreator.java | JBossRuleCreator.visit | @Override
public void visit(SliceDefinition def) throws ProtempaException {
LOGGER.log(Level.FINER, "Creating rule for {0}", def);
try {
Set<TemporalExtendedPropositionDefinition> epdsC = def
.getTemporalExtendedPropositionDefinitions();
if (!epdsC.isEmpty... | java | @Override
public void visit(SliceDefinition def) throws ProtempaException {
LOGGER.log(Level.FINER, "Creating rule for {0}", def);
try {
Set<TemporalExtendedPropositionDefinition> epdsC = def
.getTemporalExtendedPropositionDefinitions();
if (!epdsC.isEmpty... | [
"@",
"Override",
"public",
"void",
"visit",
"(",
"SliceDefinition",
"def",
")",
"throws",
"ProtempaException",
"{",
"LOGGER",
".",
"log",
"(",
"Level",
".",
"FINER",
",",
"\"Creating rule for {0}\"",
",",
"def",
")",
";",
"try",
"{",
"Set",
"<",
"TemporalExt... | Translates a slice definition into rules.
@param def a {@link SliceDefinition}. Cannot be <code>null</code>.
@throws KnowledgeSourceReadException if an error occurs accessing the
knowledge source during rule creation. | [
"Translates",
"a",
"slice",
"definition",
"into",
"rules",
"."
] | 5a620d1a407c7a5426d1cf17d47b97717cf71634 | https://github.com/eurekaclinical/protempa/blob/5a620d1a407c7a5426d1cf17d47b97717cf71634/protempa-framework/src/main/java/org/protempa/JBossRuleCreator.java#L299-L342 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.