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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
106,200 | xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/ModelBucket.java | ModelBucket.get | public T get(String name) {
String lcName = name.toLowerCase();
for (T item : collection) {
if (item.getName().toLowerCase().equals(lcName)) {
return item;
}
}
return null;
} | java | public T get(String name) {
String lcName = name.toLowerCase();
for (T item : collection) {
if (item.getName().toLowerCase().equals(lcName)) {
return item;
}
}
return null;
} | [
"public",
"T",
"get",
"(",
"String",
"name",
")",
"{",
"String",
"lcName",
"=",
"name",
".",
"toLowerCase",
"(",
")",
";",
"for",
"(",
"T",
"item",
":",
"collection",
")",
"{",
"if",
"(",
"item",
".",
"getName",
"(",
")",
".",
"toLowerCase",
"(",
... | Find for contained element, using its name.
@param name the name
@return the t | [
"Find",
"for",
"contained",
"element",
"using",
"its",
"name",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/ModelBucket.java#L48-L57 |
106,201 | xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/transform/SQLTransformer.java | SQLTransformer.javaProperty2ContentValues | public static void javaProperty2ContentValues(MethodSpec.Builder methodBuilder, TypeName beanClass, String beanName,
ModelProperty property) {
TypeName typeName = null;
if (property != null && property.getPropertyType() != null) {
typeName = property.getPropertyType().getTypeName();
}
if (property != nu... | java | public static void javaProperty2ContentValues(MethodSpec.Builder methodBuilder, TypeName beanClass, String beanName,
ModelProperty property) {
TypeName typeName = null;
if (property != null && property.getPropertyType() != null) {
typeName = property.getPropertyType().getTypeName();
}
if (property != nu... | [
"public",
"static",
"void",
"javaProperty2ContentValues",
"(",
"MethodSpec",
".",
"Builder",
"methodBuilder",
",",
"TypeName",
"beanClass",
",",
"String",
"beanName",
",",
"ModelProperty",
"property",
")",
"{",
"TypeName",
"typeName",
"=",
"null",
";",
"if",
"(",
... | Used to convert a property of managed bean to contentValue.
@param methodBuilder
the method builder
@param beanClass
the bean class
@param beanName
the bean name
@param property
the property | [
"Used",
"to",
"convert",
"a",
"property",
"of",
"managed",
"bean",
"to",
"contentValue",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/transform/SQLTransformer.java#L102-L117 |
106,202 | xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/transform/SQLTransformer.java | SQLTransformer.javaProperty2WhereCondition | public static void javaProperty2WhereCondition(MethodSpec.Builder methodBuilder, SQLiteModelMethod method,
String paramName, TypeName paramType, ModelProperty property) {
if (property != null && property.hasTypeAdapter()) {
methodBuilder.addCode(
AbstractSQLTransform.PRE_TYPE_ADAPTER_TO_STRING + "$L" + Abs... | java | public static void javaProperty2WhereCondition(MethodSpec.Builder methodBuilder, SQLiteModelMethod method,
String paramName, TypeName paramType, ModelProperty property) {
if (property != null && property.hasTypeAdapter()) {
methodBuilder.addCode(
AbstractSQLTransform.PRE_TYPE_ADAPTER_TO_STRING + "$L" + Abs... | [
"public",
"static",
"void",
"javaProperty2WhereCondition",
"(",
"MethodSpec",
".",
"Builder",
"methodBuilder",
",",
"SQLiteModelMethod",
"method",
",",
"String",
"paramName",
",",
"TypeName",
"paramType",
",",
"ModelProperty",
"property",
")",
"{",
"if",
"(",
"prope... | Used to convert a property of managed bean to where condition.
@param methodBuilder
the method builder
@param method
the method
@param paramName
the param name
@param paramType
the param type
@param property
the property | [
"Used",
"to",
"convert",
"a",
"property",
"of",
"managed",
"bean",
"to",
"where",
"condition",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/transform/SQLTransformer.java#L133-L148 |
106,203 | xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/transform/SQLTransformer.java | SQLTransformer.javaMethodParam2ContentValues | public static void javaMethodParam2ContentValues(MethodSpec.Builder methodBuilder, SQLiteModelMethod method,
String paramName, TypeName paramType, ModelProperty property) {
AssertKripton.assertTrueOrInvalidMethodSignException(!method.hasAdapterForParam(paramName), method,
"method's parameter '%s' can not use a... | java | public static void javaMethodParam2ContentValues(MethodSpec.Builder methodBuilder, SQLiteModelMethod method,
String paramName, TypeName paramType, ModelProperty property) {
AssertKripton.assertTrueOrInvalidMethodSignException(!method.hasAdapterForParam(paramName), method,
"method's parameter '%s' can not use a... | [
"public",
"static",
"void",
"javaMethodParam2ContentValues",
"(",
"MethodSpec",
".",
"Builder",
"methodBuilder",
",",
"SQLiteModelMethod",
"method",
",",
"String",
"paramName",
",",
"TypeName",
"paramType",
",",
"ModelProperty",
"property",
")",
"{",
"AssertKripton",
... | Used to convert a method's parameter to contentValues. It can not have a
type adpter, because it eventually use the one define in associated
bean's attribute
@param methodBuilder
the method builder
@param method
the method
@param paramName
the param name
@param paramType
the param type
@param property
the property | [
"Used",
"to",
"convert",
"a",
"method",
"s",
"parameter",
"to",
"contentValues",
".",
"It",
"can",
"not",
"have",
"a",
"type",
"adpter",
"because",
"it",
"eventually",
"use",
"the",
"one",
"define",
"in",
"associated",
"bean",
"s",
"attribute"
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/transform/SQLTransformer.java#L166-L177 |
106,204 | xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/transform/SQLTransformer.java | SQLTransformer.isSupportedJDKType | public static boolean isSupportedJDKType(TypeName typeName) {
if (typeName.isPrimitive()) {
return getPrimitiveTransform(typeName) != null;
}
String name = typeName.toString();
if (name.startsWith("java.lang")) {
return getLanguageTransform(typeName) != null;
}
if (name.startsWith("java.util")) {
... | java | public static boolean isSupportedJDKType(TypeName typeName) {
if (typeName.isPrimitive()) {
return getPrimitiveTransform(typeName) != null;
}
String name = typeName.toString();
if (name.startsWith("java.lang")) {
return getLanguageTransform(typeName) != null;
}
if (name.startsWith("java.util")) {
... | [
"public",
"static",
"boolean",
"isSupportedJDKType",
"(",
"TypeName",
"typeName",
")",
"{",
"if",
"(",
"typeName",
".",
"isPrimitive",
"(",
")",
")",
"{",
"return",
"getPrimitiveTransform",
"(",
"typeName",
")",
"!=",
"null",
";",
"}",
"String",
"name",
"=",... | Checks if is supported JDK type.
@param typeName
the type name
@return true, if is supported JDK type | [
"Checks",
"if",
"is",
"supported",
"JDK",
"type",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/transform/SQLTransformer.java#L406-L434 |
106,205 | xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/transform/SQLTransformer.java | SQLTransformer.resetBean | public static void resetBean(MethodSpec.Builder methodBuilder, TypeName beanClass, String beanName,
ModelProperty property, String cursorName, String indexName) {
SQLTransform transform = lookup(property.getElement().asType());
if (transform == null) {
throw new IllegalArgumentException("Transform of " + pro... | java | public static void resetBean(MethodSpec.Builder methodBuilder, TypeName beanClass, String beanName,
ModelProperty property, String cursorName, String indexName) {
SQLTransform transform = lookup(property.getElement().asType());
if (transform == null) {
throw new IllegalArgumentException("Transform of " + pro... | [
"public",
"static",
"void",
"resetBean",
"(",
"MethodSpec",
".",
"Builder",
"methodBuilder",
",",
"TypeName",
"beanClass",
",",
"String",
"beanName",
",",
"ModelProperty",
"property",
",",
"String",
"cursorName",
",",
"String",
"indexName",
")",
"{",
"SQLTransform... | Reset bean.
@param methodBuilder
the method builder
@param beanClass
the bean class
@param beanName
the bean name
@param property
the property
@param cursorName
the cursor name
@param indexName
the index name | [
"Reset",
"bean",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/transform/SQLTransformer.java#L575-L584 |
106,206 | xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/transform/SQLTransformer.java | SQLTransformer.columnTypeAsString | public static String columnTypeAsString(SQLProperty property) {
if (property.columnAffinityType != null && ColumnAffinityType.AUTO != property.columnAffinityType) {
return property.columnAffinityType.toString();
}
TypeName typeName = property.getPropertyType().getTypeName();
if (property.hasTypeAdapter()) {... | java | public static String columnTypeAsString(SQLProperty property) {
if (property.columnAffinityType != null && ColumnAffinityType.AUTO != property.columnAffinityType) {
return property.columnAffinityType.toString();
}
TypeName typeName = property.getPropertyType().getTypeName();
if (property.hasTypeAdapter()) {... | [
"public",
"static",
"String",
"columnTypeAsString",
"(",
"SQLProperty",
"property",
")",
"{",
"if",
"(",
"property",
".",
"columnAffinityType",
"!=",
"null",
"&&",
"ColumnAffinityType",
".",
"AUTO",
"!=",
"property",
".",
"columnAffinityType",
")",
"{",
"return",
... | Detect column type. If column affinity is specified by annotation,
affinity column is used.
@param property
the property
@return the SQlite column type as string | [
"Detect",
"column",
"type",
".",
"If",
"column",
"affinity",
"is",
"specified",
"by",
"annotation",
"affinity",
"column",
"is",
"used",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/transform/SQLTransformer.java#L594-L611 |
106,207 | xcesco/kripton | kripton-arch-integration/src/main/java/android/arch/core/internal/FastSafeIterableMap.java | FastSafeIterableMap.ceil | public Map.Entry<K, V> ceil(K k) {
if (contains(k)) {
return mHashMap.get(k).mPrevious;
}
return null;
} | java | public Map.Entry<K, V> ceil(K k) {
if (contains(k)) {
return mHashMap.get(k).mPrevious;
}
return null;
} | [
"public",
"Map",
".",
"Entry",
"<",
"K",
",",
"V",
">",
"ceil",
"(",
"K",
"k",
")",
"{",
"if",
"(",
"contains",
"(",
"k",
")",
")",
"{",
"return",
"mHashMap",
".",
"get",
"(",
"k",
")",
".",
"mPrevious",
";",
"}",
"return",
"null",
";",
"}"
] | Return an entry added to prior to an entry associated with the given key.
@param k the key
@return the map. entry | [
"Return",
"an",
"entry",
"added",
"to",
"prior",
"to",
"an",
"entry",
"associated",
"with",
"the",
"given",
"key",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-arch-integration/src/main/java/android/arch/core/internal/FastSafeIterableMap.java#L88-L93 |
106,208 | xcesco/kripton | kripton-shared-preferences/src/main/java/com/abubusoft/kripton/common/PrefsTypeAdapterUtils.java | PrefsTypeAdapterUtils.toJava | public static <D, J> J toJava(Class<? extends PreferenceTypeAdapter<J, D>> clazz, D value) {
@SuppressWarnings("unchecked")
PreferenceTypeAdapter<J, D> adapter = cache.get(clazz);
if (adapter == null) {
adapter = generateAdapter(clazz);
}
return adapter.toJava(value);
} | java | public static <D, J> J toJava(Class<? extends PreferenceTypeAdapter<J, D>> clazz, D value) {
@SuppressWarnings("unchecked")
PreferenceTypeAdapter<J, D> adapter = cache.get(clazz);
if (adapter == null) {
adapter = generateAdapter(clazz);
}
return adapter.toJava(value);
} | [
"public",
"static",
"<",
"D",
",",
"J",
">",
"J",
"toJava",
"(",
"Class",
"<",
"?",
"extends",
"PreferenceTypeAdapter",
"<",
"J",
",",
"D",
">",
">",
"clazz",
",",
"D",
"value",
")",
"{",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"PreferenceT... | To java.
@param <D> the generic type
@param <J> the generic type
@param clazz the clazz
@param value the value
@return the j | [
"To",
"java",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-shared-preferences/src/main/java/com/abubusoft/kripton/common/PrefsTypeAdapterUtils.java#L46-L55 |
106,209 | xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sharedprefs/transform/SetPrefsTransformation.java | SetPrefsTransformation.isStringSet | public static boolean isStringSet(PrefsProperty property) {
boolean isStringSet = false;
TypeName typeName;
if (property.hasTypeAdapter()) {
typeName = TypeUtility.typeName(property.typeAdapter.dataType);
} else {
typeName = TypeUtility.typeName(property.getElement().asType());
}
// it is parameteri... | java | public static boolean isStringSet(PrefsProperty property) {
boolean isStringSet = false;
TypeName typeName;
if (property.hasTypeAdapter()) {
typeName = TypeUtility.typeName(property.typeAdapter.dataType);
} else {
typeName = TypeUtility.typeName(property.getElement().asType());
}
// it is parameteri... | [
"public",
"static",
"boolean",
"isStringSet",
"(",
"PrefsProperty",
"property",
")",
"{",
"boolean",
"isStringSet",
"=",
"false",
";",
"TypeName",
"typeName",
";",
"if",
"(",
"property",
".",
"hasTypeAdapter",
"(",
")",
")",
"{",
"typeName",
"=",
"TypeUtility"... | Checks if is string set.
@param property the property
@return true, if is string set | [
"Checks",
"if",
"is",
"string",
"set",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sharedprefs/transform/SetPrefsTransformation.java#L192-L212 |
106,210 | xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/ModelAnnotation.java | ModelAnnotation.getAttributeAsClassName | public String getAttributeAsClassName(AnnotationAttributeType attribute) {
String temp = attributes.get(attribute.getValue());
if (StringUtils.hasText(temp)) {
temp = temp.replace(".class", "");
}
return temp;
} | java | public String getAttributeAsClassName(AnnotationAttributeType attribute) {
String temp = attributes.get(attribute.getValue());
if (StringUtils.hasText(temp)) {
temp = temp.replace(".class", "");
}
return temp;
} | [
"public",
"String",
"getAttributeAsClassName",
"(",
"AnnotationAttributeType",
"attribute",
")",
"{",
"String",
"temp",
"=",
"attributes",
".",
"get",
"(",
"attribute",
".",
"getValue",
"(",
")",
")",
";",
"if",
"(",
"StringUtils",
".",
"hasText",
"(",
"temp",... | Gets the attribute as class name.
@param attribute the attribute
@return the attribute as class name | [
"Gets",
"the",
"attribute",
"as",
"class",
"name",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/ModelAnnotation.java#L90-L98 |
106,211 | xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/ModelAnnotation.java | ModelAnnotation.getAttributeAsArray | public List<String> getAttributeAsArray(AnnotationAttributeType attribute) {
String temp = attributes.get(attribute.getValue());
return AnnotationUtility.extractAsArrayOfString(temp);
} | java | public List<String> getAttributeAsArray(AnnotationAttributeType attribute) {
String temp = attributes.get(attribute.getValue());
return AnnotationUtility.extractAsArrayOfString(temp);
} | [
"public",
"List",
"<",
"String",
">",
"getAttributeAsArray",
"(",
"AnnotationAttributeType",
"attribute",
")",
"{",
"String",
"temp",
"=",
"attributes",
".",
"get",
"(",
"attribute",
".",
"getValue",
"(",
")",
")",
";",
"return",
"AnnotationUtility",
".",
"ext... | Gets the attribute as array.
@param attribute the attribute
@return the attribute as array | [
"Gets",
"the",
"attribute",
"as",
"array",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/ModelAnnotation.java#L118-L122 |
106,212 | xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/ModelAnnotation.java | ModelAnnotation.getAttributeAsInt | public int getAttributeAsInt(AnnotationAttributeType attribute) {
String temp = attributes.get(attribute.getValue());
return Integer.parseInt(temp);
} | java | public int getAttributeAsInt(AnnotationAttributeType attribute) {
String temp = attributes.get(attribute.getValue());
return Integer.parseInt(temp);
} | [
"public",
"int",
"getAttributeAsInt",
"(",
"AnnotationAttributeType",
"attribute",
")",
"{",
"String",
"temp",
"=",
"attributes",
".",
"get",
"(",
"attribute",
".",
"getValue",
"(",
")",
")",
";",
"return",
"Integer",
".",
"parseInt",
"(",
"temp",
")",
";",
... | Gets the attribute as int.
@param attribute the attribute
@return the attribute as int | [
"Gets",
"the",
"attribute",
"as",
"int",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/ModelAnnotation.java#L130-L134 |
106,213 | xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/AbstractSelectCodeGenerator.java | AbstractSelectCodeGenerator.generateSubQueries | protected void generateSubQueries(Builder methodBuilder, SQLiteModelMethod method) {
SQLiteEntity entity = method.getEntity();
for (Triple<String, String, SQLiteModelMethod> item : method.childrenSelects) {
TypeName entityTypeName = TypeUtility.typeName(entity.getElement());
String setter;
if (entity.isIm... | java | protected void generateSubQueries(Builder methodBuilder, SQLiteModelMethod method) {
SQLiteEntity entity = method.getEntity();
for (Triple<String, String, SQLiteModelMethod> item : method.childrenSelects) {
TypeName entityTypeName = TypeUtility.typeName(entity.getElement());
String setter;
if (entity.isIm... | [
"protected",
"void",
"generateSubQueries",
"(",
"Builder",
"methodBuilder",
",",
"SQLiteModelMethod",
"method",
")",
"{",
"SQLiteEntity",
"entity",
"=",
"method",
".",
"getEntity",
"(",
")",
";",
"for",
"(",
"Triple",
"<",
"String",
",",
"String",
",",
"SQLite... | generate code for sub queries
@param methodBuilder
@param method | [
"generate",
"code",
"for",
"sub",
"queries"
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/AbstractSelectCodeGenerator.java#L89-L110 |
106,214 | xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/AbstractSelectCodeGenerator.java | AbstractSelectCodeGenerator.generateCommonPart | public void generateCommonPart(SQLiteModelMethod method, TypeSpec.Builder classBuilder, MethodSpec.Builder methodBuilder, Set<JQLProjection> fieldList, boolean generateSqlField) {
generateCommonPart(method, classBuilder, methodBuilder, fieldList, GenerationType.ALL, null, generateSqlField, false);
} | java | public void generateCommonPart(SQLiteModelMethod method, TypeSpec.Builder classBuilder, MethodSpec.Builder methodBuilder, Set<JQLProjection> fieldList, boolean generateSqlField) {
generateCommonPart(method, classBuilder, methodBuilder, fieldList, GenerationType.ALL, null, generateSqlField, false);
} | [
"public",
"void",
"generateCommonPart",
"(",
"SQLiteModelMethod",
"method",
",",
"TypeSpec",
".",
"Builder",
"classBuilder",
",",
"MethodSpec",
".",
"Builder",
"methodBuilder",
",",
"Set",
"<",
"JQLProjection",
">",
"fieldList",
",",
"boolean",
"generateSqlField",
"... | Generate common part.
@param method
the method
@param classBuilder
the class builder
@param methodBuilder
the method builder
@param fieldList
the field list
@param mapFields
the map fields | [
"Generate",
"common",
"part",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/AbstractSelectCodeGenerator.java#L324-L326 |
106,215 | xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/AbstractSelectCodeGenerator.java | AbstractSelectCodeGenerator.generateMethodBuilder | protected MethodSpec.Builder generateMethodBuilder(SQLiteModelMethod method) {
MethodSpec.Builder methodBuilder;
if (method.hasLiveData()) {
methodBuilder = MethodSpec.methodBuilder(method.getName() + LIVE_DATA_PREFIX).addModifiers(Modifier.PROTECTED);
} else {
methodBuilder = MethodSpec.methodBuilder(metho... | java | protected MethodSpec.Builder generateMethodBuilder(SQLiteModelMethod method) {
MethodSpec.Builder methodBuilder;
if (method.hasLiveData()) {
methodBuilder = MethodSpec.methodBuilder(method.getName() + LIVE_DATA_PREFIX).addModifiers(Modifier.PROTECTED);
} else {
methodBuilder = MethodSpec.methodBuilder(metho... | [
"protected",
"MethodSpec",
".",
"Builder",
"generateMethodBuilder",
"(",
"SQLiteModelMethod",
"method",
")",
"{",
"MethodSpec",
".",
"Builder",
"methodBuilder",
";",
"if",
"(",
"method",
".",
"hasLiveData",
"(",
")",
")",
"{",
"methodBuilder",
"=",
"MethodSpec",
... | Generate method builder.
@param method
the method
@return the method spec. builder | [
"Generate",
"method",
"builder",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/AbstractSelectCodeGenerator.java#L701-L710 |
106,216 | xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/AbstractSelectCodeGenerator.java | AbstractSelectCodeGenerator.generateMethodSignature | protected void generateMethodSignature(SQLiteModelMethod method, MethodSpec.Builder methodBuilder, TypeName returnTypeName, ParameterSpec... additionalParameterSpec) {
boolean finalParameter = false;
if (method.hasLiveData() && returnTypeName.equals(method.liveDataReturnClass)) {
finalParameter = true;
}
//... | java | protected void generateMethodSignature(SQLiteModelMethod method, MethodSpec.Builder methodBuilder, TypeName returnTypeName, ParameterSpec... additionalParameterSpec) {
boolean finalParameter = false;
if (method.hasLiveData() && returnTypeName.equals(method.liveDataReturnClass)) {
finalParameter = true;
}
//... | [
"protected",
"void",
"generateMethodSignature",
"(",
"SQLiteModelMethod",
"method",
",",
"MethodSpec",
".",
"Builder",
"methodBuilder",
",",
"TypeName",
"returnTypeName",
",",
"ParameterSpec",
"...",
"additionalParameterSpec",
")",
"{",
"boolean",
"finalParameter",
"=",
... | Generate method signature.
@param method
the method
@param methodBuilder
the method builder
@param returnTypeName
the return type name
@param additionalParameterSpec
the additional parameter spec | [
"Generate",
"method",
"signature",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/AbstractSelectCodeGenerator.java#L724-L748 |
106,217 | xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/AbstractSelectCodeGenerator.java | AbstractSelectCodeGenerator.checkUnusedParameters | public static void checkUnusedParameters(SQLiteModelMethod method, Set<String> usedMethodParameters, TypeName excludedClasses) {
int paramsCount = method.getParameters().size();
int usedCount = usedMethodParameters.size();
if (paramsCount > usedCount) {
StringBuilder sb = new StringBuilder();
String separa... | java | public static void checkUnusedParameters(SQLiteModelMethod method, Set<String> usedMethodParameters, TypeName excludedClasses) {
int paramsCount = method.getParameters().size();
int usedCount = usedMethodParameters.size();
if (paramsCount > usedCount) {
StringBuilder sb = new StringBuilder();
String separa... | [
"public",
"static",
"void",
"checkUnusedParameters",
"(",
"SQLiteModelMethod",
"method",
",",
"Set",
"<",
"String",
">",
"usedMethodParameters",
",",
"TypeName",
"excludedClasses",
")",
"{",
"int",
"paramsCount",
"=",
"method",
".",
"getParameters",
"(",
")",
".",... | Check if there are unused method parameters. In this case an exception
was throws.
@param method
the method
@param usedMethodParameters
the used method parameters
@param excludedClasses
the excluded classes | [
"Check",
"if",
"there",
"are",
"unused",
"method",
"parameters",
".",
"In",
"this",
"case",
"an",
"exception",
"was",
"throws",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/AbstractSelectCodeGenerator.java#L789-L811 |
106,218 | xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/AbstractSelectCodeGenerator.java | AbstractSelectCodeGenerator.generateSQLBuild | private static void generateSQLBuild(SQLiteModelMethod method, MethodSpec.Builder methodBuilder, SplittedSql splittedSql, boolean countQuery) {
methodBuilder.addStatement("$T _sqlBuilder=sqlBuilder()", StringBuilder.class);
methodBuilder.addStatement("_sqlBuilder.append($S)", splittedSql.sqlBasic.trim());
SqlMod... | java | private static void generateSQLBuild(SQLiteModelMethod method, MethodSpec.Builder methodBuilder, SplittedSql splittedSql, boolean countQuery) {
methodBuilder.addStatement("$T _sqlBuilder=sqlBuilder()", StringBuilder.class);
methodBuilder.addStatement("_sqlBuilder.append($S)", splittedSql.sqlBasic.trim());
SqlMod... | [
"private",
"static",
"void",
"generateSQLBuild",
"(",
"SQLiteModelMethod",
"method",
",",
"MethodSpec",
".",
"Builder",
"methodBuilder",
",",
"SplittedSql",
"splittedSql",
",",
"boolean",
"countQuery",
")",
"{",
"methodBuilder",
".",
"addStatement",
"(",
"\"$T _sqlBui... | Generate SQL build.
@param method
the method
@param methodBuilder
the method builder
@param splittedSql
the splitted sql
@param countQuery
is true, the query manage the count query for paged result | [
"Generate",
"SQL",
"build",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/AbstractSelectCodeGenerator.java#L825-L837 |
106,219 | xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/bind/model/many2many/M2MEntity.java | M2MEntity.extractClassName | public static String extractClassName(String fullName) {
int l = fullName.lastIndexOf(".");
return fullName.substring(l + 1);
} | java | public static String extractClassName(String fullName) {
int l = fullName.lastIndexOf(".");
return fullName.substring(l + 1);
} | [
"public",
"static",
"String",
"extractClassName",
"(",
"String",
"fullName",
")",
"{",
"int",
"l",
"=",
"fullName",
".",
"lastIndexOf",
"(",
"\".\"",
")",
";",
"return",
"fullName",
".",
"substring",
"(",
"l",
"+",
"1",
")",
";",
"}"
] | Extract class name.
@param fullName the full name
@return the string | [
"Extract",
"class",
"name",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/bind/model/many2many/M2MEntity.java#L123-L127 |
106,220 | xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/TypeUtility.java | TypeUtility.isTypeIncludedIn | public static boolean isTypeIncludedIn(TypeName value, Type... types) {
for (Type item : types) {
if (value.equals(typeName(item))) {
return true;
}
}
return false;
} | java | public static boolean isTypeIncludedIn(TypeName value, Type... types) {
for (Type item : types) {
if (value.equals(typeName(item))) {
return true;
}
}
return false;
} | [
"public",
"static",
"boolean",
"isTypeIncludedIn",
"(",
"TypeName",
"value",
",",
"Type",
"...",
"types",
")",
"{",
"for",
"(",
"Type",
"item",
":",
"types",
")",
"{",
"if",
"(",
"value",
".",
"equals",
"(",
"typeName",
"(",
"item",
")",
")",
")",
"{... | Checks if is type included in.
@param value
the value
@param types
the types
@return true, if is type included in | [
"Checks",
"if",
"is",
"type",
"included",
"in",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/TypeUtility.java#L64-L72 |
106,221 | xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/TypeUtility.java | TypeUtility.isTypePrimitive | public static boolean isTypePrimitive(TypeName value) {
return isTypeIncludedIn(value, Byte.TYPE, Character.TYPE, Boolean.TYPE, Short.TYPE, Integer.TYPE, Long.TYPE,
Float.TYPE, Double.TYPE);
} | java | public static boolean isTypePrimitive(TypeName value) {
return isTypeIncludedIn(value, Byte.TYPE, Character.TYPE, Boolean.TYPE, Short.TYPE, Integer.TYPE, Long.TYPE,
Float.TYPE, Double.TYPE);
} | [
"public",
"static",
"boolean",
"isTypePrimitive",
"(",
"TypeName",
"value",
")",
"{",
"return",
"isTypeIncludedIn",
"(",
"value",
",",
"Byte",
".",
"TYPE",
",",
"Character",
".",
"TYPE",
",",
"Boolean",
".",
"TYPE",
",",
"Short",
".",
"TYPE",
",",
"Integer... | Checks if is type primitive.
@param value
the value
@return true, if is type primitive | [
"Checks",
"if",
"is",
"type",
"primitive",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/TypeUtility.java#L94-L97 |
106,222 | xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/TypeUtility.java | TypeUtility.isTypeWrappedPrimitive | public static boolean isTypeWrappedPrimitive(TypeName value) {
return isTypeIncludedIn(value, Byte.class, Character.class, Boolean.class, Short.class, Integer.class,
Long.class, Float.class, Double.class);
} | java | public static boolean isTypeWrappedPrimitive(TypeName value) {
return isTypeIncludedIn(value, Byte.class, Character.class, Boolean.class, Short.class, Integer.class,
Long.class, Float.class, Double.class);
} | [
"public",
"static",
"boolean",
"isTypeWrappedPrimitive",
"(",
"TypeName",
"value",
")",
"{",
"return",
"isTypeIncludedIn",
"(",
"value",
",",
"Byte",
".",
"class",
",",
"Character",
".",
"class",
",",
"Boolean",
".",
"class",
",",
"Short",
".",
"class",
",",... | Checks if is type wrapped primitive.
@param value
the value
@return true, if is type wrapped primitive | [
"Checks",
"if",
"is",
"type",
"wrapped",
"primitive",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/TypeUtility.java#L106-L109 |
106,223 | xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/TypeUtility.java | TypeUtility.isEquals | public static boolean isEquals(TypeName value, TypeName kindOfParameter) {
return value.toString().equals(kindOfParameter.toString());
} | java | public static boolean isEquals(TypeName value, TypeName kindOfParameter) {
return value.toString().equals(kindOfParameter.toString());
} | [
"public",
"static",
"boolean",
"isEquals",
"(",
"TypeName",
"value",
",",
"TypeName",
"kindOfParameter",
")",
"{",
"return",
"value",
".",
"toString",
"(",
")",
".",
"equals",
"(",
"kindOfParameter",
".",
"toString",
"(",
")",
")",
";",
"}"
] | Check if class that is rapresented by value has same typeName of entity parameter.
@param value
the value
@param kindOfParameter
the kind of parameter
@return true if value is equals to className. | [
"Check",
"if",
"class",
"that",
"is",
"rapresented",
"by",
"value",
"has",
"same",
"typeName",
"of",
"entity",
"parameter",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/TypeUtility.java#L179-L181 |
106,224 | xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/TypeUtility.java | TypeUtility.typeName | public static TypeName typeName(TypeMirror typeMirror) {
LiteralType literalType = LiteralType.of(typeMirror.toString());
if (literalType.isArray()) {
return ArrayTypeName.of(typeName(literalType.getRawType()));
} else if (literalType.isCollection()) {
return ParameterizedTypeName.get(TypeUtility.className... | java | public static TypeName typeName(TypeMirror typeMirror) {
LiteralType literalType = LiteralType.of(typeMirror.toString());
if (literalType.isArray()) {
return ArrayTypeName.of(typeName(literalType.getRawType()));
} else if (literalType.isCollection()) {
return ParameterizedTypeName.get(TypeUtility.className... | [
"public",
"static",
"TypeName",
"typeName",
"(",
"TypeMirror",
"typeMirror",
")",
"{",
"LiteralType",
"literalType",
"=",
"LiteralType",
".",
"of",
"(",
"typeMirror",
".",
"toString",
"(",
")",
")",
";",
"if",
"(",
"literalType",
".",
"isArray",
"(",
")",
... | Convert a TypeMirror in a typeName.
@param typeMirror
the type mirror
@return typeName | [
"Convert",
"a",
"TypeMirror",
"in",
"a",
"typeName",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/TypeUtility.java#L243-L263 |
106,225 | xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/TypeUtility.java | TypeUtility.mergeTypeNameWithSuffix | public static ClassName mergeTypeNameWithSuffix(TypeName typeName, String typeNameSuffix) {
ClassName className = className(typeName.toString());
return classNameWithSuffix(className.packageName(), className.simpleName(), typeNameSuffix);
} | java | public static ClassName mergeTypeNameWithSuffix(TypeName typeName, String typeNameSuffix) {
ClassName className = className(typeName.toString());
return classNameWithSuffix(className.packageName(), className.simpleName(), typeNameSuffix);
} | [
"public",
"static",
"ClassName",
"mergeTypeNameWithSuffix",
"(",
"TypeName",
"typeName",
",",
"String",
"typeNameSuffix",
")",
"{",
"ClassName",
"className",
"=",
"className",
"(",
"typeName",
".",
"toString",
"(",
")",
")",
";",
"return",
"classNameWithSuffix",
"... | Merge type name with suffix.
@param typeName
the type name
@param typeNameSuffix
the type name suffix
@return the class name | [
"Merge",
"type",
"name",
"with",
"suffix",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/TypeUtility.java#L287-L291 |
106,226 | xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/TypeUtility.java | TypeUtility.typeName | public static TypeName typeName(String typeName) {
TypeName[] values = { TypeName.BOOLEAN, TypeName.BYTE, TypeName.CHAR, TypeName.DOUBLE, TypeName.FLOAT,
TypeName.INT, TypeName.LONG, TypeName.SHORT, TypeName.VOID };
for (TypeName item : values) {
if (item.toString().equals(typeName)) {
return item;
}... | java | public static TypeName typeName(String typeName) {
TypeName[] values = { TypeName.BOOLEAN, TypeName.BYTE, TypeName.CHAR, TypeName.DOUBLE, TypeName.FLOAT,
TypeName.INT, TypeName.LONG, TypeName.SHORT, TypeName.VOID };
for (TypeName item : values) {
if (item.toString().equals(typeName)) {
return item;
}... | [
"public",
"static",
"TypeName",
"typeName",
"(",
"String",
"typeName",
")",
"{",
"TypeName",
"[",
"]",
"values",
"=",
"{",
"TypeName",
".",
"BOOLEAN",
",",
"TypeName",
".",
"BYTE",
",",
"TypeName",
".",
"CHAR",
",",
"TypeName",
".",
"DOUBLE",
",",
"TypeN... | Convert a TypeMirror in a typeName, or classname or whatever.
@param typeName
the type name
@return typeName | [
"Convert",
"a",
"TypeMirror",
"in",
"a",
"typeName",
"or",
"classname",
"or",
"whatever",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/TypeUtility.java#L300-L320 |
106,227 | xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/TypeUtility.java | TypeUtility.checkTypeCompatibility | public static void checkTypeCompatibility(SQLiteModelMethod method, Pair<String, TypeName> item,
ModelProperty property) {
if (!TypeUtility.isEquals(item.value1, property.getPropertyType().getTypeName())) {
// ASSERT: property is not nullable but method yes, so we throw an
// exception
throw (new InvalidM... | java | public static void checkTypeCompatibility(SQLiteModelMethod method, Pair<String, TypeName> item,
ModelProperty property) {
if (!TypeUtility.isEquals(item.value1, property.getPropertyType().getTypeName())) {
// ASSERT: property is not nullable but method yes, so we throw an
// exception
throw (new InvalidM... | [
"public",
"static",
"void",
"checkTypeCompatibility",
"(",
"SQLiteModelMethod",
"method",
",",
"Pair",
"<",
"String",
",",
"TypeName",
">",
"item",
",",
"ModelProperty",
"property",
")",
"{",
"if",
"(",
"!",
"TypeUtility",
".",
"isEquals",
"(",
"item",
".",
... | Check if type if compatibility.
@param method
the method
@param item
the item
@param property
the property | [
"Check",
"if",
"type",
"if",
"compatibility",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/TypeUtility.java#L355-L366 |
106,228 | xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/TypeUtility.java | TypeUtility.beginStringConversion | public static void beginStringConversion(Builder methodBuilder, ModelProperty property) {
TypeName modelType = typeName(property.getElement().asType());
beginStringConversion(methodBuilder, modelType);
} | java | public static void beginStringConversion(Builder methodBuilder, ModelProperty property) {
TypeName modelType = typeName(property.getElement().asType());
beginStringConversion(methodBuilder, modelType);
} | [
"public",
"static",
"void",
"beginStringConversion",
"(",
"Builder",
"methodBuilder",
",",
"ModelProperty",
"property",
")",
"{",
"TypeName",
"modelType",
"=",
"typeName",
"(",
"property",
".",
"getElement",
"(",
")",
".",
"asType",
"(",
")",
")",
";",
"beginS... | generate begin string to translate in code to used in content value or parameter need to be converted in string through String.valueOf
@param methodBuilder
the method builder
@param property
the property | [
"generate",
"begin",
"string",
"to",
"translate",
"in",
"code",
"to",
"used",
"in",
"content",
"value",
"or",
"parameter",
"need",
"to",
"be",
"converted",
"in",
"string",
"through",
"String",
".",
"valueOf"
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/TypeUtility.java#L376-L380 |
106,229 | xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/TypeUtility.java | TypeUtility.endStringConversion | public static void endStringConversion(Builder methodBuilder, TypeName typeMirror) {
SQLTransform transform = SQLTransformer.lookup(typeMirror);
switch (transform.getColumnType()) {
case TEXT:
return;
case BLOB:
methodBuilder.addCode(",$T.UTF_8)", StandardCharsets.class);
break;
case INTEGER:
case... | java | public static void endStringConversion(Builder methodBuilder, TypeName typeMirror) {
SQLTransform transform = SQLTransformer.lookup(typeMirror);
switch (transform.getColumnType()) {
case TEXT:
return;
case BLOB:
methodBuilder.addCode(",$T.UTF_8)", StandardCharsets.class);
break;
case INTEGER:
case... | [
"public",
"static",
"void",
"endStringConversion",
"(",
"Builder",
"methodBuilder",
",",
"TypeName",
"typeMirror",
")",
"{",
"SQLTransform",
"transform",
"=",
"SQLTransformer",
".",
"lookup",
"(",
"typeMirror",
")",
";",
"switch",
"(",
"transform",
".",
"getColumn... | generate end string to translate in code to used in content value or parameter need to be converted in string through String.valueOf
@param methodBuilder
the method builder
@param typeMirror
the type mirror | [
"generate",
"end",
"string",
"to",
"translate",
"in",
"code",
"to",
"used",
"in",
"content",
"value",
"or",
"parameter",
"need",
"to",
"be",
"converted",
"in",
"string",
"through",
"String",
".",
"valueOf"
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/TypeUtility.java#L431-L447 |
106,230 | xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/TypeUtility.java | TypeUtility.typeName | public static TypeName typeName(TypeElement element, String suffix) {
String fullName = element.getQualifiedName().toString() + suffix;
int lastIndex = fullName.lastIndexOf(".");
String packageName = fullName.substring(0, lastIndex);
String className = fullName.substring(lastIndex + 1);
return typeName(pac... | java | public static TypeName typeName(TypeElement element, String suffix) {
String fullName = element.getQualifiedName().toString() + suffix;
int lastIndex = fullName.lastIndexOf(".");
String packageName = fullName.substring(0, lastIndex);
String className = fullName.substring(lastIndex + 1);
return typeName(pac... | [
"public",
"static",
"TypeName",
"typeName",
"(",
"TypeElement",
"element",
",",
"String",
"suffix",
")",
"{",
"String",
"fullName",
"=",
"element",
".",
"getQualifiedName",
"(",
")",
".",
"toString",
"(",
")",
"+",
"suffix",
";",
"int",
"lastIndex",
"=",
"... | Type name.
@param element
the element
@param suffix
the suffix
@return the type name | [
"Type",
"name",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/TypeUtility.java#L488-L497 |
106,231 | xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/TypeUtility.java | TypeUtility.parameterizedTypeName | public static TypeName parameterizedTypeName(ClassName rawClass, TypeName paramClass) {
return ParameterizedTypeName.get(rawClass, paramClass);
} | java | public static TypeName parameterizedTypeName(ClassName rawClass, TypeName paramClass) {
return ParameterizedTypeName.get(rawClass, paramClass);
} | [
"public",
"static",
"TypeName",
"parameterizedTypeName",
"(",
"ClassName",
"rawClass",
",",
"TypeName",
"paramClass",
")",
"{",
"return",
"ParameterizedTypeName",
".",
"get",
"(",
"rawClass",
",",
"paramClass",
")",
";",
"}"
] | Parameterized type name.
@param rawClass
the raw class
@param paramClass
the param class
@return the type name | [
"Parameterized",
"type",
"name",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/TypeUtility.java#L521-L523 |
106,232 | xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/TypeUtility.java | TypeUtility.simpleName | public static String simpleName(TypeName clazzName) {
String clazz = clazzName.toString();
int index = clazz.lastIndexOf(".");
if (index > 0) {
clazz=clazz.substring(index + 1);
}
return clazz;
} | java | public static String simpleName(TypeName clazzName) {
String clazz = clazzName.toString();
int index = clazz.lastIndexOf(".");
if (index > 0) {
clazz=clazz.substring(index + 1);
}
return clazz;
} | [
"public",
"static",
"String",
"simpleName",
"(",
"TypeName",
"clazzName",
")",
"{",
"String",
"clazz",
"=",
"clazzName",
".",
"toString",
"(",
")",
";",
"int",
"index",
"=",
"clazz",
".",
"lastIndexOf",
"(",
"\".\"",
")",
";",
"if",
"(",
"index",
">",
... | Return simple typeName of class.
@param clazzName
the clazz name
@return the string | [
"Return",
"simple",
"typeName",
"of",
"class",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/TypeUtility.java#L532-L539 |
106,233 | xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/TypeUtility.java | TypeUtility.isEnum | public static boolean isEnum(String className) {
try {
// is it an enum?
TypeElement element = BindTypeSubProcessor.elementUtils.getTypeElement(className);
if (element instanceof TypeElement) {
TypeElement typeElement = element;
TypeMirror superclass = typeElement.getSuperclass();
if (superclass ... | java | public static boolean isEnum(String className) {
try {
// is it an enum?
TypeElement element = BindTypeSubProcessor.elementUtils.getTypeElement(className);
if (element instanceof TypeElement) {
TypeElement typeElement = element;
TypeMirror superclass = typeElement.getSuperclass();
if (superclass ... | [
"public",
"static",
"boolean",
"isEnum",
"(",
"String",
"className",
")",
"{",
"try",
"{",
"// is it an enum?",
"TypeElement",
"element",
"=",
"BindTypeSubProcessor",
".",
"elementUtils",
".",
"getTypeElement",
"(",
"className",
")",
";",
"if",
"(",
"element",
"... | Checks if is enum.
@param className
the class name
@return true, if is enum | [
"Checks",
"if",
"is",
"enum",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/TypeUtility.java#L573-L592 |
106,234 | xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/TypeUtility.java | TypeUtility.isCollectionOfType | public static boolean isCollectionOfType(TypeName typeName, TypeName elementTypeName) {
return isAssignable(typeName, Collection.class)
&& isEquals(((ParameterizedTypeName) typeName).typeArguments.get(0), elementTypeName);
} | java | public static boolean isCollectionOfType(TypeName typeName, TypeName elementTypeName) {
return isAssignable(typeName, Collection.class)
&& isEquals(((ParameterizedTypeName) typeName).typeArguments.get(0), elementTypeName);
} | [
"public",
"static",
"boolean",
"isCollectionOfType",
"(",
"TypeName",
"typeName",
",",
"TypeName",
"elementTypeName",
")",
"{",
"return",
"isAssignable",
"(",
"typeName",
",",
"Collection",
".",
"class",
")",
"&&",
"isEquals",
"(",
"(",
"(",
"ParameterizedTypeName... | Checks if is collection and if element type is the one passed as parameter.
@param typeName
the type name
@param elementTypeName
the element type name
@return true, if is collection | [
"Checks",
"if",
"is",
"collection",
"and",
"if",
"element",
"type",
"is",
"the",
"one",
"passed",
"as",
"parameter",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/TypeUtility.java#L697-L700 |
106,235 | xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/TypeUtility.java | TypeUtility.isAssignable | public static boolean isAssignable(TypeName typeName, Class<?> assignableClazz) {
try {
if (typeName instanceof ParameterizedTypeName) {
typeName = ((ParameterizedTypeName) typeName).rawType;
} else if (typeName instanceof ArrayTypeName) {
typeName = ((ArrayTypeName) typeName).componentType;
}
Cl... | java | public static boolean isAssignable(TypeName typeName, Class<?> assignableClazz) {
try {
if (typeName instanceof ParameterizedTypeName) {
typeName = ((ParameterizedTypeName) typeName).rawType;
} else if (typeName instanceof ArrayTypeName) {
typeName = ((ArrayTypeName) typeName).componentType;
}
Cl... | [
"public",
"static",
"boolean",
"isAssignable",
"(",
"TypeName",
"typeName",
",",
"Class",
"<",
"?",
">",
"assignableClazz",
")",
"{",
"try",
"{",
"if",
"(",
"typeName",
"instanceof",
"ParameterizedTypeName",
")",
"{",
"typeName",
"=",
"(",
"(",
"ParameterizedT... | Checks if is assignable.
@param typeName
the type name
@param assignableClazz
the assignable clazz
@return true, if is assignable | [
"Checks",
"if",
"is",
"assignable",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/TypeUtility.java#L744-L757 |
106,236 | xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/TypeUtility.java | TypeUtility.extractPackageName | public static String extractPackageName(TypeElement element) {
String fullName = element.getQualifiedName().toString();
if (fullName.lastIndexOf(".") > 0) {
return fullName.substring(0, fullName.lastIndexOf("."));
}
return "";
} | java | public static String extractPackageName(TypeElement element) {
String fullName = element.getQualifiedName().toString();
if (fullName.lastIndexOf(".") > 0) {
return fullName.substring(0, fullName.lastIndexOf("."));
}
return "";
} | [
"public",
"static",
"String",
"extractPackageName",
"(",
"TypeElement",
"element",
")",
"{",
"String",
"fullName",
"=",
"element",
".",
"getQualifiedName",
"(",
")",
".",
"toString",
"(",
")",
";",
"if",
"(",
"fullName",
".",
"lastIndexOf",
"(",
"\".\"",
")"... | Extract package name.
@param element
the element
@return the string | [
"Extract",
"package",
"name",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/TypeUtility.java#L767-L774 |
106,237 | xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/grammars/jql/JQLChecker.java | JQLChecker.analyzeVariableStatementInternal | protected <L extends JqlBaseListener> void analyzeVariableStatementInternal(JQLContext jqlContext, final String jql, L listener) {
walker.walk(listener, prepareVariableStatement(jqlContext, jql).value0);
} | java | protected <L extends JqlBaseListener> void analyzeVariableStatementInternal(JQLContext jqlContext, final String jql, L listener) {
walker.walk(listener, prepareVariableStatement(jqlContext, jql).value0);
} | [
"protected",
"<",
"L",
"extends",
"JqlBaseListener",
">",
"void",
"analyzeVariableStatementInternal",
"(",
"JQLContext",
"jqlContext",
",",
"final",
"String",
"jql",
",",
"L",
"listener",
")",
"{",
"walker",
".",
"walk",
"(",
"listener",
",",
"prepareVariableState... | Analyze variable statement internal.
@param <L>
the generic type
@param jqlContext
the jql context
@param jql
the jql
@param listener
the listener | [
"Analyze",
"variable",
"statement",
"internal",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/grammars/jql/JQLChecker.java#L131-L133 |
106,238 | xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/grammars/jql/JQLChecker.java | JQLChecker.prepareParser | protected Pair<ParserRuleContext, CommonTokenStream> prepareParser(final JQLContext jqlContext, final String jql) {
JqlLexer lexer = new JqlLexer(CharStreams.fromString(jql));
CommonTokenStream tokens = new CommonTokenStream(lexer);
JqlParser parser = new JqlParser(tokens);
parser.removeErrorListeners();
par... | java | protected Pair<ParserRuleContext, CommonTokenStream> prepareParser(final JQLContext jqlContext, final String jql) {
JqlLexer lexer = new JqlLexer(CharStreams.fromString(jql));
CommonTokenStream tokens = new CommonTokenStream(lexer);
JqlParser parser = new JqlParser(tokens);
parser.removeErrorListeners();
par... | [
"protected",
"Pair",
"<",
"ParserRuleContext",
",",
"CommonTokenStream",
">",
"prepareParser",
"(",
"final",
"JQLContext",
"jqlContext",
",",
"final",
"String",
"jql",
")",
"{",
"JqlLexer",
"lexer",
"=",
"new",
"JqlLexer",
"(",
"CharStreams",
".",
"fromString",
... | Prepare parser.
@param jqlContext
the jql context
@param jql
the jql
@return the pair | [
"Prepare",
"parser",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/grammars/jql/JQLChecker.java#L160-L175 |
106,239 | xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/grammars/jql/JQLChecker.java | JQLChecker.extractColumnsToInsertOrUpdate | public Set<String> extractColumnsToInsertOrUpdate(final JQLContext jqlContext, String jqlValue, final Finder<SQLProperty> entity) {
final Set<String> result = new LinkedHashSet<String>();
final One<Boolean> selectionOn = new One<Boolean>(null);
final One<Boolean> insertOn = new One<Boolean>(null);
// Column_n... | java | public Set<String> extractColumnsToInsertOrUpdate(final JQLContext jqlContext, String jqlValue, final Finder<SQLProperty> entity) {
final Set<String> result = new LinkedHashSet<String>();
final One<Boolean> selectionOn = new One<Boolean>(null);
final One<Boolean> insertOn = new One<Boolean>(null);
// Column_n... | [
"public",
"Set",
"<",
"String",
">",
"extractColumnsToInsertOrUpdate",
"(",
"final",
"JQLContext",
"jqlContext",
",",
"String",
"jqlValue",
",",
"final",
"Finder",
"<",
"SQLProperty",
">",
"entity",
")",
"{",
"final",
"Set",
"<",
"String",
">",
"result",
"=",
... | Extract columns to insert or update.
@param jqlContext
the jql context
@param jqlValue
the jql value
@param entity
the entity
@return the sets the | [
"Extract",
"columns",
"to",
"insert",
"or",
"update",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/grammars/jql/JQLChecker.java#L330-L380 |
106,240 | xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/grammars/jql/JQLChecker.java | JQLChecker.replaceInternal | private String replaceInternal(final JQLContext jqlContext, String jql, final List<Triple<Token, Token, String>> replace, JqlBaseListener rewriterListener) {
Pair<ParserRuleContext, CommonTokenStream> parser = prepareParser(jqlContext, jql);
walker.walk(rewriterListener, parser.value0);
TokenStreamRewriter rewri... | java | private String replaceInternal(final JQLContext jqlContext, String jql, final List<Triple<Token, Token, String>> replace, JqlBaseListener rewriterListener) {
Pair<ParserRuleContext, CommonTokenStream> parser = prepareParser(jqlContext, jql);
walker.walk(rewriterListener, parser.value0);
TokenStreamRewriter rewri... | [
"private",
"String",
"replaceInternal",
"(",
"final",
"JQLContext",
"jqlContext",
",",
"String",
"jql",
",",
"final",
"List",
"<",
"Triple",
"<",
"Token",
",",
"Token",
",",
"String",
">",
">",
"replace",
",",
"JqlBaseListener",
"rewriterListener",
")",
"{",
... | Replace internal.
@param jqlContext
the jql context
@param jql
the jql
@param replace
the replace
@param rewriterListener
the rewriter listener
@return the string | [
"Replace",
"internal",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/grammars/jql/JQLChecker.java#L697-L708 |
106,241 | xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/grammars/jql/JQLChecker.java | JQLChecker.replaceFromVariableStatementInternal | private String replaceFromVariableStatementInternal(JQLContext context, String jql, final List<Triple<Token, Token, String>> replace, JqlBaseListener rewriterListener) {
Pair<ParserRuleContext, CommonTokenStream> parser = prepareVariableStatement(context, jql);
walker.walk(rewriterListener, parser.value0);
Token... | java | private String replaceFromVariableStatementInternal(JQLContext context, String jql, final List<Triple<Token, Token, String>> replace, JqlBaseListener rewriterListener) {
Pair<ParserRuleContext, CommonTokenStream> parser = prepareVariableStatement(context, jql);
walker.walk(rewriterListener, parser.value0);
Token... | [
"private",
"String",
"replaceFromVariableStatementInternal",
"(",
"JQLContext",
"context",
",",
"String",
"jql",
",",
"final",
"List",
"<",
"Triple",
"<",
"Token",
",",
"Token",
",",
"String",
">",
">",
"replace",
",",
"JqlBaseListener",
"rewriterListener",
")",
... | Replace from variable statement internal.
@param context
the context
@param jql
the jql
@param replace
the replace
@param rewriterListener
the rewriter listener
@return the string | [
"Replace",
"from",
"variable",
"statement",
"internal",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/grammars/jql/JQLChecker.java#L723-L734 |
106,242 | xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/grammars/jql/JQLChecker.java | JQLChecker.extractPlaceHolders | private <L extends Collection<JQLPlaceHolder>> L extractPlaceHolders(final JQLContext jqlContext, String jql, final L result) {
final One<Boolean> valid = new One<>();
valid.value0 = false;
analyzeInternal(jqlContext, jql, new JqlBaseListener() {
@Override
public void enterBind_parameter(Bind_parameterCon... | java | private <L extends Collection<JQLPlaceHolder>> L extractPlaceHolders(final JQLContext jqlContext, String jql, final L result) {
final One<Boolean> valid = new One<>();
valid.value0 = false;
analyzeInternal(jqlContext, jql, new JqlBaseListener() {
@Override
public void enterBind_parameter(Bind_parameterCon... | [
"private",
"<",
"L",
"extends",
"Collection",
"<",
"JQLPlaceHolder",
">",
">",
"L",
"extractPlaceHolders",
"(",
"final",
"JQLContext",
"jqlContext",
",",
"String",
"jql",
",",
"final",
"L",
"result",
")",
"{",
"final",
"One",
"<",
"Boolean",
">",
"valid",
... | Extract place holders.
@param <L>
the generic type
@param jqlContext
the jql context
@param jql
the jql
@param result
the result
@return the l | [
"Extract",
"place",
"holders",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/grammars/jql/JQLChecker.java#L876-L900 |
106,243 | xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/grammars/jql/JQLChecker.java | JQLChecker.extractPlaceHoldersFromVariableStatement | private <L extends Collection<JQLPlaceHolder>> L extractPlaceHoldersFromVariableStatement(final JQLContext jqlContext, String jql, final L result) {
final One<Boolean> valid = new One<>();
if (!StringUtils.hasText(jql))
return result;
valid.value0 = false;
analyzeVariableStatementInternal(jqlContext, jql,... | java | private <L extends Collection<JQLPlaceHolder>> L extractPlaceHoldersFromVariableStatement(final JQLContext jqlContext, String jql, final L result) {
final One<Boolean> valid = new One<>();
if (!StringUtils.hasText(jql))
return result;
valid.value0 = false;
analyzeVariableStatementInternal(jqlContext, jql,... | [
"private",
"<",
"L",
"extends",
"Collection",
"<",
"JQLPlaceHolder",
">",
">",
"L",
"extractPlaceHoldersFromVariableStatement",
"(",
"final",
"JQLContext",
"jqlContext",
",",
"String",
"jql",
",",
"final",
"L",
"result",
")",
"{",
"final",
"One",
"<",
"Boolean",... | Extract place holders from variable statement.
@param <L>
the generic type
@param jqlContext
the jql context
@param jql
the jql
@param result
the result
@return the l | [
"Extract",
"place",
"holders",
"from",
"variable",
"statement",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/grammars/jql/JQLChecker.java#L915-L943 |
106,244 | xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/bind/transform/ObjectBindTransform.java | ObjectBindTransform.generateSerializeInternal | void generateSerializeInternal(BindTypeContext context, MethodSpec.Builder methodBuilder, String serializerName, TypeName beanClass, String beanName, BindProperty property, boolean onString) {
TypeName typeName = property.getPropertyType().getTypeName();
String bindName = context.getBindMapperName(context, typeNam... | java | void generateSerializeInternal(BindTypeContext context, MethodSpec.Builder methodBuilder, String serializerName, TypeName beanClass, String beanName, BindProperty property, boolean onString) {
TypeName typeName = property.getPropertyType().getTypeName();
String bindName = context.getBindMapperName(context, typeNam... | [
"void",
"generateSerializeInternal",
"(",
"BindTypeContext",
"context",
",",
"MethodSpec",
".",
"Builder",
"methodBuilder",
",",
"String",
"serializerName",
",",
"TypeName",
"beanClass",
",",
"String",
"beanName",
",",
"BindProperty",
"property",
",",
"boolean",
"onSt... | Generate serialize internal.
@param context the context
@param methodBuilder the method builder
@param serializerName the serializer name
@param beanClass the bean class
@param beanName the bean name
@param property the property
@param onString the on string | [
"Generate",
"serialize",
"internal",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/bind/transform/ObjectBindTransform.java#L104-L136 |
106,245 | xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindDaoBuilder.java | BindDaoBuilder.daoName | public static String daoName(SQLiteDaoDefinition value) {
String classTableName = value.getName();
classTableName = classTableName + SUFFIX;
return classTableName;
} | java | public static String daoName(SQLiteDaoDefinition value) {
String classTableName = value.getName();
classTableName = classTableName + SUFFIX;
return classTableName;
} | [
"public",
"static",
"String",
"daoName",
"(",
"SQLiteDaoDefinition",
"value",
")",
"{",
"String",
"classTableName",
"=",
"value",
".",
"getName",
"(",
")",
";",
"classTableName",
"=",
"classTableName",
"+",
"SUFFIX",
";",
"return",
"classTableName",
";",
"}"
] | Dao name.
@param value
the value
@return typeName of dao | [
"Dao",
"name",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindDaoBuilder.java#L322-L326 |
106,246 | xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/AnnotationUtility.java | AnnotationUtility.extractAsArrayOfClassName | static List<String> extractAsArrayOfClassName(String value) {
Matcher matcher = classPattern.matcher(value);
List<String> result = new ArrayList<String>();
while (matcher.find()) {
result.add(matcher.group(1));
}
return result;
} | java | static List<String> extractAsArrayOfClassName(String value) {
Matcher matcher = classPattern.matcher(value);
List<String> result = new ArrayList<String>();
while (matcher.find()) {
result.add(matcher.group(1));
}
return result;
} | [
"static",
"List",
"<",
"String",
">",
"extractAsArrayOfClassName",
"(",
"String",
"value",
")",
"{",
"Matcher",
"matcher",
"=",
"classPattern",
".",
"matcher",
"(",
"value",
")",
";",
"List",
"<",
"String",
">",
"result",
"=",
"new",
"ArrayList",
"<",
"Str... | Extract as array of class name.
@param value the value
@return the list | [
"Extract",
"as",
"array",
"of",
"class",
"name",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/AnnotationUtility.java#L64-L74 |
106,247 | xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/AnnotationUtility.java | AnnotationUtility.extractAsArrayOfString | public static List<String> extractAsArrayOfString(String value) {
Matcher matcher = arrayPattern.matcher(value);
List<String> result = new ArrayList<String>();
// we need to unscape javascript format, otherwise string like " where id like '%' " will become " where id like \'%\' "
while (matcher.find()) {
... | java | public static List<String> extractAsArrayOfString(String value) {
Matcher matcher = arrayPattern.matcher(value);
List<String> result = new ArrayList<String>();
// we need to unscape javascript format, otherwise string like " where id like '%' " will become " where id like \'%\' "
while (matcher.find()) {
... | [
"public",
"static",
"List",
"<",
"String",
">",
"extractAsArrayOfString",
"(",
"String",
"value",
")",
"{",
"Matcher",
"matcher",
"=",
"arrayPattern",
".",
"matcher",
"(",
"value",
")",
";",
"List",
"<",
"String",
">",
"result",
"=",
"new",
"ArrayList",
"<... | Extract as array of string.
@param value the value
@return the list | [
"Extract",
"as",
"array",
"of",
"string",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/AnnotationUtility.java#L82-L93 |
106,248 | xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/AnnotationUtility.java | AnnotationUtility.forEachAnnotations | public static void forEachAnnotations(Element currentElement, AnnotationFilter filter, AnnotationFoundListener listener) {
final Elements elementUtils=BaseProcessor.elementUtils;
List<? extends AnnotationMirror> annotationList = elementUtils.getAllAnnotationMirrors(currentElement);
String annotationClassName;
/... | java | public static void forEachAnnotations(Element currentElement, AnnotationFilter filter, AnnotationFoundListener listener) {
final Elements elementUtils=BaseProcessor.elementUtils;
List<? extends AnnotationMirror> annotationList = elementUtils.getAllAnnotationMirrors(currentElement);
String annotationClassName;
/... | [
"public",
"static",
"void",
"forEachAnnotations",
"(",
"Element",
"currentElement",
",",
"AnnotationFilter",
"filter",
",",
"AnnotationFoundListener",
"listener",
")",
"{",
"final",
"Elements",
"elementUtils",
"=",
"BaseProcessor",
".",
"elementUtils",
";",
"List",
"<... | Iterate over annotations of currentElement. Accept only annotation in
accepted set.
@param currentElement the current element
@param filter the filter
@param listener the listener | [
"Iterate",
"over",
"annotations",
"of",
"currentElement",
".",
"Accept",
"only",
"annotation",
"in",
"accepted",
"set",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/AnnotationUtility.java#L145-L173 |
106,249 | xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/AnnotationUtility.java | AnnotationUtility.extractString | static void extractString(Elements elementUtils, Element item, Class<? extends Annotation> annotationClass, AnnotationAttributeType attribute, OnAttributeFoundListener listener) {
extractAttributeValue(elementUtils, item, annotationClass.getCanonicalName(), attribute, listener);
} | java | static void extractString(Elements elementUtils, Element item, Class<? extends Annotation> annotationClass, AnnotationAttributeType attribute, OnAttributeFoundListener listener) {
extractAttributeValue(elementUtils, item, annotationClass.getCanonicalName(), attribute, listener);
} | [
"static",
"void",
"extractString",
"(",
"Elements",
"elementUtils",
",",
"Element",
"item",
",",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"annotationClass",
",",
"AnnotationAttributeType",
"attribute",
",",
"OnAttributeFoundListener",
"listener",
")",
"{",
"... | Extract string.
@param elementUtils the element utils
@param item the item
@param annotationClass the annotation class
@param attribute the attribute
@param listener the listener | [
"Extract",
"string",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/AnnotationUtility.java#L340-L342 |
106,250 | xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/AnnotationUtility.java | AnnotationUtility.buildAnnotationList | public static List<ModelAnnotation> buildAnnotationList(final Element element, final AnnotationFilter filter) {
final List<ModelAnnotation> annotationList=new ArrayList<>();
forEachAnnotations(element, filter, new AnnotationFoundListener() {
@Override
public void onAcceptAnnotation(Element executableMetho... | java | public static List<ModelAnnotation> buildAnnotationList(final Element element, final AnnotationFilter filter) {
final List<ModelAnnotation> annotationList=new ArrayList<>();
forEachAnnotations(element, filter, new AnnotationFoundListener() {
@Override
public void onAcceptAnnotation(Element executableMetho... | [
"public",
"static",
"List",
"<",
"ModelAnnotation",
">",
"buildAnnotationList",
"(",
"final",
"Element",
"element",
",",
"final",
"AnnotationFilter",
"filter",
")",
"{",
"final",
"List",
"<",
"ModelAnnotation",
">",
"annotationList",
"=",
"new",
"ArrayList",
"<>",... | Builds the annotation list.
@param element the element
@param filter the filter
@return the list | [
"Builds",
"the",
"annotation",
"list",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/AnnotationUtility.java#L422-L436 |
106,251 | xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/AnnotationUtility.java | AnnotationUtility.extractAsInt | public static int extractAsInt(Element item, Class<? extends Annotation> annotationClass, AnnotationAttributeType attributeName) {
final Elements elementUtils=BaseProcessor.elementUtils;
final One<Integer> result = new One<Integer>();
result.value0 = 0;
extractString(elementUtils, item, annotationClass, attrib... | java | public static int extractAsInt(Element item, Class<? extends Annotation> annotationClass, AnnotationAttributeType attributeName) {
final Elements elementUtils=BaseProcessor.elementUtils;
final One<Integer> result = new One<Integer>();
result.value0 = 0;
extractString(elementUtils, item, annotationClass, attrib... | [
"public",
"static",
"int",
"extractAsInt",
"(",
"Element",
"item",
",",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"annotationClass",
",",
"AnnotationAttributeType",
"attributeName",
")",
"{",
"final",
"Elements",
"elementUtils",
"=",
"BaseProcessor",
".",
"... | Extract as int.
@param item the item
@param annotationClass the annotation class
@param attributeName the attribute name
@return the int | [
"Extract",
"as",
"int",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/AnnotationUtility.java#L532-L546 |
106,252 | xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/AnnotationUtility.java | AnnotationUtility.extractAsBoolean | public static boolean extractAsBoolean(Element item, Class<? extends Annotation> annotationClass, AnnotationAttributeType attribute) {
final Elements elementUtils=BaseProcessor.elementUtils;
final One<Boolean> result = new One<Boolean>(false);
extractString(elementUtils, item, annotationClass, attribute, new OnA... | java | public static boolean extractAsBoolean(Element item, Class<? extends Annotation> annotationClass, AnnotationAttributeType attribute) {
final Elements elementUtils=BaseProcessor.elementUtils;
final One<Boolean> result = new One<Boolean>(false);
extractString(elementUtils, item, annotationClass, attribute, new OnA... | [
"public",
"static",
"boolean",
"extractAsBoolean",
"(",
"Element",
"item",
",",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"annotationClass",
",",
"AnnotationAttributeType",
"attribute",
")",
"{",
"final",
"Elements",
"elementUtils",
"=",
"BaseProcessor",
".",... | Extract as boolean.
@param item the item
@param annotationClass the annotation class
@param attribute the attribute
@return true, if successful | [
"Extract",
"as",
"boolean",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/AnnotationUtility.java#L556-L569 |
106,253 | xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/AnnotationUtility.java | AnnotationUtility.extractAsBoolean | public static <E extends ModelEntity<?>> boolean extractAsBoolean(E item, ModelAnnotation annotation, AnnotationAttributeType attribute) {
final Elements elementUtils=BaseProcessor.elementUtils;
final One<Boolean> result = new One<Boolean>(false);
extractAttributeValue(elementUtils, item.getElement(), annotation... | java | public static <E extends ModelEntity<?>> boolean extractAsBoolean(E item, ModelAnnotation annotation, AnnotationAttributeType attribute) {
final Elements elementUtils=BaseProcessor.elementUtils;
final One<Boolean> result = new One<Boolean>(false);
extractAttributeValue(elementUtils, item.getElement(), annotation... | [
"public",
"static",
"<",
"E",
"extends",
"ModelEntity",
"<",
"?",
">",
">",
"boolean",
"extractAsBoolean",
"(",
"E",
"item",
",",
"ModelAnnotation",
"annotation",
",",
"AnnotationAttributeType",
"attribute",
")",
"{",
"final",
"Elements",
"elementUtils",
"=",
"B... | Estract from an annotation of a method the attribute value specified.
@param <E> the element type
@param item entity to analyze
@param annotation annotation to analyze
@param attribute the attribute
@return true, if successful | [
"Estract",
"from",
"an",
"annotation",
"of",
"a",
"method",
"the",
"attribute",
"value",
"specified",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/AnnotationUtility.java#L580-L593 |
106,254 | xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/AnnotationUtility.java | AnnotationUtility.getAnnotationAttributeAsBoolean | public static Boolean getAnnotationAttributeAsBoolean(ModelWithAnnotation model, Class<? extends Annotation> annotation, AnnotationAttributeType attribute, Boolean defaultValue) {
return getAnnotationAttribute(model, annotation, attribute, defaultValue, new OnAnnotationAttributeListener<Boolean>() {
@Override
... | java | public static Boolean getAnnotationAttributeAsBoolean(ModelWithAnnotation model, Class<? extends Annotation> annotation, AnnotationAttributeType attribute, Boolean defaultValue) {
return getAnnotationAttribute(model, annotation, attribute, defaultValue, new OnAnnotationAttributeListener<Boolean>() {
@Override
... | [
"public",
"static",
"Boolean",
"getAnnotationAttributeAsBoolean",
"(",
"ModelWithAnnotation",
"model",
",",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"annotation",
",",
"AnnotationAttributeType",
"attribute",
",",
"Boolean",
"defaultValue",
")",
"{",
"return",
... | Gets the annotation attribute as boolean.
@param model the model
@param annotation the annotation
@param attribute the attribute
@param defaultValue the default value
@return the annotation attribute as boolean | [
"Gets",
"the",
"annotation",
"attribute",
"as",
"boolean",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/AnnotationUtility.java#L604-L612 |
106,255 | xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/AnnotationUtility.java | AnnotationUtility.getAnnotationAttribute | static <T> T getAnnotationAttribute(ModelWithAnnotation model, Class<? extends Annotation> annotation, AnnotationAttributeType attribute, T defaultValue,
OnAnnotationAttributeListener<T> listener) {
String attributeResult;
ModelAnnotation item = model.getAnnotation(annotation);
if (item != null) {
attribut... | java | static <T> T getAnnotationAttribute(ModelWithAnnotation model, Class<? extends Annotation> annotation, AnnotationAttributeType attribute, T defaultValue,
OnAnnotationAttributeListener<T> listener) {
String attributeResult;
ModelAnnotation item = model.getAnnotation(annotation);
if (item != null) {
attribut... | [
"static",
"<",
"T",
">",
"T",
"getAnnotationAttribute",
"(",
"ModelWithAnnotation",
"model",
",",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"annotation",
",",
"AnnotationAttributeType",
"attribute",
",",
"T",
"defaultValue",
",",
"OnAnnotationAttributeListener"... | Gets the annotation attribute.
@param <T> the generic type
@param model the model
@param annotation the annotation
@param attribute the attribute
@param defaultValue the default value
@param listener the listener
@return the annotation attribute | [
"Gets",
"the",
"annotation",
"attribute",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/AnnotationUtility.java#L626-L638 |
106,256 | xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/bind/BindTypeContext.java | BindTypeContext.getBindMapperName | public String getBindMapperName(BindTypeContext context, TypeName typeName) {
Converter<String, String> format = CaseFormat.UPPER_CAMEL.converterTo(CaseFormat.LOWER_CAMEL);
TypeName bindMapperName=TypeUtility.mergeTypeNameWithSuffix(typeName,BindTypeBuilder.SUFFIX);
String simpleName=format.convert(TypeUtility.si... | java | public String getBindMapperName(BindTypeContext context, TypeName typeName) {
Converter<String, String> format = CaseFormat.UPPER_CAMEL.converterTo(CaseFormat.LOWER_CAMEL);
TypeName bindMapperName=TypeUtility.mergeTypeNameWithSuffix(typeName,BindTypeBuilder.SUFFIX);
String simpleName=format.convert(TypeUtility.si... | [
"public",
"String",
"getBindMapperName",
"(",
"BindTypeContext",
"context",
",",
"TypeName",
"typeName",
")",
"{",
"Converter",
"<",
"String",
",",
"String",
">",
"format",
"=",
"CaseFormat",
".",
"UPPER_CAMEL",
".",
"converterTo",
"(",
"CaseFormat",
".",
"LOWER... | Gets the bind mapper name.
@param context the context
@param typeName the type name
@return the bind mapper name | [
"Gets",
"the",
"bind",
"mapper",
"name",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/bind/BindTypeContext.java#L70-L93 |
106,257 | xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/InsertRawHelper.java | InsertRawHelper.generateJavaDocReturnType | public static void generateJavaDocReturnType(MethodSpec.Builder methodBuilder, TypeName returnType) {
if (returnType == TypeName.VOID) {
} else if (TypeUtility.isTypeIncludedIn(returnType, Boolean.TYPE, Boolean.class)) {
methodBuilder.addJavadoc("\n");
methodBuilder.addJavadoc("@return <code>true</code> if r... | java | public static void generateJavaDocReturnType(MethodSpec.Builder methodBuilder, TypeName returnType) {
if (returnType == TypeName.VOID) {
} else if (TypeUtility.isTypeIncludedIn(returnType, Boolean.TYPE, Boolean.class)) {
methodBuilder.addJavadoc("\n");
methodBuilder.addJavadoc("@return <code>true</code> if r... | [
"public",
"static",
"void",
"generateJavaDocReturnType",
"(",
"MethodSpec",
".",
"Builder",
"methodBuilder",
",",
"TypeName",
"returnType",
")",
"{",
"if",
"(",
"returnType",
"==",
"TypeName",
".",
"VOID",
")",
"{",
"}",
"else",
"if",
"(",
"TypeUtility",
".",
... | Generate javadoc about return type of method.
@param methodBuilder the method builder
@param returnType the return type | [
"Generate",
"javadoc",
"about",
"return",
"type",
"of",
"method",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/InsertRawHelper.java#L287-L301 |
106,258 | xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/PropertyUtility.java | PropertyUtility.modifierIsAcceptable | static boolean modifierIsAcceptable(Element item) {
// kotlin define properties as final
Object[] values = { Modifier.NATIVE, Modifier.STATIC, /* Modifier.FINAL, */ Modifier.ABSTRACT };
for (Object i : values) {
if (item.getModifiers().contains(i))
return false;
}
return true;
} | java | static boolean modifierIsAcceptable(Element item) {
// kotlin define properties as final
Object[] values = { Modifier.NATIVE, Modifier.STATIC, /* Modifier.FINAL, */ Modifier.ABSTRACT };
for (Object i : values) {
if (item.getModifiers().contains(i))
return false;
}
return true;
} | [
"static",
"boolean",
"modifierIsAcceptable",
"(",
"Element",
"item",
")",
"{",
"// kotlin define properties as final",
"Object",
"[",
"]",
"values",
"=",
"{",
"Modifier",
".",
"NATIVE",
",",
"Modifier",
".",
"STATIC",
",",
"/* Modifier.FINAL, */",
"Modifier",
".",
... | Modifier is acceptable.
@param item
the item
@return true, if successful | [
"Modifier",
"is",
"acceptable",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/PropertyUtility.java#L259-L269 |
106,259 | xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/InsertListBeanHelper.java | InsertListBeanHelper.getConflictAlgorithmType | public static ConflictAlgorithmType getConflictAlgorithmType(SQLiteModelMethod method) {
ModelAnnotation annotation = method.getAnnotation(BindSqlInsert.class);
String value = annotation.getAttribute(AnnotationAttributeType.CONFLICT_ALGORITHM_TYPE);
if (value != null && value.indexOf(".") > -1) {
value = val... | java | public static ConflictAlgorithmType getConflictAlgorithmType(SQLiteModelMethod method) {
ModelAnnotation annotation = method.getAnnotation(BindSqlInsert.class);
String value = annotation.getAttribute(AnnotationAttributeType.CONFLICT_ALGORITHM_TYPE);
if (value != null && value.indexOf(".") > -1) {
value = val... | [
"public",
"static",
"ConflictAlgorithmType",
"getConflictAlgorithmType",
"(",
"SQLiteModelMethod",
"method",
")",
"{",
"ModelAnnotation",
"annotation",
"=",
"method",
".",
"getAnnotation",
"(",
"BindSqlInsert",
".",
"class",
")",
";",
"String",
"value",
"=",
"annotati... | Gets the conflict algorithm type.
@param method
the method
@return the conflict algorithm type | [
"Gets",
"the",
"conflict",
"algorithm",
"type",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/InsertListBeanHelper.java#L272-L283 |
106,260 | tzaeschke/zoodb | src/org/zoodb/tools/ZooXmlImport.java | ZooXmlImport.readln1 | private boolean readln1(String strExpected, String strAlternative) {
String sX = scanner.next();
if (sX.equals(strExpected)) {
return true;
}
if (sX.equals(strAlternative)) {
return false;
}
throw new IllegalStateException("Expected: " + strAlternative + " but got: " + sX);
} | java | private boolean readln1(String strExpected, String strAlternative) {
String sX = scanner.next();
if (sX.equals(strExpected)) {
return true;
}
if (sX.equals(strAlternative)) {
return false;
}
throw new IllegalStateException("Expected: " + strAlternative + " but got: " + sX);
} | [
"private",
"boolean",
"readln1",
"(",
"String",
"strExpected",
",",
"String",
"strAlternative",
")",
"{",
"String",
"sX",
"=",
"scanner",
".",
"next",
"(",
")",
";",
"if",
"(",
"sX",
".",
"equals",
"(",
"strExpected",
")",
")",
"{",
"return",
"true",
"... | Reads '1' token.
@param strExpected
@param strAlternative
@return true if 1st string matches, or false if second matches
@throws IllegalStateException if neither String matches | [
"Reads",
"1",
"token",
"."
] | 058d0ff161a8ee9d53244c433aca97ee9c654410 | https://github.com/tzaeschke/zoodb/blob/058d0ff161a8ee9d53244c433aca97ee9c654410/src/org/zoodb/tools/ZooXmlImport.java#L349-L358 |
106,261 | tzaeschke/zoodb | src/org/zoodb/internal/server/index/FreeSpaceManager.java | FreeSpaceManager.getNextPage | public int getNextPage(int prevPage) {
reportFreePage(prevPage);
if (iter.hasNextULL()) {
//ArrayList<Long> toDelete = new ArrayList<>();
LongLongIndex.LLEntry e = iter.nextULL();
long pageId = e.getKey();
long value = e.getValue();
// do not return pages that are PID_DO_NOT_USE.
while ((va... | java | public int getNextPage(int prevPage) {
reportFreePage(prevPage);
if (iter.hasNextULL()) {
//ArrayList<Long> toDelete = new ArrayList<>();
LongLongIndex.LLEntry e = iter.nextULL();
long pageId = e.getKey();
long value = e.getValue();
// do not return pages that are PID_DO_NOT_USE.
while ((va... | [
"public",
"int",
"getNextPage",
"(",
"int",
"prevPage",
")",
"{",
"reportFreePage",
"(",
"prevPage",
")",
";",
"if",
"(",
"iter",
".",
"hasNextULL",
"(",
")",
")",
"{",
"//ArrayList<Long> toDelete = new ArrayList<>();",
"LongLongIndex",
".",
"LLEntry",
"e",
"=",... | Get a new free page.
@param prevPage Any previous page that is not required anymore, but
can only be re-used in the following transaction.
@return New free page. | [
"Get",
"a",
"new",
"free",
"page",
"."
] | 058d0ff161a8ee9d53244c433aca97ee9c654410 | https://github.com/tzaeschke/zoodb/blob/058d0ff161a8ee9d53244c433aca97ee9c654410/src/org/zoodb/internal/server/index/FreeSpaceManager.java#L173-L219 |
106,262 | tzaeschke/zoodb | src/org/zoodb/internal/util/PoolDDS.java | PoolDDS.offer | public final void offer(DataDeSerializer e) {
//discard if pool is full
lock();
try {
if (count < items.length) {
items[count++] = e;
}
} finally {
unlock();
}
} | java | public final void offer(DataDeSerializer e) {
//discard if pool is full
lock();
try {
if (count < items.length) {
items[count++] = e;
}
} finally {
unlock();
}
} | [
"public",
"final",
"void",
"offer",
"(",
"DataDeSerializer",
"e",
")",
"{",
"//discard if pool is full",
"lock",
"(",
")",
";",
"try",
"{",
"if",
"(",
"count",
"<",
"items",
".",
"length",
")",
"{",
"items",
"[",
"count",
"++",
"]",
"=",
"e",
";",
"}... | Return an object. The object may be discarded if the pool is full.
@param e object to return | [
"Return",
"an",
"object",
".",
"The",
"object",
"may",
"be",
"discarded",
"if",
"the",
"pool",
"is",
"full",
"."
] | 058d0ff161a8ee9d53244c433aca97ee9c654410 | https://github.com/tzaeschke/zoodb/blob/058d0ff161a8ee9d53244c433aca97ee9c654410/src/org/zoodb/internal/util/PoolDDS.java#L73-L83 |
106,263 | tzaeschke/zoodb | src/org/zoodb/internal/query/QueryOptimizer.java | QueryOptimizer.determineIndexToUse | public List<QueryAdvice> determineIndexToUse(QueryTreeNode queryTree) {
List<QueryAdvice> advices = new LinkedList<QueryAdvice>();
List<ZooFieldDef> availableIndices = new LinkedList<ZooFieldDef>();
for (ZooFieldDef f: clsDef.getAllFields()) {
if (f.isIndexed()) {
availableIndices.add(f);
}
}
// st... | java | public List<QueryAdvice> determineIndexToUse(QueryTreeNode queryTree) {
List<QueryAdvice> advices = new LinkedList<QueryAdvice>();
List<ZooFieldDef> availableIndices = new LinkedList<ZooFieldDef>();
for (ZooFieldDef f: clsDef.getAllFields()) {
if (f.isIndexed()) {
availableIndices.add(f);
}
}
// st... | [
"public",
"List",
"<",
"QueryAdvice",
">",
"determineIndexToUse",
"(",
"QueryTreeNode",
"queryTree",
")",
"{",
"List",
"<",
"QueryAdvice",
">",
"advices",
"=",
"new",
"LinkedList",
"<",
"QueryAdvice",
">",
"(",
")",
";",
"List",
"<",
"ZooFieldDef",
">",
"ava... | Determine index to use.
Policy:
1) Check if index are available. If not, do not perform any further query analysis (for now)
Query rewriting may still be able to optimize really stupid queries.
2) Create sub-queries
3) Analyse sub-queries to determine best index to use. Result may imply that index usage is
pointless (... | [
"Determine",
"index",
"to",
"use",
"."
] | 058d0ff161a8ee9d53244c433aca97ee9c654410 | https://github.com/tzaeschke/zoodb/blob/058d0ff161a8ee9d53244c433aca97ee9c654410/src/org/zoodb/internal/query/QueryOptimizer.java#L79-L152 |
106,264 | tzaeschke/zoodb | src/org/zoodb/internal/server/index/AbstractIndexPage.java | AbstractIndexPage.getPagePosition | int getPagePosition(AbstractIndexPage indexPage) {
//We know that the element exists, so we iterate to list.length instead of nEntires
//(which is not available in this context at the moment.
for (int i = 0; i < subPages.length; i++) {
if (subPages[i] == indexPage) {
return i;
}
}
throw DBLogger.ne... | java | int getPagePosition(AbstractIndexPage indexPage) {
//We know that the element exists, so we iterate to list.length instead of nEntires
//(which is not available in this context at the moment.
for (int i = 0; i < subPages.length; i++) {
if (subPages[i] == indexPage) {
return i;
}
}
throw DBLogger.ne... | [
"int",
"getPagePosition",
"(",
"AbstractIndexPage",
"indexPage",
")",
"{",
"//We know that the element exists, so we iterate to list.length instead of nEntires ",
"//(which is not available in this context at the moment.",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"subPage... | This method will fail if called on the first page in the tree. However this should not
happen, because when called, we already have a reference to a previous page.
@param oidIndexPage
@return The position of the given page in the subPage-array with 0 <= pos <= nEntries. | [
"This",
"method",
"will",
"fail",
"if",
"called",
"on",
"the",
"first",
"page",
"in",
"the",
"tree",
".",
"However",
"this",
"should",
"not",
"happen",
"because",
"when",
"called",
"we",
"already",
"have",
"a",
"reference",
"to",
"a",
"previous",
"page",
... | 058d0ff161a8ee9d53244c433aca97ee9c654410 | https://github.com/tzaeschke/zoodb/blob/058d0ff161a8ee9d53244c433aca97ee9c654410/src/org/zoodb/internal/server/index/AbstractIndexPage.java#L407-L417 |
106,265 | tzaeschke/zoodb | src/org/zoodb/internal/Session.java | Session.loadAllInstances | private void loadAllInstances(ZooClassProxy def, boolean subClasses,
MergingIterator<ZooPC> iter, boolean loadFromCache) {
for (Node n: nodes) {
iter.add(n.loadAllInstances(def, loadFromCache));
}
if (subClasses) {
for (ZooClassProxy sub: def.getSubProxies()) {
loadAllInstances(sub, true,... | java | private void loadAllInstances(ZooClassProxy def, boolean subClasses,
MergingIterator<ZooPC> iter, boolean loadFromCache) {
for (Node n: nodes) {
iter.add(n.loadAllInstances(def, loadFromCache));
}
if (subClasses) {
for (ZooClassProxy sub: def.getSubProxies()) {
loadAllInstances(sub, true,... | [
"private",
"void",
"loadAllInstances",
"(",
"ZooClassProxy",
"def",
",",
"boolean",
"subClasses",
",",
"MergingIterator",
"<",
"ZooPC",
">",
"iter",
",",
"boolean",
"loadFromCache",
")",
"{",
"for",
"(",
"Node",
"n",
":",
"nodes",
")",
"{",
"iter",
".",
"a... | This method avoids nesting MergingIterators.
@param def
@param subClasses
@param iter | [
"This",
"method",
"avoids",
"nesting",
"MergingIterators",
"."
] | 058d0ff161a8ee9d53244c433aca97ee9c654410 | https://github.com/tzaeschke/zoodb/blob/058d0ff161a8ee9d53244c433aca97ee9c654410/src/org/zoodb/internal/Session.java#L473-L484 |
106,266 | tzaeschke/zoodb | src/org/zoodb/internal/Session.java | Session.checkObjectForRefresh | private ZooPC checkObjectForRefresh(Object pc) {
if (!(pc instanceof ZooPC)) {
throw DBLogger.newUser("The object is not persistent capable: " + pc.getClass());
}
ZooPC pci = (ZooPC) pc;
if (!pci.jdoZooIsPersistent()) {
return pci;
}
... | java | private ZooPC checkObjectForRefresh(Object pc) {
if (!(pc instanceof ZooPC)) {
throw DBLogger.newUser("The object is not persistent capable: " + pc.getClass());
}
ZooPC pci = (ZooPC) pc;
if (!pci.jdoZooIsPersistent()) {
return pci;
}
... | [
"private",
"ZooPC",
"checkObjectForRefresh",
"(",
"Object",
"pc",
")",
"{",
"if",
"(",
"!",
"(",
"pc",
"instanceof",
"ZooPC",
")",
")",
"{",
"throw",
"DBLogger",
".",
"newUser",
"(",
"\"The object is not persistent capable: \"",
"+",
"pc",
".",
"getClass",
"("... | For refresh, we can ignore things like deletion or transience.
@param pc
@return the refreshed object | [
"For",
"refresh",
"we",
"can",
"ignore",
"things",
"like",
"deletion",
"or",
"transience",
"."
] | 058d0ff161a8ee9d53244c433aca97ee9c654410 | https://github.com/tzaeschke/zoodb/blob/058d0ff161a8ee9d53244c433aca97ee9c654410/src/org/zoodb/internal/Session.java#L651-L665 |
106,267 | tzaeschke/zoodb | src/org/zoodb/jdo/spi/PersistenceCapableImpl.java | PersistenceCapableImpl.jdoReplaceStateManager | @Override
public final void jdoReplaceStateManager (javax.jdo.spi.StateManager sm) {
// throws exception if current sm didn't request the change
if (jdoStateManager != null) {
jdoStateManager = jdoStateManager.replacingStateManager (this, sm);
} else {
// the following will throw an exception if not author... | java | @Override
public final void jdoReplaceStateManager (javax.jdo.spi.StateManager sm) {
// throws exception if current sm didn't request the change
if (jdoStateManager != null) {
jdoStateManager = jdoStateManager.replacingStateManager (this, sm);
} else {
// the following will throw an exception if not author... | [
"@",
"Override",
"public",
"final",
"void",
"jdoReplaceStateManager",
"(",
"javax",
".",
"jdo",
".",
"spi",
".",
"StateManager",
"sm",
")",
"{",
"// throws exception if current sm didn't request the change",
"if",
"(",
"jdoStateManager",
"!=",
"null",
")",
"{",
"jdo... | The generated method asks the current StateManager to approve the change or validates the
caller's authority to set the state. | [
"The",
"generated",
"method",
"asks",
"the",
"current",
"StateManager",
"to",
"approve",
"the",
"change",
"or",
"validates",
"the",
"caller",
"s",
"authority",
"to",
"set",
"the",
"state",
"."
] | 058d0ff161a8ee9d53244c433aca97ee9c654410 | https://github.com/tzaeschke/zoodb/blob/058d0ff161a8ee9d53244c433aca97ee9c654410/src/org/zoodb/jdo/spi/PersistenceCapableImpl.java#L142-L153 |
106,268 | tzaeschke/zoodb | src/org/zoodb/jdo/spi/PersistenceCapableImpl.java | PersistenceCapableImpl.jdoCopyKeyFieldsFromObjectId | @Override
public void jdoCopyKeyFieldsFromObjectId (ObjectIdFieldConsumer fc, Object oid) {
fc.storeIntField (2, ((IntIdentity)oid).getKey());
} | java | @Override
public void jdoCopyKeyFieldsFromObjectId (ObjectIdFieldConsumer fc, Object oid) {
fc.storeIntField (2, ((IntIdentity)oid).getKey());
} | [
"@",
"Override",
"public",
"void",
"jdoCopyKeyFieldsFromObjectId",
"(",
"ObjectIdFieldConsumer",
"fc",
",",
"Object",
"oid",
")",
"{",
"fc",
".",
"storeIntField",
"(",
"2",
",",
"(",
"(",
"IntIdentity",
")",
"oid",
")",
".",
"getKey",
"(",
")",
")",
";",
... | The generated methods copy key fields from the object id instance to the PersistenceCapable
instance or to the ObjectIdFieldConsumer. | [
"The",
"generated",
"methods",
"copy",
"key",
"fields",
"from",
"the",
"object",
"id",
"instance",
"to",
"the",
"PersistenceCapable",
"instance",
"or",
"to",
"the",
"ObjectIdFieldConsumer",
"."
] | 058d0ff161a8ee9d53244c433aca97ee9c654410 | https://github.com/tzaeschke/zoodb/blob/058d0ff161a8ee9d53244c433aca97ee9c654410/src/org/zoodb/jdo/spi/PersistenceCapableImpl.java#L514-L517 |
106,269 | tzaeschke/zoodb | src/org/zoodb/internal/server/SessionManager.java | SessionManager.writeMainPage | private void writeMainPage(int userPage, int oidPage, int schemaPage, int indexPage,
int freeSpaceIndexPage, int pageCount, StorageChannelOutput out, long lastUsedOid,
long txId) {
rootPageID = (rootPageID + 1) % 2;
out.seekPageForWrite(PAGE_TYPE.ROOT_PAGE, rootPages[rootPageID]);
//**********
... | java | private void writeMainPage(int userPage, int oidPage, int schemaPage, int indexPage,
int freeSpaceIndexPage, int pageCount, StorageChannelOutput out, long lastUsedOid,
long txId) {
rootPageID = (rootPageID + 1) % 2;
out.seekPageForWrite(PAGE_TYPE.ROOT_PAGE, rootPages[rootPageID]);
//**********
... | [
"private",
"void",
"writeMainPage",
"(",
"int",
"userPage",
",",
"int",
"oidPage",
",",
"int",
"schemaPage",
",",
"int",
"indexPage",
",",
"int",
"freeSpaceIndexPage",
",",
"int",
"pageCount",
",",
"StorageChannelOutput",
"out",
",",
"long",
"lastUsedOid",
",",
... | Writes the main page.
@param pageCount | [
"Writes",
"the",
"main",
"page",
"."
] | 058d0ff161a8ee9d53244c433aca97ee9c654410 | https://github.com/tzaeschke/zoodb/blob/058d0ff161a8ee9d53244c433aca97ee9c654410/src/org/zoodb/internal/server/SessionManager.java#L165-L195 |
106,270 | tzaeschke/zoodb | src/org/zoodb/jdo/impl/PersistenceManagerImpl.java | PersistenceManagerImpl.refresh | @Override
public void refresh(Object pc) {
DBTracer.logCall(this, pc);
checkOpen();
nativeConnection.refreshObject(pc);
} | java | @Override
public void refresh(Object pc) {
DBTracer.logCall(this, pc);
checkOpen();
nativeConnection.refreshObject(pc);
} | [
"@",
"Override",
"public",
"void",
"refresh",
"(",
"Object",
"pc",
")",
"{",
"DBTracer",
".",
"logCall",
"(",
"this",
",",
"pc",
")",
";",
"checkOpen",
"(",
")",
";",
"nativeConnection",
".",
"refreshObject",
"(",
"pc",
")",
";",
"}"
] | Refreshes and places a ReadLock on the object.
@see PersistenceManager#refresh(java.lang.Object) | [
"Refreshes",
"and",
"places",
"a",
"ReadLock",
"on",
"the",
"object",
"."
] | 058d0ff161a8ee9d53244c433aca97ee9c654410 | https://github.com/tzaeschke/zoodb/blob/058d0ff161a8ee9d53244c433aca97ee9c654410/src/org/zoodb/jdo/impl/PersistenceManagerImpl.java#L247-L252 |
106,271 | tzaeschke/zoodb | src/org/zoodb/jdo/impl/PersistenceManagerImpl.java | PersistenceManagerImpl.refreshAll | @Override
public void refreshAll(Object ... pcs) {
DBTracer.logCall(this, pcs);
checkOpen();
for (Object o: pcs) {
nativeConnection.refreshObject(o);
}
} | java | @Override
public void refreshAll(Object ... pcs) {
DBTracer.logCall(this, pcs);
checkOpen();
for (Object o: pcs) {
nativeConnection.refreshObject(o);
}
} | [
"@",
"Override",
"public",
"void",
"refreshAll",
"(",
"Object",
"...",
"pcs",
")",
"{",
"DBTracer",
".",
"logCall",
"(",
"this",
",",
"pcs",
")",
";",
"checkOpen",
"(",
")",
";",
"for",
"(",
"Object",
"o",
":",
"pcs",
")",
"{",
"nativeConnection",
".... | Refreshes and places a ReadLock on the objects.
@see PersistenceManager#refreshAll(Object...) | [
"Refreshes",
"and",
"places",
"a",
"ReadLock",
"on",
"the",
"objects",
"."
] | 058d0ff161a8ee9d53244c433aca97ee9c654410 | https://github.com/tzaeschke/zoodb/blob/058d0ff161a8ee9d53244c433aca97ee9c654410/src/org/zoodb/jdo/impl/PersistenceManagerImpl.java#L258-L265 |
106,272 | tzaeschke/zoodb | src/org/zoodb/tools/ZooCheckDb.java | ZooCheckDb.main | public static void main(String[] args) {
String dbName;
if (args.length == 0) {
dbName = DB_NAME;
} else {
dbName = args[0];
}
if (!ZooHelper.getDataStoreManager().dbExists(dbName)) {
err.println("ERROR Database not found: " + dbName);
return;
}
out.println("Checking database: " + dbName... | java | public static void main(String[] args) {
String dbName;
if (args.length == 0) {
dbName = DB_NAME;
} else {
dbName = args[0];
}
if (!ZooHelper.getDataStoreManager().dbExists(dbName)) {
err.println("ERROR Database not found: " + dbName);
return;
}
out.println("Checking database: " + dbName... | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"{",
"String",
"dbName",
";",
"if",
"(",
"args",
".",
"length",
"==",
"0",
")",
"{",
"dbName",
"=",
"DB_NAME",
";",
"}",
"else",
"{",
"dbName",
"=",
"args",
"[",
"0",
"]",
... | private static final String DB_NAME = "StackServerFault"; | [
"private",
"static",
"final",
"String",
"DB_NAME",
"=",
"StackServerFault",
";"
] | 058d0ff161a8ee9d53244c433aca97ee9c654410 | https://github.com/tzaeschke/zoodb/blob/058d0ff161a8ee9d53244c433aca97ee9c654410/src/org/zoodb/tools/ZooCheckDb.java#L40-L70 |
106,273 | tzaeschke/zoodb | src/org/zoodb/internal/DataDeSerializer.java | DataDeSerializer.readObject | public ZooPC readObject(int page, int offs, boolean skipIfCached) {
long clsOid = in.startReading(page, offs);
long ts = in.getHeaderTimestamp();
//Read first object:
long oid = in.readLong();
//check cache
ZooPC pc = cache.findCoByOID(oid);
if (skipIfCached && ... | java | public ZooPC readObject(int page, int offs, boolean skipIfCached) {
long clsOid = in.startReading(page, offs);
long ts = in.getHeaderTimestamp();
//Read first object:
long oid = in.readLong();
//check cache
ZooPC pc = cache.findCoByOID(oid);
if (skipIfCached && ... | [
"public",
"ZooPC",
"readObject",
"(",
"int",
"page",
",",
"int",
"offs",
",",
"boolean",
"skipIfCached",
")",
"{",
"long",
"clsOid",
"=",
"in",
".",
"startReading",
"(",
"page",
",",
"offs",
")",
";",
"long",
"ts",
"=",
"in",
".",
"getHeaderTimestamp",
... | This method returns an object that is read from the input
stream.
@param page page id
@param offs offset in page
@param skipIfCached Set 'true' to skip objects that are already in the cache
@return The read object. | [
"This",
"method",
"returns",
"an",
"object",
"that",
"is",
"read",
"from",
"the",
"input",
"stream",
"."
] | 058d0ff161a8ee9d53244c433aca97ee9c654410 | https://github.com/tzaeschke/zoodb/blob/058d0ff161a8ee9d53244c433aca97ee9c654410/src/org/zoodb/internal/DataDeSerializer.java#L152-L194 |
106,274 | tzaeschke/zoodb | src/org/zoodb/internal/query/QueryMergingIterator.java | QueryMergingIterator.addColl | public void addColl(Collection<E> collection) {
if (current == null) {
current = collection.iterator();
} else {
collections.add(collection);
}
} | java | public void addColl(Collection<E> collection) {
if (current == null) {
current = collection.iterator();
} else {
collections.add(collection);
}
} | [
"public",
"void",
"addColl",
"(",
"Collection",
"<",
"E",
">",
"collection",
")",
"{",
"if",
"(",
"current",
"==",
"null",
")",
"{",
"current",
"=",
"collection",
".",
"iterator",
"(",
")",
";",
"}",
"else",
"{",
"collections",
".",
"add",
"(",
"coll... | Adds a collection to the merged iterator. The iterator of the
collection is only requested after other iterators are exhausted.
This can help avoiding concurrent modification exceptions.
@param collection The collection that should be added to the iterator. | [
"Adds",
"a",
"collection",
"to",
"the",
"merged",
"iterator",
".",
"The",
"iterator",
"of",
"the",
"collection",
"is",
"only",
"requested",
"after",
"other",
"iterators",
"are",
"exhausted",
".",
"This",
"can",
"help",
"avoiding",
"concurrent",
"modification",
... | 058d0ff161a8ee9d53244c433aca97ee9c654410 | https://github.com/tzaeschke/zoodb/blob/058d0ff161a8ee9d53244c433aca97ee9c654410/src/org/zoodb/internal/query/QueryMergingIterator.java#L99-L105 |
106,275 | tzaeschke/zoodb | src/org/zoodb/internal/OidBuffer.java | OidBuffer.ensureValidity | public void ensureValidity(long oid) {
if (oids == null) {
return;
}
if (oid >= oids[oids.length-1]) {
nextValidOidPos = -1;
return;
}
while (oid >= oids[nextValidOidPos]) {
nextValidOidPos++;
}
} | java | public void ensureValidity(long oid) {
if (oids == null) {
return;
}
if (oid >= oids[oids.length-1]) {
nextValidOidPos = -1;
return;
}
while (oid >= oids[nextValidOidPos]) {
nextValidOidPos++;
}
} | [
"public",
"void",
"ensureValidity",
"(",
"long",
"oid",
")",
"{",
"if",
"(",
"oids",
"==",
"null",
")",
"{",
"return",
";",
"}",
"if",
"(",
"oid",
">=",
"oids",
"[",
"oids",
".",
"length",
"-",
"1",
"]",
")",
"{",
"nextValidOidPos",
"=",
"-",
"1"... | This needs to be called when users provide their own OIDs. The OID buffer needs to ensure
that it will never return an OID that has been previously used by a user.
@param oid OID to check | [
"This",
"needs",
"to",
"be",
"called",
"when",
"users",
"provide",
"their",
"own",
"OIDs",
".",
"The",
"OID",
"buffer",
"needs",
"to",
"ensure",
"that",
"it",
"will",
"never",
"return",
"an",
"OID",
"that",
"has",
"been",
"previously",
"used",
"by",
"a",... | 058d0ff161a8ee9d53244c433aca97ee9c654410 | https://github.com/tzaeschke/zoodb/blob/058d0ff161a8ee9d53244c433aca97ee9c654410/src/org/zoodb/internal/OidBuffer.java#L75-L86 |
106,276 | tzaeschke/zoodb | src/org/zoodb/internal/ObjectGraphTraverser.java | ObjectGraphTraverser.traverse | public final void traverse() {
//We have to check for && because 'traversalRequired' is not triggered by new objects,
//but new objects may have new objects referenced that are not marked as persistent.
//See issue #57.
if (!traversalRequired && !cache.hasDirtyPojos()) {
//shortcut
retur... | java | public final void traverse() {
//We have to check for && because 'traversalRequired' is not triggered by new objects,
//but new objects may have new objects referenced that are not marked as persistent.
//See issue #57.
if (!traversalRequired && !cache.hasDirtyPojos()) {
//shortcut
retur... | [
"public",
"final",
"void",
"traverse",
"(",
")",
"{",
"//We have to check for && because 'traversalRequired' is not triggered by new objects,",
"//but new objects may have new objects referenced that are not marked as persistent.",
"//See issue #57.",
"if",
"(",
"!",
"traversalRequired",
... | This class is only public so it can be accessed by the test harness.
Please do not use. | [
"This",
"class",
"is",
"only",
"public",
"so",
"it",
"can",
"be",
"accessed",
"by",
"the",
"test",
"harness",
".",
"Please",
"do",
"not",
"use",
"."
] | 058d0ff161a8ee9d53244c433aca97ee9c654410 | https://github.com/tzaeschke/zoodb/blob/058d0ff161a8ee9d53244c433aca97ee9c654410/src/org/zoodb/internal/ObjectGraphTraverser.java#L167-L200 |
106,277 | tzaeschke/zoodb | src/org/zoodb/internal/ObjectGraphTraverser.java | ObjectGraphTraverser.traverse | public final void traverse(ZooPC pc) {
try {
traverseObject(pc);
traverseWorkList();
} finally {
workList.clear();
toBecomePersistent.clear();
//We have to clear the seenObjects here, see also issue #58.
seenObjects.clear();
}
} | java | public final void traverse(ZooPC pc) {
try {
traverseObject(pc);
traverseWorkList();
} finally {
workList.clear();
toBecomePersistent.clear();
//We have to clear the seenObjects here, see also issue #58.
seenObjects.clear();
}
} | [
"public",
"final",
"void",
"traverse",
"(",
"ZooPC",
"pc",
")",
"{",
"try",
"{",
"traverseObject",
"(",
"pc",
")",
";",
"traverseWorkList",
"(",
")",
";",
"}",
"finally",
"{",
"workList",
".",
"clear",
"(",
")",
";",
"toBecomePersistent",
".",
"clear",
... | This can be used to enforce traversal of an object even if it is PERSITENT_CLEAN.
This can be necessary for objects that transition from DETACHED_CLEAN
to PERSITENT_CLEAN and whose children need to make this transition transitively.
@param pc Object to check. | [
"This",
"can",
"be",
"used",
"to",
"enforce",
"traversal",
"of",
"an",
"object",
"even",
"if",
"it",
"is",
"PERSITENT_CLEAN",
".",
"This",
"can",
"be",
"necessary",
"for",
"objects",
"that",
"transition",
"from",
"DETACHED_CLEAN",
"to",
"PERSITENT_CLEAN",
"and... | 058d0ff161a8ee9d53244c433aca97ee9c654410 | https://github.com/tzaeschke/zoodb/blob/058d0ff161a8ee9d53244c433aca97ee9c654410/src/org/zoodb/internal/ObjectGraphTraverser.java#L208-L218 |
106,278 | tzaeschke/zoodb | src/org/zoodb/internal/ObjectGraphTraverser.java | ObjectGraphTraverser.doPersistentContainer | @SuppressWarnings("rawtypes")
private final void doPersistentContainer(Object container) {
if (container instanceof DBArrayList) {
doCollection((DBArrayList)container);
} else if (container instanceof DBLargeVector) {
// doEnumeration(((DBLargeVector)container).elements(), contai... | java | @SuppressWarnings("rawtypes")
private final void doPersistentContainer(Object container) {
if (container instanceof DBArrayList) {
doCollection((DBArrayList)container);
} else if (container instanceof DBLargeVector) {
// doEnumeration(((DBLargeVector)container).elements(), contai... | [
"@",
"SuppressWarnings",
"(",
"\"rawtypes\"",
")",
"private",
"final",
"void",
"doPersistentContainer",
"(",
"Object",
"container",
")",
"{",
"if",
"(",
"container",
"instanceof",
"DBArrayList",
")",
"{",
"doCollection",
"(",
"(",
"DBArrayList",
")",
"container",
... | Handles persistent Collection classes. | [
"Handles",
"persistent",
"Collection",
"classes",
"."
] | 058d0ff161a8ee9d53244c433aca97ee9c654410 | https://github.com/tzaeschke/zoodb/blob/058d0ff161a8ee9d53244c433aca97ee9c654410/src/org/zoodb/internal/ObjectGraphTraverser.java#L366-L382 |
106,279 | tzaeschke/zoodb | src/org/zoodb/internal/ObjectGraphTraverser.java | ObjectGraphTraverser.getFields | private final Field[] getFields (Class<? extends Object> cls) {
Field[] ret = SEEN_CLASSES.get(cls);
if (ret != null) {
return ret;
}
List<Field> retL = new ArrayList<Field>();
for (Field f: cls.getDeclaredFields ()) {
if (!isSimpleType(f)) {
retL.add... | java | private final Field[] getFields (Class<? extends Object> cls) {
Field[] ret = SEEN_CLASSES.get(cls);
if (ret != null) {
return ret;
}
List<Field> retL = new ArrayList<Field>();
for (Field f: cls.getDeclaredFields ()) {
if (!isSimpleType(f)) {
retL.add... | [
"private",
"final",
"Field",
"[",
"]",
"getFields",
"(",
"Class",
"<",
"?",
"extends",
"Object",
">",
"cls",
")",
"{",
"Field",
"[",
"]",
"ret",
"=",
"SEEN_CLASSES",
".",
"get",
"(",
"cls",
")",
";",
"if",
"(",
"ret",
"!=",
"null",
")",
"{",
"ret... | Returns a List containing all of the Field objects for the given class.
The fields include all public and private fields from the given class
and its super classes.
@param c Class object
@return Returns list of interesting fields | [
"Returns",
"a",
"List",
"containing",
"all",
"of",
"the",
"Field",
"objects",
"for",
"the",
"given",
"class",
".",
"The",
"fields",
"include",
"all",
"public",
"and",
"private",
"fields",
"from",
"the",
"given",
"class",
"and",
"its",
"super",
"classes",
"... | 058d0ff161a8ee9d53244c433aca97ee9c654410 | https://github.com/tzaeschke/zoodb/blob/058d0ff161a8ee9d53244c433aca97ee9c654410/src/org/zoodb/internal/ObjectGraphTraverser.java#L411-L435 |
106,280 | tzaeschke/zoodb | src/org/zoodb/internal/ZooFieldDef.java | ZooFieldDef.create | public static ZooFieldDef create(ZooClassDef declaringType, String fieldName,
ZooClassDef fieldType, int arrayDim) {
String typeName = fieldType.getClassName();
JdoType jdoType;
if (arrayDim > 0) {
jdoType = JdoType.ARRAY;
} else {
jdoType = JdoType.REFERENCE;
}
long fieldOid = decla... | java | public static ZooFieldDef create(ZooClassDef declaringType, String fieldName,
ZooClassDef fieldType, int arrayDim) {
String typeName = fieldType.getClassName();
JdoType jdoType;
if (arrayDim > 0) {
jdoType = JdoType.ARRAY;
} else {
jdoType = JdoType.REFERENCE;
}
long fieldOid = decla... | [
"public",
"static",
"ZooFieldDef",
"create",
"(",
"ZooClassDef",
"declaringType",
",",
"String",
"fieldName",
",",
"ZooClassDef",
"fieldType",
",",
"int",
"arrayDim",
")",
"{",
"String",
"typeName",
"=",
"fieldType",
".",
"getClassName",
"(",
")",
";",
"JdoType"... | Creates references and reference arrays to persistent classes.
@param declaringType the type that contains the field
@param fieldName the name of the field
@param fieldType The ZooClassDef of the target class of a reference.
@param arrayDim the dimensionality of the array (if the field is an array)
@return ZooFieldDef | [
"Creates",
"references",
"and",
"reference",
"arrays",
"to",
"persistent",
"classes",
"."
] | 058d0ff161a8ee9d53244c433aca97ee9c654410 | https://github.com/tzaeschke/zoodb/blob/058d0ff161a8ee9d53244c433aca97ee9c654410/src/org/zoodb/internal/ZooFieldDef.java#L267-L280 |
106,281 | tzaeschke/zoodb | examples/org/zoodb/jdo/ex3/Example3Main.java | Example3Main.queryForCoursesByTeacher | @SuppressWarnings("unchecked")
private void queryForCoursesByTeacher(String name) {
System.out.println(">> Query for courses by teacher " + name + " returned:");
//using reference in query
Query q = pm.newQuery(Course.class, "teacher.name == '" + name + "'");
Collection<Course> courses = (Collection<Course>)q.... | java | @SuppressWarnings("unchecked")
private void queryForCoursesByTeacher(String name) {
System.out.println(">> Query for courses by teacher " + name + " returned:");
//using reference in query
Query q = pm.newQuery(Course.class, "teacher.name == '" + name + "'");
Collection<Course> courses = (Collection<Course>)q.... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"void",
"queryForCoursesByTeacher",
"(",
"String",
"name",
")",
"{",
"System",
".",
"out",
".",
"println",
"(",
"\">> Query for courses by teacher \"",
"+",
"name",
"+",
"\" returned:\"",
")",
";",
"//... | Example for a path query on Course.teacher.name == myName.
@param name | [
"Example",
"for",
"a",
"path",
"query",
"on",
"Course",
".",
"teacher",
".",
"name",
"==",
"myName",
"."
] | 058d0ff161a8ee9d53244c433aca97ee9c654410 | https://github.com/tzaeschke/zoodb/blob/058d0ff161a8ee9d53244c433aca97ee9c654410/examples/org/zoodb/jdo/ex3/Example3Main.java#L142-L151 |
106,282 | tzaeschke/zoodb | examples/org/zoodb/jdo/ex2/Example2Main.java | Example2Main.queryForCoursesWithXStudents | @SuppressWarnings("unchecked")
private void queryForCoursesWithXStudents(int studentCount) {
System.out.println(">> Query for courses with " + studentCount + " students:");
//using Java method in query
Query q = pm.newQuery(Course.class, "students.size() == " + studentCount + "");
Collection<Course> courses = ... | java | @SuppressWarnings("unchecked")
private void queryForCoursesWithXStudents(int studentCount) {
System.out.println(">> Query for courses with " + studentCount + " students:");
//using Java method in query
Query q = pm.newQuery(Course.class, "students.size() == " + studentCount + "");
Collection<Course> courses = ... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"void",
"queryForCoursesWithXStudents",
"(",
"int",
"studentCount",
")",
"{",
"System",
".",
"out",
".",
"println",
"(",
"\">> Query for courses with \"",
"+",
"studentCount",
"+",
"\" students:\"",
")",
... | This example demonstrates how many Java methods of Java SE classes can
be used in queries. Not that not all methods can be used. | [
"This",
"example",
"demonstrates",
"how",
"many",
"Java",
"methods",
"of",
"Java",
"SE",
"classes",
"can",
"be",
"used",
"in",
"queries",
".",
"Not",
"that",
"not",
"all",
"methods",
"can",
"be",
"used",
"."
] | 058d0ff161a8ee9d53244c433aca97ee9c654410 | https://github.com/tzaeschke/zoodb/blob/058d0ff161a8ee9d53244c433aca97ee9c654410/examples/org/zoodb/jdo/ex2/Example2Main.java#L176-L185 |
106,283 | tzaeschke/zoodb | examples/org/zoodb/jdo/ex2/Example2Main.java | Example2Main.queryForCoursesWithTeachersWithFirstAndLastName | @SuppressWarnings("unchecked")
private void queryForCoursesWithTeachersWithFirstAndLastName() {
System.out.println(">> Query for courses whose teacher have a frist and last name:");
//using Java method in query
Query q = pm.newQuery(Course.class, "teacher.name.indexOf(' ') >= 1");
Collection<Course> courses = ... | java | @SuppressWarnings("unchecked")
private void queryForCoursesWithTeachersWithFirstAndLastName() {
System.out.println(">> Query for courses whose teacher have a frist and last name:");
//using Java method in query
Query q = pm.newQuery(Course.class, "teacher.name.indexOf(' ') >= 1");
Collection<Course> courses = ... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"void",
"queryForCoursesWithTeachersWithFirstAndLastName",
"(",
")",
"{",
"System",
".",
"out",
".",
"println",
"(",
"\">> Query for courses whose teacher have a frist and last name:\"",
")",
";",
"//using Java me... | This example combines a path query with a Java method call on the String class. | [
"This",
"example",
"combines",
"a",
"path",
"query",
"with",
"a",
"Java",
"method",
"call",
"on",
"the",
"String",
"class",
"."
] | 058d0ff161a8ee9d53244c433aca97ee9c654410 | https://github.com/tzaeschke/zoodb/blob/058d0ff161a8ee9d53244c433aca97ee9c654410/examples/org/zoodb/jdo/ex2/Example2Main.java#L191-L201 |
106,284 | tzaeschke/zoodb | src/org/zoodb/internal/server/DiskAccessOneFile.java | DiskAccessOneFile.readObject | @Override
public ZooPC readObject(DataDeSerializer dds, long oid) {
FilePos oie = oidIndex.findOid(oid);
if (oie == null) {
throw DBLogger.newObjectNotFoundException("OID not found: " + Util.oidToString(oid));
}
return dds.readObject(oie.getPage(), oie.getOffs(), false);
} | java | @Override
public ZooPC readObject(DataDeSerializer dds, long oid) {
FilePos oie = oidIndex.findOid(oid);
if (oie == null) {
throw DBLogger.newObjectNotFoundException("OID not found: " + Util.oidToString(oid));
}
return dds.readObject(oie.getPage(), oie.getOffs(), false);
} | [
"@",
"Override",
"public",
"ZooPC",
"readObject",
"(",
"DataDeSerializer",
"dds",
",",
"long",
"oid",
")",
"{",
"FilePos",
"oie",
"=",
"oidIndex",
".",
"findOid",
"(",
"oid",
")",
";",
"if",
"(",
"oie",
"==",
"null",
")",
"{",
"throw",
"DBLogger",
".",... | Locate an object. This version allows providing a data de-serializer. This will be handy
later if we want to implement some concurrency, which requires using multiple of the
stateful DeSerializers.
@param dds DataDeSerializer
@param oid Object ID
@return Path name of the object (later: position of obj) | [
"Locate",
"an",
"object",
".",
"This",
"version",
"allows",
"providing",
"a",
"data",
"de",
"-",
"serializer",
".",
"This",
"will",
"be",
"handy",
"later",
"if",
"we",
"want",
"to",
"implement",
"some",
"concurrency",
"which",
"requires",
"using",
"multiple"... | 058d0ff161a8ee9d53244c433aca97ee9c654410 | https://github.com/tzaeschke/zoodb/blob/058d0ff161a8ee9d53244c433aca97ee9c654410/src/org/zoodb/internal/server/DiskAccessOneFile.java#L391-L399 |
106,285 | tzaeschke/zoodb | src/org/zoodb/internal/server/DiskAccessOneFile.java | DiskAccessOneFile.defineIndex | @Override
public void defineIndex(ZooClassDef def, ZooFieldDef field, boolean isUnique) {
SchemaIndexEntry se = schemaIndex.getSchema(def);
LongLongIndex fieldInd = se.defineIndex(field, isUnique);
//fill index with existing objects
PagedPosIndex ind = se.getObjectIndexLatestSchemaVersion();
PagedPosIndex... | java | @Override
public void defineIndex(ZooClassDef def, ZooFieldDef field, boolean isUnique) {
SchemaIndexEntry se = schemaIndex.getSchema(def);
LongLongIndex fieldInd = se.defineIndex(field, isUnique);
//fill index with existing objects
PagedPosIndex ind = se.getObjectIndexLatestSchemaVersion();
PagedPosIndex... | [
"@",
"Override",
"public",
"void",
"defineIndex",
"(",
"ZooClassDef",
"def",
",",
"ZooFieldDef",
"field",
",",
"boolean",
"isUnique",
")",
"{",
"SchemaIndexEntry",
"se",
"=",
"schemaIndex",
".",
"getSchema",
"(",
"def",
")",
";",
"LongLongIndex",
"fieldInd",
"... | Defines an index and populates it. All objects are put into the cache. This is not
necessarily useful, but it is a one-off operation. Otherwise we would need a special
purpose implementation of the deserializer, which would have the need for a cache removed. | [
"Defines",
"an",
"index",
"and",
"populates",
"it",
".",
"All",
"objects",
"are",
"put",
"into",
"the",
"cache",
".",
"This",
"is",
"not",
"necessarily",
"useful",
"but",
"it",
"is",
"a",
"one",
"-",
"off",
"operation",
".",
"Otherwise",
"we",
"would",
... | 058d0ff161a8ee9d53244c433aca97ee9c654410 | https://github.com/tzaeschke/zoodb/blob/058d0ff161a8ee9d53244c433aca97ee9c654410/src/org/zoodb/internal/server/DiskAccessOneFile.java#L609-L647 |
106,286 | tzaeschke/zoodb | src/org/zoodb/internal/server/DiskAccessOneFile.java | DiskAccessOneFile.getObjectClass | @Override
public long getObjectClass(long oid) {
FilePos oie = oidIndex.findOid(oid);
if (oie == null) {
throw DBLogger.newObjectNotFoundException("OID not found: " + Util.oidToString(oid));
}
try {
fileInAP.seekPage(PAGE_TYPE.DATA, oie.getPage(), oie.getOffs());
return DataDeSerializerNoClass.getC... | java | @Override
public long getObjectClass(long oid) {
FilePos oie = oidIndex.findOid(oid);
if (oie == null) {
throw DBLogger.newObjectNotFoundException("OID not found: " + Util.oidToString(oid));
}
try {
fileInAP.seekPage(PAGE_TYPE.DATA, oie.getPage(), oie.getOffs());
return DataDeSerializerNoClass.getC... | [
"@",
"Override",
"public",
"long",
"getObjectClass",
"(",
"long",
"oid",
")",
"{",
"FilePos",
"oie",
"=",
"oidIndex",
".",
"findOid",
"(",
"oid",
")",
";",
"if",
"(",
"oie",
"==",
"null",
")",
"{",
"throw",
"DBLogger",
".",
"newObjectNotFoundException",
... | Get the class of a given object. | [
"Get",
"the",
"class",
"of",
"a",
"given",
"object",
"."
] | 058d0ff161a8ee9d53244c433aca97ee9c654410 | https://github.com/tzaeschke/zoodb/blob/058d0ff161a8ee9d53244c433aca97ee9c654410/src/org/zoodb/internal/server/DiskAccessOneFile.java#L658-L672 |
106,287 | tzaeschke/zoodb | src/org/zoodb/internal/util/DBLogger.java | DBLogger.newFatalDataStore | public static RuntimeException newFatalDataStore(String msg, Throwable t) {
return newEx(FATAL_DATA_STORE_EXCEPTION, msg, t);
} | java | public static RuntimeException newFatalDataStore(String msg, Throwable t) {
return newEx(FATAL_DATA_STORE_EXCEPTION, msg, t);
} | [
"public",
"static",
"RuntimeException",
"newFatalDataStore",
"(",
"String",
"msg",
",",
"Throwable",
"t",
")",
"{",
"return",
"newEx",
"(",
"FATAL_DATA_STORE_EXCEPTION",
",",
"msg",
",",
"t",
")",
";",
"}"
] | THese always result in the session being closed!
@param msg The error message
@param t The Throwable to report
@return Fatal data store exception. | [
"THese",
"always",
"result",
"in",
"the",
"session",
"being",
"closed!"
] | 058d0ff161a8ee9d53244c433aca97ee9c654410 | https://github.com/tzaeschke/zoodb/blob/058d0ff161a8ee9d53244c433aca97ee9c654410/src/org/zoodb/internal/util/DBLogger.java#L171-L173 |
106,288 | tzaeschke/zoodb | src/org/zoodb/internal/server/index/AbstractPagedIndex.java | AbstractPagedIndex.preallocatePagesForWriteMap | final void preallocatePagesForWriteMap(Map<AbstractIndexPage, Integer> map,
FreeSpaceManager fsm) {
getRoot().createWriteMap(map, fsm);
} | java | final void preallocatePagesForWriteMap(Map<AbstractIndexPage, Integer> map,
FreeSpaceManager fsm) {
getRoot().createWriteMap(map, fsm);
} | [
"final",
"void",
"preallocatePagesForWriteMap",
"(",
"Map",
"<",
"AbstractIndexPage",
",",
"Integer",
">",
"map",
",",
"FreeSpaceManager",
"fsm",
")",
"{",
"getRoot",
"(",
")",
".",
"createWriteMap",
"(",
"map",
",",
"fsm",
")",
";",
"}"
] | Method to preallocate pages for a write command.
@param map | [
"Method",
"to",
"preallocate",
"pages",
"for",
"a",
"write",
"command",
"."
] | 058d0ff161a8ee9d53244c433aca97ee9c654410 | https://github.com/tzaeschke/zoodb/blob/058d0ff161a8ee9d53244c433aca97ee9c654410/src/org/zoodb/internal/server/index/AbstractPagedIndex.java#L144-L147 |
106,289 | tzaeschke/zoodb | src/org/zoodb/internal/server/index/AbstractPagedIndex.java | AbstractPagedIndex.writeToPreallocated | final int writeToPreallocated(StorageChannelOutput out, Map<AbstractIndexPage, Integer> map) {
return getRoot().writeToPreallocated(out, map);
} | java | final int writeToPreallocated(StorageChannelOutput out, Map<AbstractIndexPage, Integer> map) {
return getRoot().writeToPreallocated(out, map);
} | [
"final",
"int",
"writeToPreallocated",
"(",
"StorageChannelOutput",
"out",
",",
"Map",
"<",
"AbstractIndexPage",
",",
"Integer",
">",
"map",
")",
"{",
"return",
"getRoot",
"(",
")",
".",
"writeToPreallocated",
"(",
"out",
",",
"map",
")",
";",
"}"
] | Special write method that uses only pre-allocated pages.
@param map
@return the root page Id. | [
"Special",
"write",
"method",
"that",
"uses",
"only",
"pre",
"-",
"allocated",
"pages",
"."
] | 058d0ff161a8ee9d53244c433aca97ee9c654410 | https://github.com/tzaeschke/zoodb/blob/058d0ff161a8ee9d53244c433aca97ee9c654410/src/org/zoodb/internal/server/index/AbstractPagedIndex.java#L154-L156 |
106,290 | tzaeschke/zoodb | src/org/zoodb/internal/GenericObject.java | GenericObject.newEmptyInstance | static GenericObject newEmptyInstance(ZooClassDef def, AbstractCache cache) {
long oid = def.getProvidedContext().getNode().getOidBuffer().allocateOid();
return newEmptyInstance(oid, def, cache);
} | java | static GenericObject newEmptyInstance(ZooClassDef def, AbstractCache cache) {
long oid = def.getProvidedContext().getNode().getOidBuffer().allocateOid();
return newEmptyInstance(oid, def, cache);
} | [
"static",
"GenericObject",
"newEmptyInstance",
"(",
"ZooClassDef",
"def",
",",
"AbstractCache",
"cache",
")",
"{",
"long",
"oid",
"=",
"def",
".",
"getProvidedContext",
"(",
")",
".",
"getNode",
"(",
")",
".",
"getOidBuffer",
"(",
")",
".",
"allocateOid",
"(... | Creates new instances.
@param def
@return A new empty generic object. | [
"Creates",
"new",
"instances",
"."
] | 058d0ff161a8ee9d53244c433aca97ee9c654410 | https://github.com/tzaeschke/zoodb/blob/058d0ff161a8ee9d53244c433aca97ee9c654410/src/org/zoodb/internal/GenericObject.java#L135-L138 |
106,291 | tzaeschke/zoodb | src/org/zoodb/internal/GenericObject.java | GenericObject.evolve | public void evolve(SchemaOperation op) {
//TODO this is horrible!!!
ArrayList<Object> fV = new ArrayList<Object>(Arrays.asList(fixedValues));
ArrayList<Object> vV = new ArrayList<Object>(Arrays.asList(variableValues));
//TODO resize only once to correct size
if (op instanceof SchemaOperation.SchemaFieldDef... | java | public void evolve(SchemaOperation op) {
//TODO this is horrible!!!
ArrayList<Object> fV = new ArrayList<Object>(Arrays.asList(fixedValues));
ArrayList<Object> vV = new ArrayList<Object>(Arrays.asList(variableValues));
//TODO resize only once to correct size
if (op instanceof SchemaOperation.SchemaFieldDef... | [
"public",
"void",
"evolve",
"(",
"SchemaOperation",
"op",
")",
"{",
"//TODO this is horrible!!!",
"ArrayList",
"<",
"Object",
">",
"fV",
"=",
"new",
"ArrayList",
"<",
"Object",
">",
"(",
"Arrays",
".",
"asList",
"(",
"fixedValues",
")",
")",
";",
"ArrayList"... | Schema evolution of in-memory objects, operation by operation.
@param op Schema operation object | [
"Schema",
"evolution",
"of",
"in",
"-",
"memory",
"objects",
"operation",
"by",
"operation",
"."
] | 058d0ff161a8ee9d53244c433aca97ee9c654410 | https://github.com/tzaeschke/zoodb/blob/058d0ff161a8ee9d53244c433aca97ee9c654410/src/org/zoodb/internal/GenericObject.java#L315-L335 |
106,292 | tzaeschke/zoodb | src/org/zoodb/internal/GenericObject.java | GenericObject.setDbCollection | public void setDbCollection(Object collection) {
if (collection != null) {
dbCollectionData = collection;
isDbCollection = true;
} else {
dbCollectionData = null;
isDbCollection = false;
}
} | java | public void setDbCollection(Object collection) {
if (collection != null) {
dbCollectionData = collection;
isDbCollection = true;
} else {
dbCollectionData = null;
isDbCollection = false;
}
} | [
"public",
"void",
"setDbCollection",
"(",
"Object",
"collection",
")",
"{",
"if",
"(",
"collection",
"!=",
"null",
")",
"{",
"dbCollectionData",
"=",
"collection",
";",
"isDbCollection",
"=",
"true",
";",
"}",
"else",
"{",
"dbCollectionData",
"=",
"null",
";... | This is used to represent DBCollection objects as GenericObjects.
@param collection collection object | [
"This",
"is",
"used",
"to",
"represent",
"DBCollection",
"objects",
"as",
"GenericObjects",
"."
] | 058d0ff161a8ee9d53244c433aca97ee9c654410 | https://github.com/tzaeschke/zoodb/blob/058d0ff161a8ee9d53244c433aca97ee9c654410/src/org/zoodb/internal/GenericObject.java#L390-L399 |
106,293 | tzaeschke/zoodb | src/org/zoodb/internal/GenericObject.java | GenericObject.verifyPcNotDirty | void verifyPcNotDirty() {
if (handle == null || handle.internalGetPCI() == null ||
!handle.internalGetPCI().jdoZooIsDirty()) {
ZooPC pc = jdoZooGetContext().getSession().internalGetCache().findCoByOID(
jdoZooGetOid());
if (pc == null || !pc.jdoZooIsDirty()) {
return;
}
}
throw DBLogger.newU... | java | void verifyPcNotDirty() {
if (handle == null || handle.internalGetPCI() == null ||
!handle.internalGetPCI().jdoZooIsDirty()) {
ZooPC pc = jdoZooGetContext().getSession().internalGetCache().findCoByOID(
jdoZooGetOid());
if (pc == null || !pc.jdoZooIsDirty()) {
return;
}
}
throw DBLogger.newU... | [
"void",
"verifyPcNotDirty",
"(",
")",
"{",
"if",
"(",
"handle",
"==",
"null",
"||",
"handle",
".",
"internalGetPCI",
"(",
")",
"==",
"null",
"||",
"!",
"handle",
".",
"internalGetPCI",
"(",
")",
".",
"jdoZooIsDirty",
"(",
")",
")",
"{",
"ZooPC",
"pc",
... | This method verifies that this GO has no PCI representation or that the PCI representation
is not dirty or new.
Otherwise it will throw an exception in order to prevent the dirty state of the GO and the
PC to result in conflicting updates in the database. | [
"This",
"method",
"verifies",
"that",
"this",
"GO",
"has",
"no",
"PCI",
"representation",
"or",
"that",
"the",
"PCI",
"representation",
"is",
"not",
"dirty",
"or",
"new",
".",
"Otherwise",
"it",
"will",
"throw",
"an",
"exception",
"in",
"order",
"to",
"pre... | 058d0ff161a8ee9d53244c433aca97ee9c654410 | https://github.com/tzaeschke/zoodb/blob/058d0ff161a8ee9d53244c433aca97ee9c654410/src/org/zoodb/internal/GenericObject.java#L438-L450 |
106,294 | tzaeschke/zoodb | src/org/zoodb/internal/util/BucketStack.java | BucketStack.pop | public E pop() {
modCount++;
if (size == 0) {
throw new NoSuchElementException();
}
size--;
if (cntInBucket == 1) {
cntInBucket = bucketSize;
return buckets.removeLast()[0];
}
return buckets.getLast()[--cntInBucket];
} | java | public E pop() {
modCount++;
if (size == 0) {
throw new NoSuchElementException();
}
size--;
if (cntInBucket == 1) {
cntInBucket = bucketSize;
return buckets.removeLast()[0];
}
return buckets.getLast()[--cntInBucket];
} | [
"public",
"E",
"pop",
"(",
")",
"{",
"modCount",
"++",
";",
"if",
"(",
"size",
"==",
"0",
")",
"{",
"throw",
"new",
"NoSuchElementException",
"(",
")",
";",
"}",
"size",
"--",
";",
"if",
"(",
"cntInBucket",
"==",
"1",
")",
"{",
"cntInBucket",
"=",
... | Removes the element at the specified position in this list.
Only the last element in the list can be removed.
@return the element that was removed from the list
@throws NoSuchElementException if no elements remain | [
"Removes",
"the",
"element",
"at",
"the",
"specified",
"position",
"in",
"this",
"list",
".",
"Only",
"the",
"last",
"element",
"in",
"the",
"list",
"can",
"be",
"removed",
"."
] | 058d0ff161a8ee9d53244c433aca97ee9c654410 | https://github.com/tzaeschke/zoodb/blob/058d0ff161a8ee9d53244c433aca97ee9c654410/src/org/zoodb/internal/util/BucketStack.java#L130-L144 |
106,295 | tzaeschke/zoodb | src/org/zoodb/internal/util/CritBit64.java | CritBit64.compare | private static int compare(long v1, long v2) {
int pos = 0;
if (v1 != v2) {
long x = v1 ^ v2;
pos += Long.numberOfLeadingZeros(x);
return pos;
}
return -1;
} | java | private static int compare(long v1, long v2) {
int pos = 0;
if (v1 != v2) {
long x = v1 ^ v2;
pos += Long.numberOfLeadingZeros(x);
return pos;
}
return -1;
} | [
"private",
"static",
"int",
"compare",
"(",
"long",
"v1",
",",
"long",
"v2",
")",
"{",
"int",
"pos",
"=",
"0",
";",
"if",
"(",
"v1",
"!=",
"v2",
")",
"{",
"long",
"x",
"=",
"v1",
"^",
"v2",
";",
"pos",
"+=",
"Long",
".",
"numberOfLeadingZeros",
... | Compares two values.
@param v1
@param v2
@return Position of the differing bit, or -1 if both values are equal | [
"Compares",
"two",
"values",
"."
] | 058d0ff161a8ee9d53244c433aca97ee9c654410 | https://github.com/tzaeschke/zoodb/blob/058d0ff161a8ee9d53244c433aca97ee9c654410/src/org/zoodb/internal/util/CritBit64.java#L313-L321 |
106,296 | tzaeschke/zoodb | src/org/zoodb/internal/util/CritBit64.java | CritBit64.contains | public boolean contains(long key) {
if (size == 0) {
return false;
}
if (size == 1) {
int posDiff = compare(key, rootKey);
if (posDiff == -1) {
return true;
}
return false;
}
Node<V> n = root;
while (true) {
if (!doesInfixMatch(n, key)) {
return false;
}
//infix match... | java | public boolean contains(long key) {
if (size == 0) {
return false;
}
if (size == 1) {
int posDiff = compare(key, rootKey);
if (posDiff == -1) {
return true;
}
return false;
}
Node<V> n = root;
while (true) {
if (!doesInfixMatch(n, key)) {
return false;
}
//infix match... | [
"public",
"boolean",
"contains",
"(",
"long",
"key",
")",
"{",
"if",
"(",
"size",
"==",
"0",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"size",
"==",
"1",
")",
"{",
"int",
"posDiff",
"=",
"compare",
"(",
"key",
",",
"rootKey",
")",
";",
... | Check whether a given key exists in the tree.
@param key The key
@return {@code true} if the key exists otherwise {@code false} | [
"Check",
"whether",
"a",
"given",
"key",
"exists",
"in",
"the",
"tree",
"."
] | 058d0ff161a8ee9d53244c433aca97ee9c654410 | https://github.com/tzaeschke/zoodb/blob/058d0ff161a8ee9d53244c433aca97ee9c654410/src/org/zoodb/internal/util/CritBit64.java#L336-L369 |
106,297 | tzaeschke/zoodb | src/org/zoodb/internal/util/CritBit64.java | CritBit64.get | public V get(long key) {
if (size == 0) {
return null;
}
if (size == 1) {
int posDiff = compare(key, rootKey);
if (posDiff == -1) {
return rootVal;
}
return null;
}
Node<V> n = root;
while (true) {
if (!doesInfixMatch(n, key)) {
return null;
}
//infix matches, so now w... | java | public V get(long key) {
if (size == 0) {
return null;
}
if (size == 1) {
int posDiff = compare(key, rootKey);
if (posDiff == -1) {
return rootVal;
}
return null;
}
Node<V> n = root;
while (true) {
if (!doesInfixMatch(n, key)) {
return null;
}
//infix matches, so now w... | [
"public",
"V",
"get",
"(",
"long",
"key",
")",
"{",
"if",
"(",
"size",
"==",
"0",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"size",
"==",
"1",
")",
"{",
"int",
"posDiff",
"=",
"compare",
"(",
"key",
",",
"rootKey",
")",
";",
"if",
"(",... | Get the value for a given key.
@param key The key
@return the values associated with {@code key} or {@code null} if the key does not exist. | [
"Get",
"the",
"value",
"for",
"a",
"given",
"key",
"."
] | 058d0ff161a8ee9d53244c433aca97ee9c654410 | https://github.com/tzaeschke/zoodb/blob/058d0ff161a8ee9d53244c433aca97ee9c654410/src/org/zoodb/internal/util/CritBit64.java#L376-L413 |
106,298 | tzaeschke/zoodb | src/org/zoodb/internal/util/CritBit64.java | CritBit64.remove | public V remove(long key) {
if (size == 0) {
return null;
}
if (size == 1) {
int posDiff = compare(key, rootKey);
if (posDiff == -1) {
size--;
rootKey = 0;
V prev = rootVal;
rootVal = null;
return prev;
}
return null;
}
Node<V> n = root;
Node<V> parent = null;
boolean is... | java | public V remove(long key) {
if (size == 0) {
return null;
}
if (size == 1) {
int posDiff = compare(key, rootKey);
if (posDiff == -1) {
size--;
rootKey = 0;
V prev = rootVal;
rootVal = null;
return prev;
}
return null;
}
Node<V> n = root;
Node<V> parent = null;
boolean is... | [
"public",
"V",
"remove",
"(",
"long",
"key",
")",
"{",
"if",
"(",
"size",
"==",
"0",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"size",
"==",
"1",
")",
"{",
"int",
"posDiff",
"=",
"compare",
"(",
"key",
",",
"rootKey",
")",
";",
"if",
"... | Remove a key and its value
@param key The key
@return The value of the key of {@code null} if the value was not found. | [
"Remove",
"a",
"key",
"and",
"its",
"value"
] | 058d0ff161a8ee9d53244c433aca97ee9c654410 | https://github.com/tzaeschke/zoodb/blob/058d0ff161a8ee9d53244c433aca97ee9c654410/src/org/zoodb/internal/util/CritBit64.java#L420-L489 |
106,299 | tzaeschke/zoodb | src/org/zoodb/jdo/ZooJdoHelper.java | ZooJdoHelper.openDB | public static PersistenceManager openDB(String dbName) {
DBTracer.logCall(ZooJdoHelper.class, dbName);
ZooJdoProperties props = new ZooJdoProperties(dbName);
PersistenceManagerFactory pmf = JDOHelper.getPersistenceManagerFactory(props);
PersistenceManager pm = pmf.getPersistenceManager();... | java | public static PersistenceManager openDB(String dbName) {
DBTracer.logCall(ZooJdoHelper.class, dbName);
ZooJdoProperties props = new ZooJdoProperties(dbName);
PersistenceManagerFactory pmf = JDOHelper.getPersistenceManagerFactory(props);
PersistenceManager pm = pmf.getPersistenceManager();... | [
"public",
"static",
"PersistenceManager",
"openDB",
"(",
"String",
"dbName",
")",
"{",
"DBTracer",
".",
"logCall",
"(",
"ZooJdoHelper",
".",
"class",
",",
"dbName",
")",
";",
"ZooJdoProperties",
"props",
"=",
"new",
"ZooJdoProperties",
"(",
"dbName",
")",
";",... | Open a database.
This is short for: <br>
<code>
ZooJdoProperties props = new ZooJdoProperties(dbName); <br>
PersistenceManagerFactory pmf = JDOHelper.getPersistenceManagerFactory(props); <br>
PersistenceManager pm = pmf.getPersistenceManager(); <br>
</code>
@param dbName Name of the database to connect to.
@return... | [
"Open",
"a",
"database",
"."
] | 058d0ff161a8ee9d53244c433aca97ee9c654410 | https://github.com/tzaeschke/zoodb/blob/058d0ff161a8ee9d53244c433aca97ee9c654410/src/org/zoodb/jdo/ZooJdoHelper.java#L50-L56 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.