id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
112,800 | hsiafan/apk-parser | src/main/java/net/dongliu/apk/parser/AbstractApkFile.java | AbstractApkFile.getAllCertificateMetas | @Deprecated
public Map<String, List<CertificateMeta>> getAllCertificateMetas() throws IOException, CertificateException {
List<ApkSigner> apkSigners = getApkSingers();
Map<String, List<CertificateMeta>> map = new LinkedHashMap<>();
for (ApkSigner apkSigner : apkSigners) {
map.put... | java | @Deprecated
public Map<String, List<CertificateMeta>> getAllCertificateMetas() throws IOException, CertificateException {
List<ApkSigner> apkSigners = getApkSingers();
Map<String, List<CertificateMeta>> map = new LinkedHashMap<>();
for (ApkSigner apkSigner : apkSigners) {
map.put... | [
"@",
"Deprecated",
"public",
"Map",
"<",
"String",
",",
"List",
"<",
"CertificateMeta",
">",
">",
"getAllCertificateMetas",
"(",
")",
"throws",
"IOException",
",",
"CertificateException",
"{",
"List",
"<",
"ApkSigner",
">",
"apkSigners",
"=",
"getApkSingers",
"(... | Get the apk's all certificates.
For each entry, the key is certificate file path in apk file, the value is the certificates info of the certificate file.
@deprecated use {{@link #getApkSingers()}} instead | [
"Get",
"the",
"apk",
"s",
"all",
"certificates",
".",
"For",
"each",
"entry",
"the",
"key",
"is",
"certificate",
"file",
"path",
"in",
"apk",
"file",
"the",
"value",
"is",
"the",
"certificates",
"info",
"of",
"the",
"certificate",
"file",
"."
] | 8993ddd52017b37b8f2e784ae0a15417d9ede932 | https://github.com/hsiafan/apk-parser/blob/8993ddd52017b37b8f2e784ae0a15417d9ede932/src/main/java/net/dongliu/apk/parser/AbstractApkFile.java#L106-L114 |
112,801 | hsiafan/apk-parser | src/main/java/net/dongliu/apk/parser/AbstractApkFile.java | AbstractApkFile.transBinaryXml | public String transBinaryXml(String path) throws IOException {
byte[] data = getFileData(path);
if (data == null) {
return null;
}
parseResourceTable();
XmlTranslator xmlTranslator = new XmlTranslator();
transBinaryXml(data, xmlTranslator);
return xml... | java | public String transBinaryXml(String path) throws IOException {
byte[] data = getFileData(path);
if (data == null) {
return null;
}
parseResourceTable();
XmlTranslator xmlTranslator = new XmlTranslator();
transBinaryXml(data, xmlTranslator);
return xml... | [
"public",
"String",
"transBinaryXml",
"(",
"String",
"path",
")",
"throws",
"IOException",
"{",
"byte",
"[",
"]",
"data",
"=",
"getFileData",
"(",
"path",
")",
";",
"if",
"(",
"data",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"parseResourceTabl... | trans binary xml file to text xml file.
@param path the xml file path in apk file
@return the text. null if file not exists
@throws IOException | [
"trans",
"binary",
"xml",
"file",
"to",
"text",
"xml",
"file",
"."
] | 8993ddd52017b37b8f2e784ae0a15417d9ede932 | https://github.com/hsiafan/apk-parser/blob/8993ddd52017b37b8f2e784ae0a15417d9ede932/src/main/java/net/dongliu/apk/parser/AbstractApkFile.java#L222-L232 |
112,802 | hsiafan/apk-parser | src/main/java/net/dongliu/apk/parser/AbstractApkFile.java | AbstractApkFile.getAllIcons | public List<IconFace> getAllIcons() throws IOException {
List<IconPath> iconPaths = getIconPaths();
if (iconPaths.isEmpty()) {
return Collections.emptyList();
}
List<IconFace> iconFaces = new ArrayList<>(iconPaths.size());
for (IconPath iconPath : iconPaths) {
... | java | public List<IconFace> getAllIcons() throws IOException {
List<IconPath> iconPaths = getIconPaths();
if (iconPaths.isEmpty()) {
return Collections.emptyList();
}
List<IconFace> iconFaces = new ArrayList<>(iconPaths.size());
for (IconPath iconPath : iconPaths) {
... | [
"public",
"List",
"<",
"IconFace",
">",
"getAllIcons",
"(",
")",
"throws",
"IOException",
"{",
"List",
"<",
"IconPath",
">",
"iconPaths",
"=",
"getIconPaths",
"(",
")",
";",
"if",
"(",
"iconPaths",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"Collectio... | This method return icons specified in android manifest file, application.
The icons could be file icon, color icon, or adaptive icon, etc.
@return icon files. | [
"This",
"method",
"return",
"icons",
"specified",
"in",
"android",
"manifest",
"file",
"application",
".",
"The",
"icons",
"could",
"be",
"file",
"icon",
"color",
"icon",
"or",
"adaptive",
"icon",
"etc",
"."
] | 8993ddd52017b37b8f2e784ae0a15417d9ede932 | https://github.com/hsiafan/apk-parser/blob/8993ddd52017b37b8f2e784ae0a15417d9ede932/src/main/java/net/dongliu/apk/parser/AbstractApkFile.java#L250-L284 |
112,803 | hsiafan/apk-parser | src/main/java/net/dongliu/apk/parser/AbstractApkFile.java | AbstractApkFile.getIconFile | @Deprecated
public Icon getIconFile() throws IOException {
ApkMeta apkMeta = getApkMeta();
String iconPath = apkMeta.getIcon();
if (iconPath == null) {
return null;
}
return new Icon(iconPath, Densities.DEFAULT, getFileData(iconPath));
} | java | @Deprecated
public Icon getIconFile() throws IOException {
ApkMeta apkMeta = getApkMeta();
String iconPath = apkMeta.getIcon();
if (iconPath == null) {
return null;
}
return new Icon(iconPath, Densities.DEFAULT, getFileData(iconPath));
} | [
"@",
"Deprecated",
"public",
"Icon",
"getIconFile",
"(",
")",
"throws",
"IOException",
"{",
"ApkMeta",
"apkMeta",
"=",
"getApkMeta",
"(",
")",
";",
"String",
"iconPath",
"=",
"apkMeta",
".",
"getIcon",
"(",
")",
";",
"if",
"(",
"iconPath",
"==",
"null",
... | Get the default apk icon file.
@deprecated use {@link #getAllIcons()} | [
"Get",
"the",
"default",
"apk",
"icon",
"file",
"."
] | 8993ddd52017b37b8f2e784ae0a15417d9ede932 | https://github.com/hsiafan/apk-parser/blob/8993ddd52017b37b8f2e784ae0a15417d9ede932/src/main/java/net/dongliu/apk/parser/AbstractApkFile.java#L295-L303 |
112,804 | hsiafan/apk-parser | src/main/java/net/dongliu/apk/parser/AbstractApkFile.java | AbstractApkFile.getIconFiles | @Deprecated
public List<Icon> getIconFiles() throws IOException {
List<IconPath> iconPaths = getIconPaths();
List<Icon> icons = new ArrayList<>(iconPaths.size());
for (IconPath iconPath : iconPaths) {
Icon icon = newFileIcon(iconPath.getPath(), iconPath.getDensity());
... | java | @Deprecated
public List<Icon> getIconFiles() throws IOException {
List<IconPath> iconPaths = getIconPaths();
List<Icon> icons = new ArrayList<>(iconPaths.size());
for (IconPath iconPath : iconPaths) {
Icon icon = newFileIcon(iconPath.getPath(), iconPath.getDensity());
... | [
"@",
"Deprecated",
"public",
"List",
"<",
"Icon",
">",
"getIconFiles",
"(",
")",
"throws",
"IOException",
"{",
"List",
"<",
"IconPath",
">",
"iconPaths",
"=",
"getIconPaths",
"(",
")",
";",
"List",
"<",
"Icon",
">",
"icons",
"=",
"new",
"ArrayList",
"<>"... | Get all the icons, for different densities.
@deprecated using {@link #getAllIcons()} instead | [
"Get",
"all",
"the",
"icons",
"for",
"different",
"densities",
"."
] | 8993ddd52017b37b8f2e784ae0a15417d9ede932 | https://github.com/hsiafan/apk-parser/blob/8993ddd52017b37b8f2e784ae0a15417d9ede932/src/main/java/net/dongliu/apk/parser/AbstractApkFile.java#L321-L330 |
112,805 | hsiafan/apk-parser | src/main/java/net/dongliu/apk/parser/AbstractApkFile.java | AbstractApkFile.parseResourceTable | private void parseResourceTable() throws IOException {
if (resourceTableParsed) {
return;
}
resourceTableParsed = true;
byte[] data = getFileData(AndroidConstants.RESOURCE_FILE);
if (data == null) {
// if no resource entry has been found, we assume it is n... | java | private void parseResourceTable() throws IOException {
if (resourceTableParsed) {
return;
}
resourceTableParsed = true;
byte[] data = getFileData(AndroidConstants.RESOURCE_FILE);
if (data == null) {
// if no resource entry has been found, we assume it is n... | [
"private",
"void",
"parseResourceTable",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"resourceTableParsed",
")",
"{",
"return",
";",
"}",
"resourceTableParsed",
"=",
"true",
";",
"byte",
"[",
"]",
"data",
"=",
"getFileData",
"(",
"AndroidConstants",
"."... | parse resource table. | [
"parse",
"resource",
"table",
"."
] | 8993ddd52017b37b8f2e784ae0a15417d9ede932 | https://github.com/hsiafan/apk-parser/blob/8993ddd52017b37b8f2e784ae0a15417d9ede932/src/main/java/net/dongliu/apk/parser/AbstractApkFile.java#L376-L394 |
112,806 | hsiafan/apk-parser | src/main/java/net/dongliu/apk/parser/AbstractApkFile.java | AbstractApkFile.findApkSignBlock | protected ByteBuffer findApkSignBlock() throws IOException {
ByteBuffer buffer = fileData().order(ByteOrder.LITTLE_ENDIAN);
int len = buffer.limit();
// first find zip end of central directory entry
if (len < 22) {
// should not happen
throw new RuntimeException(... | java | protected ByteBuffer findApkSignBlock() throws IOException {
ByteBuffer buffer = fileData().order(ByteOrder.LITTLE_ENDIAN);
int len = buffer.limit();
// first find zip end of central directory entry
if (len < 22) {
// should not happen
throw new RuntimeException(... | [
"protected",
"ByteBuffer",
"findApkSignBlock",
"(",
")",
"throws",
"IOException",
"{",
"ByteBuffer",
"buffer",
"=",
"fileData",
"(",
")",
".",
"order",
"(",
"ByteOrder",
".",
"LITTLE_ENDIAN",
")",
";",
"int",
"len",
"=",
"buffer",
".",
"limit",
"(",
")",
"... | Create ApkSignBlockParser for this apk file.
@return null if do not have sign block | [
"Create",
"ApkSignBlockParser",
"for",
"this",
"apk",
"file",
"."
] | 8993ddd52017b37b8f2e784ae0a15417d9ede932 | https://github.com/hsiafan/apk-parser/blob/8993ddd52017b37b8f2e784ae0a15417d9ede932/src/main/java/net/dongliu/apk/parser/AbstractApkFile.java#L437-L484 |
112,807 | hsiafan/apk-parser | src/main/java/net/dongliu/apk/parser/parser/BinaryXmlParser.java | BinaryXmlParser.parse | public void parse() {
ChunkHeader firstChunkHeader = readChunkHeader();
if (firstChunkHeader == null) {
return;
}
switch (firstChunkHeader.getChunkType()) {
case ChunkType.XML:
case ChunkType.NULL:
break;
case ChunkType.STR... | java | public void parse() {
ChunkHeader firstChunkHeader = readChunkHeader();
if (firstChunkHeader == null) {
return;
}
switch (firstChunkHeader.getChunkType()) {
case ChunkType.XML:
case ChunkType.NULL:
break;
case ChunkType.STR... | [
"public",
"void",
"parse",
"(",
")",
"{",
"ChunkHeader",
"firstChunkHeader",
"=",
"readChunkHeader",
"(",
")",
";",
"if",
"(",
"firstChunkHeader",
"==",
"null",
")",
"{",
"return",
";",
"}",
"switch",
"(",
"firstChunkHeader",
".",
"getChunkType",
"(",
")",
... | Parse binary xml. | [
"Parse",
"binary",
"xml",
"."
] | 8993ddd52017b37b8f2e784ae0a15417d9ede932 | https://github.com/hsiafan/apk-parser/blob/8993ddd52017b37b8f2e784ae0a15417d9ede932/src/main/java/net/dongliu/apk/parser/parser/BinaryXmlParser.java#L52-L125 |
112,808 | hsiafan/apk-parser | src/main/java/net/dongliu/apk/parser/parser/BinaryXmlParser.java | BinaryXmlParser.getFinalValueAsString | private String getFinalValueAsString(String attributeName, String str) {
int value = Integer.parseInt(str);
switch (attributeName) {
case "screenOrientation":
return AttributeValues.getScreenOrientation(value);
case "configChanges":
return Attribut... | java | private String getFinalValueAsString(String attributeName, String str) {
int value = Integer.parseInt(str);
switch (attributeName) {
case "screenOrientation":
return AttributeValues.getScreenOrientation(value);
case "configChanges":
return Attribut... | [
"private",
"String",
"getFinalValueAsString",
"(",
"String",
"attributeName",
",",
"String",
"str",
")",
"{",
"int",
"value",
"=",
"Integer",
".",
"parseInt",
"(",
"str",
")",
";",
"switch",
"(",
"attributeName",
")",
"{",
"case",
"\"screenOrientation\"",
":",... | trans int attr value to string | [
"trans",
"int",
"attr",
"value",
"to",
"string"
] | 8993ddd52017b37b8f2e784ae0a15417d9ede932 | https://github.com/hsiafan/apk-parser/blob/8993ddd52017b37b8f2e784ae0a15417d9ede932/src/main/java/net/dongliu/apk/parser/parser/BinaryXmlParser.java#L205-L223 |
112,809 | hsiafan/apk-parser | src/main/java/net/dongliu/apk/parser/cert/asn1/Asn1BerParser.java | Asn1BerParser.parse | public static <T> T parse(ByteBuffer encoded, Class<T> containerClass)
throws Asn1DecodingException {
BerDataValue containerDataValue;
try {
containerDataValue = new ByteBufferBerDataValueReader(encoded).readDataValue();
} catch (BerDataValueFormatException e) {
... | java | public static <T> T parse(ByteBuffer encoded, Class<T> containerClass)
throws Asn1DecodingException {
BerDataValue containerDataValue;
try {
containerDataValue = new ByteBufferBerDataValueReader(encoded).readDataValue();
} catch (BerDataValueFormatException e) {
... | [
"public",
"static",
"<",
"T",
">",
"T",
"parse",
"(",
"ByteBuffer",
"encoded",
",",
"Class",
"<",
"T",
">",
"containerClass",
")",
"throws",
"Asn1DecodingException",
"{",
"BerDataValue",
"containerDataValue",
";",
"try",
"{",
"containerDataValue",
"=",
"new",
... | Returns the ASN.1 structure contained in the BER encoded input.
@param encoded encoded input. If the decoding operation succeeds, the position of this buffer
is advanced to the first position following the end of the consumed structure.
@param containerClass class describing the structure of the input. The clas... | [
"Returns",
"the",
"ASN",
".",
"1",
"structure",
"contained",
"in",
"the",
"BER",
"encoded",
"input",
"."
] | 8993ddd52017b37b8f2e784ae0a15417d9ede932 | https://github.com/hsiafan/apk-parser/blob/8993ddd52017b37b8f2e784ae0a15417d9ede932/src/main/java/net/dongliu/apk/parser/cert/asn1/Asn1BerParser.java#L57-L69 |
112,810 | hsiafan/apk-parser | src/main/java/net/dongliu/apk/parser/struct/xml/Attributes.java | Attributes.getString | @Nullable
public String getString(String name) {
Attribute attribute = get(name);
if (attribute == null) {
return null;
}
return attribute.getValue();
} | java | @Nullable
public String getString(String name) {
Attribute attribute = get(name);
if (attribute == null) {
return null;
}
return attribute.getValue();
} | [
"@",
"Nullable",
"public",
"String",
"getString",
"(",
"String",
"name",
")",
"{",
"Attribute",
"attribute",
"=",
"get",
"(",
"name",
")",
";",
"if",
"(",
"attribute",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"attribute",
".",
"get... | Get attribute with name, return value as string | [
"Get",
"attribute",
"with",
"name",
"return",
"value",
"as",
"string"
] | 8993ddd52017b37b8f2e784ae0a15417d9ede932 | https://github.com/hsiafan/apk-parser/blob/8993ddd52017b37b8f2e784ae0a15417d9ede932/src/main/java/net/dongliu/apk/parser/struct/xml/Attributes.java#L36-L43 |
112,811 | hsiafan/apk-parser | src/main/java/net/dongliu/apk/parser/ApkParsers.java | ApkParsers.getMetaInfo | public static ApkMeta getMetaInfo(String apkFilePath, Locale locale) throws IOException {
try (ApkFile apkFile = new ApkFile(apkFilePath)) {
apkFile.setPreferredLocale(locale);
return apkFile.getApkMeta();
}
} | java | public static ApkMeta getMetaInfo(String apkFilePath, Locale locale) throws IOException {
try (ApkFile apkFile = new ApkFile(apkFilePath)) {
apkFile.setPreferredLocale(locale);
return apkFile.getApkMeta();
}
} | [
"public",
"static",
"ApkMeta",
"getMetaInfo",
"(",
"String",
"apkFilePath",
",",
"Locale",
"locale",
")",
"throws",
"IOException",
"{",
"try",
"(",
"ApkFile",
"apkFile",
"=",
"new",
"ApkFile",
"(",
"apkFilePath",
")",
")",
"{",
"apkFile",
".",
"setPreferredLoc... | Get apk meta info for apk file, with locale
@throws IOException | [
"Get",
"apk",
"meta",
"info",
"for",
"apk",
"file",
"with",
"locale"
] | 8993ddd52017b37b8f2e784ae0a15417d9ede932 | https://github.com/hsiafan/apk-parser/blob/8993ddd52017b37b8f2e784ae0a15417d9ede932/src/main/java/net/dongliu/apk/parser/ApkParsers.java#L68-L73 |
112,812 | alexvasilkov/GestureViews | library/src/main/java/com/alexvasilkov/gestures/utils/MathUtils.java | MathUtils.restrict | public static float restrict(float value, float minValue, float maxValue) {
return Math.max(minValue, Math.min(value, maxValue));
} | java | public static float restrict(float value, float minValue, float maxValue) {
return Math.max(minValue, Math.min(value, maxValue));
} | [
"public",
"static",
"float",
"restrict",
"(",
"float",
"value",
",",
"float",
"minValue",
",",
"float",
"maxValue",
")",
"{",
"return",
"Math",
".",
"max",
"(",
"minValue",
",",
"Math",
".",
"min",
"(",
"value",
",",
"maxValue",
")",
")",
";",
"}"
] | Keeps value within provided bounds.
@param value Value to be restricted
@param minValue Min value
@param maxValue Max value
@return Restricted value | [
"Keeps",
"value",
"within",
"provided",
"bounds",
"."
] | f0a4c266e31dcad23bd0d9013531bc1c501b9c9f | https://github.com/alexvasilkov/GestureViews/blob/f0a4c266e31dcad23bd0d9013531bc1c501b9c9f/library/src/main/java/com/alexvasilkov/gestures/utils/MathUtils.java#L25-L27 |
112,813 | alexvasilkov/GestureViews | sample/src/main/java/com/alexvasilkov/gestures/sample/demo/DemoActivity.java | DemoActivity.initDecorMargins | private void initDecorMargins() {
if (DecorUtils.isCanHaveTransparentDecor()) {
Views.getParams(views.appBar).height += DecorUtils.getStatusBarHeight(this);
}
DecorUtils.paddingForStatusBar(views.toolbar, true);
DecorUtils.paddingForStatusBar(views.pagerToolbar, true);
... | java | private void initDecorMargins() {
if (DecorUtils.isCanHaveTransparentDecor()) {
Views.getParams(views.appBar).height += DecorUtils.getStatusBarHeight(this);
}
DecorUtils.paddingForStatusBar(views.toolbar, true);
DecorUtils.paddingForStatusBar(views.pagerToolbar, true);
... | [
"private",
"void",
"initDecorMargins",
"(",
")",
"{",
"if",
"(",
"DecorUtils",
".",
"isCanHaveTransparentDecor",
"(",
")",
")",
"{",
"Views",
".",
"getParams",
"(",
"views",
".",
"appBar",
")",
".",
"height",
"+=",
"DecorUtils",
".",
"getStatusBarHeight",
"(... | Adjusting margins and paddings to fit translucent decor. | [
"Adjusting",
"margins",
"and",
"paddings",
"to",
"fit",
"translucent",
"decor",
"."
] | f0a4c266e31dcad23bd0d9013531bc1c501b9c9f | https://github.com/alexvasilkov/GestureViews/blob/f0a4c266e31dcad23bd0d9013531bc1c501b9c9f/sample/src/main/java/com/alexvasilkov/gestures/sample/demo/DemoActivity.java#L114-L123 |
112,814 | alexvasilkov/GestureViews | sample/src/main/java/com/alexvasilkov/gestures/sample/demo/DemoActivity.java | DemoActivity.initTopImage | private void initTopImage() {
views.fullImageToolbar.setNavigationIcon(R.drawable.ic_arrow_back_white_24dp);
views.fullImageToolbar.setNavigationOnClickListener(view -> onBackPressed());
imageAnimator = GestureTransitions.from(views.appBarImage).into(views.fullImage);
// Setting up and... | java | private void initTopImage() {
views.fullImageToolbar.setNavigationIcon(R.drawable.ic_arrow_back_white_24dp);
views.fullImageToolbar.setNavigationOnClickListener(view -> onBackPressed());
imageAnimator = GestureTransitions.from(views.appBarImage).into(views.fullImage);
// Setting up and... | [
"private",
"void",
"initTopImage",
"(",
")",
"{",
"views",
".",
"fullImageToolbar",
".",
"setNavigationIcon",
"(",
"R",
".",
"drawable",
".",
"ic_arrow_back_white_24dp",
")",
";",
"views",
".",
"fullImageToolbar",
".",
"setNavigationOnClickListener",
"(",
"view",
... | Initializing top image expanding animation. | [
"Initializing",
"top",
"image",
"expanding",
"animation",
"."
] | f0a4c266e31dcad23bd0d9013531bc1c501b9c9f | https://github.com/alexvasilkov/GestureViews/blob/f0a4c266e31dcad23bd0d9013531bc1c501b9c9f/sample/src/main/java/com/alexvasilkov/gestures/sample/demo/DemoActivity.java#L128-L141 |
112,815 | alexvasilkov/GestureViews | sample/src/main/java/com/alexvasilkov/gestures/sample/demo/DemoActivity.java | DemoActivity.initPager | private void initPager() {
// Setting up pager adapter
pagerAdapter = new PhotoPagerAdapter(views.pager, getSettingsController());
pagerListener = new ViewPager.SimpleOnPageChangeListener() {
@Override
public void onPageSelected(int position) {
onPhotoInP... | java | private void initPager() {
// Setting up pager adapter
pagerAdapter = new PhotoPagerAdapter(views.pager, getSettingsController());
pagerListener = new ViewPager.SimpleOnPageChangeListener() {
@Override
public void onPageSelected(int position) {
onPhotoInP... | [
"private",
"void",
"initPager",
"(",
")",
"{",
"// Setting up pager adapter",
"pagerAdapter",
"=",
"new",
"PhotoPagerAdapter",
"(",
"views",
".",
"pager",
",",
"getSettingsController",
"(",
")",
")",
";",
"pagerListener",
"=",
"new",
"ViewPager",
".",
"SimpleOnPag... | Initializing pager and fullscreen mode. | [
"Initializing",
"pager",
"and",
"fullscreen",
"mode",
"."
] | f0a4c266e31dcad23bd0d9013531bc1c501b9c9f | https://github.com/alexvasilkov/GestureViews/blob/f0a4c266e31dcad23bd0d9013531bc1c501b9c9f/sample/src/main/java/com/alexvasilkov/gestures/sample/demo/DemoActivity.java#L188-L216 |
112,816 | alexvasilkov/GestureViews | sample/src/main/java/com/alexvasilkov/gestures/sample/demo/DemoActivity.java | DemoActivity.onPhotoInPagerSelected | private void onPhotoInPagerSelected(int position) {
Photo photo = pagerAdapter.getPhoto(position);
if (photo == null) {
views.pagerTitle.setText(null);
} else {
SpannableBuilder title = new SpannableBuilder(DemoActivity.this);
title.append(photo.getTitle()).a... | java | private void onPhotoInPagerSelected(int position) {
Photo photo = pagerAdapter.getPhoto(position);
if (photo == null) {
views.pagerTitle.setText(null);
} else {
SpannableBuilder title = new SpannableBuilder(DemoActivity.this);
title.append(photo.getTitle()).a... | [
"private",
"void",
"onPhotoInPagerSelected",
"(",
"int",
"position",
")",
"{",
"Photo",
"photo",
"=",
"pagerAdapter",
".",
"getPhoto",
"(",
"position",
")",
";",
"if",
"(",
"photo",
"==",
"null",
")",
"{",
"views",
".",
"pagerTitle",
".",
"setText",
"(",
... | Setting up photo title for current pager position. | [
"Setting",
"up",
"photo",
"title",
"for",
"current",
"pager",
"position",
"."
] | f0a4c266e31dcad23bd0d9013531bc1c501b9c9f | https://github.com/alexvasilkov/GestureViews/blob/f0a4c266e31dcad23bd0d9013531bc1c501b9c9f/sample/src/main/java/com/alexvasilkov/gestures/sample/demo/DemoActivity.java#L221-L234 |
112,817 | alexvasilkov/GestureViews | sample/src/main/java/com/alexvasilkov/gestures/sample/demo/DemoActivity.java | DemoActivity.initPagerAnimator | private void initPagerAnimator() {
final SimpleTracker gridTracker = new SimpleTracker() {
@Override
public View getViewAt(int pos) {
RecyclerView.ViewHolder holder = views.grid.findViewHolderForLayoutPosition(pos);
return holder == null ? null : PhotoList... | java | private void initPagerAnimator() {
final SimpleTracker gridTracker = new SimpleTracker() {
@Override
public View getViewAt(int pos) {
RecyclerView.ViewHolder holder = views.grid.findViewHolderForLayoutPosition(pos);
return holder == null ? null : PhotoList... | [
"private",
"void",
"initPagerAnimator",
"(",
")",
"{",
"final",
"SimpleTracker",
"gridTracker",
"=",
"new",
"SimpleTracker",
"(",
")",
"{",
"@",
"Override",
"public",
"View",
"getViewAt",
"(",
"int",
"pos",
")",
"{",
"RecyclerView",
".",
"ViewHolder",
"holder"... | Initializing grid-to-pager animation. | [
"Initializing",
"grid",
"-",
"to",
"-",
"pager",
"animation",
"."
] | f0a4c266e31dcad23bd0d9013531bc1c501b9c9f | https://github.com/alexvasilkov/GestureViews/blob/f0a4c266e31dcad23bd0d9013531bc1c501b9c9f/sample/src/main/java/com/alexvasilkov/gestures/sample/demo/DemoActivity.java#L239-L261 |
112,818 | alexvasilkov/GestureViews | sample/src/main/java/com/alexvasilkov/gestures/sample/demo/DemoActivity.java | DemoActivity.onPhotosLoaded | @Result(FlickrApi.LOAD_IMAGES_EVENT)
private void onPhotosLoaded(List<Photo> photos, boolean hasMore) {
// RecyclerView will continue scrolling when new items are added, we need to stop it.
// Seems like this buggy behavior was introduced in support library v26.0.x
final boolean onBottom =
... | java | @Result(FlickrApi.LOAD_IMAGES_EVENT)
private void onPhotosLoaded(List<Photo> photos, boolean hasMore) {
// RecyclerView will continue scrolling when new items are added, we need to stop it.
// Seems like this buggy behavior was introduced in support library v26.0.x
final boolean onBottom =
... | [
"@",
"Result",
"(",
"FlickrApi",
".",
"LOAD_IMAGES_EVENT",
")",
"private",
"void",
"onPhotosLoaded",
"(",
"List",
"<",
"Photo",
">",
"photos",
",",
"boolean",
"hasMore",
")",
"{",
"// RecyclerView will continue scrolling when new items are added, we need to stop it.",
"//... | Photos loading results callback. | [
"Photos",
"loading",
"results",
"callback",
"."
] | f0a4c266e31dcad23bd0d9013531bc1c501b9c9f | https://github.com/alexvasilkov/GestureViews/blob/f0a4c266e31dcad23bd0d9013531bc1c501b9c9f/sample/src/main/java/com/alexvasilkov/gestures/sample/demo/DemoActivity.java#L345-L375 |
112,819 | alexvasilkov/GestureViews | sample/src/main/java/com/alexvasilkov/gestures/sample/demo/DemoActivity.java | DemoActivity.onPhotosLoadFail | @Failure(FlickrApi.LOAD_IMAGES_EVENT)
private void onPhotosLoadFail() {
gridAdapter.onNextItemsError();
// Skipping state restoration
if (savedPagerPosition != NO_POSITION) {
// We can't show image right now, so we should return back to list
applyFullPagerState(0f, t... | java | @Failure(FlickrApi.LOAD_IMAGES_EVENT)
private void onPhotosLoadFail() {
gridAdapter.onNextItemsError();
// Skipping state restoration
if (savedPagerPosition != NO_POSITION) {
// We can't show image right now, so we should return back to list
applyFullPagerState(0f, t... | [
"@",
"Failure",
"(",
"FlickrApi",
".",
"LOAD_IMAGES_EVENT",
")",
"private",
"void",
"onPhotosLoadFail",
"(",
")",
"{",
"gridAdapter",
".",
"onNextItemsError",
"(",
")",
";",
"// Skipping state restoration",
"if",
"(",
"savedPagerPosition",
"!=",
"NO_POSITION",
")",
... | Photos loading failure callback. | [
"Photos",
"loading",
"failure",
"callback",
"."
] | f0a4c266e31dcad23bd0d9013531bc1c501b9c9f | https://github.com/alexvasilkov/GestureViews/blob/f0a4c266e31dcad23bd0d9013531bc1c501b9c9f/sample/src/main/java/com/alexvasilkov/gestures/sample/demo/DemoActivity.java#L380-L391 |
112,820 | alexvasilkov/GestureViews | library/src/main/java/com/alexvasilkov/gestures/animation/ViewPosition.java | ViewPosition.pack | public String pack() {
String viewStr = view.flattenToString();
String viewportStr = viewport.flattenToString();
String visibleStr = visible.flattenToString();
String imageStr = image.flattenToString();
return TextUtils.join(DELIMITER, new String[] {
viewStr, view... | java | public String pack() {
String viewStr = view.flattenToString();
String viewportStr = viewport.flattenToString();
String visibleStr = visible.flattenToString();
String imageStr = image.flattenToString();
return TextUtils.join(DELIMITER, new String[] {
viewStr, view... | [
"public",
"String",
"pack",
"(",
")",
"{",
"String",
"viewStr",
"=",
"view",
".",
"flattenToString",
"(",
")",
";",
"String",
"viewportStr",
"=",
"viewport",
".",
"flattenToString",
"(",
")",
";",
"String",
"visibleStr",
"=",
"visible",
".",
"flattenToString... | Packs this ViewPosition into string, which can be passed i.e. between activities.
@return Serialized position
@see #unpack(String) | [
"Packs",
"this",
"ViewPosition",
"into",
"string",
"which",
"can",
"be",
"passed",
"i",
".",
"e",
".",
"between",
"activities",
"."
] | f0a4c266e31dcad23bd0d9013531bc1c501b9c9f | https://github.com/alexvasilkov/GestureViews/blob/f0a4c266e31dcad23bd0d9013531bc1c501b9c9f/library/src/main/java/com/alexvasilkov/gestures/animation/ViewPosition.java#L181-L189 |
112,821 | alexvasilkov/GestureViews | library/src/main/java/com/alexvasilkov/gestures/internal/detectors/ScaleGestureDetectorFixed.java | ScaleGestureDetectorFixed.warmUpScaleDetector | private void warmUpScaleDetector() {
long time = System.currentTimeMillis();
MotionEvent event = MotionEvent.obtain(time, time, MotionEvent.ACTION_CANCEL, 0f, 0f, 0);
onTouchEvent(event);
event.recycle();
} | java | private void warmUpScaleDetector() {
long time = System.currentTimeMillis();
MotionEvent event = MotionEvent.obtain(time, time, MotionEvent.ACTION_CANCEL, 0f, 0f, 0);
onTouchEvent(event);
event.recycle();
} | [
"private",
"void",
"warmUpScaleDetector",
"(",
")",
"{",
"long",
"time",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"MotionEvent",
"event",
"=",
"MotionEvent",
".",
"obtain",
"(",
"time",
",",
"time",
",",
"MotionEvent",
".",
"ACTION_CANCEL",
",... | Scale detector is a little buggy when first time scale is occurred.
So we will feed it with fake motion event to warm it up. | [
"Scale",
"detector",
"is",
"a",
"little",
"buggy",
"when",
"first",
"time",
"scale",
"is",
"occurred",
".",
"So",
"we",
"will",
"feed",
"it",
"with",
"fake",
"motion",
"event",
"to",
"warm",
"it",
"up",
"."
] | f0a4c266e31dcad23bd0d9013531bc1c501b9c9f | https://github.com/alexvasilkov/GestureViews/blob/f0a4c266e31dcad23bd0d9013531bc1c501b9c9f/library/src/main/java/com/alexvasilkov/gestures/internal/detectors/ScaleGestureDetectorFixed.java#L28-L33 |
112,822 | alexvasilkov/GestureViews | library/src/main/java/com/alexvasilkov/gestures/utils/GravityUtils.java | GravityUtils.getMovementAreaPosition | public static void getMovementAreaPosition(Settings settings, Rect out) {
tmpRect1.set(0, 0, settings.getViewportW(), settings.getViewportH());
Gravity.apply(settings.getGravity(),
settings.getMovementAreaW(), settings.getMovementAreaH(), tmpRect1, out);
} | java | public static void getMovementAreaPosition(Settings settings, Rect out) {
tmpRect1.set(0, 0, settings.getViewportW(), settings.getViewportH());
Gravity.apply(settings.getGravity(),
settings.getMovementAreaW(), settings.getMovementAreaH(), tmpRect1, out);
} | [
"public",
"static",
"void",
"getMovementAreaPosition",
"(",
"Settings",
"settings",
",",
"Rect",
"out",
")",
"{",
"tmpRect1",
".",
"set",
"(",
"0",
",",
"0",
",",
"settings",
".",
"getViewportW",
"(",
")",
",",
"settings",
".",
"getViewportH",
"(",
")",
... | Calculates movement area position within viewport area with gravity applied.
@param settings Image settings
@param out Output rectangle | [
"Calculates",
"movement",
"area",
"position",
"within",
"viewport",
"area",
"with",
"gravity",
"applied",
"."
] | f0a4c266e31dcad23bd0d9013531bc1c501b9c9f | https://github.com/alexvasilkov/GestureViews/blob/f0a4c266e31dcad23bd0d9013531bc1c501b9c9f/library/src/main/java/com/alexvasilkov/gestures/utils/GravityUtils.java#L61-L65 |
112,823 | alexvasilkov/GestureViews | library/src/main/java/com/alexvasilkov/gestures/utils/GravityUtils.java | GravityUtils.getDefaultPivot | public static void getDefaultPivot(Settings settings, Point out) {
getMovementAreaPosition(settings, tmpRect2);
Gravity.apply(settings.getGravity(), 0, 0, tmpRect2, tmpRect1);
out.set(tmpRect1.left, tmpRect1.top);
} | java | public static void getDefaultPivot(Settings settings, Point out) {
getMovementAreaPosition(settings, tmpRect2);
Gravity.apply(settings.getGravity(), 0, 0, tmpRect2, tmpRect1);
out.set(tmpRect1.left, tmpRect1.top);
} | [
"public",
"static",
"void",
"getDefaultPivot",
"(",
"Settings",
"settings",
",",
"Point",
"out",
")",
"{",
"getMovementAreaPosition",
"(",
"settings",
",",
"tmpRect2",
")",
";",
"Gravity",
".",
"apply",
"(",
"settings",
".",
"getGravity",
"(",
")",
",",
"0",... | Calculates default pivot point for scale and rotation.
@param settings Image settings
@param out Output point | [
"Calculates",
"default",
"pivot",
"point",
"for",
"scale",
"and",
"rotation",
"."
] | f0a4c266e31dcad23bd0d9013531bc1c501b9c9f | https://github.com/alexvasilkov/GestureViews/blob/f0a4c266e31dcad23bd0d9013531bc1c501b9c9f/library/src/main/java/com/alexvasilkov/gestures/utils/GravityUtils.java#L73-L77 |
112,824 | alexvasilkov/GestureViews | library/src/main/java/com/alexvasilkov/gestures/utils/FloatScroller.java | FloatScroller.startScroll | public void startScroll(float startValue, float finalValue) {
finished = false;
startRtc = SystemClock.elapsedRealtime();
this.startValue = startValue;
this.finalValue = finalValue;
currValue = startValue;
} | java | public void startScroll(float startValue, float finalValue) {
finished = false;
startRtc = SystemClock.elapsedRealtime();
this.startValue = startValue;
this.finalValue = finalValue;
currValue = startValue;
} | [
"public",
"void",
"startScroll",
"(",
"float",
"startValue",
",",
"float",
"finalValue",
")",
"{",
"finished",
"=",
"false",
";",
"startRtc",
"=",
"SystemClock",
".",
"elapsedRealtime",
"(",
")",
";",
"this",
".",
"startValue",
"=",
"startValue",
";",
"this"... | Starts an animation from startValue to finalValue.
@param startValue Start value
@param finalValue Final value
@see android.widget.Scroller#startScroll(int, int, int, int) | [
"Starts",
"an",
"animation",
"from",
"startValue",
"to",
"finalValue",
"."
] | f0a4c266e31dcad23bd0d9013531bc1c501b9c9f | https://github.com/alexvasilkov/GestureViews/blob/f0a4c266e31dcad23bd0d9013531bc1c501b9c9f/library/src/main/java/com/alexvasilkov/gestures/utils/FloatScroller.java#L75-L82 |
112,825 | alexvasilkov/GestureViews | library/src/main/java/com/alexvasilkov/gestures/utils/FloatScroller.java | FloatScroller.computeScroll | public boolean computeScroll() {
if (finished) {
return false;
}
long elapsed = SystemClock.elapsedRealtime() - startRtc;
if (elapsed >= duration) {
finished = true;
currValue = finalValue;
return false;
}
float time = int... | java | public boolean computeScroll() {
if (finished) {
return false;
}
long elapsed = SystemClock.elapsedRealtime() - startRtc;
if (elapsed >= duration) {
finished = true;
currValue = finalValue;
return false;
}
float time = int... | [
"public",
"boolean",
"computeScroll",
"(",
")",
"{",
"if",
"(",
"finished",
")",
"{",
"return",
"false",
";",
"}",
"long",
"elapsed",
"=",
"SystemClock",
".",
"elapsedRealtime",
"(",
")",
"-",
"startRtc",
";",
"if",
"(",
"elapsed",
">=",
"duration",
")",... | Computes the current value, returning true if the animation is still active and false if the
animation has finished.
@return Computed scroll
@see android.widget.Scroller#computeScrollOffset() | [
"Computes",
"the",
"current",
"value",
"returning",
"true",
"if",
"the",
"animation",
"is",
"still",
"active",
"and",
"false",
"if",
"the",
"animation",
"has",
"finished",
"."
] | f0a4c266e31dcad23bd0d9013531bc1c501b9c9f | https://github.com/alexvasilkov/GestureViews/blob/f0a4c266e31dcad23bd0d9013531bc1c501b9c9f/library/src/main/java/com/alexvasilkov/gestures/utils/FloatScroller.java#L91-L106 |
112,826 | alexvasilkov/GestureViews | sample/src/main/java/com/alexvasilkov/gestures/sample/ex/utils/GlideHelper.java | GlideHelper.loadThumb | public static void loadThumb(ImageView image, int thumbId) {
// We don't want Glide to crop or resize our image
final RequestOptions options = new RequestOptions()
.diskCacheStrategy(DiskCacheStrategy.NONE)
.override(Target.SIZE_ORIGINAL)
.dontTransform();... | java | public static void loadThumb(ImageView image, int thumbId) {
// We don't want Glide to crop or resize our image
final RequestOptions options = new RequestOptions()
.diskCacheStrategy(DiskCacheStrategy.NONE)
.override(Target.SIZE_ORIGINAL)
.dontTransform();... | [
"public",
"static",
"void",
"loadThumb",
"(",
"ImageView",
"image",
",",
"int",
"thumbId",
")",
"{",
"// We don't want Glide to crop or resize our image",
"final",
"RequestOptions",
"options",
"=",
"new",
"RequestOptions",
"(",
")",
".",
"diskCacheStrategy",
"(",
"Dis... | Loads thumbnail. | [
"Loads",
"thumbnail",
"."
] | f0a4c266e31dcad23bd0d9013531bc1c501b9c9f | https://github.com/alexvasilkov/GestureViews/blob/f0a4c266e31dcad23bd0d9013531bc1c501b9c9f/sample/src/main/java/com/alexvasilkov/gestures/sample/ex/utils/GlideHelper.java#L19-L30 |
112,827 | alexvasilkov/GestureViews | sample/src/main/java/com/alexvasilkov/gestures/sample/ex/utils/GlideHelper.java | GlideHelper.loadFull | public static void loadFull(ImageView image, int imageId, int thumbId) {
// We don't want Glide to crop or resize our image
final RequestOptions options = new RequestOptions()
.diskCacheStrategy(DiskCacheStrategy.NONE)
.override(Target.SIZE_ORIGINAL)
.dont... | java | public static void loadFull(ImageView image, int imageId, int thumbId) {
// We don't want Glide to crop or resize our image
final RequestOptions options = new RequestOptions()
.diskCacheStrategy(DiskCacheStrategy.NONE)
.override(Target.SIZE_ORIGINAL)
.dont... | [
"public",
"static",
"void",
"loadFull",
"(",
"ImageView",
"image",
",",
"int",
"imageId",
",",
"int",
"thumbId",
")",
"{",
"// We don't want Glide to crop or resize our image",
"final",
"RequestOptions",
"options",
"=",
"new",
"RequestOptions",
"(",
")",
".",
"diskC... | Loads thumbnail and then replaces it with full image. | [
"Loads",
"thumbnail",
"and",
"then",
"replaces",
"it",
"with",
"full",
"image",
"."
] | f0a4c266e31dcad23bd0d9013531bc1c501b9c9f | https://github.com/alexvasilkov/GestureViews/blob/f0a4c266e31dcad23bd0d9013531bc1c501b9c9f/sample/src/main/java/com/alexvasilkov/gestures/sample/ex/utils/GlideHelper.java#L35-L51 |
112,828 | alexvasilkov/GestureViews | library/src/main/java/com/alexvasilkov/gestures/StateController.java | StateController.toggleMinMaxZoom | State toggleMinMaxZoom(State state, float pivotX, float pivotY) {
zoomBounds.set(state);
final float minZoom = zoomBounds.getFitZoom();
final float maxZoom = settings.getDoubleTapZoom() > 0f
? settings.getDoubleTapZoom() : zoomBounds.getMaxZoom();
final float middleZoom ... | java | State toggleMinMaxZoom(State state, float pivotX, float pivotY) {
zoomBounds.set(state);
final float minZoom = zoomBounds.getFitZoom();
final float maxZoom = settings.getDoubleTapZoom() > 0f
? settings.getDoubleTapZoom() : zoomBounds.getMaxZoom();
final float middleZoom ... | [
"State",
"toggleMinMaxZoom",
"(",
"State",
"state",
",",
"float",
"pivotX",
",",
"float",
"pivotY",
")",
"{",
"zoomBounds",
".",
"set",
"(",
"state",
")",
";",
"final",
"float",
"minZoom",
"=",
"zoomBounds",
".",
"getFitZoom",
"(",
")",
";",
"final",
"fl... | Maximizes zoom if it closer to min zoom or minimizes it if it closer to max zoom.
@param state Current state
@param pivotX Pivot's X coordinate
@param pivotY Pivot's Y coordinate
@return End state for toggle animation. | [
"Maximizes",
"zoom",
"if",
"it",
"closer",
"to",
"min",
"zoom",
"or",
"minimizes",
"it",
"if",
"it",
"closer",
"to",
"max",
"zoom",
"."
] | f0a4c266e31dcad23bd0d9013531bc1c501b9c9f | https://github.com/alexvasilkov/GestureViews/blob/f0a4c266e31dcad23bd0d9013531bc1c501b9c9f/library/src/main/java/com/alexvasilkov/gestures/StateController.java#L106-L118 |
112,829 | alexvasilkov/GestureViews | library/src/main/java/com/alexvasilkov/gestures/StateController.java | StateController.restrictStateBoundsCopy | @SuppressWarnings("SameParameterValue") // Using same method params as in restrictStateBounds
@Nullable
State restrictStateBoundsCopy(State state, State prevState, float pivotX, float pivotY,
boolean allowOverscroll, boolean allowOverzoom, boolean restrictRotation) {
tmpState.set(state);
... | java | @SuppressWarnings("SameParameterValue") // Using same method params as in restrictStateBounds
@Nullable
State restrictStateBoundsCopy(State state, State prevState, float pivotX, float pivotY,
boolean allowOverscroll, boolean allowOverzoom, boolean restrictRotation) {
tmpState.set(state);
... | [
"@",
"SuppressWarnings",
"(",
"\"SameParameterValue\"",
")",
"// Using same method params as in restrictStateBounds",
"@",
"Nullable",
"State",
"restrictStateBoundsCopy",
"(",
"State",
"state",
",",
"State",
"prevState",
",",
"float",
"pivotX",
",",
"float",
"pivotY",
","... | Restricts state's translation and zoom bounds.
@param state State to be restricted
@param prevState Previous state to calculate overscroll and overzoom (optional)
@param pivotX Pivot's X coordinate
@param pivotY Pivot's Y coordinate
@param allowOverscroll Whether overscroll is allowed
@param allowOverzoom Whether over... | [
"Restricts",
"state",
"s",
"translation",
"and",
"zoom",
"bounds",
"."
] | f0a4c266e31dcad23bd0d9013531bc1c501b9c9f | https://github.com/alexvasilkov/GestureViews/blob/f0a4c266e31dcad23bd0d9013531bc1c501b9c9f/library/src/main/java/com/alexvasilkov/gestures/StateController.java#L132-L140 |
112,830 | alexvasilkov/GestureViews | library/src/main/java/com/alexvasilkov/gestures/animation/ImageViewHelper.java | ImageViewHelper.applyScaleType | static void applyScaleType(ImageView.ScaleType type,
int dwidth, int dheight,
int vwidth, int vheight,
Matrix imageMatrix,
Matrix outMatrix) {
if (ImageView.ScaleType.CENTER == type) {
// Center bitmap in view, no scaling.
outMatrix.setTra... | java | static void applyScaleType(ImageView.ScaleType type,
int dwidth, int dheight,
int vwidth, int vheight,
Matrix imageMatrix,
Matrix outMatrix) {
if (ImageView.ScaleType.CENTER == type) {
// Center bitmap in view, no scaling.
outMatrix.setTra... | [
"static",
"void",
"applyScaleType",
"(",
"ImageView",
".",
"ScaleType",
"type",
",",
"int",
"dwidth",
",",
"int",
"dheight",
",",
"int",
"vwidth",
",",
"int",
"vheight",
",",
"Matrix",
"imageMatrix",
",",
"Matrix",
"outMatrix",
")",
"{",
"if",
"(",
"ImageV... | Helper method to calculate drawing matrix. Based on ImageView source code. | [
"Helper",
"method",
"to",
"calculate",
"drawing",
"matrix",
".",
"Based",
"on",
"ImageView",
"source",
"code",
"."
] | f0a4c266e31dcad23bd0d9013531bc1c501b9c9f | https://github.com/alexvasilkov/GestureViews/blob/f0a4c266e31dcad23bd0d9013531bc1c501b9c9f/library/src/main/java/com/alexvasilkov/gestures/animation/ImageViewHelper.java#L17-L70 |
112,831 | alexvasilkov/GestureViews | library/src/main/java/com/alexvasilkov/gestures/transition/ViewsTransitionAnimator.java | ViewsTransitionAnimator.swapAnimator | private void swapAnimator(ViewPositionAnimator old, ViewPositionAnimator next) {
final float position = old.getPosition();
final boolean isLeaving = old.isLeaving();
final boolean isAnimating = old.isAnimating();
if (GestureDebug.isDebugAnimator()) {
Log.d(TAG, "Swapping ani... | java | private void swapAnimator(ViewPositionAnimator old, ViewPositionAnimator next) {
final float position = old.getPosition();
final boolean isLeaving = old.isLeaving();
final boolean isAnimating = old.isAnimating();
if (GestureDebug.isDebugAnimator()) {
Log.d(TAG, "Swapping ani... | [
"private",
"void",
"swapAnimator",
"(",
"ViewPositionAnimator",
"old",
",",
"ViewPositionAnimator",
"next",
")",
"{",
"final",
"float",
"position",
"=",
"old",
".",
"getPosition",
"(",
")",
";",
"final",
"boolean",
"isLeaving",
"=",
"old",
".",
"isLeaving",
"(... | Replaces old animator with new one preserving state. | [
"Replaces",
"old",
"animator",
"with",
"new",
"one",
"preserving",
"state",
"."
] | f0a4c266e31dcad23bd0d9013531bc1c501b9c9f | https://github.com/alexvasilkov/GestureViews/blob/f0a4c266e31dcad23bd0d9013531bc1c501b9c9f/library/src/main/java/com/alexvasilkov/gestures/transition/ViewsTransitionAnimator.java#L279-L299 |
112,832 | alexvasilkov/GestureViews | library/src/main/java/com/alexvasilkov/gestures/internal/ZoomBounds.java | ZoomBounds.set | public ZoomBounds set(State state) {
float imageWidth = settings.getImageW();
float imageHeight = settings.getImageH();
float areaWidth = settings.getMovementAreaW();
float areaHeight = settings.getMovementAreaH();
if (imageWidth == 0f || imageHeight == 0f || areaWidth == 0f ||... | java | public ZoomBounds set(State state) {
float imageWidth = settings.getImageW();
float imageHeight = settings.getImageH();
float areaWidth = settings.getMovementAreaW();
float areaHeight = settings.getMovementAreaH();
if (imageWidth == 0f || imageHeight == 0f || areaWidth == 0f ||... | [
"public",
"ZoomBounds",
"set",
"(",
"State",
"state",
")",
"{",
"float",
"imageWidth",
"=",
"settings",
".",
"getImageW",
"(",
")",
";",
"float",
"imageHeight",
"=",
"settings",
".",
"getImageH",
"(",
")",
";",
"float",
"areaWidth",
"=",
"settings",
".",
... | Calculates min, max and "fit" zoom levels for given state and according to current settings.
@param state State for which to calculate zoom bounds.
@return Current zoom bounds object for calls chaining. | [
"Calculates",
"min",
"max",
"and",
"fit",
"zoom",
"levels",
"for",
"given",
"state",
"and",
"according",
"to",
"current",
"settings",
"."
] | f0a4c266e31dcad23bd0d9013531bc1c501b9c9f | https://github.com/alexvasilkov/GestureViews/blob/f0a4c266e31dcad23bd0d9013531bc1c501b9c9f/library/src/main/java/com/alexvasilkov/gestures/internal/ZoomBounds.java#L41-L129 |
112,833 | alexvasilkov/GestureViews | library/src/main/java/com/alexvasilkov/gestures/Settings.java | Settings.setMovementArea | public Settings setMovementArea(int width, int height) {
isMovementAreaSpecified = true;
movementAreaW = width;
movementAreaH = height;
return this;
} | java | public Settings setMovementArea(int width, int height) {
isMovementAreaSpecified = true;
movementAreaW = width;
movementAreaH = height;
return this;
} | [
"public",
"Settings",
"setMovementArea",
"(",
"int",
"width",
",",
"int",
"height",
")",
"{",
"isMovementAreaSpecified",
"=",
"true",
";",
"movementAreaW",
"=",
"width",
";",
"movementAreaH",
"=",
"height",
";",
"return",
"this",
";",
"}"
] | Setting movement area size. Viewport area will be used instead if no movement area is
specified.
@param width Movement area width
@param height Movement area height
@return Current settings object for calls chaining | [
"Setting",
"movement",
"area",
"size",
".",
"Viewport",
"area",
"will",
"be",
"used",
"instead",
"if",
"no",
"movement",
"area",
"is",
"specified",
"."
] | f0a4c266e31dcad23bd0d9013531bc1c501b9c9f | https://github.com/alexvasilkov/GestureViews/blob/f0a4c266e31dcad23bd0d9013531bc1c501b9c9f/library/src/main/java/com/alexvasilkov/gestures/Settings.java#L242-L247 |
112,834 | alexvasilkov/GestureViews | sample/src/main/java/com/alexvasilkov/gestures/sample/ex/image/animation/cross/FullImageActivity.java | FullImageActivity.runAfterImageDraw | private void runAfterImageDraw(final Runnable action) {
image.getViewTreeObserver().addOnPreDrawListener(new OnPreDrawListener() {
@Override
public boolean onPreDraw() {
image.getViewTreeObserver().removeOnPreDrawListener(this);
runOnNextFrame(action);
... | java | private void runAfterImageDraw(final Runnable action) {
image.getViewTreeObserver().addOnPreDrawListener(new OnPreDrawListener() {
@Override
public boolean onPreDraw() {
image.getViewTreeObserver().removeOnPreDrawListener(this);
runOnNextFrame(action);
... | [
"private",
"void",
"runAfterImageDraw",
"(",
"final",
"Runnable",
"action",
")",
"{",
"image",
".",
"getViewTreeObserver",
"(",
")",
".",
"addOnPreDrawListener",
"(",
"new",
"OnPreDrawListener",
"(",
")",
"{",
"@",
"Override",
"public",
"boolean",
"onPreDraw",
"... | Runs provided action after image is drawn for the first time. | [
"Runs",
"provided",
"action",
"after",
"image",
"is",
"drawn",
"for",
"the",
"first",
"time",
"."
] | f0a4c266e31dcad23bd0d9013531bc1c501b9c9f | https://github.com/alexvasilkov/GestureViews/blob/f0a4c266e31dcad23bd0d9013531bc1c501b9c9f/sample/src/main/java/com/alexvasilkov/gestures/sample/ex/image/animation/cross/FullImageActivity.java#L133-L143 |
112,835 | alexvasilkov/GestureViews | library/src/main/java/com/alexvasilkov/gestures/commons/CropAreaView.java | CropAreaView.update | public void update(boolean animate) {
final Settings settings =
imageView == null ? null : imageView.getController().getSettings();
if (settings != null && getWidth() > 0 && getHeight() > 0) {
// If aspect is specified we will automatically adjust movement area settings
... | java | public void update(boolean animate) {
final Settings settings =
imageView == null ? null : imageView.getController().getSettings();
if (settings != null && getWidth() > 0 && getHeight() > 0) {
// If aspect is specified we will automatically adjust movement area settings
... | [
"public",
"void",
"update",
"(",
"boolean",
"animate",
")",
"{",
"final",
"Settings",
"settings",
"=",
"imageView",
"==",
"null",
"?",
"null",
":",
"imageView",
".",
"getController",
"(",
")",
".",
"getSettings",
"(",
")",
";",
"if",
"(",
"settings",
"!=... | Applies area size, area position and corners rounding with optional animation.
@param animate Whether to animate changes when applying new cropping area settings | [
"Applies",
"area",
"size",
"area",
"position",
"and",
"corners",
"rounding",
"with",
"optional",
"animation",
"."
] | f0a4c266e31dcad23bd0d9013531bc1c501b9c9f | https://github.com/alexvasilkov/GestureViews/blob/f0a4c266e31dcad23bd0d9013531bc1c501b9c9f/library/src/main/java/com/alexvasilkov/gestures/commons/CropAreaView.java#L206-L252 |
112,836 | alexvasilkov/GestureViews | library/src/main/java/com/alexvasilkov/gestures/commons/CropAreaView.java | CropAreaView.drawRectHole | private void drawRectHole(Canvas canvas) {
paint.setStyle(Paint.Style.FILL);
paint.setColor(backColor);
// Top part
tmpRectF.set(0f, 0f, canvas.getWidth(), areaRect.top);
canvas.drawRect(tmpRectF, paint);
// Bottom part
tmpRectF.set(0f, areaRect.bottom, canvas.g... | java | private void drawRectHole(Canvas canvas) {
paint.setStyle(Paint.Style.FILL);
paint.setColor(backColor);
// Top part
tmpRectF.set(0f, 0f, canvas.getWidth(), areaRect.top);
canvas.drawRect(tmpRectF, paint);
// Bottom part
tmpRectF.set(0f, areaRect.bottom, canvas.g... | [
"private",
"void",
"drawRectHole",
"(",
"Canvas",
"canvas",
")",
"{",
"paint",
".",
"setStyle",
"(",
"Paint",
".",
"Style",
".",
"FILL",
")",
";",
"paint",
".",
"setColor",
"(",
"backColor",
")",
";",
"// Top part",
"tmpRectF",
".",
"set",
"(",
"0f",
"... | If cropping area is not rounded we can draw it much faster | [
"If",
"cropping",
"area",
"is",
"not",
"rounded",
"we",
"can",
"draw",
"it",
"much",
"faster"
] | f0a4c266e31dcad23bd0d9013531bc1c501b9c9f | https://github.com/alexvasilkov/GestureViews/blob/f0a4c266e31dcad23bd0d9013531bc1c501b9c9f/library/src/main/java/com/alexvasilkov/gestures/commons/CropAreaView.java#L311-L330 |
112,837 | alexvasilkov/GestureViews | library/src/main/java/com/alexvasilkov/gestures/commons/CropAreaView.java | CropAreaView.drawRoundedHole | @SuppressWarnings("deprecation")
private void drawRoundedHole(Canvas canvas) {
paint.setStyle(Paint.Style.FILL);
paint.setColor(backColor);
// Punching hole in background color requires offscreen drawing
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
canvas... | java | @SuppressWarnings("deprecation")
private void drawRoundedHole(Canvas canvas) {
paint.setStyle(Paint.Style.FILL);
paint.setColor(backColor);
// Punching hole in background color requires offscreen drawing
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
canvas... | [
"@",
"SuppressWarnings",
"(",
"\"deprecation\"",
")",
"private",
"void",
"drawRoundedHole",
"(",
"Canvas",
"canvas",
")",
"{",
"paint",
".",
"setStyle",
"(",
"Paint",
".",
"Style",
".",
"FILL",
")",
";",
"paint",
".",
"setColor",
"(",
"backColor",
")",
";"... | If cropping area is rounded we have to use off-screen buffer to punch a hole | [
"If",
"cropping",
"area",
"is",
"rounded",
"we",
"have",
"to",
"use",
"off",
"-",
"screen",
"buffer",
"to",
"punch",
"a",
"hole"
] | f0a4c266e31dcad23bd0d9013531bc1c501b9c9f | https://github.com/alexvasilkov/GestureViews/blob/f0a4c266e31dcad23bd0d9013531bc1c501b9c9f/library/src/main/java/com/alexvasilkov/gestures/commons/CropAreaView.java#L333-L352 |
112,838 | qcloudsms/qcloudsms_java | src/main/java/com/github/qcloudsms/SmsResultBase.java | SmsResultBase.parseToJson | public JSONObject parseToJson(HTTPResponse response) throws JSONException {
// Set raw response
this.response = response;
// May throw JSONException
return new JSONObject(response.body);
} | java | public JSONObject parseToJson(HTTPResponse response) throws JSONException {
// Set raw response
this.response = response;
// May throw JSONException
return new JSONObject(response.body);
} | [
"public",
"JSONObject",
"parseToJson",
"(",
"HTTPResponse",
"response",
")",
"throws",
"JSONException",
"{",
"// Set raw response",
"this",
".",
"response",
"=",
"response",
";",
"// May throw JSONException",
"return",
"new",
"JSONObject",
"(",
"response",
".",
"body"... | Parse HTTP response to JSONObject
@param response HTTP response
@return JSONObject
@throws JSONException json parse exception | [
"Parse",
"HTTP",
"response",
"to",
"JSONObject"
] | 920ba838b4fdafcbf684e71bb09846de72294eea | https://github.com/qcloudsms/qcloudsms_java/blob/920ba838b4fdafcbf684e71bb09846de72294eea/src/main/java/com/github/qcloudsms/SmsResultBase.java#L35-L40 |
112,839 | qcloudsms/qcloudsms_java | src/main/java/com/github/qcloudsms/SmsBase.java | SmsBase.handleError | public HTTPResponse handleError(HTTPResponse response) throws HTTPException {
if (response.statusCode < 200 || response.statusCode >= 300) {
throw new HTTPException(response.statusCode, response.reason);
}
return response;
} | java | public HTTPResponse handleError(HTTPResponse response) throws HTTPException {
if (response.statusCode < 200 || response.statusCode >= 300) {
throw new HTTPException(response.statusCode, response.reason);
}
return response;
} | [
"public",
"HTTPResponse",
"handleError",
"(",
"HTTPResponse",
"response",
")",
"throws",
"HTTPException",
"{",
"if",
"(",
"response",
".",
"statusCode",
"<",
"200",
"||",
"response",
".",
"statusCode",
">=",
"300",
")",
"{",
"throw",
"new",
"HTTPException",
"(... | Handle http status error
@param response raw http response
@return response raw http response
@throws HTTPException http status exception | [
"Handle",
"http",
"status",
"error"
] | 920ba838b4fdafcbf684e71bb09846de72294eea | https://github.com/qcloudsms/qcloudsms_java/blob/920ba838b4fdafcbf684e71bb09846de72294eea/src/main/java/com/github/qcloudsms/SmsBase.java#L34-L39 |
112,840 | JavaEden/Orchid | OrchidCore/src/main/java/com/eden/orchid/api/theme/assets/DefaultAssetManager.java | DefaultAssetManager.addAsset | @Override
public AssetPage addAsset(AssetPage asset, boolean renderImmediately) {
final String assetKey = asset.getReference().toString();
if(assets.containsKey(assetKey)) {
return assets.get(assetKey);
}
else {
assets.put(assetKey, asset);
if(rend... | java | @Override
public AssetPage addAsset(AssetPage asset, boolean renderImmediately) {
final String assetKey = asset.getReference().toString();
if(assets.containsKey(assetKey)) {
return assets.get(assetKey);
}
else {
assets.put(assetKey, asset);
if(rend... | [
"@",
"Override",
"public",
"AssetPage",
"addAsset",
"(",
"AssetPage",
"asset",
",",
"boolean",
"renderImmediately",
")",
"{",
"final",
"String",
"assetKey",
"=",
"asset",
".",
"getReference",
"(",
")",
".",
"toString",
"(",
")",
";",
"if",
"(",
"assets",
"... | this point. Inline resources are rendered directly into the page, and should not be rendered as a proper resource | [
"this",
"point",
".",
"Inline",
"resources",
"are",
"rendered",
"directly",
"into",
"the",
"page",
"and",
"should",
"not",
"be",
"rendered",
"as",
"a",
"proper",
"resource"
] | 47cde156fc3a7aea894cde41b7f76c503dad9811 | https://github.com/JavaEden/Orchid/blob/47cde156fc3a7aea894cde41b7f76c503dad9811/OrchidCore/src/main/java/com/eden/orchid/api/theme/assets/DefaultAssetManager.java#L52-L66 |
112,841 | JavaEden/Orchid | OrchidCore/src/main/java/com/eden/orchid/utilities/OrchidUtils.java | OrchidUtils.getRelativeFilename | public static String getRelativeFilename(String sourcePath, String baseDir) {
if (sourcePath.contains(baseDir)) {
int indexOf = sourcePath.indexOf(baseDir);
if (indexOf + baseDir.length() < sourcePath.length()) {
String relative = sourcePath.substring((indexOf + baseDir.... | java | public static String getRelativeFilename(String sourcePath, String baseDir) {
if (sourcePath.contains(baseDir)) {
int indexOf = sourcePath.indexOf(baseDir);
if (indexOf + baseDir.length() < sourcePath.length()) {
String relative = sourcePath.substring((indexOf + baseDir.... | [
"public",
"static",
"String",
"getRelativeFilename",
"(",
"String",
"sourcePath",
",",
"String",
"baseDir",
")",
"{",
"if",
"(",
"sourcePath",
".",
"contains",
"(",
"baseDir",
")",
")",
"{",
"int",
"indexOf",
"=",
"sourcePath",
".",
"indexOf",
"(",
"baseDir"... | Removes the base directory from a file path. Leading slashes are also removed from the resulting file path.
@param sourcePath The original file path
@param baseDir the base directory that should be removed from the original file path
@return the file path relative to the base directory | [
"Removes",
"the",
"base",
"directory",
"from",
"a",
"file",
"path",
".",
"Leading",
"slashes",
"are",
"also",
"removed",
"from",
"the",
"resulting",
"file",
"path",
"."
] | 47cde156fc3a7aea894cde41b7f76c503dad9811 | https://github.com/JavaEden/Orchid/blob/47cde156fc3a7aea894cde41b7f76c503dad9811/OrchidCore/src/main/java/com/eden/orchid/utilities/OrchidUtils.java#L79-L98 |
112,842 | JavaEden/Orchid | OrchidCore/src/main/java/com/eden/orchid/utilities/OrchidUtils.java | OrchidUtils.first | public static <T> T first(List<T> items) {
if(items != null && items.size() > 0) {
return items.get(0);
}
return null;
} | java | public static <T> T first(List<T> items) {
if(items != null && items.size() > 0) {
return items.get(0);
}
return null;
} | [
"public",
"static",
"<",
"T",
">",
"T",
"first",
"(",
"List",
"<",
"T",
">",
"items",
")",
"{",
"if",
"(",
"items",
"!=",
"null",
"&&",
"items",
".",
"size",
"(",
")",
">",
"0",
")",
"{",
"return",
"items",
".",
"get",
"(",
"0",
")",
";",
"... | Returns the first item in a list if possible, returning null otherwise.
@param items the list
@param <T> the type of items in the list
@return the first item in the list if the list is not null and not empty, null otherwise | [
"Returns",
"the",
"first",
"item",
"in",
"a",
"list",
"if",
"possible",
"returning",
"null",
"otherwise",
"."
] | 47cde156fc3a7aea894cde41b7f76c503dad9811 | https://github.com/JavaEden/Orchid/blob/47cde156fc3a7aea894cde41b7f76c503dad9811/OrchidCore/src/main/java/com/eden/orchid/utilities/OrchidUtils.java#L284-L290 |
112,843 | vakinge/jeesuite-libs | jeesuite-common/src/main/java/com/jeesuite/common/packagescan/InternalScanner.java | InternalScanner.findInPackage | List<String> findInPackage(Test test, String packageName) {
List<String> localClsssOrPkgs = new ArrayList<String>();
packageName = packageName.replace('.', '/');
Enumeration<URL> urls;
try {
urls = classloader.getResources(packageName);
// test for empty
... | java | List<String> findInPackage(Test test, String packageName) {
List<String> localClsssOrPkgs = new ArrayList<String>();
packageName = packageName.replace('.', '/');
Enumeration<URL> urls;
try {
urls = classloader.getResources(packageName);
// test for empty
... | [
"List",
"<",
"String",
">",
"findInPackage",
"(",
"Test",
"test",
",",
"String",
"packageName",
")",
"{",
"List",
"<",
"String",
">",
"localClsssOrPkgs",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"packageName",
"=",
"packageName",
".",
... | Scans for classes starting at the package provided and descending into subpackages.
Each class is offered up to the Test as it is discovered, and if the Test returns
true the class is retained.
@param test an instance of {@link Test} that will be used to filter classes
@param packageName the name of the package... | [
"Scans",
"for",
"classes",
"starting",
"at",
"the",
"package",
"provided",
"and",
"descending",
"into",
"subpackages",
".",
"Each",
"class",
"is",
"offered",
"up",
"to",
"the",
"Test",
"as",
"it",
"is",
"discovered",
"and",
"if",
"the",
"Test",
"returns",
... | c48fe2c7fbd294892cf4030dbec96e744dd3e386 | https://github.com/vakinge/jeesuite-libs/blob/c48fe2c7fbd294892cf4030dbec96e744dd3e386/jeesuite-common/src/main/java/com/jeesuite/common/packagescan/InternalScanner.java#L63-L83 |
112,844 | vakinge/jeesuite-libs | jeesuite-common/src/main/java/com/jeesuite/common/packagescan/PackageScanner.java | PackageScanner.scan | public Set<String> scan() {
// Initialize the pattern factories
initPatterns();
// Determine which packages to start from
List<String> roots = packagePatterns.getRoots();
InternalScanner scanner = new InternalScanner(getClassLoader());
// Kick off the scanning
S... | java | public Set<String> scan() {
// Initialize the pattern factories
initPatterns();
// Determine which packages to start from
List<String> roots = packagePatterns.getRoots();
InternalScanner scanner = new InternalScanner(getClassLoader());
// Kick off the scanning
S... | [
"public",
"Set",
"<",
"String",
">",
"scan",
"(",
")",
"{",
"// Initialize the pattern factories",
"initPatterns",
"(",
")",
";",
"// Determine which packages to start from",
"List",
"<",
"String",
">",
"roots",
"=",
"packagePatterns",
".",
"getRoots",
"(",
")",
"... | Scans the classloader as configured.
@return A list of discovered packages and their guessed version | [
"Scans",
"the",
"classloader",
"as",
"configured",
"."
] | c48fe2c7fbd294892cf4030dbec96e744dd3e386 | https://github.com/vakinge/jeesuite-libs/blob/c48fe2c7fbd294892cf4030dbec96e744dd3e386/jeesuite-common/src/main/java/com/jeesuite/common/packagescan/PackageScanner.java#L52-L64 |
112,845 | vakinge/jeesuite-libs | jeesuite-common2/src/main/java/com/jeesuite/common2/excel/convert/XLSX2CSV.java | XLSX2CSV.processSheet | public void processSheet(StylesTable styles, ReadOnlySharedStringsTable strings, SheetContentsHandler sheetHandler,
InputStream sheetInputStream) throws IOException, ParserConfigurationException, SAXException {
DataFormatter formatter = new DataFormatter();
InputSource sheetSource = new InputSource(sheetInputStr... | java | public void processSheet(StylesTable styles, ReadOnlySharedStringsTable strings, SheetContentsHandler sheetHandler,
InputStream sheetInputStream) throws IOException, ParserConfigurationException, SAXException {
DataFormatter formatter = new DataFormatter();
InputSource sheetSource = new InputSource(sheetInputStr... | [
"public",
"void",
"processSheet",
"(",
"StylesTable",
"styles",
",",
"ReadOnlySharedStringsTable",
"strings",
",",
"SheetContentsHandler",
"sheetHandler",
",",
"InputStream",
"sheetInputStream",
")",
"throws",
"IOException",
",",
"ParserConfigurationException",
",",
"SAXExc... | Parses and shows the content of one sheet using the specified styles and
shared-strings tables.
@param styles
@param strings
@param sheetInputStream | [
"Parses",
"and",
"shows",
"the",
"content",
"of",
"one",
"sheet",
"using",
"the",
"specified",
"styles",
"and",
"shared",
"-",
"strings",
"tables",
"."
] | c48fe2c7fbd294892cf4030dbec96e744dd3e386 | https://github.com/vakinge/jeesuite-libs/blob/c48fe2c7fbd294892cf4030dbec96e744dd3e386/jeesuite-common2/src/main/java/com/jeesuite/common2/excel/convert/XLSX2CSV.java#L164-L176 |
112,846 | vakinge/jeesuite-libs | jeesuite-common/src/main/java/com/jeesuite/common/util/JDBCUtils.java | JDBCUtils.query | @Deprecated
public static ResultSet query(String sql, Object... args) {
ResultSet result = null;
Connection con = getconnnection();
PreparedStatement ps = null;
try {
ps = con.prepareStatement(sql);
if (args != null) {
for (int i = 0; i < args.length; i++) {
ps.setObject((i + 1), args[i]);
}... | java | @Deprecated
public static ResultSet query(String sql, Object... args) {
ResultSet result = null;
Connection con = getconnnection();
PreparedStatement ps = null;
try {
ps = con.prepareStatement(sql);
if (args != null) {
for (int i = 0; i < args.length; i++) {
ps.setObject((i + 1), args[i]);
}... | [
"@",
"Deprecated",
"public",
"static",
"ResultSet",
"query",
"(",
"String",
"sql",
",",
"Object",
"...",
"args",
")",
"{",
"ResultSet",
"result",
"=",
"null",
";",
"Connection",
"con",
"=",
"getconnnection",
"(",
")",
";",
"PreparedStatement",
"ps",
"=",
"... | query, because need to manually close the resource, so not recommended
for use it
@param sql
@param args
@return ResultSet | [
"query",
"because",
"need",
"to",
"manually",
"close",
"the",
"resource",
"so",
"not",
"recommended",
"for",
"use",
"it"
] | c48fe2c7fbd294892cf4030dbec96e744dd3e386 | https://github.com/vakinge/jeesuite-libs/blob/c48fe2c7fbd294892cf4030dbec96e744dd3e386/jeesuite-common/src/main/java/com/jeesuite/common/util/JDBCUtils.java#L171-L188 |
112,847 | vakinge/jeesuite-libs | jeesuite-common2/src/main/java/com/jeesuite/common2/excel/convert/XLS2CSV.java | XLS2CSV.process | public List<String> process() throws IOException {
MissingRecordAwareHSSFListener listener = new MissingRecordAwareHSSFListener(this);
formatListener = new FormatTrackingHSSFListener(listener);
HSSFEventFactory factory = new HSSFEventFactory();
HSSFRequest request = new HSSFRequest();
if(outputFormulaValues... | java | public List<String> process() throws IOException {
MissingRecordAwareHSSFListener listener = new MissingRecordAwareHSSFListener(this);
formatListener = new FormatTrackingHSSFListener(listener);
HSSFEventFactory factory = new HSSFEventFactory();
HSSFRequest request = new HSSFRequest();
if(outputFormulaValues... | [
"public",
"List",
"<",
"String",
">",
"process",
"(",
")",
"throws",
"IOException",
"{",
"MissingRecordAwareHSSFListener",
"listener",
"=",
"new",
"MissingRecordAwareHSSFListener",
"(",
"this",
")",
";",
"formatListener",
"=",
"new",
"FormatTrackingHSSFListener",
"(",... | Initiates the processing of the XLS file to CSV | [
"Initiates",
"the",
"processing",
"of",
"the",
"XLS",
"file",
"to",
"CSV"
] | c48fe2c7fbd294892cf4030dbec96e744dd3e386 | https://github.com/vakinge/jeesuite-libs/blob/c48fe2c7fbd294892cf4030dbec96e744dd3e386/jeesuite-common2/src/main/java/com/jeesuite/common2/excel/convert/XLS2CSV.java#L103-L120 |
112,848 | sgroschupf/zkclient | src/main/java/org/I0Itec/zkclient/ZkClient.java | ZkClient.createPersistent | public void createPersistent(String path, boolean createParents) throws ZkInterruptedException, IllegalArgumentException, ZkException, RuntimeException {
createPersistent(path, createParents, ZooDefs.Ids.OPEN_ACL_UNSAFE);
} | java | public void createPersistent(String path, boolean createParents) throws ZkInterruptedException, IllegalArgumentException, ZkException, RuntimeException {
createPersistent(path, createParents, ZooDefs.Ids.OPEN_ACL_UNSAFE);
} | [
"public",
"void",
"createPersistent",
"(",
"String",
"path",
",",
"boolean",
"createParents",
")",
"throws",
"ZkInterruptedException",
",",
"IllegalArgumentException",
",",
"ZkException",
",",
"RuntimeException",
"{",
"createPersistent",
"(",
"path",
",",
"createParents... | Create a persistent node and set its ACLs.
@param path
@param createParents
if true all parent dirs are created as well and no {@link ZkNodeExistsException} is thrown in case the
path already exists
@throws ZkInterruptedException
if operation was interrupted, or a required reconnection got interrupted
@throws IllegalA... | [
"Create",
"a",
"persistent",
"node",
"and",
"set",
"its",
"ACLs",
"."
] | 03ccf12c70aca2f771bfcd94d44dc7c4d4a1495e | https://github.com/sgroschupf/zkclient/blob/03ccf12c70aca2f771bfcd94d44dc7c4d4a1495e/src/main/java/org/I0Itec/zkclient/ZkClient.java#L270-L272 |
112,849 | sgroschupf/zkclient | src/main/java/org/I0Itec/zkclient/ZkClient.java | ZkClient.setAcl | public void setAcl(final String path, final List<ACL> acl) throws ZkException {
if (path == null) {
throw new NullPointerException("Missing value for path");
}
if (acl == null || acl.size() == 0) {
throw new NullPointerException("Missing value for ACL");
}
... | java | public void setAcl(final String path, final List<ACL> acl) throws ZkException {
if (path == null) {
throw new NullPointerException("Missing value for path");
}
if (acl == null || acl.size() == 0) {
throw new NullPointerException("Missing value for ACL");
}
... | [
"public",
"void",
"setAcl",
"(",
"final",
"String",
"path",
",",
"final",
"List",
"<",
"ACL",
">",
"acl",
")",
"throws",
"ZkException",
"{",
"if",
"(",
"path",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"Missing value for path\"",... | Sets the acl on path
@param path
@param acl
List of ACL permissions to assign to the path.
@throws ZkException
if any ZooKeeper exception occurred
@throws RuntimeException
if any other exception occurs | [
"Sets",
"the",
"acl",
"on",
"path"
] | 03ccf12c70aca2f771bfcd94d44dc7c4d4a1495e | https://github.com/sgroschupf/zkclient/blob/03ccf12c70aca2f771bfcd94d44dc7c4d4a1495e/src/main/java/org/I0Itec/zkclient/ZkClient.java#L320-L342 |
112,850 | sgroschupf/zkclient | src/main/java/org/I0Itec/zkclient/ZkClient.java | ZkClient.getAcl | public Map.Entry<List<ACL>, Stat> getAcl(final String path) throws ZkException {
if (path == null) {
throw new NullPointerException("Missing value for path");
}
if (!exists(path)) {
throw new RuntimeException("trying to get acls on non existing node " + path);
}
... | java | public Map.Entry<List<ACL>, Stat> getAcl(final String path) throws ZkException {
if (path == null) {
throw new NullPointerException("Missing value for path");
}
if (!exists(path)) {
throw new RuntimeException("trying to get acls on non existing node " + path);
}
... | [
"public",
"Map",
".",
"Entry",
"<",
"List",
"<",
"ACL",
">",
",",
"Stat",
">",
"getAcl",
"(",
"final",
"String",
"path",
")",
"throws",
"ZkException",
"{",
"if",
"(",
"path",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"Missi... | Gets the acl on path
@param path
@return an entry instance with key = list of acls on node and value = stats.
@throws ZkException
if any ZooKeeper exception occurred
@throws RuntimeException
if any other exception occurs | [
"Gets",
"the",
"acl",
"on",
"path"
] | 03ccf12c70aca2f771bfcd94d44dc7c4d4a1495e | https://github.com/sgroschupf/zkclient/blob/03ccf12c70aca2f771bfcd94d44dc7c4d4a1495e/src/main/java/org/I0Itec/zkclient/ZkClient.java#L354-L369 |
112,851 | sgroschupf/zkclient | src/main/java/org/I0Itec/zkclient/ZkClient.java | ZkClient.createEphemeral | public void createEphemeral(final String path, final List<ACL> acl) throws ZkInterruptedException, IllegalArgumentException, ZkException, RuntimeException {
create(path, null, acl, CreateMode.EPHEMERAL);
} | java | public void createEphemeral(final String path, final List<ACL> acl) throws ZkInterruptedException, IllegalArgumentException, ZkException, RuntimeException {
create(path, null, acl, CreateMode.EPHEMERAL);
} | [
"public",
"void",
"createEphemeral",
"(",
"final",
"String",
"path",
",",
"final",
"List",
"<",
"ACL",
">",
"acl",
")",
"throws",
"ZkInterruptedException",
",",
"IllegalArgumentException",
",",
"ZkException",
",",
"RuntimeException",
"{",
"create",
"(",
"path",
... | Create an ephemeral node and set its ACL.
@param path
@param acl
@throws ZkInterruptedException
if operation was interrupted, or a required reconnection got interrupted
@throws IllegalArgumentException
if called from anything except the ZooKeeper event thread
@throws ZkException
if any ZooKeeper exception occurred
@th... | [
"Create",
"an",
"ephemeral",
"node",
"and",
"set",
"its",
"ACL",
"."
] | 03ccf12c70aca2f771bfcd94d44dc7c4d4a1495e | https://github.com/sgroschupf/zkclient/blob/03ccf12c70aca2f771bfcd94d44dc7c4d4a1495e/src/main/java/org/I0Itec/zkclient/ZkClient.java#L478-L480 |
112,852 | sgroschupf/zkclient | src/main/java/org/I0Itec/zkclient/ZkClient.java | ZkClient.create | public String create(final String path, Object data, final List<ACL> acl, final CreateMode mode) {
if (path == null) {
throw new NullPointerException("Missing value for path");
}
if (acl == null || acl.size() == 0) {
throw new NullPointerException("Missing value for ACL")... | java | public String create(final String path, Object data, final List<ACL> acl, final CreateMode mode) {
if (path == null) {
throw new NullPointerException("Missing value for path");
}
if (acl == null || acl.size() == 0) {
throw new NullPointerException("Missing value for ACL")... | [
"public",
"String",
"create",
"(",
"final",
"String",
"path",
",",
"Object",
"data",
",",
"final",
"List",
"<",
"ACL",
">",
"acl",
",",
"final",
"CreateMode",
"mode",
")",
"{",
"if",
"(",
"path",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerExce... | Create a node with ACL.
@param path
@param data
@param acl
@param mode
@return create node's path
@throws ZkInterruptedException
if operation was interrupted, or a required reconnection got interrupted
@throws IllegalArgumentException
if called from anything except the ZooKeeper event thread
@throws ZkException
if any... | [
"Create",
"a",
"node",
"with",
"ACL",
"."
] | 03ccf12c70aca2f771bfcd94d44dc7c4d4a1495e | https://github.com/sgroschupf/zkclient/blob/03ccf12c70aca2f771bfcd94d44dc7c4d4a1495e/src/main/java/org/I0Itec/zkclient/ZkClient.java#L519-L535 |
112,853 | sgroschupf/zkclient | src/main/java/org/I0Itec/zkclient/ZkClient.java | ZkClient.addAuthInfo | public void addAuthInfo(final String scheme, final byte[] auth) {
retryUntilConnected(new Callable<Object>() {
@Override
public Object call() throws Exception {
_connection.addAuthInfo(scheme, auth);
return null;
}
});
} | java | public void addAuthInfo(final String scheme, final byte[] auth) {
retryUntilConnected(new Callable<Object>() {
@Override
public Object call() throws Exception {
_connection.addAuthInfo(scheme, auth);
return null;
}
});
} | [
"public",
"void",
"addAuthInfo",
"(",
"final",
"String",
"scheme",
",",
"final",
"byte",
"[",
"]",
"auth",
")",
"{",
"retryUntilConnected",
"(",
"new",
"Callable",
"<",
"Object",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"Object",
"call",
"(",
")",
... | Add authentication information to the connection. This will be used to identify the user and check access to
nodes protected by ACLs
@param scheme
@param auth | [
"Add",
"authentication",
"information",
"to",
"the",
"connection",
".",
"This",
"will",
"be",
"used",
"to",
"identify",
"the",
"user",
"and",
"check",
"access",
"to",
"nodes",
"protected",
"by",
"ACLs"
] | 03ccf12c70aca2f771bfcd94d44dc7c4d4a1495e | https://github.com/sgroschupf/zkclient/blob/03ccf12c70aca2f771bfcd94d44dc7c4d4a1495e/src/main/java/org/I0Itec/zkclient/ZkClient.java#L1199-L1207 |
112,854 | sgroschupf/zkclient | src/main/java/org/I0Itec/zkclient/ZkClient.java | ZkClient.connect | public void connect(final long maxMsToWaitUntilConnected, Watcher watcher) throws ZkInterruptedException, ZkTimeoutException, IllegalStateException {
boolean started = false;
acquireEventLock();
try {
setShutdownTrigger(false);
_eventThread = new ZkEventThread(_connection... | java | public void connect(final long maxMsToWaitUntilConnected, Watcher watcher) throws ZkInterruptedException, ZkTimeoutException, IllegalStateException {
boolean started = false;
acquireEventLock();
try {
setShutdownTrigger(false);
_eventThread = new ZkEventThread(_connection... | [
"public",
"void",
"connect",
"(",
"final",
"long",
"maxMsToWaitUntilConnected",
",",
"Watcher",
"watcher",
")",
"throws",
"ZkInterruptedException",
",",
"ZkTimeoutException",
",",
"IllegalStateException",
"{",
"boolean",
"started",
"=",
"false",
";",
"acquireEventLock",... | Connect to ZooKeeper.
@param maxMsToWaitUntilConnected
@param watcher
@throws ZkInterruptedException
if the connection timed out due to thread interruption
@throws ZkTimeoutException
if the connection timed out
@throws IllegalStateException
if the connection timed out due to thread interruption | [
"Connect",
"to",
"ZooKeeper",
"."
] | 03ccf12c70aca2f771bfcd94d44dc7c4d4a1495e | https://github.com/sgroschupf/zkclient/blob/03ccf12c70aca2f771bfcd94d44dc7c4d4a1495e/src/main/java/org/I0Itec/zkclient/ZkClient.java#L1221-L1245 |
112,855 | sgroschupf/zkclient | src/main/java/org/I0Itec/zkclient/serialize/TcclAwareObjectIputStream.java | TcclAwareObjectIputStream.resolveProxyClass | protected Class resolveProxyClass(String[] interfaces) throws IOException, ClassNotFoundException {
ClassLoader cl = getClass().getClassLoader();
Class[] cinterfaces = new Class[interfaces.length];
for (int i = 0; i < interfaces.length; i++) {
try {
cinterfaces[i] = cl.loadClass(interfaces[i]);
} catch... | java | protected Class resolveProxyClass(String[] interfaces) throws IOException, ClassNotFoundException {
ClassLoader cl = getClass().getClassLoader();
Class[] cinterfaces = new Class[interfaces.length];
for (int i = 0; i < interfaces.length; i++) {
try {
cinterfaces[i] = cl.loadClass(interfaces[i]);
} catch... | [
"protected",
"Class",
"resolveProxyClass",
"(",
"String",
"[",
"]",
"interfaces",
")",
"throws",
"IOException",
",",
"ClassNotFoundException",
"{",
"ClassLoader",
"cl",
"=",
"getClass",
"(",
")",
".",
"getClassLoader",
"(",
")",
";",
"Class",
"[",
"]",
"cinter... | Returns a proxy class that implements the interfaces named in a proxy
class descriptor; subclasses may implement this method to read custom
data from the stream along with the descriptors for dynamic proxy
classes, allowing them to use an alternate loading mechanism for the
interfaces and the proxy class.
For each int... | [
"Returns",
"a",
"proxy",
"class",
"that",
"implements",
"the",
"interfaces",
"named",
"in",
"a",
"proxy",
"class",
"descriptor",
";",
"subclasses",
"may",
"implement",
"this",
"method",
"to",
"read",
"custom",
"data",
"from",
"the",
"stream",
"along",
"with",
... | 03ccf12c70aca2f771bfcd94d44dc7c4d4a1495e | https://github.com/sgroschupf/zkclient/blob/03ccf12c70aca2f771bfcd94d44dc7c4d4a1495e/src/main/java/org/I0Itec/zkclient/serialize/TcclAwareObjectIputStream.java#L60-L81 |
112,856 | orhanobut/hawk | hawk/src/main/java/com/orhanobut/hawk/Hawk.java | Hawk.init | public static HawkBuilder init(Context context) {
HawkUtils.checkNull("Context", context);
hawkFacade = null;
return new HawkBuilder(context);
} | java | public static HawkBuilder init(Context context) {
HawkUtils.checkNull("Context", context);
hawkFacade = null;
return new HawkBuilder(context);
} | [
"public",
"static",
"HawkBuilder",
"init",
"(",
"Context",
"context",
")",
"{",
"HawkUtils",
".",
"checkNull",
"(",
"\"Context\"",
",",
"context",
")",
";",
"hawkFacade",
"=",
"null",
";",
"return",
"new",
"HawkBuilder",
"(",
"context",
")",
";",
"}"
] | This will init the hawk without password protection.
@param context is used to instantiate context based objects.
ApplicationContext will be used | [
"This",
"will",
"init",
"the",
"hawk",
"without",
"password",
"protection",
"."
] | 0d22dde128b1ab5f50ac20d802db79cf402aa150 | https://github.com/orhanobut/hawk/blob/0d22dde128b1ab5f50ac20d802db79cf402aa150/hawk/src/main/java/com/orhanobut/hawk/Hawk.java#L22-L26 |
112,857 | orhanobut/hawk | hawk/src/main/java/com/orhanobut/hawk/Hawk.java | Hawk.put | public static <T> boolean put(String key, T value) {
return hawkFacade.put(key, value);
} | java | public static <T> boolean put(String key, T value) {
return hawkFacade.put(key, value);
} | [
"public",
"static",
"<",
"T",
">",
"boolean",
"put",
"(",
"String",
"key",
",",
"T",
"value",
")",
"{",
"return",
"hawkFacade",
".",
"put",
"(",
"key",
",",
"value",
")",
";",
"}"
] | Saves any type including any collection, primitive values or custom objects
@param key is required to differentiate the given data
@param value is the data that is going to be encrypted and persisted
@return true if the operation is successful. Any failure in any step will return false | [
"Saves",
"any",
"type",
"including",
"any",
"collection",
"primitive",
"values",
"or",
"custom",
"objects"
] | 0d22dde128b1ab5f50ac20d802db79cf402aa150 | https://github.com/orhanobut/hawk/blob/0d22dde128b1ab5f50ac20d802db79cf402aa150/hawk/src/main/java/com/orhanobut/hawk/Hawk.java#L39-L41 |
112,858 | orhanobut/hawk | hawk/src/main/java/com/orhanobut/hawk/Hawk.java | Hawk.get | public static <T> T get(String key, T defaultValue) {
return hawkFacade.get(key, defaultValue);
} | java | public static <T> T get(String key, T defaultValue) {
return hawkFacade.get(key, defaultValue);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"get",
"(",
"String",
"key",
",",
"T",
"defaultValue",
")",
"{",
"return",
"hawkFacade",
".",
"get",
"(",
"key",
",",
"defaultValue",
")",
";",
"}"
] | Gets the saved data, if it is null, default value will be returned
@param key is used to get the saved data
@param defaultValue will be return if the response is null
@return the saved object | [
"Gets",
"the",
"saved",
"data",
"if",
"it",
"is",
"null",
"default",
"value",
"will",
"be",
"returned"
] | 0d22dde128b1ab5f50ac20d802db79cf402aa150 | https://github.com/orhanobut/hawk/blob/0d22dde128b1ab5f50ac20d802db79cf402aa150/hawk/src/main/java/com/orhanobut/hawk/Hawk.java#L62-L64 |
112,859 | dmytrodanylyk/android-process-button | library/src/main/java/com/dd/processbutton/FlatButton.java | FlatButton.setBackgroundCompat | @SuppressWarnings("deprecation")
@SuppressLint("NewApi")
public void setBackgroundCompat(Drawable drawable) {
int pL = getPaddingLeft();
int pT = getPaddingTop();
int pR = getPaddingRight();
int pB = getPaddingBottom();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JE... | java | @SuppressWarnings("deprecation")
@SuppressLint("NewApi")
public void setBackgroundCompat(Drawable drawable) {
int pL = getPaddingLeft();
int pT = getPaddingTop();
int pR = getPaddingRight();
int pB = getPaddingBottom();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JE... | [
"@",
"SuppressWarnings",
"(",
"\"deprecation\"",
")",
"@",
"SuppressLint",
"(",
"\"NewApi\"",
")",
"public",
"void",
"setBackgroundCompat",
"(",
"Drawable",
"drawable",
")",
"{",
"int",
"pL",
"=",
"getPaddingLeft",
"(",
")",
";",
"int",
"pT",
"=",
"getPaddingT... | Set the View's background. Masks the API changes made in Jelly Bean.
@param drawable | [
"Set",
"the",
"View",
"s",
"background",
".",
"Masks",
"the",
"API",
"changes",
"made",
"in",
"Jelly",
"Bean",
"."
] | c08f374da24538b66f38b894b89d5d12f1df6d3d | https://github.com/dmytrodanylyk/android-process-button/blob/c08f374da24538b66f38b894b89d5d12f1df6d3d/library/src/main/java/com/dd/processbutton/FlatButton.java#L139-L153 |
112,860 | flavioarfaria/KenBurnsView | library/src/main/java/com/flaviofaria/kenburnsview/KenBurnsView.java | KenBurnsView.startNewTransition | private void startNewTransition() {
if (!hasBounds()) {
return; // Can't start transition if the drawable has no bounds.
}
mCurrentTrans = mTransGen.generateNextTransition(mDrawableRect, mViewportRect);
mElapsedTime = 0;
mLastFrameTime = System.currentTimeMillis();
... | java | private void startNewTransition() {
if (!hasBounds()) {
return; // Can't start transition if the drawable has no bounds.
}
mCurrentTrans = mTransGen.generateNextTransition(mDrawableRect, mViewportRect);
mElapsedTime = 0;
mLastFrameTime = System.currentTimeMillis();
... | [
"private",
"void",
"startNewTransition",
"(",
")",
"{",
"if",
"(",
"!",
"hasBounds",
"(",
")",
")",
"{",
"return",
";",
"// Can't start transition if the drawable has no bounds.",
"}",
"mCurrentTrans",
"=",
"mTransGen",
".",
"generateNextTransition",
"(",
"mDrawableRe... | Generates and starts a transition. | [
"Generates",
"and",
"starts",
"a",
"transition",
"."
] | 57a0fd7a586759c5c2e18fda51a3fcb09b48f388 | https://github.com/flavioarfaria/KenBurnsView/blob/57a0fd7a586759c5c2e18fda51a3fcb09b48f388/library/src/main/java/com/flaviofaria/kenburnsview/KenBurnsView.java#L208-L216 |
112,861 | flavioarfaria/KenBurnsView | library/src/main/java/com/flaviofaria/kenburnsview/KenBurnsView.java | KenBurnsView.restart | public void restart() {
int width = getWidth();
int height = getHeight();
if (width == 0 || height == 0) {
return; // Can't call restart() when view area is zero.
}
updateViewport(width, height);
updateDrawableBounds();
startNewTransition();
} | java | public void restart() {
int width = getWidth();
int height = getHeight();
if (width == 0 || height == 0) {
return; // Can't call restart() when view area is zero.
}
updateViewport(width, height);
updateDrawableBounds();
startNewTransition();
} | [
"public",
"void",
"restart",
"(",
")",
"{",
"int",
"width",
"=",
"getWidth",
"(",
")",
";",
"int",
"height",
"=",
"getHeight",
"(",
")",
";",
"if",
"(",
"width",
"==",
"0",
"||",
"height",
"==",
"0",
")",
"{",
"return",
";",
"// Can't call restart() ... | Creates a new transition and starts over. | [
"Creates",
"a",
"new",
"transition",
"and",
"starts",
"over",
"."
] | 57a0fd7a586759c5c2e18fda51a3fcb09b48f388 | https://github.com/flavioarfaria/KenBurnsView/blob/57a0fd7a586759c5c2e18fda51a3fcb09b48f388/library/src/main/java/com/flaviofaria/kenburnsview/KenBurnsView.java#L222-L234 |
112,862 | flavioarfaria/KenBurnsView | library/src/main/java/com/flaviofaria/kenburnsview/KenBurnsView.java | KenBurnsView.updateDrawableBounds | private void updateDrawableBounds() {
if (mDrawableRect == null) {
mDrawableRect = new RectF();
}
Drawable d = getDrawable();
if (d != null && d.getIntrinsicHeight() > 0 && d.getIntrinsicWidth() > 0) {
mDrawableRect.set(0, 0, d.getIntrinsicWidth(), d.getIntrinsicH... | java | private void updateDrawableBounds() {
if (mDrawableRect == null) {
mDrawableRect = new RectF();
}
Drawable d = getDrawable();
if (d != null && d.getIntrinsicHeight() > 0 && d.getIntrinsicWidth() > 0) {
mDrawableRect.set(0, 0, d.getIntrinsicWidth(), d.getIntrinsicH... | [
"private",
"void",
"updateDrawableBounds",
"(",
")",
"{",
"if",
"(",
"mDrawableRect",
"==",
"null",
")",
"{",
"mDrawableRect",
"=",
"new",
"RectF",
"(",
")",
";",
"}",
"Drawable",
"d",
"=",
"getDrawable",
"(",
")",
";",
"if",
"(",
"d",
"!=",
"null",
... | Updates the drawable bounds rect. This must be called every time the drawable
associated to this view changes. | [
"Updates",
"the",
"drawable",
"bounds",
"rect",
".",
"This",
"must",
"be",
"called",
"every",
"time",
"the",
"drawable",
"associated",
"to",
"this",
"view",
"changes",
"."
] | 57a0fd7a586759c5c2e18fda51a3fcb09b48f388 | https://github.com/flavioarfaria/KenBurnsView/blob/57a0fd7a586759c5c2e18fda51a3fcb09b48f388/library/src/main/java/com/flaviofaria/kenburnsview/KenBurnsView.java#L292-L300 |
112,863 | flavioarfaria/KenBurnsView | library/src/main/java/com/flaviofaria/kenburnsview/Transition.java | Transition.getInterpolatedRect | public RectF getInterpolatedRect(long elapsedTime) {
float elapsedTimeFraction = elapsedTime / (float) mDuration;
float interpolationProgress = Math.min(elapsedTimeFraction, 1);
float interpolation = mInterpolator.getInterpolation(interpolationProgress);
float currentWidth = mSrcRect.wid... | java | public RectF getInterpolatedRect(long elapsedTime) {
float elapsedTimeFraction = elapsedTime / (float) mDuration;
float interpolationProgress = Math.min(elapsedTimeFraction, 1);
float interpolation = mInterpolator.getInterpolation(interpolationProgress);
float currentWidth = mSrcRect.wid... | [
"public",
"RectF",
"getInterpolatedRect",
"(",
"long",
"elapsedTime",
")",
"{",
"float",
"elapsedTimeFraction",
"=",
"elapsedTime",
"/",
"(",
"float",
")",
"mDuration",
";",
"float",
"interpolationProgress",
"=",
"Math",
".",
"min",
"(",
"elapsedTimeFraction",
","... | Gets the current rect that represents the part of the image to take the scene
in the current frame.
@param elapsedTime the elapsed time since this transition started. | [
"Gets",
"the",
"current",
"rect",
"that",
"represents",
"the",
"part",
"of",
"the",
"image",
"to",
"take",
"the",
"scene",
"in",
"the",
"current",
"frame",
"."
] | 57a0fd7a586759c5c2e18fda51a3fcb09b48f388 | https://github.com/flavioarfaria/KenBurnsView/blob/57a0fd7a586759c5c2e18fda51a3fcb09b48f388/library/src/main/java/com/flaviofaria/kenburnsview/Transition.java#L91-L108 |
112,864 | signalapp/libsignal-service-java | java/src/main/java/org/whispersystems/signalservice/api/SignalServiceMessagePipe.java | SignalServiceMessagePipe.read | public SignalServiceEnvelope read(long timeout, TimeUnit unit)
throws InvalidVersionException, IOException, TimeoutException
{
return read(timeout, unit, new NullMessagePipeCallback());
} | java | public SignalServiceEnvelope read(long timeout, TimeUnit unit)
throws InvalidVersionException, IOException, TimeoutException
{
return read(timeout, unit, new NullMessagePipeCallback());
} | [
"public",
"SignalServiceEnvelope",
"read",
"(",
"long",
"timeout",
",",
"TimeUnit",
"unit",
")",
"throws",
"InvalidVersionException",
",",
"IOException",
",",
"TimeoutException",
"{",
"return",
"read",
"(",
"timeout",
",",
"unit",
",",
"new",
"NullMessagePipeCallbac... | A blocking call that reads a message off the pipe. When this
call returns, the message has been acknowledged and will not
be retransmitted.
@param timeout The timeout to wait for.
@param unit The timeout time unit.
@return A new message.
@throws InvalidVersionException
@throws IOException
@throws TimeoutException | [
"A",
"blocking",
"call",
"that",
"reads",
"a",
"message",
"off",
"the",
"pipe",
".",
"When",
"this",
"call",
"returns",
"the",
"message",
"has",
"been",
"acknowledged",
"and",
"will",
"not",
"be",
"retransmitted",
"."
] | 64f1150c5e4062d67d31c9a2a9c3a0237d022902 | https://github.com/signalapp/libsignal-service-java/blob/64f1150c5e4062d67d31c9a2a9c3a0237d022902/java/src/main/java/org/whispersystems/signalservice/api/SignalServiceMessagePipe.java#L70-L74 |
112,865 | signalapp/libsignal-service-java | java/src/main/java/org/whispersystems/signalservice/api/SignalServiceMessageSender.java | SignalServiceMessageSender.sendReceipt | public void sendReceipt(SignalServiceAddress recipient,
Optional<UnidentifiedAccessPair> unidentifiedAccess,
SignalServiceReceiptMessage message)
throws IOException, UntrustedIdentityException
{
byte[] content = createReceiptContent(message);
sendMess... | java | public void sendReceipt(SignalServiceAddress recipient,
Optional<UnidentifiedAccessPair> unidentifiedAccess,
SignalServiceReceiptMessage message)
throws IOException, UntrustedIdentityException
{
byte[] content = createReceiptContent(message);
sendMess... | [
"public",
"void",
"sendReceipt",
"(",
"SignalServiceAddress",
"recipient",
",",
"Optional",
"<",
"UnidentifiedAccessPair",
">",
"unidentifiedAccess",
",",
"SignalServiceReceiptMessage",
"message",
")",
"throws",
"IOException",
",",
"UntrustedIdentityException",
"{",
"byte",... | Send a read receipt for a received message.
@param recipient The sender of the received message you're acknowledging.
@param message The read receipt to deliver.
@throws IOException
@throws UntrustedIdentityException | [
"Send",
"a",
"read",
"receipt",
"for",
"a",
"received",
"message",
"."
] | 64f1150c5e4062d67d31c9a2a9c3a0237d022902 | https://github.com/signalapp/libsignal-service-java/blob/64f1150c5e4062d67d31c9a2a9c3a0237d022902/java/src/main/java/org/whispersystems/signalservice/api/SignalServiceMessageSender.java#L149-L157 |
112,866 | signalapp/libsignal-service-java | java/src/main/java/org/whispersystems/signalservice/api/SignalServiceMessageSender.java | SignalServiceMessageSender.sendTyping | public void sendTyping(SignalServiceAddress recipient,
Optional<UnidentifiedAccessPair> unidentifiedAccess,
SignalServiceTypingMessage message)
throws IOException, UntrustedIdentityException
{
byte[] content = createTypingContent(message);
sendMessage(r... | java | public void sendTyping(SignalServiceAddress recipient,
Optional<UnidentifiedAccessPair> unidentifiedAccess,
SignalServiceTypingMessage message)
throws IOException, UntrustedIdentityException
{
byte[] content = createTypingContent(message);
sendMessage(r... | [
"public",
"void",
"sendTyping",
"(",
"SignalServiceAddress",
"recipient",
",",
"Optional",
"<",
"UnidentifiedAccessPair",
">",
"unidentifiedAccess",
",",
"SignalServiceTypingMessage",
"message",
")",
"throws",
"IOException",
",",
"UntrustedIdentityException",
"{",
"byte",
... | Send a typing indicator.
@param recipient The destination
@param message The typing indicator to deliver
@throws IOException
@throws UntrustedIdentityException | [
"Send",
"a",
"typing",
"indicator",
"."
] | 64f1150c5e4062d67d31c9a2a9c3a0237d022902 | https://github.com/signalapp/libsignal-service-java/blob/64f1150c5e4062d67d31c9a2a9c3a0237d022902/java/src/main/java/org/whispersystems/signalservice/api/SignalServiceMessageSender.java#L167-L175 |
112,867 | signalapp/libsignal-service-java | java/src/main/java/org/whispersystems/signalservice/api/SignalServiceMessageSender.java | SignalServiceMessageSender.sendCallMessage | public void sendCallMessage(SignalServiceAddress recipient,
Optional<UnidentifiedAccessPair> unidentifiedAccess,
SignalServiceCallMessage message)
throws IOException, UntrustedIdentityException
{
byte[] content = createCallContent(message);
sen... | java | public void sendCallMessage(SignalServiceAddress recipient,
Optional<UnidentifiedAccessPair> unidentifiedAccess,
SignalServiceCallMessage message)
throws IOException, UntrustedIdentityException
{
byte[] content = createCallContent(message);
sen... | [
"public",
"void",
"sendCallMessage",
"(",
"SignalServiceAddress",
"recipient",
",",
"Optional",
"<",
"UnidentifiedAccessPair",
">",
"unidentifiedAccess",
",",
"SignalServiceCallMessage",
"message",
")",
"throws",
"IOException",
",",
"UntrustedIdentityException",
"{",
"byte"... | Send a call setup message to a single recipient.
@param recipient The message's destination.
@param message The call message.
@throws IOException | [
"Send",
"a",
"call",
"setup",
"message",
"to",
"a",
"single",
"recipient",
"."
] | 64f1150c5e4062d67d31c9a2a9c3a0237d022902 | https://github.com/signalapp/libsignal-service-java/blob/64f1150c5e4062d67d31c9a2a9c3a0237d022902/java/src/main/java/org/whispersystems/signalservice/api/SignalServiceMessageSender.java#L194-L201 |
112,868 | signalapp/libsignal-service-java | java/src/main/java/org/whispersystems/signalservice/api/SignalServiceMessageSender.java | SignalServiceMessageSender.sendMessage | public SendMessageResult sendMessage(SignalServiceAddress recipient,
Optional<UnidentifiedAccessPair> unidentifiedAccess,
SignalServiceDataMessage message)
throws UntrustedIdentityException, IOException
{
byte[... | java | public SendMessageResult sendMessage(SignalServiceAddress recipient,
Optional<UnidentifiedAccessPair> unidentifiedAccess,
SignalServiceDataMessage message)
throws UntrustedIdentityException, IOException
{
byte[... | [
"public",
"SendMessageResult",
"sendMessage",
"(",
"SignalServiceAddress",
"recipient",
",",
"Optional",
"<",
"UnidentifiedAccessPair",
">",
"unidentifiedAccess",
",",
"SignalServiceDataMessage",
"message",
")",
"throws",
"UntrustedIdentityException",
",",
"IOException",
"{",... | Send a message to a single recipient.
@param recipient The message's destination.
@param message The message.
@throws UntrustedIdentityException
@throws IOException | [
"Send",
"a",
"message",
"to",
"a",
"single",
"recipient",
"."
] | 64f1150c5e4062d67d31c9a2a9c3a0237d022902 | https://github.com/signalapp/libsignal-service-java/blob/64f1150c5e4062d67d31c9a2a9c3a0237d022902/java/src/main/java/org/whispersystems/signalservice/api/SignalServiceMessageSender.java#L211-L234 |
112,869 | signalapp/libsignal-service-java | java/src/main/java/org/whispersystems/signalservice/api/SignalServiceMessageSender.java | SignalServiceMessageSender.sendMessage | public List<SendMessageResult> sendMessage(List<SignalServiceAddress> recipients,
List<Optional<UnidentifiedAccessPair>> unidentifiedAccess,
SignalServiceDataMessage message)
throws IOException, Unt... | java | public List<SendMessageResult> sendMessage(List<SignalServiceAddress> recipients,
List<Optional<UnidentifiedAccessPair>> unidentifiedAccess,
SignalServiceDataMessage message)
throws IOException, Unt... | [
"public",
"List",
"<",
"SendMessageResult",
">",
"sendMessage",
"(",
"List",
"<",
"SignalServiceAddress",
">",
"recipients",
",",
"List",
"<",
"Optional",
"<",
"UnidentifiedAccessPair",
">",
">",
"unidentifiedAccess",
",",
"SignalServiceDataMessage",
"message",
")",
... | Send a message to a group.
@param recipients The group members.
@param message The group message.
@throws IOException | [
"Send",
"a",
"message",
"to",
"a",
"group",
"."
] | 64f1150c5e4062d67d31c9a2a9c3a0237d022902 | https://github.com/signalapp/libsignal-service-java/blob/64f1150c5e4062d67d31c9a2a9c3a0237d022902/java/src/main/java/org/whispersystems/signalservice/api/SignalServiceMessageSender.java#L243-L266 |
112,870 | signalapp/libsignal-service-java | java/src/main/java/org/whispersystems/signalservice/api/SignalServiceMessageReceiver.java | SignalServiceMessageReceiver.createMessagePipe | public SignalServiceMessagePipe createMessagePipe() {
WebSocketConnection webSocket = new WebSocketConnection(urls.getSignalServiceUrls()[0].getUrl(),
urls.getSignalServiceUrls()[0].getTrustStore(),
... | java | public SignalServiceMessagePipe createMessagePipe() {
WebSocketConnection webSocket = new WebSocketConnection(urls.getSignalServiceUrls()[0].getUrl(),
urls.getSignalServiceUrls()[0].getTrustStore(),
... | [
"public",
"SignalServiceMessagePipe",
"createMessagePipe",
"(",
")",
"{",
"WebSocketConnection",
"webSocket",
"=",
"new",
"WebSocketConnection",
"(",
"urls",
".",
"getSignalServiceUrls",
"(",
")",
"[",
"0",
"]",
".",
"getUrl",
"(",
")",
",",
"urls",
".",
"getSig... | Creates a pipe for receiving SignalService messages.
Callers must call {@link SignalServiceMessagePipe#shutdown()} when finished with the pipe.
@return A SignalServiceMessagePipe for receiving Signal Service messages. | [
"Creates",
"a",
"pipe",
"for",
"receiving",
"SignalService",
"messages",
"."
] | 64f1150c5e4062d67d31c9a2a9c3a0237d022902 | https://github.com/signalapp/libsignal-service-java/blob/64f1150c5e4062d67d31c9a2a9c3a0237d022902/java/src/main/java/org/whispersystems/signalservice/api/SignalServiceMessageReceiver.java#L146-L153 |
112,871 | signalapp/libsignal-service-java | java/src/main/java/org/whispersystems/signalservice/api/SignalServiceAccountManager.java | SignalServiceAccountManager.requestSmsVerificationCode | public void requestSmsVerificationCode(boolean androidSmsRetrieverSupported, Optional<String> captchaToken) throws IOException {
this.pushServiceSocket.requestSmsVerificationCode(androidSmsRetrieverSupported, captchaToken);
} | java | public void requestSmsVerificationCode(boolean androidSmsRetrieverSupported, Optional<String> captchaToken) throws IOException {
this.pushServiceSocket.requestSmsVerificationCode(androidSmsRetrieverSupported, captchaToken);
} | [
"public",
"void",
"requestSmsVerificationCode",
"(",
"boolean",
"androidSmsRetrieverSupported",
",",
"Optional",
"<",
"String",
">",
"captchaToken",
")",
"throws",
"IOException",
"{",
"this",
".",
"pushServiceSocket",
".",
"requestSmsVerificationCode",
"(",
"androidSmsRet... | Request an SMS verification code. On success, the server will send
an SMS verification code to this Signal user.
@throws IOException | [
"Request",
"an",
"SMS",
"verification",
"code",
".",
"On",
"success",
"the",
"server",
"will",
"send",
"an",
"SMS",
"verification",
"code",
"to",
"this",
"Signal",
"user",
"."
] | 64f1150c5e4062d67d31c9a2a9c3a0237d022902 | https://github.com/signalapp/libsignal-service-java/blob/64f1150c5e4062d67d31c9a2a9c3a0237d022902/java/src/main/java/org/whispersystems/signalservice/api/SignalServiceAccountManager.java#L137-L139 |
112,872 | signalapp/libsignal-service-java | java/src/main/java/org/whispersystems/signalservice/api/SignalServiceAccountManager.java | SignalServiceAccountManager.requestVoiceVerificationCode | public void requestVoiceVerificationCode(Locale locale, Optional<String> captchaToken) throws IOException {
this.pushServiceSocket.requestVoiceVerificationCode(locale, captchaToken);
} | java | public void requestVoiceVerificationCode(Locale locale, Optional<String> captchaToken) throws IOException {
this.pushServiceSocket.requestVoiceVerificationCode(locale, captchaToken);
} | [
"public",
"void",
"requestVoiceVerificationCode",
"(",
"Locale",
"locale",
",",
"Optional",
"<",
"String",
">",
"captchaToken",
")",
"throws",
"IOException",
"{",
"this",
".",
"pushServiceSocket",
".",
"requestVoiceVerificationCode",
"(",
"locale",
",",
"captchaToken"... | Request a Voice verification code. On success, the server will
make a voice call to this Signal user.
@throws IOException | [
"Request",
"a",
"Voice",
"verification",
"code",
".",
"On",
"success",
"the",
"server",
"will",
"make",
"a",
"voice",
"call",
"to",
"this",
"Signal",
"user",
"."
] | 64f1150c5e4062d67d31c9a2a9c3a0237d022902 | https://github.com/signalapp/libsignal-service-java/blob/64f1150c5e4062d67d31c9a2a9c3a0237d022902/java/src/main/java/org/whispersystems/signalservice/api/SignalServiceAccountManager.java#L147-L149 |
112,873 | signalapp/libsignal-service-java | java/src/main/java/org/whispersystems/signalservice/api/SignalServiceAccountManager.java | SignalServiceAccountManager.verifyAccountWithCode | public void verifyAccountWithCode(String verificationCode, String signalingKey, int signalProtocolRegistrationId, boolean fetchesMessages, String pin,
byte[] unidentifiedAccessKey, boolean unrestrictedUnidentifiedAccess)
throws IOException
{
this.pushServiceSocket.verifyA... | java | public void verifyAccountWithCode(String verificationCode, String signalingKey, int signalProtocolRegistrationId, boolean fetchesMessages, String pin,
byte[] unidentifiedAccessKey, boolean unrestrictedUnidentifiedAccess)
throws IOException
{
this.pushServiceSocket.verifyA... | [
"public",
"void",
"verifyAccountWithCode",
"(",
"String",
"verificationCode",
",",
"String",
"signalingKey",
",",
"int",
"signalProtocolRegistrationId",
",",
"boolean",
"fetchesMessages",
",",
"String",
"pin",
",",
"byte",
"[",
"]",
"unidentifiedAccessKey",
",",
"bool... | Verify a Signal Service account with a received SMS or voice verification code.
@param verificationCode The verification code received via SMS or Voice
(see {@link #requestSmsVerificationCode} and
{@link #requestVoiceVerificationCode}).
@param signalingKey 52 random bytes. A 32 byte AES key and a 20 byte Hmac256 key,... | [
"Verify",
"a",
"Signal",
"Service",
"account",
"with",
"a",
"received",
"SMS",
"or",
"voice",
"verification",
"code",
"."
] | 64f1150c5e4062d67d31c9a2a9c3a0237d022902 | https://github.com/signalapp/libsignal-service-java/blob/64f1150c5e4062d67d31c9a2a9c3a0237d022902/java/src/main/java/org/whispersystems/signalservice/api/SignalServiceAccountManager.java#L166-L175 |
112,874 | signalapp/libsignal-service-java | java/src/main/java/org/whispersystems/signalservice/api/SignalServiceAccountManager.java | SignalServiceAccountManager.setAccountAttributes | public void setAccountAttributes(String signalingKey, int signalProtocolRegistrationId, boolean fetchesMessages, String pin,
byte[] unidentifiedAccessKey, boolean unrestrictedUnidentifiedAccess)
throws IOException
{
this.pushServiceSocket.setAccountAttributes(signalingKey,... | java | public void setAccountAttributes(String signalingKey, int signalProtocolRegistrationId, boolean fetchesMessages, String pin,
byte[] unidentifiedAccessKey, boolean unrestrictedUnidentifiedAccess)
throws IOException
{
this.pushServiceSocket.setAccountAttributes(signalingKey,... | [
"public",
"void",
"setAccountAttributes",
"(",
"String",
"signalingKey",
",",
"int",
"signalProtocolRegistrationId",
",",
"boolean",
"fetchesMessages",
",",
"String",
"pin",
",",
"byte",
"[",
"]",
"unidentifiedAccessKey",
",",
"boolean",
"unrestrictedUnidentifiedAccess",
... | Refresh account attributes with server.
@param signalingKey 52 random bytes. A 32 byte AES key and a 20 byte Hmac256 key, concatenated.
@param signalProtocolRegistrationId A random 14-bit number that identifies this Signal install.
This value should remain consistent across registrations for the same
install, but pro... | [
"Refresh",
"account",
"attributes",
"with",
"server",
"."
] | 64f1150c5e4062d67d31c9a2a9c3a0237d022902 | https://github.com/signalapp/libsignal-service-java/blob/64f1150c5e4062d67d31c9a2a9c3a0237d022902/java/src/main/java/org/whispersystems/signalservice/api/SignalServiceAccountManager.java#L188-L194 |
112,875 | signalapp/libsignal-service-java | java/src/main/java/org/whispersystems/signalservice/api/SignalServiceAccountManager.java | SignalServiceAccountManager.setPreKeys | public void setPreKeys(IdentityKey identityKey, SignedPreKeyRecord signedPreKey, List<PreKeyRecord> oneTimePreKeys)
throws IOException
{
this.pushServiceSocket.registerPreKeys(identityKey, signedPreKey, oneTimePreKeys);
} | java | public void setPreKeys(IdentityKey identityKey, SignedPreKeyRecord signedPreKey, List<PreKeyRecord> oneTimePreKeys)
throws IOException
{
this.pushServiceSocket.registerPreKeys(identityKey, signedPreKey, oneTimePreKeys);
} | [
"public",
"void",
"setPreKeys",
"(",
"IdentityKey",
"identityKey",
",",
"SignedPreKeyRecord",
"signedPreKey",
",",
"List",
"<",
"PreKeyRecord",
">",
"oneTimePreKeys",
")",
"throws",
"IOException",
"{",
"this",
".",
"pushServiceSocket",
".",
"registerPreKeys",
"(",
"... | Register an identity key, signed prekey, and list of one time prekeys
with the server.
@param identityKey The client's long-term identity keypair.
@param signedPreKey The client's signed prekey.
@param oneTimePreKeys The client's list of one-time prekeys.
@throws IOException | [
"Register",
"an",
"identity",
"key",
"signed",
"prekey",
"and",
"list",
"of",
"one",
"time",
"prekeys",
"with",
"the",
"server",
"."
] | 64f1150c5e4062d67d31c9a2a9c3a0237d022902 | https://github.com/signalapp/libsignal-service-java/blob/64f1150c5e4062d67d31c9a2a9c3a0237d022902/java/src/main/java/org/whispersystems/signalservice/api/SignalServiceAccountManager.java#L206-L210 |
112,876 | signalapp/libsignal-service-java | java/src/main/java/org/whispersystems/signalservice/api/SignalServiceAccountManager.java | SignalServiceAccountManager.getContact | public Optional<ContactTokenDetails> getContact(String e164number) throws IOException {
String contactToken = createDirectoryServerToken(e164number, true);
ContactTokenDetails contactTokenDetails = this.pushServiceSocket.getContactTokenDetails(contactToken);
if (contactTokenDetails != n... | java | public Optional<ContactTokenDetails> getContact(String e164number) throws IOException {
String contactToken = createDirectoryServerToken(e164number, true);
ContactTokenDetails contactTokenDetails = this.pushServiceSocket.getContactTokenDetails(contactToken);
if (contactTokenDetails != n... | [
"public",
"Optional",
"<",
"ContactTokenDetails",
">",
"getContact",
"(",
"String",
"e164number",
")",
"throws",
"IOException",
"{",
"String",
"contactToken",
"=",
"createDirectoryServerToken",
"(",
"e164number",
",",
"true",
")",
";",
"ContactTokenDetails",
"contactT... | Checks whether a contact is currently registered with the server.
@param e164number The contact to check.
@return An optional ContactTokenDetails, present if registered, absent if not.
@throws IOException | [
"Checks",
"whether",
"a",
"contact",
"is",
"currently",
"registered",
"with",
"the",
"server",
"."
] | 64f1150c5e4062d67d31c9a2a9c3a0237d022902 | https://github.com/signalapp/libsignal-service-java/blob/64f1150c5e4062d67d31c9a2a9c3a0237d022902/java/src/main/java/org/whispersystems/signalservice/api/SignalServiceAccountManager.java#L245-L254 |
112,877 | signalapp/libsignal-service-java | java/src/main/java/org/whispersystems/signalservice/api/SignalServiceAccountManager.java | SignalServiceAccountManager.getContacts | public List<ContactTokenDetails> getContacts(Set<String> e164numbers)
throws IOException
{
Map<String, String> contactTokensMap = createDirectoryServerTokenMap(e164numbers);
List<ContactTokenDetails> activeTokens = this.pushServiceSocket.retrieveDirectory(contactTokensMap.keySet());
for (... | java | public List<ContactTokenDetails> getContacts(Set<String> e164numbers)
throws IOException
{
Map<String, String> contactTokensMap = createDirectoryServerTokenMap(e164numbers);
List<ContactTokenDetails> activeTokens = this.pushServiceSocket.retrieveDirectory(contactTokensMap.keySet());
for (... | [
"public",
"List",
"<",
"ContactTokenDetails",
">",
"getContacts",
"(",
"Set",
"<",
"String",
">",
"e164numbers",
")",
"throws",
"IOException",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"contactTokensMap",
"=",
"createDirectoryServerTokenMap",
"(",
"e164number... | Checks which contacts in a set are registered with the server.
@param e164numbers The contacts to check.
@return A list of ContactTokenDetails for the registered users.
@throws IOException | [
"Checks",
"which",
"contacts",
"in",
"a",
"set",
"are",
"registered",
"with",
"the",
"server",
"."
] | 64f1150c5e4062d67d31c9a2a9c3a0237d022902 | https://github.com/signalapp/libsignal-service-java/blob/64f1150c5e4062d67d31c9a2a9c3a0237d022902/java/src/main/java/org/whispersystems/signalservice/api/SignalServiceAccountManager.java#L263-L274 |
112,878 | kiegroup/droolsjbpm-integration | kie-server-parent/kie-server-controller-plugin/src/main/java/org/kie/server/gateway/KieServerGateway.java | KieServerGateway.getContainer | @SuppressWarnings("unchecked")
public KieContainerResource getContainer(String serverUrl, String container) {
// in case of container is not instantiated the response doesn't parse ServiceResponse
String response = client.target(serverUrl)
.path("containers")
.path(container... | java | @SuppressWarnings("unchecked")
public KieContainerResource getContainer(String serverUrl, String container) {
// in case of container is not instantiated the response doesn't parse ServiceResponse
String response = client.target(serverUrl)
.path("containers")
.path(container... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"KieContainerResource",
"getContainer",
"(",
"String",
"serverUrl",
",",
"String",
"container",
")",
"{",
"// in case of container is not instantiated the response doesn't parse ServiceResponse",
"String",
"response",
... | Verify the container status on remote process server.
@param serverUrl remote process server URL
@param container container id
@return KieContainerResource with status or null if the container in not instantiated | [
"Verify",
"the",
"container",
"status",
"on",
"remote",
"process",
"server",
"."
] | 6c26200ab03855dbb92b56ca0c6363cdec0eaf2c | https://github.com/kiegroup/droolsjbpm-integration/blob/6c26200ab03855dbb92b56ca0c6363cdec0eaf2c/kie-server-parent/kie-server-controller-plugin/src/main/java/org/kie/server/gateway/KieServerGateway.java#L57-L70 |
112,879 | kiegroup/droolsjbpm-integration | droolsjbpm-integration-examples/src/main/java/org/drools/examples/broker/events/EventFeeder.java | EventFeeder.feed | public void feed() {
if ( source.hasNext() ) {
Event< ? > event = source.getNext();
FeedContext context = new FeedContext( event );
FeedTrigger trigger = new FeedTrigger();
trigger.setNextFireTime( event.getDate() );
FeedJob job = new FeedJob( source,
... | java | public void feed() {
if ( source.hasNext() ) {
Event< ? > event = source.getNext();
FeedContext context = new FeedContext( event );
FeedTrigger trigger = new FeedTrigger();
trigger.setNextFireTime( event.getDate() );
FeedJob job = new FeedJob( source,
... | [
"public",
"void",
"feed",
"(",
")",
"{",
"if",
"(",
"source",
".",
"hasNext",
"(",
")",
")",
"{",
"Event",
"<",
"?",
">",
"event",
"=",
"source",
".",
"getNext",
"(",
")",
";",
"FeedContext",
"context",
"=",
"new",
"FeedContext",
"(",
"event",
")",... | For this simple demo, we are loading the
whole stream of events into the memory. | [
"For",
"this",
"simple",
"demo",
"we",
"are",
"loading",
"the",
"whole",
"stream",
"of",
"events",
"into",
"the",
"memory",
"."
] | 6c26200ab03855dbb92b56ca0c6363cdec0eaf2c | https://github.com/kiegroup/droolsjbpm-integration/blob/6c26200ab03855dbb92b56ca0c6363cdec0eaf2c/droolsjbpm-integration-examples/src/main/java/org/drools/examples/broker/events/EventFeeder.java#L50-L64 |
112,880 | kiegroup/droolsjbpm-integration | droolsjbpm-integration-examples/src/main/java/org/drools/examples/conway/ui/CellGridCanvas.java | CellGridCanvas.update | public void update(final Graphics g) {
final Dimension d = getSize();
if ( (this.offScreenImage == null) ) {
this.offScreenImage = createImage( d.width,
d.height );
}
paint( this.offScreenImage.getGraphics() );
g.drawImage( th... | java | public void update(final Graphics g) {
final Dimension d = getSize();
if ( (this.offScreenImage == null) ) {
this.offScreenImage = createImage( d.width,
d.height );
}
paint( this.offScreenImage.getGraphics() );
g.drawImage( th... | [
"public",
"void",
"update",
"(",
"final",
"Graphics",
"g",
")",
"{",
"final",
"Dimension",
"d",
"=",
"getSize",
"(",
")",
";",
"if",
"(",
"(",
"this",
".",
"offScreenImage",
"==",
"null",
")",
")",
"{",
"this",
".",
"offScreenImage",
"=",
"createImage"... | Use double buffering.
@see java.awt.Component#update(java.awt.Graphics) | [
"Use",
"double",
"buffering",
"."
] | 6c26200ab03855dbb92b56ca0c6363cdec0eaf2c | https://github.com/kiegroup/droolsjbpm-integration/blob/6c26200ab03855dbb92b56ca0c6363cdec0eaf2c/droolsjbpm-integration-examples/src/main/java/org/drools/examples/conway/ui/CellGridCanvas.java#L118-L129 |
112,881 | kiegroup/droolsjbpm-integration | droolsjbpm-integration-examples/src/main/java/org/drools/examples/conway/ui/CellGridCanvas.java | CellGridCanvas.paint | public void paint(final Graphics g) {
// Draw grid on background image, which is faster
final int numberOfColumns = this.cellGrid.getNumberOfColumns();
final int numberOfRows = this.cellGrid.getNumberOfRows();
if ( this.backgroundImage == null ) {
final Dimension d = getSize(... | java | public void paint(final Graphics g) {
// Draw grid on background image, which is faster
final int numberOfColumns = this.cellGrid.getNumberOfColumns();
final int numberOfRows = this.cellGrid.getNumberOfRows();
if ( this.backgroundImage == null ) {
final Dimension d = getSize(... | [
"public",
"void",
"paint",
"(",
"final",
"Graphics",
"g",
")",
"{",
"// Draw grid on background image, which is faster",
"final",
"int",
"numberOfColumns",
"=",
"this",
".",
"cellGrid",
".",
"getNumberOfColumns",
"(",
")",
";",
"final",
"int",
"numberOfRows",
"=",
... | Draw this generation.
@see java.awt.Component#paint(java.awt.Graphics) | [
"Draw",
"this",
"generation",
"."
] | 6c26200ab03855dbb92b56ca0c6363cdec0eaf2c | https://github.com/kiegroup/droolsjbpm-integration/blob/6c26200ab03855dbb92b56ca0c6363cdec0eaf2c/droolsjbpm-integration-examples/src/main/java/org/drools/examples/conway/ui/CellGridCanvas.java#L136-L188 |
112,882 | kiegroup/droolsjbpm-integration | droolsjbpm-integration-examples/src/main/java/org/drools/examples/conway/ui/CellGridCanvas.java | CellGridCanvas.getPreferredSize | public Dimension getPreferredSize() {
final int numberOfColumns = this.cellGrid.getNumberOfColumns();
final int numberOfRows = this.cellGrid.getNumberOfRows();
return new Dimension( this.cellSize * numberOfColumns,
this.cellSize * numberOfRows );
} | java | public Dimension getPreferredSize() {
final int numberOfColumns = this.cellGrid.getNumberOfColumns();
final int numberOfRows = this.cellGrid.getNumberOfRows();
return new Dimension( this.cellSize * numberOfColumns,
this.cellSize * numberOfRows );
} | [
"public",
"Dimension",
"getPreferredSize",
"(",
")",
"{",
"final",
"int",
"numberOfColumns",
"=",
"this",
".",
"cellGrid",
".",
"getNumberOfColumns",
"(",
")",
";",
"final",
"int",
"numberOfRows",
"=",
"this",
".",
"cellGrid",
".",
"getNumberOfRows",
"(",
")",... | This is the preferred size.
@see java.awt.Component#getPreferredSize() | [
"This",
"is",
"the",
"preferred",
"size",
"."
] | 6c26200ab03855dbb92b56ca0c6363cdec0eaf2c | https://github.com/kiegroup/droolsjbpm-integration/blob/6c26200ab03855dbb92b56ca0c6363cdec0eaf2c/droolsjbpm-integration-examples/src/main/java/org/drools/examples/conway/ui/CellGridCanvas.java#L195-L200 |
112,883 | kiegroup/droolsjbpm-integration | kie-spring/src/main/java/org/kie/spring/annotations/AnnotationsUtil.java | AnnotationsUtil.registerAnnotationConfigProcessors | public static Set<BeanDefinitionHolder> registerAnnotationConfigProcessors(
BeanDefinitionRegistry registry, Object source, ReleaseId releaseId) {
Set<BeanDefinitionHolder> beanDefs = new LinkedHashSet<BeanDefinitionHolder>(1);
if (!registry.containsBeanDefinition(KIE_ANNOTATION_PROCESSOR_... | java | public static Set<BeanDefinitionHolder> registerAnnotationConfigProcessors(
BeanDefinitionRegistry registry, Object source, ReleaseId releaseId) {
Set<BeanDefinitionHolder> beanDefs = new LinkedHashSet<BeanDefinitionHolder>(1);
if (!registry.containsBeanDefinition(KIE_ANNOTATION_PROCESSOR_... | [
"public",
"static",
"Set",
"<",
"BeanDefinitionHolder",
">",
"registerAnnotationConfigProcessors",
"(",
"BeanDefinitionRegistry",
"registry",
",",
"Object",
"source",
",",
"ReleaseId",
"releaseId",
")",
"{",
"Set",
"<",
"BeanDefinitionHolder",
">",
"beanDefs",
"=",
"n... | Register all relevant annotation post processors in the given registry.
@param registry the registry to operate on
@param source the configuration source element (already extracted)
that this registration was triggered from. May be <code>null</code>.
@return a Set of BeanDefinitionHolders, containing all bean definitio... | [
"Register",
"all",
"relevant",
"annotation",
"post",
"processors",
"in",
"the",
"given",
"registry",
"."
] | 6c26200ab03855dbb92b56ca0c6363cdec0eaf2c | https://github.com/kiegroup/droolsjbpm-integration/blob/6c26200ab03855dbb92b56ca0c6363cdec0eaf2c/kie-spring/src/main/java/org/kie/spring/annotations/AnnotationsUtil.java#L50-L63 |
112,884 | kiegroup/droolsjbpm-integration | kie-server-parent/kie-server-common/src/main/java/org/kie/server/common/rest/Base64Util.java | Base64Util.encode | public static String encode( String string ) {
byte[] bytes;
try {
bytes = string.getBytes(PREFERRED_ENCODING);
} catch( UnsupportedEncodingException uee ) {
bytes = string.getBytes();
}
return encodeBytes(bytes);
} | java | public static String encode( String string ) {
byte[] bytes;
try {
bytes = string.getBytes(PREFERRED_ENCODING);
} catch( UnsupportedEncodingException uee ) {
bytes = string.getBytes();
}
return encodeBytes(bytes);
} | [
"public",
"static",
"String",
"encode",
"(",
"String",
"string",
")",
"{",
"byte",
"[",
"]",
"bytes",
";",
"try",
"{",
"bytes",
"=",
"string",
".",
"getBytes",
"(",
"PREFERRED_ENCODING",
")",
";",
"}",
"catch",
"(",
"UnsupportedEncodingException",
"uee",
"... | Encode string as a byte array in Base64 annotation.
@param string
@return The Base64-encoded data as a string | [
"Encode",
"string",
"as",
"a",
"byte",
"array",
"in",
"Base64",
"annotation",
"."
] | 6c26200ab03855dbb92b56ca0c6363cdec0eaf2c | https://github.com/kiegroup/droolsjbpm-integration/blob/6c26200ab03855dbb92b56ca0c6363cdec0eaf2c/kie-server-parent/kie-server-common/src/main/java/org/kie/server/common/rest/Base64Util.java#L115-L123 |
112,885 | kiegroup/droolsjbpm-integration | kie-server-parent/kie-server-remote/kie-server-client/src/main/java/org/kie/server/client/impl/DMNServicesClientImpl.java | DMNServicesClientImpl.evaluateDecisions | public ServiceResponse<DMNResult> evaluateDecisions(String containerId, DMNContextKS payload) {
ServiceResponse<DMNResult> result = null;
if( config.isRest() ) {
Map<String, Object> valuesMap = new HashMap<String, Object>();
valuesMap.put(CONTAINER_ID, containerId... | java | public ServiceResponse<DMNResult> evaluateDecisions(String containerId, DMNContextKS payload) {
ServiceResponse<DMNResult> result = null;
if( config.isRest() ) {
Map<String, Object> valuesMap = new HashMap<String, Object>();
valuesMap.put(CONTAINER_ID, containerId... | [
"public",
"ServiceResponse",
"<",
"DMNResult",
">",
"evaluateDecisions",
"(",
"String",
"containerId",
",",
"DMNContextKS",
"payload",
")",
"{",
"ServiceResponse",
"<",
"DMNResult",
">",
"result",
"=",
"null",
";",
"if",
"(",
"config",
".",
"isRest",
"(",
")",... | DO NOT ADD @Override | [
"DO",
"NOT",
"ADD"
] | 6c26200ab03855dbb92b56ca0c6363cdec0eaf2c | https://github.com/kiegroup/droolsjbpm-integration/blob/6c26200ab03855dbb92b56ca0c6363cdec0eaf2c/kie-server-parent/kie-server-remote/kie-server-client/src/main/java/org/kie/server/client/impl/DMNServicesClientImpl.java#L125-L161 |
112,886 | kiegroup/droolsjbpm-integration | kie-server-parent/kie-server-common/src/main/java/org/kie/server/common/rest/variant/AcceptHeaders.java | AcceptHeaders.getMediaTypeQualityValues | public static Map<MediaType, QualityValue> getMediaTypeQualityValues(String header)
{
if (header == null)
return null;
header = header.trim();
if (header.length() == 0)
return null;
Map<MediaType, QualityValue> result = new LinkedHashMap<MediaType, QualityValue>();
in... | java | public static Map<MediaType, QualityValue> getMediaTypeQualityValues(String header)
{
if (header == null)
return null;
header = header.trim();
if (header.length() == 0)
return null;
Map<MediaType, QualityValue> result = new LinkedHashMap<MediaType, QualityValue>();
in... | [
"public",
"static",
"Map",
"<",
"MediaType",
",",
"QualityValue",
">",
"getMediaTypeQualityValues",
"(",
"String",
"header",
")",
"{",
"if",
"(",
"header",
"==",
"null",
")",
"return",
"null",
";",
"header",
"=",
"header",
".",
"trim",
"(",
")",
";",
"if... | Gets the media types from a comma-separated list.
@param header the header value.
@return the listed items in order of appearance or {@code null} if the header didn't contain any entries. | [
"Gets",
"the",
"media",
"types",
"from",
"a",
"comma",
"-",
"separated",
"list",
"."
] | 6c26200ab03855dbb92b56ca0c6363cdec0eaf2c | https://github.com/kiegroup/droolsjbpm-integration/blob/6c26200ab03855dbb92b56ca0c6363cdec0eaf2c/kie-server-parent/kie-server-common/src/main/java/org/kie/server/common/rest/variant/AcceptHeaders.java#L158-L206 |
112,887 | kiegroup/droolsjbpm-integration | kie-maven-plugin/src/main/java/org/kie/maven/plugin/BytecodeInjectReactive.java | BytecodeInjectReactive.addMethod | private static int addMethod(ConstPool cPool, CtMethod method) {
// addMethodrefInfo is a safe add, if constant already present it return the existing value without adding.
return cPool.addMethodrefInfo( cPool.getThisClassInfo(), method.getName(), method.getSignature() );
} | java | private static int addMethod(ConstPool cPool, CtMethod method) {
// addMethodrefInfo is a safe add, if constant already present it return the existing value without adding.
return cPool.addMethodrefInfo( cPool.getThisClassInfo(), method.getName(), method.getSignature() );
} | [
"private",
"static",
"int",
"addMethod",
"(",
"ConstPool",
"cPool",
",",
"CtMethod",
"method",
")",
"{",
"// addMethodrefInfo is a safe add, if constant already present it return the existing value without adding.",
"return",
"cPool",
".",
"addMethodrefInfo",
"(",
"cPool",
".",... | Add Method to ConstPool. If method was not in the ConstPool will add and return index, otherwise will return index of already existing entry of constpool | [
"Add",
"Method",
"to",
"ConstPool",
".",
"If",
"method",
"was",
"not",
"in",
"the",
"ConstPool",
"will",
"add",
"and",
"return",
"index",
"otherwise",
"will",
"return",
"index",
"of",
"already",
"existing",
"entry",
"of",
"constpool"
] | 6c26200ab03855dbb92b56ca0c6363cdec0eaf2c | https://github.com/kiegroup/droolsjbpm-integration/blob/6c26200ab03855dbb92b56ca0c6363cdec0eaf2c/kie-maven-plugin/src/main/java/org/kie/maven/plugin/BytecodeInjectReactive.java#L215-L218 |
112,888 | kiegroup/droolsjbpm-integration | kie-maven-plugin/src/main/java/org/kie/maven/plugin/BytecodeInjectReactive.java | BytecodeInjectReactive.isCtFieldACollection | private boolean isCtFieldACollection(CtField ctField) {
try {
return ctField.getType().equals(cp.get(Collection.class.getName()))
|| ctField.getType().equals(cp.get(List.class.getName()))
|| ctField.getType().equals(cp.get(Set.class.getName())) ;
} cat... | java | private boolean isCtFieldACollection(CtField ctField) {
try {
return ctField.getType().equals(cp.get(Collection.class.getName()))
|| ctField.getType().equals(cp.get(List.class.getName()))
|| ctField.getType().equals(cp.get(Set.class.getName())) ;
} cat... | [
"private",
"boolean",
"isCtFieldACollection",
"(",
"CtField",
"ctField",
")",
"{",
"try",
"{",
"return",
"ctField",
".",
"getType",
"(",
")",
".",
"equals",
"(",
"cp",
".",
"get",
"(",
"Collection",
".",
"class",
".",
"getName",
"(",
")",
")",
")",
"||... | Verify that CtField is exactly the java.util.Collection, java.util.List or java.util.Set, otherwise cannot instrument the class' field | [
"Verify",
"that",
"CtField",
"is",
"exactly",
"the",
"java",
".",
"util",
".",
"Collection",
"java",
".",
"util",
".",
"List",
"or",
"java",
".",
"util",
".",
"Set",
"otherwise",
"cannot",
"instrument",
"the",
"class",
"field"
] | 6c26200ab03855dbb92b56ca0c6363cdec0eaf2c | https://github.com/kiegroup/droolsjbpm-integration/blob/6c26200ab03855dbb92b56ca0c6363cdec0eaf2c/kie-maven-plugin/src/main/java/org/kie/maven/plugin/BytecodeInjectReactive.java#L309-L318 |
112,889 | kiegroup/droolsjbpm-integration | kie-server-parent/kie-server-remote/kie-server-client/src/main/java/org/kie/server/client/KieServicesFactory.java | KieServicesFactory.newRestConfiguration | public static KieServicesConfiguration newRestConfiguration( String serverUrl, String login, String password, long timeout ) {
return new KieServicesConfigurationImpl( serverUrl, login, password, timeout );
} | java | public static KieServicesConfiguration newRestConfiguration( String serverUrl, String login, String password, long timeout ) {
return new KieServicesConfigurationImpl( serverUrl, login, password, timeout );
} | [
"public",
"static",
"KieServicesConfiguration",
"newRestConfiguration",
"(",
"String",
"serverUrl",
",",
"String",
"login",
",",
"String",
"password",
",",
"long",
"timeout",
")",
"{",
"return",
"new",
"KieServicesConfigurationImpl",
"(",
"serverUrl",
",",
"login",
... | Creates a new configuration object for REST based service
@param serverUrl the URL to the server (e.g.: "http://localhost:8080")
@param login user login
@param password user password
@param timeout the maximum timeout in milliseconds
@return configuration instance | [
"Creates",
"a",
"new",
"configuration",
"object",
"for",
"REST",
"based",
"service"
] | 6c26200ab03855dbb92b56ca0c6363cdec0eaf2c | https://github.com/kiegroup/droolsjbpm-integration/blob/6c26200ab03855dbb92b56ca0c6363cdec0eaf2c/kie-server-parent/kie-server-remote/kie-server-client/src/main/java/org/kie/server/client/KieServicesFactory.java#L47-L49 |
112,890 | kiegroup/droolsjbpm-integration | drools-android/src/main/java/org/drools/android/MultiDexClassLoader.java | MultiDexClassLoader.writeClass | private String writeClass(String name, byte[] bytes) throws IOException {
name = name.replace('.','/');
File dexFile = new File(String.format("%s/%s.dex", getDexDir(), name));
if(dexFile.exists() && isReuseClassFiles()) {
if (log.isTraceEnabled())
log.trace(String.for... | java | private String writeClass(String name, byte[] bytes) throws IOException {
name = name.replace('.','/');
File dexFile = new File(String.format("%s/%s.dex", getDexDir(), name));
if(dexFile.exists() && isReuseClassFiles()) {
if (log.isTraceEnabled())
log.trace(String.for... | [
"private",
"String",
"writeClass",
"(",
"String",
"name",
",",
"byte",
"[",
"]",
"bytes",
")",
"throws",
"IOException",
"{",
"name",
"=",
"name",
".",
"replace",
"(",
"'",
"'",
",",
"'",
"'",
")",
";",
"File",
"dexFile",
"=",
"new",
"File",
"(",
"S... | Convert class to dex
@param name class name
@param bytes classfile bytes
@return the dex file name | [
"Convert",
"class",
"to",
"dex"
] | 6c26200ab03855dbb92b56ca0c6363cdec0eaf2c | https://github.com/kiegroup/droolsjbpm-integration/blob/6c26200ab03855dbb92b56ca0c6363cdec0eaf2c/drools-android/src/main/java/org/drools/android/MultiDexClassLoader.java#L83-L118 |
112,891 | kiegroup/droolsjbpm-integration | kie-server-parent/kie-server-services/kie-server-services-common/src/main/java/org/kie/server/services/impl/KieServerImpl.java | KieServerImpl.storeServerState | private void storeServerState(Consumer<KieServerState> kieServerStateConsumer) {
KieServerState currentState = repository.load(KieServerEnvironment.getServerId());
kieServerStateConsumer.accept(currentState);
repository.store(KieServerEnvironment.getServerId(), currentState);
} | java | private void storeServerState(Consumer<KieServerState> kieServerStateConsumer) {
KieServerState currentState = repository.load(KieServerEnvironment.getServerId());
kieServerStateConsumer.accept(currentState);
repository.store(KieServerEnvironment.getServerId(), currentState);
} | [
"private",
"void",
"storeServerState",
"(",
"Consumer",
"<",
"KieServerState",
">",
"kieServerStateConsumer",
")",
"{",
"KieServerState",
"currentState",
"=",
"repository",
".",
"load",
"(",
"KieServerEnvironment",
".",
"getServerId",
"(",
")",
")",
";",
"kieServerS... | Persists updated KieServer state.
@param kieServerStateConsumer | [
"Persists",
"updated",
"KieServer",
"state",
"."
] | 6c26200ab03855dbb92b56ca0c6363cdec0eaf2c | https://github.com/kiegroup/droolsjbpm-integration/blob/6c26200ab03855dbb92b56ca0c6363cdec0eaf2c/kie-server-parent/kie-server-services/kie-server-services-common/src/main/java/org/kie/server/services/impl/KieServerImpl.java#L695-L699 |
112,892 | kiegroup/droolsjbpm-integration | kie-maven-plugin/src/main/java/org/kie/maven/plugin/InjectReactiveMojo.java | InjectReactiveMojo.walkDir | private void walkDir(File dir) {
walkDir(
dir,
new FileFilter() {
@Override
public boolean accept(File pathname) {
return ( pathname.isFile() && pathname.getName().endsWith( ".class" ) );
}
... | java | private void walkDir(File dir) {
walkDir(
dir,
new FileFilter() {
@Override
public boolean accept(File pathname) {
return ( pathname.isFile() && pathname.getName().endsWith( ".class" ) );
}
... | [
"private",
"void",
"walkDir",
"(",
"File",
"dir",
")",
"{",
"walkDir",
"(",
"dir",
",",
"new",
"FileFilter",
"(",
")",
"{",
"@",
"Override",
"public",
"boolean",
"accept",
"(",
"File",
"pathname",
")",
"{",
"return",
"(",
"pathname",
".",
"isFile",
"("... | Expects a directory. | [
"Expects",
"a",
"directory",
"."
] | 6c26200ab03855dbb92b56ca0c6363cdec0eaf2c | https://github.com/kiegroup/droolsjbpm-integration/blob/6c26200ab03855dbb92b56ca0c6363cdec0eaf2c/kie-maven-plugin/src/main/java/org/kie/maven/plugin/InjectReactiveMojo.java#L284-L300 |
112,893 | kiegroup/droolsjbpm-integration | kie-server-parent/kie-server-services/kie-server-services-openshift/src/main/java/org/kie/server/services/openshift/impl/storage/cloud/KieServerStateOpenShiftRepository.java | KieServerStateOpenShiftRepository.isKieContainerUpdateDuringRolloutAllowed | public boolean isKieContainerUpdateDuringRolloutAllowed(ConfigMap cm, KieServerState newState) {
KieServerState state = (KieServerState) xs.fromXML(cm.getData().get(CFG_MAP_DATA_KEY));
for (KieContainerResource container : state.getContainers()) {
if (container.getStatus().equals(KieContaine... | java | public boolean isKieContainerUpdateDuringRolloutAllowed(ConfigMap cm, KieServerState newState) {
KieServerState state = (KieServerState) xs.fromXML(cm.getData().get(CFG_MAP_DATA_KEY));
for (KieContainerResource container : state.getContainers()) {
if (container.getStatus().equals(KieContaine... | [
"public",
"boolean",
"isKieContainerUpdateDuringRolloutAllowed",
"(",
"ConfigMap",
"cm",
",",
"KieServerState",
"newState",
")",
"{",
"KieServerState",
"state",
"=",
"(",
"KieServerState",
")",
"xs",
".",
"fromXML",
"(",
"cm",
".",
"getData",
"(",
")",
".",
"get... | Non KieServer process including workbench is allowed to update KieServerState
even during DC rollout, but ONLY under certain conditions.
@param cm
@param newState
@return | [
"Non",
"KieServer",
"process",
"including",
"workbench",
"is",
"allowed",
"to",
"update",
"KieServerState",
"even",
"during",
"DC",
"rollout",
"but",
"ONLY",
"under",
"certain",
"conditions",
"."
] | 6c26200ab03855dbb92b56ca0c6363cdec0eaf2c | https://github.com/kiegroup/droolsjbpm-integration/blob/6c26200ab03855dbb92b56ca0c6363cdec0eaf2c/kie-server-parent/kie-server-services/kie-server-services-openshift/src/main/java/org/kie/server/services/openshift/impl/storage/cloud/KieServerStateOpenShiftRepository.java#L283-L296 |
112,894 | kiegroup/droolsjbpm-integration | kie-osgi/kie-osgi-integration/src/main/java/org/kie/osgi/compiler/OsgiKieModule.java | OsgiKieModule.parseBundleId | public static String parseBundleId(String url) {
if (isOsgiBundleUrl(url)) {
int slashesIdx = url.indexOf("://");
return url.substring(slashesIdx + "://".length(), url.indexOf('.'));
} else {
return null;
}
} | java | public static String parseBundleId(String url) {
if (isOsgiBundleUrl(url)) {
int slashesIdx = url.indexOf("://");
return url.substring(slashesIdx + "://".length(), url.indexOf('.'));
} else {
return null;
}
} | [
"public",
"static",
"String",
"parseBundleId",
"(",
"String",
"url",
")",
"{",
"if",
"(",
"isOsgiBundleUrl",
"(",
"url",
")",
")",
"{",
"int",
"slashesIdx",
"=",
"url",
".",
"indexOf",
"(",
"\"://\"",
")",
";",
"return",
"url",
".",
"substring",
"(",
"... | Parses OSGi bundle ID from the provided URL. The URL may not be coming from OSGi,
in which case "null" is returned
@param url URL
@return parsed bundle ID, or null if the url is not OSGi bundle URL | [
"Parses",
"OSGi",
"bundle",
"ID",
"from",
"the",
"provided",
"URL",
".",
"The",
"URL",
"may",
"not",
"be",
"coming",
"from",
"OSGi",
"in",
"which",
"case",
"null",
"is",
"returned"
] | 6c26200ab03855dbb92b56ca0c6363cdec0eaf2c | https://github.com/kiegroup/droolsjbpm-integration/blob/6c26200ab03855dbb92b56ca0c6363cdec0eaf2c/kie-osgi/kie-osgi-integration/src/main/java/org/kie/osgi/compiler/OsgiKieModule.java#L154-L161 |
112,895 | kiegroup/droolsjbpm-integration | kie-osgi/kie-osgi-integration/src/main/java/org/kie/osgi/compiler/OsgiKieModule.java | OsgiKieModule.isOsgiBundleUrl | public static boolean isOsgiBundleUrl(String str) {
if (str == null) {
throw new NullPointerException("Specified string can not be null!");
}
return str.startsWith("bundle") && str.contains("://");
} | java | public static boolean isOsgiBundleUrl(String str) {
if (str == null) {
throw new NullPointerException("Specified string can not be null!");
}
return str.startsWith("bundle") && str.contains("://");
} | [
"public",
"static",
"boolean",
"isOsgiBundleUrl",
"(",
"String",
"str",
")",
"{",
"if",
"(",
"str",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"Specified string can not be null!\"",
")",
";",
"}",
"return",
"str",
".",
"startsWith",
... | Determines if the provided string is OSGi bundle URL or not.
@param str string to check
@return true if the string is OSGi bundle URL, otherwise false | [
"Determines",
"if",
"the",
"provided",
"string",
"is",
"OSGi",
"bundle",
"URL",
"or",
"not",
"."
] | 6c26200ab03855dbb92b56ca0c6363cdec0eaf2c | https://github.com/kiegroup/droolsjbpm-integration/blob/6c26200ab03855dbb92b56ca0c6363cdec0eaf2c/kie-osgi/kie-osgi-integration/src/main/java/org/kie/osgi/compiler/OsgiKieModule.java#L169-L174 |
112,896 | kiegroup/droolsjbpm-integration | kie-server-parent/kie-server-services/kie-server-services-jbpm/src/main/java/org/kie/server/services/jbpm/ExecutorServiceBase.java | ExecutorServiceBase.convertToRequestInfoList | protected RequestInfoInstanceList convertToRequestInfoList(List<RequestInfo> requests, boolean withErrors, boolean withData) {
RequestInfoInstance[] requestInfos = new RequestInfoInstance[requests.size()];
int index = 0;
for (RequestInfo request : requests) {
requestInfos[index] = ... | java | protected RequestInfoInstanceList convertToRequestInfoList(List<RequestInfo> requests, boolean withErrors, boolean withData) {
RequestInfoInstance[] requestInfos = new RequestInfoInstance[requests.size()];
int index = 0;
for (RequestInfo request : requests) {
requestInfos[index] = ... | [
"protected",
"RequestInfoInstanceList",
"convertToRequestInfoList",
"(",
"List",
"<",
"RequestInfo",
">",
"requests",
",",
"boolean",
"withErrors",
",",
"boolean",
"withData",
")",
"{",
"RequestInfoInstance",
"[",
"]",
"requestInfos",
"=",
"new",
"RequestInfoInstance",
... | utility methods for conversion | [
"utility",
"methods",
"for",
"conversion"
] | 6c26200ab03855dbb92b56ca0c6363cdec0eaf2c | https://github.com/kiegroup/droolsjbpm-integration/blob/6c26200ab03855dbb92b56ca0c6363cdec0eaf2c/kie-server-parent/kie-server-services/kie-server-services-jbpm/src/main/java/org/kie/server/services/jbpm/ExecutorServiceBase.java#L214-L225 |
112,897 | kiegroup/droolsjbpm-integration | kie-server-parent/kie-server-common/src/main/java/org/kie/server/common/rest/KieServerHttpRequest.java | KieServerHttpRequest.basicAuthorization | public KieServerHttpRequest basicAuthorization(final String name, final String password ) {
return header(AUTHORIZATION, "Basic " + org.kie.server.common.rest.Base64Util.encode(name + ':' + password));
} | java | public KieServerHttpRequest basicAuthorization(final String name, final String password ) {
return header(AUTHORIZATION, "Basic " + org.kie.server.common.rest.Base64Util.encode(name + ':' + password));
} | [
"public",
"KieServerHttpRequest",
"basicAuthorization",
"(",
"final",
"String",
"name",
",",
"final",
"String",
"password",
")",
"{",
"return",
"header",
"(",
"AUTHORIZATION",
",",
"\"Basic \"",
"+",
"org",
".",
"kie",
".",
"server",
".",
"common",
".",
"rest"... | Set the 'Authorization' header to given values in Basic authentication
format
@param name
@param password
@return this request | [
"Set",
"the",
"Authorization",
"header",
"to",
"given",
"values",
"in",
"Basic",
"authentication",
"format"
] | 6c26200ab03855dbb92b56ca0c6363cdec0eaf2c | https://github.com/kiegroup/droolsjbpm-integration/blob/6c26200ab03855dbb92b56ca0c6363cdec0eaf2c/kie-server-parent/kie-server-common/src/main/java/org/kie/server/common/rest/KieServerHttpRequest.java#L1040-L1042 |
112,898 | kiegroup/droolsjbpm-integration | kie-server-parent/kie-server-common/src/main/java/org/kie/server/common/rest/KieServerHttpRequest.java | KieServerHttpRequest.contentType | public KieServerHttpRequest contentType(final String contentType, final String charset ) {
if( charset != null && charset.length() > 0 ) {
final String separator = "; " + PARAM_CHARSET + '=';
return header(CONTENT_TYPE, contentType + separator + charset);
} else
retur... | java | public KieServerHttpRequest contentType(final String contentType, final String charset ) {
if( charset != null && charset.length() > 0 ) {
final String separator = "; " + PARAM_CHARSET + '=';
return header(CONTENT_TYPE, contentType + separator + charset);
} else
retur... | [
"public",
"KieServerHttpRequest",
"contentType",
"(",
"final",
"String",
"contentType",
",",
"final",
"String",
"charset",
")",
"{",
"if",
"(",
"charset",
"!=",
"null",
"&&",
"charset",
".",
"length",
"(",
")",
">",
"0",
")",
"{",
"final",
"String",
"separ... | Set the 'Content-Type' request header to the given value and charset
@param contentType
@param charset
@return this request | [
"Set",
"the",
"Content",
"-",
"Type",
"request",
"header",
"to",
"the",
"given",
"value",
"and",
"charset"
] | 6c26200ab03855dbb92b56ca0c6363cdec0eaf2c | https://github.com/kiegroup/droolsjbpm-integration/blob/6c26200ab03855dbb92b56ca0c6363cdec0eaf2c/kie-server-parent/kie-server-common/src/main/java/org/kie/server/common/rest/KieServerHttpRequest.java#L1072-L1078 |
112,899 | kiegroup/droolsjbpm-integration | kie-server-parent/kie-server-common/src/main/java/org/kie/server/common/rest/KieServerHttpRequest.java | KieServerHttpRequest.accept | public KieServerHttpRequest accept(final String accept ) {
RequestInfo requestInfo = getRequestInfo();
if( requestInfo.getHeader(ACCEPT).isEmpty() ) {
requestInfo.setHeader(ACCEPT, new ArrayList<String>());
}
requestInfo.headers.get(ACCEPT).set(0, accept);
return this;... | java | public KieServerHttpRequest accept(final String accept ) {
RequestInfo requestInfo = getRequestInfo();
if( requestInfo.getHeader(ACCEPT).isEmpty() ) {
requestInfo.setHeader(ACCEPT, new ArrayList<String>());
}
requestInfo.headers.get(ACCEPT).set(0, accept);
return this;... | [
"public",
"KieServerHttpRequest",
"accept",
"(",
"final",
"String",
"accept",
")",
"{",
"RequestInfo",
"requestInfo",
"=",
"getRequestInfo",
"(",
")",
";",
"if",
"(",
"requestInfo",
".",
"getHeader",
"(",
"ACCEPT",
")",
".",
"isEmpty",
"(",
")",
")",
"{",
... | Set the 'Accept' header to given value
@param accept
@return this request | [
"Set",
"the",
"Accept",
"header",
"to",
"given",
"value"
] | 6c26200ab03855dbb92b56ca0c6363cdec0eaf2c | https://github.com/kiegroup/droolsjbpm-integration/blob/6c26200ab03855dbb92b56ca0c6363cdec0eaf2c/kie-server-parent/kie-server-common/src/main/java/org/kie/server/common/rest/KieServerHttpRequest.java#L1086-L1093 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.