repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
partition
stringclasses
1 value
gliga/ekstazi
org.ekstazi.core/src/main/java/org/ekstazi/maven/SurefireMojoInterceptor.java
SurefireMojoInterceptor.updateParallel
private static void updateParallel(Object mojo) throws Exception { try { String currentParallel = getStringField(PARALLEL_FIELD, mojo); if (currentParallel != null) { warn(mojo, "Ekstazi does not support parallel parameter. This parameter will be set to null for this run...
java
private static void updateParallel(Object mojo) throws Exception { try { String currentParallel = getStringField(PARALLEL_FIELD, mojo); if (currentParallel != null) { warn(mojo, "Ekstazi does not support parallel parameter. This parameter will be set to null for this run...
[ "private", "static", "void", "updateParallel", "(", "Object", "mojo", ")", "throws", "Exception", "{", "try", "{", "String", "currentParallel", "=", "getStringField", "(", "PARALLEL_FIELD", ",", "mojo", ")", ";", "if", "(", "currentParallel", "!=", "null", ")"...
Sets parallel parameter to null if the parameter is different from null and prints a warning. This method is written in Shanghai'14.
[ "Sets", "parallel", "parameter", "to", "null", "if", "the", "parameter", "is", "different", "from", "null", "and", "prints", "a", "warning", "." ]
5bf4d39a13305afe62f8b8d2d7b4c573d37d42a1
https://github.com/gliga/ekstazi/blob/5bf4d39a13305afe62f8b8d2d7b4c573d37d42a1/org.ekstazi.core/src/main/java/org/ekstazi/maven/SurefireMojoInterceptor.java#L182-L194
train
gliga/ekstazi
org.ekstazi.core/src/main/java/org/ekstazi/maven/SurefireMojoInterceptor.java
SurefireMojoInterceptor.isOneVMPerClass
private static boolean isOneVMPerClass(Object mojo) throws Exception { // We already know that we fork process (checked in // precondition). Threfore if we see reuseForks=false, we know // that one class will be run in one VM. try { return !invokeAndGetBoolean(IS_REUSE_FORKS,...
java
private static boolean isOneVMPerClass(Object mojo) throws Exception { // We already know that we fork process (checked in // precondition). Threfore if we see reuseForks=false, we know // that one class will be run in one VM. try { return !invokeAndGetBoolean(IS_REUSE_FORKS,...
[ "private", "static", "boolean", "isOneVMPerClass", "(", "Object", "mojo", ")", "throws", "Exception", "{", "// We already know that we fork process (checked in", "// precondition). Threfore if we see reuseForks=false, we know", "// that one class will be run in one VM.", "try", "{", ...
Returns true if one test class is executed in one VM. @param mojo Mojo @return True if one test class is executed in one VM, false otherwise @throws Exception If value of the fields cannot be retrieved
[ "Returns", "true", "if", "one", "test", "class", "is", "executed", "in", "one", "VM", "." ]
5bf4d39a13305afe62f8b8d2d7b4c573d37d42a1
https://github.com/gliga/ekstazi/blob/5bf4d39a13305afe62f8b8d2d7b4c573d37d42a1/org.ekstazi.core/src/main/java/org/ekstazi/maven/SurefireMojoInterceptor.java#L205-L216
train
gdx-libs/gdx-kiwi
src/com/github/czyzby/kiwi/util/gdx/asset/lazy/provider/ArrayObjectProvider.java
ArrayObjectProvider.getProvider
public static <Type> ArrayObjectProvider<Type> getProvider(final Class<Type> arrayType) { return new ArrayObjectProvider<Type>(arrayType); }
java
public static <Type> ArrayObjectProvider<Type> getProvider(final Class<Type> arrayType) { return new ArrayObjectProvider<Type>(arrayType); }
[ "public", "static", "<", "Type", ">", "ArrayObjectProvider", "<", "Type", ">", "getProvider", "(", "final", "Class", "<", "Type", ">", "arrayType", ")", "{", "return", "new", "ArrayObjectProvider", "<", "Type", ">", "(", "arrayType", ")", ";", "}" ]
Produces typed arrays.
[ "Produces", "typed", "arrays", "." ]
0172ee7534162f33b939bcdc4de089bc9579dd62
https://github.com/gdx-libs/gdx-kiwi/blob/0172ee7534162f33b939bcdc4de089bc9579dd62/src/com/github/czyzby/kiwi/util/gdx/asset/lazy/provider/ArrayObjectProvider.java#L37-L39
train
phax/ph-oton
ph-oton-uictrls/src/main/java/com/helger/photon/uictrls/fineupload5/FineUploader5Request.java
FineUploader5Request.addCustomHeaders
@Nonnull public FineUploader5Request addCustomHeaders (@Nullable final Map <String, String> aCustomHeaders) { m_aRequestCustomHeaders.addAll (aCustomHeaders); return this; }
java
@Nonnull public FineUploader5Request addCustomHeaders (@Nullable final Map <String, String> aCustomHeaders) { m_aRequestCustomHeaders.addAll (aCustomHeaders); return this; }
[ "@", "Nonnull", "public", "FineUploader5Request", "addCustomHeaders", "(", "@", "Nullable", "final", "Map", "<", "String", ",", "String", ">", "aCustomHeaders", ")", "{", "m_aRequestCustomHeaders", ".", "addAll", "(", "aCustomHeaders", ")", ";", "return", "this", ...
Additional headers sent along with each upload request. @param aCustomHeaders Custom headers to be added. @return this
[ "Additional", "headers", "sent", "along", "with", "each", "upload", "request", "." ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-uictrls/src/main/java/com/helger/photon/uictrls/fineupload5/FineUploader5Request.java#L92-L97
train
phax/ph-oton
ph-oton-uictrls/src/main/java/com/helger/photon/uictrls/fineupload5/FineUploader5Request.java
FineUploader5Request.setEndpoint
@Nonnull public FineUploader5Request setEndpoint (@Nonnull final ISimpleURL aRequestEndpoint) { ValueEnforcer.notNull (aRequestEndpoint, "RequestEndpoint"); m_aRequestEndpoint = aRequestEndpoint; return this; }
java
@Nonnull public FineUploader5Request setEndpoint (@Nonnull final ISimpleURL aRequestEndpoint) { ValueEnforcer.notNull (aRequestEndpoint, "RequestEndpoint"); m_aRequestEndpoint = aRequestEndpoint; return this; }
[ "@", "Nonnull", "public", "FineUploader5Request", "setEndpoint", "(", "@", "Nonnull", "final", "ISimpleURL", "aRequestEndpoint", ")", "{", "ValueEnforcer", ".", "notNull", "(", "aRequestEndpoint", ",", "\"RequestEndpoint\"", ")", ";", "m_aRequestEndpoint", "=", "aRequ...
The endpoint to send upload requests to. @param aRequestEndpoint The new action URL. May not be <code>null</code>. @return this
[ "The", "endpoint", "to", "send", "upload", "requests", "to", "." ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-uictrls/src/main/java/com/helger/photon/uictrls/fineupload5/FineUploader5Request.java#L131-L137
train
phax/ph-oton
ph-oton-uictrls/src/main/java/com/helger/photon/uictrls/fineupload5/FineUploader5Request.java
FineUploader5Request.setFilenameParam
@Nonnull public FineUploader5Request setFilenameParam (@Nonnull @Nonempty final String sFilenameParam) { ValueEnforcer.notEmpty (sFilenameParam, "FilenameParam"); m_sRequestFilenameParam = sFilenameParam; return this; }
java
@Nonnull public FineUploader5Request setFilenameParam (@Nonnull @Nonempty final String sFilenameParam) { ValueEnforcer.notEmpty (sFilenameParam, "FilenameParam"); m_sRequestFilenameParam = sFilenameParam; return this; }
[ "@", "Nonnull", "public", "FineUploader5Request", "setFilenameParam", "(", "@", "Nonnull", "@", "Nonempty", "final", "String", "sFilenameParam", ")", "{", "ValueEnforcer", ".", "notEmpty", "(", "sFilenameParam", ",", "\"FilenameParam\"", ")", ";", "m_sRequestFilenameP...
The name of the parameter passed if the original filename has been edited or a Blob is being sent. @param sFilenameParam New value. May neither be <code>null</code> nor empty. @return this
[ "The", "name", "of", "the", "parameter", "passed", "if", "the", "original", "filename", "has", "been", "edited", "or", "a", "Blob", "is", "being", "sent", "." ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-uictrls/src/main/java/com/helger/photon/uictrls/fineupload5/FineUploader5Request.java#L153-L159
train
phax/ph-oton
ph-oton-uictrls/src/main/java/com/helger/photon/uictrls/fineupload5/FineUploader5Request.java
FineUploader5Request.setUUIDName
@Nonnull public FineUploader5Request setUUIDName (@Nonnull @Nonempty final String sUUIDName) { ValueEnforcer.notEmpty (sUUIDName, "UUIDName"); m_sRequestUUIDName = sUUIDName; return this; }
java
@Nonnull public FineUploader5Request setUUIDName (@Nonnull @Nonempty final String sUUIDName) { ValueEnforcer.notEmpty (sUUIDName, "UUIDName"); m_sRequestUUIDName = sUUIDName; return this; }
[ "@", "Nonnull", "public", "FineUploader5Request", "setUUIDName", "(", "@", "Nonnull", "@", "Nonempty", "final", "String", "sUUIDName", ")", "{", "ValueEnforcer", ".", "notEmpty", "(", "sUUIDName", ",", "\"UUIDName\"", ")", ";", "m_sRequestUUIDName", "=", "sUUIDNam...
The name of the parameter the uniquely identifies each associated item. The value is a Level 4 UUID. @param sUUIDName New value. May neither be <code>null</code> nor empty. @return this
[ "The", "name", "of", "the", "parameter", "the", "uniquely", "identifies", "each", "associated", "item", ".", "The", "value", "is", "a", "Level", "4", "UUID", "." ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-uictrls/src/main/java/com/helger/photon/uictrls/fineupload5/FineUploader5Request.java#L316-L322
train
phax/ph-oton
ph-oton-uictrls/src/main/java/com/helger/photon/uictrls/fineupload5/FineUploader5Request.java
FineUploader5Request.setTotalFileSizeName
@Nonnull public FineUploader5Request setTotalFileSizeName (@Nonnull @Nonempty final String sTotalFileSizeName) { ValueEnforcer.notEmpty (sTotalFileSizeName, "TotalFileSizeName"); m_sRequestTotalFileSizeName = sTotalFileSizeName; return this; }
java
@Nonnull public FineUploader5Request setTotalFileSizeName (@Nonnull @Nonempty final String sTotalFileSizeName) { ValueEnforcer.notEmpty (sTotalFileSizeName, "TotalFileSizeName"); m_sRequestTotalFileSizeName = sTotalFileSizeName; return this; }
[ "@", "Nonnull", "public", "FineUploader5Request", "setTotalFileSizeName", "(", "@", "Nonnull", "@", "Nonempty", "final", "String", "sTotalFileSizeName", ")", "{", "ValueEnforcer", ".", "notEmpty", "(", "sTotalFileSizeName", ",", "\"TotalFileSizeName\"", ")", ";", "m_s...
The name of the parameter passed that specifies the total file size in bytes. @param sTotalFileSizeName New value. May neither be <code>null</code> nor empty. @return this
[ "The", "name", "of", "the", "parameter", "passed", "that", "specifies", "the", "total", "file", "size", "in", "bytes", "." ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-uictrls/src/main/java/com/helger/photon/uictrls/fineupload5/FineUploader5Request.java#L339-L345
train
phax/ph-oton
ph-oton-app/src/main/java/com/helger/photon/app/resource/WebSiteResourceWithCondition.java
WebSiteResourceWithCondition.canBeBundledWith
public boolean canBeBundledWith (@Nonnull final WebSiteResourceWithCondition aOther) { ValueEnforcer.notNull (aOther, "Other"); // Resource cannot be bundled at all if (!m_bIsBundlable || !aOther.isBundlable ()) return false; // Can only bundle resources of the same type if (!m_aResource.g...
java
public boolean canBeBundledWith (@Nonnull final WebSiteResourceWithCondition aOther) { ValueEnforcer.notNull (aOther, "Other"); // Resource cannot be bundled at all if (!m_bIsBundlable || !aOther.isBundlable ()) return false; // Can only bundle resources of the same type if (!m_aResource.g...
[ "public", "boolean", "canBeBundledWith", "(", "@", "Nonnull", "final", "WebSiteResourceWithCondition", "aOther", ")", "{", "ValueEnforcer", ".", "notNull", "(", "aOther", ",", "\"Other\"", ")", ";", "// Resource cannot be bundled at all", "if", "(", "!", "m_bIsBundlab...
Check if this resource can be bundled with the passed resource. @param aOther The resource to check against. May not be <code>null</code>. @return <code>true</code> if this resource can be bundled with the passed resource, <code>false</code> if not.
[ "Check", "if", "this", "resource", "can", "be", "bundled", "with", "the", "passed", "resource", "." ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-app/src/main/java/com/helger/photon/app/resource/WebSiteResourceWithCondition.java#L114-L136
train
phax/ph-oton
ph-oton-app/src/main/java/com/helger/photon/app/resource/WebSiteResourceWithCondition.java
WebSiteResourceWithCondition.createForJS
@Nonnull public static WebSiteResourceWithCondition createForJS (@Nonnull final IJSPathProvider aPP, final boolean bRegular) { return createForJS (aPP.getJSItemPath (bRegular), aPP.getConditionalComment (), aPP.isBundlable ()); }
java
@Nonnull public static WebSiteResourceWithCondition createForJS (@Nonnull final IJSPathProvider aPP, final boolean bRegular) { return createForJS (aPP.getJSItemPath (bRegular), aPP.getConditionalComment (), aPP.isBundlable ()); }
[ "@", "Nonnull", "public", "static", "WebSiteResourceWithCondition", "createForJS", "(", "@", "Nonnull", "final", "IJSPathProvider", "aPP", ",", "final", "boolean", "bRegular", ")", "{", "return", "createForJS", "(", "aPP", ".", "getJSItemPath", "(", "bRegular", ")...
Factory method for JavaScript resources. @param aPP The path provider. @param bRegular <code>true</code> for regular version, <code>false</code> for the minified/optimized version. @return New {@link WebSiteResourceWithCondition} object. Never <code>null</code>.
[ "Factory", "method", "for", "JavaScript", "resources", "." ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-app/src/main/java/com/helger/photon/app/resource/WebSiteResourceWithCondition.java#L243-L247
train
phax/ph-oton
ph-oton-app/src/main/java/com/helger/photon/app/resource/WebSiteResourceWithCondition.java
WebSiteResourceWithCondition.createForCSS
@Nonnull public static WebSiteResourceWithCondition createForCSS (@Nonnull final ICSSPathProvider aPP, final boolean bRegular) { return createForCSS (aPP.getCSSItemPath (bRegular), aPP.getConditionalComment (), aPP.isBundlable (), aPP.ge...
java
@Nonnull public static WebSiteResourceWithCondition createForCSS (@Nonnull final ICSSPathProvider aPP, final boolean bRegular) { return createForCSS (aPP.getCSSItemPath (bRegular), aPP.getConditionalComment (), aPP.isBundlable (), aPP.ge...
[ "@", "Nonnull", "public", "static", "WebSiteResourceWithCondition", "createForCSS", "(", "@", "Nonnull", "final", "ICSSPathProvider", "aPP", ",", "final", "boolean", "bRegular", ")", "{", "return", "createForCSS", "(", "aPP", ".", "getCSSItemPath", "(", "bRegular", ...
Factory method for CSS resources. @param aPP The path provider. @param bRegular <code>true</code> for regular version, <code>false</code> for the minified/optimized version. @return New {@link WebSiteResourceWithCondition} object. Never <code>null</code>.
[ "Factory", "method", "for", "CSS", "resources", "." ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-app/src/main/java/com/helger/photon/app/resource/WebSiteResourceWithCondition.java#L273-L280
train
phax/ph-oton
ph-oton-bootstrap4-pages/src/main/java/com/helger/photon/bootstrap4/pages/security/SecurityUIHelper.java
SecurityUIHelper.canBeDeleted
public static boolean canBeDeleted (@Nullable final IUser aUser) { return aUser != null && !aUser.isDeleted () && !aUser.isAdministrator (); }
java
public static boolean canBeDeleted (@Nullable final IUser aUser) { return aUser != null && !aUser.isDeleted () && !aUser.isAdministrator (); }
[ "public", "static", "boolean", "canBeDeleted", "(", "@", "Nullable", "final", "IUser", "aUser", ")", "{", "return", "aUser", "!=", "null", "&&", "!", "aUser", ".", "isDeleted", "(", ")", "&&", "!", "aUser", ".", "isAdministrator", "(", ")", ";", "}" ]
Check if a user can be deleted or not. Currently all not deleted users can be deleted except for the administrator special user. @param aUser The user to check. May be <code>null</code>. @return <code>true</code> if the user can be deleted, <code>false</code> if not.
[ "Check", "if", "a", "user", "can", "be", "deleted", "or", "not", ".", "Currently", "all", "not", "deleted", "users", "can", "be", "deleted", "except", "for", "the", "administrator", "special", "user", "." ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-bootstrap4-pages/src/main/java/com/helger/photon/bootstrap4/pages/security/SecurityUIHelper.java#L59-L62
train
phax/ph-oton
ph-oton-datatables/src/main/java/com/helger/photon/uictrls/datatables/ajax/DataTablesServerData.java
DataTablesServerData.createConversionSettings
@Nonnull public static IHCConversionSettings createConversionSettings () { // Create HTML without namespaces final HCConversionSettings aRealCS = HCSettings.getMutableConversionSettings ().getClone (); aRealCS.getMutableXMLWriterSettings ().setEmitNamespaces (false); // Remove any "HCCustomizerAuto...
java
@Nonnull public static IHCConversionSettings createConversionSettings () { // Create HTML without namespaces final HCConversionSettings aRealCS = HCSettings.getMutableConversionSettings ().getClone (); aRealCS.getMutableXMLWriterSettings ().setEmitNamespaces (false); // Remove any "HCCustomizerAuto...
[ "@", "Nonnull", "public", "static", "IHCConversionSettings", "createConversionSettings", "(", ")", "{", "// Create HTML without namespaces", "final", "HCConversionSettings", "aRealCS", "=", "HCSettings", ".", "getMutableConversionSettings", "(", ")", ".", "getClone", "(", ...
Create the HC conversion settings to be used for HTML serialization. @return Never <code>null</code>.
[ "Create", "the", "HC", "conversion", "settings", "to", "be", "used", "for", "HTML", "serialization", "." ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-datatables/src/main/java/com/helger/photon/uictrls/datatables/ajax/DataTablesServerData.java#L137-L154
train
phax/ph-oton
ph-oton-app/src/main/java/com/helger/photon/app/html/PhotonCSS.java
PhotonCSS.unregisterCSSIncludeFromThisRequest
public static void unregisterCSSIncludeFromThisRequest (@Nonnull final ICSSPathProvider aCSSPathProvider) { final CSSResourceSet aSet = _getPerRequestSet (false); if (aSet != null) aSet.removeItem (aCSSPathProvider); }
java
public static void unregisterCSSIncludeFromThisRequest (@Nonnull final ICSSPathProvider aCSSPathProvider) { final CSSResourceSet aSet = _getPerRequestSet (false); if (aSet != null) aSet.removeItem (aCSSPathProvider); }
[ "public", "static", "void", "unregisterCSSIncludeFromThisRequest", "(", "@", "Nonnull", "final", "ICSSPathProvider", "aCSSPathProvider", ")", "{", "final", "CSSResourceSet", "aSet", "=", "_getPerRequestSet", "(", "false", ")", ";", "if", "(", "aSet", "!=", "null", ...
Unregister an existing CSS item only from this request @param aCSSPathProvider The CSS path provider to use. May not be <code>null</code>.
[ "Unregister", "an", "existing", "CSS", "item", "only", "from", "this", "request" ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-app/src/main/java/com/helger/photon/app/html/PhotonCSS.java#L231-L236
train
phax/ph-oton
ph-oton-html/src/main/java/com/helger/html/hc/html/grouping/HCOutput.java
HCOutput.setFor
@Nonnull public final HCOutput setFor (@Nullable final IHCHasID <?> aFor) { if (aFor == null) m_sFor = null; else m_sFor = aFor.ensureID ().getID (); return this; }
java
@Nonnull public final HCOutput setFor (@Nullable final IHCHasID <?> aFor) { if (aFor == null) m_sFor = null; else m_sFor = aFor.ensureID ().getID (); return this; }
[ "@", "Nonnull", "public", "final", "HCOutput", "setFor", "(", "@", "Nullable", "final", "IHCHasID", "<", "?", ">", "aFor", ")", "{", "if", "(", "aFor", "==", "null", ")", "m_sFor", "=", "null", ";", "else", "m_sFor", "=", "aFor", ".", "ensureID", "("...
Specifies the relationship between the result of the calculation, and the elements used in the calculation @param aFor The HTML of the other object. @return this
[ "Specifies", "the", "relationship", "between", "the", "result", "of", "the", "calculation", "and", "the", "elements", "used", "in", "the", "calculation" ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-html/src/main/java/com/helger/html/hc/html/grouping/HCOutput.java#L78-L86
train
gliga/ekstazi
org.ekstazi.core/src/main/java/org/ekstazi/instrument/CoverageMethodVisitor.java
CoverageMethodVisitor.visitLdcInsn
@Override public void visitLdcInsn(Object cst) { // We use this method to support accesses to .class. if (cst instanceof Type) { int sort = ((Type) cst).getSort(); if (sort == Type.OBJECT) { String className = Types.descToInternalName(((Type) cst).getDescripto...
java
@Override public void visitLdcInsn(Object cst) { // We use this method to support accesses to .class. if (cst instanceof Type) { int sort = ((Type) cst).getSort(); if (sort == Type.OBJECT) { String className = Types.descToInternalName(((Type) cst).getDescripto...
[ "@", "Override", "public", "void", "visitLdcInsn", "(", "Object", "cst", ")", "{", "// We use this method to support accesses to .class.", "if", "(", "cst", "instanceof", "Type", ")", "{", "int", "sort", "=", "(", "(", "Type", ")", "cst", ")", ".", "getSort", ...
METHOD VISITOR INTERFACE
[ "METHOD", "VISITOR", "INTERFACE" ]
5bf4d39a13305afe62f8b8d2d7b4c573d37d42a1
https://github.com/gliga/ekstazi/blob/5bf4d39a13305afe62f8b8d2d7b4c573d37d42a1/org.ekstazi.core/src/main/java/org/ekstazi/instrument/CoverageMethodVisitor.java#L81-L92
train
gliga/ekstazi
org.ekstazi.core/src/main/java/org/ekstazi/instrument/CoverageMethodVisitor.java
CoverageMethodVisitor.insertTInvocation0
private void insertTInvocation0(String className, int probeId) { // Check if class name has been seen since the last label. if (!mSeenClasses.add(className)) return; // Check if this class name should be ignored. if (Types.isIgnorableInternalName(className)) return; // x. (we tr...
java
private void insertTInvocation0(String className, int probeId) { // Check if class name has been seen since the last label. if (!mSeenClasses.add(className)) return; // Check if this class name should be ignored. if (Types.isIgnorableInternalName(className)) return; // x. (we tr...
[ "private", "void", "insertTInvocation0", "(", "String", "className", ",", "int", "probeId", ")", "{", "// Check if class name has been seen since the last label.", "if", "(", "!", "mSeenClasses", ".", "add", "(", "className", ")", ")", "return", ";", "// Check if this...
Checks if the class name belongs to a set of classes that should be ignored; if not, an invocation to coverage monitor is inserted. @param className Name of the class to be passed to coverage monitor.
[ "Checks", "if", "the", "class", "name", "belongs", "to", "a", "set", "of", "classes", "that", "should", "be", "ignored", ";", "if", "not", "an", "invocation", "to", "coverage", "monitor", "is", "inserted", "." ]
5bf4d39a13305afe62f8b8d2d7b4c573d37d42a1
https://github.com/gliga/ekstazi/blob/5bf4d39a13305afe62f8b8d2d7b4c573d37d42a1/org.ekstazi.core/src/main/java/org/ekstazi/instrument/CoverageMethodVisitor.java#L210-L250
train
gliga/ekstazi
ekstazi-maven-plugin/src/main/java/org/ekstazi/maven/AbstractEkstaziMojo.java
AbstractEkstaziMojo.lookupPlugin
protected Plugin lookupPlugin(String key) { List<Plugin> plugins = project.getBuildPlugins(); for (Iterator<Plugin> iterator = plugins.iterator(); iterator.hasNext();) { Plugin plugin = iterator.next(); if(key.equalsIgnoreCase(plugin.getKey())) { return plugin; ...
java
protected Plugin lookupPlugin(String key) { List<Plugin> plugins = project.getBuildPlugins(); for (Iterator<Plugin> iterator = plugins.iterator(); iterator.hasNext();) { Plugin plugin = iterator.next(); if(key.equalsIgnoreCase(plugin.getKey())) { return plugin; ...
[ "protected", "Plugin", "lookupPlugin", "(", "String", "key", ")", "{", "List", "<", "Plugin", ">", "plugins", "=", "project", ".", "getBuildPlugins", "(", ")", ";", "for", "(", "Iterator", "<", "Plugin", ">", "iterator", "=", "plugins", ".", "iterator", ...
Find plugin based on the plugin key. Returns null if plugin cannot be located.
[ "Find", "plugin", "based", "on", "the", "plugin", "key", ".", "Returns", "null", "if", "plugin", "cannot", "be", "located", "." ]
5bf4d39a13305afe62f8b8d2d7b4c573d37d42a1
https://github.com/gliga/ekstazi/blob/5bf4d39a13305afe62f8b8d2d7b4c573d37d42a1/ekstazi-maven-plugin/src/main/java/org/ekstazi/maven/AbstractEkstaziMojo.java#L128-L138
train
gliga/ekstazi
ekstazi-maven-plugin/src/main/java/org/ekstazi/maven/AbstractEkstaziMojo.java
AbstractEkstaziMojo.isRestoreGoalPresent
protected boolean isRestoreGoalPresent() { Plugin ekstaziPlugin = lookupPlugin(EKSTAZI_PLUGIN_KEY); if (ekstaziPlugin == null) { return false; } for (Object execution : ekstaziPlugin.getExecutions()) { for (Object goal : ((PluginExecution) execution).getGoals()) {...
java
protected boolean isRestoreGoalPresent() { Plugin ekstaziPlugin = lookupPlugin(EKSTAZI_PLUGIN_KEY); if (ekstaziPlugin == null) { return false; } for (Object execution : ekstaziPlugin.getExecutions()) { for (Object goal : ((PluginExecution) execution).getGoals()) {...
[ "protected", "boolean", "isRestoreGoalPresent", "(", ")", "{", "Plugin", "ekstaziPlugin", "=", "lookupPlugin", "(", "EKSTAZI_PLUGIN_KEY", ")", ";", "if", "(", "ekstaziPlugin", "==", "null", ")", "{", "return", "false", ";", "}", "for", "(", "Object", "executio...
Returns true if restore goal is present, false otherwise.
[ "Returns", "true", "if", "restore", "goal", "is", "present", "false", "otherwise", "." ]
5bf4d39a13305afe62f8b8d2d7b4c573d37d42a1
https://github.com/gliga/ekstazi/blob/5bf4d39a13305afe62f8b8d2d7b4c573d37d42a1/ekstazi-maven-plugin/src/main/java/org/ekstazi/maven/AbstractEkstaziMojo.java#L143-L156
train
gliga/ekstazi
ekstazi-maven-plugin/src/main/java/org/ekstazi/maven/AbstractEkstaziMojo.java
AbstractEkstaziMojo.restoreExcludesFile
private void restoreExcludesFile(File excludesFileFile) throws MojoExecutionException { if (!excludesFileFile.exists()) { return; } try { String[] lines = FileUtil.readLines(excludesFileFile); List<String> newLines = new ArrayList<String>(); for (...
java
private void restoreExcludesFile(File excludesFileFile) throws MojoExecutionException { if (!excludesFileFile.exists()) { return; } try { String[] lines = FileUtil.readLines(excludesFileFile); List<String> newLines = new ArrayList<String>(); for (...
[ "private", "void", "restoreExcludesFile", "(", "File", "excludesFileFile", ")", "throws", "MojoExecutionException", "{", "if", "(", "!", "excludesFileFile", ".", "exists", "(", ")", ")", "{", "return", ";", "}", "try", "{", "String", "[", "]", "lines", "=", ...
Removes lines from excludesFile that are added by Ekstazi.
[ "Removes", "lines", "from", "excludesFile", "that", "are", "added", "by", "Ekstazi", "." ]
5bf4d39a13305afe62f8b8d2d7b4c573d37d42a1
https://github.com/gliga/ekstazi/blob/5bf4d39a13305afe62f8b8d2d7b4c573d37d42a1/ekstazi-maven-plugin/src/main/java/org/ekstazi/maven/AbstractEkstaziMojo.java#L200-L216
train
spotify/crtauth-java
src/main/java/com/spotify/crtauth/utils/TraditionalKeyParser.java
TraditionalKeyParser.parsePrivateKeyASN1
private static List<byte[]> parsePrivateKeyASN1(ByteBuffer byteBuffer) { final List<byte[]> collection = new ArrayList<byte[]>(); while (byteBuffer.hasRemaining()) { byte type = byteBuffer.get(); int length = UnsignedBytes.toInt(byteBuffer.get()); if ((length & 0x80) != 0) { int number...
java
private static List<byte[]> parsePrivateKeyASN1(ByteBuffer byteBuffer) { final List<byte[]> collection = new ArrayList<byte[]>(); while (byteBuffer.hasRemaining()) { byte type = byteBuffer.get(); int length = UnsignedBytes.toInt(byteBuffer.get()); if ((length & 0x80) != 0) { int number...
[ "private", "static", "List", "<", "byte", "[", "]", ">", "parsePrivateKeyASN1", "(", "ByteBuffer", "byteBuffer", ")", "{", "final", "List", "<", "byte", "[", "]", ">", "collection", "=", "new", "ArrayList", "<", "byte", "[", "]", ">", "(", ")", ";", ...
This is a simplistic ASN.1 parser that can only parse a collection of primitive types. @param byteBuffer the raw byte representation of a Pcks1 private key. @return A list of bytes array that represent the content of the original ASN.1 collection.
[ "This", "is", "a", "simplistic", "ASN", ".", "1", "parser", "that", "can", "only", "parse", "a", "collection", "of", "primitive", "types", "." ]
90f3b40323848740c915b195ad1b547fbeb41700
https://github.com/spotify/crtauth-java/blob/90f3b40323848740c915b195ad1b547fbeb41700/src/main/java/com/spotify/crtauth/utils/TraditionalKeyParser.java#L99-L127
train
phax/ph-oton
ph-oton-api/src/main/java/com/helger/photon/api/pathdescriptor/PathDescriptorHelper.java
PathDescriptorHelper.getCleanPathParts
@Nonnull @ReturnsMutableCopy public static ICommonsList <String> getCleanPathParts (@Nonnull final String sPath) { // Remove leading and trailing whitespaces and slashes String sRealPath = StringHelper.trimStartAndEnd (sPath.trim (), "/", "/"); // Remove obscure path parts sRealPath = FilenameHel...
java
@Nonnull @ReturnsMutableCopy public static ICommonsList <String> getCleanPathParts (@Nonnull final String sPath) { // Remove leading and trailing whitespaces and slashes String sRealPath = StringHelper.trimStartAndEnd (sPath.trim (), "/", "/"); // Remove obscure path parts sRealPath = FilenameHel...
[ "@", "Nonnull", "@", "ReturnsMutableCopy", "public", "static", "ICommonsList", "<", "String", ">", "getCleanPathParts", "(", "@", "Nonnull", "final", "String", "sPath", ")", "{", "// Remove leading and trailing whitespaces and slashes", "String", "sRealPath", "=", "Stri...
Clean the provided path and split it into parts, separated by slashes. @param sPath Source path. May not be <code>null</code>. @return The list with all path parts. Never <code>null</code>.
[ "Clean", "the", "provided", "path", "and", "split", "it", "into", "parts", "separated", "by", "slashes", "." ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-api/src/main/java/com/helger/photon/api/pathdescriptor/PathDescriptorHelper.java#L45-L58
train
phax/ph-oton
ph-oton-uictrls/src/main/java/com/helger/photon/uictrls/fineupload5/FineUploader5Paste.java
FineUploader5Paste.setDefaultName
@Nonnull public FineUploader5Paste setDefaultName (@Nonnull @Nonempty final String sDefaultName) { ValueEnforcer.notEmpty (sDefaultName, "DefaultName"); m_sPasteDefaultName = sDefaultName; return this; }
java
@Nonnull public FineUploader5Paste setDefaultName (@Nonnull @Nonempty final String sDefaultName) { ValueEnforcer.notEmpty (sDefaultName, "DefaultName"); m_sPasteDefaultName = sDefaultName; return this; }
[ "@", "Nonnull", "public", "FineUploader5Paste", "setDefaultName", "(", "@", "Nonnull", "@", "Nonempty", "final", "String", "sDefaultName", ")", "{", "ValueEnforcer", ".", "notEmpty", "(", "sDefaultName", ",", "\"DefaultName\"", ")", ";", "m_sPasteDefaultName", "=", ...
The default name given to pasted images. @param sDefaultName New value. May neither be <code>null</code> nor empty. @return this for chaining
[ "The", "default", "name", "given", "to", "pasted", "images", "." ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-uictrls/src/main/java/com/helger/photon/uictrls/fineupload5/FineUploader5Paste.java#L57-L63
train
bayofmany/peapod
core/src/main/java/peapod/internal/Inflector.java
Inflector.ordinalize
public String ordinalize(int number) { String numberStr = Integer.toString(number); if (11 <= number && number <= 13) return numberStr + "th"; int remainder = number % 10; if (remainder == 1) return numberStr + "st"; if (remainder == 2) return numberStr + "nd"; if (remain...
java
public String ordinalize(int number) { String numberStr = Integer.toString(number); if (11 <= number && number <= 13) return numberStr + "th"; int remainder = number % 10; if (remainder == 1) return numberStr + "st"; if (remainder == 2) return numberStr + "nd"; if (remain...
[ "public", "String", "ordinalize", "(", "int", "number", ")", "{", "String", "numberStr", "=", "Integer", ".", "toString", "(", "number", ")", ";", "if", "(", "11", "<=", "number", "&&", "number", "<=", "13", ")", "return", "numberStr", "+", "\"th\"", "...
Turns a non-negative number into an ordinal string used to denote the position in an ordered sequence, such as 1st, 2nd, 3rd, 4th. @param number the non-negative number @return the string with the number and ordinal suffix
[ "Turns", "a", "non", "-", "negative", "number", "into", "an", "ordinal", "string", "used", "to", "denote", "the", "position", "in", "an", "ordered", "sequence", "such", "as", "1st", "2nd", "3rd", "4th", "." ]
46ca0a8a19b5e57158abfb1ca9fa1c6811c6da11
https://github.com/bayofmany/peapod/blob/46ca0a8a19b5e57158abfb1ca9fa1c6811c6da11/core/src/main/java/peapod/internal/Inflector.java#L403-L411
train
phax/ph-oton
ph-oton-core/src/main/java/com/helger/photon/core/login/AbstractLoginManager.java
AbstractLoginManager.isLoginInProgress
@OverrideOnDemand protected boolean isLoginInProgress (@Nonnull final IRequestWebScopeWithoutResponse aRequestScope) { return CLogin.REQUEST_ACTION_VALIDATE_LOGIN_CREDENTIALS.equals (aRequestScope.params () .getAsString (CLogin.REQ...
java
@OverrideOnDemand protected boolean isLoginInProgress (@Nonnull final IRequestWebScopeWithoutResponse aRequestScope) { return CLogin.REQUEST_ACTION_VALIDATE_LOGIN_CREDENTIALS.equals (aRequestScope.params () .getAsString (CLogin.REQ...
[ "@", "OverrideOnDemand", "protected", "boolean", "isLoginInProgress", "(", "@", "Nonnull", "final", "IRequestWebScopeWithoutResponse", "aRequestScope", ")", "{", "return", "CLogin", ".", "REQUEST_ACTION_VALIDATE_LOGIN_CREDENTIALS", ".", "equals", "(", "aRequestScope", ".", ...
Check if the login process is in progress @param aRequestScope Request scope @return <code>true</code> if it is in progress @since 3.4.0
[ "Check", "if", "the", "login", "process", "is", "in", "progress" ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-core/src/main/java/com/helger/photon/core/login/AbstractLoginManager.java#L127-L132
train
phax/ph-oton
ph-oton-core/src/main/java/com/helger/photon/core/login/AbstractLoginManager.java
AbstractLoginManager.getLoginName
@Nullable @OverrideOnDemand protected String getLoginName (@Nonnull final IRequestWebScopeWithoutResponse aRequestScope) { return aRequestScope.params ().getAsString (CLogin.REQUEST_ATTR_USERID); }
java
@Nullable @OverrideOnDemand protected String getLoginName (@Nonnull final IRequestWebScopeWithoutResponse aRequestScope) { return aRequestScope.params ().getAsString (CLogin.REQUEST_ATTR_USERID); }
[ "@", "Nullable", "@", "OverrideOnDemand", "protected", "String", "getLoginName", "(", "@", "Nonnull", "final", "IRequestWebScopeWithoutResponse", "aRequestScope", ")", "{", "return", "aRequestScope", ".", "params", "(", ")", ".", "getAsString", "(", "CLogin", ".", ...
Get the current login name @param aRequestScope Request scope @return <code>null</code> if no login name was present @since 3.4.0
[ "Get", "the", "current", "login", "name" ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-core/src/main/java/com/helger/photon/core/login/AbstractLoginManager.java#L142-L147
train
phax/ph-oton
ph-oton-core/src/main/java/com/helger/photon/core/login/AbstractLoginManager.java
AbstractLoginManager.getPassword
@Nullable @OverrideOnDemand protected String getPassword (@Nonnull final IRequestWebScopeWithoutResponse aRequestScope) { return aRequestScope.params ().getAsString (CLogin.REQUEST_ATTR_PASSWORD); }
java
@Nullable @OverrideOnDemand protected String getPassword (@Nonnull final IRequestWebScopeWithoutResponse aRequestScope) { return aRequestScope.params ().getAsString (CLogin.REQUEST_ATTR_PASSWORD); }
[ "@", "Nullable", "@", "OverrideOnDemand", "protected", "String", "getPassword", "(", "@", "Nonnull", "final", "IRequestWebScopeWithoutResponse", "aRequestScope", ")", "{", "return", "aRequestScope", ".", "params", "(", ")", ".", "getAsString", "(", "CLogin", ".", ...
Get the current password @param aRequestScope Request scope @return <code>null</code> if no password was present @since 3.4.0
[ "Get", "the", "current", "password" ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-core/src/main/java/com/helger/photon/core/login/AbstractLoginManager.java#L157-L162
train
phax/ph-oton
ph-oton-core/src/main/java/com/helger/photon/core/login/AbstractLoginManager.java
AbstractLoginManager.checkUserAndShowLogin
@Nonnull public final EContinue checkUserAndShowLogin (@Nonnull final IRequestWebScopeWithoutResponse aRequestScope, @Nonnull final UnifiedResponse aUnifiedResponse) { final LoggedInUserManager aLoggedInUserManager = LoggedInUserManager.getInstance (); String ...
java
@Nonnull public final EContinue checkUserAndShowLogin (@Nonnull final IRequestWebScopeWithoutResponse aRequestScope, @Nonnull final UnifiedResponse aUnifiedResponse) { final LoggedInUserManager aLoggedInUserManager = LoggedInUserManager.getInstance (); String ...
[ "@", "Nonnull", "public", "final", "EContinue", "checkUserAndShowLogin", "(", "@", "Nonnull", "final", "IRequestWebScopeWithoutResponse", "aRequestScope", ",", "@", "Nonnull", "final", "UnifiedResponse", "aUnifiedResponse", ")", "{", "final", "LoggedInUserManager", "aLogg...
Main login routine. @param aRequestScope Request scope @param aUnifiedResponse Response @return {@link EContinue#BREAK} to indicate that no user is logged in and therefore the login screen should be shown, {@link EContinue#CONTINUE} if a user is correctly logged in.
[ "Main", "login", "routine", "." ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-core/src/main/java/com/helger/photon/core/login/AbstractLoginManager.java#L217-L298
train
phax/ph-oton
ph-oton-uicore/src/main/java/com/helger/photon/uicore/js/JSFormHelper.java
JSFormHelper.setSelectOptions
@Nonnull public static JSInvocation setSelectOptions (@Nonnull final IJSExpression aSelector, @Nonnull final IJSExpression aValueList) { return getFormHelper ().invoke ("setSelectOptions").arg (aSelector).arg (aValueList); }
java
@Nonnull public static JSInvocation setSelectOptions (@Nonnull final IJSExpression aSelector, @Nonnull final IJSExpression aValueList) { return getFormHelper ().invoke ("setSelectOptions").arg (aSelector).arg (aValueList); }
[ "@", "Nonnull", "public", "static", "JSInvocation", "setSelectOptions", "(", "@", "Nonnull", "final", "IJSExpression", "aSelector", ",", "@", "Nonnull", "final", "IJSExpression", "aValueList", ")", "{", "return", "getFormHelper", "(", ")", ".", "invoke", "(", "\...
Set all options of a &lt;select&gt; @param aSelector jQuery object @param aValueList list of array[value,text] - nested array! @return the invocation
[ "Set", "all", "options", "of", "a", "&lt", ";", "select&gt", ";" ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-uicore/src/main/java/com/helger/photon/uicore/js/JSFormHelper.java#L119-L124
train
gliga/ekstazi
org.ekstazi.core/src/main/java/org/ekstazi/data/TxtStorer.java
TxtStorer.isMagicCorrect
protected boolean isMagicCorrect(BufferedReader br) throws IOException { if (mCheckMagicSequence) { String magicLine = br.readLine(); return (magicLine != null && magicLine.equals(mMode.getMagicSequence())); } else { return true; } }
java
protected boolean isMagicCorrect(BufferedReader br) throws IOException { if (mCheckMagicSequence) { String magicLine = br.readLine(); return (magicLine != null && magicLine.equals(mMode.getMagicSequence())); } else { return true; } }
[ "protected", "boolean", "isMagicCorrect", "(", "BufferedReader", "br", ")", "throws", "IOException", "{", "if", "(", "mCheckMagicSequence", ")", "{", "String", "magicLine", "=", "br", ".", "readLine", "(", ")", ";", "return", "(", "magicLine", "!=", "null", ...
Check magic sequence. Note that subclasses are responsible to decide if something should be read from buffer. This approach was taken to support old format without magic sequence.
[ "Check", "magic", "sequence", ".", "Note", "that", "subclasses", "are", "responsible", "to", "decide", "if", "something", "should", "be", "read", "from", "buffer", ".", "This", "approach", "was", "taken", "to", "support", "old", "format", "without", "magic", ...
5bf4d39a13305afe62f8b8d2d7b4c573d37d42a1
https://github.com/gliga/ekstazi/blob/5bf4d39a13305afe62f8b8d2d7b4c573d37d42a1/org.ekstazi.core/src/main/java/org/ekstazi/data/TxtStorer.java#L127-L134
train
gliga/ekstazi
org.ekstazi.core/src/main/java/org/ekstazi/data/TxtStorer.java
TxtStorer.parseLine
protected RegData parseLine(State state, String line) { // Note. Initial this method was using String.split, but that method // seems to be much more expensive than playing with indexOf and // substring. int sepIndex = line.indexOf(SEPARATOR); String urlExternalForm = line.substr...
java
protected RegData parseLine(State state, String line) { // Note. Initial this method was using String.split, but that method // seems to be much more expensive than playing with indexOf and // substring. int sepIndex = line.indexOf(SEPARATOR); String urlExternalForm = line.substr...
[ "protected", "RegData", "parseLine", "(", "State", "state", ",", "String", "line", ")", "{", "// Note. Initial this method was using String.split, but that method", "// seems to be much more expensive than playing with indexOf and", "// substring.", "int", "sepIndex", "=", "line", ...
Parses a single line from the file. This method is never invoked for magic sequence. The line includes path to file and hash. Subclasses may include more fields. This method returns null if the line is of no interest. This can be used by subclasses to implement different protocols.
[ "Parses", "a", "single", "line", "from", "the", "file", ".", "This", "method", "is", "never", "invoked", "for", "magic", "sequence", ".", "The", "line", "includes", "path", "to", "file", "and", "hash", ".", "Subclasses", "may", "include", "more", "fields",...
5bf4d39a13305afe62f8b8d2d7b4c573d37d42a1
https://github.com/gliga/ekstazi/blob/5bf4d39a13305afe62f8b8d2d7b4c573d37d42a1/org.ekstazi.core/src/main/java/org/ekstazi/data/TxtStorer.java#L144-L152
train
gliga/ekstazi
org.ekstazi.core/src/main/java/org/ekstazi/data/TxtStorer.java
TxtStorer.printLine
protected void printLine(State state, Writer pw, String externalForm, String hash) throws IOException { pw.write(externalForm); pw.write(SEPARATOR); pw.write(hash); pw.write('\n'); }
java
protected void printLine(State state, Writer pw, String externalForm, String hash) throws IOException { pw.write(externalForm); pw.write(SEPARATOR); pw.write(hash); pw.write('\n'); }
[ "protected", "void", "printLine", "(", "State", "state", ",", "Writer", "pw", ",", "String", "externalForm", ",", "String", "hash", ")", "throws", "IOException", "{", "pw", ".", "write", "(", "externalForm", ")", ";", "pw", ".", "write", "(", "SEPARATOR", ...
Prints one line to the given writer; the line includes path to file and hash. Subclasses may include more fields.
[ "Prints", "one", "line", "to", "the", "given", "writer", ";", "the", "line", "includes", "path", "to", "file", "and", "hash", ".", "Subclasses", "may", "include", "more", "fields", "." ]
5bf4d39a13305afe62f8b8d2d7b4c573d37d42a1
https://github.com/gliga/ekstazi/blob/5bf4d39a13305afe62f8b8d2d7b4c573d37d42a1/org.ekstazi.core/src/main/java/org/ekstazi/data/TxtStorer.java#L185-L190
train
gdx-libs/gdx-kiwi
src/com/github/czyzby/kiwi/util/gdx/scene2d/range/FloatRange.java
FloatRange.update
public void update(final float delta) { if (transitionInProgress) { currentValue += (targetValue - initialValue) * delta / transitionLength; if (isInitialGreater) { if (currentValue <= targetValue) { finalizeTransition(); } ...
java
public void update(final float delta) { if (transitionInProgress) { currentValue += (targetValue - initialValue) * delta / transitionLength; if (isInitialGreater) { if (currentValue <= targetValue) { finalizeTransition(); } ...
[ "public", "void", "update", "(", "final", "float", "delta", ")", "{", "if", "(", "transitionInProgress", ")", "{", "currentValue", "+=", "(", "targetValue", "-", "initialValue", ")", "*", "delta", "/", "transitionLength", ";", "if", "(", "isInitialGreater", ...
Updates current value as long as it doesn't match the target value. @param delta time passed since the last update.
[ "Updates", "current", "value", "as", "long", "as", "it", "doesn", "t", "match", "the", "target", "value", "." ]
0172ee7534162f33b939bcdc4de089bc9579dd62
https://github.com/gdx-libs/gdx-kiwi/blob/0172ee7534162f33b939bcdc4de089bc9579dd62/src/com/github/czyzby/kiwi/util/gdx/scene2d/range/FloatRange.java#L59-L72
train
gdx-libs/gdx-kiwi
src/com/github/czyzby/kiwi/util/gdx/scene2d/range/FloatRange.java
FloatRange.setCurrentValue
public void setCurrentValue(final float currentValue) { this.currentValue = currentValue; initialValue = currentValue; targetValue = currentValue; transitionInProgress = false; }
java
public void setCurrentValue(final float currentValue) { this.currentValue = currentValue; initialValue = currentValue; targetValue = currentValue; transitionInProgress = false; }
[ "public", "void", "setCurrentValue", "(", "final", "float", "currentValue", ")", "{", "this", ".", "currentValue", "=", "currentValue", ";", "initialValue", "=", "currentValue", ";", "targetValue", "=", "currentValue", ";", "transitionInProgress", "=", "false", ";...
Ends transition. Immediately changes managed current value.
[ "Ends", "transition", ".", "Immediately", "changes", "managed", "current", "value", "." ]
0172ee7534162f33b939bcdc4de089bc9579dd62
https://github.com/gdx-libs/gdx-kiwi/blob/0172ee7534162f33b939bcdc4de089bc9579dd62/src/com/github/czyzby/kiwi/util/gdx/scene2d/range/FloatRange.java#L90-L95
train
phax/ph-oton
ph-oton-uicore/src/main/java/com/helger/photon/uicore/UITextFormatter.java
UITextFormatter.markdown
@Nonnull public static IHCNode markdown (@Nullable final String sMD) { try { final HCNodeList aNL = MARKDOWN_PROC.process (sMD).getNodeList (); // Replace a single <p> element with its contents if (aNL.getChildCount () == 1 && aNL.getChildAtIndex (0) instanceof HCP) return ((HCP) ...
java
@Nonnull public static IHCNode markdown (@Nullable final String sMD) { try { final HCNodeList aNL = MARKDOWN_PROC.process (sMD).getNodeList (); // Replace a single <p> element with its contents if (aNL.getChildCount () == 1 && aNL.getChildAtIndex (0) instanceof HCP) return ((HCP) ...
[ "@", "Nonnull", "public", "static", "IHCNode", "markdown", "(", "@", "Nullable", "final", "String", "sMD", ")", "{", "try", "{", "final", "HCNodeList", "aNL", "=", "MARKDOWN_PROC", ".", "process", "(", "sMD", ")", ".", "getNodeList", "(", ")", ";", "// R...
Process the provided String as Markdown and return the created IHCNode. @param sMD The Markdown source to be invoked. May be <code>null</code>. @return Either the processed markdown code or in case of an internal error a {@link HCTextNode} which contains the source text.
[ "Process", "the", "provided", "String", "as", "Markdown", "and", "return", "the", "created", "IHCNode", "." ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-uicore/src/main/java/com/helger/photon/uicore/UITextFormatter.java#L110-L128
train
phax/ph-oton
ph-oton-uicore/src/main/java/com/helger/photon/uicore/page/AbstractWebPage.java
AbstractWebPage.getContent
public final void getContent (@Nonnull final WPECTYPE aWPEC) { if (isValidToDisplayPage (aWPEC).isValid ()) { // "before"-callback beforeFillContent (aWPEC); // Create the main page content fillContent (aWPEC); // "after"-callback afterFillContent (aWPEC); } else ...
java
public final void getContent (@Nonnull final WPECTYPE aWPEC) { if (isValidToDisplayPage (aWPEC).isValid ()) { // "before"-callback beforeFillContent (aWPEC); // Create the main page content fillContent (aWPEC); // "after"-callback afterFillContent (aWPEC); } else ...
[ "public", "final", "void", "getContent", "(", "@", "Nonnull", "final", "WPECTYPE", "aWPEC", ")", "{", "if", "(", "isValidToDisplayPage", "(", "aWPEC", ")", ".", "isValid", "(", ")", ")", "{", "// \"before\"-callback", "beforeFillContent", "(", "aWPEC", ")", ...
Default implementation calling the abstract fillContent method and creating the help node if desired.
[ "Default", "implementation", "calling", "the", "abstract", "fillContent", "method", "and", "creating", "the", "help", "node", "if", "desired", "." ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-uicore/src/main/java/com/helger/photon/uicore/page/AbstractWebPage.java#L152-L170
train
phax/ph-oton
ph-oton-uicore/src/main/java/com/helger/photon/uicore/page/AbstractWebPage.java
AbstractWebPage.addAjax
@Nonnull public static final AjaxFunctionDeclaration addAjax (@Nullable final String sPrefix, @Nonnull final IAjaxExecutor aExecutor) { // null means random name final String sFuncName = StringHelper.hasText (sPrefix) ? sPrefix + AjaxFunctionDeclaration...
java
@Nonnull public static final AjaxFunctionDeclaration addAjax (@Nullable final String sPrefix, @Nonnull final IAjaxExecutor aExecutor) { // null means random name final String sFuncName = StringHelper.hasText (sPrefix) ? sPrefix + AjaxFunctionDeclaration...
[ "@", "Nonnull", "public", "static", "final", "AjaxFunctionDeclaration", "addAjax", "(", "@", "Nullable", "final", "String", "sPrefix", ",", "@", "Nonnull", "final", "IAjaxExecutor", "aExecutor", ")", "{", "// null means random name", "final", "String", "sFuncName", ...
Add a per-page AJAX executor, with an automatically generated name. It is automatically generated with the global AjaxInvoker. @param sPrefix Function name prefix. If one is provided, this will be used as URL name so only limited chars are allowed. @param aExecutor The executor to be executed. May not be <code>null</c...
[ "Add", "a", "per", "-", "page", "AJAX", "executor", "with", "an", "automatically", "generated", "name", ".", "It", "is", "automatically", "generated", "with", "the", "global", "AjaxInvoker", "." ]
f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-uicore/src/main/java/com/helger/photon/uicore/page/AbstractWebPage.java#L189-L201
train
deltatree/qrsct
src/main/java/de/deltatree/tools/qrsct/QRSCT.java
QRSCT.reference
public QRSCT reference(String reference) { if (reference != null && reference.length() <= 35) { this.text = ""; //$NON-NLS-1$ this.reference = checkValidSigns(reference); return this; } throw new IllegalArgumentException("supplied reference [" + reference //$NON-NLS-1$ + "] not valid: has to b...
java
public QRSCT reference(String reference) { if (reference != null && reference.length() <= 35) { this.text = ""; //$NON-NLS-1$ this.reference = checkValidSigns(reference); return this; } throw new IllegalArgumentException("supplied reference [" + reference //$NON-NLS-1$ + "] not valid: has to b...
[ "public", "QRSCT", "reference", "(", "String", "reference", ")", "{", "if", "(", "reference", "!=", "null", "&&", "reference", ".", "length", "(", ")", "<=", "35", ")", "{", "this", ".", "text", "=", "\"\"", ";", "//$NON-NLS-1$\r", "this", ".", "refere...
Sets the reference of this builder !!!If you set this attribute, attribute text will be reset to an empty string!!! It's only possible to define one of these attributes @param reference reference (max length: 35) @return QRSCT builder
[ "Sets", "the", "reference", "of", "this", "builder", "!!!If", "you", "set", "this", "attribute", "attribute", "text", "will", "be", "reset", "to", "an", "empty", "string!!!", "It", "s", "only", "possible", "to", "define", "one", "of", "these", "attributes" ]
81a137f74d9eceb47d4225d6f1ff45569d359a19
https://github.com/deltatree/qrsct/blob/81a137f74d9eceb47d4225d6f1ff45569d359a19/src/main/java/de/deltatree/tools/qrsct/QRSCT.java#L181-L189
train
deltatree/qrsct
src/main/java/de/deltatree/tools/qrsct/QRSCT.java
QRSCT.text
public QRSCT text(String text) { if (text != null && text.length() <= 140) { this.reference = ""; //$NON-NLS-1$ this.text = checkValidSigns(text); return this; } throw new IllegalArgumentException("supplied text [" + text //$NON-NLS-1$ + "] not valid: has to be not null and of max length 140")...
java
public QRSCT text(String text) { if (text != null && text.length() <= 140) { this.reference = ""; //$NON-NLS-1$ this.text = checkValidSigns(text); return this; } throw new IllegalArgumentException("supplied text [" + text //$NON-NLS-1$ + "] not valid: has to be not null and of max length 140")...
[ "public", "QRSCT", "text", "(", "String", "text", ")", "{", "if", "(", "text", "!=", "null", "&&", "text", ".", "length", "(", ")", "<=", "140", ")", "{", "this", ".", "reference", "=", "\"\"", ";", "//$NON-NLS-1$\r", "this", ".", "text", "=", "che...
Sets the text of this builder !!!If you set this attribute, attribute reference will be reset to an empty string!!! It's only possible to define one of these attributes @param text text (max length: 140) @return QRSCT builder
[ "Sets", "the", "text", "of", "this", "builder", "!!!If", "you", "set", "this", "attribute", "attribute", "reference", "will", "be", "reset", "to", "an", "empty", "string!!!", "It", "s", "only", "possible", "to", "define", "one", "of", "these", "attributes" ]
81a137f74d9eceb47d4225d6f1ff45569d359a19
https://github.com/deltatree/qrsct/blob/81a137f74d9eceb47d4225d6f1ff45569d359a19/src/main/java/de/deltatree/tools/qrsct/QRSCT.java#L200-L208
train
sosandstrom/mardao
mardao-maven-plugin/src/main/java/net/sf/mardao/plugin/ProcessDomainMojo.java
ProcessDomainMojo.processClasspath
private void processClasspath(String classpathElement) throws ResourceNotFoundException, ParseErrorException, Exception { // getLog().info("Classpath is " + classpathElement); if (classpathElement.endsWith(".jar")) { // TODO: implement JAR scanning } else { final File dir ...
java
private void processClasspath(String classpathElement) throws ResourceNotFoundException, ParseErrorException, Exception { // getLog().info("Classpath is " + classpathElement); if (classpathElement.endsWith(".jar")) { // TODO: implement JAR scanning } else { final File dir ...
[ "private", "void", "processClasspath", "(", "String", "classpathElement", ")", "throws", "ResourceNotFoundException", ",", "ParseErrorException", ",", "Exception", "{", "// getLog().info(\"Classpath is \" + classpathElement);", "if", "(", "classpathElement", ".", "endsWi...
Process the classes for a specified package @param classpathElement @throws ResourceNotFoundException @throws ParseErrorException @throws Exception
[ "Process", "the", "classes", "for", "a", "specified", "package" ]
b77e3a2ac1d8932e0a3174f3645f71b211dfc055
https://github.com/sosandstrom/mardao/blob/b77e3a2ac1d8932e0a3174f3645f71b211dfc055/mardao-maven-plugin/src/main/java/net/sf/mardao/plugin/ProcessDomainMojo.java#L272-L281
train
sosandstrom/mardao
mardao-maven-plugin/src/main/java/net/sf/mardao/plugin/ProcessDomainMojo.java
ProcessDomainMojo.processPackage
private void processPackage(File root, File dir) { getLog().debug("- package: " + dir); if (null != dir && dir.isDirectory()) { for (File f : dir.listFiles(new FileFilter() { @Override public boolean accept(File pathname) { return pathname....
java
private void processPackage(File root, File dir) { getLog().debug("- package: " + dir); if (null != dir && dir.isDirectory()) { for (File f : dir.listFiles(new FileFilter() { @Override public boolean accept(File pathname) { return pathname....
[ "private", "void", "processPackage", "(", "File", "root", ",", "File", "dir", ")", "{", "getLog", "(", ")", ".", "debug", "(", "\"- package: \"", "+", "dir", ")", ";", "if", "(", "null", "!=", "dir", "&&", "dir", ".", "isDirectory", "(", ")", ")", ...
Recursive method to process a folder or file; if a folder, call recursively for each file. If for a file, process the file using the classVisitor. @param root base folder @param dir this (sub-)packages folder
[ "Recursive", "method", "to", "process", "a", "folder", "or", "file", ";", "if", "a", "folder", "call", "recursively", "for", "each", "file", ".", "If", "for", "a", "file", "process", "the", "file", "using", "the", "classVisitor", "." ]
b77e3a2ac1d8932e0a3174f3645f71b211dfc055
https://github.com/sosandstrom/mardao/blob/b77e3a2ac1d8932e0a3174f3645f71b211dfc055/mardao-maven-plugin/src/main/java/net/sf/mardao/plugin/ProcessDomainMojo.java#L315-L354
train
phax/ph-datetime
ph-holiday/src/main/java/com/helger/holiday/mgr/XMLHolidayManager.java
XMLHolidayManager._getHolidays
@Nonnull @ReturnsMutableCopy private HolidayMap _getHolidays (final int nYear, @Nonnull final Configuration aConfig, @Nullable final String... aArgs) { if (LOGGER.isDebugEnabled ()) LOGGER.debug ("Adding holidays for " + aConfig.getDe...
java
@Nonnull @ReturnsMutableCopy private HolidayMap _getHolidays (final int nYear, @Nonnull final Configuration aConfig, @Nullable final String... aArgs) { if (LOGGER.isDebugEnabled ()) LOGGER.debug ("Adding holidays for " + aConfig.getDe...
[ "@", "Nonnull", "@", "ReturnsMutableCopy", "private", "HolidayMap", "_getHolidays", "(", "final", "int", "nYear", ",", "@", "Nonnull", "final", "Configuration", "aConfig", ",", "@", "Nullable", "final", "String", "...", "aArgs", ")", "{", "if", "(", "LOGGER", ...
Parses the provided configuration for the provided year and fills the list of holidays. @param nYear @param aConfig @param aArgs @return the holidays
[ "Parses", "the", "provided", "configuration", "for", "the", "provided", "year", "and", "fills", "the", "list", "of", "holidays", "." ]
cfaff01cb76d9affb934800ff55734b5a7d8983e
https://github.com/phax/ph-datetime/blob/cfaff01cb76d9affb934800ff55734b5a7d8983e/ph-holiday/src/main/java/com/helger/holiday/mgr/XMLHolidayManager.java#L174-L204
train
phax/ph-datetime
ph-holiday/src/main/java/com/helger/holiday/mgr/XMLHolidayManager.java
XMLHolidayManager._validateConfigurationHierarchy
private static void _validateConfigurationHierarchy (@Nonnull final Configuration aConfig) { final ICommonsSet <String> aHierarchySet = new CommonsHashSet <> (); for (final Configuration aSubConfig : aConfig.getSubConfigurations ()) { final String sHierarchy = aSubConfig.getHierarchy (); if (!...
java
private static void _validateConfigurationHierarchy (@Nonnull final Configuration aConfig) { final ICommonsSet <String> aHierarchySet = new CommonsHashSet <> (); for (final Configuration aSubConfig : aConfig.getSubConfigurations ()) { final String sHierarchy = aSubConfig.getHierarchy (); if (!...
[ "private", "static", "void", "_validateConfigurationHierarchy", "(", "@", "Nonnull", "final", "Configuration", "aConfig", ")", "{", "final", "ICommonsSet", "<", "String", ">", "aHierarchySet", "=", "new", "CommonsHashSet", "<>", "(", ")", ";", "for", "(", "final...
Validates the content of the provided configuration by checking for multiple hierarchy entries within one configuration. It traverses down the configuration tree.
[ "Validates", "the", "content", "of", "the", "provided", "configuration", "by", "checking", "for", "multiple", "hierarchy", "entries", "within", "one", "configuration", ".", "It", "traverses", "down", "the", "configuration", "tree", "." ]
cfaff01cb76d9affb934800ff55734b5a7d8983e
https://github.com/phax/ph-datetime/blob/cfaff01cb76d9affb934800ff55734b5a7d8983e/ph-holiday/src/main/java/com/helger/holiday/mgr/XMLHolidayManager.java#L211-L227
train
phax/ph-datetime
ph-holiday/src/main/java/com/helger/holiday/mgr/XMLHolidayManager.java
XMLHolidayManager._createConfigurationHierarchy
@Nonnull private static CalendarHierarchy _createConfigurationHierarchy (@Nonnull final Configuration aConfig, @Nullable final CalendarHierarchy aParent) { final ECountry eCountry = ECountry.getFromIDOrNull (aConfig.getHierarchy ()); final Ca...
java
@Nonnull private static CalendarHierarchy _createConfigurationHierarchy (@Nonnull final Configuration aConfig, @Nullable final CalendarHierarchy aParent) { final ECountry eCountry = ECountry.getFromIDOrNull (aConfig.getHierarchy ()); final Ca...
[ "@", "Nonnull", "private", "static", "CalendarHierarchy", "_createConfigurationHierarchy", "(", "@", "Nonnull", "final", "Configuration", "aConfig", ",", "@", "Nullable", "final", "CalendarHierarchy", "aParent", ")", "{", "final", "ECountry", "eCountry", "=", "ECountr...
Creates the configuration hierarchy for the provided configuration. @param aConfig @return configuration hierarchy
[ "Creates", "the", "configuration", "hierarchy", "for", "the", "provided", "configuration", "." ]
cfaff01cb76d9affb934800ff55734b5a7d8983e
https://github.com/phax/ph-datetime/blob/cfaff01cb76d9affb934800ff55734b5a7d8983e/ph-holiday/src/main/java/com/helger/holiday/mgr/XMLHolidayManager.java#L248-L260
train
sosandstrom/mardao
mardao-jdbc/src/main/java/net/sf/mardao/dao/JdbcSupplier.java
JdbcSupplier.setDbType
public static void setDbType(JdbcDialect dialect, String key, String type) { Properties props = getTypesProps(dialect); props.setProperty(key, type); }
java
public static void setDbType(JdbcDialect dialect, String key, String type) { Properties props = getTypesProps(dialect); props.setProperty(key, type); }
[ "public", "static", "void", "setDbType", "(", "JdbcDialect", "dialect", ",", "String", "key", ",", "String", "type", ")", "{", "Properties", "props", "=", "getTypesProps", "(", "dialect", ")", ";", "props", ".", "setProperty", "(", "key", ",", "type", ")",...
Add a type for your DB's dialect
[ "Add", "a", "type", "for", "your", "DB", "s", "dialect" ]
b77e3a2ac1d8932e0a3174f3645f71b211dfc055
https://github.com/sosandstrom/mardao/blob/b77e3a2ac1d8932e0a3174f3645f71b211dfc055/mardao-jdbc/src/main/java/net/sf/mardao/dao/JdbcSupplier.java#L505-L508
train
phax/ph-datetime
ph-holiday/src/main/java/com/helger/holiday/parser/EthiopianOrthodoxHolidayParser.java
EthiopianOrthodoxHolidayParser._getEthiopianOrthodoxHolidaysInGregorianYear
private static ICommonsSet <LocalDate> _getEthiopianOrthodoxHolidaysInGregorianYear (final int nGregorianYear, final int nEOMonth, final int nEODa...
java
private static ICommonsSet <LocalDate> _getEthiopianOrthodoxHolidaysInGregorianYear (final int nGregorianYear, final int nEOMonth, final int nEODa...
[ "private", "static", "ICommonsSet", "<", "LocalDate", ">", "_getEthiopianOrthodoxHolidaysInGregorianYear", "(", "final", "int", "nGregorianYear", ",", "final", "int", "nEOMonth", ",", "final", "int", "nEODay", ")", "{", "return", "CalendarHelper", ".", "getDatesFromCh...
Returns a set of gregorian dates within a gregorian year which equal the Ethiopian orthodox month and day. Because the Ethiopian orthodox year different from the gregorian there may be more than one occurrence of an Ethiopian orthodox date in an gregorian year. @param nGregorianYear @param nEOMonth orthodox month @par...
[ "Returns", "a", "set", "of", "gregorian", "dates", "within", "a", "gregorian", "year", "which", "equal", "the", "Ethiopian", "orthodox", "month", "and", "day", ".", "Because", "the", "Ethiopian", "orthodox", "year", "different", "from", "the", "gregorian", "th...
cfaff01cb76d9affb934800ff55734b5a7d8983e
https://github.com/phax/ph-datetime/blob/cfaff01cb76d9affb934800ff55734b5a7d8983e/ph-holiday/src/main/java/com/helger/holiday/parser/EthiopianOrthodoxHolidayParser.java#L64-L72
train
revelytix/spark
spark-http-client/src/main/java/spark/protocol/parser/XMLResultsParser.java
XMLResultsParser.parse
@Override public Result parse(Command cmd, InputStream input, ResultType type) { return parseResults(cmd, input, type); }
java
@Override public Result parse(Command cmd, InputStream input, ResultType type) { return parseResults(cmd, input, type); }
[ "@", "Override", "public", "Result", "parse", "(", "Command", "cmd", ",", "InputStream", "input", ",", "ResultType", "type", ")", "{", "return", "parseResults", "(", "cmd", ",", "input", ",", "type", ")", ";", "}" ]
Parses the input stream as either XML select or ask results.
[ "Parses", "the", "input", "stream", "as", "either", "XML", "select", "or", "ask", "results", "." ]
d777d40c962bc66fdc04b7c3a66d20b777ff6fb4
https://github.com/revelytix/spark/blob/d777d40c962bc66fdc04b7c3a66d20b777ff6fb4/spark-http-client/src/main/java/spark/protocol/parser/XMLResultsParser.java#L80-L83
train
revelytix/spark
spark-http-client/src/main/java/spark/protocol/parser/XMLResultsParser.java
XMLResultsParser.parseResults
public static Result parseResults(Command cmd, InputStream input, ResultType type) throws SparqlException { try { return createResults(cmd, input, type); } catch (Throwable t) { logger.debug("Error parsing results from stream, cleaning up."); try { input.close(); } catch (IOExcep...
java
public static Result parseResults(Command cmd, InputStream input, ResultType type) throws SparqlException { try { return createResults(cmd, input, type); } catch (Throwable t) { logger.debug("Error parsing results from stream, cleaning up."); try { input.close(); } catch (IOExcep...
[ "public", "static", "Result", "parseResults", "(", "Command", "cmd", ",", "InputStream", "input", ",", "ResultType", "type", ")", "throws", "SparqlException", "{", "try", "{", "return", "createResults", "(", "cmd", ",", "input", ",", "type", ")", ";", "}", ...
Parses an XMLResults object based on the contents of the given stream. @param cmd The command that originated the request. @param stream The input stream containing raw XML. @param query The query used to generate the stream. @return A new XMLResults object. Either variable bindings, or a boolean result. @throws Sparql...
[ "Parses", "an", "XMLResults", "object", "based", "on", "the", "contents", "of", "the", "given", "stream", "." ]
d777d40c962bc66fdc04b7c3a66d20b777ff6fb4
https://github.com/revelytix/spark/blob/d777d40c962bc66fdc04b7c3a66d20b777ff6fb4/spark-http-client/src/main/java/spark/protocol/parser/XMLResultsParser.java#L93-L105
train
revelytix/spark
spark-http-client/src/main/java/spark/protocol/parser/XMLResultsParser.java
XMLResultsParser.createResults
private static Result createResults(Command cmd, InputStream stream, ResultType type) throws SparqlException { XMLInputFactory xmlStreamFactory = XMLInputFactory.newInstance(); // Tell the factory to combine adjacent character blocks into a single event, so we don't have to do it ourselves. xmlStreamFa...
java
private static Result createResults(Command cmd, InputStream stream, ResultType type) throws SparqlException { XMLInputFactory xmlStreamFactory = XMLInputFactory.newInstance(); // Tell the factory to combine adjacent character blocks into a single event, so we don't have to do it ourselves. xmlStreamFa...
[ "private", "static", "Result", "createResults", "(", "Command", "cmd", ",", "InputStream", "stream", ",", "ResultType", "type", ")", "throws", "SparqlException", "{", "XMLInputFactory", "xmlStreamFactory", "=", "XMLInputFactory", ".", "newInstance", "(", ")", ";", ...
Sets up an XML parser for the input, and creates the appropriate result type based on the parsed XML.
[ "Sets", "up", "an", "XML", "parser", "for", "the", "input", "and", "creates", "the", "appropriate", "result", "type", "based", "on", "the", "parsed", "XML", "." ]
d777d40c962bc66fdc04b7c3a66d20b777ff6fb4
https://github.com/revelytix/spark/blob/d777d40c962bc66fdc04b7c3a66d20b777ff6fb4/spark-http-client/src/main/java/spark/protocol/parser/XMLResultsParser.java#L108-L164
train
revelytix/spark
spark-http-client/src/main/java/spark/protocol/parser/XMLResultsParser.java
XMLResultsParser.parseHeader
static private void parseHeader(String base, XMLStreamReader rdr, List<String> cols, List<String> md) throws XMLStreamException, SparqlException { logger.debug("xml:base is initially {}", base); base = getBase(base, rdr); testOpen(rdr, rdr.nextTag(), HEAD, "Missing header from XML results"); base = getB...
java
static private void parseHeader(String base, XMLStreamReader rdr, List<String> cols, List<String> md) throws XMLStreamException, SparqlException { logger.debug("xml:base is initially {}", base); base = getBase(base, rdr); testOpen(rdr, rdr.nextTag(), HEAD, "Missing header from XML results"); base = getB...
[ "static", "private", "void", "parseHeader", "(", "String", "base", ",", "XMLStreamReader", "rdr", ",", "List", "<", "String", ">", "cols", ",", "List", "<", "String", ">", "md", ")", "throws", "XMLStreamException", ",", "SparqlException", "{", "logger", ".",...
Parse the &lt;head&gt; element with the variables and metadata. @param base The base URI, initialized to the endpoint URL if known. @param rdr The XML reader to parse information from. @param cols A list to populate with the columns that may appear in the header. @param md A list to populate with metada that may appear...
[ "Parse", "the", "&lt", ";", "head&gt", ";", "element", "with", "the", "variables", "and", "metadata", "." ]
d777d40c962bc66fdc04b7c3a66d20b777ff6fb4
https://github.com/revelytix/spark/blob/d777d40c962bc66fdc04b7c3a66d20b777ff6fb4/spark-http-client/src/main/java/spark/protocol/parser/XMLResultsParser.java#L194-L219
train
revelytix/spark
spark-http-client/src/main/java/spark/protocol/parser/XMLResultsParser.java
XMLResultsParser.nameIs
static final boolean nameIs(XMLStreamReader rdr, Element elt) { return rdr.getLocalName().equalsIgnoreCase(elt.name()); }
java
static final boolean nameIs(XMLStreamReader rdr, Element elt) { return rdr.getLocalName().equalsIgnoreCase(elt.name()); }
[ "static", "final", "boolean", "nameIs", "(", "XMLStreamReader", "rdr", ",", "Element", "elt", ")", "{", "return", "rdr", ".", "getLocalName", "(", ")", ".", "equalsIgnoreCase", "(", "elt", ".", "name", "(", ")", ")", ";", "}" ]
Convenience method to test if the current local name is the same as an expected element. @param rdr The XMLStreamReader to get the current state from. @param elt The element to test against. @return <code>true</code> iff the current local name is the same as the element name.
[ "Convenience", "method", "to", "test", "if", "the", "current", "local", "name", "is", "the", "same", "as", "an", "expected", "element", "." ]
d777d40c962bc66fdc04b7c3a66d20b777ff6fb4
https://github.com/revelytix/spark/blob/d777d40c962bc66fdc04b7c3a66d20b777ff6fb4/spark-http-client/src/main/java/spark/protocol/parser/XMLResultsParser.java#L271-L273
train
michael-rapp/AndroidUtil
library/src/main/java/de/mrapp/android/util/ThreadUtil.java
ThreadUtil.runOnUiThread
public static void runOnUiThread(@NonNull final Runnable runnable) { Condition.INSTANCE.ensureNotNull(runnable, "The runnable may not be null"); new Handler(Looper.getMainLooper()).post(runnable); }
java
public static void runOnUiThread(@NonNull final Runnable runnable) { Condition.INSTANCE.ensureNotNull(runnable, "The runnable may not be null"); new Handler(Looper.getMainLooper()).post(runnable); }
[ "public", "static", "void", "runOnUiThread", "(", "@", "NonNull", "final", "Runnable", "runnable", ")", "{", "Condition", ".", "INSTANCE", ".", "ensureNotNull", "(", "runnable", ",", "\"The runnable may not be null\"", ")", ";", "new", "Handler", "(", "Looper", ...
Executes a specific runnable on the UI thread. @param runnable The runnable, which should be executed, as an instance of the type {@link Runnable}. The runnable may not be null
[ "Executes", "a", "specific", "runnable", "on", "the", "UI", "thread", "." ]
67ec0e5732344eeb4d946dd1f96d782939e449f4
https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/ThreadUtil.java#L44-L47
train
michael-rapp/AndroidUtil
library/src/main/java/de/mrapp/android/util/multithreading/AbstractDataBinder.java
AbstractDataBinder.notifyOnLoad
@SafeVarargs private final boolean notifyOnLoad(@NonNull final KeyType key, @NonNull final ParamType... params) { boolean result = true; for (Listener<DataType, KeyType, ViewType, ParamType> listener : listeners) { result &= listener.onLoadData(thi...
java
@SafeVarargs private final boolean notifyOnLoad(@NonNull final KeyType key, @NonNull final ParamType... params) { boolean result = true; for (Listener<DataType, KeyType, ViewType, ParamType> listener : listeners) { result &= listener.onLoadData(thi...
[ "@", "SafeVarargs", "private", "final", "boolean", "notifyOnLoad", "(", "@", "NonNull", "final", "KeyType", "key", ",", "@", "NonNull", "final", "ParamType", "...", "params", ")", "{", "boolean", "result", "=", "true", ";", "for", "(", "Listener", "<", "Da...
Notifies all listeners, that the data binder starts to load data asynchronously. @param key The key of the data, which should be loaded, as an instance of the generic type KeyType. The key may not be null @param params An array, which contains optional parameters, as an array of the type ParamType or an empty array, i...
[ "Notifies", "all", "listeners", "that", "the", "data", "binder", "starts", "to", "load", "data", "asynchronously", "." ]
67ec0e5732344eeb4d946dd1f96d782939e449f4
https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/multithreading/AbstractDataBinder.java#L261-L271
train
michael-rapp/AndroidUtil
library/src/main/java/de/mrapp/android/util/multithreading/AbstractDataBinder.java
AbstractDataBinder.notifyOnFinished
@SafeVarargs private final void notifyOnFinished(@NonNull final KeyType key, @Nullable final DataType data, @NonNull final ViewType view, @NonNull final ParamType... params) { for (Listener<DataType, KeyType, ViewType, ParamType...
java
@SafeVarargs private final void notifyOnFinished(@NonNull final KeyType key, @Nullable final DataType data, @NonNull final ViewType view, @NonNull final ParamType... params) { for (Listener<DataType, KeyType, ViewType, ParamType...
[ "@", "SafeVarargs", "private", "final", "void", "notifyOnFinished", "(", "@", "NonNull", "final", "KeyType", "key", ",", "@", "Nullable", "final", "DataType", "data", ",", "@", "NonNull", "final", "ViewType", "view", ",", "@", "NonNull", "final", "ParamType", ...
Notifies all listeners, that the data binder is showing data, which has been loaded either asynchronously or from cache. @param key The key of the data, which has be loaded, as an instance of the generic type KeyType. The key may not be null @param data The data, which has been loaded, as an instance of the generic ty...
[ "Notifies", "all", "listeners", "that", "the", "data", "binder", "is", "showing", "data", "which", "has", "been", "loaded", "either", "asynchronously", "or", "from", "cache", "." ]
67ec0e5732344eeb4d946dd1f96d782939e449f4
https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/multithreading/AbstractDataBinder.java#L290-L297
train
michael-rapp/AndroidUtil
library/src/main/java/de/mrapp/android/util/multithreading/AbstractDataBinder.java
AbstractDataBinder.notifyOnCanceled
private void notifyOnCanceled() { for (Listener<DataType, KeyType, ViewType, ParamType> listener : listeners) { listener.onCanceled(this); } }
java
private void notifyOnCanceled() { for (Listener<DataType, KeyType, ViewType, ParamType> listener : listeners) { listener.onCanceled(this); } }
[ "private", "void", "notifyOnCanceled", "(", ")", "{", "for", "(", "Listener", "<", "DataType", ",", "KeyType", ",", "ViewType", ",", "ParamType", ">", "listener", ":", "listeners", ")", "{", "listener", ".", "onCanceled", "(", "this", ")", ";", "}", "}" ...
Notifies all listeners, that the data binder has been canceled.
[ "Notifies", "all", "listeners", "that", "the", "data", "binder", "has", "been", "canceled", "." ]
67ec0e5732344eeb4d946dd1f96d782939e449f4
https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/multithreading/AbstractDataBinder.java#L302-L306
train
michael-rapp/AndroidUtil
library/src/main/java/de/mrapp/android/util/multithreading/AbstractDataBinder.java
AbstractDataBinder.getCachedData
@Nullable private DataType getCachedData(@NonNull final KeyType key) { synchronized (cache) { return cache.get(key); } }
java
@Nullable private DataType getCachedData(@NonNull final KeyType key) { synchronized (cache) { return cache.get(key); } }
[ "@", "Nullable", "private", "DataType", "getCachedData", "(", "@", "NonNull", "final", "KeyType", "key", ")", "{", "synchronized", "(", "cache", ")", "{", "return", "cache", ".", "get", "(", "key", ")", ";", "}", "}" ]
Returns the data, which corresponds to a specific key, from the cache. @param key The key of the data, which should be retrieved, as an instance of the generic type KeyType. The key may not be null @return The data, which has been retrieved, as an instance of the generic type DataType or null, if no data with the give...
[ "Returns", "the", "data", "which", "corresponds", "to", "a", "specific", "key", "from", "the", "cache", "." ]
67ec0e5732344eeb4d946dd1f96d782939e449f4
https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/multithreading/AbstractDataBinder.java#L317-L322
train
michael-rapp/AndroidUtil
library/src/main/java/de/mrapp/android/util/multithreading/AbstractDataBinder.java
AbstractDataBinder.cacheData
private void cacheData(@NonNull final KeyType key, @NonNull final DataType data) { synchronized (cache) { if (useCache) { cache.put(key, data); } } }
java
private void cacheData(@NonNull final KeyType key, @NonNull final DataType data) { synchronized (cache) { if (useCache) { cache.put(key, data); } } }
[ "private", "void", "cacheData", "(", "@", "NonNull", "final", "KeyType", "key", ",", "@", "NonNull", "final", "DataType", "data", ")", "{", "synchronized", "(", "cache", ")", "{", "if", "(", "useCache", ")", "{", "cache", ".", "put", "(", "key", ",", ...
Adds the data, which corresponds to a specific key, to the cache, if caching is enabled. @param key The key of the data, which should be added to the cache, as an instance of the generic type KeyType. The key may not be null @param data The data, which should be added to the cache, as an instance of the generic type D...
[ "Adds", "the", "data", "which", "corresponds", "to", "a", "specific", "key", "to", "the", "cache", "if", "caching", "is", "enabled", "." ]
67ec0e5732344eeb4d946dd1f96d782939e449f4
https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/multithreading/AbstractDataBinder.java#L334-L340
train
michael-rapp/AndroidUtil
library/src/main/java/de/mrapp/android/util/multithreading/AbstractDataBinder.java
AbstractDataBinder.loadDataAsynchronously
private void loadDataAsynchronously( @NonNull final Task<DataType, KeyType, ViewType, ParamType> task) { threadPool.submit(new Runnable() { @Override public void run() { if (!isCanceled()) { while (!notifyOnLoad(task.key, task.params)) { ...
java
private void loadDataAsynchronously( @NonNull final Task<DataType, KeyType, ViewType, ParamType> task) { threadPool.submit(new Runnable() { @Override public void run() { if (!isCanceled()) { while (!notifyOnLoad(task.key, task.params)) { ...
[ "private", "void", "loadDataAsynchronously", "(", "@", "NonNull", "final", "Task", "<", "DataType", ",", "KeyType", ",", "ViewType", ",", "ParamType", ">", "task", ")", "{", "threadPool", ".", "submit", "(", "new", "Runnable", "(", ")", "{", "@", "Override...
Asynchronously executes a specific task in order to load data and to display it afterwards. @param task The task, which should be executed, as an instance of the class {@link Task}. The task may not be null
[ "Asynchronously", "executes", "a", "specific", "task", "in", "order", "to", "load", "data", "and", "to", "display", "it", "afterwards", "." ]
67ec0e5732344eeb4d946dd1f96d782939e449f4
https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/multithreading/AbstractDataBinder.java#L349-L372
train
michael-rapp/AndroidUtil
library/src/main/java/de/mrapp/android/util/multithreading/AbstractDataBinder.java
AbstractDataBinder.loadData
@Nullable private DataType loadData(@NonNull final Task<DataType, KeyType, ViewType, ParamType> task) { try { DataType data = doInBackground(task.key, task.params); if (data != null) { cacheData(task.key, data); } logger.logInfo(getClass(), "...
java
@Nullable private DataType loadData(@NonNull final Task<DataType, KeyType, ViewType, ParamType> task) { try { DataType data = doInBackground(task.key, task.params); if (data != null) { cacheData(task.key, data); } logger.logInfo(getClass(), "...
[ "@", "Nullable", "private", "DataType", "loadData", "(", "@", "NonNull", "final", "Task", "<", "DataType", ",", "KeyType", ",", "ViewType", ",", "ParamType", ">", "task", ")", "{", "try", "{", "DataType", "data", "=", "doInBackground", "(", "task", ".", ...
Executes a specific task in order to load data. @param task The task, which should be executed, as an instance of the class {@link Task}. The task may not be null @return The data, which has been loaded, as an instance of the generic type DataType or null, if no data has been loaded
[ "Executes", "a", "specific", "task", "in", "order", "to", "load", "data", "." ]
67ec0e5732344eeb4d946dd1f96d782939e449f4
https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/multithreading/AbstractDataBinder.java#L383-L399
train
michael-rapp/AndroidUtil
library/src/main/java/de/mrapp/android/util/multithreading/AbstractDataBinder.java
AbstractDataBinder.addListener
public final void addListener( @NonNull final Listener<DataType, KeyType, ViewType, ParamType> listener) { listeners.add(listener); }
java
public final void addListener( @NonNull final Listener<DataType, KeyType, ViewType, ParamType> listener) { listeners.add(listener); }
[ "public", "final", "void", "addListener", "(", "@", "NonNull", "final", "Listener", "<", "DataType", ",", "KeyType", ",", "ViewType", ",", "ParamType", ">", "listener", ")", "{", "listeners", ".", "add", "(", "listener", ")", ";", "}" ]
Adds a new listener, which should be notified about the events of the data binder. @param listener The listener, which should be added, as an instance of the type {@link Listener}. The listener may not be null
[ "Adds", "a", "new", "listener", "which", "should", "be", "notified", "about", "the", "events", "of", "the", "data", "binder", "." ]
67ec0e5732344eeb4d946dd1f96d782939e449f4
https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/multithreading/AbstractDataBinder.java#L592-L595
train
michael-rapp/AndroidUtil
library/src/main/java/de/mrapp/android/util/multithreading/AbstractDataBinder.java
AbstractDataBinder.removeListener
public final void removeListener( @NonNull final Listener<DataType, KeyType, ViewType, ParamType> listener) { listeners.remove(listener); }
java
public final void removeListener( @NonNull final Listener<DataType, KeyType, ViewType, ParamType> listener) { listeners.remove(listener); }
[ "public", "final", "void", "removeListener", "(", "@", "NonNull", "final", "Listener", "<", "DataType", ",", "KeyType", ",", "ViewType", ",", "ParamType", ">", "listener", ")", "{", "listeners", ".", "remove", "(", "listener", ")", ";", "}" ]
Removes a specific listener, which should not be notified about the events of the data binder, anymore. @param listener The listener, which should be removed, as an instance of the type {@link Listener}. The listener may not be null
[ "Removes", "a", "specific", "listener", "which", "should", "not", "be", "notified", "about", "the", "events", "of", "the", "data", "binder", "anymore", "." ]
67ec0e5732344eeb4d946dd1f96d782939e449f4
https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/multithreading/AbstractDataBinder.java#L605-L608
train
michael-rapp/AndroidUtil
library/src/main/java/de/mrapp/android/util/multithreading/AbstractDataBinder.java
AbstractDataBinder.load
@SafeVarargs public final void load(@NonNull final KeyType key, @NonNull final ViewType view, @NonNull final ParamType... params) { load(key, view, true, params); }
java
@SafeVarargs public final void load(@NonNull final KeyType key, @NonNull final ViewType view, @NonNull final ParamType... params) { load(key, view, true, params); }
[ "@", "SafeVarargs", "public", "final", "void", "load", "(", "@", "NonNull", "final", "KeyType", "key", ",", "@", "NonNull", "final", "ViewType", "view", ",", "@", "NonNull", "final", "ParamType", "...", "params", ")", "{", "load", "(", "key", ",", "view"...
Loads the the data, which corresponds to a specific key, and displays it in a specific view. If the data has already been loaded, it will be retrieved from the cache. By default, the data is loaded in a background thread. @param key The key of the data, which should be loaded, as an instance of the generic type KeyTyp...
[ "Loads", "the", "the", "data", "which", "corresponds", "to", "a", "specific", "key", "and", "displays", "it", "in", "a", "specific", "view", ".", "If", "the", "data", "has", "already", "been", "loaded", "it", "will", "be", "retrieved", "from", "the", "ca...
67ec0e5732344eeb4d946dd1f96d782939e449f4
https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/multithreading/AbstractDataBinder.java#L625-L629
train
michael-rapp/AndroidUtil
library/src/main/java/de/mrapp/android/util/multithreading/AbstractDataBinder.java
AbstractDataBinder.load
@SafeVarargs public final void load(@NonNull final KeyType key, @NonNull final ViewType view, final boolean async, @NonNull final ParamType... params) { Condition.INSTANCE.ensureNotNull(key, "The key may not be null"); Condition.INSTANCE.ensureNotNull(view, "The view may n...
java
@SafeVarargs public final void load(@NonNull final KeyType key, @NonNull final ViewType view, final boolean async, @NonNull final ParamType... params) { Condition.INSTANCE.ensureNotNull(key, "The key may not be null"); Condition.INSTANCE.ensureNotNull(view, "The view may n...
[ "@", "SafeVarargs", "public", "final", "void", "load", "(", "@", "NonNull", "final", "KeyType", "key", ",", "@", "NonNull", "final", "ViewType", "view", ",", "final", "boolean", "async", ",", "@", "NonNull", "final", "ParamType", "...", "params", ")", "{",...
Loads the the data, which corresponds to a specific key, and displays it in a specific view. If the data has already been loaded, it will be retrieved from the cache. @param key The key of the data, which should be loaded, as an instance of the generic type KeyType. The key may not be null @param view The view, which ...
[ "Loads", "the", "the", "data", "which", "corresponds", "to", "a", "specific", "key", "and", "displays", "it", "in", "a", "specific", "view", ".", "If", "the", "data", "has", "already", "been", "loaded", "it", "will", "be", "retrieved", "from", "the", "ca...
67ec0e5732344eeb4d946dd1f96d782939e449f4
https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/multithreading/AbstractDataBinder.java#L647-L675
train
michael-rapp/AndroidUtil
library/src/main/java/de/mrapp/android/util/multithreading/AbstractDataBinder.java
AbstractDataBinder.isCached
public final boolean isCached(@NonNull final KeyType key) { Condition.INSTANCE.ensureNotNull(key, "The key may not be null"); synchronized (cache) { return cache.get(key) != null; } }
java
public final boolean isCached(@NonNull final KeyType key) { Condition.INSTANCE.ensureNotNull(key, "The key may not be null"); synchronized (cache) { return cache.get(key) != null; } }
[ "public", "final", "boolean", "isCached", "(", "@", "NonNull", "final", "KeyType", "key", ")", "{", "Condition", ".", "INSTANCE", ".", "ensureNotNull", "(", "key", ",", "\"The key may not be null\"", ")", ";", "synchronized", "(", "cache", ")", "{", "return", ...
Returns, whether the data, which corresponds to a specific key, is currently cached, or not. @param key The key, which corresponds to the data, which should be checked, as an instance of the generic type KeyType. The key may not be null @return True, if the data, which corresponds to the given key, is currently cached...
[ "Returns", "whether", "the", "data", "which", "corresponds", "to", "a", "specific", "key", "is", "currently", "cached", "or", "not", "." ]
67ec0e5732344eeb4d946dd1f96d782939e449f4
https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/multithreading/AbstractDataBinder.java#L706-L712
train
michael-rapp/AndroidUtil
library/src/main/java/de/mrapp/android/util/multithreading/AbstractDataBinder.java
AbstractDataBinder.useCache
public final void useCache(final boolean useCache) { synchronized (cache) { this.useCache = useCache; logger.logDebug(getClass(), useCache ? "Enabled" : "Disabled" + " caching"); if (!useCache) { clearCache(); } } }
java
public final void useCache(final boolean useCache) { synchronized (cache) { this.useCache = useCache; logger.logDebug(getClass(), useCache ? "Enabled" : "Disabled" + " caching"); if (!useCache) { clearCache(); } } }
[ "public", "final", "void", "useCache", "(", "final", "boolean", "useCache", ")", "{", "synchronized", "(", "cache", ")", "{", "this", ".", "useCache", "=", "useCache", ";", "logger", ".", "logDebug", "(", "getClass", "(", ")", ",", "useCache", "?", "\"En...
Sets, whether data should be cached, or not. @param useCache True, if data should be cached, false otherwise.
[ "Sets", "whether", "data", "should", "be", "cached", "or", "not", "." ]
67ec0e5732344eeb4d946dd1f96d782939e449f4
https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/multithreading/AbstractDataBinder.java#L731-L740
train
rahulsom/genealogy
src/main/java/com/github/rahulsom/genealogy/NameDbUsa.java
NameDbUsa.profile
private static void profile(Task task, String message, int tries) { for (int i = 0; i < tries; i++) { long start = System.nanoTime(); task.run(); long finish = System.nanoTime(); System.out.println( String.format("[Try %d] %-30s: %-5.2fms", i +...
java
private static void profile(Task task, String message, int tries) { for (int i = 0; i < tries; i++) { long start = System.nanoTime(); task.run(); long finish = System.nanoTime(); System.out.println( String.format("[Try %d] %-30s: %-5.2fms", i +...
[ "private", "static", "void", "profile", "(", "Task", "task", ",", "String", "message", ",", "int", "tries", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "tries", ";", "i", "++", ")", "{", "long", "start", "=", "System", ".", "nanoTi...
Poor mans profiler @param task task to execute @param message message identifying the task @param tries number of times task needs to be executed
[ "Poor", "mans", "profiler" ]
2beb35ab9c6e03080328aa08b18f0a3c5d3f5c12
https://github.com/rahulsom/genealogy/blob/2beb35ab9c6e03080328aa08b18f0a3c5d3f5c12/src/main/java/com/github/rahulsom/genealogy/NameDbUsa.java#L193-L203
train
michael-rapp/AndroidUtil
library/src/main/java/de/mrapp/android/util/view/ElevationShadowView.java
ElevationShadowView.obtainShadowElevation
private void obtainShadowElevation(@NonNull final TypedArray typedArray) { int defaultValue = getResources().getDimensionPixelSize( R.dimen.elevation_shadow_view_shadow_elevation_default_value); elevation = pixelsToDp(getContext(), typedArray .getDimensionPixelSize(R.styl...
java
private void obtainShadowElevation(@NonNull final TypedArray typedArray) { int defaultValue = getResources().getDimensionPixelSize( R.dimen.elevation_shadow_view_shadow_elevation_default_value); elevation = pixelsToDp(getContext(), typedArray .getDimensionPixelSize(R.styl...
[ "private", "void", "obtainShadowElevation", "(", "@", "NonNull", "final", "TypedArray", "typedArray", ")", "{", "int", "defaultValue", "=", "getResources", "(", ")", ".", "getDimensionPixelSize", "(", "R", ".", "dimen", ".", "elevation_shadow_view_shadow_elevation_def...
Obtains the elevation of the shadow, which is visualized by the view, from a specific typed array. @param typedArray The typed array, the elevation should be obtained from, as an instance of the class {@link TypedArray}. The typed array may not be null
[ "Obtains", "the", "elevation", "of", "the", "shadow", "which", "is", "visualized", "by", "the", "view", "from", "a", "specific", "typed", "array", "." ]
67ec0e5732344eeb4d946dd1f96d782939e449f4
https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/view/ElevationShadowView.java#L117-L123
train
michael-rapp/AndroidUtil
library/src/main/java/de/mrapp/android/util/view/ElevationShadowView.java
ElevationShadowView.obtainShadowOrientation
private void obtainShadowOrientation(@NonNull final TypedArray typedArray) { int defaultValue = getResources() .getInteger(R.integer.elevation_shadow_view_shadow_orientation_default_value); orientation = Orientation.fromValue(typedArray .getInteger(R.styleable.ElevationSh...
java
private void obtainShadowOrientation(@NonNull final TypedArray typedArray) { int defaultValue = getResources() .getInteger(R.integer.elevation_shadow_view_shadow_orientation_default_value); orientation = Orientation.fromValue(typedArray .getInteger(R.styleable.ElevationSh...
[ "private", "void", "obtainShadowOrientation", "(", "@", "NonNull", "final", "TypedArray", "typedArray", ")", "{", "int", "defaultValue", "=", "getResources", "(", ")", ".", "getInteger", "(", "R", ".", "integer", ".", "elevation_shadow_view_shadow_orientation_default_...
Obtains the orientation of the shadow, which is visualized by the view, from a specific typed array. @param typedArray The typed array, the elevation should be obtained from, as an instance of the class {@link TypedArray}. The typed array may not be null
[ "Obtains", "the", "orientation", "of", "the", "shadow", "which", "is", "visualized", "by", "the", "view", "from", "a", "specific", "typed", "array", "." ]
67ec0e5732344eeb4d946dd1f96d782939e449f4
https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/view/ElevationShadowView.java#L133-L138
train
michael-rapp/AndroidUtil
library/src/main/java/de/mrapp/android/util/view/ElevationShadowView.java
ElevationShadowView.obtainEmulateParallelLight
private void obtainEmulateParallelLight(@NonNull final TypedArray typedArray) { boolean defaultValue = getResources() .getBoolean(R.bool.elevation_shadow_view_emulate_parallel_light_default_value); emulateParallelLight = typedArray .getBoolean(R.styleable.ElevationShadowV...
java
private void obtainEmulateParallelLight(@NonNull final TypedArray typedArray) { boolean defaultValue = getResources() .getBoolean(R.bool.elevation_shadow_view_emulate_parallel_light_default_value); emulateParallelLight = typedArray .getBoolean(R.styleable.ElevationShadowV...
[ "private", "void", "obtainEmulateParallelLight", "(", "@", "NonNull", "final", "TypedArray", "typedArray", ")", "{", "boolean", "defaultValue", "=", "getResources", "(", ")", ".", "getBoolean", "(", "R", ".", "bool", ".", "elevation_shadow_view_emulate_parallel_light_...
Obtains the boolean value, which specifies whether parallel light should be emulated, from a specific typed array. @param typedArray The typed array, the boolean value should be obtained from, as an instance of the class {@link TypedArray}
[ "Obtains", "the", "boolean", "value", "which", "specifies", "whether", "parallel", "light", "should", "be", "emulated", "from", "a", "specific", "typed", "array", "." ]
67ec0e5732344eeb4d946dd1f96d782939e449f4
https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/view/ElevationShadowView.java#L148-L153
train
michael-rapp/AndroidUtil
library/src/main/java/de/mrapp/android/util/view/ElevationShadowView.java
ElevationShadowView.adaptElevationShadow
private void adaptElevationShadow() { setImageBitmap( createElevationShadow(getContext(), elevation, orientation, emulateParallelLight)); setScaleType(orientation == Orientation.LEFT || orientation == Orientation.TOP || orientation == Orientation.RIGHT || orientation == O...
java
private void adaptElevationShadow() { setImageBitmap( createElevationShadow(getContext(), elevation, orientation, emulateParallelLight)); setScaleType(orientation == Orientation.LEFT || orientation == Orientation.TOP || orientation == Orientation.RIGHT || orientation == O...
[ "private", "void", "adaptElevationShadow", "(", ")", "{", "setImageBitmap", "(", "createElevationShadow", "(", "getContext", "(", ")", ",", "elevation", ",", "orientation", ",", "emulateParallelLight", ")", ")", ";", "setScaleType", "(", "orientation", "==", "Orie...
Adapts the shadow, which is visualized by the view, depending on its current attributes.
[ "Adapts", "the", "shadow", "which", "is", "visualized", "by", "the", "view", "depending", "on", "its", "current", "attributes", "." ]
67ec0e5732344eeb4d946dd1f96d782939e449f4
https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/view/ElevationShadowView.java#L158-L164
train
michael-rapp/AndroidUtil
library/src/main/java/de/mrapp/android/util/view/ElevationShadowView.java
ElevationShadowView.setShadowElevation
public final void setShadowElevation(final int elevation) { Condition.INSTANCE.ensureAtLeast(elevation, 0, "The elevation must be at least 0"); Condition.INSTANCE.ensureAtMaximum(elevation, ElevationUtil.MAX_ELEVATION, "The elevation must be at maximum " + ElevationUtil.MAX_ELEVATION); ...
java
public final void setShadowElevation(final int elevation) { Condition.INSTANCE.ensureAtLeast(elevation, 0, "The elevation must be at least 0"); Condition.INSTANCE.ensureAtMaximum(elevation, ElevationUtil.MAX_ELEVATION, "The elevation must be at maximum " + ElevationUtil.MAX_ELEVATION); ...
[ "public", "final", "void", "setShadowElevation", "(", "final", "int", "elevation", ")", "{", "Condition", ".", "INSTANCE", ".", "ensureAtLeast", "(", "elevation", ",", "0", ",", "\"The elevation must be at least 0\"", ")", ";", "Condition", ".", "INSTANCE", ".", ...
Sets the elevation of the shadow, which should be visualized by the view. @param elevation The elevation of the shadow, which should be set, in dp as an {@link Integer} value. The elevation must be at least 0 and at maximum 16
[ "Sets", "the", "elevation", "of", "the", "shadow", "which", "should", "be", "visualized", "by", "the", "view", "." ]
67ec0e5732344eeb4d946dd1f96d782939e449f4
https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/view/ElevationShadowView.java#L234-L240
train
michael-rapp/AndroidUtil
library/src/main/java/de/mrapp/android/util/view/ElevationShadowView.java
ElevationShadowView.setShadowOrientation
public final void setShadowOrientation(@NonNull final Orientation orientation) { Condition.INSTANCE.ensureNotNull(orientation, "The orientation may not be null"); this.orientation = orientation; adaptElevationShadow(); }
java
public final void setShadowOrientation(@NonNull final Orientation orientation) { Condition.INSTANCE.ensureNotNull(orientation, "The orientation may not be null"); this.orientation = orientation; adaptElevationShadow(); }
[ "public", "final", "void", "setShadowOrientation", "(", "@", "NonNull", "final", "Orientation", "orientation", ")", "{", "Condition", ".", "INSTANCE", ".", "ensureNotNull", "(", "orientation", ",", "\"The orientation may not be null\"", ")", ";", "this", ".", "orien...
Sets the orientation of the shadow, which should be visualized by the view. @param orientation The orientation, which should be set, as a value of the enum {@link Orientation}. The orientation may either be <code>LEFT</code>, <code>RIGHT</code>, <code>TOP</code>, <code>BOTTOM</code>, <code>TOP_LEFT</code>, <code>TOP_R...
[ "Sets", "the", "orientation", "of", "the", "shadow", "which", "should", "be", "visualized", "by", "the", "view", "." ]
67ec0e5732344eeb4d946dd1f96d782939e449f4
https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/view/ElevationShadowView.java#L263-L267
train
avarabyeu/restendpoint
src/main/java/com/github/avarabyeu/restendpoint/http/DefaultErrorHandler.java
DefaultErrorHandler.hasError
@Override public boolean hasError(Response<ByteSource> rs) { StatusType statusType = StatusType.valueOf(rs.getStatus()); return (statusType == StatusType.CLIENT_ERROR || statusType == StatusType.SERVER_ERROR); }
java
@Override public boolean hasError(Response<ByteSource> rs) { StatusType statusType = StatusType.valueOf(rs.getStatus()); return (statusType == StatusType.CLIENT_ERROR || statusType == StatusType.SERVER_ERROR); }
[ "@", "Override", "public", "boolean", "hasError", "(", "Response", "<", "ByteSource", ">", "rs", ")", "{", "StatusType", "statusType", "=", "StatusType", ".", "valueOf", "(", "rs", ".", "getStatus", "(", ")", ")", ";", "return", "(", "statusType", "==", ...
Returns TRUE in case status code of response starts with 4 or 5
[ "Returns", "TRUE", "in", "case", "status", "code", "of", "response", "starts", "with", "4", "or", "5" ]
e11fc0813ea4cefbe4d8bca292cd48b40abf185d
https://github.com/avarabyeu/restendpoint/blob/e11fc0813ea4cefbe4d8bca292cd48b40abf185d/src/main/java/com/github/avarabyeu/restendpoint/http/DefaultErrorHandler.java#L36-L40
train
avarabyeu/restendpoint
src/main/java/com/github/avarabyeu/restendpoint/http/DefaultErrorHandler.java
DefaultErrorHandler.handleError
protected void handleError(URI requestUri, HttpMethod requestMethod, int statusCode, String statusMessage, ByteSource errorBody) throws RestEndpointIOException { throw new RestEndpointException(requestUri, requestMethod, statusCode, statusMessage, errorBody); }
java
protected void handleError(URI requestUri, HttpMethod requestMethod, int statusCode, String statusMessage, ByteSource errorBody) throws RestEndpointIOException { throw new RestEndpointException(requestUri, requestMethod, statusCode, statusMessage, errorBody); }
[ "protected", "void", "handleError", "(", "URI", "requestUri", ",", "HttpMethod", "requestMethod", ",", "int", "statusCode", ",", "String", "statusMessage", ",", "ByteSource", "errorBody", ")", "throws", "RestEndpointIOException", "{", "throw", "new", "RestEndpointExce...
Handler methods for HTTP client errors @param requestUri - Request URI @param requestMethod - Request HTTP Method @param statusCode - HTTP status code @param statusMessage - HTTP status message @param errorBody - HTTP response body
[ "Handler", "methods", "for", "HTTP", "client", "errors" ]
e11fc0813ea4cefbe4d8bca292cd48b40abf185d
https://github.com/avarabyeu/restendpoint/blob/e11fc0813ea4cefbe4d8bca292cd48b40abf185d/src/main/java/com/github/avarabyeu/restendpoint/http/DefaultErrorHandler.java#L69-L72
train
misberner/duzzt
processor/src/main/java/com/github/misberner/duzzt/processor/Duzzt.java
Duzzt.init
public void init(APUtils utils) throws DuzztInitializationException { URL url = GenerateEDSLProcessor.class.getResource(ST_RESOURCE_NAME); this.sourceGenGroup = new STGroupFile( url, ST_ENCODING, ST_DELIM_START_CHAR, ST_DELIM_STOP_CHAR); sourceGenGroup.setListener(new ReporterDiagnosticListe...
java
public void init(APUtils utils) throws DuzztInitializationException { URL url = GenerateEDSLProcessor.class.getResource(ST_RESOURCE_NAME); this.sourceGenGroup = new STGroupFile( url, ST_ENCODING, ST_DELIM_START_CHAR, ST_DELIM_STOP_CHAR); sourceGenGroup.setListener(new ReporterDiagnosticListe...
[ "public", "void", "init", "(", "APUtils", "utils", ")", "throws", "DuzztInitializationException", "{", "URL", "url", "=", "GenerateEDSLProcessor", ".", "class", ".", "getResource", "(", "ST_RESOURCE_NAME", ")", ";", "this", ".", "sourceGenGroup", "=", "new", "ST...
Initialize the Duzzt embedded DSL generator. @param utils the APUtils instance wrapping the {@link javax.annotation.processing.ProcessingEnvironment} @throws DuzztInitializationException if a fatal error occurs during initialization
[ "Initialize", "the", "Duzzt", "embedded", "DSL", "generator", "." ]
3fb784c1a9142967141743587fe7ad3945d0ac28
https://github.com/misberner/duzzt/blob/3fb784c1a9142967141743587fe7ad3945d0ac28/processor/src/main/java/com/github/misberner/duzzt/processor/Duzzt.java#L132-L151
train
misberner/duzzt
processor/src/main/java/com/github/misberner/duzzt/processor/Duzzt.java
Duzzt.process
public void process(Element elem, GenerateEmbeddedDSL annotation, Elements elementUtils, Types typeUtils, Filer filer, Reporter reporter) throws IOException { if(!ElementUtils.checkElementKind(elem, ElementKind.CLASS, ElementKind.INTERFACE)) { throw new IllegalArgumentException("Annotation " + GenerateEmbedd...
java
public void process(Element elem, GenerateEmbeddedDSL annotation, Elements elementUtils, Types typeUtils, Filer filer, Reporter reporter) throws IOException { if(!ElementUtils.checkElementKind(elem, ElementKind.CLASS, ElementKind.INTERFACE)) { throw new IllegalArgumentException("Annotation " + GenerateEmbedd...
[ "public", "void", "process", "(", "Element", "elem", ",", "GenerateEmbeddedDSL", "annotation", ",", "Elements", "elementUtils", ",", "Types", "typeUtils", ",", "Filer", "filer", ",", "Reporter", "reporter", ")", "throws", "IOException", "{", "if", "(", "!", "E...
Process an annotated element. @param elem the element to process (must be class or interface) @param annotation the annotation specifying the EDSL @param elementUtils {@link javax.lang.model} element utilities class @param typeUtils {@link javax.lang.model} type utilities @param filer the {@link Filer} used to write o...
[ "Process", "an", "annotated", "element", "." ]
3fb784c1a9142967141743587fe7ad3945d0ac28
https://github.com/misberner/duzzt/blob/3fb784c1a9142967141743587fe7ad3945d0ac28/processor/src/main/java/com/github/misberner/duzzt/processor/Duzzt.java#L165-L189
train
michael-rapp/AndroidUtil
library/src/main/java/de/mrapp/android/util/PermissionUtil.java
PermissionUtil.isPermissionGranted
public static boolean isPermissionGranted(@NonNull final Context context, @NonNull final String permission) { Condition.INSTANCE.ensureNotNull(context, "The context may not be null"); Condition.INSTANCE.ensureNotNull(permission, "The permission may not be nu...
java
public static boolean isPermissionGranted(@NonNull final Context context, @NonNull final String permission) { Condition.INSTANCE.ensureNotNull(context, "The context may not be null"); Condition.INSTANCE.ensureNotNull(permission, "The permission may not be nu...
[ "public", "static", "boolean", "isPermissionGranted", "(", "@", "NonNull", "final", "Context", "context", ",", "@", "NonNull", "final", "String", "permission", ")", "{", "Condition", ".", "INSTANCE", ".", "ensureNotNull", "(", "context", ",", "\"The context may no...
Returns, whether a specific permission is granted, or not. @param context The context, which should be used, as an instance of the class {@link Context}. The context may not be null @param permission The permission, which should be checked, as a {@link String}, e.g. <code>android.Manifest.permission.CALL_PHONE</code>....
[ "Returns", "whether", "a", "specific", "permission", "is", "granted", "or", "not", "." ]
67ec0e5732344eeb4d946dd1f96d782939e449f4
https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/PermissionUtil.java#L57-L65
train
michael-rapp/AndroidUtil
library/src/main/java/de/mrapp/android/util/PermissionUtil.java
PermissionUtil.areAllPermissionsGranted
public static boolean areAllPermissionsGranted(@NonNull final Context context, @NonNull final String... permissions) { Condition.INSTANCE.ensureNotNull(context, "The context may not be null"); Condition.INSTANCE.ensureNotNull(permissions, "The array may...
java
public static boolean areAllPermissionsGranted(@NonNull final Context context, @NonNull final String... permissions) { Condition.INSTANCE.ensureNotNull(context, "The context may not be null"); Condition.INSTANCE.ensureNotNull(permissions, "The array may...
[ "public", "static", "boolean", "areAllPermissionsGranted", "(", "@", "NonNull", "final", "Context", "context", ",", "@", "NonNull", "final", "String", "...", "permissions", ")", "{", "Condition", ".", "INSTANCE", ".", "ensureNotNull", "(", "context", ",", "\"The...
Returns, whether all permissions, which are contained by a specific array, are granted, or not. @param context The context, which should be used, as an instance of the class {@link Context}. The context may not be null @param permissions An array, which contains the permissions, e.g. <code>android.Manifest.permission....
[ "Returns", "whether", "all", "permissions", "which", "are", "contained", "by", "a", "specific", "array", "are", "granted", "or", "not", "." ]
67ec0e5732344eeb4d946dd1f96d782939e449f4
https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/PermissionUtil.java#L79-L93
train
michael-rapp/AndroidUtil
library/src/main/java/de/mrapp/android/util/PermissionUtil.java
PermissionUtil.getNotGrantedPermissions
@NonNull public static String[] getNotGrantedPermissions(@NonNull final Context context, @NonNull final String... permissions) { Condition.INSTANCE.ensureNotNull(permissions, "The array may not be null"); Collection<String> notGrantedPermissions = ...
java
@NonNull public static String[] getNotGrantedPermissions(@NonNull final Context context, @NonNull final String... permissions) { Condition.INSTANCE.ensureNotNull(permissions, "The array may not be null"); Collection<String> notGrantedPermissions = ...
[ "@", "NonNull", "public", "static", "String", "[", "]", "getNotGrantedPermissions", "(", "@", "NonNull", "final", "Context", "context", ",", "@", "NonNull", "final", "String", "...", "permissions", ")", "{", "Condition", ".", "INSTANCE", ".", "ensureNotNull", ...
Returns the subset of specific permissions, which are not granted. @param context The context, which should be used, as an instance of the class {@link Context}. The context may not be null @param permissions An array, which contains the permissions, e.g. <code>android.Manifest.CALL_PHONE</code>, which should be check...
[ "Returns", "the", "subset", "of", "specific", "permissions", "which", "are", "not", "granted", "." ]
67ec0e5732344eeb4d946dd1f96d782939e449f4
https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/PermissionUtil.java#L107-L122
train
MKLab-ITI/simmo
src/main/java/gr/iti/mklab/simmo/core/morphia/ObjectDAO.java
ObjectDAO.findByDate
private List<O> findByDate(String dateField, Date start, Date end, int numObjects, boolean asc) { if (start == null) start = new Date(0); if (end == null) end = new Date(); return getDatastore().find(clazz).filter(dateField + " >", start).filter(dateField + " <", end).ord...
java
private List<O> findByDate(String dateField, Date start, Date end, int numObjects, boolean asc) { if (start == null) start = new Date(0); if (end == null) end = new Date(); return getDatastore().find(clazz).filter(dateField + " >", start).filter(dateField + " <", end).ord...
[ "private", "List", "<", "O", ">", "findByDate", "(", "String", "dateField", ",", "Date", "start", ",", "Date", "end", ",", "int", "numObjects", ",", "boolean", "asc", ")", "{", "if", "(", "start", "==", "null", ")", "start", "=", "new", "Date", "(", ...
A private helper method that can be applied to "creationDate", "crawledDate", "lastModifiedDate". For usage sample see the methods below @param dateField @param start @param end @param numObjects @param asc @return
[ "A", "private", "helper", "method", "that", "can", "be", "applied", "to", "creationDate", "crawledDate", "lastModifiedDate", ".", "For", "usage", "sample", "see", "the", "methods", "below" ]
a78436e982e160fb0260746c563c7e4d24736486
https://github.com/MKLab-ITI/simmo/blob/a78436e982e160fb0260746c563c7e4d24736486/src/main/java/gr/iti/mklab/simmo/core/morphia/ObjectDAO.java#L55-L61
train
MKLab-ITI/simmo
src/main/java/gr/iti/mklab/simmo/core/morphia/ObjectDAO.java
ObjectDAO.createdInPeriod
public List<O> createdInPeriod(Date start, Date end, int numObjects) { return findByDate("creationDate", start, end, numObjects, true); }
java
public List<O> createdInPeriod(Date start, Date end, int numObjects) { return findByDate("creationDate", start, end, numObjects, true); }
[ "public", "List", "<", "O", ">", "createdInPeriod", "(", "Date", "start", ",", "Date", "end", ",", "int", "numObjects", ")", "{", "return", "findByDate", "(", "\"creationDate\"", ",", "start", ",", "end", ",", "numObjects", ",", "true", ")", ";", "}" ]
Returns a list of images created in the time period specified by start and end @param start @param end @param numObjects @return
[ "Returns", "a", "list", "of", "images", "created", "in", "the", "time", "period", "specified", "by", "start", "and", "end" ]
a78436e982e160fb0260746c563c7e4d24736486
https://github.com/MKLab-ITI/simmo/blob/a78436e982e160fb0260746c563c7e4d24736486/src/main/java/gr/iti/mklab/simmo/core/morphia/ObjectDAO.java#L93-L95
train
MKLab-ITI/simmo
src/main/java/gr/iti/mklab/simmo/core/morphia/ObjectDAO.java
ObjectDAO.similar
public List<Similarity> similar(Image object, double threshold) { //return getDatastore().find(Similarity.class).field("firstObject").equal(object).order("similarityScore").asList(); Query<Similarity> q = getDatastore().createQuery(Similarity.class); q.or( q.criteria("firstObject...
java
public List<Similarity> similar(Image object, double threshold) { //return getDatastore().find(Similarity.class).field("firstObject").equal(object).order("similarityScore").asList(); Query<Similarity> q = getDatastore().createQuery(Similarity.class); q.or( q.criteria("firstObject...
[ "public", "List", "<", "Similarity", ">", "similar", "(", "Image", "object", ",", "double", "threshold", ")", "{", "//return getDatastore().find(Similarity.class).field(\"firstObject\").equal(object).order(\"similarityScore\").asList();", "Query", "<", "Similarity", ">", "q", ...
Returns a list of objects that are similar to the specified object @param object @param threshold @return
[ "Returns", "a", "list", "of", "objects", "that", "are", "similar", "to", "the", "specified", "object" ]
a78436e982e160fb0260746c563c7e4d24736486
https://github.com/MKLab-ITI/simmo/blob/a78436e982e160fb0260746c563c7e4d24736486/src/main/java/gr/iti/mklab/simmo/core/morphia/ObjectDAO.java#L104-L112
train
edwardcapriolo/teknek-core
src/main/java/io/teknek/datalayer/WorkerDao.java
WorkerDao.createZookeeperBase
public void createZookeeperBase() throws WorkerDaoException { createPersistentEmptyNodeIfNotExist(BASE_ZK); createPersistentEmptyNodeIfNotExist(WORKERS_ZK); createPersistentEmptyNodeIfNotExist(PLANS_ZK); createPersistentEmptyNodeIfNotExist(SAVED_ZK); createPersistentEmptyNodeIfNotExist(LOCKS_ZK); ...
java
public void createZookeeperBase() throws WorkerDaoException { createPersistentEmptyNodeIfNotExist(BASE_ZK); createPersistentEmptyNodeIfNotExist(WORKERS_ZK); createPersistentEmptyNodeIfNotExist(PLANS_ZK); createPersistentEmptyNodeIfNotExist(SAVED_ZK); createPersistentEmptyNodeIfNotExist(LOCKS_ZK); ...
[ "public", "void", "createZookeeperBase", "(", ")", "throws", "WorkerDaoException", "{", "createPersistentEmptyNodeIfNotExist", "(", "BASE_ZK", ")", ";", "createPersistentEmptyNodeIfNotExist", "(", "WORKERS_ZK", ")", ";", "createPersistentEmptyNodeIfNotExist", "(", "PLANS_ZK",...
Creates all the required base directories in ZK for the application to run
[ "Creates", "all", "the", "required", "base", "directories", "in", "ZK", "for", "the", "application", "to", "run" ]
4fa972d11044dee2954c0cc5e1b53b18fba319b9
https://github.com/edwardcapriolo/teknek-core/blob/4fa972d11044dee2954c0cc5e1b53b18fba319b9/src/main/java/io/teknek/datalayer/WorkerDao.java#L121-L128
train
edwardcapriolo/teknek-core
src/main/java/io/teknek/datalayer/WorkerDao.java
WorkerDao.findWorkersWorkingOnPlan
public List<String> findWorkersWorkingOnPlan(Plan plan) throws WorkerDaoException{ try { Stat exists = framework.getCuratorFramework().checkExists().forPath(PLAN_WORKERS_ZK + "/" + plan.getName()); if (exists == null ){ return new ArrayList<String>(); } return framework.getCuratorFra...
java
public List<String> findWorkersWorkingOnPlan(Plan plan) throws WorkerDaoException{ try { Stat exists = framework.getCuratorFramework().checkExists().forPath(PLAN_WORKERS_ZK + "/" + plan.getName()); if (exists == null ){ return new ArrayList<String>(); } return framework.getCuratorFra...
[ "public", "List", "<", "String", ">", "findWorkersWorkingOnPlan", "(", "Plan", "plan", ")", "throws", "WorkerDaoException", "{", "try", "{", "Stat", "exists", "=", "framework", ".", "getCuratorFramework", "(", ")", ".", "checkExists", "(", ")", ".", "forPath",...
Returns the node name of all the ephemeral nodes under a plan. This is effectively who is working on the plan. @param plan @return @throws WorkerDaoException If there are zookeeper problems
[ "Returns", "the", "node", "name", "of", "all", "the", "ephemeral", "nodes", "under", "a", "plan", ".", "This", "is", "effectively", "who", "is", "working", "on", "the", "plan", "." ]
4fa972d11044dee2954c0cc5e1b53b18fba319b9
https://github.com/edwardcapriolo/teknek-core/blob/4fa972d11044dee2954c0cc5e1b53b18fba319b9/src/main/java/io/teknek/datalayer/WorkerDao.java#L137-L147
train
edwardcapriolo/teknek-core
src/main/java/io/teknek/datalayer/WorkerDao.java
WorkerDao.findPlanByName
public Plan findPlanByName(String name) throws WorkerDaoException { Stat planStat; byte[] planBytes; try { planStat = framework.getCuratorFramework().checkExists().forPath(PLANS_ZK + "/" + name); if (planStat == null) { return null; } planBytes = framework.getCuratorFramework...
java
public Plan findPlanByName(String name) throws WorkerDaoException { Stat planStat; byte[] planBytes; try { planStat = framework.getCuratorFramework().checkExists().forPath(PLANS_ZK + "/" + name); if (planStat == null) { return null; } planBytes = framework.getCuratorFramework...
[ "public", "Plan", "findPlanByName", "(", "String", "name", ")", "throws", "WorkerDaoException", "{", "Stat", "planStat", ";", "byte", "[", "]", "planBytes", ";", "try", "{", "planStat", "=", "framework", ".", "getCuratorFramework", "(", ")", ".", "checkExists"...
Search zookeeper for a plan with given name. @param name @return null if plan not found, null if plan is corrupt data @throws WorkerDaoException for zookeeper problems
[ "Search", "zookeeper", "for", "a", "plan", "with", "given", "name", "." ]
4fa972d11044dee2954c0cc5e1b53b18fba319b9
https://github.com/edwardcapriolo/teknek-core/blob/4fa972d11044dee2954c0cc5e1b53b18fba319b9/src/main/java/io/teknek/datalayer/WorkerDao.java#L173-L195
train
edwardcapriolo/teknek-core
src/main/java/io/teknek/datalayer/WorkerDao.java
WorkerDao.createOrUpdatePlan
public void createOrUpdatePlan(Plan plan) throws WorkerDaoException { try { createZookeeperBase(); Stat s = this.framework.getCuratorFramework().checkExists().forPath(PLANS_ZK + "/" + plan.getName()); if (s != null) { framework.getCuratorFramework().setData().withVersion(s.getVersion()) ...
java
public void createOrUpdatePlan(Plan plan) throws WorkerDaoException { try { createZookeeperBase(); Stat s = this.framework.getCuratorFramework().checkExists().forPath(PLANS_ZK + "/" + plan.getName()); if (s != null) { framework.getCuratorFramework().setData().withVersion(s.getVersion()) ...
[ "public", "void", "createOrUpdatePlan", "(", "Plan", "plan", ")", "throws", "WorkerDaoException", "{", "try", "{", "createZookeeperBase", "(", ")", ";", "Stat", "s", "=", "this", ".", "framework", ".", "getCuratorFramework", "(", ")", ".", "checkExists", "(", ...
Creates or updates a plan in zookeeper. @param plan @throws WorkerDaoException if malformed plan or communication error with zookeeper
[ "Creates", "or", "updates", "a", "plan", "in", "zookeeper", "." ]
4fa972d11044dee2954c0cc5e1b53b18fba319b9
https://github.com/edwardcapriolo/teknek-core/blob/4fa972d11044dee2954c0cc5e1b53b18fba319b9/src/main/java/io/teknek/datalayer/WorkerDao.java#L217-L233
train
edwardcapriolo/teknek-core
src/main/java/io/teknek/datalayer/WorkerDao.java
WorkerDao.createEphemeralNodeForDaemon
public void createEphemeralNodeForDaemon(TeknekDaemon d) throws WorkerDaoException { try { byte [] hostbytes = d.getHostname().getBytes(ENCODING); framework.getCuratorFramework().create() .withMode(CreateMode.EPHEMERAL).withACL(Ids.OPEN_ACL_UNSAFE).forPath(WORKERS_ZK + "/" + d.getMyId(), ...
java
public void createEphemeralNodeForDaemon(TeknekDaemon d) throws WorkerDaoException { try { byte [] hostbytes = d.getHostname().getBytes(ENCODING); framework.getCuratorFramework().create() .withMode(CreateMode.EPHEMERAL).withACL(Ids.OPEN_ACL_UNSAFE).forPath(WORKERS_ZK + "/" + d.getMyId(), ...
[ "public", "void", "createEphemeralNodeForDaemon", "(", "TeknekDaemon", "d", ")", "throws", "WorkerDaoException", "{", "try", "{", "byte", "[", "]", "hostbytes", "=", "d", ".", "getHostname", "(", ")", ".", "getBytes", "(", "ENCODING", ")", ";", "framework", ...
Creates an ephemeral node so that we can determine how many current live nodes there are @param zk @param d @throws WorkerDaoException
[ "Creates", "an", "ephemeral", "node", "so", "that", "we", "can", "determine", "how", "many", "current", "live", "nodes", "there", "are" ]
4fa972d11044dee2954c0cc5e1b53b18fba319b9
https://github.com/edwardcapriolo/teknek-core/blob/4fa972d11044dee2954c0cc5e1b53b18fba319b9/src/main/java/io/teknek/datalayer/WorkerDao.java#L241-L251
train
edwardcapriolo/teknek-core
src/main/java/io/teknek/datalayer/WorkerDao.java
WorkerDao.findAllWorkerStatusForPlan
public List<WorkerStatus> findAllWorkerStatusForPlan(Plan plan, List<String> otherWorkers) throws WorkerDaoException{ List<WorkerStatus> results = new ArrayList<WorkerStatus>(); try { Stat preCheck = framework.getCuratorFramework().checkExists().forPath(PLAN_WORKERS_ZK + "/" + plan.getName()); if (p...
java
public List<WorkerStatus> findAllWorkerStatusForPlan(Plan plan, List<String> otherWorkers) throws WorkerDaoException{ List<WorkerStatus> results = new ArrayList<WorkerStatus>(); try { Stat preCheck = framework.getCuratorFramework().checkExists().forPath(PLAN_WORKERS_ZK + "/" + plan.getName()); if (p...
[ "public", "List", "<", "WorkerStatus", ">", "findAllWorkerStatusForPlan", "(", "Plan", "plan", ",", "List", "<", "String", ">", "otherWorkers", ")", "throws", "WorkerDaoException", "{", "List", "<", "WorkerStatus", ">", "results", "=", "new", "ArrayList", "<", ...
Gets the status of each worker. The status contains the partitionId being consumed. This information helps the next worker bind to an unconsumed partition @param plan @param otherWorkers @return @throws WorkerDaoException
[ "Gets", "the", "status", "of", "each", "worker", ".", "The", "status", "contains", "the", "partitionId", "being", "consumed", ".", "This", "information", "helps", "the", "next", "worker", "bind", "to", "an", "unconsumed", "partition" ]
4fa972d11044dee2954c0cc5e1b53b18fba319b9
https://github.com/edwardcapriolo/teknek-core/blob/4fa972d11044dee2954c0cc5e1b53b18fba319b9/src/main/java/io/teknek/datalayer/WorkerDao.java#L275-L298
train
edwardcapriolo/teknek-core
src/main/java/io/teknek/datalayer/WorkerDao.java
WorkerDao.registerWorkerStatus
public void registerWorkerStatus(ZooKeeper zk, Plan plan, WorkerStatus s) throws WorkerDaoException{ String writeToPath = PLAN_WORKERS_ZK + "/" + plan.getName() + "/" + s.getWorkerUuid(); try { Stat planBase = zk.exists(PLAN_WORKERS_ZK + "/" + plan.getName(), false); if (planBase == null){ t...
java
public void registerWorkerStatus(ZooKeeper zk, Plan plan, WorkerStatus s) throws WorkerDaoException{ String writeToPath = PLAN_WORKERS_ZK + "/" + plan.getName() + "/" + s.getWorkerUuid(); try { Stat planBase = zk.exists(PLAN_WORKERS_ZK + "/" + plan.getName(), false); if (planBase == null){ t...
[ "public", "void", "registerWorkerStatus", "(", "ZooKeeper", "zk", ",", "Plan", "plan", ",", "WorkerStatus", "s", ")", "throws", "WorkerDaoException", "{", "String", "writeToPath", "=", "PLAN_WORKERS_ZK", "+", "\"/\"", "+", "plan", ".", "getName", "(", ")", "+"...
Registers an ephemeral node representing ownership of a feed partition. Note we do not use curator here because we want a standard watch not from the main thread! @param zk @param plan @param s @throws WorkerDaoException
[ "Registers", "an", "ephemeral", "node", "representing", "ownership", "of", "a", "feed", "partition", ".", "Note", "we", "do", "not", "use", "curator", "here", "because", "we", "want", "a", "standard", "watch", "not", "from", "the", "main", "thread!" ]
4fa972d11044dee2954c0cc5e1b53b18fba319b9
https://github.com/edwardcapriolo/teknek-core/blob/4fa972d11044dee2954c0cc5e1b53b18fba319b9/src/main/java/io/teknek/datalayer/WorkerDao.java#L308-L324
train
edwardcapriolo/teknek-core
src/main/java/io/teknek/datalayer/WorkerDao.java
WorkerDao.deletePlan
public void deletePlan(Plan p) throws WorkerDaoException { String planNode = PLANS_ZK + "/" + p.getName(); try { Stat s = framework.getCuratorFramework().checkExists().forPath(planNode); framework.getCuratorFramework().delete().withVersion(s.getVersion()).forPath(planNode); } catch (Exception e)...
java
public void deletePlan(Plan p) throws WorkerDaoException { String planNode = PLANS_ZK + "/" + p.getName(); try { Stat s = framework.getCuratorFramework().checkExists().forPath(planNode); framework.getCuratorFramework().delete().withVersion(s.getVersion()).forPath(planNode); } catch (Exception e)...
[ "public", "void", "deletePlan", "(", "Plan", "p", ")", "throws", "WorkerDaoException", "{", "String", "planNode", "=", "PLANS_ZK", "+", "\"/\"", "+", "p", ".", "getName", "(", ")", ";", "try", "{", "Stat", "s", "=", "framework", ".", "getCuratorFramework",...
Note you should call stop the plan if it is running before deleting @param p @throws WorkerDaoException
[ "Note", "you", "should", "call", "stop", "the", "plan", "if", "it", "is", "running", "before", "deleting" ]
4fa972d11044dee2954c0cc5e1b53b18fba319b9
https://github.com/edwardcapriolo/teknek-core/blob/4fa972d11044dee2954c0cc5e1b53b18fba319b9/src/main/java/io/teknek/datalayer/WorkerDao.java#L444-L452
train
michael-rapp/AndroidUtil
library/src/main/java/de/mrapp/android/util/ArrayUtil.java
ArrayUtil.indexOf
public static int indexOf(@NonNull final boolean[] array, final boolean value) { Condition.INSTANCE.ensureNotNull(array, "The array may not be null"); for (int i = 0; i < array.length; i++) { if (array[i] == value) { return i; } } return -1; }
java
public static int indexOf(@NonNull final boolean[] array, final boolean value) { Condition.INSTANCE.ensureNotNull(array, "The array may not be null"); for (int i = 0; i < array.length; i++) { if (array[i] == value) { return i; } } return -1; }
[ "public", "static", "int", "indexOf", "(", "@", "NonNull", "final", "boolean", "[", "]", "array", ",", "final", "boolean", "value", ")", "{", "Condition", ".", "INSTANCE", ".", "ensureNotNull", "(", "array", ",", "\"The array may not be null\"", ")", ";", "f...
Returns the index of the first item of an array, which equals a specific boolean value. @param array The array, which should be checked, as a {@link Boolean} array. The array may not be null @param value The value, which should be checked, as a {@link Boolean} value @return The index of the first item, which equals th...
[ "Returns", "the", "index", "of", "the", "first", "item", "of", "an", "array", "which", "equals", "a", "specific", "boolean", "value", "." ]
67ec0e5732344eeb4d946dd1f96d782939e449f4
https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/ArrayUtil.java#L45-L54
train
michael-rapp/AndroidUtil
library/src/main/java/de/mrapp/android/util/view/AbstractViewRecycler.java
AbstractViewRecycler.addUnusedView
protected final void addUnusedView(@NonNull final View view, final int viewType) { if (useCache) { if (unusedViews == null) { unusedViews = new SparseArray<>(adapter.getViewTypeCount()); } Queue<View> queue = unusedViews.get(viewType); if (queue ...
java
protected final void addUnusedView(@NonNull final View view, final int viewType) { if (useCache) { if (unusedViews == null) { unusedViews = new SparseArray<>(adapter.getViewTypeCount()); } Queue<View> queue = unusedViews.get(viewType); if (queue ...
[ "protected", "final", "void", "addUnusedView", "(", "@", "NonNull", "final", "View", "view", ",", "final", "int", "viewType", ")", "{", "if", "(", "useCache", ")", "{", "if", "(", "unusedViews", "==", "null", ")", "{", "unusedViews", "=", "new", "SparseA...
Adds an unused view to the cache. @param view The unused view, which should be added to the cache, as an instance of the class {@link View}. The view may not be null @param viewType The view type, the unused view corresponds to, as an {@link Integer} value
[ "Adds", "an", "unused", "view", "to", "the", "cache", "." ]
67ec0e5732344eeb4d946dd1f96d782939e449f4
https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/view/AbstractViewRecycler.java#L212-L227
train
michael-rapp/AndroidUtil
library/src/main/java/de/mrapp/android/util/view/AbstractViewRecycler.java
AbstractViewRecycler.pollUnusedView
@Nullable protected final View pollUnusedView(final int viewType) { if (useCache && unusedViews != null) { Queue<View> queue = unusedViews.get(viewType); if (queue != null) { return queue.poll(); } } return null; }
java
@Nullable protected final View pollUnusedView(final int viewType) { if (useCache && unusedViews != null) { Queue<View> queue = unusedViews.get(viewType); if (queue != null) { return queue.poll(); } } return null; }
[ "@", "Nullable", "protected", "final", "View", "pollUnusedView", "(", "final", "int", "viewType", ")", "{", "if", "(", "useCache", "&&", "unusedViews", "!=", "null", ")", "{", "Queue", "<", "View", ">", "queue", "=", "unusedViews", ".", "get", "(", "view...
Retrieves an unused view, which corresponds to a specific view type, from the cache, if any is available. @param viewType The view type of the unused view, which should be retrieved, as an {@link Integer} value @return An unused view, which corresponds to the given view type, as an instance of the class {@link View} o...
[ "Retrieves", "an", "unused", "view", "which", "corresponds", "to", "a", "specific", "view", "type", "from", "the", "cache", "if", "any", "is", "available", "." ]
67ec0e5732344eeb4d946dd1f96d782939e449f4
https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/view/AbstractViewRecycler.java#L239-L250
train
michael-rapp/AndroidUtil
library/src/main/java/de/mrapp/android/util/view/AbstractViewRecycler.java
AbstractViewRecycler.getView
@Nullable public final View getView(@NonNull final ItemType item) { Condition.INSTANCE.ensureNotNull(item, "The item may not be null"); return activeViews.get(item); }
java
@Nullable public final View getView(@NonNull final ItemType item) { Condition.INSTANCE.ensureNotNull(item, "The item may not be null"); return activeViews.get(item); }
[ "@", "Nullable", "public", "final", "View", "getView", "(", "@", "NonNull", "final", "ItemType", "item", ")", "{", "Condition", ".", "INSTANCE", ".", "ensureNotNull", "(", "item", ",", "\"The item may not be null\"", ")", ";", "return", "activeViews", ".", "ge...
Returns the view, which is currently used to visualize a specific item. @param item The item, whose view should be returned, as an instance of the generic type ItemType. The item may not be null @return The view, which is currently used to visualize the given item, as an instance of the type ItemType or null, if no su...
[ "Returns", "the", "view", "which", "is", "currently", "used", "to", "visualize", "a", "specific", "item", "." ]
67ec0e5732344eeb4d946dd1f96d782939e449f4
https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/view/AbstractViewRecycler.java#L429-L433
train
michael-rapp/AndroidUtil
library/src/main/java/de/mrapp/android/util/view/AbstractViewRecycler.java
AbstractViewRecycler.clearCache
public final void clearCache() { if (unusedViews != null) { unusedViews.clear(); unusedViews = null; } logger.logDebug(getClass(), "Removed all unused views from cache"); }
java
public final void clearCache() { if (unusedViews != null) { unusedViews.clear(); unusedViews = null; } logger.logDebug(getClass(), "Removed all unused views from cache"); }
[ "public", "final", "void", "clearCache", "(", ")", "{", "if", "(", "unusedViews", "!=", "null", ")", "{", "unusedViews", ".", "clear", "(", ")", ";", "unusedViews", "=", "null", ";", "}", "logger", ".", "logDebug", "(", "getClass", "(", ")", ",", "\"...
Removes all unused views from the cache.
[ "Removes", "all", "unused", "views", "from", "the", "cache", "." ]
67ec0e5732344eeb4d946dd1f96d782939e449f4
https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/view/AbstractViewRecycler.java#L477-L484
train
michael-rapp/AndroidUtil
library/src/main/java/de/mrapp/android/util/view/AbstractViewRecycler.java
AbstractViewRecycler.clearCache
public final void clearCache(final int viewType) { if (unusedViews != null) { unusedViews.remove(viewType); } logger.logDebug(getClass(), "Removed all unused views of view type " + viewType + " from cache"); }
java
public final void clearCache(final int viewType) { if (unusedViews != null) { unusedViews.remove(viewType); } logger.logDebug(getClass(), "Removed all unused views of view type " + viewType + " from cache"); }
[ "public", "final", "void", "clearCache", "(", "final", "int", "viewType", ")", "{", "if", "(", "unusedViews", "!=", "null", ")", "{", "unusedViews", ".", "remove", "(", "viewType", ")", ";", "}", "logger", ".", "logDebug", "(", "getClass", "(", ")", ",...
Removes all unused views, which correspond to a specific view type, from the cache. @param viewType The view type of the unused views, which should be removed from the cache, as an {@link Integer} value
[ "Removes", "all", "unused", "views", "which", "correspond", "to", "a", "specific", "view", "type", "from", "the", "cache", "." ]
67ec0e5732344eeb4d946dd1f96d782939e449f4
https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/view/AbstractViewRecycler.java#L493-L500
train
edwardcapriolo/teknek-core
src/main/java/io/teknek/daemon/Worker.java
Worker.init
public void init(){ try { zk = new ZooKeeper(parent.getProperties().get(TeknekDaemon.ZK_SERVER_LIST).toString(), 30000, this); } catch (IOException e1) { throw new RuntimeException(e1); } Feed feed = DriverFactory.buildFeed(plan.getFeedDesc()); List<WorkerStatus> workerStatus; try { ...
java
public void init(){ try { zk = new ZooKeeper(parent.getProperties().get(TeknekDaemon.ZK_SERVER_LIST).toString(), 30000, this); } catch (IOException e1) { throw new RuntimeException(e1); } Feed feed = DriverFactory.buildFeed(plan.getFeedDesc()); List<WorkerStatus> workerStatus; try { ...
[ "public", "void", "init", "(", ")", "{", "try", "{", "zk", "=", "new", "ZooKeeper", "(", "parent", ".", "getProperties", "(", ")", ".", "get", "(", "TeknekDaemon", ".", "ZK_SERVER_LIST", ")", ".", "toString", "(", ")", ",", "30000", ",", "this", ")",...
Deterine what partitions of the feed are already attached to other workers.
[ "Deterine", "what", "partitions", "of", "the", "feed", "are", "already", "attached", "to", "other", "workers", "." ]
4fa972d11044dee2954c0cc5e1b53b18fba319b9
https://github.com/edwardcapriolo/teknek-core/blob/4fa972d11044dee2954c0cc5e1b53b18fba319b9/src/main/java/io/teknek/daemon/Worker.java#L61-L90
train
edwardcapriolo/teknek-core
src/main/java/io/teknek/daemon/Worker.java
Worker.shutdown
private void shutdown(){ parent.workerThreads.get(plan).remove(this); if (zk != null) { try { logger.debug("closing " + zk.getSessionId()); zk.close(); zk = null; } catch (InterruptedException e1) { logger.debug(e1); } logger.debug("shutdown complete"); ...
java
private void shutdown(){ parent.workerThreads.get(plan).remove(this); if (zk != null) { try { logger.debug("closing " + zk.getSessionId()); zk.close(); zk = null; } catch (InterruptedException e1) { logger.debug(e1); } logger.debug("shutdown complete"); ...
[ "private", "void", "shutdown", "(", ")", "{", "parent", ".", "workerThreads", ".", "get", "(", "plan", ")", ".", "remove", "(", "this", ")", ";", "if", "(", "zk", "!=", "null", ")", "{", "try", "{", "logger", ".", "debug", "(", "\"closing \"", "+",...
Remove ourselves from parents worker threads and close our zk connection
[ "Remove", "ourselves", "from", "parents", "worker", "threads", "and", "close", "our", "zk", "connection" ]
4fa972d11044dee2954c0cc5e1b53b18fba319b9
https://github.com/edwardcapriolo/teknek-core/blob/4fa972d11044dee2954c0cc5e1b53b18fba319b9/src/main/java/io/teknek/daemon/Worker.java#L106-L118
train
phax/ph-datetime
ph-holiday/src/main/java/com/helger/holiday/mgr/CalendarHierarchy.java
CalendarHierarchy.getDescription
@Nonnull public String getDescription (final Locale aContentLocale) { final String ret = m_eCountry == null ? null : m_eCountry.getDisplayText (aContentLocale); return ret != null ? ret : "undefined"; }
java
@Nonnull public String getDescription (final Locale aContentLocale) { final String ret = m_eCountry == null ? null : m_eCountry.getDisplayText (aContentLocale); return ret != null ? ret : "undefined"; }
[ "@", "Nonnull", "public", "String", "getDescription", "(", "final", "Locale", "aContentLocale", ")", "{", "final", "String", "ret", "=", "m_eCountry", "==", "null", "?", "null", ":", "m_eCountry", ".", "getDisplayText", "(", "aContentLocale", ")", ";", "return...
Returns the hierarchies description text from the resource bundle. @param aContentLocale Locale to return the description text for. @return Description text
[ "Returns", "the", "hierarchies", "description", "text", "from", "the", "resource", "bundle", "." ]
cfaff01cb76d9affb934800ff55734b5a7d8983e
https://github.com/phax/ph-datetime/blob/cfaff01cb76d9affb934800ff55734b5a7d8983e/ph-holiday/src/main/java/com/helger/holiday/mgr/CalendarHierarchy.java#L78-L83
train
revelytix/spark
sherpa-java/src/main/java/sherpa/client/SHPSolutions.java
SHPSolutions.toNode
private static RDFNode toNode(Object value) { if (value == null) { return null; } else if (value instanceof RDFNode) { return (RDFNode) value; } else if (value instanceof IRI) { return new NamedNodeImpl(URI.create(((IRI)value).iri.toString())); } else if (value instanceof PlainLiteral)...
java
private static RDFNode toNode(Object value) { if (value == null) { return null; } else if (value instanceof RDFNode) { return (RDFNode) value; } else if (value instanceof IRI) { return new NamedNodeImpl(URI.create(((IRI)value).iri.toString())); } else if (value instanceof PlainLiteral)...
[ "private", "static", "RDFNode", "toNode", "(", "Object", "value", ")", "{", "if", "(", "value", "==", "null", ")", "{", "return", "null", ";", "}", "else", "if", "(", "value", "instanceof", "RDFNode", ")", "{", "return", "(", "RDFNode", ")", "value", ...
Convert a protocol data object to an RDFNode.
[ "Convert", "a", "protocol", "data", "object", "to", "an", "RDFNode", "." ]
d777d40c962bc66fdc04b7c3a66d20b777ff6fb4
https://github.com/revelytix/spark/blob/d777d40c962bc66fdc04b7c3a66d20b777ff6fb4/sherpa-java/src/main/java/sherpa/client/SHPSolutions.java#L71-L96
train