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
48,200
aol/cyclops
cyclops-anym/src/main/java/cyclops/monads/transformers/ListT.java
ListT.map
@Override public <B> ListT<W,B> map(final Function<? super T, ? extends B> f) { return of(run.map(o -> o.map(f))); }
java
@Override public <B> ListT<W,B> map(final Function<? super T, ? extends B> f) { return of(run.map(o -> o.map(f))); }
[ "@", "Override", "public", "<", "B", ">", "ListT", "<", "W", ",", "B", ">", "map", "(", "final", "Function", "<", "?", "super", "T", ",", "?", "extends", "B", ">", "f", ")", "{", "return", "of", "(", "run", ".", "map", "(", "o", "->", "o", ...
Map the wrapped List <pre> {@code ListT.of(AnyM.fromStream(Arrays.asList(10)) .map(t->t=t+1); //ListT<AnyM<Stream<List[11]>>> } </pre> @param f Mapping function for the wrapped List @return ListT that applies the transform function to the wrapped List
[ "Map", "the", "wrapped", "List" ]
59a9fde30190a4d1faeb9f6d9851d209d82b81dd
https://github.com/aol/cyclops/blob/59a9fde30190a4d1faeb9f6d9851d209d82b81dd/cyclops-anym/src/main/java/cyclops/monads/transformers/ListT.java#L143-L146
48,201
aol/cyclops
cyclops-anym/src/main/java/cyclops/monads/transformers/ListT.java
ListT.of
public static <W extends WitnessType<W>,A> ListT<W,A> of(final AnyM<W,? extends IndexedSequenceX<A>> monads) { return new ListT<>( monads); }
java
public static <W extends WitnessType<W>,A> ListT<W,A> of(final AnyM<W,? extends IndexedSequenceX<A>> monads) { return new ListT<>( monads); }
[ "public", "static", "<", "W", "extends", "WitnessType", "<", "W", ">", ",", "A", ">", "ListT", "<", "W", ",", "A", ">", "of", "(", "final", "AnyM", "<", "W", ",", "?", "extends", "IndexedSequenceX", "<", "A", ">", ">", "monads", ")", "{", "return...
Construct an ListT from an AnyM that wraps a monad containing Lists @param monads AnyM that contains a monad wrapping an List @return ListT
[ "Construct", "an", "ListT", "from", "an", "AnyM", "that", "wraps", "a", "monad", "containing", "Lists" ]
59a9fde30190a4d1faeb9f6d9851d209d82b81dd
https://github.com/aol/cyclops/blob/59a9fde30190a4d1faeb9f6d9851d209d82b81dd/cyclops-anym/src/main/java/cyclops/monads/transformers/ListT.java#L197-L200
48,202
twitter/scalding
maple/src/main/java/com/twitter/maple/hbase/HBaseScheme.java
HBaseScheme.getFamilyNames
public String[] getFamilyNames() { HashSet<String> familyNameSet = new HashSet<String>(); if (familyNames == null) { for (String columnName : columns(null, this.valueFields)) { int pos = columnName.indexOf(":"); familyNameSet.add(hbaseColumn(pos > 0 ? columnName.substring(0, pos) : column...
java
public String[] getFamilyNames() { HashSet<String> familyNameSet = new HashSet<String>(); if (familyNames == null) { for (String columnName : columns(null, this.valueFields)) { int pos = columnName.indexOf(":"); familyNameSet.add(hbaseColumn(pos > 0 ? columnName.substring(0, pos) : column...
[ "public", "String", "[", "]", "getFamilyNames", "(", ")", "{", "HashSet", "<", "String", ">", "familyNameSet", "=", "new", "HashSet", "<", "String", ">", "(", ")", ";", "if", "(", "familyNames", "==", "null", ")", "{", "for", "(", "String", "columnName...
Method getFamilyNames returns the set of familyNames of this HBaseScheme object. @return the familyNames (type String[]) of this HBaseScheme object.
[ "Method", "getFamilyNames", "returns", "the", "set", "of", "familyNames", "of", "this", "HBaseScheme", "object", "." ]
428b5507279655676e507d52c669c3cbc7812dc0
https://github.com/twitter/scalding/blob/428b5507279655676e507d52c669c3cbc7812dc0/maple/src/main/java/com/twitter/maple/hbase/HBaseScheme.java#L140-L154
48,203
twitter/scalding
scalding-serialization/src/main/java/com/twitter/scalding/serialization/Undeprecated.java
Undeprecated.getAsciiBytes
@SuppressWarnings("deprecation") public static void getAsciiBytes(String element, int charStart, int charLen, byte[] bytes, int byteOffset) { element.getBytes(charStart, charLen, bytes, byteOffset); }
java
@SuppressWarnings("deprecation") public static void getAsciiBytes(String element, int charStart, int charLen, byte[] bytes, int byteOffset) { element.getBytes(charStart, charLen, bytes, byteOffset); }
[ "@", "SuppressWarnings", "(", "\"deprecation\"", ")", "public", "static", "void", "getAsciiBytes", "(", "String", "element", ",", "int", "charStart", ",", "int", "charLen", ",", "byte", "[", "]", "bytes", ",", "int", "byteOffset", ")", "{", "element", ".", ...
This method is faster for ASCII data, but unsafe otherwise it is used by our macros AFTER checking that the string is ASCII following a pattern seen in Kryo, which benchmarking showed helped. Scala cannot supress warnings like this so we do it here
[ "This", "method", "is", "faster", "for", "ASCII", "data", "but", "unsafe", "otherwise", "it", "is", "used", "by", "our", "macros", "AFTER", "checking", "that", "the", "string", "is", "ASCII", "following", "a", "pattern", "seen", "in", "Kryo", "which", "ben...
428b5507279655676e507d52c669c3cbc7812dc0
https://github.com/twitter/scalding/blob/428b5507279655676e507d52c669c3cbc7812dc0/scalding-serialization/src/main/java/com/twitter/scalding/serialization/Undeprecated.java#L25-L28
48,204
twitter/scalding
scalding-parquet-scrooge/src/main/java/com/twitter/scalding/parquet/scrooge/ScroogeReadSupport.java
ScroogeReadSupport.getSchemaForRead
public static MessageType getSchemaForRead(MessageType fileMessageType, MessageType projectedMessageType) { assertGroupsAreCompatible(fileMessageType, projectedMessageType); return projectedMessageType; }
java
public static MessageType getSchemaForRead(MessageType fileMessageType, MessageType projectedMessageType) { assertGroupsAreCompatible(fileMessageType, projectedMessageType); return projectedMessageType; }
[ "public", "static", "MessageType", "getSchemaForRead", "(", "MessageType", "fileMessageType", ",", "MessageType", "projectedMessageType", ")", "{", "assertGroupsAreCompatible", "(", "fileMessageType", ",", "projectedMessageType", ")", ";", "return", "projectedMessageType", ...
Updated method from ReadSupport which checks if the projection's compatible instead of a stricter check to see if the file's schema contains the projection @param fileMessageType @param projectedMessageType @return
[ "Updated", "method", "from", "ReadSupport", "which", "checks", "if", "the", "projection", "s", "compatible", "instead", "of", "a", "stricter", "check", "to", "see", "if", "the", "file", "s", "schema", "contains", "the", "projection" ]
428b5507279655676e507d52c669c3cbc7812dc0
https://github.com/twitter/scalding/blob/428b5507279655676e507d52c669c3cbc7812dc0/scalding-parquet-scrooge/src/main/java/com/twitter/scalding/parquet/scrooge/ScroogeReadSupport.java#L133-L136
48,205
twitter/scalding
scalding-parquet-scrooge/src/main/java/com/twitter/scalding/parquet/scrooge/ScroogeReadSupport.java
ScroogeReadSupport.assertGroupsAreCompatible
public static void assertGroupsAreCompatible(GroupType fileType, GroupType projection) { List<Type> fields = projection.getFields(); for (Type otherType : fields) { if (fileType.containsField(otherType.getName())) { Type thisType = fileType.getType(otherType.getName()); assertAreCompatible...
java
public static void assertGroupsAreCompatible(GroupType fileType, GroupType projection) { List<Type> fields = projection.getFields(); for (Type otherType : fields) { if (fileType.containsField(otherType.getName())) { Type thisType = fileType.getType(otherType.getName()); assertAreCompatible...
[ "public", "static", "void", "assertGroupsAreCompatible", "(", "GroupType", "fileType", ",", "GroupType", "projection", ")", "{", "List", "<", "Type", ">", "fields", "=", "projection", ".", "getFields", "(", ")", ";", "for", "(", "Type", "otherType", ":", "fi...
Validates that the requested group type projection is compatible. This allows the projection schema to have extra optional fields. @param fileType the typed schema of the source @param projection requested projection schema
[ "Validates", "that", "the", "requested", "group", "type", "projection", "is", "compatible", ".", "This", "allows", "the", "projection", "schema", "to", "have", "extra", "optional", "fields", "." ]
428b5507279655676e507d52c669c3cbc7812dc0
https://github.com/twitter/scalding/blob/428b5507279655676e507d52c669c3cbc7812dc0/scalding-parquet-scrooge/src/main/java/com/twitter/scalding/parquet/scrooge/ScroogeReadSupport.java#L160-L173
48,206
twitter/scalding
scalding-parquet-scrooge/src/main/java/com/twitter/scalding/parquet/scrooge/ScroogeReadSupport.java
ScroogeReadSupport.assertAreCompatible
public static void assertAreCompatible(Type fileType, Type projection) { if (!fileType.getName().equals(projection.getName()) || (fileType.getRepetition() != projection.getRepetition() && !fileType.getRepetition().isMoreRestrictiveThan(projection.getRepetition()))) { throw new InvalidRecordException(pro...
java
public static void assertAreCompatible(Type fileType, Type projection) { if (!fileType.getName().equals(projection.getName()) || (fileType.getRepetition() != projection.getRepetition() && !fileType.getRepetition().isMoreRestrictiveThan(projection.getRepetition()))) { throw new InvalidRecordException(pro...
[ "public", "static", "void", "assertAreCompatible", "(", "Type", "fileType", ",", "Type", "projection", ")", "{", "if", "(", "!", "fileType", ".", "getName", "(", ")", ".", "equals", "(", "projection", ".", "getName", "(", ")", ")", "||", "(", "fileType",...
Validates that the requested projection is compatible. This makes it possible to project a required field using optional since it is less restrictive. @param fileType the typed schema of the source @param projection requested projection schema
[ "Validates", "that", "the", "requested", "projection", "is", "compatible", ".", "This", "makes", "it", "possible", "to", "project", "a", "required", "field", "using", "optional", "since", "it", "is", "less", "restrictive", "." ]
428b5507279655676e507d52c669c3cbc7812dc0
https://github.com/twitter/scalding/blob/428b5507279655676e507d52c669c3cbc7812dc0/scalding-parquet-scrooge/src/main/java/com/twitter/scalding/parquet/scrooge/ScroogeReadSupport.java#L183-L188
48,207
twitter/scalding
scalding-parquet-scrooge/src/main/java/com/twitter/scalding/parquet/scrooge/ScroogeReadSupport.java
ScroogeReadSupport.getThriftClass
public static <T extends ThriftStruct> Class<T> getThriftClass(Map<String, String> fileMetadata, Configuration conf) throws ClassNotFoundException { String className = conf.get(THRIFT_READ_CLASS_KEY, null); if (className == null) { final ThriftMetaData metaData = ThriftMetaData.fromExtraMetaData(fileMetad...
java
public static <T extends ThriftStruct> Class<T> getThriftClass(Map<String, String> fileMetadata, Configuration conf) throws ClassNotFoundException { String className = conf.get(THRIFT_READ_CLASS_KEY, null); if (className == null) { final ThriftMetaData metaData = ThriftMetaData.fromExtraMetaData(fileMetad...
[ "public", "static", "<", "T", "extends", "ThriftStruct", ">", "Class", "<", "T", ">", "getThriftClass", "(", "Map", "<", "String", ",", "String", ">", "fileMetadata", ",", "Configuration", "conf", ")", "throws", "ClassNotFoundException", "{", "String", "classN...
Getting thrift class from extra metadata
[ "Getting", "thrift", "class", "from", "extra", "metadata" ]
428b5507279655676e507d52c669c3cbc7812dc0
https://github.com/twitter/scalding/blob/428b5507279655676e507d52c669c3cbc7812dc0/scalding-parquet-scrooge/src/main/java/com/twitter/scalding/parquet/scrooge/ScroogeReadSupport.java#L227-L238
48,208
yshrsmz/KeyboardVisibilityEvent
keyboardvisibilityevent/src/main/java/net/yslibrary/android/keyboardvisibilityevent/util/UIUtil.java
UIUtil.showKeyboard
public static void showKeyboard(Context context, EditText target) { if (context == null || target == null) { return; } InputMethodManager imm = getInputMethodManager(context); imm.showSoftInput(target, InputMethodManager.SHOW_IMPLICIT); }
java
public static void showKeyboard(Context context, EditText target) { if (context == null || target == null) { return; } InputMethodManager imm = getInputMethodManager(context); imm.showSoftInput(target, InputMethodManager.SHOW_IMPLICIT); }
[ "public", "static", "void", "showKeyboard", "(", "Context", "context", ",", "EditText", "target", ")", "{", "if", "(", "context", "==", "null", "||", "target", "==", "null", ")", "{", "return", ";", "}", "InputMethodManager", "imm", "=", "getInputMethodManag...
Show keyboard and focus to given EditText @param context Context @param target EditText to focus
[ "Show", "keyboard", "and", "focus", "to", "given", "EditText" ]
fbde29a2c28ff1b2fa44f43cdd1ff3ec1d3321d8
https://github.com/yshrsmz/KeyboardVisibilityEvent/blob/fbde29a2c28ff1b2fa44f43cdd1ff3ec1d3321d8/keyboardvisibilityevent/src/main/java/net/yslibrary/android/keyboardvisibilityevent/util/UIUtil.java#L30-L38
48,209
yshrsmz/KeyboardVisibilityEvent
keyboardvisibilityevent/src/main/java/net/yslibrary/android/keyboardvisibilityevent/util/UIUtil.java
UIUtil.showKeyboardInDialog
public static void showKeyboardInDialog(Dialog dialog, EditText target) { if (dialog == null || target == null) { return; } dialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE); target.requestFocus(); }
java
public static void showKeyboardInDialog(Dialog dialog, EditText target) { if (dialog == null || target == null) { return; } dialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE); target.requestFocus(); }
[ "public", "static", "void", "showKeyboardInDialog", "(", "Dialog", "dialog", ",", "EditText", "target", ")", "{", "if", "(", "dialog", "==", "null", "||", "target", "==", "null", ")", "{", "return", ";", "}", "dialog", ".", "getWindow", "(", ")", ".", ...
Show keyboard and focus to given EditText. Use this method if target EditText is in Dialog. @param dialog Dialog @param target EditText to focus
[ "Show", "keyboard", "and", "focus", "to", "given", "EditText", ".", "Use", "this", "method", "if", "target", "EditText", "is", "in", "Dialog", "." ]
fbde29a2c28ff1b2fa44f43cdd1ff3ec1d3321d8
https://github.com/yshrsmz/KeyboardVisibilityEvent/blob/fbde29a2c28ff1b2fa44f43cdd1ff3ec1d3321d8/keyboardvisibilityevent/src/main/java/net/yslibrary/android/keyboardvisibilityevent/util/UIUtil.java#L47-L54
48,210
yshrsmz/KeyboardVisibilityEvent
keyboardvisibilityevent/src/main/java/net/yslibrary/android/keyboardvisibilityevent/KeyboardVisibilityEvent.java
KeyboardVisibilityEvent.setEventListener
public static void setEventListener(final Activity activity, final KeyboardVisibilityEventListener listener) { final Unregistrar unregistrar = registerEventListener(activity, listener); activity.getApplication() .registerActivityLifecycleCallbacks...
java
public static void setEventListener(final Activity activity, final KeyboardVisibilityEventListener listener) { final Unregistrar unregistrar = registerEventListener(activity, listener); activity.getApplication() .registerActivityLifecycleCallbacks...
[ "public", "static", "void", "setEventListener", "(", "final", "Activity", "activity", ",", "final", "KeyboardVisibilityEventListener", "listener", ")", "{", "final", "Unregistrar", "unregistrar", "=", "registerEventListener", "(", "activity", ",", "listener", ")", ";"...
Set keyboard visibility change event listener. This automatically remove registered event listener when the Activity is destroyed @param activity Activity @param listener KeyboardVisibilityEventListener
[ "Set", "keyboard", "visibility", "change", "event", "listener", ".", "This", "automatically", "remove", "registered", "event", "listener", "when", "the", "Activity", "is", "destroyed" ]
fbde29a2c28ff1b2fa44f43cdd1ff3ec1d3321d8
https://github.com/yshrsmz/KeyboardVisibilityEvent/blob/fbde29a2c28ff1b2fa44f43cdd1ff3ec1d3321d8/keyboardvisibilityevent/src/main/java/net/yslibrary/android/keyboardvisibilityevent/KeyboardVisibilityEvent.java#L27-L38
48,211
yshrsmz/KeyboardVisibilityEvent
keyboardvisibilityevent/src/main/java/net/yslibrary/android/keyboardvisibilityevent/KeyboardVisibilityEvent.java
KeyboardVisibilityEvent.registerEventListener
public static Unregistrar registerEventListener(final Activity activity, final KeyboardVisibilityEventListener listener) { if (activity == null) { throw new NullPointerException("Parameter:activity must not be null"); } int softIn...
java
public static Unregistrar registerEventListener(final Activity activity, final KeyboardVisibilityEventListener listener) { if (activity == null) { throw new NullPointerException("Parameter:activity must not be null"); } int softIn...
[ "public", "static", "Unregistrar", "registerEventListener", "(", "final", "Activity", "activity", ",", "final", "KeyboardVisibilityEventListener", "listener", ")", "{", "if", "(", "activity", "==", "null", ")", "{", "throw", "new", "NullPointerException", "(", "\"Pa...
Set keyboard visibility change event listener. @param activity Activity @param listener KeyboardVisibilityEventListener @return Unregistrar
[ "Set", "keyboard", "visibility", "change", "event", "listener", "." ]
fbde29a2c28ff1b2fa44f43cdd1ff3ec1d3321d8
https://github.com/yshrsmz/KeyboardVisibilityEvent/blob/fbde29a2c28ff1b2fa44f43cdd1ff3ec1d3321d8/keyboardvisibilityevent/src/main/java/net/yslibrary/android/keyboardvisibilityevent/KeyboardVisibilityEvent.java#L47-L99
48,212
yshrsmz/KeyboardVisibilityEvent
keyboardvisibilityevent/src/main/java/net/yslibrary/android/keyboardvisibilityevent/KeyboardVisibilityEvent.java
KeyboardVisibilityEvent.isKeyboardVisible
public static boolean isKeyboardVisible(Activity activity) { Rect r = new Rect(); View activityRoot = getActivityRoot(activity); activityRoot.getWindowVisibleDisplayFrame(r); int screenHeight = activityRoot.getRootView().getHeight(); int heightDiff = screenHeight - r.height();...
java
public static boolean isKeyboardVisible(Activity activity) { Rect r = new Rect(); View activityRoot = getActivityRoot(activity); activityRoot.getWindowVisibleDisplayFrame(r); int screenHeight = activityRoot.getRootView().getHeight(); int heightDiff = screenHeight - r.height();...
[ "public", "static", "boolean", "isKeyboardVisible", "(", "Activity", "activity", ")", "{", "Rect", "r", "=", "new", "Rect", "(", ")", ";", "View", "activityRoot", "=", "getActivityRoot", "(", "activity", ")", ";", "activityRoot", ".", "getWindowVisibleDisplayFra...
Determine if keyboard is visible @param activity Activity @return Whether keyboard is visible or not
[ "Determine", "if", "keyboard", "is", "visible" ]
fbde29a2c28ff1b2fa44f43cdd1ff3ec1d3321d8
https://github.com/yshrsmz/KeyboardVisibilityEvent/blob/fbde29a2c28ff1b2fa44f43cdd1ff3ec1d3321d8/keyboardvisibilityevent/src/main/java/net/yslibrary/android/keyboardvisibilityevent/KeyboardVisibilityEvent.java#L107-L118
48,213
mikepenz/Android-Iconics
library-core/src/main/java/com/mikepenz/iconics/IconicsDrawable.java
IconicsDrawable.toBitmap
@NonNull public Bitmap toBitmap() { if (mSizeX == -1 || mSizeY == -1) { actionBar(); } Bitmap bitmap = Bitmap.createBitmap( getIntrinsicWidth(), getIntrinsicHeight(), Bitmap.Config.ARGB_8888); style(Paint.Style.FILL); ...
java
@NonNull public Bitmap toBitmap() { if (mSizeX == -1 || mSizeY == -1) { actionBar(); } Bitmap bitmap = Bitmap.createBitmap( getIntrinsicWidth(), getIntrinsicHeight(), Bitmap.Config.ARGB_8888); style(Paint.Style.FILL); ...
[ "@", "NonNull", "public", "Bitmap", "toBitmap", "(", ")", "{", "if", "(", "mSizeX", "==", "-", "1", "||", "mSizeY", "==", "-", "1", ")", "{", "actionBar", "(", ")", ";", "}", "Bitmap", "bitmap", "=", "Bitmap", ".", "createBitmap", "(", "getIntrinsicW...
Creates a BitMap to use in Widgets or anywhere else @return bitmap to set
[ "Creates", "a", "BitMap", "to", "use", "in", "Widgets", "or", "anywhere", "else" ]
0b2c8f7d07b6d2715a417563c66311e7e1fcc7d8
https://github.com/mikepenz/Android-Iconics/blob/0b2c8f7d07b6d2715a417563c66311e7e1fcc7d8/library-core/src/main/java/com/mikepenz/iconics/IconicsDrawable.java#L273-L291
48,214
mikepenz/Android-Iconics
library-core/src/main/java/com/mikepenz/iconics/IconicsDrawable.java
IconicsDrawable.iconOffsetXDp
@NonNull public IconicsDrawable iconOffsetXDp(@Dimension(unit = DP) int sizeDp) { return iconOffsetXPx(Utils.convertDpToPx(mContext, sizeDp)); }
java
@NonNull public IconicsDrawable iconOffsetXDp(@Dimension(unit = DP) int sizeDp) { return iconOffsetXPx(Utils.convertDpToPx(mContext, sizeDp)); }
[ "@", "NonNull", "public", "IconicsDrawable", "iconOffsetXDp", "(", "@", "Dimension", "(", "unit", "=", "DP", ")", "int", "sizeDp", ")", "{", "return", "iconOffsetXPx", "(", "Utils", ".", "convertDpToPx", "(", "mContext", ",", "sizeDp", ")", ")", ";", "}" ]
set the icon offset for X as dp @return The current IconicsDrawable for chaining.
[ "set", "the", "icon", "offset", "for", "X", "as", "dp" ]
0b2c8f7d07b6d2715a417563c66311e7e1fcc7d8
https://github.com/mikepenz/Android-Iconics/blob/0b2c8f7d07b6d2715a417563c66311e7e1fcc7d8/library-core/src/main/java/com/mikepenz/iconics/IconicsDrawable.java#L525-L528
48,215
mikepenz/Android-Iconics
library-core/src/main/java/com/mikepenz/iconics/IconicsDrawable.java
IconicsDrawable.iconOffsetXPx
@NonNull public IconicsDrawable iconOffsetXPx(@Dimension(unit = PX) int sizePx) { mIconOffsetX = sizePx; invalidateSelf(); return this; }
java
@NonNull public IconicsDrawable iconOffsetXPx(@Dimension(unit = PX) int sizePx) { mIconOffsetX = sizePx; invalidateSelf(); return this; }
[ "@", "NonNull", "public", "IconicsDrawable", "iconOffsetXPx", "(", "@", "Dimension", "(", "unit", "=", "PX", ")", "int", "sizePx", ")", "{", "mIconOffsetX", "=", "sizePx", ";", "invalidateSelf", "(", ")", ";", "return", "this", ";", "}" ]
set the icon offset for X @return The current IconicsDrawable for chaining.
[ "set", "the", "icon", "offset", "for", "X" ]
0b2c8f7d07b6d2715a417563c66311e7e1fcc7d8
https://github.com/mikepenz/Android-Iconics/blob/0b2c8f7d07b6d2715a417563c66311e7e1fcc7d8/library-core/src/main/java/com/mikepenz/iconics/IconicsDrawable.java#L535-L541
48,216
mikepenz/Android-Iconics
library-core/src/main/java/com/mikepenz/iconics/IconicsDrawable.java
IconicsDrawable.iconOffsetYDp
@NonNull public IconicsDrawable iconOffsetYDp(@Dimension(unit = DP) int sizeDp) { return iconOffsetYPx(Utils.convertDpToPx(mContext, sizeDp)); }
java
@NonNull public IconicsDrawable iconOffsetYDp(@Dimension(unit = DP) int sizeDp) { return iconOffsetYPx(Utils.convertDpToPx(mContext, sizeDp)); }
[ "@", "NonNull", "public", "IconicsDrawable", "iconOffsetYDp", "(", "@", "Dimension", "(", "unit", "=", "DP", ")", "int", "sizeDp", ")", "{", "return", "iconOffsetYPx", "(", "Utils", ".", "convertDpToPx", "(", "mContext", ",", "sizeDp", ")", ")", ";", "}" ]
set the icon offset for Y as dp @return The current IconicsDrawable for chaining.
[ "set", "the", "icon", "offset", "for", "Y", "as", "dp" ]
0b2c8f7d07b6d2715a417563c66311e7e1fcc7d8
https://github.com/mikepenz/Android-Iconics/blob/0b2c8f7d07b6d2715a417563c66311e7e1fcc7d8/library-core/src/main/java/com/mikepenz/iconics/IconicsDrawable.java#L558-L561
48,217
mikepenz/Android-Iconics
library-core/src/main/java/com/mikepenz/iconics/IconicsDrawable.java
IconicsDrawable.iconOffsetYPx
@NonNull public IconicsDrawable iconOffsetYPx(@Dimension(unit = PX) int sizePx) { mIconOffsetY = sizePx; invalidateSelf(); return this; }
java
@NonNull public IconicsDrawable iconOffsetYPx(@Dimension(unit = PX) int sizePx) { mIconOffsetY = sizePx; invalidateSelf(); return this; }
[ "@", "NonNull", "public", "IconicsDrawable", "iconOffsetYPx", "(", "@", "Dimension", "(", "unit", "=", "PX", ")", "int", "sizePx", ")", "{", "mIconOffsetY", "=", "sizePx", ";", "invalidateSelf", "(", ")", ";", "return", "this", ";", "}" ]
set the icon offset for Y @return The current IconicsDrawable for chaining.
[ "set", "the", "icon", "offset", "for", "Y" ]
0b2c8f7d07b6d2715a417563c66311e7e1fcc7d8
https://github.com/mikepenz/Android-Iconics/blob/0b2c8f7d07b6d2715a417563c66311e7e1fcc7d8/library-core/src/main/java/com/mikepenz/iconics/IconicsDrawable.java#L568-L574
48,218
mikepenz/Android-Iconics
library-core/src/main/java/com/mikepenz/iconics/IconicsDrawable.java
IconicsDrawable.paddingDp
@NonNull public IconicsDrawable paddingDp(@Dimension(unit = DP) int sizeDp) { return paddingPx(Utils.convertDpToPx(mContext, sizeDp)); }
java
@NonNull public IconicsDrawable paddingDp(@Dimension(unit = DP) int sizeDp) { return paddingPx(Utils.convertDpToPx(mContext, sizeDp)); }
[ "@", "NonNull", "public", "IconicsDrawable", "paddingDp", "(", "@", "Dimension", "(", "unit", "=", "DP", ")", "int", "sizeDp", ")", "{", "return", "paddingPx", "(", "Utils", ".", "convertDpToPx", "(", "mContext", ",", "sizeDp", ")", ")", ";", "}" ]
Set the padding in dp for the drawable @return The current IconicsDrawable for chaining.
[ "Set", "the", "padding", "in", "dp", "for", "the", "drawable" ]
0b2c8f7d07b6d2715a417563c66311e7e1fcc7d8
https://github.com/mikepenz/Android-Iconics/blob/0b2c8f7d07b6d2715a417563c66311e7e1fcc7d8/library-core/src/main/java/com/mikepenz/iconics/IconicsDrawable.java#L591-L594
48,219
mikepenz/Android-Iconics
library-core/src/main/java/com/mikepenz/iconics/IconicsDrawable.java
IconicsDrawable.paddingPx
@NonNull public IconicsDrawable paddingPx(@Dimension(unit = PX) int sizePx) { if (mIconPadding != sizePx) { mIconPadding = sizePx; if (mDrawContour) { mIconPadding += mContourWidth; } if (mDrawBackgroundContour) { mIconPadding +...
java
@NonNull public IconicsDrawable paddingPx(@Dimension(unit = PX) int sizePx) { if (mIconPadding != sizePx) { mIconPadding = sizePx; if (mDrawContour) { mIconPadding += mContourWidth; } if (mDrawBackgroundContour) { mIconPadding +...
[ "@", "NonNull", "public", "IconicsDrawable", "paddingPx", "(", "@", "Dimension", "(", "unit", "=", "PX", ")", "int", "sizePx", ")", "{", "if", "(", "mIconPadding", "!=", "sizePx", ")", "{", "mIconPadding", "=", "sizePx", ";", "if", "(", "mDrawContour", "...
Set a padding for the. @return The current IconicsDrawable for chaining.
[ "Set", "a", "padding", "for", "the", "." ]
0b2c8f7d07b6d2715a417563c66311e7e1fcc7d8
https://github.com/mikepenz/Android-Iconics/blob/0b2c8f7d07b6d2715a417563c66311e7e1fcc7d8/library-core/src/main/java/com/mikepenz/iconics/IconicsDrawable.java#L601-L615
48,220
mikepenz/Android-Iconics
library-core/src/main/java/com/mikepenz/iconics/IconicsDrawable.java
IconicsDrawable.contourWidthDp
@NonNull public IconicsDrawable contourWidthDp(@Dimension(unit = DP) int sizeDp) { return contourWidthPx(Utils.convertDpToPx(mContext, sizeDp)); }
java
@NonNull public IconicsDrawable contourWidthDp(@Dimension(unit = DP) int sizeDp) { return contourWidthPx(Utils.convertDpToPx(mContext, sizeDp)); }
[ "@", "NonNull", "public", "IconicsDrawable", "contourWidthDp", "(", "@", "Dimension", "(", "unit", "=", "DP", ")", "int", "sizeDp", ")", "{", "return", "contourWidthPx", "(", "Utils", ".", "convertDpToPx", "(", "mContext", ",", "sizeDp", ")", ")", ";", "}"...
Set contour width from dp for the icon @return The current IconicsDrawable for chaining.
[ "Set", "contour", "width", "from", "dp", "for", "the", "icon" ]
0b2c8f7d07b6d2715a417563c66311e7e1fcc7d8
https://github.com/mikepenz/Android-Iconics/blob/0b2c8f7d07b6d2715a417563c66311e7e1fcc7d8/library-core/src/main/java/com/mikepenz/iconics/IconicsDrawable.java#L1011-L1014
48,221
mikepenz/Android-Iconics
library-core/src/main/java/com/mikepenz/iconics/IconicsDrawable.java
IconicsDrawable.contourWidthPx
@NonNull public IconicsDrawable contourWidthPx(@Dimension(unit = PX) int sizePx) { mContourWidth = sizePx; mContourBrush.getPaint().setStrokeWidth(sizePx); drawContour(true); invalidateSelf(); return this; }
java
@NonNull public IconicsDrawable contourWidthPx(@Dimension(unit = PX) int sizePx) { mContourWidth = sizePx; mContourBrush.getPaint().setStrokeWidth(sizePx); drawContour(true); invalidateSelf(); return this; }
[ "@", "NonNull", "public", "IconicsDrawable", "contourWidthPx", "(", "@", "Dimension", "(", "unit", "=", "PX", ")", "int", "sizePx", ")", "{", "mContourWidth", "=", "sizePx", ";", "mContourBrush", ".", "getPaint", "(", ")", ".", "setStrokeWidth", "(", "sizePx...
Set contour width for the icon. @return The current IconicsDrawable for chaining.
[ "Set", "contour", "width", "for", "the", "icon", "." ]
0b2c8f7d07b6d2715a417563c66311e7e1fcc7d8
https://github.com/mikepenz/Android-Iconics/blob/0b2c8f7d07b6d2715a417563c66311e7e1fcc7d8/library-core/src/main/java/com/mikepenz/iconics/IconicsDrawable.java#L1021-L1029
48,222
mikepenz/Android-Iconics
library-core/src/main/java/com/mikepenz/iconics/IconicsDrawable.java
IconicsDrawable.backgroundContourWidthDp
@NonNull public IconicsDrawable backgroundContourWidthDp(@Dimension(unit = DP) int sizeDp) { return backgroundContourWidthPx(Utils.convertDpToPx(mContext, sizeDp)); }
java
@NonNull public IconicsDrawable backgroundContourWidthDp(@Dimension(unit = DP) int sizeDp) { return backgroundContourWidthPx(Utils.convertDpToPx(mContext, sizeDp)); }
[ "@", "NonNull", "public", "IconicsDrawable", "backgroundContourWidthDp", "(", "@", "Dimension", "(", "unit", "=", "DP", ")", "int", "sizeDp", ")", "{", "return", "backgroundContourWidthPx", "(", "Utils", ".", "convertDpToPx", "(", "mContext", ",", "sizeDp", ")",...
Set background contour width from dp for the icon @return The current IconicsDrawable for chaining.
[ "Set", "background", "contour", "width", "from", "dp", "for", "the", "icon" ]
0b2c8f7d07b6d2715a417563c66311e7e1fcc7d8
https://github.com/mikepenz/Android-Iconics/blob/0b2c8f7d07b6d2715a417563c66311e7e1fcc7d8/library-core/src/main/java/com/mikepenz/iconics/IconicsDrawable.java#L1143-L1146
48,223
mikepenz/Android-Iconics
library-core/src/main/java/com/mikepenz/iconics/IconicsDrawable.java
IconicsDrawable.backgroundContourWidthPx
@NonNull public IconicsDrawable backgroundContourWidthPx(@Dimension(unit = PX) int sizePx) { mBackgroundContourWidth = sizePx; mBackgroundContourBrush.getPaint().setStrokeWidth(sizePx); drawBackgroundContour(true); invalidateSelf(); return this; }
java
@NonNull public IconicsDrawable backgroundContourWidthPx(@Dimension(unit = PX) int sizePx) { mBackgroundContourWidth = sizePx; mBackgroundContourBrush.getPaint().setStrokeWidth(sizePx); drawBackgroundContour(true); invalidateSelf(); return this; }
[ "@", "NonNull", "public", "IconicsDrawable", "backgroundContourWidthPx", "(", "@", "Dimension", "(", "unit", "=", "PX", ")", "int", "sizePx", ")", "{", "mBackgroundContourWidth", "=", "sizePx", ";", "mBackgroundContourBrush", ".", "getPaint", "(", ")", ".", "set...
Set background contour width for the icon. @return The current IconicsDrawable for chaining.
[ "Set", "background", "contour", "width", "for", "the", "icon", "." ]
0b2c8f7d07b6d2715a417563c66311e7e1fcc7d8
https://github.com/mikepenz/Android-Iconics/blob/0b2c8f7d07b6d2715a417563c66311e7e1fcc7d8/library-core/src/main/java/com/mikepenz/iconics/IconicsDrawable.java#L1153-L1161
48,224
mikepenz/Android-Iconics
library-core/src/main/java/com/mikepenz/iconics/animation/IconicsAnimationProcessor.java
IconicsAnimationProcessor.start
@NonNull public IconicsAnimationProcessor start() { mAnimator.setInterpolator(mInterpolator); mAnimator.setDuration(mDuration); mAnimator.setRepeatCount(mRepeatCount); mAnimator.setRepeatMode(mRepeatMode); if (mDrawable != null) { mIsStartRequested = false; ...
java
@NonNull public IconicsAnimationProcessor start() { mAnimator.setInterpolator(mInterpolator); mAnimator.setDuration(mDuration); mAnimator.setRepeatCount(mRepeatCount); mAnimator.setRepeatMode(mRepeatMode); if (mDrawable != null) { mIsStartRequested = false; ...
[ "@", "NonNull", "public", "IconicsAnimationProcessor", "start", "(", ")", "{", "mAnimator", ".", "setInterpolator", "(", "mInterpolator", ")", ";", "mAnimator", ".", "setDuration", "(", "mDuration", ")", ";", "mAnimator", ".", "setRepeatCount", "(", "mRepeatCount"...
Starts the animation, if processor is attached to drawable, otherwise sets flag to start animation immediately after attaching
[ "Starts", "the", "animation", "if", "processor", "is", "attached", "to", "drawable", "otherwise", "sets", "flag", "to", "start", "animation", "immediately", "after", "attaching" ]
0b2c8f7d07b6d2715a417563c66311e7e1fcc7d8
https://github.com/mikepenz/Android-Iconics/blob/0b2c8f7d07b6d2715a417563c66311e7e1fcc7d8/library-core/src/main/java/com/mikepenz/iconics/animation/IconicsAnimationProcessor.java#L221-L235
48,225
mikepenz/Android-Iconics
library-core/src/main/java/com/mikepenz/iconics/utils/GenericsUtil.java
GenericsUtil.resolveRClass
private static Class resolveRClass(String packageName) { do { try { return Class.forName(packageName + ".R$string"); } catch (ClassNotFoundException e) { packageName = packageName.contains(".") ? packageName.substring(0, packageName.lastIndexOf('.')) : "";...
java
private static Class resolveRClass(String packageName) { do { try { return Class.forName(packageName + ".R$string"); } catch (ClassNotFoundException e) { packageName = packageName.contains(".") ? packageName.substring(0, packageName.lastIndexOf('.')) : "";...
[ "private", "static", "Class", "resolveRClass", "(", "String", "packageName", ")", "{", "do", "{", "try", "{", "return", "Class", ".", "forName", "(", "packageName", "+", "\".R$string\"", ")", ";", "}", "catch", "(", "ClassNotFoundException", "e", ")", "{", ...
a helper class to resolve the correct R Class for the package
[ "a", "helper", "class", "to", "resolve", "the", "correct", "R", "Class", "for", "the", "package" ]
0b2c8f7d07b6d2715a417563c66311e7e1fcc7d8
https://github.com/mikepenz/Android-Iconics/blob/0b2c8f7d07b6d2715a417563c66311e7e1fcc7d8/library-core/src/main/java/com/mikepenz/iconics/utils/GenericsUtil.java#L43-L53
48,226
mikepenz/Android-Iconics
library-core/src/main/java/com/mikepenz/iconics/utils/GenericsUtil.java
GenericsUtil.getStringResourceByName
private static String getStringResourceByName(Context ctx, String resourceName) { String packageName = ctx.getPackageName(); int resId = ctx.getResources().getIdentifier(resourceName, "string", packageName); if (resId == 0) { return ""; } else { return ctx.getStri...
java
private static String getStringResourceByName(Context ctx, String resourceName) { String packageName = ctx.getPackageName(); int resId = ctx.getResources().getIdentifier(resourceName, "string", packageName); if (resId == 0) { return ""; } else { return ctx.getStri...
[ "private", "static", "String", "getStringResourceByName", "(", "Context", "ctx", ",", "String", "resourceName", ")", "{", "String", "packageName", "=", "ctx", ".", "getPackageName", "(", ")", ";", "int", "resId", "=", "ctx", ".", "getResources", "(", ")", "....
helper class to retrieve a string by it's resource name
[ "helper", "class", "to", "retrieve", "a", "string", "by", "it", "s", "resource", "name" ]
0b2c8f7d07b6d2715a417563c66311e7e1fcc7d8
https://github.com/mikepenz/Android-Iconics/blob/0b2c8f7d07b6d2715a417563c66311e7e1fcc7d8/library-core/src/main/java/com/mikepenz/iconics/utils/GenericsUtil.java#L90-L98
48,227
mikepenz/Android-Iconics
library-core/src/main/java/com/mikepenz/iconics/utils/IconicsUtils.java
IconicsUtils.applyStyles
public static void applyStyles(Context ctx, Spannable text, List<StyleContainer> styleContainers, List<CharacterStyle> styles, HashMap<String, List<CharacterStyle>> stylesFor) { for (StyleContainer styleContainer : styleContainers) { if (styleContainer.style != null) { text.setSpan(s...
java
public static void applyStyles(Context ctx, Spannable text, List<StyleContainer> styleContainers, List<CharacterStyle> styles, HashMap<String, List<CharacterStyle>> stylesFor) { for (StyleContainer styleContainer : styleContainers) { if (styleContainer.style != null) { text.setSpan(s...
[ "public", "static", "void", "applyStyles", "(", "Context", "ctx", ",", "Spannable", "text", ",", "List", "<", "StyleContainer", ">", "styleContainers", ",", "List", "<", "CharacterStyle", ">", "styles", ",", "HashMap", "<", "String", ",", "List", "<", "Chara...
Applies all given styles on the given Spannable @param ctx @param text the text which will get the Styles applied @param styleContainers all styles to apply @param styles additional CharacterStyles to apply @param stylesFor additional styles to apply for specific icons
[ "Applies", "all", "given", "styles", "on", "the", "given", "Spannable" ]
0b2c8f7d07b6d2715a417563c66311e7e1fcc7d8
https://github.com/mikepenz/Android-Iconics/blob/0b2c8f7d07b6d2715a417563c66311e7e1fcc7d8/library-core/src/main/java/com/mikepenz/iconics/utils/IconicsUtils.java#L259-L279
48,228
coursier/coursier
modules/bootstrap-launcher/src/main/java/coursier/bootstrap/launcher/jar/CentralDirectoryEndRecord.java
CentralDirectoryEndRecord.getCentralDirectory
public RandomAccessData getCentralDirectory(RandomAccessData data) { long offset = Bytes.littleEndianValue(this.block, this.offset + 16, 4); long length = Bytes.littleEndianValue(this.block, this.offset + 12, 4); return data.getSubsection(offset, length); }
java
public RandomAccessData getCentralDirectory(RandomAccessData data) { long offset = Bytes.littleEndianValue(this.block, this.offset + 16, 4); long length = Bytes.littleEndianValue(this.block, this.offset + 12, 4); return data.getSubsection(offset, length); }
[ "public", "RandomAccessData", "getCentralDirectory", "(", "RandomAccessData", "data", ")", "{", "long", "offset", "=", "Bytes", ".", "littleEndianValue", "(", "this", ".", "block", ",", "this", ".", "offset", "+", "16", ",", "4", ")", ";", "long", "length", ...
Return the bytes of the "Central directory" based on the offset indicated in this record. @param data the source data @return the central directory data
[ "Return", "the", "bytes", "of", "the", "Central", "directory", "based", "on", "the", "offset", "indicated", "in", "this", "record", "." ]
651da8db6c7528a819b91a5c1bca9b402176b19c
https://github.com/coursier/coursier/blob/651da8db6c7528a819b91a5c1bca9b402176b19c/modules/bootstrap-launcher/src/main/java/coursier/bootstrap/launcher/jar/CentralDirectoryEndRecord.java#L108-L112
48,229
hawtio/hawtio
hawtio-util/src/main/java/io/hawt/util/Hosts.java
Hosts.getLocalHostName
public static String getLocalHostName() throws UnknownHostException { String preffered = System.getProperty(PREFERED_ADDRESS_PROPERTY_NAME); return chooseAddress(preffered).getHostName(); }
java
public static String getLocalHostName() throws UnknownHostException { String preffered = System.getProperty(PREFERED_ADDRESS_PROPERTY_NAME); return chooseAddress(preffered).getHostName(); }
[ "public", "static", "String", "getLocalHostName", "(", ")", "throws", "UnknownHostException", "{", "String", "preffered", "=", "System", ".", "getProperty", "(", "PREFERED_ADDRESS_PROPERTY_NAME", ")", ";", "return", "chooseAddress", "(", "preffered", ")", ".", "getH...
Returns the local hostname. It loops through the network interfaces and returns the first non loopback address @return @throws UnknownHostException
[ "Returns", "the", "local", "hostname", ".", "It", "loops", "through", "the", "network", "interfaces", "and", "returns", "the", "first", "non", "loopback", "address" ]
d8b1c8f246307c0313ba297a494106d0859f3ffd
https://github.com/hawtio/hawtio/blob/d8b1c8f246307c0313ba297a494106d0859f3ffd/hawtio-util/src/main/java/io/hawt/util/Hosts.java#L158-L161
48,230
hawtio/hawtio
hawtio-util/src/main/java/io/hawt/util/Hosts.java
Hosts.getLocalIp
public static String getLocalIp() throws UnknownHostException { String preffered = System.getProperty(PREFERED_ADDRESS_PROPERTY_NAME); return chooseAddress(preffered).getHostAddress(); }
java
public static String getLocalIp() throws UnknownHostException { String preffered = System.getProperty(PREFERED_ADDRESS_PROPERTY_NAME); return chooseAddress(preffered).getHostAddress(); }
[ "public", "static", "String", "getLocalIp", "(", ")", "throws", "UnknownHostException", "{", "String", "preffered", "=", "System", ".", "getProperty", "(", "PREFERED_ADDRESS_PROPERTY_NAME", ")", ";", "return", "chooseAddress", "(", "preffered", ")", ".", "getHostAdd...
Returns the local IP. It loops through the network interfaces and returns the first non loopback address @return @throws UnknownHostException
[ "Returns", "the", "local", "IP", ".", "It", "loops", "through", "the", "network", "interfaces", "and", "returns", "the", "first", "non", "loopback", "address" ]
d8b1c8f246307c0313ba297a494106d0859f3ffd
https://github.com/hawtio/hawtio/blob/d8b1c8f246307c0313ba297a494106d0859f3ffd/hawtio-util/src/main/java/io/hawt/util/Hosts.java#L169-L172
48,231
hawtio/hawtio
hawtio-system/src/main/java/io/hawt/web/auth/LoginServlet.java
LoginServlet.doGet
@Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { if (authConfiguration.isKeycloakEnabled()) { redirector.doRedirect(request, response, "/"); } else { redirector.doForward(request, response, "/login...
java
@Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { if (authConfiguration.isKeycloakEnabled()) { redirector.doRedirect(request, response, "/"); } else { redirector.doForward(request, response, "/login...
[ "@", "Override", "protected", "void", "doGet", "(", "HttpServletRequest", "request", ",", "HttpServletResponse", "response", ")", "throws", "ServletException", ",", "IOException", "{", "if", "(", "authConfiguration", ".", "isKeycloakEnabled", "(", ")", ")", "{", "...
GET simply returns login.html
[ "GET", "simply", "returns", "login", ".", "html" ]
d8b1c8f246307c0313ba297a494106d0859f3ffd
https://github.com/hawtio/hawtio/blob/d8b1c8f246307c0313ba297a494106d0859f3ffd/hawtio-system/src/main/java/io/hawt/web/auth/LoginServlet.java#L78-L85
48,232
hawtio/hawtio
hawtio-ide/src/main/java/io/hawt/ide/IdeFacade.java
IdeFacade.findClassAbsoluteFileName
@Override public String findClassAbsoluteFileName(String fileName, String className, List<String> sourceRoots) { // usually the fileName is just the name of the file without any package information // so lets turn the package name into a path int lastIdx = className.lastIndexOf('.'); ...
java
@Override public String findClassAbsoluteFileName(String fileName, String className, List<String> sourceRoots) { // usually the fileName is just the name of the file without any package information // so lets turn the package name into a path int lastIdx = className.lastIndexOf('.'); ...
[ "@", "Override", "public", "String", "findClassAbsoluteFileName", "(", "String", "fileName", ",", "String", "className", ",", "List", "<", "String", ">", "sourceRoots", ")", "{", "// usually the fileName is just the name of the file without any package information", "// so le...
Given a class name and a file name, try to find the absolute file name of the source file on the users machine or null if it cannot be found
[ "Given", "a", "class", "name", "and", "a", "file", "name", "try", "to", "find", "the", "absolute", "file", "name", "of", "the", "source", "file", "on", "the", "users", "machine", "or", "null", "if", "it", "cannot", "be", "found" ]
d8b1c8f246307c0313ba297a494106d0859f3ffd
https://github.com/hawtio/hawtio/blob/d8b1c8f246307c0313ba297a494106d0859f3ffd/hawtio-ide/src/main/java/io/hawt/ide/IdeFacade.java#L63-L81
48,233
hawtio/hawtio
hawtio-ide/src/main/java/io/hawt/ide/IdeFacade.java
IdeFacade.ideaOpenAndNavigate
@Override public String ideaOpenAndNavigate(String fileName, int line, int column) throws Exception { if (line < 0) line = 0; if (column < 0) column = 0; String xml = "<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\n" + "<methodCall>\n" + " <methodName>fi...
java
@Override public String ideaOpenAndNavigate(String fileName, int line, int column) throws Exception { if (line < 0) line = 0; if (column < 0) column = 0; String xml = "<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\n" + "<methodCall>\n" + " <methodName>fi...
[ "@", "Override", "public", "String", "ideaOpenAndNavigate", "(", "String", "fileName", ",", "int", "line", ",", "int", "column", ")", "throws", "Exception", "{", "if", "(", "line", "<", "0", ")", "line", "=", "0", ";", "if", "(", "column", "<", "0", ...
Uses Intellij's XmlRPC mechanism to open and navigate to a file
[ "Uses", "Intellij", "s", "XmlRPC", "mechanism", "to", "open", "and", "navigate", "to", "a", "file" ]
d8b1c8f246307c0313ba297a494106d0859f3ffd
https://github.com/hawtio/hawtio/blob/d8b1c8f246307c0313ba297a494106d0859f3ffd/hawtio-ide/src/main/java/io/hawt/ide/IdeFacade.java#L130-L145
48,234
hawtio/hawtio
hawtio-util/src/main/java/io/hawt/util/Files.java
Files.recursiveDelete
public static int recursiveDelete(File file) { int answer = 0; if (file.isDirectory()) { File[] files = file.listFiles(); if (files != null) { for (File child : files) { answer += recursiveDelete(child); } } ...
java
public static int recursiveDelete(File file) { int answer = 0; if (file.isDirectory()) { File[] files = file.listFiles(); if (files != null) { for (File child : files) { answer += recursiveDelete(child); } } ...
[ "public", "static", "int", "recursiveDelete", "(", "File", "file", ")", "{", "int", "answer", "=", "0", ";", "if", "(", "file", ".", "isDirectory", "(", ")", ")", "{", "File", "[", "]", "files", "=", "file", ".", "listFiles", "(", ")", ";", "if", ...
Recursively deletes the given file whether its a file or directory returning the number of files deleted
[ "Recursively", "deletes", "the", "given", "file", "whether", "its", "a", "file", "or", "directory", "returning", "the", "number", "of", "files", "deleted" ]
d8b1c8f246307c0313ba297a494106d0859f3ffd
https://github.com/hawtio/hawtio/blob/d8b1c8f246307c0313ba297a494106d0859f3ffd/hawtio-util/src/main/java/io/hawt/util/Files.java#L58-L72
48,235
hawtio/hawtio
tooling/hawtio-maven-plugin/src/main/java/io/hawt/maven/main/SpringMain.java
SpringMain.showOptions
public void showOptions() { showOptionsHeader(); for (Option option : options) { System.out.println(option.getInformation()); } }
java
public void showOptions() { showOptionsHeader(); for (Option option : options) { System.out.println(option.getInformation()); } }
[ "public", "void", "showOptions", "(", ")", "{", "showOptionsHeader", "(", ")", ";", "for", "(", "Option", "option", ":", "options", ")", "{", "System", ".", "out", ".", "println", "(", "option", ".", "getInformation", "(", ")", ")", ";", "}", "}" ]
Displays the command line options.
[ "Displays", "the", "command", "line", "options", "." ]
d8b1c8f246307c0313ba297a494106d0859f3ffd
https://github.com/hawtio/hawtio/blob/d8b1c8f246307c0313ba297a494106d0859f3ffd/tooling/hawtio-maven-plugin/src/main/java/io/hawt/maven/main/SpringMain.java#L96-L102
48,236
hawtio/hawtio
hawtio-embedded/src/main/java/io/hawt/embedded/Main.java
Main.findWar
protected String findWar(String... paths) { if (paths != null) { for (String path : paths) { if (path != null) { File file = new File(path); if (file.exists()) { if (file.isFile()) { String na...
java
protected String findWar(String... paths) { if (paths != null) { for (String path : paths) { if (path != null) { File file = new File(path); if (file.exists()) { if (file.isFile()) { String na...
[ "protected", "String", "findWar", "(", "String", "...", "paths", ")", "{", "if", "(", "paths", "!=", "null", ")", "{", "for", "(", "String", "path", ":", "paths", ")", "{", "if", "(", "path", "!=", "null", ")", "{", "File", "file", "=", "new", "F...
Strategy method where we could use some smarts to find the war using known paths or maybe the local maven repository?
[ "Strategy", "method", "where", "we", "could", "use", "some", "smarts", "to", "find", "the", "war", "using", "known", "paths", "or", "maybe", "the", "local", "maven", "repository?" ]
d8b1c8f246307c0313ba297a494106d0859f3ffd
https://github.com/hawtio/hawtio/blob/d8b1c8f246307c0313ba297a494106d0859f3ffd/hawtio-embedded/src/main/java/io/hawt/embedded/Main.java#L231-L255
48,237
hawtio/hawtio
hawtio-system/src/main/java/io/hawt/web/auth/keycloak/KeycloakServlet.java
KeycloakServlet.defaultKeycloakConfigLocation
protected String defaultKeycloakConfigLocation() { String karafBase = System.getProperty("karaf.base"); if (karafBase != null) { return karafBase + "/etc/keycloak.json"; } String jettyHome = System.getProperty("jetty.home"); if (jettyHome != null) { retur...
java
protected String defaultKeycloakConfigLocation() { String karafBase = System.getProperty("karaf.base"); if (karafBase != null) { return karafBase + "/etc/keycloak.json"; } String jettyHome = System.getProperty("jetty.home"); if (jettyHome != null) { retur...
[ "protected", "String", "defaultKeycloakConfigLocation", "(", ")", "{", "String", "karafBase", "=", "System", ".", "getProperty", "(", "\"karaf.base\"", ")", ";", "if", "(", "karafBase", "!=", "null", ")", "{", "return", "karafBase", "+", "\"/etc/keycloak.json\"", ...
Will try to guess the config location based on the server where hawtio is running. Used just if keycloakClientConfig is not provided @return config to be used by default
[ "Will", "try", "to", "guess", "the", "config", "location", "based", "on", "the", "server", "where", "hawtio", "is", "running", ".", "Used", "just", "if", "keycloakClientConfig", "is", "not", "provided" ]
d8b1c8f246307c0313ba297a494106d0859f3ffd
https://github.com/hawtio/hawtio/blob/d8b1c8f246307c0313ba297a494106d0859f3ffd/hawtio-system/src/main/java/io/hawt/web/auth/keycloak/KeycloakServlet.java#L88-L111
48,238
hawtio/hawtio
hawtio-util/src/main/java/io/hawt/util/Zips.java
Zips.createZipFile
public static void createZipFile(Logger log, File sourceDir, File outputZipFile) throws IOException { FileFilter filter = null; createZipFile(log, sourceDir, outputZipFile, filter); }
java
public static void createZipFile(Logger log, File sourceDir, File outputZipFile) throws IOException { FileFilter filter = null; createZipFile(log, sourceDir, outputZipFile, filter); }
[ "public", "static", "void", "createZipFile", "(", "Logger", "log", ",", "File", "sourceDir", ",", "File", "outputZipFile", ")", "throws", "IOException", "{", "FileFilter", "filter", "=", "null", ";", "createZipFile", "(", "log", ",", "sourceDir", ",", "outputZ...
Creates a zip fie from the given source directory and output zip file name
[ "Creates", "a", "zip", "fie", "from", "the", "given", "source", "directory", "and", "output", "zip", "file", "name" ]
d8b1c8f246307c0313ba297a494106d0859f3ffd
https://github.com/hawtio/hawtio/blob/d8b1c8f246307c0313ba297a494106d0859f3ffd/hawtio-util/src/main/java/io/hawt/util/Zips.java#L43-L46
48,239
hawtio/hawtio
hawtio-util/src/main/java/io/hawt/util/Zips.java
Zips.zipDirectory
public static void zipDirectory(Logger log, File directory, ZipOutputStream zos, String path, FileFilter filter) throws IOException { // get a listing of the directory content File[] dirList = directory.listFiles(); byte[] readBuffer = new byte[8192]; int bytesIn = 0; // loop thr...
java
public static void zipDirectory(Logger log, File directory, ZipOutputStream zos, String path, FileFilter filter) throws IOException { // get a listing of the directory content File[] dirList = directory.listFiles(); byte[] readBuffer = new byte[8192]; int bytesIn = 0; // loop thr...
[ "public", "static", "void", "zipDirectory", "(", "Logger", "log", ",", "File", "directory", ",", "ZipOutputStream", "zos", ",", "String", "path", ",", "FileFilter", "filter", ")", "throws", "IOException", "{", "// get a listing of the directory content", "File", "["...
Zips the directory recursively into the ZIP stream given the starting path and optional filter
[ "Zips", "the", "directory", "recursively", "into", "the", "ZIP", "stream", "given", "the", "starting", "path", "and", "optional", "filter" ]
d8b1c8f246307c0313ba297a494106d0859f3ffd
https://github.com/hawtio/hawtio/blob/d8b1c8f246307c0313ba297a494106d0859f3ffd/hawtio-util/src/main/java/io/hawt/util/Zips.java#L65-L102
48,240
hawtio/hawtio
hawtio-util/src/main/java/io/hawt/util/Zips.java
Zips.unzip
public static void unzip(InputStream in, File toDir) throws IOException { ZipInputStream zis = new ZipInputStream(new BufferedInputStream(in)); try { ZipEntry entry = zis.getNextEntry(); while (entry != null) { if (!entry.isDirectory()) { Strin...
java
public static void unzip(InputStream in, File toDir) throws IOException { ZipInputStream zis = new ZipInputStream(new BufferedInputStream(in)); try { ZipEntry entry = zis.getNextEntry(); while (entry != null) { if (!entry.isDirectory()) { Strin...
[ "public", "static", "void", "unzip", "(", "InputStream", "in", ",", "File", "toDir", ")", "throws", "IOException", "{", "ZipInputStream", "zis", "=", "new", "ZipInputStream", "(", "new", "BufferedInputStream", "(", "in", ")", ")", ";", "try", "{", "ZipEntry"...
Unzips the given input stream of a ZIP to the given directory
[ "Unzips", "the", "given", "input", "stream", "of", "a", "ZIP", "to", "the", "given", "directory" ]
d8b1c8f246307c0313ba297a494106d0859f3ffd
https://github.com/hawtio/hawtio/blob/d8b1c8f246307c0313ba297a494106d0859f3ffd/hawtio-util/src/main/java/io/hawt/util/Zips.java#L111-L136
48,241
hawtio/hawtio
hawtio-util/src/main/java/io/hawt/util/IOHelper.java
IOHelper.readFully
public static String readFully(BufferedReader reader) throws IOException { if (reader == null) { return null; } StringBuilder sb = new StringBuilder(BUFFER_SIZE); char[] buf = new char[BUFFER_SIZE]; try { int len; // read until we reach then e...
java
public static String readFully(BufferedReader reader) throws IOException { if (reader == null) { return null; } StringBuilder sb = new StringBuilder(BUFFER_SIZE); char[] buf = new char[BUFFER_SIZE]; try { int len; // read until we reach then e...
[ "public", "static", "String", "readFully", "(", "BufferedReader", "reader", ")", "throws", "IOException", "{", "if", "(", "reader", "==", "null", ")", "{", "return", "null", ";", "}", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", "BUFFER_SIZE", ")...
Reads the entire reader into memory as a String
[ "Reads", "the", "entire", "reader", "into", "memory", "as", "a", "String" ]
d8b1c8f246307c0313ba297a494106d0859f3ffd
https://github.com/hawtio/hawtio/blob/d8b1c8f246307c0313ba297a494106d0859f3ffd/hawtio-util/src/main/java/io/hawt/util/IOHelper.java#L35-L53
48,242
hawtio/hawtio
hawtio-util/src/main/java/io/hawt/util/IOHelper.java
IOHelper.close
public static void close(Closeable closeable, String name, Logger log) { if (closeable != null) { try { closeable.close(); } catch (IOException e) { if (log == null) { // then fallback to use the own Logger log = LOG...
java
public static void close(Closeable closeable, String name, Logger log) { if (closeable != null) { try { closeable.close(); } catch (IOException e) { if (log == null) { // then fallback to use the own Logger log = LOG...
[ "public", "static", "void", "close", "(", "Closeable", "closeable", ",", "String", "name", ",", "Logger", "log", ")", "{", "if", "(", "closeable", "!=", "null", ")", "{", "try", "{", "closeable", ".", "close", "(", ")", ";", "}", "catch", "(", "IOExc...
Closes the given resource if it is available, logging any closing exceptions to the given log. @param closeable the object to close @param name the name of the resource @param log the log to use when reporting closure warnings, will use this class's own {@link Logger} if <tt>log == null</tt>
[ "Closes", "the", "given", "resource", "if", "it", "is", "available", "logging", "any", "closing", "exceptions", "to", "the", "given", "log", "." ]
d8b1c8f246307c0313ba297a494106d0859f3ffd
https://github.com/hawtio/hawtio/blob/d8b1c8f246307c0313ba297a494106d0859f3ffd/hawtio-util/src/main/java/io/hawt/util/IOHelper.java#L62-L78
48,243
hawtio/hawtio
hawtio-util/src/main/java/io/hawt/util/IOHelper.java
IOHelper.write
public static void write(File file, String text, boolean append) throws IOException { FileWriter writer = new FileWriter(file, append); try { writer.write(text); } finally { writer.close(); } }
java
public static void write(File file, String text, boolean append) throws IOException { FileWriter writer = new FileWriter(file, append); try { writer.write(text); } finally { writer.close(); } }
[ "public", "static", "void", "write", "(", "File", "file", ",", "String", "text", ",", "boolean", "append", ")", "throws", "IOException", "{", "FileWriter", "writer", "=", "new", "FileWriter", "(", "file", ",", "append", ")", ";", "try", "{", "writer", "....
Writes the given text to the file; either in append mode or replace mode depending the append flag
[ "Writes", "the", "given", "text", "to", "the", "file", ";", "either", "in", "append", "mode", "or", "replace", "mode", "depending", "the", "append", "flag" ]
d8b1c8f246307c0313ba297a494106d0859f3ffd
https://github.com/hawtio/hawtio/blob/d8b1c8f246307c0313ba297a494106d0859f3ffd/hawtio-util/src/main/java/io/hawt/util/IOHelper.java#L96-L103
48,244
hawtio/hawtio
hawtio-util/src/main/java/io/hawt/util/IOHelper.java
IOHelper.write
public static void write(File file, byte[] data, boolean append) throws IOException { FileOutputStream stream = new FileOutputStream(file, append); try { stream.write(data); } finally { stream.close(); } }
java
public static void write(File file, byte[] data, boolean append) throws IOException { FileOutputStream stream = new FileOutputStream(file, append); try { stream.write(data); } finally { stream.close(); } }
[ "public", "static", "void", "write", "(", "File", "file", ",", "byte", "[", "]", "data", ",", "boolean", "append", ")", "throws", "IOException", "{", "FileOutputStream", "stream", "=", "new", "FileOutputStream", "(", "file", ",", "append", ")", ";", "try",...
Writes the given data to the file; either in append mode or replace mode depending the append flag
[ "Writes", "the", "given", "data", "to", "the", "file", ";", "either", "in", "append", "mode", "or", "replace", "mode", "depending", "the", "append", "flag" ]
d8b1c8f246307c0313ba297a494106d0859f3ffd
https://github.com/hawtio/hawtio/blob/d8b1c8f246307c0313ba297a494106d0859f3ffd/hawtio-util/src/main/java/io/hawt/util/IOHelper.java#L109-L116
48,245
hawtio/hawtio
examples/springboot-1-authentication/src/main/java/io/hawt/example/spring/boot/SampleAuthenticationSpringBootService.java
SampleAuthenticationSpringBootService.configFacade
@Bean(initMethod = "init") public ConfigFacade configFacade() throws Exception { final URL loginResource = this.getClass().getClassLoader().getResource("login.conf"); if (loginResource != null) { setSystemPropertyIfNotSet(JAVA_SECURITY_AUTH_LOGIN_CONFIG, loginResource.toExternalForm());...
java
@Bean(initMethod = "init") public ConfigFacade configFacade() throws Exception { final URL loginResource = this.getClass().getClassLoader().getResource("login.conf"); if (loginResource != null) { setSystemPropertyIfNotSet(JAVA_SECURITY_AUTH_LOGIN_CONFIG, loginResource.toExternalForm());...
[ "@", "Bean", "(", "initMethod", "=", "\"init\"", ")", "public", "ConfigFacade", "configFacade", "(", ")", "throws", "Exception", "{", "final", "URL", "loginResource", "=", "this", ".", "getClass", "(", ")", ".", "getClassLoader", "(", ")", ".", "getResource"...
Configure facade to use authentication. @return config @throws Exception if an error occurs
[ "Configure", "facade", "to", "use", "authentication", "." ]
d8b1c8f246307c0313ba297a494106d0859f3ffd
https://github.com/hawtio/hawtio/blob/d8b1c8f246307c0313ba297a494106d0859f3ffd/examples/springboot-1-authentication/src/main/java/io/hawt/example/spring/boot/SampleAuthenticationSpringBootService.java#L40-L63
48,246
hawtio/hawtio
hawtio-util/src/main/java/io/hawt/util/Strings.java
Strings.sanitizeDirectory
public static String sanitizeDirectory(String name) { if (isBlank(name)) { return name; } return sanitize(name).replace(".", ""); }
java
public static String sanitizeDirectory(String name) { if (isBlank(name)) { return name; } return sanitize(name).replace(".", ""); }
[ "public", "static", "String", "sanitizeDirectory", "(", "String", "name", ")", "{", "if", "(", "isBlank", "(", "name", ")", ")", "{", "return", "name", ";", "}", "return", "sanitize", "(", "name", ")", ".", "replace", "(", "\".\"", ",", "\"\"", ")", ...
Also remove any dots in the directory name @param name @return
[ "Also", "remove", "any", "dots", "in", "the", "directory", "name" ]
d8b1c8f246307c0313ba297a494106d0859f3ffd
https://github.com/hawtio/hawtio/blob/d8b1c8f246307c0313ba297a494106d0859f3ffd/hawtio-util/src/main/java/io/hawt/util/Strings.java#L50-L55
48,247
hawtio/hawtio
tooling/hawtio-junit/src/main/java/io/hawt/junit/ThrowableDTO.java
ThrowableDTO.addThrowableAndCauses
public static void addThrowableAndCauses(List<ThrowableDTO> exceptions, Throwable exception) { if (exception != null) { ThrowableDTO dto = new ThrowableDTO(exception); exceptions.add(dto); Throwable cause = exception.getCause(); if (cause != null && cause != excep...
java
public static void addThrowableAndCauses(List<ThrowableDTO> exceptions, Throwable exception) { if (exception != null) { ThrowableDTO dto = new ThrowableDTO(exception); exceptions.add(dto); Throwable cause = exception.getCause(); if (cause != null && cause != excep...
[ "public", "static", "void", "addThrowableAndCauses", "(", "List", "<", "ThrowableDTO", ">", "exceptions", ",", "Throwable", "exception", ")", "{", "if", "(", "exception", "!=", "null", ")", "{", "ThrowableDTO", "dto", "=", "new", "ThrowableDTO", "(", "exceptio...
Adds the exception and all of the causes to the given list of exceptions
[ "Adds", "the", "exception", "and", "all", "of", "the", "causes", "to", "the", "given", "list", "of", "exceptions" ]
d8b1c8f246307c0313ba297a494106d0859f3ffd
https://github.com/hawtio/hawtio/blob/d8b1c8f246307c0313ba297a494106d0859f3ffd/tooling/hawtio-junit/src/main/java/io/hawt/junit/ThrowableDTO.java#L35-L44
48,248
hawtio/hawtio
hawtio-log/src/main/java/io/hawt/log/support/Objects.java
Objects.compare
@SuppressWarnings("unchecked") public static int compare(Object a, Object b) { if (a == b) { return 0; } if (a == null) { return -1; } if (b == null) { return 1; } if (a instanceof Comparable) { Comparable compar...
java
@SuppressWarnings("unchecked") public static int compare(Object a, Object b) { if (a == b) { return 0; } if (a == null) { return -1; } if (b == null) { return 1; } if (a instanceof Comparable) { Comparable compar...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "static", "int", "compare", "(", "Object", "a", ",", "Object", "b", ")", "{", "if", "(", "a", "==", "b", ")", "{", "return", "0", ";", "}", "if", "(", "a", "==", "null", ")", "{", "ret...
A helper method for performing an ordered comparison on the objects handling nulls and objects which do not handle sorting gracefully @param a the first object @param b the second object
[ "A", "helper", "method", "for", "performing", "an", "ordered", "comparison", "on", "the", "objects", "handling", "nulls", "and", "objects", "which", "do", "not", "handle", "sorting", "gracefully" ]
d8b1c8f246307c0313ba297a494106d0859f3ffd
https://github.com/hawtio/hawtio/blob/d8b1c8f246307c0313ba297a494106d0859f3ffd/hawtio-log/src/main/java/io/hawt/log/support/Objects.java#L26-L46
48,249
hawtio/hawtio
hawtio-system/src/main/java/io/hawt/web/auth/keycloak/KeycloakUserServlet.java
KeycloakUserServlet.getKeycloakUsername
protected String getKeycloakUsername(final HttpServletRequest req, HttpServletResponse resp) { AtomicReference<String> username = new AtomicReference<>(); Authenticator.authenticate( authConfiguration, req, subject -> { username.set(AuthHelpers.getUsername(subject...
java
protected String getKeycloakUsername(final HttpServletRequest req, HttpServletResponse resp) { AtomicReference<String> username = new AtomicReference<>(); Authenticator.authenticate( authConfiguration, req, subject -> { username.set(AuthHelpers.getUsername(subject...
[ "protected", "String", "getKeycloakUsername", "(", "final", "HttpServletRequest", "req", ",", "HttpServletResponse", "resp", ")", "{", "AtomicReference", "<", "String", ">", "username", "=", "new", "AtomicReference", "<>", "(", ")", ";", "Authenticator", ".", "aut...
With Keycloak integration, the Authorization header is available in the request to the UserServlet.
[ "With", "Keycloak", "integration", "the", "Authorization", "header", "is", "available", "in", "the", "request", "to", "the", "UserServlet", "." ]
d8b1c8f246307c0313ba297a494106d0859f3ffd
https://github.com/hawtio/hawtio/blob/d8b1c8f246307c0313ba297a494106d0859f3ffd/hawtio-system/src/main/java/io/hawt/web/auth/keycloak/KeycloakUserServlet.java#L39-L51
48,250
hawtio/hawtio
tooling/hawtio-maven-plugin/src/main/java/io/hawt/maven/BaseMojo.java
BaseMojo.filterUnwantedArtifacts
protected boolean filterUnwantedArtifacts(Artifact artifact) { // filter out maven and plexus stuff (plexus used by maven plugins) if (artifact.getGroupId().startsWith("org.apache.maven")) { return true; } else if (artifact.getGroupId().startsWith("org.codehaus.plexus")) { ...
java
protected boolean filterUnwantedArtifacts(Artifact artifact) { // filter out maven and plexus stuff (plexus used by maven plugins) if (artifact.getGroupId().startsWith("org.apache.maven")) { return true; } else if (artifact.getGroupId().startsWith("org.codehaus.plexus")) { ...
[ "protected", "boolean", "filterUnwantedArtifacts", "(", "Artifact", "artifact", ")", "{", "// filter out maven and plexus stuff (plexus used by maven plugins)", "if", "(", "artifact", ".", "getGroupId", "(", ")", ".", "startsWith", "(", "\"org.apache.maven\"", ")", ")", "...
Filter unwanted artifacts @param artifact the artifact @return <tt>true</tt> to skip this artifact, <tt>false</tt> to keep it
[ "Filter", "unwanted", "artifacts" ]
d8b1c8f246307c0313ba297a494106d0859f3ffd
https://github.com/hawtio/hawtio/blob/d8b1c8f246307c0313ba297a494106d0859f3ffd/tooling/hawtio-maven-plugin/src/main/java/io/hawt/maven/BaseMojo.java#L163-L172
48,251
hawtio/hawtio
tooling/hawtio-maven-plugin/src/main/java/io/hawt/maven/BaseMojo.java
BaseMojo.addRelevantPluginDependencies
protected void addRelevantPluginDependencies(Set<Artifact> artifacts) throws MojoExecutionException { if (pluginDependencies == null) { return; } Iterator<Artifact> iter = this.pluginDependencies.iterator(); while (iter.hasNext()) { Artifact classPathElement = it...
java
protected void addRelevantPluginDependencies(Set<Artifact> artifacts) throws MojoExecutionException { if (pluginDependencies == null) { return; } Iterator<Artifact> iter = this.pluginDependencies.iterator(); while (iter.hasNext()) { Artifact classPathElement = it...
[ "protected", "void", "addRelevantPluginDependencies", "(", "Set", "<", "Artifact", ">", "artifacts", ")", "throws", "MojoExecutionException", "{", "if", "(", "pluginDependencies", "==", "null", ")", "{", "return", ";", "}", "Iterator", "<", "Artifact", ">", "ite...
Add any relevant project dependencies to the classpath.
[ "Add", "any", "relevant", "project", "dependencies", "to", "the", "classpath", "." ]
d8b1c8f246307c0313ba297a494106d0859f3ffd
https://github.com/hawtio/hawtio/blob/d8b1c8f246307c0313ba297a494106d0859f3ffd/tooling/hawtio-maven-plugin/src/main/java/io/hawt/maven/BaseMojo.java#L228-L239
48,252
hawtio/hawtio
tooling/hawtio-maven-plugin/src/main/java/io/hawt/maven/BaseMojo.java
BaseMojo.getAllDependencies
protected Collection<Artifact> getAllDependencies() throws Exception { List<Artifact> artifacts = new ArrayList<Artifact>(); for (Iterator<?> dependencies = project.getDependencies().iterator(); dependencies.hasNext();) { Dependency dependency = (Dependency)dependencies.next(); ...
java
protected Collection<Artifact> getAllDependencies() throws Exception { List<Artifact> artifacts = new ArrayList<Artifact>(); for (Iterator<?> dependencies = project.getDependencies().iterator(); dependencies.hasNext();) { Dependency dependency = (Dependency)dependencies.next(); ...
[ "protected", "Collection", "<", "Artifact", ">", "getAllDependencies", "(", ")", "throws", "Exception", "{", "List", "<", "Artifact", ">", "artifacts", "=", "new", "ArrayList", "<", "Artifact", ">", "(", ")", ";", "for", "(", "Iterator", "<", "?", ">", "...
generic method to retrieve all the transitive dependencies
[ "generic", "method", "to", "retrieve", "all", "the", "transitive", "dependencies" ]
d8b1c8f246307c0313ba297a494106d0859f3ffd
https://github.com/hawtio/hawtio/blob/d8b1c8f246307c0313ba297a494106d0859f3ffd/tooling/hawtio-maven-plugin/src/main/java/io/hawt/maven/BaseMojo.java#L255-L303
48,253
hawtio/hawtio
hawtio-util/src/main/java/io/hawt/util/introspect/support/ClassScanner.java
ClassScanner.setClassLoaderProvider
public void setClassLoaderProvider(String id, ClassLoaderProvider classLoaderProvider) { if (classLoaderProvider != null) { classLoaderProviderMap.put(id, classLoaderProvider); } else { classLoaderProviderMap.remove(id); } }
java
public void setClassLoaderProvider(String id, ClassLoaderProvider classLoaderProvider) { if (classLoaderProvider != null) { classLoaderProviderMap.put(id, classLoaderProvider); } else { classLoaderProviderMap.remove(id); } }
[ "public", "void", "setClassLoaderProvider", "(", "String", "id", ",", "ClassLoaderProvider", "classLoaderProvider", ")", "{", "if", "(", "classLoaderProvider", "!=", "null", ")", "{", "classLoaderProviderMap", ".", "put", "(", "id", ",", "classLoaderProvider", ")", ...
Registers a named class loader provider or removes it if the classLoaderProvider is null
[ "Registers", "a", "named", "class", "loader", "provider", "or", "removes", "it", "if", "the", "classLoaderProvider", "is", "null" ]
d8b1c8f246307c0313ba297a494106d0859f3ffd
https://github.com/hawtio/hawtio/blob/d8b1c8f246307c0313ba297a494106d0859f3ffd/hawtio-util/src/main/java/io/hawt/util/introspect/support/ClassScanner.java#L82-L88
48,254
hawtio/hawtio
hawtio-util/src/main/java/io/hawt/util/introspect/support/ClassScanner.java
ClassScanner.findClassNames
public SortedSet<String> findClassNames(String search, Integer limit) { Map<Package, ClassLoader[]> packageMap = Packages.getPackageMap(getClassLoaders(), ignorePackages); return findClassNamesInPackages(search, limit, packageMap); }
java
public SortedSet<String> findClassNames(String search, Integer limit) { Map<Package, ClassLoader[]> packageMap = Packages.getPackageMap(getClassLoaders(), ignorePackages); return findClassNamesInPackages(search, limit, packageMap); }
[ "public", "SortedSet", "<", "String", ">", "findClassNames", "(", "String", "search", ",", "Integer", "limit", ")", "{", "Map", "<", "Package", ",", "ClassLoader", "[", "]", ">", "packageMap", "=", "Packages", ".", "getPackageMap", "(", "getClassLoaders", "(...
Searches for the available class names given the text search @return all the class names found on the current classpath using the given text search filter
[ "Searches", "for", "the", "available", "class", "names", "given", "the", "text", "search" ]
d8b1c8f246307c0313ba297a494106d0859f3ffd
https://github.com/hawtio/hawtio/blob/d8b1c8f246307c0313ba297a494106d0859f3ffd/hawtio-util/src/main/java/io/hawt/util/introspect/support/ClassScanner.java#L95-L98
48,255
hawtio/hawtio
hawtio-util/src/main/java/io/hawt/util/introspect/support/ClassScanner.java
ClassScanner.getAllClassesMap
public SortedMap<String, Class<?>> getAllClassesMap() { Package[] packages = Package.getPackages(); return getClassesMap(packages); }
java
public SortedMap<String, Class<?>> getAllClassesMap() { Package[] packages = Package.getPackages(); return getClassesMap(packages); }
[ "public", "SortedMap", "<", "String", ",", "Class", "<", "?", ">", ">", "getAllClassesMap", "(", ")", "{", "Package", "[", "]", "packages", "=", "Package", ".", "getPackages", "(", ")", ";", "return", "getClassesMap", "(", "packages", ")", ";", "}" ]
Returns all the classes found in a sorted map
[ "Returns", "all", "the", "classes", "found", "in", "a", "sorted", "map" ]
d8b1c8f246307c0313ba297a494106d0859f3ffd
https://github.com/hawtio/hawtio/blob/d8b1c8f246307c0313ba297a494106d0859f3ffd/hawtio-util/src/main/java/io/hawt/util/introspect/support/ClassScanner.java#L220-L223
48,256
hawtio/hawtio
hawtio-util/src/main/java/io/hawt/util/introspect/support/ClassScanner.java
ClassScanner.getClassesMap
public SortedMap<String, Class<?>> getClassesMap(Package... packages) { SortedMap<String, Class<?>> answer = new TreeMap<String, Class<?>>(); Map<String, ClassResource> urlSet = new HashMap<String, ClassResource>(); for (Package aPackage : packages) { addPackageResources(aPackage, ur...
java
public SortedMap<String, Class<?>> getClassesMap(Package... packages) { SortedMap<String, Class<?>> answer = new TreeMap<String, Class<?>>(); Map<String, ClassResource> urlSet = new HashMap<String, ClassResource>(); for (Package aPackage : packages) { addPackageResources(aPackage, ur...
[ "public", "SortedMap", "<", "String", ",", "Class", "<", "?", ">", ">", "getClassesMap", "(", "Package", "...", "packages", ")", "{", "SortedMap", "<", "String", ",", "Class", "<", "?", ">", ">", "answer", "=", "new", "TreeMap", "<", "String", ",", "...
Returns all the classes found in a sorted map for the given list of packages
[ "Returns", "all", "the", "classes", "found", "in", "a", "sorted", "map", "for", "the", "given", "list", "of", "packages" ]
d8b1c8f246307c0313ba297a494106d0859f3ffd
https://github.com/hawtio/hawtio/blob/d8b1c8f246307c0313ba297a494106d0859f3ffd/hawtio-util/src/main/java/io/hawt/util/introspect/support/ClassScanner.java#L228-L241
48,257
hawtio/hawtio
hawtio-util/src/main/java/io/hawt/util/introspect/support/ClassScanner.java
ClassScanner.findClass
public Class<?> findClass(String className) throws ClassNotFoundException { for (String skip : SKIP_CLASSES) { if (skip.equals(className)) { return null; } } for (ClassLoader classLoader : getClassLoaders()) { try { return clas...
java
public Class<?> findClass(String className) throws ClassNotFoundException { for (String skip : SKIP_CLASSES) { if (skip.equals(className)) { return null; } } for (ClassLoader classLoader : getClassLoaders()) { try { return clas...
[ "public", "Class", "<", "?", ">", "findClass", "(", "String", "className", ")", "throws", "ClassNotFoundException", "{", "for", "(", "String", "skip", ":", "SKIP_CLASSES", ")", "{", "if", "(", "skip", ".", "equals", "(", "className", ")", ")", "{", "retu...
Finds a class from its name
[ "Finds", "a", "class", "from", "its", "name" ]
d8b1c8f246307c0313ba297a494106d0859f3ffd
https://github.com/hawtio/hawtio/blob/d8b1c8f246307c0313ba297a494106d0859f3ffd/hawtio-util/src/main/java/io/hawt/util/introspect/support/ClassScanner.java#L252-L267
48,258
hawtio/hawtio
hawtio-util/src/main/java/io/hawt/util/introspect/support/ClassScanner.java
ClassScanner.optionallyFindClasses
public List<Class<?>> optionallyFindClasses(Iterable<String> classNames) { List<Class<?>> answer = new ArrayList<Class<?>>(); for (String className : classNames) { Class<?> aClass = optionallyFindClass(className); if (aClass != null) { answer.add(aClass); ...
java
public List<Class<?>> optionallyFindClasses(Iterable<String> classNames) { List<Class<?>> answer = new ArrayList<Class<?>>(); for (String className : classNames) { Class<?> aClass = optionallyFindClass(className); if (aClass != null) { answer.add(aClass); ...
[ "public", "List", "<", "Class", "<", "?", ">", ">", "optionallyFindClasses", "(", "Iterable", "<", "String", ">", "classNames", ")", "{", "List", "<", "Class", "<", "?", ">", ">", "answer", "=", "new", "ArrayList", "<", "Class", "<", "?", ">", ">", ...
Tries to find as many of the class names on the class loaders as possible and return them
[ "Tries", "to", "find", "as", "many", "of", "the", "class", "names", "on", "the", "class", "loaders", "as", "possible", "and", "return", "them" ]
d8b1c8f246307c0313ba297a494106d0859f3ffd
https://github.com/hawtio/hawtio/blob/d8b1c8f246307c0313ba297a494106d0859f3ffd/hawtio-util/src/main/java/io/hawt/util/introspect/support/ClassScanner.java#L284-L293
48,259
hawtio/hawtio
hawtio-util/src/main/java/io/hawt/util/introspect/support/ClassScanner.java
ClassScanner.withinLimit
protected boolean withinLimit(Integer limit, Collection<?> collection) { if (limit == null) { return true; } else { int value = limit.intValue(); return value <= 0 || value > collection.size(); } }
java
protected boolean withinLimit(Integer limit, Collection<?> collection) { if (limit == null) { return true; } else { int value = limit.intValue(); return value <= 0 || value > collection.size(); } }
[ "protected", "boolean", "withinLimit", "(", "Integer", "limit", ",", "Collection", "<", "?", ">", "collection", ")", "{", "if", "(", "limit", "==", "null", ")", "{", "return", "true", ";", "}", "else", "{", "int", "value", "=", "limit", ".", "intValue"...
Returns true if we are within the limit value for the number of results in the collection
[ "Returns", "true", "if", "we", "are", "within", "the", "limit", "value", "for", "the", "number", "of", "results", "in", "the", "collection" ]
d8b1c8f246307c0313ba297a494106d0859f3ffd
https://github.com/hawtio/hawtio/blob/d8b1c8f246307c0313ba297a494106d0859f3ffd/hawtio-util/src/main/java/io/hawt/util/introspect/support/ClassScanner.java#L537-L544
48,260
hawtio/hawtio
hawtio-log/src/main/java/io/hawt/log/log4j/MavenCoordHelper.java
MavenCoordHelper.findClass
protected static Class findClass(final String className) throws ClassNotFoundException { try { return Thread.currentThread().getContextClassLoader().loadClass(className); } catch (ClassNotFoundException e) { try { return Class.forName(className); } cat...
java
protected static Class findClass(final String className) throws ClassNotFoundException { try { return Thread.currentThread().getContextClassLoader().loadClass(className); } catch (ClassNotFoundException e) { try { return Class.forName(className); } cat...
[ "protected", "static", "Class", "findClass", "(", "final", "String", "className", ")", "throws", "ClassNotFoundException", "{", "try", "{", "return", "Thread", ".", "currentThread", "(", ")", ".", "getContextClassLoader", "(", ")", ".", "loadClass", "(", "classN...
Find class given class name. @param className class name, may not be null. @return class, will not be null. @throws ClassNotFoundException thrown if class can not be found.
[ "Find", "class", "given", "class", "name", "." ]
d8b1c8f246307c0313ba297a494106d0859f3ffd
https://github.com/hawtio/hawtio/blob/d8b1c8f246307c0313ba297a494106d0859f3ffd/hawtio-log/src/main/java/io/hawt/log/log4j/MavenCoordHelper.java#L105-L115
48,261
hawtio/hawtio
hawtio-core/src/main/java/io/hawt/config/ConfigFacade.java
ConfigFacade.getConfigDirectory
public File getConfigDirectory() { String dirName = getConfigDir(); File answer = null; if (Strings.isNotBlank(dirName)) { answer = new File(dirName); } else { answer = new File(".hawtio"); } answer.mkdirs(); return answer; }
java
public File getConfigDirectory() { String dirName = getConfigDir(); File answer = null; if (Strings.isNotBlank(dirName)) { answer = new File(dirName); } else { answer = new File(".hawtio"); } answer.mkdirs(); return answer; }
[ "public", "File", "getConfigDirectory", "(", ")", "{", "String", "dirName", "=", "getConfigDir", "(", ")", ";", "File", "answer", "=", "null", ";", "if", "(", "Strings", ".", "isNotBlank", "(", "dirName", ")", ")", "{", "answer", "=", "new", "File", "(...
Returns the configuration directory; lazily attempting to create it if it does not yet exist
[ "Returns", "the", "configuration", "directory", ";", "lazily", "attempting", "to", "create", "it", "if", "it", "does", "not", "yet", "exist" ]
d8b1c8f246307c0313ba297a494106d0859f3ffd
https://github.com/hawtio/hawtio/blob/d8b1c8f246307c0313ba297a494106d0859f3ffd/hawtio-core/src/main/java/io/hawt/config/ConfigFacade.java#L57-L67
48,262
hawtio/hawtio
hawtio-log/src/main/java/io/hawt/log/support/LogQuerySupport.java
LogQuerySupport.start
public void start() { MBeanServer server = getMbeanServer(); if (server != null) { registerMBeanServer(server); } else { LOG.error("No MBeanServer available so cannot register mbean"); } }
java
public void start() { MBeanServer server = getMbeanServer(); if (server != null) { registerMBeanServer(server); } else { LOG.error("No MBeanServer available so cannot register mbean"); } }
[ "public", "void", "start", "(", ")", "{", "MBeanServer", "server", "=", "getMbeanServer", "(", ")", ";", "if", "(", "server", "!=", "null", ")", "{", "registerMBeanServer", "(", "server", ")", ";", "}", "else", "{", "LOG", ".", "error", "(", "\"No MBea...
Registers the object with JMX
[ "Registers", "the", "object", "with", "JMX" ]
d8b1c8f246307c0313ba297a494106d0859f3ffd
https://github.com/hawtio/hawtio/blob/d8b1c8f246307c0313ba297a494106d0859f3ffd/hawtio-log/src/main/java/io/hawt/log/support/LogQuerySupport.java#L71-L78
48,263
hawtio/hawtio
hawtio-local-jvm-mbean/src/main/java/io/hawt/jvm/local/JVMList.java
JVMList.checkAgentUrl
protected String checkAgentUrl(Object pVm) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException { Properties systemProperties = getAgentSystemProperties(pVm); return systemProperties.getProperty(JvmAgent.JOLOKIA_AGENT_URL); }
java
protected String checkAgentUrl(Object pVm) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException { Properties systemProperties = getAgentSystemProperties(pVm); return systemProperties.getProperty(JvmAgent.JOLOKIA_AGENT_URL); }
[ "protected", "String", "checkAgentUrl", "(", "Object", "pVm", ")", "throws", "NoSuchMethodException", ",", "InvocationTargetException", ",", "IllegalAccessException", "{", "Properties", "systemProperties", "=", "getAgentSystemProperties", "(", "pVm", ")", ";", "return", ...
borrowed these from AbstractBaseCommand for now
[ "borrowed", "these", "from", "AbstractBaseCommand", "for", "now" ]
d8b1c8f246307c0313ba297a494106d0859f3ffd
https://github.com/hawtio/hawtio/blob/d8b1c8f246307c0313ba297a494106d0859f3ffd/hawtio-local-jvm-mbean/src/main/java/io/hawt/jvm/local/JVMList.java#L276-L279
48,264
hawtio/hawtio
hawtio-system/src/main/java/io/hawt/web/proxy/ProxyDetails.java
ProxyDetails.indexOf
protected int indexOf(String text, String... values) { int answer = -1; for (String value : values) { int idx = text.indexOf(value); if (idx >= 0) { if (answer < 0 || idx < answer) { answer = idx; } } } ...
java
protected int indexOf(String text, String... values) { int answer = -1; for (String value : values) { int idx = text.indexOf(value); if (idx >= 0) { if (answer < 0 || idx < answer) { answer = idx; } } } ...
[ "protected", "int", "indexOf", "(", "String", "text", ",", "String", "...", "values", ")", "{", "int", "answer", "=", "-", "1", ";", "for", "(", "String", "value", ":", "values", ")", "{", "int", "idx", "=", "text", ".", "indexOf", "(", "value", ")...
Returns the lowest index of the given list of values
[ "Returns", "the", "lowest", "index", "of", "the", "given", "list", "of", "values" ]
d8b1c8f246307c0313ba297a494106d0859f3ffd
https://github.com/hawtio/hawtio/blob/d8b1c8f246307c0313ba297a494106d0859f3ffd/hawtio-system/src/main/java/io/hawt/web/proxy/ProxyDetails.java#L195-L206
48,265
hawtio/hawtio
hawtio-util/src/main/java/io/hawt/util/FileLocker.java
FileLocker.getLock
public static FileLocker getLock(File lockFile) { lockFile.getParentFile().mkdirs(); if (!lockFile.exists()) { try { IOHelper.write(lockFile, "I have the lock!"); lockFile.deleteOnExit(); return new FileLocker(lockFile); } catch (IO...
java
public static FileLocker getLock(File lockFile) { lockFile.getParentFile().mkdirs(); if (!lockFile.exists()) { try { IOHelper.write(lockFile, "I have the lock!"); lockFile.deleteOnExit(); return new FileLocker(lockFile); } catch (IO...
[ "public", "static", "FileLocker", "getLock", "(", "File", "lockFile", ")", "{", "lockFile", ".", "getParentFile", "(", ")", ".", "mkdirs", "(", ")", ";", "if", "(", "!", "lockFile", ".", "exists", "(", ")", ")", "{", "try", "{", "IOHelper", ".", "wri...
Attempts to grab the lock for the given file, returning a FileLock if the lock has been created; otherwise it returns null
[ "Attempts", "to", "grab", "the", "lock", "for", "the", "given", "file", "returning", "a", "FileLock", "if", "the", "lock", "has", "been", "created", ";", "otherwise", "it", "returns", "null" ]
d8b1c8f246307c0313ba297a494106d0859f3ffd
https://github.com/hawtio/hawtio/blob/d8b1c8f246307c0313ba297a494106d0859f3ffd/hawtio-util/src/main/java/io/hawt/util/FileLocker.java#L16-L29
48,266
hawtio/hawtio
hawtio-util/src/main/java/io/hawt/util/Objects.java
Objects.getVersion
public static String getVersion(Class<?> aClass, String groupId, String artifactId) { String version = null; // lets try find the maven property - as the Java API rarely works :) InputStream is = null; String fileName = "/META-INF/maven/" + groupId + "/" + artifactId + ...
java
public static String getVersion(Class<?> aClass, String groupId, String artifactId) { String version = null; // lets try find the maven property - as the Java API rarely works :) InputStream is = null; String fileName = "/META-INF/maven/" + groupId + "/" + artifactId + ...
[ "public", "static", "String", "getVersion", "(", "Class", "<", "?", ">", "aClass", ",", "String", "groupId", ",", "String", "artifactId", ")", "{", "String", "version", "=", "null", ";", "// lets try find the maven property - as the Java API rarely works :)", "InputSt...
Returns the version of the given class's package or the group and artifact of the jar
[ "Returns", "the", "version", "of", "the", "given", "class", "s", "package", "or", "the", "group", "and", "artifact", "of", "the", "jar" ]
d8b1c8f246307c0313ba297a494106d0859f3ffd
https://github.com/hawtio/hawtio/blob/d8b1c8f246307c0313ba297a494106d0859f3ffd/hawtio-util/src/main/java/io/hawt/util/Objects.java#L63-L119
48,267
stripe/stripe-android
stripe/src/main/java/com/stripe/android/view/CardMultilineWidget.java
CardMultilineWidget.clear
public void clear() { mCardNumberEditText.setText(""); mExpiryDateEditText.setText(""); mCvcEditText.setText(""); mPostalCodeEditText.setText(""); mCardNumberEditText.setShouldShowError(false); mExpiryDateEditText.setShouldShowError(false); mCvcEditText.setShouldS...
java
public void clear() { mCardNumberEditText.setText(""); mExpiryDateEditText.setText(""); mCvcEditText.setText(""); mPostalCodeEditText.setText(""); mCardNumberEditText.setShouldShowError(false); mExpiryDateEditText.setShouldShowError(false); mCvcEditText.setShouldS...
[ "public", "void", "clear", "(", ")", "{", "mCardNumberEditText", ".", "setText", "(", "\"\"", ")", ";", "mExpiryDateEditText", ".", "setText", "(", "\"\"", ")", ";", "mCvcEditText", ".", "setText", "(", "\"\"", ")", ";", "mPostalCodeEditText", ".", "setText"...
Clear all entered data and hide all error messages.
[ "Clear", "all", "entered", "data", "and", "hide", "all", "error", "messages", "." ]
0f199255f3769a3b84583fe3ace47bfae8c3b1c8
https://github.com/stripe/stripe-android/blob/0f199255f3769a3b84583fe3ace47bfae8c3b1c8/stripe/src/main/java/com/stripe/android/view/CardMultilineWidget.java#L94-L104
48,268
stripe/stripe-android
stripe/src/main/java/com/stripe/android/view/CardMultilineWidget.java
CardMultilineWidget.validateCardNumber
public boolean validateCardNumber() { boolean cardNumberIsValid = CardUtils.isValidCardNumber(mCardNumberEditText.getCardNumber()); mCardNumberEditText.setShouldShowError(!cardNumberIsValid); return cardNumberIsValid; }
java
public boolean validateCardNumber() { boolean cardNumberIsValid = CardUtils.isValidCardNumber(mCardNumberEditText.getCardNumber()); mCardNumberEditText.setShouldShowError(!cardNumberIsValid); return cardNumberIsValid; }
[ "public", "boolean", "validateCardNumber", "(", ")", "{", "boolean", "cardNumberIsValid", "=", "CardUtils", ".", "isValidCardNumber", "(", "mCardNumberEditText", ".", "getCardNumber", "(", ")", ")", ";", "mCardNumberEditText", ".", "setShouldShowError", "(", "!", "c...
Checks whether the current card number is valid
[ "Checks", "whether", "the", "current", "card", "number", "is", "valid" ]
0f199255f3769a3b84583fe3ace47bfae8c3b1c8
https://github.com/stripe/stripe-android/blob/0f199255f3769a3b84583fe3ace47bfae8c3b1c8/stripe/src/main/java/com/stripe/android/view/CardMultilineWidget.java#L200-L205
48,269
stripe/stripe-android
stripe/src/main/java/com/stripe/android/view/CardInputWidget.java
CardInputWidget.setExpiryDate
public void setExpiryDate( @IntRange(from = 1, to = 12) int month, @IntRange(from = 0, to = 9999) int year) { mExpiryDateEditText.setText(DateUtils.createDateStringFromIntegerInput(month, year)); }
java
public void setExpiryDate( @IntRange(from = 1, to = 12) int month, @IntRange(from = 0, to = 9999) int year) { mExpiryDateEditText.setText(DateUtils.createDateStringFromIntegerInput(month, year)); }
[ "public", "void", "setExpiryDate", "(", "@", "IntRange", "(", "from", "=", "1", ",", "to", "=", "12", ")", "int", "month", ",", "@", "IntRange", "(", "from", "=", "0", ",", "to", "=", "9999", ")", "int", "year", ")", "{", "mExpiryDateEditText", "."...
Set the expiration date. Method invokes completion listener and changes focus to the CVC field if a valid date is entered. Note that while a four-digit and two-digit year will both work, information beyond the tens digit of a year will be truncated. Logic elsewhere in the SDK makes assumptions about what century is im...
[ "Set", "the", "expiration", "date", ".", "Method", "invokes", "completion", "listener", "and", "changes", "focus", "to", "the", "CVC", "field", "if", "a", "valid", "date", "is", "entered", "." ]
0f199255f3769a3b84583fe3ace47bfae8c3b1c8
https://github.com/stripe/stripe-android/blob/0f199255f3769a3b84583fe3ace47bfae8c3b1c8/stripe/src/main/java/com/stripe/android/view/CardInputWidget.java#L165-L169
48,270
stripe/stripe-android
stripe/src/main/java/com/stripe/android/view/CardInputWidget.java
CardInputWidget.clear
public void clear() { if (mCardNumberEditText.hasFocus() || mExpiryDateEditText.hasFocus() || mCvcNumberEditText.hasFocus() || this.hasFocus()) { mCardNumberEditText.requestFocus(); } mCvcNumberEditText.setText(""); mExpiryDateE...
java
public void clear() { if (mCardNumberEditText.hasFocus() || mExpiryDateEditText.hasFocus() || mCvcNumberEditText.hasFocus() || this.hasFocus()) { mCardNumberEditText.requestFocus(); } mCvcNumberEditText.setText(""); mExpiryDateE...
[ "public", "void", "clear", "(", ")", "{", "if", "(", "mCardNumberEditText", ".", "hasFocus", "(", ")", "||", "mExpiryDateEditText", ".", "hasFocus", "(", ")", "||", "mCvcNumberEditText", ".", "hasFocus", "(", ")", "||", "this", ".", "hasFocus", "(", ")", ...
Clear all text fields in the CardInputWidget.
[ "Clear", "all", "text", "fields", "in", "the", "CardInputWidget", "." ]
0f199255f3769a3b84583fe3ace47bfae8c3b1c8
https://github.com/stripe/stripe-android/blob/0f199255f3769a3b84583fe3ace47bfae8c3b1c8/stripe/src/main/java/com/stripe/android/view/CardInputWidget.java#L184-L194
48,271
stripe/stripe-android
stripe/src/main/java/com/stripe/android/view/CardInputWidget.java
CardInputWidget.setEnabled
public void setEnabled(boolean isEnabled) { mCardNumberEditText.setEnabled(isEnabled); mExpiryDateEditText.setEnabled(isEnabled); mCvcNumberEditText.setEnabled(isEnabled); }
java
public void setEnabled(boolean isEnabled) { mCardNumberEditText.setEnabled(isEnabled); mExpiryDateEditText.setEnabled(isEnabled); mCvcNumberEditText.setEnabled(isEnabled); }
[ "public", "void", "setEnabled", "(", "boolean", "isEnabled", ")", "{", "mCardNumberEditText", ".", "setEnabled", "(", "isEnabled", ")", ";", "mExpiryDateEditText", ".", "setEnabled", "(", "isEnabled", ")", ";", "mCvcNumberEditText", ".", "setEnabled", "(", "isEnab...
Enable or disable text fields @param isEnabled boolean indicating whether fields should be enabled
[ "Enable", "or", "disable", "text", "fields" ]
0f199255f3769a3b84583fe3ace47bfae8c3b1c8
https://github.com/stripe/stripe-android/blob/0f199255f3769a3b84583fe3ace47bfae8c3b1c8/stripe/src/main/java/com/stripe/android/view/CardInputWidget.java#L201-L205
48,272
stripe/stripe-android
stripe/src/main/java/com/stripe/android/view/StripeEditText.java
StripeEditText.setHintDelayed
public void setHintDelayed(@StringRes final int hintResource, long delayMilliseconds) { final Runnable hintRunnable = new Runnable() { @Override public void run() { setHint(hintResource); } }; mHandler.postDelayed(hintRunnable, delayMillisecond...
java
public void setHintDelayed(@StringRes final int hintResource, long delayMilliseconds) { final Runnable hintRunnable = new Runnable() { @Override public void run() { setHint(hintResource); } }; mHandler.postDelayed(hintRunnable, delayMillisecond...
[ "public", "void", "setHintDelayed", "(", "@", "StringRes", "final", "int", "hintResource", ",", "long", "delayMilliseconds", ")", "{", "final", "Runnable", "hintRunnable", "=", "new", "Runnable", "(", ")", "{", "@", "Override", "public", "void", "run", "(", ...
Change the hint value of this control after a delay. @param hintResource the string resource for the hint to be set @param delayMilliseconds a delay period, measured in milliseconds
[ "Change", "the", "hint", "value", "of", "this", "control", "after", "a", "delay", "." ]
0f199255f3769a3b84583fe3ace47bfae8c3b1c8
https://github.com/stripe/stripe-android/blob/0f199255f3769a3b84583fe3ace47bfae8c3b1c8/stripe/src/main/java/com/stripe/android/view/StripeEditText.java#L140-L148
48,273
stripe/stripe-android
stripe/src/main/java/com/stripe/android/view/StripeEditText.java
StripeEditText.setShouldShowError
public void setShouldShowError(boolean shouldShowError) { if (mErrorMessage != null && mErrorMessageListener != null) { String errorMessage = shouldShowError ? mErrorMessage : null; mErrorMessageListener.displayErrorMessage(errorMessage); mShouldShowError = shouldShowError; ...
java
public void setShouldShowError(boolean shouldShowError) { if (mErrorMessage != null && mErrorMessageListener != null) { String errorMessage = shouldShowError ? mErrorMessage : null; mErrorMessageListener.displayErrorMessage(errorMessage); mShouldShowError = shouldShowError; ...
[ "public", "void", "setShouldShowError", "(", "boolean", "shouldShowError", ")", "{", "if", "(", "mErrorMessage", "!=", "null", "&&", "mErrorMessageListener", "!=", "null", ")", "{", "String", "errorMessage", "=", "shouldShowError", "?", "mErrorMessage", ":", "null...
Sets whether or not the text should be put into "error mode," which displays the text in an error color determined by the original text color. @param shouldShowError whether or not we should display text in an error state.
[ "Sets", "whether", "or", "not", "the", "text", "should", "be", "put", "into", "error", "mode", "which", "displays", "the", "text", "in", "an", "error", "color", "determined", "by", "the", "original", "text", "color", "." ]
0f199255f3769a3b84583fe3ace47bfae8c3b1c8
https://github.com/stripe/stripe-android/blob/0f199255f3769a3b84583fe3ace47bfae8c3b1c8/stripe/src/main/java/com/stripe/android/view/StripeEditText.java#L156-L171
48,274
stripe/stripe-android
example/src/main/java/com/stripe/example/activity/RedirectActivity.java
RedirectActivity.showDialog
private void showDialog(@NonNull final Source source) { // Caching the source object here because this app makes a lot of them. mRedirectSource = source; final SourceRedirect sourceRedirect = source.getRedirect(); final String redirectUrl = sourceRedirect != null ? sourceRedirect.getUrl...
java
private void showDialog(@NonNull final Source source) { // Caching the source object here because this app makes a lot of them. mRedirectSource = source; final SourceRedirect sourceRedirect = source.getRedirect(); final String redirectUrl = sourceRedirect != null ? sourceRedirect.getUrl...
[ "private", "void", "showDialog", "(", "@", "NonNull", "final", "Source", "source", ")", "{", "// Caching the source object here because this app makes a lot of them.", "mRedirectSource", "=", "source", ";", "final", "SourceRedirect", "sourceRedirect", "=", "source", ".", ...
Show a dialog with a link to the external verification site. @param source the {@link Source} to verify
[ "Show", "a", "dialog", "with", "a", "link", "to", "the", "external", "verification", "site", "." ]
0f199255f3769a3b84583fe3ace47bfae8c3b1c8
https://github.com/stripe/stripe-android/blob/0f199255f3769a3b84583fe3ace47bfae8c3b1c8/example/src/main/java/com/stripe/example/activity/RedirectActivity.java#L259-L268
48,275
stripe/stripe-android
samplestore/src/main/java/com/stripe/samplestore/StoreActivity.java
StoreActivity.handlePostAuthReturn
private void handlePostAuthReturn() { final Uri intentUri = getIntent().getData(); if (intentUri != null) { if ("stripe".equals(intentUri.getScheme()) && "payment-auth-return".equals(intentUri.getHost())) { final String paymentIntentClientSecret = ...
java
private void handlePostAuthReturn() { final Uri intentUri = getIntent().getData(); if (intentUri != null) { if ("stripe".equals(intentUri.getScheme()) && "payment-auth-return".equals(intentUri.getHost())) { final String paymentIntentClientSecret = ...
[ "private", "void", "handlePostAuthReturn", "(", ")", "{", "final", "Uri", "intentUri", "=", "getIntent", "(", ")", ".", "getData", "(", ")", ";", "if", "(", "intentUri", "!=", "null", ")", "{", "if", "(", "\"stripe\"", ".", "equals", "(", "intentUri", ...
If the intent URI matches the post auth deep-link URI, the user attempted to authenticate payment and was returned to the app. Retrieve the PaymentIntent and inform the user about the state of their payment.
[ "If", "the", "intent", "URI", "matches", "the", "post", "auth", "deep", "-", "link", "URI", "the", "user", "attempted", "to", "authenticate", "payment", "and", "was", "returned", "to", "the", "app", ".", "Retrieve", "the", "PaymentIntent", "and", "inform", ...
0f199255f3769a3b84583fe3ace47bfae8c3b1c8
https://github.com/stripe/stripe-android/blob/0f199255f3769a3b84583fe3ace47bfae8c3b1c8/samplestore/src/main/java/com/stripe/samplestore/StoreActivity.java#L117-L144
48,276
stripe/stripe-android
stripe/src/main/java/com/stripe/android/view/DateUtils.java
DateUtils.separateDateStringParts
@Size(2) @NonNull static String[] separateDateStringParts(@NonNull @Size(max = 4) String expiryInput) { String[] parts = new String[2]; if (expiryInput.length() >= 2) { parts[0] = expiryInput.substring(0, 2); parts[1] = expiryInput.substring(2); } else { ...
java
@Size(2) @NonNull static String[] separateDateStringParts(@NonNull @Size(max = 4) String expiryInput) { String[] parts = new String[2]; if (expiryInput.length() >= 2) { parts[0] = expiryInput.substring(0, 2); parts[1] = expiryInput.substring(2); } else { ...
[ "@", "Size", "(", "2", ")", "@", "NonNull", "static", "String", "[", "]", "separateDateStringParts", "(", "@", "NonNull", "@", "Size", "(", "max", "=", "4", ")", "String", "expiryInput", ")", "{", "String", "[", "]", "parts", "=", "new", "String", "[...
Separates raw string input of the format MMYY into a "month" group and a "year" group. Either or both of these may be incomplete. This method does not check to see if the input is valid. @param expiryInput up to four characters of user input @return a length-2 array containing the first two characters in the 0 index, ...
[ "Separates", "raw", "string", "input", "of", "the", "format", "MMYY", "into", "a", "month", "group", "and", "a", "year", "group", ".", "Either", "or", "both", "of", "these", "may", "be", "incomplete", ".", "This", "method", "does", "not", "check", "to", ...
0f199255f3769a3b84583fe3ace47bfae8c3b1c8
https://github.com/stripe/stripe-android/blob/0f199255f3769a3b84583fe3ace47bfae8c3b1c8/stripe/src/main/java/com/stripe/android/view/DateUtils.java#L44-L56
48,277
stripe/stripe-android
stripe/src/main/java/com/stripe/android/view/DateUtils.java
DateUtils.convertTwoDigitYearToFour
@IntRange(from = 1000, to = 9999) static int convertTwoDigitYearToFour(@IntRange(from = 0, to = 99) int inputYear) { return convertTwoDigitYearToFour(inputYear, Calendar.getInstance()); }
java
@IntRange(from = 1000, to = 9999) static int convertTwoDigitYearToFour(@IntRange(from = 0, to = 99) int inputYear) { return convertTwoDigitYearToFour(inputYear, Calendar.getInstance()); }
[ "@", "IntRange", "(", "from", "=", "1000", ",", "to", "=", "9999", ")", "static", "int", "convertTwoDigitYearToFour", "(", "@", "IntRange", "(", "from", "=", "0", ",", "to", "=", "99", ")", "int", "inputYear", ")", "{", "return", "convertTwoDigitYearToFo...
Converts a two-digit input year to a four-digit year. As the current calendar year approaches a century, we assume small values to mean the next century. For instance, if the current year is 2090, and the input value is "18", the user probably means 2118, not 2018. However, in 2017, the input "18" probably means 2018. ...
[ "Converts", "a", "two", "-", "digit", "input", "year", "to", "a", "four", "-", "digit", "year", ".", "As", "the", "current", "calendar", "year", "approaches", "a", "century", "we", "assume", "small", "values", "to", "mean", "the", "next", "century", ".",...
0f199255f3769a3b84583fe3ace47bfae8c3b1c8
https://github.com/stripe/stripe-android/blob/0f199255f3769a3b84583fe3ace47bfae8c3b1c8/stripe/src/main/java/com/stripe/android/view/DateUtils.java#L143-L146
48,278
stripe/stripe-android
stripe/src/main/java/com/stripe/android/model/SourceParams.java
SourceParams.createSourceFromTokenParams
@NonNull public static SourceParams createSourceFromTokenParams(String tokenId) { SourceParams sourceParams = SourceParams.createCustomParams(); sourceParams.setType(Source.CARD); sourceParams.setToken(tokenId); return sourceParams; }
java
@NonNull public static SourceParams createSourceFromTokenParams(String tokenId) { SourceParams sourceParams = SourceParams.createCustomParams(); sourceParams.setType(Source.CARD); sourceParams.setToken(tokenId); return sourceParams; }
[ "@", "NonNull", "public", "static", "SourceParams", "createSourceFromTokenParams", "(", "String", "tokenId", ")", "{", "SourceParams", "sourceParams", "=", "SourceParams", ".", "createCustomParams", "(", ")", ";", "sourceParams", ".", "setType", "(", "Source", ".", ...
Create parameters necessary for converting a token into a source @param tokenId the id of the {@link Token} to be converted into a source. @return a {@link SourceParams} object that can be used to create a source.
[ "Create", "parameters", "necessary", "for", "converting", "a", "token", "into", "a", "source" ]
0f199255f3769a3b84583fe3ace47bfae8c3b1c8
https://github.com/stripe/stripe-android/blob/0f199255f3769a3b84583fe3ace47bfae8c3b1c8/stripe/src/main/java/com/stripe/android/model/SourceParams.java#L248-L254
48,279
stripe/stripe-android
stripe/src/main/java/com/stripe/android/model/SourceParams.java
SourceParams.createRetrieveSourceParams
@NonNull public static Map<String, Object> createRetrieveSourceParams( @NonNull @Size(min = 1) String clientSecret) { final Map<String, Object> params = new HashMap<>(); params.put(API_PARAM_CLIENT_SECRET, clientSecret); return params; }
java
@NonNull public static Map<String, Object> createRetrieveSourceParams( @NonNull @Size(min = 1) String clientSecret) { final Map<String, Object> params = new HashMap<>(); params.put(API_PARAM_CLIENT_SECRET, clientSecret); return params; }
[ "@", "NonNull", "public", "static", "Map", "<", "String", ",", "Object", ">", "createRetrieveSourceParams", "(", "@", "NonNull", "@", "Size", "(", "min", "=", "1", ")", "String", "clientSecret", ")", "{", "final", "Map", "<", "String", ",", "Object", ">"...
Create parameters needed to retrieve a source. @param clientSecret the client secret for the source, needed because the Android SDK uses a public key @return a {@link Map} matching the parameter name to the client secret, ready to send to the server.
[ "Create", "parameters", "needed", "to", "retrieve", "a", "source", "." ]
0f199255f3769a3b84583fe3ace47bfae8c3b1c8
https://github.com/stripe/stripe-android/blob/0f199255f3769a3b84583fe3ace47bfae8c3b1c8/stripe/src/main/java/com/stripe/android/model/SourceParams.java#L608-L614
48,280
stripe/stripe-android
example/src/main/java/com/stripe/example/module/DependencyHandler.java
DependencyHandler.clearReferences
public void clearReferences() { if (mAsyncTaskController != null) { mAsyncTaskController.detach(); } if (mRxTokenController != null) { mRxTokenController.detach(); } if (mIntentServiceTokenController != null) { mIntentServiceTokenController....
java
public void clearReferences() { if (mAsyncTaskController != null) { mAsyncTaskController.detach(); } if (mRxTokenController != null) { mRxTokenController.detach(); } if (mIntentServiceTokenController != null) { mIntentServiceTokenController....
[ "public", "void", "clearReferences", "(", ")", "{", "if", "(", "mAsyncTaskController", "!=", "null", ")", "{", "mAsyncTaskController", ".", "detach", "(", ")", ";", "}", "if", "(", "mRxTokenController", "!=", "null", ")", "{", "mRxTokenController", ".", "det...
Clear all the references so that we can start over again.
[ "Clear", "all", "the", "references", "so", "that", "we", "can", "start", "over", "again", "." ]
0f199255f3769a3b84583fe3ace47bfae8c3b1c8
https://github.com/stripe/stripe-android/blob/0f199255f3769a3b84583fe3ace47bfae8c3b1c8/example/src/main/java/com/stripe/example/module/DependencyHandler.java#L125-L142
48,281
playn/playn
core/src/playn/core/Surface.java
Surface.rotate
public Surface rotate (float angle) { float sr = (float) Math.sin(angle); float cr = (float) Math.cos(angle); transform(cr, sr, -sr, cr, 0, 0); return this; }
java
public Surface rotate (float angle) { float sr = (float) Math.sin(angle); float cr = (float) Math.cos(angle); transform(cr, sr, -sr, cr, 0, 0); return this; }
[ "public", "Surface", "rotate", "(", "float", "angle", ")", "{", "float", "sr", "=", "(", "float", ")", "Math", ".", "sin", "(", "angle", ")", ";", "float", "cr", "=", "(", "float", ")", "Math", ".", "cos", "(", "angle", ")", ";", "transform", "("...
Rotates the current transformation matrix by the specified angle in radians.
[ "Rotates", "the", "current", "transformation", "matrix", "by", "the", "specified", "angle", "in", "radians", "." ]
7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66
https://github.com/playn/playn/blob/7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66/core/src/playn/core/Surface.java#L168-L173
48,282
playn/playn
core/src/playn/core/Surface.java
Surface.transform
public Surface transform (float m00, float m01, float m10, float m11, float tx, float ty) { AffineTransform top = tx(); Transforms.multiply(top, m00, m01, m10, m11, tx, ty, top); return this; }
java
public Surface transform (float m00, float m01, float m10, float m11, float tx, float ty) { AffineTransform top = tx(); Transforms.multiply(top, m00, m01, m10, m11, tx, ty, top); return this; }
[ "public", "Surface", "transform", "(", "float", "m00", ",", "float", "m01", ",", "float", "m10", ",", "float", "m11", ",", "float", "tx", ",", "float", "ty", ")", "{", "AffineTransform", "top", "=", "tx", "(", ")", ";", "Transforms", ".", "multiply", ...
Multiplies the current transformation matrix by the given matrix.
[ "Multiplies", "the", "current", "transformation", "matrix", "by", "the", "given", "matrix", "." ]
7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66
https://github.com/playn/playn/blob/7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66/core/src/playn/core/Surface.java#L176-L180
48,283
playn/playn
core/src/playn/core/Surface.java
Surface.intersects
public boolean intersects (float x, float y, float w, float h) { tx().transform(intersectionTestPoint.set(x, y), intersectionTestPoint); tx().transform(intersectionTestSize.set(w, h), intersectionTestSize); float ix = intersectionTestPoint.x, iy = intersectionTestPoint.y; float iw = intersectionTestSize...
java
public boolean intersects (float x, float y, float w, float h) { tx().transform(intersectionTestPoint.set(x, y), intersectionTestPoint); tx().transform(intersectionTestSize.set(w, h), intersectionTestSize); float ix = intersectionTestPoint.x, iy = intersectionTestPoint.y; float iw = intersectionTestSize...
[ "public", "boolean", "intersects", "(", "float", "x", ",", "float", "y", ",", "float", "w", ",", "float", "h", ")", "{", "tx", "(", ")", ".", "transform", "(", "intersectionTestPoint", ".", "set", "(", "x", ",", "y", ")", ",", "intersectionTestPoint", ...
Returns whether the given rectangle intersects the render target area of this surface.
[ "Returns", "whether", "the", "given", "rectangle", "intersects", "the", "render", "target", "area", "of", "this", "surface", "." ]
7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66
https://github.com/playn/playn/blob/7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66/core/src/playn/core/Surface.java#L258-L271
48,284
playn/playn
core/src/playn/core/Surface.java
Surface.fillRect
public Surface fillRect (float x, float y, float width, float height) { if (patternTex != null) { batch.addQuad(patternTex, tint, tx(), x, y, width, height); } else { batch.addQuad(colorTex, Tint.combine(fillColor, tint), tx(), x, y, width, height); } return this; }
java
public Surface fillRect (float x, float y, float width, float height) { if (patternTex != null) { batch.addQuad(patternTex, tint, tx(), x, y, width, height); } else { batch.addQuad(colorTex, Tint.combine(fillColor, tint), tx(), x, y, width, height); } return this; }
[ "public", "Surface", "fillRect", "(", "float", "x", ",", "float", "y", ",", "float", "width", ",", "float", "height", ")", "{", "if", "(", "patternTex", "!=", "null", ")", "{", "batch", ".", "addQuad", "(", "patternTex", ",", "tint", ",", "tx", "(", ...
Fills the specified rectangle.
[ "Fills", "the", "specified", "rectangle", "." ]
7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66
https://github.com/playn/playn/blob/7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66/core/src/playn/core/Surface.java#L385-L392
48,285
playn/playn
java-lwjgl2/src/playn/java/SharedLibraryExtractor.java
SharedLibraryExtractor.platformNames
private String[] platformNames(String libraryName) { if (isWindows) return new String[] { libraryName + (is64Bit ? "64.dll" : ".dll") }; if (isLinux) return new String[] { "lib" + libraryName + (is64Bit ? "64.so" : ".so") }; if (isMac) return new String[] { "lib" + libraryName + ".jnilib", ...
java
private String[] platformNames(String libraryName) { if (isWindows) return new String[] { libraryName + (is64Bit ? "64.dll" : ".dll") }; if (isLinux) return new String[] { "lib" + libraryName + (is64Bit ? "64.so" : ".so") }; if (isMac) return new String[] { "lib" + libraryName + ".jnilib", ...
[ "private", "String", "[", "]", "platformNames", "(", "String", "libraryName", ")", "{", "if", "(", "isWindows", ")", "return", "new", "String", "[", "]", "{", "libraryName", "+", "(", "is64Bit", "?", "\"64.dll\"", ":", "\".dll\"", ")", "}", ";", "if", ...
Maps a platform independent library name to one or more platform dependent names.
[ "Maps", "a", "platform", "independent", "library", "name", "to", "one", "or", "more", "platform", "dependent", "names", "." ]
7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66
https://github.com/playn/playn/blob/7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66/java-lwjgl2/src/playn/java/SharedLibraryExtractor.java#L89-L95
48,286
playn/playn
java-lwjgl2/src/playn/java/SharedLibraryExtractor.java
SharedLibraryExtractor.crc
private String crc(InputStream input) { if (input == null) throw new IllegalArgumentException("input cannot be null."); CRC32 crc = new CRC32(); byte[] buffer = new byte[4096]; try { while (true) { int length = input.read(buffer); if (length == -1) break; crc.update(b...
java
private String crc(InputStream input) { if (input == null) throw new IllegalArgumentException("input cannot be null."); CRC32 crc = new CRC32(); byte[] buffer = new byte[4096]; try { while (true) { int length = input.read(buffer); if (length == -1) break; crc.update(b...
[ "private", "String", "crc", "(", "InputStream", "input", ")", "{", "if", "(", "input", "==", "null", ")", "throw", "new", "IllegalArgumentException", "(", "\"input cannot be null.\"", ")", ";", "CRC32", "crc", "=", "new", "CRC32", "(", ")", ";", "byte", "[...
Returns a CRC of the remaining bytes in the stream.
[ "Returns", "a", "CRC", "of", "the", "remaining", "bytes", "in", "the", "stream", "." ]
7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66
https://github.com/playn/playn/blob/7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66/java-lwjgl2/src/playn/java/SharedLibraryExtractor.java#L98-L116
48,287
playn/playn
html/src/playn/super/java/nio/CharBuffer.java
CharBuffer.put
public CharBuffer put (String str, int start, int end) { int length = str.length(); if (start < 0 || end < start || end > length) { throw new IndexOutOfBoundsException(); } if (end - start > remaining()) { throw new BufferOverflowException(); } fo...
java
public CharBuffer put (String str, int start, int end) { int length = str.length(); if (start < 0 || end < start || end > length) { throw new IndexOutOfBoundsException(); } if (end - start > remaining()) { throw new BufferOverflowException(); } fo...
[ "public", "CharBuffer", "put", "(", "String", "str", ",", "int", "start", ",", "int", "end", ")", "{", "int", "length", "=", "str", ".", "length", "(", ")", ";", "if", "(", "start", "<", "0", "||", "end", "<", "start", "||", "end", ">", "length",...
Writes chars of the given string to the current position of this buffer, and increases the position by the number of chars written. @param str the string to write. @param start the first char to write, must not be negative and not greater than {@code str.length()}. @param end the last char to write (excluding), must b...
[ "Writes", "chars", "of", "the", "given", "string", "to", "the", "current", "position", "of", "this", "buffer", "and", "increases", "the", "position", "by", "the", "number", "of", "chars", "written", "." ]
7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66
https://github.com/playn/playn/blob/7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66/html/src/playn/super/java/nio/CharBuffer.java#L413-L426
48,288
playn/playn
core/src/playn/core/Net.java
Net.get
public RFuture<String> get(String url) { return req(url).execute().map(GET_PAYLOAD); }
java
public RFuture<String> get(String url) { return req(url).execute().map(GET_PAYLOAD); }
[ "public", "RFuture", "<", "String", ">", "get", "(", "String", "url", ")", "{", "return", "req", "(", "url", ")", ".", "execute", "(", ")", ".", "map", "(", "GET_PAYLOAD", ")", ";", "}" ]
Performs an HTTP GET request to the specified URL.
[ "Performs", "an", "HTTP", "GET", "request", "to", "the", "specified", "URL", "." ]
7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66
https://github.com/playn/playn/blob/7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66/core/src/playn/core/Net.java#L265-L267
48,289
playn/playn
core/src/playn/core/Net.java
Net.post
public RFuture<String> post(String url, String data) { return req(url).setPayload(data).execute().map(GET_PAYLOAD); }
java
public RFuture<String> post(String url, String data) { return req(url).setPayload(data).execute().map(GET_PAYLOAD); }
[ "public", "RFuture", "<", "String", ">", "post", "(", "String", "url", ",", "String", "data", ")", "{", "return", "req", "(", "url", ")", ".", "setPayload", "(", "data", ")", ".", "execute", "(", ")", ".", "map", "(", "GET_PAYLOAD", ")", ";", "}" ]
Performs an HTTP POST request to the specified URL.
[ "Performs", "an", "HTTP", "POST", "request", "to", "the", "specified", "URL", "." ]
7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66
https://github.com/playn/playn/blob/7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66/core/src/playn/core/Net.java#L272-L274
48,290
playn/playn
core/src/playn/core/Image.java
Image.region
public Region region (final float rx, final float ry, final float rwidth, final float rheight) { final Image image = this; return new Region() { private Tile tile; @Override public boolean isLoaded () { return image.isLoaded(); } @Override public Tile tile () { if (tile == null) tile =...
java
public Region region (final float rx, final float ry, final float rwidth, final float rheight) { final Image image = this; return new Region() { private Tile tile; @Override public boolean isLoaded () { return image.isLoaded(); } @Override public Tile tile () { if (tile == null) tile =...
[ "public", "Region", "region", "(", "final", "float", "rx", ",", "final", "float", "ry", ",", "final", "float", "rwidth", ",", "final", "float", "rheight", ")", "{", "final", "Image", "image", "=", "this", ";", "return", "new", "Region", "(", ")", "{", ...
Returns a region of this image which can be drawn independently.
[ "Returns", "a", "region", "of", "this", "image", "which", "can", "be", "drawn", "independently", "." ]
7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66
https://github.com/playn/playn/blob/7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66/core/src/playn/core/Image.java#L194-L220
48,291
playn/playn
scene/src/playn/scene/CanvasLayer.java
CanvasLayer.resize
public void resize (float width, float height) { if (canvas != null) canvas.close(); canvas = gfx.createCanvas(width, height); }
java
public void resize (float width, float height) { if (canvas != null) canvas.close(); canvas = gfx.createCanvas(width, height); }
[ "public", "void", "resize", "(", "float", "width", ",", "float", "height", ")", "{", "if", "(", "canvas", "!=", "null", ")", "canvas", ".", "close", "(", ")", ";", "canvas", "=", "gfx", ".", "createCanvas", "(", "width", ",", "height", ")", ";", "}...
Resizes the canvas that is displayed by this layer. <p>Note: this throws away the old canvas and creates a new blank canvas with the desired size. Thus this should immediately be followed by a {@link #begin}/{@link #end} pair which updates the contents of the new canvas. Until then, it will display the old image data.
[ "Resizes", "the", "canvas", "that", "is", "displayed", "by", "this", "layer", "." ]
7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66
https://github.com/playn/playn/blob/7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66/scene/src/playn/scene/CanvasLayer.java#L71-L74
48,292
playn/playn
scene/src/playn/scene/CanvasLayer.java
CanvasLayer.end
public void end () { Texture tex = (Texture)tile(); Image image = canvas.image; // if our texture is already the right size, just update it if (tex != null && tex.pixelWidth == image.pixelWidth() && tex.pixelHeight == image.pixelHeight()) tex.update(image); // otherwise we need to create a n...
java
public void end () { Texture tex = (Texture)tile(); Image image = canvas.image; // if our texture is already the right size, just update it if (tex != null && tex.pixelWidth == image.pixelWidth() && tex.pixelHeight == image.pixelHeight()) tex.update(image); // otherwise we need to create a n...
[ "public", "void", "end", "(", ")", "{", "Texture", "tex", "=", "(", "Texture", ")", "tile", "(", ")", ";", "Image", "image", "=", "canvas", ".", "image", ";", "// if our texture is already the right size, just update it", "if", "(", "tex", "!=", "null", "&&"...
Informs this layer that a drawing operation has just completed. The backing canvas image data is uploaded to the GPU.
[ "Informs", "this", "layer", "that", "a", "drawing", "operation", "has", "just", "completed", ".", "The", "backing", "canvas", "image", "data", "is", "uploaded", "to", "the", "GPU", "." ]
7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66
https://github.com/playn/playn/blob/7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66/scene/src/playn/scene/CanvasLayer.java#L84-L93
48,293
playn/playn
scene/src/playn/scene/Layer.java
Layer.close
@Override public void close() { if (parent != null) parent.remove(this); setState(State.DISPOSED); setBatch(null); }
java
@Override public void close() { if (parent != null) parent.remove(this); setState(State.DISPOSED); setBatch(null); }
[ "@", "Override", "public", "void", "close", "(", ")", "{", "if", "(", "parent", "!=", "null", ")", "parent", ".", "remove", "(", "this", ")", ";", "setState", "(", "State", ".", "DISPOSED", ")", ";", "setBatch", "(", "null", ")", ";", "}" ]
Disposes this layer, removing it from its parent layer. Any resources associated with this layer are freed, and it cannot be reused after being disposed. Disposing a layer that has children will dispose them as well.
[ "Disposes", "this", "layer", "removing", "it", "from", "its", "parent", "layer", ".", "Any", "resources", "associated", "with", "this", "layer", "are", "freed", "and", "it", "cannot", "be", "reused", "after", "being", "disposed", ".", "Disposing", "a", "laye...
7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66
https://github.com/playn/playn/blob/7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66/scene/src/playn/scene/Layer.java#L262-L266
48,294
playn/playn
scene/src/playn/scene/Layer.java
Layer.transform
public AffineTransform transform() { if (isSet(Flag.XFDIRTY)) { float sina = FloatMath.sin(rotation), cosa = FloatMath.cos(rotation); float m00 = cosa * scaleX, m01 = sina * scaleX; float m10 = -sina * scaleY, m11 = cosa * scaleY; float tx = transform.tx(), ty = transform.ty(); transf...
java
public AffineTransform transform() { if (isSet(Flag.XFDIRTY)) { float sina = FloatMath.sin(rotation), cosa = FloatMath.cos(rotation); float m00 = cosa * scaleX, m01 = sina * scaleX; float m10 = -sina * scaleY, m11 = cosa * scaleY; float tx = transform.tx(), ty = transform.ty(); transf...
[ "public", "AffineTransform", "transform", "(", ")", "{", "if", "(", "isSet", "(", "Flag", ".", "XFDIRTY", ")", ")", "{", "float", "sina", "=", "FloatMath", ".", "sin", "(", "rotation", ")", ",", "cosa", "=", "FloatMath", ".", "cos", "(", "rotation", ...
Returns the layer's current transformation matrix. If any changes have been made to the layer's scale, rotation or translation, they will be applied to the transform matrix before it is returned. <p><em>Note:</em> any direct modifications to this matrix <em>except</em> modifications to its translation, will be overwri...
[ "Returns", "the", "layer", "s", "current", "transformation", "matrix", ".", "If", "any", "changes", "have", "been", "made", "to", "the", "layer", "s", "scale", "rotation", "or", "translation", "they", "will", "be", "applied", "to", "the", "transform", "matri...
7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66
https://github.com/playn/playn/blob/7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66/scene/src/playn/scene/Layer.java#L280-L290
48,295
playn/playn
scene/src/playn/scene/Layer.java
Layer.originX
public float originX () { if (isSet(Flag.ODIRTY)) { float width = width(); if (width > 0) { this.originX = origin.ox(width); this.originY = origin.oy(height()); setFlag(Flag.ODIRTY, false); } } return originX; }
java
public float originX () { if (isSet(Flag.ODIRTY)) { float width = width(); if (width > 0) { this.originX = origin.ox(width); this.originY = origin.oy(height()); setFlag(Flag.ODIRTY, false); } } return originX; }
[ "public", "float", "originX", "(", ")", "{", "if", "(", "isSet", "(", "Flag", ".", "ODIRTY", ")", ")", "{", "float", "width", "=", "width", "(", ")", ";", "if", "(", "width", ">", "0", ")", "{", "this", ".", "originX", "=", "origin", ".", "ox",...
Returns the x-component of the layer's origin.
[ "Returns", "the", "x", "-", "component", "of", "the", "layer", "s", "origin", "." ]
7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66
https://github.com/playn/playn/blob/7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66/scene/src/playn/scene/Layer.java#L348-L358
48,296
playn/playn
scene/src/playn/scene/Layer.java
Layer.originY
public float originY () { if (isSet(Flag.ODIRTY)) { float height = height(); if (height > 0) { this.originX = origin.ox(width()); this.originY = origin.oy(height); setFlag(Flag.ODIRTY, false); } } return originY; }
java
public float originY () { if (isSet(Flag.ODIRTY)) { float height = height(); if (height > 0) { this.originX = origin.ox(width()); this.originY = origin.oy(height); setFlag(Flag.ODIRTY, false); } } return originY; }
[ "public", "float", "originY", "(", ")", "{", "if", "(", "isSet", "(", "Flag", ".", "ODIRTY", ")", ")", "{", "float", "height", "=", "height", "(", ")", ";", "if", "(", "height", ">", "0", ")", "{", "this", ".", "originX", "=", "origin", ".", "o...
Returns the y-component of the layer's origin.
[ "Returns", "the", "y", "-", "component", "of", "the", "layer", "s", "origin", "." ]
7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66
https://github.com/playn/playn/blob/7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66/scene/src/playn/scene/Layer.java#L360-L370
48,297
playn/playn
scene/src/playn/scene/Layer.java
Layer.setOrigin
public Layer setOrigin (Origin origin) { this.origin = origin; setFlag(Flag.ODIRTY, true); return this; }
java
public Layer setOrigin (Origin origin) { this.origin = origin; setFlag(Flag.ODIRTY, true); return this; }
[ "public", "Layer", "setOrigin", "(", "Origin", "origin", ")", "{", "this", ".", "origin", "=", "origin", ";", "setFlag", "(", "Flag", ".", "ODIRTY", ",", "true", ")", ";", "return", "this", ";", "}" ]
Configures the origin of this layer based on a logical location which is recomputed whenever the layer changes size. @return a reference to this layer for call chaining.
[ "Configures", "the", "origin", "of", "this", "layer", "based", "on", "a", "logical", "location", "which", "is", "recomputed", "whenever", "the", "layer", "changes", "size", "." ]
7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66
https://github.com/playn/playn/blob/7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66/scene/src/playn/scene/Layer.java#L401-L405
48,298
playn/playn
scene/src/playn/scene/Layer.java
Layer.debugPrint
public void debugPrint(final Log log) { this.visit(new Visitor() { public void visit(Layer layer, int depth) { String prefix = repeat('.', depth); log.debug(prefix + layer.toString()); } }); }
java
public void debugPrint(final Log log) { this.visit(new Visitor() { public void visit(Layer layer, int depth) { String prefix = repeat('.', depth); log.debug(prefix + layer.toString()); } }); }
[ "public", "void", "debugPrint", "(", "final", "Log", "log", ")", "{", "this", ".", "visit", "(", "new", "Visitor", "(", ")", "{", "public", "void", "visit", "(", "Layer", "layer", ",", "int", "depth", ")", "{", "String", "prefix", "=", "repeat", "(",...
Prints a debug representation of this layer and its children. @param log the output will go to this log (at the debug level).
[ "Prints", "a", "debug", "representation", "of", "this", "layer", "and", "its", "children", "." ]
7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66
https://github.com/playn/playn/blob/7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66/scene/src/playn/scene/Layer.java#L718-L725
48,299
playn/playn
android/src/playn/android/AndroidAudio.java
AndroidAudio.createSound
public SoundImpl<?> createSound(AssetFileDescriptor fd) { PooledSound sound = new PooledSound(pool.load(fd, 1)); loadingSounds.put(sound.soundId, sound); return sound; }
java
public SoundImpl<?> createSound(AssetFileDescriptor fd) { PooledSound sound = new PooledSound(pool.load(fd, 1)); loadingSounds.put(sound.soundId, sound); return sound; }
[ "public", "SoundImpl", "<", "?", ">", "createSound", "(", "AssetFileDescriptor", "fd", ")", "{", "PooledSound", "sound", "=", "new", "PooledSound", "(", "pool", ".", "load", "(", "fd", ",", "1", ")", ")", ";", "loadingSounds", ".", "put", "(", "sound", ...
Creates a sound instance from the supplied asset file descriptor.
[ "Creates", "a", "sound", "instance", "from", "the", "supplied", "asset", "file", "descriptor", "." ]
7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66
https://github.com/playn/playn/blob/7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66/android/src/playn/android/AndroidAudio.java#L125-L129