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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
8,500 | JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/util/ClassUtility.java | ClassUtility.camelCaseToUnderscore | public static String camelCaseToUnderscore(final String camelCaseString) {
final StringBuilder sb = new StringBuilder();
for (final String camelPart : camelCaseString.split("(?<!(^|[A-Z]))(?=[A-Z])|(?<!^)(?=[A-Z][a-z])")) {
if (sb.length() > 0) {
sb.append(CASE_SEPARATOR);
... | java | public static String camelCaseToUnderscore(final String camelCaseString) {
final StringBuilder sb = new StringBuilder();
for (final String camelPart : camelCaseString.split("(?<!(^|[A-Z]))(?=[A-Z])|(?<!^)(?=[A-Z][a-z])")) {
if (sb.length() > 0) {
sb.append(CASE_SEPARATOR);
... | [
"public",
"static",
"String",
"camelCaseToUnderscore",
"(",
"final",
"String",
"camelCaseString",
")",
"{",
"final",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"final",
"String",
"camelPart",
":",
"camelCaseString",
".",
"spli... | Convert aStringUnderscored into A_STRING_UNDESCORED.
@param camelCaseString the string to convert
@return the underscored string | [
"Convert",
"aStringUnderscored",
"into",
"A_STRING_UNDESCORED",
"."
] | 93f4fc087b83c73db540333b9686e97b4cec694d | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/util/ClassUtility.java#L276-L286 |
8,501 | JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/util/ClassUtility.java | ClassUtility.getMethodByName | public static Method getMethodByName(final Class<?> cls, final String action) throws NoSuchMethodException {
for (final Method m : cls.getMethods()) {
if (m.getName().equals(action)) {
return m;
}
}
throw new NoSuchMethodException(action);
} | java | public static Method getMethodByName(final Class<?> cls, final String action) throws NoSuchMethodException {
for (final Method m : cls.getMethods()) {
if (m.getName().equals(action)) {
return m;
}
}
throw new NoSuchMethodException(action);
} | [
"public",
"static",
"Method",
"getMethodByName",
"(",
"final",
"Class",
"<",
"?",
">",
"cls",
",",
"final",
"String",
"action",
")",
"throws",
"NoSuchMethodException",
"{",
"for",
"(",
"final",
"Method",
"m",
":",
"cls",
".",
"getMethods",
"(",
")",
")",
... | Return the method that exactly match the action name. The name must be unique into the class.
@param cls the class which contain the searched method
@param action the name of the method to find
@return the method
@throws NoSuchMethodException if no method was method | [
"Return",
"the",
"method",
"that",
"exactly",
"match",
"the",
"action",
"name",
".",
"The",
"name",
"must",
"be",
"unique",
"into",
"the",
"class",
"."
] | 93f4fc087b83c73db540333b9686e97b4cec694d | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/util/ClassUtility.java#L296-L303 |
8,502 | JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/util/ClassUtility.java | ClassUtility.retrievePropertyList | public static List<Field> retrievePropertyList(final Class<?> cls) {
final List<Field> propertyList = new ArrayList<>();
for (final Field f : cls.getFields()) {
propertyList.add(f);
}
return propertyList;
} | java | public static List<Field> retrievePropertyList(final Class<?> cls) {
final List<Field> propertyList = new ArrayList<>();
for (final Field f : cls.getFields()) {
propertyList.add(f);
}
return propertyList;
} | [
"public",
"static",
"List",
"<",
"Field",
">",
"retrievePropertyList",
"(",
"final",
"Class",
"<",
"?",
">",
"cls",
")",
"{",
"final",
"List",
"<",
"Field",
">",
"propertyList",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"final",
"Field"... | List all properties for the given class.
@param cls the class to inspect by reflection
@return the field list | [
"List",
"all",
"properties",
"for",
"the",
"given",
"class",
"."
] | 93f4fc087b83c73db540333b9686e97b4cec694d | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/util/ClassUtility.java#L312-L318 |
8,503 | JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/util/ClassUtility.java | ClassUtility.findProperty | public static Field findProperty(final Class<?> sourceClass, final String itemName, final Class<?> searchedClass) {
Field found = null;
if (itemName != null && !itemName.trim().isEmpty()) {
try {
found = sourceClass.getField(ClassUtility.underscoreToCamelCase(itemName));
... | java | public static Field findProperty(final Class<?> sourceClass, final String itemName, final Class<?> searchedClass) {
Field found = null;
if (itemName != null && !itemName.trim().isEmpty()) {
try {
found = sourceClass.getField(ClassUtility.underscoreToCamelCase(itemName));
... | [
"public",
"static",
"Field",
"findProperty",
"(",
"final",
"Class",
"<",
"?",
">",
"sourceClass",
",",
"final",
"String",
"itemName",
",",
"final",
"Class",
"<",
"?",
">",
"searchedClass",
")",
"{",
"Field",
"found",
"=",
"null",
";",
"if",
"(",
"itemNam... | Retrieve a field according to the item name first, then according to searched class.
@param sourceClass the class to inspect
@param itemName the item name to find (LIKE_THIS)
@param searchedClass the property class to find if item name query has failed
@return the source class field that match provided criterion | [
"Retrieve",
"a",
"field",
"according",
"to",
"the",
"item",
"name",
"first",
"then",
"according",
"to",
"searched",
"class",
"."
] | 93f4fc087b83c73db540333b9686e97b4cec694d | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/util/ClassUtility.java#L329-L350 |
8,504 | JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/util/ClassUtility.java | ClassUtility.retrieveMethodList | public static List<Method> retrieveMethodList(final Class<?> cls, final String methodName) {
final List<Method> methodList = new ArrayList<>();
final String camelCasedMethodName = underscoreToCamelCase(methodName);
for (final Method m : cls.getMethods()) {
if (m.getName().equals(came... | java | public static List<Method> retrieveMethodList(final Class<?> cls, final String methodName) {
final List<Method> methodList = new ArrayList<>();
final String camelCasedMethodName = underscoreToCamelCase(methodName);
for (final Method m : cls.getMethods()) {
if (m.getName().equals(came... | [
"public",
"static",
"List",
"<",
"Method",
">",
"retrieveMethodList",
"(",
"final",
"Class",
"<",
"?",
">",
"cls",
",",
"final",
"String",
"methodName",
")",
"{",
"final",
"List",
"<",
"Method",
">",
"methodList",
"=",
"new",
"ArrayList",
"<>",
"(",
")",... | Check if the given method exists in the given class.
@param cls the class to search into
@param methodName the name of the method to check (camelCased or in upper case with underscore separator)
@return true if the method exists | [
"Check",
"if",
"the",
"given",
"method",
"exists",
"in",
"the",
"given",
"class",
"."
] | 93f4fc087b83c73db540333b9686e97b4cec694d | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/util/ClassUtility.java#L360-L369 |
8,505 | JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/util/ClassUtility.java | ClassUtility.getClassFromType | public static Class<?> getClassFromType(final Type type) {
Class<?> returnClass = null;
if (type instanceof Class<?>) {
returnClass = (Class<?>) type;
} else if (type instanceof ParameterizedType) {
returnClass = getClassFromType(((ParameterizedType) type).getRawType());
... | java | public static Class<?> getClassFromType(final Type type) {
Class<?> returnClass = null;
if (type instanceof Class<?>) {
returnClass = (Class<?>) type;
} else if (type instanceof ParameterizedType) {
returnClass = getClassFromType(((ParameterizedType) type).getRawType());
... | [
"public",
"static",
"Class",
"<",
"?",
">",
"getClassFromType",
"(",
"final",
"Type",
"type",
")",
"{",
"Class",
"<",
"?",
">",
"returnClass",
"=",
"null",
";",
"if",
"(",
"type",
"instanceof",
"Class",
"<",
"?",
">",
")",
"{",
"returnClass",
"=",
"(... | Return the Class object for the given type.
@param type the given type to cast into Class
@return the Class casted object | [
"Return",
"the",
"Class",
"object",
"for",
"the",
"given",
"type",
"."
] | 93f4fc087b83c73db540333b9686e97b4cec694d | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/util/ClassUtility.java#L378-L386 |
8,506 | JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/util/ClassUtility.java | ClassUtility.getAnnotationAttribute | public static Object getAnnotationAttribute(final Annotation annotation, final String attributeName) {
Object object = null;
try {
// Get the annotation method for the given name
final Method attributeMethod = annotation.annotationType().getDeclaredMethod(attributeName);
... | java | public static Object getAnnotationAttribute(final Annotation annotation, final String attributeName) {
Object object = null;
try {
// Get the annotation method for the given name
final Method attributeMethod = annotation.annotationType().getDeclaredMethod(attributeName);
... | [
"public",
"static",
"Object",
"getAnnotationAttribute",
"(",
"final",
"Annotation",
"annotation",
",",
"final",
"String",
"attributeName",
")",
"{",
"Object",
"object",
"=",
"null",
";",
"try",
"{",
"// Get the annotation method for the given name",
"final",
"Method",
... | Retrieve an annotation property dynamically by reflection.
@param annotation the annotation to explore
@param attributeName the name of the method to call
@return the property value | [
"Retrieve",
"an",
"annotation",
"property",
"dynamically",
"by",
"reflection",
"."
] | 93f4fc087b83c73db540333b9686e97b4cec694d | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/util/ClassUtility.java#L417-L432 |
8,507 | JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/util/ClassUtility.java | ClassUtility.getClassFromStaticMethod | @SuppressWarnings("unchecked")
public static Class<? extends Application> getClassFromStaticMethod(final int classDeepLevel) {
Class<? extends Application> clazz = null;
try {
clazz = (Class<? extends Application>) Class.forName(Thread.currentThread().getStackTrace()[classDeepLevel].getC... | java | @SuppressWarnings("unchecked")
public static Class<? extends Application> getClassFromStaticMethod(final int classDeepLevel) {
Class<? extends Application> clazz = null;
try {
clazz = (Class<? extends Application>) Class.forName(Thread.currentThread().getStackTrace()[classDeepLevel].getC... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"Class",
"<",
"?",
"extends",
"Application",
">",
"getClassFromStaticMethod",
"(",
"final",
"int",
"classDeepLevel",
")",
"{",
"Class",
"<",
"?",
"extends",
"Application",
">",
"clazz",
"=",... | Return the class used by the Nth level of the current call stack.
@param classDeepLevel the deep level to use to find the right class
@return the Nth level ancestor class | [
"Return",
"the",
"class",
"used",
"by",
"the",
"Nth",
"level",
"of",
"the",
"current",
"call",
"stack",
"."
] | 93f4fc087b83c73db540333b9686e97b4cec694d | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/util/ClassUtility.java#L441-L450 |
8,508 | JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/util/ClassUtility.java | ClassUtility.callMethod | public static Object callMethod(final Method method, final Object instance, final Object... parameters) throws CoreException {
Object res = null;
try {
// store current visibility
final boolean accessible = method.isAccessible();
// let it accessible anyway
... | java | public static Object callMethod(final Method method, final Object instance, final Object... parameters) throws CoreException {
Object res = null;
try {
// store current visibility
final boolean accessible = method.isAccessible();
// let it accessible anyway
... | [
"public",
"static",
"Object",
"callMethod",
"(",
"final",
"Method",
"method",
",",
"final",
"Object",
"instance",
",",
"final",
"Object",
"...",
"parameters",
")",
"throws",
"CoreException",
"{",
"Object",
"res",
"=",
"null",
";",
"try",
"{",
"// store current... | Call the given method for the instance object even if its visibility is private or protected.
@param method the method to call
@param instance the object instance to use
@param parameters the list of method parameters to use
@return the method return
@throws CoreException if the method call has failed | [
"Call",
"the",
"given",
"method",
"for",
"the",
"instance",
"object",
"even",
"if",
"its",
"visibility",
"is",
"private",
"or",
"protected",
"."
] | 93f4fc087b83c73db540333b9686e97b4cec694d | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/util/ClassUtility.java#L519-L541 |
8,509 | JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/util/ClassUtility.java | ClassUtility.setFieldValue | public static void setFieldValue(final Field field, final Object instance, final Object value) throws CoreException {
try {
// store current visibility
final boolean accessible = field.isAccessible();
// let it accessible anyway
field.setAccessible(true);
... | java | public static void setFieldValue(final Field field, final Object instance, final Object value) throws CoreException {
try {
// store current visibility
final boolean accessible = field.isAccessible();
// let it accessible anyway
field.setAccessible(true);
... | [
"public",
"static",
"void",
"setFieldValue",
"(",
"final",
"Field",
"field",
",",
"final",
"Object",
"instance",
",",
"final",
"Object",
"value",
")",
"throws",
"CoreException",
"{",
"try",
"{",
"// store current visibility",
"final",
"boolean",
"accessible",
"=",... | Update an object field even if it has a private or protected visibility.
@param field the field to update
@param instance the object instance that hold this field
@param value the value to set into this field
@throws CoreException if the new value cannot be set | [
"Update",
"an",
"object",
"field",
"even",
"if",
"it",
"has",
"a",
"private",
"or",
"protected",
"visibility",
"."
] | 93f4fc087b83c73db540333b9686e97b4cec694d | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/util/ClassUtility.java#L552-L570 |
8,510 | JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/util/ClassUtility.java | ClassUtility.getFieldValue | public static Object getFieldValue(final Field field, final Object instance) throws CoreRuntimeException {
Object value = null;
try {
// store current visibility
final boolean accessible = field.isAccessible();
// let it accessible anyway
field.setAccessi... | java | public static Object getFieldValue(final Field field, final Object instance) throws CoreRuntimeException {
Object value = null;
try {
// store current visibility
final boolean accessible = field.isAccessible();
// let it accessible anyway
field.setAccessi... | [
"public",
"static",
"Object",
"getFieldValue",
"(",
"final",
"Field",
"field",
",",
"final",
"Object",
"instance",
")",
"throws",
"CoreRuntimeException",
"{",
"Object",
"value",
"=",
"null",
";",
"try",
"{",
"// store current visibility",
"final",
"boolean",
"acce... | Retrieve an object field even if it has a private or protected visibility.
@param field the field to update
@param instance the object instance that hold this field
@return value the value stored into this field
@throws CoreException if the new value cannot be set | [
"Retrieve",
"an",
"object",
"field",
"even",
"if",
"it",
"has",
"a",
"private",
"or",
"protected",
"visibility",
"."
] | 93f4fc087b83c73db540333b9686e97b4cec694d | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/util/ClassUtility.java#L582-L601 |
8,511 | JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/util/ClassUtility.java | ClassUtility.getGenericClassAssigned | public static Class<?> getGenericClassAssigned(final Class<?> fromClass, final Class<?> typeSearched) {
Class<?> realType = null;
final Type superType = fromClass.getGenericSuperclass();
realType = searchIntoParameterzedType(superType, typeSearched);
if (realType == null) {
... | java | public static Class<?> getGenericClassAssigned(final Class<?> fromClass, final Class<?> typeSearched) {
Class<?> realType = null;
final Type superType = fromClass.getGenericSuperclass();
realType = searchIntoParameterzedType(superType, typeSearched);
if (realType == null) {
... | [
"public",
"static",
"Class",
"<",
"?",
">",
"getGenericClassAssigned",
"(",
"final",
"Class",
"<",
"?",
">",
"fromClass",
",",
"final",
"Class",
"<",
"?",
">",
"typeSearched",
")",
"{",
"Class",
"<",
"?",
">",
"realType",
"=",
"null",
";",
"final",
"Ty... | Return the first generic type of the hierarchy that can be assigned to the type searched.
@param fromClass the base class hosting the generic type
@param typeSearched the searched type, the returned class shall be a subclass of it
@return a class that is a subclass of typeSearched or null | [
"Return",
"the",
"first",
"generic",
"type",
"of",
"the",
"hierarchy",
"that",
"can",
"be",
"assigned",
"to",
"the",
"type",
"searched",
"."
] | 93f4fc087b83c73db540333b9686e97b4cec694d | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/util/ClassUtility.java#L611-L638 |
8,512 | JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/util/ClassUtility.java | ClassUtility.searchIntoParameterzedType | private static Class<?> searchIntoParameterzedType(final Type superType, final Class<?> typeSearched) {
if (superType instanceof ParameterizedType) {
for (final Type genericType : ((ParameterizedType) superType).getActualTypeArguments()) {
if (genericType instanceof Class<?> && typeS... | java | private static Class<?> searchIntoParameterzedType(final Type superType, final Class<?> typeSearched) {
if (superType instanceof ParameterizedType) {
for (final Type genericType : ((ParameterizedType) superType).getActualTypeArguments()) {
if (genericType instanceof Class<?> && typeS... | [
"private",
"static",
"Class",
"<",
"?",
">",
"searchIntoParameterzedType",
"(",
"final",
"Type",
"superType",
",",
"final",
"Class",
"<",
"?",
">",
"typeSearched",
")",
"{",
"if",
"(",
"superType",
"instanceof",
"ParameterizedType",
")",
"{",
"for",
"(",
"fi... | Extract the searched type from a ParamterizedType.
@param superType the base class hosting the generic type
@param typeSearched the searched type, the returned class shall be a subclass of it
@return the searched type or null | [
"Extract",
"the",
"searched",
"type",
"from",
"a",
"ParamterizedType",
"."
] | 93f4fc087b83c73db540333b9686e97b4cec694d | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/util/ClassUtility.java#L648-L659 |
8,513 | pmlopes/yoke | framework/src/main/java/com/jetdrone/vertx/yoke/Middleware.java | Middleware.init | public Middleware init(@NotNull final Yoke yoke, @NotNull final String mount) {
if (initialized) {
throw new RuntimeException("Already Initialized!");
}
this.yoke = yoke;
this.mount = mount;
this.initialized = true;
return this;
} | java | public Middleware init(@NotNull final Yoke yoke, @NotNull final String mount) {
if (initialized) {
throw new RuntimeException("Already Initialized!");
}
this.yoke = yoke;
this.mount = mount;
this.initialized = true;
return this;
} | [
"public",
"Middleware",
"init",
"(",
"@",
"NotNull",
"final",
"Yoke",
"yoke",
",",
"@",
"NotNull",
"final",
"String",
"mount",
")",
"{",
"if",
"(",
"initialized",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"\"Already Initialized!\"",
")",
";",
"}",
... | Initializes the middleware. This methos is called from Yoke once a middleware is added to the chain.
@param yoke the local Yoke instance.
@param mount the configured mount path.
@return self | [
"Initializes",
"the",
"middleware",
".",
"This",
"methos",
"is",
"called",
"from",
"Yoke",
"once",
"a",
"middleware",
"is",
"added",
"to",
"the",
"chain",
"."
] | fe8a64036f09fb745f0644faddd46162d64faf3c | https://github.com/pmlopes/yoke/blob/fe8a64036f09fb745f0644faddd46162d64faf3c/framework/src/main/java/com/jetdrone/vertx/yoke/Middleware.java#L69-L80 |
8,514 | JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/resource/image/WebImage.java | WebImage.getUrl | public String getUrl() {
final StringBuilder sb = new StringBuilder();
sb.append(secured() ? "https://" : "http://")
.append(website())
.append(path())
.append(name())
.append(extension());
return sb.toString();
} | java | public String getUrl() {
final StringBuilder sb = new StringBuilder();
sb.append(secured() ? "https://" : "http://")
.append(website())
.append(path())
.append(name())
.append(extension());
return sb.toString();
} | [
"public",
"String",
"getUrl",
"(",
")",
"{",
"final",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"sb",
".",
"append",
"(",
"secured",
"(",
")",
"?",
"\"https://\"",
":",
"\"http://\"",
")",
".",
"append",
"(",
"website",
"(",
")... | Build the image url.
@return the full image url string | [
"Build",
"the",
"image",
"url",
"."
] | 93f4fc087b83c73db540333b9686e97b4cec694d | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/resource/image/WebImage.java#L112-L122 |
8,515 | JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/service/basic/impl/StageServiceImpl.java | StageServiceImpl.getRootPane | private Region getRootPane(final StageWaveBean swb) {
return swb.rootPane() == null
? new StackPane()
: swb.rootPane();
} | java | private Region getRootPane(final StageWaveBean swb) {
return swb.rootPane() == null
? new StackPane()
: swb.rootPane();
} | [
"private",
"Region",
"getRootPane",
"(",
"final",
"StageWaveBean",
"swb",
")",
"{",
"return",
"swb",
".",
"rootPane",
"(",
")",
"==",
"null",
"?",
"new",
"StackPane",
"(",
")",
":",
"swb",
".",
"rootPane",
"(",
")",
";",
"}"
] | Gets the root pane.
@param swb the swb the waveBean holding defau!t values
@return the root pane | [
"Gets",
"the",
"root",
"pane",
"."
] | 93f4fc087b83c73db540333b9686e97b4cec694d | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/service/basic/impl/StageServiceImpl.java#L97-L102 |
8,516 | JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/service/basic/impl/StageServiceImpl.java | StageServiceImpl.getScene | private Scene getScene(final StageWaveBean swb, final Region region) {
Scene scene = swb.scene();
if (scene == null) {
scene = new Scene(region);
} else {
scene.setRoot(region);
}
return scene;
} | java | private Scene getScene(final StageWaveBean swb, final Region region) {
Scene scene = swb.scene();
if (scene == null) {
scene = new Scene(region);
} else {
scene.setRoot(region);
}
return scene;
} | [
"private",
"Scene",
"getScene",
"(",
"final",
"StageWaveBean",
"swb",
",",
"final",
"Region",
"region",
")",
"{",
"Scene",
"scene",
"=",
"swb",
".",
"scene",
"(",
")",
";",
"if",
"(",
"scene",
"==",
"null",
")",
"{",
"scene",
"=",
"new",
"Scene",
"("... | Gets the scene.
@param swb the waveBean holding defaut values
@param region the region
@return the scene | [
"Gets",
"the",
"scene",
"."
] | 93f4fc087b83c73db540333b9686e97b4cec694d | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/service/basic/impl/StageServiceImpl.java#L112-L122 |
8,517 | JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/service/basic/impl/StageServiceImpl.java | StageServiceImpl.getStage | private Stage getStage(final StageWaveBean swb, final Scene scene) {
Stage stage = swb.stage();
if (stage == null) {
stage = new Stage();
}
stage.setScene(scene);
return stage;
} | java | private Stage getStage(final StageWaveBean swb, final Scene scene) {
Stage stage = swb.stage();
if (stage == null) {
stage = new Stage();
}
stage.setScene(scene);
return stage;
} | [
"private",
"Stage",
"getStage",
"(",
"final",
"StageWaveBean",
"swb",
",",
"final",
"Scene",
"scene",
")",
"{",
"Stage",
"stage",
"=",
"swb",
".",
"stage",
"(",
")",
";",
"if",
"(",
"stage",
"==",
"null",
")",
"{",
"stage",
"=",
"new",
"Stage",
"(",
... | Gets the stage.
@param swb the waveBean holding default values
@param scene the scene
@return the stage | [
"Gets",
"the",
"stage",
"."
] | 93f4fc087b83c73db540333b9686e97b4cec694d | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/service/basic/impl/StageServiceImpl.java#L132-L141 |
8,518 | JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/link/ComponentEnhancer.java | ComponentEnhancer.canProcessAnnotation | public static boolean canProcessAnnotation(final Class<? extends Component<?>> componentClass) {
final SkipAnnotation skip = ClassUtility.getLastClassAnnotation(componentClass, SkipAnnotation.class);
// No annotation or annotation deactivated ==> skip annotation processing
return !(skip == nul... | java | public static boolean canProcessAnnotation(final Class<? extends Component<?>> componentClass) {
final SkipAnnotation skip = ClassUtility.getLastClassAnnotation(componentClass, SkipAnnotation.class);
// No annotation or annotation deactivated ==> skip annotation processing
return !(skip == nul... | [
"public",
"static",
"boolean",
"canProcessAnnotation",
"(",
"final",
"Class",
"<",
"?",
"extends",
"Component",
"<",
"?",
">",
">",
"componentClass",
")",
"{",
"final",
"SkipAnnotation",
"skip",
"=",
"ClassUtility",
".",
"getLastClassAnnotation",
"(",
"componentCl... | Check if annotation can be processed for the given class.
@param componentClass the class to check
@return true if annotation can be processed | [
"Check",
"if",
"annotation",
"can",
"be",
"processed",
"for",
"the",
"given",
"class",
"."
] | 93f4fc087b83c73db540333b9686e97b4cec694d | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/link/ComponentEnhancer.java#L72-L78 |
8,519 | JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/link/ComponentEnhancer.java | ComponentEnhancer.injectComponent | private static void injectComponent(final Component<?> component, final boolean inner) {
// Retrieve all fields annotated with Link
for (final Field field : ClassUtility.getAnnotatedFields(component.getClass(), Link.class)) {
final String keyPart = field.getAnnotation(Link.class).value();
... | java | private static void injectComponent(final Component<?> component, final boolean inner) {
// Retrieve all fields annotated with Link
for (final Field field : ClassUtility.getAnnotatedFields(component.getClass(), Link.class)) {
final String keyPart = field.getAnnotation(Link.class).value();
... | [
"private",
"static",
"void",
"injectComponent",
"(",
"final",
"Component",
"<",
"?",
">",
"component",
",",
"final",
"boolean",
"inner",
")",
"{",
"// Retrieve all fields annotated with Link",
"for",
"(",
"final",
"Field",
"field",
":",
"ClassUtility",
".",
"getAn... | Inject component.
@param component the component
@param inner only manage innercomponent otherwise mange component | [
"Inject",
"component",
"."
] | 93f4fc087b83c73db540333b9686e97b4cec694d | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/link/ComponentEnhancer.java#L104-L128 |
8,520 | JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/link/ComponentEnhancer.java | ComponentEnhancer.injectComponent | @SuppressWarnings("unchecked")
private static void injectComponent(final FacadeReady<?> component, final Field field, final Object... keyParts) {
try {
if (Command.class.isAssignableFrom(field.getType())) {
ClassUtility.setFieldValue(field, component, component.localFacade().glo... | java | @SuppressWarnings("unchecked")
private static void injectComponent(final FacadeReady<?> component, final Field field, final Object... keyParts) {
try {
if (Command.class.isAssignableFrom(field.getType())) {
ClassUtility.setFieldValue(field, component, component.localFacade().glo... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"static",
"void",
"injectComponent",
"(",
"final",
"FacadeReady",
"<",
"?",
">",
"component",
",",
"final",
"Field",
"field",
",",
"final",
"Object",
"...",
"keyParts",
")",
"{",
"try",
"{",
"if"... | Inject a component into the property of an other.
@param component the component
@param field the field
@param keyParts the key parts | [
"Inject",
"a",
"component",
"into",
"the",
"property",
"of",
"an",
"other",
"."
] | 93f4fc087b83c73db540333b9686e97b4cec694d | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/link/ComponentEnhancer.java#L137-L152 |
8,521 | JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/link/ComponentEnhancer.java | ComponentEnhancer.injectInnerComponent | @SuppressWarnings("unchecked")
private static void injectInnerComponent(final Component<?> component, final Field field, final Object... keyParts) {
final ParameterizedType innerComponentType = (ParameterizedType) field.getGenericType();
final Class<?> componentType = (Class<?>) innerComponentType.... | java | @SuppressWarnings("unchecked")
private static void injectInnerComponent(final Component<?> component, final Field field, final Object... keyParts) {
final ParameterizedType innerComponentType = (ParameterizedType) field.getGenericType();
final Class<?> componentType = (Class<?>) innerComponentType.... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"static",
"void",
"injectInnerComponent",
"(",
"final",
"Component",
"<",
"?",
">",
"component",
",",
"final",
"Field",
"field",
",",
"final",
"Object",
"...",
"keyParts",
")",
"{",
"final",
"Param... | Inject Inner component.
@param component the component
@param field the field
@param keyParts the key parts | [
"Inject",
"Inner",
"component",
"."
] | 93f4fc087b83c73db540333b9686e97b4cec694d | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/link/ComponentEnhancer.java#L161-L174 |
8,522 | JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/link/ComponentEnhancer.java | ComponentEnhancer.defineLifecycleMethod | public static MultiMap<String, Method> defineLifecycleMethod(final Component<?> component) {
final MultiMap<String, Method> lifecycleMethod = new MultiMap<>();
manageLifecycleAnnotation(component, lifecycleMethod, BeforeInit.class);
manageLifecycleAnnotation(component, lifecycleMethod, AfterIn... | java | public static MultiMap<String, Method> defineLifecycleMethod(final Component<?> component) {
final MultiMap<String, Method> lifecycleMethod = new MultiMap<>();
manageLifecycleAnnotation(component, lifecycleMethod, BeforeInit.class);
manageLifecycleAnnotation(component, lifecycleMethod, AfterIn... | [
"public",
"static",
"MultiMap",
"<",
"String",
",",
"Method",
">",
"defineLifecycleMethod",
"(",
"final",
"Component",
"<",
"?",
">",
"component",
")",
"{",
"final",
"MultiMap",
"<",
"String",
",",
"Method",
">",
"lifecycleMethod",
"=",
"new",
"MultiMap",
"<... | Parse all methods to search annotated methods that are attached to a lifecycle phase.
@param component the JRebirth component to manage
@return the map that store all method that should be call sorted by lifecycle phase | [
"Parse",
"all",
"methods",
"to",
"search",
"annotated",
"methods",
"that",
"are",
"attached",
"to",
"a",
"lifecycle",
"phase",
"."
] | 93f4fc087b83c73db540333b9686e97b4cec694d | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/link/ComponentEnhancer.java#L194-L203 |
8,523 | JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/link/ComponentEnhancer.java | ComponentEnhancer.manageLifecycleAnnotation | private static void manageLifecycleAnnotation(final Component<?> component, final MultiMap<String, Method> lifecycleMethod, final Class<? extends Annotation> annotationClass) {
for (final Method method : ClassUtility.getAnnotatedMethods(component.getClass(), annotationClass)) {
// Add a method to t... | java | private static void manageLifecycleAnnotation(final Component<?> component, final MultiMap<String, Method> lifecycleMethod, final Class<? extends Annotation> annotationClass) {
for (final Method method : ClassUtility.getAnnotatedMethods(component.getClass(), annotationClass)) {
// Add a method to t... | [
"private",
"static",
"void",
"manageLifecycleAnnotation",
"(",
"final",
"Component",
"<",
"?",
">",
"component",
",",
"final",
"MultiMap",
"<",
"String",
",",
"Method",
">",
"lifecycleMethod",
",",
"final",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"ann... | Store annotated method related to a lifecycle phase.
@param component the JRebirth component to manage
@param lifecycleMethod the map that store methods
@param annotationClass the annotation related to lifecycle phase | [
"Store",
"annotated",
"method",
"related",
"to",
"a",
"lifecycle",
"phase",
"."
] | 93f4fc087b83c73db540333b9686e97b4cec694d | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/link/ComponentEnhancer.java#L212-L219 |
8,524 | JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/application/AbstractApplication.java | AbstractApplication.preloadAndLaunch | protected static void preloadAndLaunch(final Class<? extends Preloader> preloaderClass, final String... args) {
preloadAndLaunch(ClassUtility.getClassFromStaticMethod(3), preloaderClass, args);
} | java | protected static void preloadAndLaunch(final Class<? extends Preloader> preloaderClass, final String... args) {
preloadAndLaunch(ClassUtility.getClassFromStaticMethod(3), preloaderClass, args);
} | [
"protected",
"static",
"void",
"preloadAndLaunch",
"(",
"final",
"Class",
"<",
"?",
"extends",
"Preloader",
">",
"preloaderClass",
",",
"final",
"String",
"...",
"args",
")",
"{",
"preloadAndLaunch",
"(",
"ClassUtility",
".",
"getClassFromStaticMethod",
"(",
"3",
... | Launch the Current JavaFX Application with given preloader.
@param preloaderClass the preloader class used as splash screen with progress
@param args arguments passed to java command line | [
"Launch",
"the",
"Current",
"JavaFX",
"Application",
"with",
"given",
"preloader",
"."
] | 93f4fc087b83c73db540333b9686e97b4cec694d | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/application/AbstractApplication.java#L113-L115 |
8,525 | JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/application/AbstractApplication.java | AbstractApplication.preloadAndLaunch | protected static void preloadAndLaunch(final Class<? extends Application> appClass, final Class<? extends Preloader> preloaderClass, final String... args) {
LauncherImpl.launchApplication(appClass, preloaderClass, args);
} | java | protected static void preloadAndLaunch(final Class<? extends Application> appClass, final Class<? extends Preloader> preloaderClass, final String... args) {
LauncherImpl.launchApplication(appClass, preloaderClass, args);
} | [
"protected",
"static",
"void",
"preloadAndLaunch",
"(",
"final",
"Class",
"<",
"?",
"extends",
"Application",
">",
"appClass",
",",
"final",
"Class",
"<",
"?",
"extends",
"Preloader",
">",
"preloaderClass",
",",
"final",
"String",
"...",
"args",
")",
"{",
"L... | Launch the given JavaFX Application with given preloader.
@param appClass the JavaFX application class to launch
@param preloaderClass the preloader class used as splash screen with progress
@param args arguments passed to java command line | [
"Launch",
"the",
"given",
"JavaFX",
"Application",
"with",
"given",
"preloader",
"."
] | 93f4fc087b83c73db540333b9686e97b4cec694d | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/application/AbstractApplication.java#L124-L126 |
8,526 | JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/application/AbstractApplication.java | AbstractApplication.loadConfigurationFiles | private void loadConfigurationFiles() {
// Parse the first annotation found (manage overriding)
final Configuration conf = ClassUtility.getLastClassAnnotation(this.getClass(), Configuration.class);
// Conf variable cannot be null because it was defined in this class
// It's possible to... | java | private void loadConfigurationFiles() {
// Parse the first annotation found (manage overriding)
final Configuration conf = ClassUtility.getLastClassAnnotation(this.getClass(), Configuration.class);
// Conf variable cannot be null because it was defined in this class
// It's possible to... | [
"private",
"void",
"loadConfigurationFiles",
"(",
")",
"{",
"// Parse the first annotation found (manage overriding)",
"final",
"Configuration",
"conf",
"=",
"ClassUtility",
".",
"getLastClassAnnotation",
"(",
"this",
".",
"getClass",
"(",
")",
",",
"Configuration",
".",
... | Load all configuration files before showing anything. | [
"Load",
"all",
"configuration",
"files",
"before",
"showing",
"anything",
"."
] | 93f4fc087b83c73db540333b9686e97b4cec694d | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/application/AbstractApplication.java#L254-L265 |
8,527 | JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/application/AbstractApplication.java | AbstractApplication.loadMessagesFiles | private void loadMessagesFiles() {
// Parse the first annotation found (manage overriding)
final Localized local = ClassUtility.getLastClassAnnotation(this.getClass(), Localized.class);
// Conf variable cannot be null because it was defined in this class
// It's possible to discard def... | java | private void loadMessagesFiles() {
// Parse the first annotation found (manage overriding)
final Localized local = ClassUtility.getLastClassAnnotation(this.getClass(), Localized.class);
// Conf variable cannot be null because it was defined in this class
// It's possible to discard def... | [
"private",
"void",
"loadMessagesFiles",
"(",
")",
"{",
"// Parse the first annotation found (manage overriding)",
"final",
"Localized",
"local",
"=",
"ClassUtility",
".",
"getLastClassAnnotation",
"(",
"this",
".",
"getClass",
"(",
")",
",",
"Localized",
".",
"class",
... | Load all Messages files before showing anything. | [
"Load",
"all",
"Messages",
"files",
"before",
"showing",
"anything",
"."
] | 93f4fc087b83c73db540333b9686e97b4cec694d | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/application/AbstractApplication.java#L270-L280 |
8,528 | JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/application/AbstractApplication.java | AbstractApplication.initializeStage | private void initializeStage() {
// Define the stage title
this.stage.setTitle(applicationTitle());
// Define stage icons, the toolkit will use the best size
final List<Image> stageIcons = stageIcons();
if (stageIcons != null && !stageIcons.isEmpty()) {
this.stage.ge... | java | private void initializeStage() {
// Define the stage title
this.stage.setTitle(applicationTitle());
// Define stage icons, the toolkit will use the best size
final List<Image> stageIcons = stageIcons();
if (stageIcons != null && !stageIcons.isEmpty()) {
this.stage.ge... | [
"private",
"void",
"initializeStage",
"(",
")",
"{",
"// Define the stage title",
"this",
".",
"stage",
".",
"setTitle",
"(",
"applicationTitle",
"(",
")",
")",
";",
"// Define stage icons, the toolkit will use the best size",
"final",
"List",
"<",
"Image",
">",
"stag... | Customize the primary Stage. | [
"Customize",
"the",
"primary",
"Stage",
"."
] | 93f4fc087b83c73db540333b9686e97b4cec694d | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/application/AbstractApplication.java#L340-L352 |
8,529 | JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/application/AbstractApplication.java | AbstractApplication.initializeScene | private void initializeScene() {
final Stage currentStage = this.stage;
final KeyCode fullKeyCode = fullScreenKeyCode();
final KeyCode iconKeyCode = iconifiedKeyCode();
// Attach the handler only if necessary, these 2 method can be overridden to return null
if (fullKeyCode != ... | java | private void initializeScene() {
final Stage currentStage = this.stage;
final KeyCode fullKeyCode = fullScreenKeyCode();
final KeyCode iconKeyCode = iconifiedKeyCode();
// Attach the handler only if necessary, these 2 method can be overridden to return null
if (fullKeyCode != ... | [
"private",
"void",
"initializeScene",
"(",
")",
"{",
"final",
"Stage",
"currentStage",
"=",
"this",
".",
"stage",
";",
"final",
"KeyCode",
"fullKeyCode",
"=",
"fullScreenKeyCode",
"(",
")",
";",
"final",
"KeyCode",
"iconKeyCode",
"=",
"iconifiedKeyCode",
"(",
... | Initialize the default scene. | [
"Initialize",
"the",
"default",
"scene",
"."
] | 93f4fc087b83c73db540333b9686e97b4cec694d | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/application/AbstractApplication.java#L364-L395 |
8,530 | JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/application/AbstractApplication.java | AbstractApplication.preloadModules | protected void preloadModules() {
// Add default ModuleModel component interface (because it cannot be added by module starter, API is not processed with annotation engine)
JRebirthThread.getThread().getFacade().componentFactory().define(
... | java | protected void preloadModules() {
// Add default ModuleModel component interface (because it cannot be added by module starter, API is not processed with annotation engine)
JRebirthThread.getThread().getFacade().componentFactory().define(
... | [
"protected",
"void",
"preloadModules",
"(",
")",
"{",
"// Add default ModuleModel component interface (because it cannot be added by module starter, API is not processed with annotation engine)",
"JRebirthThread",
".",
"getThread",
"(",
")",
".",
"getFacade",
"(",
")",
".",
"compon... | Preload Module.xml files. | [
"Preload",
"Module",
".",
"xml",
"files",
"."
] | 93f4fc087b83c73db540333b9686e97b4cec694d | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/application/AbstractApplication.java#L414-L432 |
8,531 | JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/application/AbstractApplication.java | AbstractApplication.addCSS | protected void addCSS(final Scene scene, final StyleSheetItem styleSheetItem) {
final URL styleSheetURL = styleSheetItem.get();
if (styleSheetURL == null) {
LOGGER.error(CSS_LOADING_ERROR, styleSheetItem.toString(), ResourceParameters.STYLE_FOLDER.get());
} else {
scene.... | java | protected void addCSS(final Scene scene, final StyleSheetItem styleSheetItem) {
final URL styleSheetURL = styleSheetItem.get();
if (styleSheetURL == null) {
LOGGER.error(CSS_LOADING_ERROR, styleSheetItem.toString(), ResourceParameters.STYLE_FOLDER.get());
} else {
scene.... | [
"protected",
"void",
"addCSS",
"(",
"final",
"Scene",
"scene",
",",
"final",
"StyleSheetItem",
"styleSheetItem",
")",
"{",
"final",
"URL",
"styleSheetURL",
"=",
"styleSheetItem",
".",
"get",
"(",
")",
";",
"if",
"(",
"styleSheetURL",
"==",
"null",
")",
"{",
... | Attach a new CSS file to the scene using the default classloader.
@param scene the scene that will hold this new CSS file
@param styleSheetItem the stylesheet item to add | [
"Attach",
"a",
"new",
"CSS",
"file",
"to",
"the",
"scene",
"using",
"the",
"default",
"classloader",
"."
] | 93f4fc087b83c73db540333b9686e97b4cec694d | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/application/AbstractApplication.java#L456-L465 |
8,532 | JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/application/AbstractApplication.java | AbstractApplication.applicationTitle | protected String applicationTitle() {
// Add application Name
String name = StageParameters.APPLICATION_NAME.get();
if (name.contains(PARAM)) {
name = name.replace(PARAM, computeShortClassName());
}
// Add version with a space before
final String version = Sta... | java | protected String applicationTitle() {
// Add application Name
String name = StageParameters.APPLICATION_NAME.get();
if (name.contains(PARAM)) {
name = name.replace(PARAM, computeShortClassName());
}
// Add version with a space before
final String version = Sta... | [
"protected",
"String",
"applicationTitle",
"(",
")",
"{",
"// Add application Name",
"String",
"name",
"=",
"StageParameters",
".",
"APPLICATION_NAME",
".",
"get",
"(",
")",
";",
"if",
"(",
"name",
".",
"contains",
"(",
"PARAM",
")",
")",
"{",
"name",
"=",
... | Return the application title.
This method could be overridden.
By default it will return {@link StageParameters.APPLICATION_NAME} {@link StageParameters.APPLICATION_VERSION} string.
The default application is: ApplicationClass powered by JRebirth <br />
If version is equals to "0.0.0", it will not be appended
@retu... | [
"Return",
"the",
"application",
"title",
"."
] | 93f4fc087b83c73db540333b9686e97b4cec694d | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/application/AbstractApplication.java#L479-L492 |
8,533 | JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/application/AbstractApplication.java | AbstractApplication.stageIcons | protected List<Image> stageIcons() {
// TODO to be rewritten with ImageSet Resource when available
return StageParameters.APPLICATION_ICONS.get()
.stream()
.map(p -> Resources.create(p).get())
... | java | protected List<Image> stageIcons() {
// TODO to be rewritten with ImageSet Resource when available
return StageParameters.APPLICATION_ICONS.get()
.stream()
.map(p -> Resources.create(p).get())
... | [
"protected",
"List",
"<",
"Image",
">",
"stageIcons",
"(",
")",
"{",
"// TODO to be rewritten with ImageSet Resource when available",
"return",
"StageParameters",
".",
"APPLICATION_ICONS",
".",
"get",
"(",
")",
".",
"stream",
"(",
")",
".",
"map",
"(",
"p",
"->",
... | Return the application stage icon.
This method could be overridden.
By default it will return {@link StageParameters.APPLICATION_ICONS} list of JRebirth icons.
Image Params parameterized will be converted as Image using anonymous ImageItem
@return the list of image to use as stage icons | [
"Return",
"the",
"application",
"stage",
"icon",
"."
] | 93f4fc087b83c73db540333b9686e97b4cec694d | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/application/AbstractApplication.java#L505-L511 |
8,534 | JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/application/AbstractApplication.java | AbstractApplication.computeShortClassName | private String computeShortClassName() {
String name = this.getClass().getSimpleName();
if (name.endsWith(APP_SUFFIX_CLASSNAME)) {
name = name.substring(0, name.indexOf(APP_SUFFIX_CLASSNAME));
}
return name;
} | java | private String computeShortClassName() {
String name = this.getClass().getSimpleName();
if (name.endsWith(APP_SUFFIX_CLASSNAME)) {
name = name.substring(0, name.indexOf(APP_SUFFIX_CLASSNAME));
}
return name;
} | [
"private",
"String",
"computeShortClassName",
"(",
")",
"{",
"String",
"name",
"=",
"this",
".",
"getClass",
"(",
")",
".",
"getSimpleName",
"(",
")",
";",
"if",
"(",
"name",
".",
"endsWith",
"(",
"APP_SUFFIX_CLASSNAME",
")",
")",
"{",
"name",
"=",
"name... | Return the application class name without the Application suffix.
@return the application class short name | [
"Return",
"the",
"application",
"class",
"name",
"without",
"the",
"Application",
"suffix",
"."
] | 93f4fc087b83c73db540333b9686e97b4cec694d | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/application/AbstractApplication.java#L518-L524 |
8,535 | JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/application/AbstractApplication.java | AbstractApplication.manageDefaultStyleSheet | private void manageDefaultStyleSheet(final Scene scene) {
if (scene.getStylesheets().isEmpty()) {
// No style sheet has been added to the scene
LOGGER.log(NO_CSS_DEFINED);
addCSS(scene, JRebirthStyles.DEFAULT);
}
} | java | private void manageDefaultStyleSheet(final Scene scene) {
if (scene.getStylesheets().isEmpty()) {
// No style sheet has been added to the scene
LOGGER.log(NO_CSS_DEFINED);
addCSS(scene, JRebirthStyles.DEFAULT);
}
} | [
"private",
"void",
"manageDefaultStyleSheet",
"(",
"final",
"Scene",
"scene",
")",
"{",
"if",
"(",
"scene",
".",
"getStylesheets",
"(",
")",
".",
"isEmpty",
"(",
")",
")",
"{",
"// No style sheet has been added to the scene",
"LOGGER",
".",
"log",
"(",
"NO_CSS_D... | Attach default CSS file if none have been previously attached.
@param scene the scene to check | [
"Attach",
"default",
"CSS",
"file",
"if",
"none",
"have",
"been",
"previously",
"attached",
"."
] | 93f4fc087b83c73db540333b9686e97b4cec694d | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/application/AbstractApplication.java#L531-L538 |
8,536 | JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/application/AbstractApplication.java | AbstractApplication.buildScene | protected final Scene buildScene() throws CoreException {
final Scene scene = new Scene(buildRootPane(),
StageParameters.APPLICATION_SCENE_WIDTH.get(),
StageParameters.APPLICATION_SCENE_HEIGHT.get(),
... | java | protected final Scene buildScene() throws CoreException {
final Scene scene = new Scene(buildRootPane(),
StageParameters.APPLICATION_SCENE_WIDTH.get(),
StageParameters.APPLICATION_SCENE_HEIGHT.get(),
... | [
"protected",
"final",
"Scene",
"buildScene",
"(",
")",
"throws",
"CoreException",
"{",
"final",
"Scene",
"scene",
"=",
"new",
"Scene",
"(",
"buildRootPane",
"(",
")",
",",
"StageParameters",
".",
"APPLICATION_SCENE_WIDTH",
".",
"get",
"(",
")",
",",
"StagePara... | Initialize the properties of the scene.
800x600 with transparent background and a Region as Parent Node
@return the scene built
@throws CoreException if build fails | [
"Initialize",
"the",
"properties",
"of",
"the",
"scene",
"."
] | 93f4fc087b83c73db540333b9686e97b4cec694d | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/application/AbstractApplication.java#L549-L557 |
8,537 | JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/application/AbstractApplication.java | AbstractApplication.buildRootPane | @SuppressWarnings("unchecked")
protected P buildRootPane() throws CoreException {
// Build the root node by reflection without any parameter or excluded class
this.rootNode = (P) ClassUtility.buildGenericType(this.getClass(), Pane.class);
return this.rootNode;
} | java | @SuppressWarnings("unchecked")
protected P buildRootPane() throws CoreException {
// Build the root node by reflection without any parameter or excluded class
this.rootNode = (P) ClassUtility.buildGenericType(this.getClass(), Pane.class);
return this.rootNode;
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"protected",
"P",
"buildRootPane",
"(",
")",
"throws",
"CoreException",
"{",
"// Build the root node by reflection without any parameter or excluded class",
"this",
".",
"rootNode",
"=",
"(",
"P",
")",
"ClassUtility",
".... | Build dynamically the root pane.
@return the root pane
@throws CoreException if build fails | [
"Build",
"dynamically",
"the",
"root",
"pane",
"."
] | 93f4fc087b83c73db540333b9686e97b4cec694d | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/application/AbstractApplication.java#L565-L571 |
8,538 | JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/application/AbstractApplication.java | AbstractApplication.initializeExceptionHandler | protected void initializeExceptionHandler() {
// Initialize the default uncaught exception handler for all other threads
Thread.setDefaultUncaughtExceptionHandler(getDefaultUncaughtExceptionHandler());
// Initialize the uncaught exception handler for JavaFX Application Thread
JRebirth.... | java | protected void initializeExceptionHandler() {
// Initialize the default uncaught exception handler for all other threads
Thread.setDefaultUncaughtExceptionHandler(getDefaultUncaughtExceptionHandler());
// Initialize the uncaught exception handler for JavaFX Application Thread
JRebirth.... | [
"protected",
"void",
"initializeExceptionHandler",
"(",
")",
"{",
"// Initialize the default uncaught exception handler for all other threads",
"Thread",
".",
"setDefaultUncaughtExceptionHandler",
"(",
"getDefaultUncaughtExceptionHandler",
"(",
")",
")",
";",
"// Initialize the uncau... | Initialize all Uncaught Exception Handler. | [
"Initialize",
"all",
"Uncaught",
"Exception",
"Handler",
"."
] | 93f4fc087b83c73db540333b9686e97b4cec694d | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/application/AbstractApplication.java#L576-L586 |
8,539 | JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/util/ClasspathUtility.java | ClasspathUtility.getClasspathResources | public static Collection<String> getClasspathResources(final Pattern searchPattern) {
final List<String> resources = new ArrayList<>();
final ClassLoader cl = Thread.currentThread().getContextClassLoader();
if (hasJavaWebstartLibrary() && cl instanceof JNLPClassLoaderIf) {
... | java | public static Collection<String> getClasspathResources(final Pattern searchPattern) {
final List<String> resources = new ArrayList<>();
final ClassLoader cl = Thread.currentThread().getContextClassLoader();
if (hasJavaWebstartLibrary() && cl instanceof JNLPClassLoaderIf) {
... | [
"public",
"static",
"Collection",
"<",
"String",
">",
"getClasspathResources",
"(",
"final",
"Pattern",
"searchPattern",
")",
"{",
"final",
"List",
"<",
"String",
">",
"resources",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"final",
"ClassLoader",
"cl",
"... | Retrieve all resources that match the search pattern from the java.class.path.
@param searchPattern the pattern used to filter all matching files
@return Sorted list of resources that match the pattern | [
"Retrieve",
"all",
"resources",
"that",
"match",
"the",
"search",
"pattern",
"from",
"the",
"java",
".",
"class",
".",
"path",
"."
] | 93f4fc087b83c73db540333b9686e97b4cec694d | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/util/ClasspathUtility.java#L76-L117 |
8,540 | JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/util/ClasspathUtility.java | ClasspathUtility.hasJavaWebstartLibrary | private static boolean hasJavaWebstartLibrary() {
boolean hasWebStartLibrary = true;
try {
Class.forName("com.sun.jnlp.JNLPClassLoaderIf");
} catch (final ClassNotFoundException e) {
hasWebStartLibrary = false;
}
return hasWebStartLibrary;
} | java | private static boolean hasJavaWebstartLibrary() {
boolean hasWebStartLibrary = true;
try {
Class.forName("com.sun.jnlp.JNLPClassLoaderIf");
} catch (final ClassNotFoundException e) {
hasWebStartLibrary = false;
}
return hasWebStartLibrary;
} | [
"private",
"static",
"boolean",
"hasJavaWebstartLibrary",
"(",
")",
"{",
"boolean",
"hasWebStartLibrary",
"=",
"true",
";",
"try",
"{",
"Class",
".",
"forName",
"(",
"\"com.sun.jnlp.JNLPClassLoaderIf\"",
")",
";",
"}",
"catch",
"(",
"final",
"ClassNotFoundException"... | Check that javaws.jar is accessible.
@return true if javaws.jar is accessible | [
"Check",
"that",
"javaws",
".",
"jar",
"is",
"accessible",
"."
] | 93f4fc087b83c73db540333b9686e97b4cec694d | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/util/ClasspathUtility.java#L124-L132 |
8,541 | JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/util/ClasspathUtility.java | ClasspathUtility.getResources | private static List<String> getResources(final String classpathEntryPath, final Pattern searchPattern, final boolean cachedJar) {
final List<String> resources = new ArrayList<>();
// System.out.println("Search into "+classpathEntryPath);
final File classpathEntryFile = new File(classpathEnt... | java | private static List<String> getResources(final String classpathEntryPath, final Pattern searchPattern, final boolean cachedJar) {
final List<String> resources = new ArrayList<>();
// System.out.println("Search into "+classpathEntryPath);
final File classpathEntryFile = new File(classpathEnt... | [
"private",
"static",
"List",
"<",
"String",
">",
"getResources",
"(",
"final",
"String",
"classpathEntryPath",
",",
"final",
"Pattern",
"searchPattern",
",",
"final",
"boolean",
"cachedJar",
")",
"{",
"final",
"List",
"<",
"String",
">",
"resources",
"=",
"new... | Search all files that match the given Regex pattern.
@param classpathEntryPath the root folder used for search
@param searchPattern the regex pattern used as a filter
@param cachedJar is a jar cached by Java Webstart without any extension
@return list of resources that match the pattern | [
"Search",
"all",
"files",
"that",
"match",
"the",
"given",
"Regex",
"pattern",
"."
] | 93f4fc087b83c73db540333b9686e97b4cec694d | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/util/ClasspathUtility.java#L143-L159 |
8,542 | JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/util/ClasspathUtility.java | ClasspathUtility.getResourcesFromDirectory | private static List<String> getResourcesFromDirectory(final File directory, final Pattern searchPattern) {
final List<String> resources = new ArrayList<>();
// Filter only properties files
final File[] fileList = directory.listFiles();
if (fileList != null && fileList.length > 0)... | java | private static List<String> getResourcesFromDirectory(final File directory, final Pattern searchPattern) {
final List<String> resources = new ArrayList<>();
// Filter only properties files
final File[] fileList = directory.listFiles();
if (fileList != null && fileList.length > 0)... | [
"private",
"static",
"List",
"<",
"String",
">",
"getResourcesFromDirectory",
"(",
"final",
"File",
"directory",
",",
"final",
"Pattern",
"searchPattern",
")",
"{",
"final",
"List",
"<",
"String",
">",
"resources",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";... | Browse a directory to search resources that match the pattern.
@param directory the root directory to browse
@param searchPattern the regex pattern used as a filter
@return list of resources that match the pattern | [
"Browse",
"a",
"directory",
"to",
"search",
"resources",
"that",
"match",
"the",
"pattern",
"."
] | 93f4fc087b83c73db540333b9686e97b4cec694d | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/util/ClasspathUtility.java#L169-L191 |
8,543 | JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/util/ClasspathUtility.java | ClasspathUtility.getResourcesFromJarOrZipFile | @SuppressWarnings("unchecked")
private static List<String> getResourcesFromJarOrZipFile(final File jarOrZipFile, final Pattern searchPattern) {
final List<String> resources = new ArrayList<>();
try (ZipFile zf = new ZipFile(jarOrZipFile);) {
final Enumeration<ZipEntry> e = (Enume... | java | @SuppressWarnings("unchecked")
private static List<String> getResourcesFromJarOrZipFile(final File jarOrZipFile, final Pattern searchPattern) {
final List<String> resources = new ArrayList<>();
try (ZipFile zf = new ZipFile(jarOrZipFile);) {
final Enumeration<ZipEntry> e = (Enume... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"static",
"List",
"<",
"String",
">",
"getResourcesFromJarOrZipFile",
"(",
"final",
"File",
"jarOrZipFile",
",",
"final",
"Pattern",
"searchPattern",
")",
"{",
"final",
"List",
"<",
"String",
">",
"r... | Browse the jar content to search resources that match the pattern.
@param jarOrZipFile the jar to explore
@param searchPattern the regex pattern used as a filter
@return list of resources that match the pattern | [
"Browse",
"the",
"jar",
"content",
"to",
"search",
"resources",
"that",
"match",
"the",
"pattern",
"."
] | 93f4fc087b83c73db540333b9686e97b4cec694d | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/util/ClasspathUtility.java#L201-L217 |
8,544 | JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/util/ClasspathUtility.java | ClasspathUtility.checkResource | private static void checkResource(final List<String> resources, final Pattern searchPattern, final String resourceName) {
if (searchPattern.matcher(resourceName).matches()) {
resources.add(resourceName);
}
} | java | private static void checkResource(final List<String> resources, final Pattern searchPattern, final String resourceName) {
if (searchPattern.matcher(resourceName).matches()) {
resources.add(resourceName);
}
} | [
"private",
"static",
"void",
"checkResource",
"(",
"final",
"List",
"<",
"String",
">",
"resources",
",",
"final",
"Pattern",
"searchPattern",
",",
"final",
"String",
"resourceName",
")",
"{",
"if",
"(",
"searchPattern",
".",
"matcher",
"(",
"resourceName",
")... | Check if the resource match the regex.
@param resources the list of found resources
@param searchPattern the regex pattern
@param resourceName the resource to check and to add | [
"Check",
"if",
"the",
"resource",
"match",
"the",
"regex",
"."
] | 93f4fc087b83c73db540333b9686e97b4cec694d | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/util/ClasspathUtility.java#L226-L230 |
8,545 | JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/util/ClasspathUtility.java | ClasspathUtility.loadInputStream | public static InputStream loadInputStream(final String custConfFileName) {
InputStream is = null;
final File resourceFile = new File(custConfFileName);
// Check if the file could be find
if (resourceFile.exists()) {
try {
is = new FileInputStream(resourc... | java | public static InputStream loadInputStream(final String custConfFileName) {
InputStream is = null;
final File resourceFile = new File(custConfFileName);
// Check if the file could be find
if (resourceFile.exists()) {
try {
is = new FileInputStream(resourc... | [
"public",
"static",
"InputStream",
"loadInputStream",
"(",
"final",
"String",
"custConfFileName",
")",
"{",
"InputStream",
"is",
"=",
"null",
";",
"final",
"File",
"resourceFile",
"=",
"new",
"File",
"(",
"custConfFileName",
")",
";",
"// Check if the file could be ... | TRy to load a custom resource file.
@param custConfFileName the custom resource file to load
@return the load input stream | [
"TRy",
"to",
"load",
"a",
"custom",
"resource",
"file",
"."
] | 93f4fc087b83c73db540333b9686e97b4cec694d | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/util/ClasspathUtility.java#L239-L255 |
8,546 | JRebirth/JRebirth | org.jrebirth.af/component/src/main/java/org/jrebirth/af/component/ui/stack/StackModel.java | StackModel.getPageEnumClass | @SuppressWarnings("unchecked")
private Class<PageEnum> getPageEnumClass() {
Class<PageEnum> res = null;
if (object() != null && object().pageEnumClass() != null) {
res = (Class<PageEnum>) object().pageEnumClass();
} else if (getFirstKeyPart() instanceof Class && PageEnum.class.is... | java | @SuppressWarnings("unchecked")
private Class<PageEnum> getPageEnumClass() {
Class<PageEnum> res = null;
if (object() != null && object().pageEnumClass() != null) {
res = (Class<PageEnum>) object().pageEnumClass();
} else if (getFirstKeyPart() instanceof Class && PageEnum.class.is... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"Class",
"<",
"PageEnum",
">",
"getPageEnumClass",
"(",
")",
"{",
"Class",
"<",
"PageEnum",
">",
"res",
"=",
"null",
";",
"if",
"(",
"object",
"(",
")",
"!=",
"null",
"&&",
"object",
"(",
"... | Returns the page enum class associated to this model.
Checks the modelObject and return it only if it extends {@link PageEnum}
@return the page enum class | [
"Returns",
"the",
"page",
"enum",
"class",
"associated",
"to",
"this",
"model",
"."
] | 93f4fc087b83c73db540333b9686e97b4cec694d | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/component/src/main/java/org/jrebirth/af/component/ui/stack/StackModel.java#L104-L113 |
8,547 | JRebirth/JRebirth | org.jrebirth.af/component/src/main/java/org/jrebirth/af/component/ui/stack/StackModel.java | StackModel.getStackName | private String getStackName() {
String res = null;
if (object() != null && object().stackName() != null) {
res = object().stackName();
} else if (getFirstKeyPart() instanceof String) {
res = (String) getFirstKeyPart();
}
return res;
} | java | private String getStackName() {
String res = null;
if (object() != null && object().stackName() != null) {
res = object().stackName();
} else if (getFirstKeyPart() instanceof String) {
res = (String) getFirstKeyPart();
}
return res;
} | [
"private",
"String",
"getStackName",
"(",
")",
"{",
"String",
"res",
"=",
"null",
";",
"if",
"(",
"object",
"(",
")",
"!=",
"null",
"&&",
"object",
"(",
")",
".",
"stackName",
"(",
")",
"!=",
"null",
")",
"{",
"res",
"=",
"object",
"(",
")",
".",... | Returns the current stack name associated to this model.
Checks the modelObject and return it only if it is a String
@return the stack name | [
"Returns",
"the",
"current",
"stack",
"name",
"associated",
"to",
"this",
"model",
"."
] | 93f4fc087b83c73db540333b9686e97b4cec694d | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/component/src/main/java/org/jrebirth/af/component/ui/stack/StackModel.java#L122-L130 |
8,548 | JRebirth/JRebirth | org.jrebirth.af/component/src/main/java/org/jrebirth/af/component/ui/stack/StackModel.java | StackModel.showPage | private void showPage(final UniqueKey<? extends Model> pageModelKey, final Wave wave) {
if (pageModelKey != null && !pageModelKey.equals(this.currentModelKey)) {
LOGGER.info("Show Page Model: " + pageModelKey.toString());
// Create the Wave Bean that will hold all data processed by cha... | java | private void showPage(final UniqueKey<? extends Model> pageModelKey, final Wave wave) {
if (pageModelKey != null && !pageModelKey.equals(this.currentModelKey)) {
LOGGER.info("Show Page Model: " + pageModelKey.toString());
// Create the Wave Bean that will hold all data processed by cha... | [
"private",
"void",
"showPage",
"(",
"final",
"UniqueKey",
"<",
"?",
"extends",
"Model",
">",
"pageModelKey",
",",
"final",
"Wave",
"wave",
")",
"{",
"if",
"(",
"pageModelKey",
"!=",
"null",
"&&",
"!",
"pageModelKey",
".",
"equals",
"(",
"this",
".",
"cur... | Private method used to show another page.
@param pageModelKey the mdoelKey for the page to show | [
"Private",
"method",
"used",
"to",
"show",
"another",
"page",
"."
] | 93f4fc087b83c73db540333b9686e97b4cec694d | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/component/src/main/java/org/jrebirth/af/component/ui/stack/StackModel.java#L137-L176 |
8,549 | cqyijifu/watcher | watcher-http/src/main/java/com/yiji/framework/watcher/http/adaptor/web/util/IPRange.java | IPRange.parseRange | final void parseRange(String range) {
if (range == null) {
throw new IllegalArgumentException("Invalid IP range");
}
int index = range.indexOf('/');
String subnetStr = null;
if (index == -1) {
ipAddress = new IPAddress(range);
} else {
ipAddress = new IPAddress(range.substring(0, index));
sub... | java | final void parseRange(String range) {
if (range == null) {
throw new IllegalArgumentException("Invalid IP range");
}
int index = range.indexOf('/');
String subnetStr = null;
if (index == -1) {
ipAddress = new IPAddress(range);
} else {
ipAddress = new IPAddress(range.substring(0, index));
sub... | [
"final",
"void",
"parseRange",
"(",
"String",
"range",
")",
"{",
"if",
"(",
"range",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Invalid IP range\"",
")",
";",
"}",
"int",
"index",
"=",
"range",
".",
"indexOf",
"(",
"'",
"... | Parse the IP range string representation.
@param range String representation of the IP range. | [
"Parse",
"the",
"IP",
"range",
"string",
"representation",
"."
] | 9032ede2743de751d8ae4b77ade39726f016457d | https://github.com/cqyijifu/watcher/blob/9032ede2743de751d8ae4b77ade39726f016457d/watcher-http/src/main/java/com/yiji/framework/watcher/http/adaptor/web/util/IPRange.java#L93-L129 |
8,550 | cqyijifu/watcher | watcher-http/src/main/java/com/yiji/framework/watcher/http/adaptor/web/util/IPRange.java | IPRange.computeNetworkPrefixFromMask | private int computeNetworkPrefixFromMask(IPAddress mask) {
int result = 0;
int tmp = mask.getIPAddress();
while ((tmp & 0x00000001) == 0x00000001) {
result++;
tmp = tmp >>> 1;
}
if (tmp != 0) {
return -1;
}
return result;
} | java | private int computeNetworkPrefixFromMask(IPAddress mask) {
int result = 0;
int tmp = mask.getIPAddress();
while ((tmp & 0x00000001) == 0x00000001) {
result++;
tmp = tmp >>> 1;
}
if (tmp != 0) {
return -1;
}
return result;
} | [
"private",
"int",
"computeNetworkPrefixFromMask",
"(",
"IPAddress",
"mask",
")",
"{",
"int",
"result",
"=",
"0",
";",
"int",
"tmp",
"=",
"mask",
".",
"getIPAddress",
"(",
")",
";",
"while",
"(",
"(",
"tmp",
"&",
"0x00000001",
")",
"==",
"0x00000001",
")"... | Compute the extended network prefix from the IP subnet mask.
@param mask Reference to the subnet mask IP number.
@return Return the extended network prefix. Return -1 if the specified
mask cannot be converted into a extended prefix network. | [
"Compute",
"the",
"extended",
"network",
"prefix",
"from",
"the",
"IP",
"subnet",
"mask",
"."
] | 9032ede2743de751d8ae4b77ade39726f016457d | https://github.com/cqyijifu/watcher/blob/9032ede2743de751d8ae4b77ade39726f016457d/watcher-http/src/main/java/com/yiji/framework/watcher/http/adaptor/web/util/IPRange.java#L139-L154 |
8,551 | cqyijifu/watcher | watcher-http/src/main/java/com/yiji/framework/watcher/http/adaptor/web/util/IPRange.java | IPRange.computeMaskFromNetworkPrefix | private IPAddress computeMaskFromNetworkPrefix(int prefix) {
/*
* int subnet = 0; for (int i=0; i<prefix; i++) { subnet = subnet << 1; subnet += 1; }
*/
StringBuilder str = new StringBuilder();
for (int i = 0; i < 32; i++) {
if (i < prefix) {
str.append("1");
} else {
str.append("0");
... | java | private IPAddress computeMaskFromNetworkPrefix(int prefix) {
/*
* int subnet = 0; for (int i=0; i<prefix; i++) { subnet = subnet << 1; subnet += 1; }
*/
StringBuilder str = new StringBuilder();
for (int i = 0; i < 32; i++) {
if (i < prefix) {
str.append("1");
} else {
str.append("0");
... | [
"private",
"IPAddress",
"computeMaskFromNetworkPrefix",
"(",
"int",
"prefix",
")",
"{",
"/*\n\t\t * int subnet = 0; for (int i=0; i<prefix; i++) { subnet = subnet << 1; subnet += 1; }\n\t\t */",
"StringBuilder",
"str",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"in... | Convert a extended network prefix integer into an IP number.
@param prefix The network prefix number.
@return Return the IP number corresponding to the extended network
prefix. | [
"Convert",
"a",
"extended",
"network",
"prefix",
"integer",
"into",
"an",
"IP",
"number",
"."
] | 9032ede2743de751d8ae4b77ade39726f016457d | https://github.com/cqyijifu/watcher/blob/9032ede2743de751d8ae4b77ade39726f016457d/watcher-http/src/main/java/com/yiji/framework/watcher/http/adaptor/web/util/IPRange.java#L180-L198 |
8,552 | cqyijifu/watcher | watcher-http/src/main/java/com/yiji/framework/watcher/http/adaptor/web/util/IPRange.java | IPRange.isIPAddressInRange | public boolean isIPAddressInRange(IPAddress address) {
if (ipSubnetMask == null) {
return this.ipAddress.equals(address);
}
int result1 = address.getIPAddress() & ipSubnetMask.getIPAddress();
int result2 = ipAddress.getIPAddress() & ipSubnetMask.getIPAddress();
return result1 == result2;
} | java | public boolean isIPAddressInRange(IPAddress address) {
if (ipSubnetMask == null) {
return this.ipAddress.equals(address);
}
int result1 = address.getIPAddress() & ipSubnetMask.getIPAddress();
int result2 = ipAddress.getIPAddress() & ipSubnetMask.getIPAddress();
return result1 == result2;
} | [
"public",
"boolean",
"isIPAddressInRange",
"(",
"IPAddress",
"address",
")",
"{",
"if",
"(",
"ipSubnetMask",
"==",
"null",
")",
"{",
"return",
"this",
".",
"ipAddress",
".",
"equals",
"(",
"address",
")",
";",
"}",
"int",
"result1",
"=",
"address",
".",
... | Check if the specified IP address is in the encapsulated range.
@param address The IP address to be tested.
@return Return <code>true</code> if the specified IP address is in the
encapsulated IP range, otherwise return <code>false</code>. | [
"Check",
"if",
"the",
"specified",
"IP",
"address",
"is",
"in",
"the",
"encapsulated",
"range",
"."
] | 9032ede2743de751d8ae4b77ade39726f016457d | https://github.com/cqyijifu/watcher/blob/9032ede2743de751d8ae4b77ade39726f016457d/watcher-http/src/main/java/com/yiji/framework/watcher/http/adaptor/web/util/IPRange.java#L208-L217 |
8,553 | cqyijifu/watcher | watcher-http/src/main/java/com/yiji/framework/watcher/http/adaptor/web/util/IPAddress.java | IPAddress.parseIPAddress | final int parseIPAddress(String ipAddressStr) {
int result = 0;
if (ipAddressStr == null) {
throw new IllegalArgumentException();
}
try {
String tmp = ipAddressStr;
// get the 3 first numbers
int offset = 0;
for (int i = 0; i < 3; i++) {
// get the position of the first dot
... | java | final int parseIPAddress(String ipAddressStr) {
int result = 0;
if (ipAddressStr == null) {
throw new IllegalArgumentException();
}
try {
String tmp = ipAddressStr;
// get the 3 first numbers
int offset = 0;
for (int i = 0; i < 3; i++) {
// get the position of the first dot
... | [
"final",
"int",
"parseIPAddress",
"(",
"String",
"ipAddressStr",
")",
"{",
"int",
"result",
"=",
"0",
";",
"if",
"(",
"ipAddressStr",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
")",
";",
"}",
"try",
"{",
"String",
"tmp",
"="... | Convert a decimal-dotted notation representation of an IP address into an
32 bits interger value.
@param ipAddressStr Decimal-dotted notation (xxx.xxx.xxx.xxx) of the IP
address.
@return Return the 32 bits integer representation of the IP address.
decimal-dotted notation xxx.xxx.xxx.xxx. | [
"Convert",
"a",
"decimal",
"-",
"dotted",
"notation",
"representation",
"of",
"an",
"IP",
"address",
"into",
"an",
"32",
"bits",
"interger",
"value",
"."
] | 9032ede2743de751d8ae4b77ade39726f016457d | https://github.com/cqyijifu/watcher/blob/9032ede2743de751d8ae4b77ade39726f016457d/watcher-http/src/main/java/com/yiji/framework/watcher/http/adaptor/web/util/IPAddress.java#L123-L179 |
8,554 | TGIO/ParseLiveQuery | parse-livequery/src/main/java/tgio/parselivequery/LiveQueryClient.java | LiveQueryClient.on | public static void on(String op, OnListener listener) {
getInstance().mEvents.add(new Event(op, listener));
} | java | public static void on(String op, OnListener listener) {
getInstance().mEvents.add(new Event(op, listener));
} | [
"public",
"static",
"void",
"on",
"(",
"String",
"op",
",",
"OnListener",
"listener",
")",
"{",
"getInstance",
"(",
")",
".",
"mEvents",
".",
"add",
"(",
"new",
"Event",
"(",
"op",
",",
"listener",
")",
")",
";",
"}"
] | Connect && Disconnect events | [
"Connect",
"&&",
"Disconnect",
"events"
] | 92ed9d0b1b7936bf714850044df2a2c564184aa3 | https://github.com/TGIO/ParseLiveQuery/blob/92ed9d0b1b7936bf714850044df2a2c564184aa3/parse-livequery/src/main/java/tgio/parselivequery/LiveQueryClient.java#L195-L197 |
8,555 | mikepenz/Crossfader | library/src/main/java/com/mikepenz/crossfader/view/CrossFadeSlidingPaneLayout.java | CrossFadeSlidingPaneLayout.enableDisableView | private void enableDisableView(View view, boolean enabled) {
view.setEnabled(enabled);
view.setFocusable(enabled);
if (view instanceof ViewGroup) {
ViewGroup group = (ViewGroup) view;
for (int idx = 0; idx < group.getChildCount(); idx++) {
enableDisableVi... | java | private void enableDisableView(View view, boolean enabled) {
view.setEnabled(enabled);
view.setFocusable(enabled);
if (view instanceof ViewGroup) {
ViewGroup group = (ViewGroup) view;
for (int idx = 0; idx < group.getChildCount(); idx++) {
enableDisableVi... | [
"private",
"void",
"enableDisableView",
"(",
"View",
"view",
",",
"boolean",
"enabled",
")",
"{",
"view",
".",
"setEnabled",
"(",
"enabled",
")",
";",
"view",
".",
"setFocusable",
"(",
"enabled",
")",
";",
"if",
"(",
"view",
"instanceof",
"ViewGroup",
")",... | helper method to disable a view and all its subviews
@param view
@param enabled | [
"helper",
"method",
"to",
"disable",
"a",
"view",
"and",
"all",
"its",
"subviews"
] | b2e1ee461bc3bcdd897d83f0fad950663bdc73b4 | https://github.com/mikepenz/Crossfader/blob/b2e1ee461bc3bcdd897d83f0fad950663bdc73b4/library/src/main/java/com/mikepenz/crossfader/view/CrossFadeSlidingPaneLayout.java#L152-L162 |
8,556 | mikepenz/Crossfader | library/src/main/java/com/mikepenz/crossfader/Crossfader.java | Crossfader.withStructure | public Crossfader withStructure(View first, int firstWidth, View second, int secondWidth) {
withFirst(first, firstWidth);
withSecond(second, secondWidth);
return this;
} | java | public Crossfader withStructure(View first, int firstWidth, View second, int secondWidth) {
withFirst(first, firstWidth);
withSecond(second, secondWidth);
return this;
} | [
"public",
"Crossfader",
"withStructure",
"(",
"View",
"first",
",",
"int",
"firstWidth",
",",
"View",
"second",
",",
"int",
"secondWidth",
")",
"{",
"withFirst",
"(",
"first",
",",
"firstWidth",
")",
";",
"withSecond",
"(",
"second",
",",
"secondWidth",
")",... | define the default view and the slided view of the crossfader
@param first
@param firstWidth
@param second
@param secondWidth
@return | [
"define",
"the",
"default",
"view",
"and",
"the",
"slided",
"view",
"of",
"the",
"crossfader"
] | b2e1ee461bc3bcdd897d83f0fad950663bdc73b4 | https://github.com/mikepenz/Crossfader/blob/b2e1ee461bc3bcdd897d83f0fad950663bdc73b4/library/src/main/java/com/mikepenz/crossfader/Crossfader.java#L111-L115 |
8,557 | mikepenz/Crossfader | library/src/main/java/com/mikepenz/crossfader/Crossfader.java | Crossfader.withCanSlide | public Crossfader withCanSlide(boolean canSlide) {
this.mCanSlide = canSlide;
if (mCrossFadeSlidingPaneLayout != null) {
mCrossFadeSlidingPaneLayout.setCanSlide(mCanSlide);
}
return this;
} | java | public Crossfader withCanSlide(boolean canSlide) {
this.mCanSlide = canSlide;
if (mCrossFadeSlidingPaneLayout != null) {
mCrossFadeSlidingPaneLayout.setCanSlide(mCanSlide);
}
return this;
} | [
"public",
"Crossfader",
"withCanSlide",
"(",
"boolean",
"canSlide",
")",
"{",
"this",
".",
"mCanSlide",
"=",
"canSlide",
";",
"if",
"(",
"mCrossFadeSlidingPaneLayout",
"!=",
"null",
")",
"{",
"mCrossFadeSlidingPaneLayout",
".",
"setCanSlide",
"(",
"mCanSlide",
")"... | Allow the panel to slide
@param canSlide
@return | [
"Allow",
"the",
"panel",
"to",
"slide"
] | b2e1ee461bc3bcdd897d83f0fad950663bdc73b4 | https://github.com/mikepenz/Crossfader/blob/b2e1ee461bc3bcdd897d83f0fad950663bdc73b4/library/src/main/java/com/mikepenz/crossfader/Crossfader.java#L141-L147 |
8,558 | mikepenz/Crossfader | library/src/main/java/com/mikepenz/crossfader/Crossfader.java | Crossfader.withPanelSlideListener | public Crossfader withPanelSlideListener(SlidingPaneLayout.PanelSlideListener panelSlideListener) {
this.mPanelSlideListener = panelSlideListener;
if (mCrossFadeSlidingPaneLayout != null) {
mCrossFadeSlidingPaneLayout.setPanelSlideListener(mPanelSlideListener);
}
return this;... | java | public Crossfader withPanelSlideListener(SlidingPaneLayout.PanelSlideListener panelSlideListener) {
this.mPanelSlideListener = panelSlideListener;
if (mCrossFadeSlidingPaneLayout != null) {
mCrossFadeSlidingPaneLayout.setPanelSlideListener(mPanelSlideListener);
}
return this;... | [
"public",
"Crossfader",
"withPanelSlideListener",
"(",
"SlidingPaneLayout",
".",
"PanelSlideListener",
"panelSlideListener",
")",
"{",
"this",
".",
"mPanelSlideListener",
"=",
"panelSlideListener",
";",
"if",
"(",
"mCrossFadeSlidingPaneLayout",
"!=",
"null",
")",
"{",
"... | set a PanelSlideListener used with the CrossFadeSlidingPaneLayout
@param panelSlideListener
@return | [
"set",
"a",
"PanelSlideListener",
"used",
"with",
"the",
"CrossFadeSlidingPaneLayout"
] | b2e1ee461bc3bcdd897d83f0fad950663bdc73b4 | https://github.com/mikepenz/Crossfader/blob/b2e1ee461bc3bcdd897d83f0fad950663bdc73b4/library/src/main/java/com/mikepenz/crossfader/Crossfader.java#L158-L164 |
8,559 | mikepenz/Crossfader | library/src/main/java/com/mikepenz/crossfader/Crossfader.java | Crossfader.build | public Crossfader build() {
if (mFirstWidth < mSecondWidth) {
throw new RuntimeException("the first layout has to be the layout with the greater width");
}
//get the layout which should be replaced by the CrossFadeSlidingPaneLayout
ViewGroup container = ((ViewGroup) mContent... | java | public Crossfader build() {
if (mFirstWidth < mSecondWidth) {
throw new RuntimeException("the first layout has to be the layout with the greater width");
}
//get the layout which should be replaced by the CrossFadeSlidingPaneLayout
ViewGroup container = ((ViewGroup) mContent... | [
"public",
"Crossfader",
"build",
"(",
")",
"{",
"if",
"(",
"mFirstWidth",
"<",
"mSecondWidth",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"\"the first layout has to be the layout with the greater width\"",
")",
";",
"}",
"//get the layout which should be replaced by... | builds the crossfader and it's content views
will define all properties and define and add the layouts
@return | [
"builds",
"the",
"crossfader",
"and",
"it",
"s",
"content",
"views",
"will",
"define",
"all",
"properties",
"and",
"define",
"and",
"add",
"the",
"layouts"
] | b2e1ee461bc3bcdd897d83f0fad950663bdc73b4 | https://github.com/mikepenz/Crossfader/blob/b2e1ee461bc3bcdd897d83f0fad950663bdc73b4/library/src/main/java/com/mikepenz/crossfader/Crossfader.java#L281-L340 |
8,560 | mikepenz/Crossfader | library/src/main/java/com/mikepenz/crossfader/Crossfader.java | Crossfader.setWidth | protected void setWidth(View view, int width) {
ViewGroup.LayoutParams lp = view.getLayoutParams();
lp.width = width;
view.setLayoutParams(lp);
} | java | protected void setWidth(View view, int width) {
ViewGroup.LayoutParams lp = view.getLayoutParams();
lp.width = width;
view.setLayoutParams(lp);
} | [
"protected",
"void",
"setWidth",
"(",
"View",
"view",
",",
"int",
"width",
")",
"{",
"ViewGroup",
".",
"LayoutParams",
"lp",
"=",
"view",
".",
"getLayoutParams",
"(",
")",
";",
"lp",
".",
"width",
"=",
"width",
";",
"view",
".",
"setLayoutParams",
"(",
... | define the width of the given view
@param view
@param width | [
"define",
"the",
"width",
"of",
"the",
"given",
"view"
] | b2e1ee461bc3bcdd897d83f0fad950663bdc73b4 | https://github.com/mikepenz/Crossfader/blob/b2e1ee461bc3bcdd897d83f0fad950663bdc73b4/library/src/main/java/com/mikepenz/crossfader/Crossfader.java#L381-L385 |
8,561 | mikepenz/Crossfader | library/src/main/java/com/mikepenz/crossfader/Crossfader.java | Crossfader.setLeftMargin | protected void setLeftMargin(View view, int leftMargin) {
SlidingPaneLayout.LayoutParams lp = (SlidingPaneLayout.LayoutParams) view.getLayoutParams();
lp.leftMargin = leftMargin;
lp.rightMargin = 0;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
lp.setMar... | java | protected void setLeftMargin(View view, int leftMargin) {
SlidingPaneLayout.LayoutParams lp = (SlidingPaneLayout.LayoutParams) view.getLayoutParams();
lp.leftMargin = leftMargin;
lp.rightMargin = 0;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
lp.setMar... | [
"protected",
"void",
"setLeftMargin",
"(",
"View",
"view",
",",
"int",
"leftMargin",
")",
"{",
"SlidingPaneLayout",
".",
"LayoutParams",
"lp",
"=",
"(",
"SlidingPaneLayout",
".",
"LayoutParams",
")",
"view",
".",
"getLayoutParams",
"(",
")",
";",
"lp",
".",
... | define the left margin of the given view
@param view
@param leftMargin | [
"define",
"the",
"left",
"margin",
"of",
"the",
"given",
"view"
] | b2e1ee461bc3bcdd897d83f0fad950663bdc73b4 | https://github.com/mikepenz/Crossfader/blob/b2e1ee461bc3bcdd897d83f0fad950663bdc73b4/library/src/main/java/com/mikepenz/crossfader/Crossfader.java#L393-L403 |
8,562 | mikepenz/Crossfader | library/src/main/java/com/mikepenz/crossfader/util/UIUtils.java | UIUtils.isPointInsideView | public static boolean isPointInsideView(float x, float y, View view) {
int location[] = new int[2];
view.getLocationOnScreen(location);
int viewX = location[0];
int viewY = location[1];
//point is inside view bounds
if ((viewX < x && x < (viewX + view.getWidth())) &&
... | java | public static boolean isPointInsideView(float x, float y, View view) {
int location[] = new int[2];
view.getLocationOnScreen(location);
int viewX = location[0];
int viewY = location[1];
//point is inside view bounds
if ((viewX < x && x < (viewX + view.getWidth())) &&
... | [
"public",
"static",
"boolean",
"isPointInsideView",
"(",
"float",
"x",
",",
"float",
"y",
",",
"View",
"view",
")",
"{",
"int",
"location",
"[",
"]",
"=",
"new",
"int",
"[",
"2",
"]",
";",
"view",
".",
"getLocationOnScreen",
"(",
"location",
")",
";",
... | Determines if given points are inside view
@param x - x coordinate of point
@param y - y coordinate of point
@param view - view object to compare
@return true if the points are within view bounds, false otherwise | [
"Determines",
"if",
"given",
"points",
"are",
"inside",
"view"
] | b2e1ee461bc3bcdd897d83f0fad950663bdc73b4 | https://github.com/mikepenz/Crossfader/blob/b2e1ee461bc3bcdd897d83f0fad950663bdc73b4/library/src/main/java/com/mikepenz/crossfader/util/UIUtils.java#L50-L63 |
8,563 | rzwitserloot/lombok.ast | src/ast/lombok/ast/AbstractNode.java | AbstractNode.ensureParentage | protected void ensureParentage(AbstractNode child) throws IllegalStateException {
if (child.parent == this) return;
throw new IllegalStateException(String.format(
"Can't disown child of type %s - it isn't my child (I'm a %s)",
child.getClass().getName(), this.getClass().getName()));
} | java | protected void ensureParentage(AbstractNode child) throws IllegalStateException {
if (child.parent == this) return;
throw new IllegalStateException(String.format(
"Can't disown child of type %s - it isn't my child (I'm a %s)",
child.getClass().getName(), this.getClass().getName()));
} | [
"protected",
"void",
"ensureParentage",
"(",
"AbstractNode",
"child",
")",
"throws",
"IllegalStateException",
"{",
"if",
"(",
"child",
".",
"parent",
"==",
"this",
")",
"return",
";",
"throw",
"new",
"IllegalStateException",
"(",
"String",
".",
"format",
"(",
... | Checks if the provided node is a direct child of this node.
@param child This node must be a direct child of myself.
@throws IllegalStateException If {@code child} isn't a direct child of myself. | [
"Checks",
"if",
"the",
"provided",
"node",
"is",
"a",
"direct",
"child",
"of",
"this",
"node",
"."
] | ed83541c1a5a08952a5d4d7e316a6be9a05311fb | https://github.com/rzwitserloot/lombok.ast/blob/ed83541c1a5a08952a5d4d7e316a6be9a05311fb/src/ast/lombok/ast/AbstractNode.java#L114-L120 |
8,564 | jroyalty/jglm | src/main/java/com/hackoeur/jglm/Mat4.java | Mat4.add | public Mat4 add(final Mat4 other) {
return new Mat4(
m00 + other.m00, m01 + other.m01, m02 + other.m02, m03 + other.m03,
m10 + other.m10, m11 + other.m11, m12 + other.m12, m13 + other.m13,
m20 + other.m20, m21 + other.m21, m... | java | public Mat4 add(final Mat4 other) {
return new Mat4(
m00 + other.m00, m01 + other.m01, m02 + other.m02, m03 + other.m03,
m10 + other.m10, m11 + other.m11, m12 + other.m12, m13 + other.m13,
m20 + other.m20, m21 + other.m21, m... | [
"public",
"Mat4",
"add",
"(",
"final",
"Mat4",
"other",
")",
"{",
"return",
"new",
"Mat4",
"(",
"m00",
"+",
"other",
".",
"m00",
",",
"m01",
"+",
"other",
".",
"m01",
",",
"m02",
"+",
"other",
".",
"m02",
",",
"m03",
"+",
"other",
".",
"m03",
"... | Add two matrices together and return the result
@param other | [
"Add",
"two",
"matrices",
"together",
"and",
"return",
"the",
"result"
] | 9397c2fcf0d4d62844c64d0b14065ee7bf8cafc6 | https://github.com/jroyalty/jglm/blob/9397c2fcf0d4d62844c64d0b14065ee7bf8cafc6/src/main/java/com/hackoeur/jglm/Mat4.java#L421-L428 |
8,565 | rzwitserloot/lombok.ast | src/main/lombok/ast/grammar/ProfilerParseRunner.java | ProfilerParseRunner.getOverviewReport | public String getOverviewReport() {
TreeSet<ReportEntry<V>> topLevelFailed = new TreeSet<ReportEntry<V>>();
fillReport(topLevelFailed, rootReport);
StringBuilder out = new StringBuilder();
for (ReportEntry<V> entry : topLevelFailed) {
if (entry.getSubSteps() < 100) break;
out.append(formatReport(entry, fa... | java | public String getOverviewReport() {
TreeSet<ReportEntry<V>> topLevelFailed = new TreeSet<ReportEntry<V>>();
fillReport(topLevelFailed, rootReport);
StringBuilder out = new StringBuilder();
for (ReportEntry<V> entry : topLevelFailed) {
if (entry.getSubSteps() < 100) break;
out.append(formatReport(entry, fa... | [
"public",
"String",
"getOverviewReport",
"(",
")",
"{",
"TreeSet",
"<",
"ReportEntry",
"<",
"V",
">>",
"topLevelFailed",
"=",
"new",
"TreeSet",
"<",
"ReportEntry",
"<",
"V",
">",
">",
"(",
")",
";",
"fillReport",
"(",
"topLevelFailed",
",",
"rootReport",
"... | Returns a string describing, in order of 'expensiveness', the top-level failed rule chains in the parse run. | [
"Returns",
"a",
"string",
"describing",
"in",
"order",
"of",
"expensiveness",
"the",
"top",
"-",
"level",
"failed",
"rule",
"chains",
"in",
"the",
"parse",
"run",
"."
] | ed83541c1a5a08952a5d4d7e316a6be9a05311fb | https://github.com/rzwitserloot/lombok.ast/blob/ed83541c1a5a08952a5d4d7e316a6be9a05311fb/src/main/lombok/ast/grammar/ProfilerParseRunner.java#L64-L74 |
8,566 | rzwitserloot/lombok.ast | src/main/lombok/ast/grammar/ProfilerParseRunner.java | ProfilerParseRunner.getExtendedReport | public List<String> getExtendedReport(int topEntries) {
TreeSet<ReportEntry<V>> topLevelFailed = new TreeSet<ReportEntry<V>>();
fillReport(topLevelFailed, rootReport);
int count = topEntries;
List<String> result = Lists.newArrayList();
StringBuilder out = new StringBuilder();
for (ReportEntry<V> entry : top... | java | public List<String> getExtendedReport(int topEntries) {
TreeSet<ReportEntry<V>> topLevelFailed = new TreeSet<ReportEntry<V>>();
fillReport(topLevelFailed, rootReport);
int count = topEntries;
List<String> result = Lists.newArrayList();
StringBuilder out = new StringBuilder();
for (ReportEntry<V> entry : top... | [
"public",
"List",
"<",
"String",
">",
"getExtendedReport",
"(",
"int",
"topEntries",
")",
"{",
"TreeSet",
"<",
"ReportEntry",
"<",
"V",
">>",
"topLevelFailed",
"=",
"new",
"TreeSet",
"<",
"ReportEntry",
"<",
"V",
">",
">",
"(",
")",
";",
"fillReport",
"(... | Lists the work done by the most expensive failed rules.
First all failed rules are sorted according to how long they took, then, for each such rule,
a string is produced listing it and all its child rules. These are returned.
@param topEntries Produce reports for the top {@code topEntries} most expensive failed rules... | [
"Lists",
"the",
"work",
"done",
"by",
"the",
"most",
"expensive",
"failed",
"rules",
"."
] | ed83541c1a5a08952a5d4d7e316a6be9a05311fb | https://github.com/rzwitserloot/lombok.ast/blob/ed83541c1a5a08952a5d4d7e316a6be9a05311fb/src/main/lombok/ast/grammar/ProfilerParseRunner.java#L85-L99 |
8,567 | jroyalty/jglm | src/main/java/com/hackoeur/jglm/support/FastMath.java | FastMath.doubleHighPart | private static double doubleHighPart(double d) {
if (d > -Precision.SAFE_MIN && d < Precision.SAFE_MIN){
return d; // These are un-normalised - don't try to convert
}
long xl = Double.doubleToLongBits(d);
xl = xl & MASK_30BITS; // Drop low order bits
return Double.lon... | java | private static double doubleHighPart(double d) {
if (d > -Precision.SAFE_MIN && d < Precision.SAFE_MIN){
return d; // These are un-normalised - don't try to convert
}
long xl = Double.doubleToLongBits(d);
xl = xl & MASK_30BITS; // Drop low order bits
return Double.lon... | [
"private",
"static",
"double",
"doubleHighPart",
"(",
"double",
"d",
")",
"{",
"if",
"(",
"d",
">",
"-",
"Precision",
".",
"SAFE_MIN",
"&&",
"d",
"<",
"Precision",
".",
"SAFE_MIN",
")",
"{",
"return",
"d",
";",
"// These are un-normalised - don't try to conver... | Get the high order bits from the mantissa.
Equivalent to adding and subtracting HEX_40000 but also works for very large numbers
@param d the value to split
@return the high order part of the mantissa | [
"Get",
"the",
"high",
"order",
"bits",
"from",
"the",
"mantissa",
".",
"Equivalent",
"to",
"adding",
"and",
"subtracting",
"HEX_40000",
"but",
"also",
"works",
"for",
"very",
"large",
"numbers"
] | 9397c2fcf0d4d62844c64d0b14065ee7bf8cafc6 | https://github.com/jroyalty/jglm/blob/9397c2fcf0d4d62844c64d0b14065ee7bf8cafc6/src/main/java/com/hackoeur/jglm/support/FastMath.java#L364-L371 |
8,568 | jroyalty/jglm | src/main/java/com/hackoeur/jglm/support/FastMath.java | FastMath.cosh | public static double cosh(double x) {
if (x != x) {
return x;
}
// cosh[z] = (exp(z) + exp(-z))/2
// for numbers with magnitude 20 or so,
// exp(-z) can be ignored in comparison with exp(z)
if (x > 20) {
if (x >= LOG_MAX_VALUE) {
// Avoid overflow... | java | public static double cosh(double x) {
if (x != x) {
return x;
}
// cosh[z] = (exp(z) + exp(-z))/2
// for numbers with magnitude 20 or so,
// exp(-z) can be ignored in comparison with exp(z)
if (x > 20) {
if (x >= LOG_MAX_VALUE) {
// Avoid overflow... | [
"public",
"static",
"double",
"cosh",
"(",
"double",
"x",
")",
"{",
"if",
"(",
"x",
"!=",
"x",
")",
"{",
"return",
"x",
";",
"}",
"// cosh[z] = (exp(z) + exp(-z))/2",
"// for numbers with magnitude 20 or so,",
"// exp(-z) can be ignored in comparison with exp(z)",
"if",... | Compute the hyperbolic cosine of a number.
@param x number on which evaluation is done
@return hyperbolic cosine of x | [
"Compute",
"the",
"hyperbolic",
"cosine",
"of",
"a",
"number",
"."
] | 9397c2fcf0d4d62844c64d0b14065ee7bf8cafc6 | https://github.com/jroyalty/jglm/blob/9397c2fcf0d4d62844c64d0b14065ee7bf8cafc6/src/main/java/com/hackoeur/jglm/support/FastMath.java#L426-L489 |
8,569 | jroyalty/jglm | src/main/java/com/hackoeur/jglm/support/FastMath.java | FastMath.exp | private static double exp(double x, double extra, double[] hiPrec) {
double intPartA;
double intPartB;
int intVal;
/* Lookup exp(floor(x)).
* intPartA will have the upper 22 bits, intPartB will have the lower
* 52 bits.
*/
if (x < 0.0) {
in... | java | private static double exp(double x, double extra, double[] hiPrec) {
double intPartA;
double intPartB;
int intVal;
/* Lookup exp(floor(x)).
* intPartA will have the upper 22 bits, intPartB will have the lower
* 52 bits.
*/
if (x < 0.0) {
in... | [
"private",
"static",
"double",
"exp",
"(",
"double",
"x",
",",
"double",
"extra",
",",
"double",
"[",
"]",
"hiPrec",
")",
"{",
"double",
"intPartA",
";",
"double",
"intPartB",
";",
"int",
"intVal",
";",
"/* Lookup exp(floor(x)).\n * intPartA will have the ... | Internal helper method for exponential function.
@param x original argument of the exponential function
@param extra extra bits of precision on input (To Be Confirmed)
@param hiPrec extra bits of precision on output (To Be Confirmed)
@return exp(x) | [
"Internal",
"helper",
"method",
"for",
"exponential",
"function",
"."
] | 9397c2fcf0d4d62844c64d0b14065ee7bf8cafc6 | https://github.com/jroyalty/jglm/blob/9397c2fcf0d4d62844c64d0b14065ee7bf8cafc6/src/main/java/com/hackoeur/jglm/support/FastMath.java#L881-L996 |
8,570 | jroyalty/jglm | src/main/java/com/hackoeur/jglm/support/FastMath.java | FastMath.log10 | public static double log10(final double x) {
final double hiPrec[] = new double[2];
final double lores = log(x, hiPrec);
if (Double.isInfinite(lores)){ // don't allow this to be converted to NaN
return lores;
}
final double tmp = hiPrec[0] * HEX_40000000;
fi... | java | public static double log10(final double x) {
final double hiPrec[] = new double[2];
final double lores = log(x, hiPrec);
if (Double.isInfinite(lores)){ // don't allow this to be converted to NaN
return lores;
}
final double tmp = hiPrec[0] * HEX_40000000;
fi... | [
"public",
"static",
"double",
"log10",
"(",
"final",
"double",
"x",
")",
"{",
"final",
"double",
"hiPrec",
"[",
"]",
"=",
"new",
"double",
"[",
"2",
"]",
";",
"final",
"double",
"lores",
"=",
"log",
"(",
"x",
",",
"hiPrec",
")",
";",
"if",
"(",
"... | Compute the base 10 logarithm.
@param x a number
@return log10(x) | [
"Compute",
"the",
"base",
"10",
"logarithm",
"."
] | 9397c2fcf0d4d62844c64d0b14065ee7bf8cafc6 | https://github.com/jroyalty/jglm/blob/9397c2fcf0d4d62844c64d0b14065ee7bf8cafc6/src/main/java/com/hackoeur/jglm/support/FastMath.java#L1437-L1453 |
8,571 | jroyalty/jglm | src/main/java/com/hackoeur/jglm/support/FastMath.java | FastMath.pow | public static double pow(double d, int e) {
if (e == 0) {
return 1.0;
} else if (e < 0) {
e = -e;
d = 1.0 / d;
}
// split d as two 26 bits numbers
// beware the following expressions must NOT be simplified, they rely on floating point arithme... | java | public static double pow(double d, int e) {
if (e == 0) {
return 1.0;
} else if (e < 0) {
e = -e;
d = 1.0 / d;
}
// split d as two 26 bits numbers
// beware the following expressions must NOT be simplified, they rely on floating point arithme... | [
"public",
"static",
"double",
"pow",
"(",
"double",
"d",
",",
"int",
"e",
")",
"{",
"if",
"(",
"e",
"==",
"0",
")",
"{",
"return",
"1.0",
";",
"}",
"else",
"if",
"(",
"e",
"<",
"0",
")",
"{",
"e",
"=",
"-",
"e",
";",
"d",
"=",
"1.0",
"/",... | Raise a double to an int power.
@param d Number to raise.
@param e Exponent.
@return d<sup>e</sup>
@since 3.1 | [
"Raise",
"a",
"double",
"to",
"an",
"int",
"power",
"."
] | 9397c2fcf0d4d62844c64d0b14065ee7bf8cafc6 | https://github.com/jroyalty/jglm/blob/9397c2fcf0d4d62844c64d0b14065ee7bf8cafc6/src/main/java/com/hackoeur/jglm/support/FastMath.java#L1651-L1708 |
8,572 | jroyalty/jglm | src/main/java/com/hackoeur/jglm/support/FastMath.java | FastMath.sin | public static double sin(double x) {
boolean negative = false;
int quadrant = 0;
double xa;
double xb = 0.0;
/* Take absolute value of the input */
xa = x;
if (x < 0) {
negative = true;
xa = -xa;
}
/* Check for zero and ne... | java | public static double sin(double x) {
boolean negative = false;
int quadrant = 0;
double xa;
double xb = 0.0;
/* Take absolute value of the input */
xa = x;
if (x < 0) {
negative = true;
xa = -xa;
}
/* Check for zero and ne... | [
"public",
"static",
"double",
"sin",
"(",
"double",
"x",
")",
"{",
"boolean",
"negative",
"=",
"false",
";",
"int",
"quadrant",
"=",
"0",
";",
"double",
"xa",
";",
"double",
"xb",
"=",
"0.0",
";",
"/* Take absolute value of the input */",
"xa",
"=",
"x",
... | Sine function.
@param x Argument.
@return sin(x) | [
"Sine",
"function",
"."
] | 9397c2fcf0d4d62844c64d0b14065ee7bf8cafc6 | https://github.com/jroyalty/jglm/blob/9397c2fcf0d4d62844c64d0b14065ee7bf8cafc6/src/main/java/com/hackoeur/jglm/support/FastMath.java#L2265-L2324 |
8,573 | jroyalty/jglm | src/main/java/com/hackoeur/jglm/support/FastMath.java | FastMath.cos | public static double cos(double x) {
int quadrant = 0;
/* Take absolute value of the input */
double xa = x;
if (x < 0) {
xa = -xa;
}
if (xa != xa || xa == Double.POSITIVE_INFINITY) {
return Double.NaN;
}
/* Perform any argument ... | java | public static double cos(double x) {
int quadrant = 0;
/* Take absolute value of the input */
double xa = x;
if (x < 0) {
xa = -xa;
}
if (xa != xa || xa == Double.POSITIVE_INFINITY) {
return Double.NaN;
}
/* Perform any argument ... | [
"public",
"static",
"double",
"cos",
"(",
"double",
"x",
")",
"{",
"int",
"quadrant",
"=",
"0",
";",
"/* Take absolute value of the input */",
"double",
"xa",
"=",
"x",
";",
"if",
"(",
"x",
"<",
"0",
")",
"{",
"xa",
"=",
"-",
"xa",
";",
"}",
"if",
... | Cosine function.
@param x Argument.
@return cos(x) | [
"Cosine",
"function",
"."
] | 9397c2fcf0d4d62844c64d0b14065ee7bf8cafc6 | https://github.com/jroyalty/jglm/blob/9397c2fcf0d4d62844c64d0b14065ee7bf8cafc6/src/main/java/com/hackoeur/jglm/support/FastMath.java#L2332-L2378 |
8,574 | jroyalty/jglm | src/main/java/com/hackoeur/jglm/support/FastMath.java | FastMath.tan | public static double tan(double x) {
boolean negative = false;
int quadrant = 0;
/* Take absolute value of the input */
double xa = x;
if (x < 0) {
negative = true;
xa = -xa;
}
/* Check for zero and negative zero */
if (xa == 0.0)... | java | public static double tan(double x) {
boolean negative = false;
int quadrant = 0;
/* Take absolute value of the input */
double xa = x;
if (x < 0) {
negative = true;
xa = -xa;
}
/* Check for zero and negative zero */
if (xa == 0.0)... | [
"public",
"static",
"double",
"tan",
"(",
"double",
"x",
")",
"{",
"boolean",
"negative",
"=",
"false",
";",
"int",
"quadrant",
"=",
"0",
";",
"/* Take absolute value of the input */",
"double",
"xa",
"=",
"x",
";",
"if",
"(",
"x",
"<",
"0",
")",
"{",
... | Tangent function.
@param x Argument.
@return tan(x) | [
"Tangent",
"function",
"."
] | 9397c2fcf0d4d62844c64d0b14065ee7bf8cafc6 | https://github.com/jroyalty/jglm/blob/9397c2fcf0d4d62844c64d0b14065ee7bf8cafc6/src/main/java/com/hackoeur/jglm/support/FastMath.java#L2386-L2455 |
8,575 | jroyalty/jglm | src/main/java/com/hackoeur/jglm/support/FastMath.java | FastMath.asin | public static double asin(double x) {
if (x != x) {
return Double.NaN;
}
if (x > 1.0 || x < -1.0) {
return Double.NaN;
}
if (x == 1.0) {
return Math.PI/2.0;
}
if (x == -1.0) {
return -Math.PI/2.0;
}
if (x == 0.0) { // Matc... | java | public static double asin(double x) {
if (x != x) {
return Double.NaN;
}
if (x > 1.0 || x < -1.0) {
return Double.NaN;
}
if (x == 1.0) {
return Math.PI/2.0;
}
if (x == -1.0) {
return -Math.PI/2.0;
}
if (x == 0.0) { // Matc... | [
"public",
"static",
"double",
"asin",
"(",
"double",
"x",
")",
"{",
"if",
"(",
"x",
"!=",
"x",
")",
"{",
"return",
"Double",
".",
"NaN",
";",
"}",
"if",
"(",
"x",
">",
"1.0",
"||",
"x",
"<",
"-",
"1.0",
")",
"{",
"return",
"Double",
".",
"NaN... | Compute the arc sine of a number.
@param x number on which evaluation is done
@return arc sine of x | [
"Compute",
"the",
"arc",
"sine",
"of",
"a",
"number",
"."
] | 9397c2fcf0d4d62844c64d0b14065ee7bf8cafc6 | https://github.com/jroyalty/jglm/blob/9397c2fcf0d4d62844c64d0b14065ee7bf8cafc6/src/main/java/com/hackoeur/jglm/support/FastMath.java#L2740-L2810 |
8,576 | jroyalty/jglm | src/main/java/com/hackoeur/jglm/support/FastMath.java | FastMath.acos | public static double acos(double x) {
if (x != x) {
return Double.NaN;
}
if (x > 1.0 || x < -1.0) {
return Double.NaN;
}
if (x == -1.0) {
return Math.PI;
}
if (x == 1.0) {
return 0.0;
}
if (x == 0) {
return Math.... | java | public static double acos(double x) {
if (x != x) {
return Double.NaN;
}
if (x > 1.0 || x < -1.0) {
return Double.NaN;
}
if (x == -1.0) {
return Math.PI;
}
if (x == 1.0) {
return 0.0;
}
if (x == 0) {
return Math.... | [
"public",
"static",
"double",
"acos",
"(",
"double",
"x",
")",
"{",
"if",
"(",
"x",
"!=",
"x",
")",
"{",
"return",
"Double",
".",
"NaN",
";",
"}",
"if",
"(",
"x",
">",
"1.0",
"||",
"x",
"<",
"-",
"1.0",
")",
"{",
"return",
"Double",
".",
"NaN... | Compute the arc cosine of a number.
@param x number on which evaluation is done
@return arc cosine of x | [
"Compute",
"the",
"arc",
"cosine",
"of",
"a",
"number",
"."
] | 9397c2fcf0d4d62844c64d0b14065ee7bf8cafc6 | https://github.com/jroyalty/jglm/blob/9397c2fcf0d4d62844c64d0b14065ee7bf8cafc6/src/main/java/com/hackoeur/jglm/support/FastMath.java#L2816-L2892 |
8,577 | jroyalty/jglm | src/main/java/com/hackoeur/jglm/support/FastMath.java | FastMath.cbrt | public static double cbrt(double x) {
/* Convert input double to bits */
long inbits = Double.doubleToLongBits(x);
int exponent = (int) ((inbits >> 52) & 0x7ff) - 1023;
boolean subnormal = false;
if (exponent == -1023) {
if (x == 0) {
return x;
}
... | java | public static double cbrt(double x) {
/* Convert input double to bits */
long inbits = Double.doubleToLongBits(x);
int exponent = (int) ((inbits >> 52) & 0x7ff) - 1023;
boolean subnormal = false;
if (exponent == -1023) {
if (x == 0) {
return x;
}
... | [
"public",
"static",
"double",
"cbrt",
"(",
"double",
"x",
")",
"{",
"/* Convert input double to bits */",
"long",
"inbits",
"=",
"Double",
".",
"doubleToLongBits",
"(",
"x",
")",
";",
"int",
"exponent",
"=",
"(",
"int",
")",
"(",
"(",
"inbits",
">>",
"52",... | Compute the cubic root of a number.
@param x number on which evaluation is done
@return cubic root of x | [
"Compute",
"the",
"cubic",
"root",
"of",
"a",
"number",
"."
] | 9397c2fcf0d4d62844c64d0b14065ee7bf8cafc6 | https://github.com/jroyalty/jglm/blob/9397c2fcf0d4d62844c64d0b14065ee7bf8cafc6/src/main/java/com/hackoeur/jglm/support/FastMath.java#L2898-L2976 |
8,578 | jroyalty/jglm | src/main/java/com/hackoeur/jglm/support/FastMath.java | FastMath.toRadians | public static double toRadians(double x)
{
if (Double.isInfinite(x) || x == 0.0) { // Matches +/- 0.0; return correct sign
return x;
}
// These are PI/180 split into high and low order bits
final double facta = 0.01745329052209854;
final double factb = 1.99784475... | java | public static double toRadians(double x)
{
if (Double.isInfinite(x) || x == 0.0) { // Matches +/- 0.0; return correct sign
return x;
}
// These are PI/180 split into high and low order bits
final double facta = 0.01745329052209854;
final double factb = 1.99784475... | [
"public",
"static",
"double",
"toRadians",
"(",
"double",
"x",
")",
"{",
"if",
"(",
"Double",
".",
"isInfinite",
"(",
"x",
")",
"||",
"x",
"==",
"0.0",
")",
"{",
"// Matches +/- 0.0; return correct sign",
"return",
"x",
";",
"}",
"// These are PI/180 split int... | Convert degrees to radians, with error of less than 0.5 ULP
@param x angle in degrees
@return x converted into radians | [
"Convert",
"degrees",
"to",
"radians",
"with",
"error",
"of",
"less",
"than",
"0",
".",
"5",
"ULP"
] | 9397c2fcf0d4d62844c64d0b14065ee7bf8cafc6 | https://github.com/jroyalty/jglm/blob/9397c2fcf0d4d62844c64d0b14065ee7bf8cafc6/src/main/java/com/hackoeur/jglm/support/FastMath.java#L2983-L3001 |
8,579 | jroyalty/jglm | src/main/java/com/hackoeur/jglm/support/FastMath.java | FastMath.toDegrees | public static double toDegrees(double x)
{
if (Double.isInfinite(x) || x == 0.0) { // Matches +/- 0.0; return correct sign
return x;
}
// These are 180/PI split into high and low order bits
final double facta = 57.2957763671875;
final double factb = 3.14589482087... | java | public static double toDegrees(double x)
{
if (Double.isInfinite(x) || x == 0.0) { // Matches +/- 0.0; return correct sign
return x;
}
// These are 180/PI split into high and low order bits
final double facta = 57.2957763671875;
final double factb = 3.14589482087... | [
"public",
"static",
"double",
"toDegrees",
"(",
"double",
"x",
")",
"{",
"if",
"(",
"Double",
".",
"isInfinite",
"(",
"x",
")",
"||",
"x",
"==",
"0.0",
")",
"{",
"// Matches +/- 0.0; return correct sign",
"return",
"x",
";",
"}",
"// These are 180/PI split int... | Convert radians to degrees, with error of less than 0.5 ULP
@param x angle in radians
@return x converted into degrees | [
"Convert",
"radians",
"to",
"degrees",
"with",
"error",
"of",
"less",
"than",
"0",
".",
"5",
"ULP"
] | 9397c2fcf0d4d62844c64d0b14065ee7bf8cafc6 | https://github.com/jroyalty/jglm/blob/9397c2fcf0d4d62844c64d0b14065ee7bf8cafc6/src/main/java/com/hackoeur/jglm/support/FastMath.java#L3008-L3022 |
8,580 | jroyalty/jglm | src/main/java/com/hackoeur/jglm/support/FastMath.java | FastMath.scalb | public static double scalb(final double d, final int n) {
// first simple and fast handling when 2^n can be represented using normal numbers
if ((n > -1023) && (n < 1024)) {
return d * Double.longBitsToDouble(((long) (n + 1023)) << 52);
}
// handle special cases
if ... | java | public static double scalb(final double d, final int n) {
// first simple and fast handling when 2^n can be represented using normal numbers
if ((n > -1023) && (n < 1024)) {
return d * Double.longBitsToDouble(((long) (n + 1023)) << 52);
}
// handle special cases
if ... | [
"public",
"static",
"double",
"scalb",
"(",
"final",
"double",
"d",
",",
"final",
"int",
"n",
")",
"{",
"// first simple and fast handling when 2^n can be represented using normal numbers",
"if",
"(",
"(",
"n",
">",
"-",
"1023",
")",
"&&",
"(",
"n",
"<",
"1024",... | Multiply a double number by a power of 2.
@param d number to multiply
@param n power of 2
@return d × 2<sup>n</sup> | [
"Multiply",
"a",
"double",
"number",
"by",
"a",
"power",
"of",
"2",
"."
] | 9397c2fcf0d4d62844c64d0b14065ee7bf8cafc6 | https://github.com/jroyalty/jglm/blob/9397c2fcf0d4d62844c64d0b14065ee7bf8cafc6/src/main/java/com/hackoeur/jglm/support/FastMath.java#L3090-L3166 |
8,581 | jroyalty/jglm | src/main/java/com/hackoeur/jglm/support/FastMath.java | FastMath.scalb | public static float scalb(final float f, final int n) {
// first simple and fast handling when 2^n can be represented using normal numbers
if ((n > -127) && (n < 128)) {
return f * Float.intBitsToFloat((n + 127) << 23);
}
// handle special cases
if (Float.isNaN(f) |... | java | public static float scalb(final float f, final int n) {
// first simple and fast handling when 2^n can be represented using normal numbers
if ((n > -127) && (n < 128)) {
return f * Float.intBitsToFloat((n + 127) << 23);
}
// handle special cases
if (Float.isNaN(f) |... | [
"public",
"static",
"float",
"scalb",
"(",
"final",
"float",
"f",
",",
"final",
"int",
"n",
")",
"{",
"// first simple and fast handling when 2^n can be represented using normal numbers",
"if",
"(",
"(",
"n",
">",
"-",
"127",
")",
"&&",
"(",
"n",
"<",
"128",
"... | Multiply a float number by a power of 2.
@param f number to multiply
@param n power of 2
@return f × 2<sup>n</sup> | [
"Multiply",
"a",
"float",
"number",
"by",
"a",
"power",
"of",
"2",
"."
] | 9397c2fcf0d4d62844c64d0b14065ee7bf8cafc6 | https://github.com/jroyalty/jglm/blob/9397c2fcf0d4d62844c64d0b14065ee7bf8cafc6/src/main/java/com/hackoeur/jglm/support/FastMath.java#L3174-L3250 |
8,582 | jroyalty/jglm | src/main/java/com/hackoeur/jglm/support/FastMath.java | FastMath.floor | public static double floor(double x) {
long y;
if (x != x) { // NaN
return x;
}
if (x >= TWO_POWER_52 || x <= -TWO_POWER_52) {
return x;
}
y = (long) x;
if (x < 0 && y != x) {
y--;
}
if (y == 0) {
... | java | public static double floor(double x) {
long y;
if (x != x) { // NaN
return x;
}
if (x >= TWO_POWER_52 || x <= -TWO_POWER_52) {
return x;
}
y = (long) x;
if (x < 0 && y != x) {
y--;
}
if (y == 0) {
... | [
"public",
"static",
"double",
"floor",
"(",
"double",
"x",
")",
"{",
"long",
"y",
";",
"if",
"(",
"x",
"!=",
"x",
")",
"{",
"// NaN",
"return",
"x",
";",
"}",
"if",
"(",
"x",
">=",
"TWO_POWER_52",
"||",
"x",
"<=",
"-",
"TWO_POWER_52",
")",
"{",
... | Get the largest whole number smaller than x.
@param x number from which floor is requested
@return a double number f such that f is an integer f <= x < f + 1.0 | [
"Get",
"the",
"largest",
"whole",
"number",
"smaller",
"than",
"x",
"."
] | 9397c2fcf0d4d62844c64d0b14065ee7bf8cafc6 | https://github.com/jroyalty/jglm/blob/9397c2fcf0d4d62844c64d0b14065ee7bf8cafc6/src/main/java/com/hackoeur/jglm/support/FastMath.java#L3368-L3389 |
8,583 | jroyalty/jglm | src/main/java/com/hackoeur/jglm/support/FastMath.java | FastMath.ceil | public static double ceil(double x) {
double y;
if (x != x) { // NaN
return x;
}
y = floor(x);
if (y == x) {
return y;
}
y += 1.0;
if (y == 0) {
return x*y;
}
return y;
} | java | public static double ceil(double x) {
double y;
if (x != x) { // NaN
return x;
}
y = floor(x);
if (y == x) {
return y;
}
y += 1.0;
if (y == 0) {
return x*y;
}
return y;
} | [
"public",
"static",
"double",
"ceil",
"(",
"double",
"x",
")",
"{",
"double",
"y",
";",
"if",
"(",
"x",
"!=",
"x",
")",
"{",
"// NaN",
"return",
"x",
";",
"}",
"y",
"=",
"floor",
"(",
"x",
")",
";",
"if",
"(",
"y",
"==",
"x",
")",
"{",
"ret... | Get the smallest whole number larger than x.
@param x number from which ceil is requested
@return a double number c such that c is an integer c - 1.0 < x <= c | [
"Get",
"the",
"smallest",
"whole",
"number",
"larger",
"than",
"x",
"."
] | 9397c2fcf0d4d62844c64d0b14065ee7bf8cafc6 | https://github.com/jroyalty/jglm/blob/9397c2fcf0d4d62844c64d0b14065ee7bf8cafc6/src/main/java/com/hackoeur/jglm/support/FastMath.java#L3395-L3414 |
8,584 | jroyalty/jglm | src/main/java/com/hackoeur/jglm/support/FastMath.java | FastMath.rint | public static double rint(double x) {
double y = floor(x);
double d = x - y;
if (d > 0.5) {
if (y == -1.0) {
return -0.0; // Preserve sign of operand
}
return y+1.0;
}
if (d < 0.5) {
return y;
}
/* ... | java | public static double rint(double x) {
double y = floor(x);
double d = x - y;
if (d > 0.5) {
if (y == -1.0) {
return -0.0; // Preserve sign of operand
}
return y+1.0;
}
if (d < 0.5) {
return y;
}
/* ... | [
"public",
"static",
"double",
"rint",
"(",
"double",
"x",
")",
"{",
"double",
"y",
"=",
"floor",
"(",
"x",
")",
";",
"double",
"d",
"=",
"x",
"-",
"y",
";",
"if",
"(",
"d",
">",
"0.5",
")",
"{",
"if",
"(",
"y",
"==",
"-",
"1.0",
")",
"{",
... | Get the whole number that is the nearest to x, or the even one if x is exactly half way between two integers.
@param x number from which nearest whole number is requested
@return a double number r such that r is an integer r - 0.5 <= x <= r + 0.5 | [
"Get",
"the",
"whole",
"number",
"that",
"is",
"the",
"nearest",
"to",
"x",
"or",
"the",
"even",
"one",
"if",
"x",
"is",
"exactly",
"half",
"way",
"between",
"two",
"integers",
"."
] | 9397c2fcf0d4d62844c64d0b14065ee7bf8cafc6 | https://github.com/jroyalty/jglm/blob/9397c2fcf0d4d62844c64d0b14065ee7bf8cafc6/src/main/java/com/hackoeur/jglm/support/FastMath.java#L3420-L3437 |
8,585 | jroyalty/jglm | src/main/java/com/hackoeur/jglm/support/FastMathCalc.java | FastMathCalc.resplit | private static void resplit(final double a[]) {
final double c = a[0] + a[1];
final double d = -(c - a[0] - a[1]);
if (c < 8e298 && c > -8e298) { // MAGIC NUMBER
double z = c * HEX_40000000;
a[0] = (c + z) - z;
a[1] = c - a[0] + d;
} else {
... | java | private static void resplit(final double a[]) {
final double c = a[0] + a[1];
final double d = -(c - a[0] - a[1]);
if (c < 8e298 && c > -8e298) { // MAGIC NUMBER
double z = c * HEX_40000000;
a[0] = (c + z) - z;
a[1] = c - a[0] + d;
} else {
... | [
"private",
"static",
"void",
"resplit",
"(",
"final",
"double",
"a",
"[",
"]",
")",
"{",
"final",
"double",
"c",
"=",
"a",
"[",
"0",
"]",
"+",
"a",
"[",
"1",
"]",
";",
"final",
"double",
"d",
"=",
"-",
"(",
"c",
"-",
"a",
"[",
"0",
"]",
"-"... | Recompute a split.
@param a input/out array containing the split, changed
on output | [
"Recompute",
"a",
"split",
"."
] | 9397c2fcf0d4d62844c64d0b14065ee7bf8cafc6 | https://github.com/jroyalty/jglm/blob/9397c2fcf0d4d62844c64d0b14065ee7bf8cafc6/src/main/java/com/hackoeur/jglm/support/FastMathCalc.java#L343-L356 |
8,586 | jroyalty/jglm | src/main/java/com/hackoeur/jglm/support/FastMathCalc.java | FastMathCalc.splitMult | private static void splitMult(double a[], double b[], double ans[]) {
ans[0] = a[0] * b[0];
ans[1] = a[0] * b[1] + a[1] * b[0] + a[1] * b[1];
/* Resplit */
resplit(ans);
} | java | private static void splitMult(double a[], double b[], double ans[]) {
ans[0] = a[0] * b[0];
ans[1] = a[0] * b[1] + a[1] * b[0] + a[1] * b[1];
/* Resplit */
resplit(ans);
} | [
"private",
"static",
"void",
"splitMult",
"(",
"double",
"a",
"[",
"]",
",",
"double",
"b",
"[",
"]",
",",
"double",
"ans",
"[",
"]",
")",
"{",
"ans",
"[",
"0",
"]",
"=",
"a",
"[",
"0",
"]",
"*",
"b",
"[",
"0",
"]",
";",
"ans",
"[",
"1",
... | Multiply two numbers in split form.
@param a first term of multiplication
@param b second term of multiplication
@param ans placeholder where to put the result | [
"Multiply",
"two",
"numbers",
"in",
"split",
"form",
"."
] | 9397c2fcf0d4d62844c64d0b14065ee7bf8cafc6 | https://github.com/jroyalty/jglm/blob/9397c2fcf0d4d62844c64d0b14065ee7bf8cafc6/src/main/java/com/hackoeur/jglm/support/FastMathCalc.java#L363-L369 |
8,587 | jroyalty/jglm | src/main/java/com/hackoeur/jglm/support/FastMathCalc.java | FastMathCalc.splitAdd | private static void splitAdd(final double a[], final double b[], final double ans[]) {
ans[0] = a[0] + b[0];
ans[1] = a[1] + b[1];
resplit(ans);
} | java | private static void splitAdd(final double a[], final double b[], final double ans[]) {
ans[0] = a[0] + b[0];
ans[1] = a[1] + b[1];
resplit(ans);
} | [
"private",
"static",
"void",
"splitAdd",
"(",
"final",
"double",
"a",
"[",
"]",
",",
"final",
"double",
"b",
"[",
"]",
",",
"final",
"double",
"ans",
"[",
"]",
")",
"{",
"ans",
"[",
"0",
"]",
"=",
"a",
"[",
"0",
"]",
"+",
"b",
"[",
"0",
"]",
... | Add two numbers in split form.
@param a first term of addition
@param b second term of addition
@param ans placeholder where to put the result | [
"Add",
"two",
"numbers",
"in",
"split",
"form",
"."
] | 9397c2fcf0d4d62844c64d0b14065ee7bf8cafc6 | https://github.com/jroyalty/jglm/blob/9397c2fcf0d4d62844c64d0b14065ee7bf8cafc6/src/main/java/com/hackoeur/jglm/support/FastMathCalc.java#L376-L381 |
8,588 | jroyalty/jglm | src/main/java/com/hackoeur/jglm/support/FastMathCalc.java | FastMathCalc.printarray | static void printarray(PrintStream out, String name, int expectedLen, double[][] array2d) {
out.println(name);
checkLen(expectedLen, array2d.length);
out.println(TABLE_START_DECL + " ");
int i = 0;
for(double[] array : array2d) { // "double array[]" causes PMD parsing error
... | java | static void printarray(PrintStream out, String name, int expectedLen, double[][] array2d) {
out.println(name);
checkLen(expectedLen, array2d.length);
out.println(TABLE_START_DECL + " ");
int i = 0;
for(double[] array : array2d) { // "double array[]" causes PMD parsing error
... | [
"static",
"void",
"printarray",
"(",
"PrintStream",
"out",
",",
"String",
"name",
",",
"int",
"expectedLen",
",",
"double",
"[",
"]",
"[",
"]",
"array2d",
")",
"{",
"out",
".",
"println",
"(",
"name",
")",
";",
"checkLen",
"(",
"expectedLen",
",",
"arr... | Print an array.
@param out text output stream where output should be printed
@param name array name
@param expectedLen expected length of the array
@param array2d array data | [
"Print",
"an",
"array",
"."
] | 9397c2fcf0d4d62844c64d0b14065ee7bf8cafc6 | https://github.com/jroyalty/jglm/blob/9397c2fcf0d4d62844c64d0b14065ee7bf8cafc6/src/main/java/com/hackoeur/jglm/support/FastMathCalc.java#L600-L613 |
8,589 | rzwitserloot/lombok.ast | src/main/lombok/ast/grammar/StructuresParser.java | StructuresParser.variableDefinition | Rule variableDefinition() {
return Sequence(
group.types.type().label("type"),
variableDefinitionPart().label("head"),
ZeroOrMore(Sequence(
Ch(','), group.basics.optWS(),
variableDefinitionPart()).label("tail")),
set(actions.createVariableDefinition(value("type"), value("head"), values("Ze... | java | Rule variableDefinition() {
return Sequence(
group.types.type().label("type"),
variableDefinitionPart().label("head"),
ZeroOrMore(Sequence(
Ch(','), group.basics.optWS(),
variableDefinitionPart()).label("tail")),
set(actions.createVariableDefinition(value("type"), value("head"), values("Ze... | [
"Rule",
"variableDefinition",
"(",
")",
"{",
"return",
"Sequence",
"(",
"group",
".",
"types",
".",
"type",
"(",
")",
".",
"label",
"(",
"\"type\"",
")",
",",
"variableDefinitionPart",
"(",
")",
".",
"label",
"(",
"\"head\"",
")",
",",
"ZeroOrMore",
"(",... | Add your own modifiers! | [
"Add",
"your",
"own",
"modifiers!"
] | ed83541c1a5a08952a5d4d7e316a6be9a05311fb | https://github.com/rzwitserloot/lombok.ast/blob/ed83541c1a5a08952a5d4d7e316a6be9a05311fb/src/main/lombok/ast/grammar/StructuresParser.java#L289-L297 |
8,590 | rzwitserloot/lombok.ast | src/main/lombok/ast/grammar/ExpressionsParser.java | ExpressionsParser.postfixIncrementExpressionChaining | Rule postfixIncrementExpressionChaining() {
return Sequence(
dotNewExpressionChaining(), set(),
ZeroOrMore(Sequence(
FirstOf(String("++"), String("--")).label("operator"),
group.basics.optWS()).label("operatorCt")),
set(actions.createUnaryPostfixExpression(value(), nodes("ZeroOrMore/operatorCt... | java | Rule postfixIncrementExpressionChaining() {
return Sequence(
dotNewExpressionChaining(), set(),
ZeroOrMore(Sequence(
FirstOf(String("++"), String("--")).label("operator"),
group.basics.optWS()).label("operatorCt")),
set(actions.createUnaryPostfixExpression(value(), nodes("ZeroOrMore/operatorCt... | [
"Rule",
"postfixIncrementExpressionChaining",
"(",
")",
"{",
"return",
"Sequence",
"(",
"dotNewExpressionChaining",
"(",
")",
",",
"set",
"(",
")",
",",
"ZeroOrMore",
"(",
"Sequence",
"(",
"FirstOf",
"(",
"String",
"(",
"\"++\"",
")",
",",
"String",
"(",
"\"... | P2'
Technically, postfix increment operations are in P2 along with all the unary operators like ~ and !, as well as typecasts.
However, because ALL of the P2 expression are right-associative, the postfix operators can be considered as a higher level of precedence. | [
"P2",
"Technically",
"postfix",
"increment",
"operations",
"are",
"in",
"P2",
"along",
"with",
"all",
"the",
"unary",
"operators",
"like",
"~",
"and",
"!",
"as",
"well",
"as",
"typecasts",
".",
"However",
"because",
"ALL",
"of",
"the",
"P2",
"expression",
... | ed83541c1a5a08952a5d4d7e316a6be9a05311fb | https://github.com/rzwitserloot/lombok.ast/blob/ed83541c1a5a08952a5d4d7e316a6be9a05311fb/src/main/lombok/ast/grammar/ExpressionsParser.java#L218-L225 |
8,591 | jroyalty/jglm | src/main/java/com/hackoeur/jglm/support/Precision.java | Precision.compareTo | public static int compareTo(double x, double y, double eps) {
if (equals(x, y, eps)) {
return 0;
} else if (x < y) {
return -1;
}
return 1;
} | java | public static int compareTo(double x, double y, double eps) {
if (equals(x, y, eps)) {
return 0;
} else if (x < y) {
return -1;
}
return 1;
} | [
"public",
"static",
"int",
"compareTo",
"(",
"double",
"x",
",",
"double",
"y",
",",
"double",
"eps",
")",
"{",
"if",
"(",
"equals",
"(",
"x",
",",
"y",
",",
"eps",
")",
")",
"{",
"return",
"0",
";",
"}",
"else",
"if",
"(",
"x",
"<",
"y",
")"... | Compares two numbers given some amount of allowed error.
@param x the first number
@param y the second number
@param eps the amount of error to allow when checking for equality
@return <ul><li>0 if {@link #equals(double, double, double) equals(x, y, eps)}</li>
<li>< 0 if !{@link #equals(double, double, double) equ... | [
"Compares",
"two",
"numbers",
"given",
"some",
"amount",
"of",
"allowed",
"error",
"."
] | 9397c2fcf0d4d62844c64d0b14065ee7bf8cafc6 | https://github.com/jroyalty/jglm/blob/9397c2fcf0d4d62844c64d0b14065ee7bf8cafc6/src/main/java/com/hackoeur/jglm/support/Precision.java#L91-L98 |
8,592 | rzwitserloot/lombok.ast | src/main/lombok/ast/grammar/Source.java | Source.associateJavadoc | private void associateJavadoc(List<Comment> comments, List<Node> nodes) {
final TreeMap<Integer, Node> startPosMap = Maps.newTreeMap();
for (Node node : nodes) node.accept(new ForwardingAstVisitor() {
@Override public boolean visitNode(Node node) {
if (node.isGenerated()) return false;
int startPos = nod... | java | private void associateJavadoc(List<Comment> comments, List<Node> nodes) {
final TreeMap<Integer, Node> startPosMap = Maps.newTreeMap();
for (Node node : nodes) node.accept(new ForwardingAstVisitor() {
@Override public boolean visitNode(Node node) {
if (node.isGenerated()) return false;
int startPos = nod... | [
"private",
"void",
"associateJavadoc",
"(",
"List",
"<",
"Comment",
">",
"comments",
",",
"List",
"<",
"Node",
">",
"nodes",
")",
"{",
"final",
"TreeMap",
"<",
"Integer",
",",
"Node",
">",
"startPosMap",
"=",
"Maps",
".",
"newTreeMap",
"(",
")",
";",
"... | Associates comments that are javadocs to the node they belong to, by checking if the node that immediately follows a javadoc node is a JavadocContainer. | [
"Associates",
"comments",
"that",
"are",
"javadocs",
"to",
"the",
"node",
"they",
"belong",
"to",
"by",
"checking",
"if",
"the",
"node",
"that",
"immediately",
"follows",
"a",
"javadoc",
"node",
"is",
"a",
"JavadocContainer",
"."
] | ed83541c1a5a08952a5d4d7e316a6be9a05311fb | https://github.com/rzwitserloot/lombok.ast/blob/ed83541c1a5a08952a5d4d7e316a6be9a05311fb/src/main/lombok/ast/grammar/Source.java#L342-L369 |
8,593 | rzwitserloot/lombok.ast | src/main/lombok/ast/grammar/Source.java | Source.gatherComments | private boolean gatherComments(org.parboiled.Node<Node> parsed) {
boolean foundComments = false;
for (org.parboiled.Node<Node> child : parsed.getChildren()) {
foundComments |= gatherComments(child);
}
List<Comment> cmts = registeredComments.get(parsed);
if (cmts != null) for (Comment c : cmts) {
comm... | java | private boolean gatherComments(org.parboiled.Node<Node> parsed) {
boolean foundComments = false;
for (org.parboiled.Node<Node> child : parsed.getChildren()) {
foundComments |= gatherComments(child);
}
List<Comment> cmts = registeredComments.get(parsed);
if (cmts != null) for (Comment c : cmts) {
comm... | [
"private",
"boolean",
"gatherComments",
"(",
"org",
".",
"parboiled",
".",
"Node",
"<",
"Node",
">",
"parsed",
")",
"{",
"boolean",
"foundComments",
"=",
"false",
";",
"for",
"(",
"org",
".",
"parboiled",
".",
"Node",
"<",
"Node",
">",
"child",
":",
"p... | Delves through the parboiled node tree to find comments. | [
"Delves",
"through",
"the",
"parboiled",
"node",
"tree",
"to",
"find",
"comments",
"."
] | ed83541c1a5a08952a5d4d7e316a6be9a05311fb | https://github.com/rzwitserloot/lombok.ast/blob/ed83541c1a5a08952a5d4d7e316a6be9a05311fb/src/main/lombok/ast/grammar/Source.java#L383-L396 |
8,594 | esmasui/AndroidJUnit4 | android-junit4/src/main/java/android/os/PerformanceCollector.java | PerformanceCollector.startTiming | public void startTiming(String label) {
if (mPerfWriter != null)
mPerfWriter.writeStartTiming(label);
mPerfMeasurement = new Bundle();
mPerfMeasurement.putParcelableArrayList(
METRIC_KEY_ITERATIONS, new ArrayList<Parcelable>());
mExecTime = SystemClock.uptimeM... | java | public void startTiming(String label) {
if (mPerfWriter != null)
mPerfWriter.writeStartTiming(label);
mPerfMeasurement = new Bundle();
mPerfMeasurement.putParcelableArrayList(
METRIC_KEY_ITERATIONS, new ArrayList<Parcelable>());
mExecTime = SystemClock.uptimeM... | [
"public",
"void",
"startTiming",
"(",
"String",
"label",
")",
"{",
"if",
"(",
"mPerfWriter",
"!=",
"null",
")",
"mPerfWriter",
".",
"writeStartTiming",
"(",
"label",
")",
";",
"mPerfMeasurement",
"=",
"new",
"Bundle",
"(",
")",
";",
"mPerfMeasurement",
".",
... | Start measurement of user and cpu time.
@param label description of code block between startTiming and
stopTiming, used to label output | [
"Start",
"measurement",
"of",
"user",
"and",
"cpu",
"time",
"."
] | 173b050663844f81ca9da6c9076dd13e1bde6a75 | https://github.com/esmasui/AndroidJUnit4/blob/173b050663844f81ca9da6c9076dd13e1bde6a75/android-junit4/src/main/java/android/os/PerformanceCollector.java#L362-L370 |
8,595 | esmasui/AndroidJUnit4 | android-junit4/src/main/java/android/os/PerformanceCollector.java | PerformanceCollector.addIteration | public Bundle addIteration(String label) {
mCpuTime = Process.getElapsedCpuTime() - mCpuTime;
mExecTime = SystemClock.uptimeMillis() - mExecTime;
Bundle iteration = new Bundle();
iteration.putString(METRIC_KEY_LABEL, label);
iteration.putLong(METRIC_KEY_EXECUTION_TIME, mExecTime... | java | public Bundle addIteration(String label) {
mCpuTime = Process.getElapsedCpuTime() - mCpuTime;
mExecTime = SystemClock.uptimeMillis() - mExecTime;
Bundle iteration = new Bundle();
iteration.putString(METRIC_KEY_LABEL, label);
iteration.putLong(METRIC_KEY_EXECUTION_TIME, mExecTime... | [
"public",
"Bundle",
"addIteration",
"(",
"String",
"label",
")",
"{",
"mCpuTime",
"=",
"Process",
".",
"getElapsedCpuTime",
"(",
")",
"-",
"mCpuTime",
";",
"mExecTime",
"=",
"SystemClock",
".",
"uptimeMillis",
"(",
")",
"-",
"mExecTime",
";",
"Bundle",
"iter... | Add a measured segment, and start measuring the next segment. Returns
collected data in a Bundle object.
@param label description of code block between startTiming and
addIteration, and between two calls to addIteration, used
to label output
@return Runtime metrics stored as key/value pairs. Values are of type
long, a... | [
"Add",
"a",
"measured",
"segment",
"and",
"start",
"measuring",
"the",
"next",
"segment",
".",
"Returns",
"collected",
"data",
"in",
"a",
"Bundle",
"object",
"."
] | 173b050663844f81ca9da6c9076dd13e1bde6a75 | https://github.com/esmasui/AndroidJUnit4/blob/173b050663844f81ca9da6c9076dd13e1bde6a75/android-junit4/src/main/java/android/os/PerformanceCollector.java#L387-L400 |
8,596 | esmasui/AndroidJUnit4 | android-junit4/src/main/java/android/os/PerformanceCollector.java | PerformanceCollector.stopTiming | public Bundle stopTiming(String label) {
addIteration(label);
if (mPerfWriter != null)
mPerfWriter.writeStopTiming(mPerfMeasurement);
return mPerfMeasurement;
} | java | public Bundle stopTiming(String label) {
addIteration(label);
if (mPerfWriter != null)
mPerfWriter.writeStopTiming(mPerfMeasurement);
return mPerfMeasurement;
} | [
"public",
"Bundle",
"stopTiming",
"(",
"String",
"label",
")",
"{",
"addIteration",
"(",
"label",
")",
";",
"if",
"(",
"mPerfWriter",
"!=",
"null",
")",
"mPerfWriter",
".",
"writeStopTiming",
"(",
"mPerfMeasurement",
")",
";",
"return",
"mPerfMeasurement",
";"... | Stop measurement of user and cpu time.
@param label description of code block between addIteration or
startTiming and stopTiming, used to label output
@return Runtime metrics stored in a bundle, including all iterations
between calls to startTiming and stopTiming. List of iterations
is keyed by {@link #METRIC_KEY_ITER... | [
"Stop",
"measurement",
"of",
"user",
"and",
"cpu",
"time",
"."
] | 173b050663844f81ca9da6c9076dd13e1bde6a75 | https://github.com/esmasui/AndroidJUnit4/blob/173b050663844f81ca9da6c9076dd13e1bde6a75/android-junit4/src/main/java/android/os/PerformanceCollector.java#L411-L416 |
8,597 | esmasui/AndroidJUnit4 | android-junit4/src/main/java/android/os/PerformanceCollector.java | PerformanceCollector.addMeasurement | public void addMeasurement(String label, String value) {
if (mPerfWriter != null)
mPerfWriter.writeMeasurement(label, value);
} | java | public void addMeasurement(String label, String value) {
if (mPerfWriter != null)
mPerfWriter.writeMeasurement(label, value);
} | [
"public",
"void",
"addMeasurement",
"(",
"String",
"label",
",",
"String",
"value",
")",
"{",
"if",
"(",
"mPerfWriter",
"!=",
"null",
")",
"mPerfWriter",
".",
"writeMeasurement",
"(",
"label",
",",
"value",
")",
";",
"}"
] | Add a string field to the collector.
@param label short description of the metric that was measured
@param value string summary of the measurement | [
"Add",
"a",
"string",
"field",
"to",
"the",
"collector",
"."
] | 173b050663844f81ca9da6c9076dd13e1bde6a75 | https://github.com/esmasui/AndroidJUnit4/blob/173b050663844f81ca9da6c9076dd13e1bde6a75/android-junit4/src/main/java/android/os/PerformanceCollector.java#L446-L449 |
8,598 | esmasui/AndroidJUnit4 | android-junit4/src/main/java/com/android/internal/util/Predicates.java | Predicates.and | public static <T> Predicate<T> and(Predicate<? super T>... components) {
return and(Arrays.asList(components));
} | java | public static <T> Predicate<T> and(Predicate<? super T>... components) {
return and(Arrays.asList(components));
} | [
"public",
"static",
"<",
"T",
">",
"Predicate",
"<",
"T",
">",
"and",
"(",
"Predicate",
"<",
"?",
"super",
"T",
">",
"...",
"components",
")",
"{",
"return",
"and",
"(",
"Arrays",
".",
"asList",
"(",
"components",
")",
")",
";",
"}"
] | Returns a Predicate that evaluates to true iff each of its components
evaluates to true. The components are evaluated in order, and evaluation
will be "short-circuited" as soon as the answer is determined. | [
"Returns",
"a",
"Predicate",
"that",
"evaluates",
"to",
"true",
"iff",
"each",
"of",
"its",
"components",
"evaluates",
"to",
"true",
".",
"The",
"components",
"are",
"evaluated",
"in",
"order",
"and",
"evaluation",
"will",
"be",
"short",
"-",
"circuited",
"a... | 173b050663844f81ca9da6c9076dd13e1bde6a75 | https://github.com/esmasui/AndroidJUnit4/blob/173b050663844f81ca9da6c9076dd13e1bde6a75/android-junit4/src/main/java/com/android/internal/util/Predicates.java#L35-L37 |
8,599 | esmasui/AndroidJUnit4 | android-junit4/src/main/java/com/android/internal/util/Predicates.java | Predicates.or | public static <T> Predicate<T> or(Predicate<? super T>... components) {
return or(Arrays.asList(components));
} | java | public static <T> Predicate<T> or(Predicate<? super T>... components) {
return or(Arrays.asList(components));
} | [
"public",
"static",
"<",
"T",
">",
"Predicate",
"<",
"T",
">",
"or",
"(",
"Predicate",
"<",
"?",
"super",
"T",
">",
"...",
"components",
")",
"{",
"return",
"or",
"(",
"Arrays",
".",
"asList",
"(",
"components",
")",
")",
";",
"}"
] | Returns a Predicate that evaluates to true iff any one of its components
evaluates to true. The components are evaluated in order, and evaluation
will be "short-circuited" as soon as the answer is determined. | [
"Returns",
"a",
"Predicate",
"that",
"evaluates",
"to",
"true",
"iff",
"any",
"one",
"of",
"its",
"components",
"evaluates",
"to",
"true",
".",
"The",
"components",
"are",
"evaluated",
"in",
"order",
"and",
"evaluation",
"will",
"be",
"short",
"-",
"circuite... | 173b050663844f81ca9da6c9076dd13e1bde6a75 | https://github.com/esmasui/AndroidJUnit4/blob/173b050663844f81ca9da6c9076dd13e1bde6a75/android-junit4/src/main/java/com/android/internal/util/Predicates.java#L56-L58 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.