New upstream version 8.5.8+dfsg
Pierre Gruet
2 years ago
0 | eclipse.preferences.version=1 | |
1 | org.eclipse.jdt.core.classpathVariable.IVY_HOME=/Users/vigna/.ivy2 | |
2 | org.eclipse.jdt.core.classpathVariable.JRE_LIB=/Library/Java/JavaVirtualMachines/jdk-10.0.1.jdk/Contents/Home/lib/jrt-fs.jar | |
3 | org.eclipse.jdt.core.classpathVariable.JRE_SRC=/Library/Java/JavaVirtualMachines/jdk-10.0.1.jdk/Contents/Home/lib/src.zip | |
4 | org.eclipse.jdt.core.classpathVariable.JRE_SRCROOT= | |
5 | org.eclipse.jdt.core.classpathVariable.JUNIT_HOME=/Users/vigna/.p2/pool/plugins/org.junit_4.12.0.v201504281640 | |
6 | org.eclipse.jdt.core.classpathVariable.M2_REPO=/Users/vigna/.m2/repository | |
7 | org.eclipse.jdt.core.codeComplete.argumentPrefixes= | |
8 | org.eclipse.jdt.core.codeComplete.argumentSuffixes= | |
9 | org.eclipse.jdt.core.codeComplete.fieldPrefixes= | |
10 | org.eclipse.jdt.core.codeComplete.fieldSuffixes= | |
11 | org.eclipse.jdt.core.codeComplete.localPrefixes= | |
12 | org.eclipse.jdt.core.codeComplete.localSuffixes= | |
13 | org.eclipse.jdt.core.codeComplete.staticFieldPrefixes= | |
14 | org.eclipse.jdt.core.codeComplete.staticFieldSuffixes= | |
15 | org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes= | |
16 | org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes= | |
17 | org.eclipse.jdt.core.codeComplete.visibilityCheck=enabled | |
18 | org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled | |
19 | org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore | |
20 | org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull | |
21 | org.eclipse.jdt.core.compiler.annotation.nonnull.secondary= | |
22 | org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault | |
23 | org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary= | |
24 | org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable | |
25 | org.eclipse.jdt.core.compiler.annotation.nullable.secondary= | |
26 | org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled | |
27 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled | |
28 | org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate | |
29 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 | |
30 | org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve | |
31 | org.eclipse.jdt.core.compiler.compliance=1.8 | |
32 | org.eclipse.jdt.core.compiler.debug.lineNumber=generate | |
33 | org.eclipse.jdt.core.compiler.debug.localVariable=generate | |
34 | org.eclipse.jdt.core.compiler.debug.sourceFile=generate | |
35 | org.eclipse.jdt.core.compiler.problem.APILeak=warning | |
36 | org.eclipse.jdt.core.compiler.problem.annotatedTypeArgumentToUnannotated=info | |
37 | org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning | |
38 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error | |
39 | org.eclipse.jdt.core.compiler.problem.autoboxing=warning | |
40 | org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning | |
41 | org.eclipse.jdt.core.compiler.problem.deadCode=warning | |
42 | org.eclipse.jdt.core.compiler.problem.deprecation=warning | |
43 | org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled | |
44 | org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled | |
45 | org.eclipse.jdt.core.compiler.problem.discouragedReference=warning | |
46 | org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore | |
47 | org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled | |
48 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error | |
49 | org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore | |
50 | org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore | |
51 | org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled | |
52 | org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore | |
53 | org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning | |
54 | org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning | |
55 | org.eclipse.jdt.core.compiler.problem.forbiddenReference=error | |
56 | org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning | |
57 | org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=enabled | |
58 | org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning | |
59 | org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning | |
60 | org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore | |
61 | org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore | |
62 | org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning | |
63 | org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore | |
64 | org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning | |
65 | org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled | |
66 | org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning | |
67 | org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning | |
68 | org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled | |
69 | org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning | |
70 | org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore | |
71 | org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning | |
72 | org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning | |
73 | org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore | |
74 | org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning | |
75 | org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation=warning | |
76 | org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error | |
77 | org.eclipse.jdt.core.compiler.problem.nullReference=error | |
78 | org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error | |
79 | org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning | |
80 | org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning | |
81 | org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore | |
82 | org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables=warning | |
83 | org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore | |
84 | org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore | |
85 | org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore | |
86 | org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning | |
87 | org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning | |
88 | org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning | |
89 | org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning | |
90 | org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore | |
91 | org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore | |
92 | org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore | |
93 | org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning | |
94 | org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled | |
95 | org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning | |
96 | org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled | |
97 | org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled | |
98 | org.eclipse.jdt.core.compiler.problem.suppressWarningsNotFullyAnalysed=info | |
99 | org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled | |
100 | org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore | |
101 | org.eclipse.jdt.core.compiler.problem.terminalDeprecation=warning | |
102 | org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning | |
103 | org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled | |
104 | org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning | |
105 | org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning | |
106 | org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore | |
107 | org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning | |
108 | org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType=warning | |
109 | org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentTypeStrict=disabled | |
110 | org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=warning | |
111 | org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore | |
112 | org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning | |
113 | org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore | |
114 | org.eclipse.jdt.core.compiler.problem.unstableAutoModuleName=warning | |
115 | org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning | |
116 | org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled | |
117 | org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled | |
118 | org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled | |
119 | org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore | |
120 | org.eclipse.jdt.core.compiler.problem.unusedImport=warning | |
121 | org.eclipse.jdt.core.compiler.problem.unusedLabel=warning | |
122 | org.eclipse.jdt.core.compiler.problem.unusedLocal=warning | |
123 | org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore | |
124 | org.eclipse.jdt.core.compiler.problem.unusedParameter=warning | |
125 | org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled | |
126 | org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled | |
127 | org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled | |
128 | org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning | |
129 | org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=warning | |
130 | org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning | |
131 | org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning | |
132 | org.eclipse.jdt.core.compiler.release=enabled | |
133 | org.eclipse.jdt.core.compiler.source=1.8 | |
134 | org.eclipse.jdt.core.compiler.taskCaseSensitive=enabled | |
135 | org.eclipse.jdt.core.compiler.taskPriorities=NORMAL,HIGH,NORMAL | |
136 | org.eclipse.jdt.core.compiler.taskTags=TODO,FIXME,XXX | |
137 | org.eclipse.jdt.core.formatter.align_assignment_statements_on_columns=false | |
138 | org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines=2147483647 | |
139 | org.eclipse.jdt.core.formatter.align_type_members_on_columns=false | |
140 | org.eclipse.jdt.core.formatter.align_variable_declarations_on_columns=false | |
141 | org.eclipse.jdt.core.formatter.align_with_spaces=false | |
142 | org.eclipse.jdt.core.formatter.alignment_for_additive_operator=0 | |
143 | org.eclipse.jdt.core.formatter.alignment_for_annotations_on_enum_constant=49 | |
144 | org.eclipse.jdt.core.formatter.alignment_for_annotations_on_field=49 | |
145 | org.eclipse.jdt.core.formatter.alignment_for_annotations_on_local_variable=49 | |
146 | org.eclipse.jdt.core.formatter.alignment_for_annotations_on_method=49 | |
147 | org.eclipse.jdt.core.formatter.alignment_for_annotations_on_package=49 | |
148 | org.eclipse.jdt.core.formatter.alignment_for_annotations_on_parameter=0 | |
149 | org.eclipse.jdt.core.formatter.alignment_for_annotations_on_type=49 | |
150 | org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=0 | |
151 | org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 | |
152 | org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=0 | |
153 | org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=0 | |
154 | org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=0 | |
155 | org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=0 | |
156 | org.eclipse.jdt.core.formatter.alignment_for_assertion_message=0 | |
157 | org.eclipse.jdt.core.formatter.alignment_for_assignment=0 | |
158 | org.eclipse.jdt.core.formatter.alignment_for_binary_expression=0 | |
159 | org.eclipse.jdt.core.formatter.alignment_for_bitwise_operator=0 | |
160 | org.eclipse.jdt.core.formatter.alignment_for_compact_if=0 | |
161 | org.eclipse.jdt.core.formatter.alignment_for_compact_loops=0 | |
162 | org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=0 | |
163 | org.eclipse.jdt.core.formatter.alignment_for_conditional_expression_chain=0 | |
164 | org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 | |
165 | org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 | |
166 | org.eclipse.jdt.core.formatter.alignment_for_expressions_in_for_loop_header=0 | |
167 | org.eclipse.jdt.core.formatter.alignment_for_logical_operator=0 | |
168 | org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 | |
169 | org.eclipse.jdt.core.formatter.alignment_for_module_statements=16 | |
170 | org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 | |
171 | org.eclipse.jdt.core.formatter.alignment_for_multiplicative_operator=0 | |
172 | org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references=0 | |
173 | org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=0 | |
174 | org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=0 | |
175 | org.eclipse.jdt.core.formatter.alignment_for_record_components=0 | |
176 | org.eclipse.jdt.core.formatter.alignment_for_relational_operator=0 | |
177 | org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=0 | |
178 | org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=0 | |
179 | org.eclipse.jdt.core.formatter.alignment_for_shift_operator=0 | |
180 | org.eclipse.jdt.core.formatter.alignment_for_string_concatenation=0 | |
181 | org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=0 | |
182 | org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=0 | |
183 | org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_record_declaration=0 | |
184 | org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=0 | |
185 | org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=0 | |
186 | org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=0 | |
187 | org.eclipse.jdt.core.formatter.alignment_for_type_annotations=0 | |
188 | org.eclipse.jdt.core.formatter.alignment_for_type_arguments=0 | |
189 | org.eclipse.jdt.core.formatter.alignment_for_type_parameters=0 | |
190 | org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=0 | |
191 | org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 | |
192 | org.eclipse.jdt.core.formatter.blank_lines_after_last_class_body_declaration=0 | |
193 | org.eclipse.jdt.core.formatter.blank_lines_after_package=1 | |
194 | org.eclipse.jdt.core.formatter.blank_lines_before_abstract_method=1 | |
195 | org.eclipse.jdt.core.formatter.blank_lines_before_field=0 | |
196 | org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 | |
197 | org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 | |
198 | org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 | |
199 | org.eclipse.jdt.core.formatter.blank_lines_before_method=1 | |
200 | org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 | |
201 | org.eclipse.jdt.core.formatter.blank_lines_before_package=0 | |
202 | org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 | |
203 | org.eclipse.jdt.core.formatter.blank_lines_between_statement_group_in_switch=0 | |
204 | org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 | |
205 | org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line | |
206 | org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line | |
207 | org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line | |
208 | org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line | |
209 | org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line | |
210 | org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line | |
211 | org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line | |
212 | org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line | |
213 | org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line | |
214 | org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line | |
215 | org.eclipse.jdt.core.formatter.brace_position_for_record_constructor=end_of_line | |
216 | org.eclipse.jdt.core.formatter.brace_position_for_record_declaration=end_of_line | |
217 | org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line | |
218 | org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line | |
219 | org.eclipse.jdt.core.formatter.comment.align_tags_descriptions_grouped=false | |
220 | org.eclipse.jdt.core.formatter.comment.align_tags_names_descriptions=false | |
221 | org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false | |
222 | org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false | |
223 | org.eclipse.jdt.core.formatter.comment.count_line_length_from_starting_position=true | |
224 | org.eclipse.jdt.core.formatter.comment.format_block_comments=false | |
225 | org.eclipse.jdt.core.formatter.comment.format_header=false | |
226 | org.eclipse.jdt.core.formatter.comment.format_html=true | |
227 | org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true | |
228 | org.eclipse.jdt.core.formatter.comment.format_line_comments=true | |
229 | org.eclipse.jdt.core.formatter.comment.format_source_code=true | |
230 | org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true | |
231 | org.eclipse.jdt.core.formatter.comment.indent_root_tags=true | |
232 | org.eclipse.jdt.core.formatter.comment.indent_tag_description=false | |
233 | org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert | |
234 | org.eclipse.jdt.core.formatter.comment.insert_new_line_between_different_tags=do not insert | |
235 | org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert | |
236 | org.eclipse.jdt.core.formatter.comment.line_length=100 | |
237 | org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true | |
238 | org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true | |
239 | org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false | |
240 | org.eclipse.jdt.core.formatter.compact_else_if=true | |
241 | org.eclipse.jdt.core.formatter.continuation_indentation=2 | |
242 | org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 | |
243 | org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off | |
244 | org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on | |
245 | org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false | |
246 | org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true | |
247 | org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true | |
248 | org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true | |
249 | org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true | |
250 | org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_record_header=true | |
251 | org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true | |
252 | org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true | |
253 | org.eclipse.jdt.core.formatter.indent_empty_lines=false | |
254 | org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true | |
255 | org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true | |
256 | org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true | |
257 | org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false | |
258 | org.eclipse.jdt.core.formatter.indentation.size=8 | |
259 | org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_enum_constant=insert | |
260 | org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert | |
261 | org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert | |
262 | org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert | |
263 | org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert | |
264 | org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert | |
265 | org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert | |
266 | org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert | |
267 | org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert | |
268 | org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert | |
269 | org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert | |
270 | org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert | |
271 | org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert | |
272 | org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert | |
273 | org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert | |
274 | org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert | |
275 | org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert | |
276 | org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert | |
277 | org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert | |
278 | org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert | |
279 | org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert | |
280 | org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert | |
281 | org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert | |
282 | org.eclipse.jdt.core.formatter.insert_space_after_additive_operator=insert | |
283 | org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert | |
284 | org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_case=insert | |
285 | org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_default=insert | |
286 | org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert | |
287 | org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert | |
288 | org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert | |
289 | org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert | |
290 | org.eclipse.jdt.core.formatter.insert_space_after_bitwise_operator=insert | |
291 | org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert | |
292 | org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert | |
293 | org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert | |
294 | org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=do not insert | |
295 | org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert | |
296 | org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert | |
297 | org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert | |
298 | org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert | |
299 | org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert | |
300 | org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert | |
301 | org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert | |
302 | org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert | |
303 | org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert | |
304 | org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert | |
305 | org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert | |
306 | org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert | |
307 | org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert | |
308 | org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert | |
309 | org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert | |
310 | org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert | |
311 | org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert | |
312 | org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert | |
313 | org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert | |
314 | org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert | |
315 | org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert | |
316 | org.eclipse.jdt.core.formatter.insert_space_after_comma_in_record_components=insert | |
317 | org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert | |
318 | org.eclipse.jdt.core.formatter.insert_space_after_comma_in_switch_case_expressions=insert | |
319 | org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert | |
320 | org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert | |
321 | org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert | |
322 | org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert | |
323 | org.eclipse.jdt.core.formatter.insert_space_after_logical_operator=insert | |
324 | org.eclipse.jdt.core.formatter.insert_space_after_multiplicative_operator=insert | |
325 | org.eclipse.jdt.core.formatter.insert_space_after_not_operator=do not insert | |
326 | org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert | |
327 | org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert | |
328 | org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert | |
329 | org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert | |
330 | org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert | |
331 | org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert | |
332 | org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert | |
333 | org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert | |
334 | org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert | |
335 | org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert | |
336 | org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert | |
337 | org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert | |
338 | org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert | |
339 | org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert | |
340 | org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert | |
341 | org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert | |
342 | org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_record_declaration=do not insert | |
343 | org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert | |
344 | org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert | |
345 | org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert | |
346 | org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert | |
347 | org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert | |
348 | org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert | |
349 | org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert | |
350 | org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert | |
351 | org.eclipse.jdt.core.formatter.insert_space_after_relational_operator=insert | |
352 | org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert | |
353 | org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert | |
354 | org.eclipse.jdt.core.formatter.insert_space_after_shift_operator=insert | |
355 | org.eclipse.jdt.core.formatter.insert_space_after_string_concatenation=insert | |
356 | org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert | |
357 | org.eclipse.jdt.core.formatter.insert_space_before_additive_operator=insert | |
358 | org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert | |
359 | org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_case=insert | |
360 | org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_default=insert | |
361 | org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert | |
362 | org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert | |
363 | org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert | |
364 | org.eclipse.jdt.core.formatter.insert_space_before_bitwise_operator=insert | |
365 | org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert | |
366 | org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert | |
367 | org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert | |
368 | org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert | |
369 | org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert | |
370 | org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert | |
371 | org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert | |
372 | org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert | |
373 | org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert | |
374 | org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert | |
375 | org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert | |
376 | org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert | |
377 | org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert | |
378 | org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert | |
379 | org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert | |
380 | org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert | |
381 | org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_record_declaration=do not insert | |
382 | org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert | |
383 | org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert | |
384 | org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert | |
385 | org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert | |
386 | org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert | |
387 | org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert | |
388 | org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert | |
389 | org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert | |
390 | org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert | |
391 | org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert | |
392 | org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert | |
393 | org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert | |
394 | org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert | |
395 | org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert | |
396 | org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert | |
397 | org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert | |
398 | org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert | |
399 | org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert | |
400 | org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert | |
401 | org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert | |
402 | org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert | |
403 | org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert | |
404 | org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert | |
405 | org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert | |
406 | org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert | |
407 | org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert | |
408 | org.eclipse.jdt.core.formatter.insert_space_before_comma_in_record_components=do not insert | |
409 | org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert | |
410 | org.eclipse.jdt.core.formatter.insert_space_before_comma_in_switch_case_expressions=do not insert | |
411 | org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert | |
412 | org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert | |
413 | org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert | |
414 | org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert | |
415 | org.eclipse.jdt.core.formatter.insert_space_before_logical_operator=insert | |
416 | org.eclipse.jdt.core.formatter.insert_space_before_multiplicative_operator=insert | |
417 | org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert | |
418 | org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert | |
419 | org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert | |
420 | org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert | |
421 | org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert | |
422 | org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert | |
423 | org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert | |
424 | org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert | |
425 | org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert | |
426 | org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert | |
427 | org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert | |
428 | org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_record_constructor=insert | |
429 | org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_record_declaration=insert | |
430 | org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert | |
431 | org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert | |
432 | org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert | |
433 | org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert | |
434 | org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert | |
435 | org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert | |
436 | org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert | |
437 | org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert | |
438 | org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert | |
439 | org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert | |
440 | org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert | |
441 | org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert | |
442 | org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert | |
443 | org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert | |
444 | org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert | |
445 | org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_record_declaration=do not insert | |
446 | org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert | |
447 | org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert | |
448 | org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert | |
449 | org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert | |
450 | org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert | |
451 | org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert | |
452 | org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert | |
453 | org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert | |
454 | org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert | |
455 | org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert | |
456 | org.eclipse.jdt.core.formatter.insert_space_before_relational_operator=insert | |
457 | org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert | |
458 | org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert | |
459 | org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert | |
460 | org.eclipse.jdt.core.formatter.insert_space_before_shift_operator=insert | |
461 | org.eclipse.jdt.core.formatter.insert_space_before_string_concatenation=insert | |
462 | org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert | |
463 | org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert | |
464 | org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert | |
465 | org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert | |
466 | org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert | |
467 | org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert | |
468 | org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert | |
469 | org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert | |
470 | org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert | |
471 | org.eclipse.jdt.core.formatter.join_lines_in_comments=true | |
472 | org.eclipse.jdt.core.formatter.join_wrapped_lines=true | |
473 | org.eclipse.jdt.core.formatter.keep_annotation_declaration_on_one_line=one_line_never | |
474 | org.eclipse.jdt.core.formatter.keep_anonymous_type_declaration_on_one_line=one_line_never | |
475 | org.eclipse.jdt.core.formatter.keep_code_block_on_one_line=one_line_never | |
476 | org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=true | |
477 | org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false | |
478 | org.eclipse.jdt.core.formatter.keep_enum_constant_declaration_on_one_line=one_line_never | |
479 | org.eclipse.jdt.core.formatter.keep_enum_declaration_on_one_line=one_line_never | |
480 | org.eclipse.jdt.core.formatter.keep_if_then_body_block_on_one_line=one_line_never | |
481 | org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false | |
482 | org.eclipse.jdt.core.formatter.keep_lambda_body_block_on_one_line=one_line_never | |
483 | org.eclipse.jdt.core.formatter.keep_loop_body_block_on_one_line=one_line_never | |
484 | org.eclipse.jdt.core.formatter.keep_method_body_on_one_line=one_line_never | |
485 | org.eclipse.jdt.core.formatter.keep_record_constructor_on_one_line=one_line_never | |
486 | org.eclipse.jdt.core.formatter.keep_record_declaration_on_one_line=one_line_never | |
487 | org.eclipse.jdt.core.formatter.keep_simple_do_while_body_on_same_line=true | |
488 | org.eclipse.jdt.core.formatter.keep_simple_for_body_on_same_line=true | |
489 | org.eclipse.jdt.core.formatter.keep_simple_getter_setter_on_one_line=false | |
490 | org.eclipse.jdt.core.formatter.keep_simple_while_body_on_same_line=true | |
491 | org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=true | |
492 | org.eclipse.jdt.core.formatter.keep_type_declaration_on_one_line=one_line_never | |
493 | org.eclipse.jdt.core.formatter.lineSplit=120 | |
494 | org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false | |
495 | org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false | |
496 | org.eclipse.jdt.core.formatter.number_of_blank_lines_after_code_block=0 | |
497 | org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_code_block=0 | |
498 | org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 | |
499 | org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_code_block=0 | |
500 | org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_method_body=0 | |
501 | org.eclipse.jdt.core.formatter.number_of_blank_lines_before_code_block=0 | |
502 | org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 | |
503 | org.eclipse.jdt.core.formatter.parentheses_positions_in_annotation=common_lines | |
504 | org.eclipse.jdt.core.formatter.parentheses_positions_in_catch_clause=common_lines | |
505 | org.eclipse.jdt.core.formatter.parentheses_positions_in_enum_constant_declaration=common_lines | |
506 | org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment=common_lines | |
507 | org.eclipse.jdt.core.formatter.parentheses_positions_in_if_while_statement=common_lines | |
508 | org.eclipse.jdt.core.formatter.parentheses_positions_in_lambda_declaration=common_lines | |
509 | org.eclipse.jdt.core.formatter.parentheses_positions_in_method_delcaration=common_lines | |
510 | org.eclipse.jdt.core.formatter.parentheses_positions_in_method_invocation=common_lines | |
511 | org.eclipse.jdt.core.formatter.parentheses_positions_in_record_declaration=common_lines | |
512 | org.eclipse.jdt.core.formatter.parentheses_positions_in_switch_statement=common_lines | |
513 | org.eclipse.jdt.core.formatter.parentheses_positions_in_try_clause=common_lines | |
514 | org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true | |
515 | org.eclipse.jdt.core.formatter.tabulation.char=tab | |
516 | org.eclipse.jdt.core.formatter.tabulation.size=4 | |
517 | org.eclipse.jdt.core.formatter.text_block_indentation=0 | |
518 | org.eclipse.jdt.core.formatter.use_on_off_tags=false | |
519 | org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false | |
520 | org.eclipse.jdt.core.formatter.wrap_before_additive_operator=true | |
521 | org.eclipse.jdt.core.formatter.wrap_before_assertion_message_operator=true | |
522 | org.eclipse.jdt.core.formatter.wrap_before_assignment_operator=false | |
523 | org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true | |
524 | org.eclipse.jdt.core.formatter.wrap_before_bitwise_operator=true | |
525 | org.eclipse.jdt.core.formatter.wrap_before_conditional_operator=true | |
526 | org.eclipse.jdt.core.formatter.wrap_before_logical_operator=true | |
527 | org.eclipse.jdt.core.formatter.wrap_before_multiplicative_operator=true | |
528 | org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true | |
529 | org.eclipse.jdt.core.formatter.wrap_before_relational_operator=true | |
530 | org.eclipse.jdt.core.formatter.wrap_before_shift_operator=true | |
531 | org.eclipse.jdt.core.formatter.wrap_before_string_concatenation=true | |
532 | org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true | |
533 | org.eclipse.jdt.core.timeoutForParameterNameFromAttachedJavadoc=50 |
0 | CustomFiltersActionGroup.org.eclipse.jdt.ui.PackageExplorer.TAG_DUMMY_TO_TEST_EXISTENCE=storedViewPreferences | |
1 | breadcrumb.org.eclipse.jdt.ui.JavaPerspective=true | |
2 | content_assist_autoinsert=true | |
3 | content_assist_category_order=org.eclipse.jdt.ui.templateProposalCategory\:0\u0000org.eclipse.jdt.ui.swtProposalCategory\:1\u0000org.eclipse.jdt.ui.javaNoTypeProposalCategory\:65537\u0000org.eclipse.jdt.ui.javaTypeProposalCategory\:65538\u0000org.eclipse.jdt.ui.textProposalCategory\:65539\u0000org.eclipse.jdt.ui.javaAllProposalCategory\:5\u0000org.eclipse.jdt.ui.javaChainProposalCategory\:6\u0000org.eclipse.mylyn.java.ui.javaAllProposalCategory\:65542\u0000 | |
4 | content_assist_disabled_computers=org.eclipse.jdt.ui.javaNoTypeProposalCategory\u0000org.eclipse.jdt.ui.javaTypeProposalCategory\u0000org.eclipse.jdt.ui.textProposalCategory\u0000org.eclipse.mylyn.java.ui.javaAllProposalCategory\u0000 | |
5 | content_assist_insert_completion=true | |
6 | content_assist_lru_history=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><history maxLHS\="100" maxRHS\="10"><lhs name\="it.unimi.dsi.fastutil.objects.ObjectList"><rhs name\="it.unimi.dsi.util.FrontCodedStringList"/><rhs name\="it.unimi.dsi.fastutil.objects.ObjectArrayList"/></lhs><lhs name\="java.util.List"><rhs name\="it.unimi.dsi.util.FrontCodedStringList"/><rhs name\="it.unimi.dsi.fastutil.objects.ObjectArrayList"/><rhs name\="java.util.ArrayList"/></lhs><lhs name\="it.unimi.dsi.util.FrontCodedStringList"><rhs name\="it.unimi.dsi.util.FrontCodedStringList"/></lhs><lhs name\="org.jgrapht.opt.graph.sparse.IncomingEdgesSupport"><rhs name\="org.jgrapht.opt.graph.sparse.IncomingEdgesSupport"/></lhs><lhs name\="org.apache.commons.math3.random.AbstractRandomGenerator"><rhs name\="it.unimi.dsi.util.XoRoShiRo128PlusRandomGenerator"/><rhs name\="it.unimi.dsi.util.XoRoShiRo128PlusPlusRandomGenerator"/></lhs><lhs name\="org.apache.commons.math3.random.RandomGenerator"><rhs name\="it.unimi.dsi.util.XoRoShiRo128PlusRandomGenerator"/><rhs name\="it.unimi.dsi.util.XoRoShiRo128PlusPlusRandomGenerator"/></lhs><lhs name\="it.unimi.dsi.util.XoRoShiRo128PlusRandomGenerator"><rhs name\="it.unimi.dsi.util.XoRoShiRo128PlusRandomGenerator"/></lhs><lhs name\="org.rocksdb.RocksObject"><rhs name\="org.rocksdb.ColumnFamilyHandle"/></lhs><lhs name\="org.rocksdb.AbstractImmutableNativeReference"><rhs name\="org.rocksdb.ColumnFamilyHandle"/></lhs><lhs name\="org.rocksdb.AbstractNativeReference"><rhs name\="org.rocksdb.ColumnFamilyHandle"/></lhs><lhs name\="java.lang.AutoCloseable"><rhs name\="org.rocksdb.ColumnFamilyHandle"/><rhs name\="java.io.FileWriter"/><rhs name\="java.io.InputStreamReader"/><rhs name\="java.io.OutputStreamWriter"/><rhs name\="eu.fasten.core.data.callableindex.RocksDao"/><rhs name\="it.unimi.dsi.fastutil.io.FastBufferedOutputStream"/><rhs name\="it.unimi.dsi.fastutil.io.FastBufferedInputStream"/><rhs name\="it.unimi.dsi.fastutil.io.FastByteArrayInputStream"/><rhs name\="it.unimi.dsi.big.util.MappedFrontCodedStringBigList"/></lhs><lhs name\="org.rocksdb.ColumnFamilyHandle"><rhs name\="org.rocksdb.ColumnFamilyHandle"/></lhs><lhs name\="it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap"><rhs name\="it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap"/></lhs><lhs name\="it.unimi.dsi.fastutil.io.RepositionableStream"><rhs name\="it.unimi.dsi.fastutil.io.FastByteArrayInputStream"/><rhs name\="it.unimi.dsi.fastutil.io.FastBufferedInputStream"/></lhs><lhs name\="it.unimi.dsi.fastutil.io.MeasurableInputStream"><rhs name\="it.unimi.dsi.fastutil.io.FastByteArrayInputStream"/><rhs name\="it.unimi.dsi.fastutil.io.FastBufferedInputStream"/></lhs><lhs name\="it.unimi.dsi.fastutil.io.MeasurableStream"><rhs name\="it.unimi.dsi.fastutil.io.FastByteArrayInputStream"/><rhs name\="it.unimi.dsi.fastutil.io.FastBufferedInputStream"/></lhs><lhs name\="java.io.InputStream"><rhs name\="it.unimi.dsi.fastutil.io.FastBufferedInputStream"/><rhs name\="it.unimi.dsi.fastutil.io.FastByteArrayInputStream"/></lhs><lhs name\="java.io.Closeable"><rhs name\="java.io.FileWriter"/><rhs name\="java.io.InputStreamReader"/><rhs name\="java.io.OutputStreamWriter"/><rhs name\="eu.fasten.core.data.callableindex.RocksDao"/><rhs name\="it.unimi.dsi.fastutil.io.FastBufferedOutputStream"/><rhs name\="it.unimi.dsi.fastutil.io.FastBufferedInputStream"/><rhs name\="it.unimi.dsi.fastutil.io.FastByteArrayInputStream"/><rhs name\="it.unimi.dsi.big.util.MappedFrontCodedStringBigList"/></lhs><lhs name\="it.unimi.dsi.fastutil.io.FastByteArrayInputStream"><rhs name\="it.unimi.dsi.fastutil.io.FastByteArrayInputStream"/></lhs><lhs name\="java.util.Collection"><rhs name\="it.unimi.dsi.sux4j.util.ZFastTrie"/><rhs name\="it.unimi.dsi.bits.LongArrayBitVector"/><rhs name\="it.unimi.dsi.fastutil.objects.ObjectArrayList"/><rhs name\="it.unimi.dsi.fastutil.objects.ObjectOpenHashSet"/><rhs name\="it.unimi.dsi.fastutil.longs.LongOpenHashSet"/><rhs name\="it.unimi.dsi.fastutil.longs.LongLinkedOpenHashSet"/><rhs name\="java.util.LinkedHashSet"/><rhs name\="java.util.ArrayList"/><rhs name\="it.unimi.dsi.big.util.MappedFrontCodedStringBigList"/></lhs><lhs name\="java.lang.Iterable"><rhs name\="it.unimi.dsi.sux4j.util.ZFastTrie"/><rhs name\="it.unimi.dsi.bits.LongArrayBitVector"/><rhs name\="it.unimi.dsi.fastutil.objects.ObjectArrayList"/><rhs name\="it.unimi.dsi.fastutil.objects.ObjectOpenHashSet"/><rhs name\="it.unimi.dsi.fastutil.longs.LongOpenHashSet"/><rhs name\="it.unimi.dsi.fastutil.longs.LongLinkedOpenHashSet"/><rhs name\="java.util.LinkedHashSet"/><rhs name\="com.google.common.collect.testing.SampleElements"/><rhs name\="java.util.ArrayList"/><rhs name\="it.unimi.dsi.big.util.MappedFrontCodedStringBigList"/></lhs><lhs name\="java.util.RandomAccess"><rhs name\="java.util.ArrayList"/><rhs name\="it.unimi.dsi.bits.LongArrayBitVector"/><rhs name\="it.unimi.dsi.fastutil.objects.ObjectArrayList"/><rhs name\="it.unimi.dsi.big.util.MappedFrontCodedStringBigList"/></lhs><lhs name\="java.util.AbstractList"><rhs name\="java.util.ArrayList"/></lhs><lhs name\="java.util.AbstractCollection"><rhs name\="java.util.ArrayList"/><rhs name\="it.unimi.dsi.sux4j.util.ZFastTrie"/><rhs name\="it.unimi.dsi.bits.LongArrayBitVector"/><rhs name\="it.unimi.dsi.fastutil.objects.ObjectArrayList"/><rhs name\="java.util.LinkedHashSet"/><rhs name\="it.unimi.dsi.big.util.MappedFrontCodedStringBigList"/></lhs><lhs name\="java.util.ArrayList"><rhs name\="java.util.ArrayList"/></lhs><lhs name\="eu.fasten.core.data.graphdb.GraphMetadata"><rhs name\="eu.fasten.core.data.graphdb.GraphMetadata"/></lhs><lhs name\="eu.fasten.core.data.graphdb.GraphMetadata$ReceiverRecord$Type"><rhs name\="eu.fasten.core.data.graphdb.GraphMetadata$ReceiverRecord$Type"/></lhs><lhs name\="java.util.concurrent.locks.ReadWriteLock"><rhs name\="java.util.concurrent.locks.ReentrantReadWriteLock"/></lhs><lhs name\="java.util.concurrent.locks.ReentrantReadWriteLock"><rhs name\="java.util.concurrent.locks.ReentrantReadWriteLock"/></lhs><lhs name\="com.google.common.collect.BiMap"><rhs name\="com.google.common.collect.HashBiMap"/></lhs><lhs name\="java.util.concurrent.ConcurrentMap"><rhs name\="java.util.concurrent.ConcurrentHashMap"/></lhs><lhs name\="it.unimi.dsi.fastutil.objects.ObjectCollection"><rhs name\="it.unimi.dsi.sux4j.util.ZFastTrie"/><rhs name\="it.unimi.dsi.fastutil.objects.ObjectArrayList"/><rhs name\="it.unimi.dsi.big.util.MappedFrontCodedStringBigList"/></lhs><lhs name\="it.unimi.dsi.fastutil.objects.ObjectIterable"><rhs name\="it.unimi.dsi.sux4j.util.ZFastTrie"/><rhs name\="it.unimi.dsi.fastutil.objects.ObjectArrayList"/><rhs name\="it.unimi.dsi.big.util.MappedFrontCodedStringBigList"/></lhs><lhs name\="it.unimi.dsi.fastutil.objects.AbstractObjectCollection"><rhs name\="it.unimi.dsi.sux4j.util.ZFastTrie"/><rhs name\="it.unimi.dsi.fastutil.objects.ObjectArrayList"/><rhs name\="it.unimi.dsi.big.util.MappedFrontCodedStringBigList"/></lhs><lhs name\="it.unimi.dsi.fastutil.objects.ObjectArrayList"><rhs name\="it.unimi.dsi.fastutil.objects.ObjectArrayList"/></lhs><lhs name\="it.unimi.dsi.sux4j.util.ZFastTrie"><rhs name\="it.unimi.dsi.sux4j.util.ZFastTrie"/></lhs><lhs name\="java.util.function.LongToDoubleFunction"><rhs name\="it.unimi.dsi.fastutil.longs.Long2DoubleArrayMap"/><rhs name\="it.unimi.dsi.fastutil.longs.Long2DoubleOpenHashMap"/></lhs><lhs name\="it.unimi.dsi.fastutil.longs.Long2DoubleFunction"><rhs name\="it.unimi.dsi.fastutil.longs.Long2DoubleArrayMap"/><rhs name\="it.unimi.dsi.fastutil.longs.Long2DoubleOpenHashMap"/></lhs><lhs name\="it.unimi.dsi.fastutil.Hash"><rhs name\="it.unimi.dsi.fastutil.longs.Long2DoubleOpenHashMap"/><rhs name\="it.unimi.dsi.fastutil.longs.Long2IntOpenHashMap"/></lhs><lhs name\="it.unimi.dsi.fastutil.longs.AbstractLong2DoubleMap"><rhs name\="it.unimi.dsi.fastutil.longs.Long2DoubleOpenHashMap"/></lhs><lhs name\="it.unimi.dsi.fastutil.longs.Long2DoubleMap"><rhs name\="it.unimi.dsi.fastutil.longs.Long2DoubleArrayMap"/><rhs name\="it.unimi.dsi.fastutil.longs.Long2DoubleOpenHashMap"/></lhs><lhs name\="it.unimi.dsi.fastutil.longs.AbstractLong2DoubleFunction"><rhs name\="it.unimi.dsi.fastutil.longs.Long2DoubleOpenHashMap"/></lhs><lhs name\="it.unimi.dsi.fastutil.longs.Long2DoubleOpenHashMap"><rhs name\="it.unimi.dsi.fastutil.longs.Long2DoubleOpenHashMap"/></lhs><lhs name\="it.unimi.dsi.bits.AbstractBitVector"><rhs name\="it.unimi.dsi.bits.LongArrayBitVector"/></lhs><lhs name\="it.unimi.dsi.bits.BitVector"><rhs name\="it.unimi.dsi.bits.LongArrayBitVector"/></lhs><lhs name\="it.unimi.dsi.fastutil.booleans.BooleanBigList"><rhs name\="it.unimi.dsi.bits.LongArrayBitVector"/></lhs><lhs name\="it.unimi.dsi.fastutil.BigList"><rhs name\="it.unimi.dsi.bits.LongArrayBitVector"/><rhs name\="it.unimi.dsi.big.util.MappedFrontCodedStringBigList"/></lhs><lhs name\="it.unimi.dsi.fastutil.Size64"><rhs name\="it.unimi.dsi.bits.LongArrayBitVector"/><rhs name\="it.unimi.dsi.big.util.MappedFrontCodedStringBigList"/></lhs><lhs name\="it.unimi.dsi.fastutil.booleans.BooleanCollection"><rhs name\="it.unimi.dsi.bits.LongArrayBitVector"/></lhs><lhs name\="it.unimi.dsi.fastutil.booleans.BooleanIterable"><rhs name\="it.unimi.dsi.bits.LongArrayBitVector"/></lhs><lhs name\="it.unimi.dsi.fastutil.booleans.AbstractBooleanBigList"><rhs name\="it.unimi.dsi.bits.LongArrayBitVector"/></lhs><lhs name\="it.unimi.dsi.fastutil.booleans.BooleanStack"><rhs name\="it.unimi.dsi.bits.LongArrayBitVector"/></lhs><lhs name\="it.unimi.dsi.fastutil.booleans.AbstractBooleanCollection"><rhs name\="it.unimi.dsi.bits.LongArrayBitVector"/></lhs><lhs name\="it.unimi.dsi.bits.LongArrayBitVector"><rhs name\="it.unimi.dsi.bits.LongArrayBitVector"/></lhs><lhs name\="org.jgrapht.Graph"><rhs name\="org.jgrapht.graph.EdgeReversedGraph"/></lhs><lhs name\="java.util.Set"><rhs name\="it.unimi.dsi.fastutil.objects.ObjectOpenHashSet"/><rhs name\="it.unimi.dsi.fastutil.longs.LongOpenHashSet"/><rhs name\="it.unimi.dsi.fastutil.longs.LongLinkedOpenHashSet"/><rhs name\="java.util.LinkedHashSet"/></lhs><lhs name\="java.util.HashSet"><rhs name\="java.util.LinkedHashSet"/></lhs><lhs name\="java.util.AbstractSet"><rhs name\="java.util.LinkedHashSet"/></lhs><lhs name\="java.util.LinkedHashSet"><rhs name\="java.util.LinkedHashSet"/></lhs><lhs name\="it.unimi.dsi.fastutil.objects.Object2ByteFunction"><rhs name\="it.unimi.dsi.fastutil.objects.Object2ByteOpenHashMap"/></lhs><lhs name\="java.util.function.ToIntFunction"><rhs name\="it.unimi.dsi.fastutil.objects.Object2ByteOpenHashMap"/></lhs><lhs name\="it.unimi.dsi.fastutil.objects.Object2ByteMap"><rhs name\="it.unimi.dsi.fastutil.objects.Object2ByteOpenHashMap"/></lhs><lhs name\="it.unimi.dsi.lang.FlyweightPrototype"><rhs name\="it.unimi.dsi.webgraph.UnionImmutableGraph"/></lhs><lhs name\="it.unimi.dsi.webgraph.ImmutableGraph"><rhs name\="it.unimi.dsi.webgraph.UnionImmutableGraph"/></lhs><lhs name\="org.apache.commons.rng.core.source64.AbstractXoRoShiRo128"><rhs name\="org.apache.commons.rng.core.source64.XoRoShiRo128Plus"/></lhs><lhs name\="org.apache.commons.rng.LongJumpableUniformRandomProvider"><rhs name\="org.apache.commons.rng.core.source64.XoRoShiRo128Plus"/></lhs><lhs name\="org.apache.commons.rng.JumpableUniformRandomProvider"><rhs name\="org.apache.commons.rng.core.source64.XoRoShiRo128Plus"/></lhs><lhs name\="org.apache.commons.rng.UniformRandomProvider"><rhs name\="org.apache.commons.rng.core.source64.XoRoShiRo128Plus"/></lhs><lhs name\="org.apache.commons.rng.core.source64.LongProvider"><rhs name\="org.apache.commons.rng.core.source64.XoRoShiRo128Plus"/></lhs><lhs name\="org.apache.commons.rng.core.source64.RandomLongSource"><rhs name\="org.apache.commons.rng.core.source64.XoRoShiRo128Plus"/></lhs><lhs name\="org.apache.commons.rng.core.BaseProvider"><rhs name\="org.apache.commons.rng.core.source64.XoRoShiRo128Plus"/></lhs><lhs name\="org.apache.commons.rng.RestorableUniformRandomProvider"><rhs name\="org.apache.commons.rng.core.source64.XoRoShiRo128Plus"/></lhs><lhs name\="org.apache.commons.rng.core.source64.XoRoShiRo128Plus"><rhs name\="org.apache.commons.rng.core.source64.XoRoShiRo128Plus"/></lhs><lhs name\="java.util.Map"><rhs name\="it.unimi.dsi.fastutil.longs.Long2DoubleOpenHashMap"/><rhs name\="it.unimi.dsi.fastutil.longs.Long2IntOpenHashMap"/><rhs name\="it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap"/></lhs><lhs name\="it.unimi.dsi.fastutil.longs.AbstractLong2IntMap"><rhs name\="it.unimi.dsi.fastutil.longs.Long2IntOpenHashMap"/></lhs><lhs name\="it.unimi.dsi.fastutil.longs.Long2IntMap"><rhs name\="it.unimi.dsi.fastutil.longs.Long2IntOpenHashMap"/></lhs><lhs name\="it.unimi.dsi.fastutil.longs.Long2IntFunction"><rhs name\="it.unimi.dsi.fastutil.longs.Long2IntOpenHashMap"/></lhs><lhs name\="java.util.function.LongToIntFunction"><rhs name\="it.unimi.dsi.fastutil.longs.Long2IntOpenHashMap"/></lhs><lhs name\="it.unimi.dsi.fastutil.longs.AbstractLong2IntFunction"><rhs name\="it.unimi.dsi.fastutil.longs.Long2IntOpenHashMap"/></lhs><lhs name\="it.unimi.dsi.fastutil.longs.Long2IntOpenHashMap"><rhs name\="it.unimi.dsi.fastutil.longs.Long2IntOpenHashMap"/></lhs><lhs name\="eu.fasten.core.data.ArrayImmutableDirectedGraph$Builder"><rhs name\="eu.fasten.core.data.ArrayImmutableDirectedGraph$Builder"/></lhs><lhs name\="it.unimi.dsi.fastutil.objects.Object2ObjectFunction"><rhs name\="it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap"/></lhs><lhs name\="it.unimi.dsi.fastutil.objects.Object2ObjectMap"><rhs name\="it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap"/></lhs><lhs name\="java.lang.Appendable"><rhs name\="java.io.FileWriter"/><rhs name\="java.io.OutputStreamWriter"/></lhs><lhs name\="java.io.Flushable"><rhs name\="java.io.FileWriter"/><rhs name\="java.io.OutputStreamWriter"/><rhs name\="it.unimi.dsi.fastutil.io.FastBufferedOutputStream"/></lhs><lhs name\="java.io.Writer"><rhs name\="java.io.FileWriter"/><rhs name\="java.io.OutputStreamWriter"/></lhs><lhs name\="com.arakelian.json.JsonFilterOptions"><rhs name\="com.arakelian.json.ImmutableJsonFilterOptions"/></lhs><lhs name\="com.arakelian.json.JsonFilter"><rhs name\="com.arakelian.json.JsonFilter"/></lhs><lhs name\="java.lang.Readable"><rhs name\="java.io.InputStreamReader"/></lhs><lhs name\="java.io.Reader"><rhs name\="java.io.InputStreamReader"/></lhs><lhs name\="eu.fasten.core.data.callableindex.RocksDao"><rhs name\="eu.fasten.core.data.callableindex.RocksDao"/></lhs><lhs name\="java.nio.file.OpenOption"><rhs name\="java.nio.file.StandardOpenOption"/></lhs><lhs name\="java.io.OutputStream"><rhs name\="it.unimi.dsi.fastutil.io.FastBufferedOutputStream"/></lhs><lhs name\="it.unimi.dsi.big.util.MappedFrontCodedStringBigList"><rhs name\="it.unimi.dsi.big.util.MappedFrontCodedStringBigList"/></lhs><lhs name\="it.unimi.dsi.util.XoRoShiRo128PlusPlusRandomGenerator"><rhs name\="it.unimi.dsi.util.XoRoShiRo128PlusPlusRandomGenerator"/></lhs><lhs name\="com.google.common.collect.testing.SampleElements"><rhs name\="com.google.common.collect.testing.SampleElements"/></lhs><lhs name\="it.unimi.dsi.fastutil.io.FastBufferedInputStream"><rhs name\="it.unimi.dsi.fastutil.io.FastBufferedInputStream"/></lhs><lhs name\="it.unimi.dsi.fastutil.objects.AbstractObjectBigList"><rhs name\="it.unimi.dsi.big.util.MappedFrontCodedStringBigList"/></lhs><lhs name\="it.unimi.dsi.fastutil.objects.ObjectBigList"><rhs name\="it.unimi.dsi.big.util.MappedFrontCodedStringBigList"/></lhs><lhs name\="it.unimi.dsi.fastutil.Stack"><rhs name\="it.unimi.dsi.big.util.MappedFrontCodedStringBigList"/></lhs></history> | |
7 | content_assist_number_of_computers=12 | |
8 | content_assist_proposals_background=255,255,255 | |
9 | content_assist_proposals_foreground=0,0,0 | |
10 | eclipse.preferences.version=1 | |
11 | editor_folding_enabled=false | |
12 | editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true | |
13 | formatter_profile=_LAW Conventions | |
14 | formatter_settings_version=21 | |
15 | lastRecentlyUsedFilters=org.eclipse.jdt.internal.ui.PackageExplorer.EmptyInnerPackageFilter,org.eclipse.jdt.internal.ui.PackageExplorer.EmptyPackageFilter, | |
16 | org.eclipse.buildship.ui.packageexplorer.filter.gradle.buildfolder=true | |
17 | org.eclipse.buildship.ui.packageexplorer.filter.gradle.subProject=true | |
18 | org.eclipse.jdt.internal.ui.PackageExplorer.EmptyPackageFilter=true | |
19 | org.eclipse.jdt.internal.ui.PackageExplorer.HideInnerClassFilesFilter=true | |
20 | org.eclipse.jdt.internal.ui.navigator.layout=2 | |
21 | org.eclipse.jdt.internal.ui.navigator.librariesnode=true | |
22 | org.eclipse.jdt.ui.PackageExplorer.EmptyLibraryContainerFilter=true | |
23 | org.eclipse.jdt.ui.PackageExplorer.ImportDeclarationFilter=true | |
24 | org.eclipse.jdt.ui.PackageExplorer.PackageDeclarationFilter=true | |
25 | org.eclipse.jdt.ui.PackageExplorer.SyntheticMembersFilter=true | |
26 | org.eclipse.jdt.ui.PackageExplorer_patternFilterId_.*=false | |
27 | org.eclipse.jdt.ui.exception.name=e | |
28 | org.eclipse.jdt.ui.formatterprofiles=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?>\n<profiles version\="20">\n <profile kind\="CodeFormatterProfile" name\="JGraphT" version\="20">\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment" value\="common_lines"/>\n <setting id\="org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries" value\="true"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.comment.format_javadoc_comments" value\="true"/>\n <setting id\="org.eclipse.jdt.core.formatter.indentation.size" value\="4"/>\n <setting id\="org.eclipse.jdt.core.formatter.parentheses_positions_in_enum_constant_declaration" value\="common_lines"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.align_with_spaces" value\="false"/>\n <setting id\="org.eclipse.jdt.core.formatter.continuation_indentation" value\="1"/>\n <setting id\="org.eclipse.jdt.core.formatter.number_of_blank_lines_before_code_block" value\="0"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_switch_case_expressions" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.blank_lines_after_package" value\="1"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant" value\="48"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.comment.indent_root_tags" value\="true"/>\n <setting id\="org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch" value\="true"/>\n <setting id\="org.eclipse.jdt.core.formatter.enabling_tag" value\="@formatter\:on"/>\n <setting id\="org.eclipse.jdt.core.formatter.comment.count_line_length_from_starting_position" value\="false"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_record_components" value\="32"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value\="17"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.wrap_before_multiplicative_operator" value\="true"/>\n <setting id\="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line" value\="false"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references" value\="16"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_logical_operator" value\="16"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.keep_annotation_declaration_on_one_line" value\="one_line_never"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_record_declaration" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_enum_constant" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_multiplicative_operator" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments" value\="false"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.blank_lines_before_abstract_method" value\="1"/>\n <setting id\="org.eclipse.jdt.core.formatter.keep_enum_constant_declaration_on_one_line" value\="one_line_never"/>\n <setting id\="org.eclipse.jdt.core.formatter.align_variable_declarations_on_columns" value\="false"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch" value\="32"/>\n <setting id\="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body" value\="0"/>\n <setting id\="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" value\="false"/>\n <setting id\="org.eclipse.jdt.core.formatter.parentheses_positions_in_catch_clause" value\="common_lines"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call" value\="32"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_multiplicative_operator" value\="16"/>\n <setting id\="org.eclipse.jdt.core.formatter.keep_anonymous_type_declaration_on_one_line" value\="one_line_never"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_switch_case_expressions" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.wrap_before_shift_operator" value\="true"/>\n <setting id\="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header" value\="true"/>\n <setting id\="org.eclipse.jdt.core.formatter.brace_position_for_block" value\="next_line_on_wrap"/>\n <setting id\="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_code_block" value\="0"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_bitwise_operator" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value\="true"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration" value\="32"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_type_parameters" value\="16"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_compact_loops" value\="16"/>\n <setting id\="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment" value\="false"/>\n <setting id\="org.eclipse.jdt.core.formatter.keep_simple_for_body_on_same_line" value\="false"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column" value\="true"/>\n <setting id\="org.eclipse.jdt.core.formatter.parentheses_positions_in_annotation" value\="common_lines"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_enum_constant" value\="0"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.text_block_indentation" value\="0"/>\n <setting id\="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value\="false"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_assignment" value\="16"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_module_statements" value\="16"/>\n <setting id\="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header" value\="true"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.comment.align_tags_names_descriptions" value\="false"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.keep_if_then_body_block_on_one_line" value\="one_line_never"/>\n <setting id\="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration" value\="0"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line" value\="false"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.align_assignment_statements_on_columns" value\="false"/>\n <setting id\="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case" value\="end_of_line"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression_chain" value\="0"/>\n <setting id\="org.eclipse.jdt.core.formatter.comment.format_header" value\="false"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_type_annotations" value\="0"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression" value\="32"/>\n <setting id\="org.eclipse.jdt.core.formatter.wrap_before_assertion_message_operator" value\="true"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_method_declaration" value\="0"/>\n <setting id\="org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines" value\="2147483647"/>\n <setting id\="org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries" value\="true"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_bitwise_operator" value\="16"/>\n <setting id\="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration" value\="next_line"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_resources_in_try" value\="32"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation" value\="32"/>\n <setting id\="org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column" value\="false"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.comment.format_source_code" value\="true"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.blank_lines_before_field" value\="0"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.blank_lines_before_method" value\="1"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" value\="17"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_not_operator" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.comment.format_html" value\="true"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.parentheses_positions_in_method_delcaration" value\="common_lines"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_compact_if" value\="16"/>\n <setting id\="org.eclipse.jdt.core.formatter.indent_empty_lines" value\="false"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_type_arguments" value\="16"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation" value\="0"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_package" value\="0"/>\n <setting id\="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch" value\="false"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_new_line_after_label" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header" value\="true"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_case" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_record_header" value\="true"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases" value\="true"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.wrap_before_bitwise_operator" value\="true"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.comment.indent_tag_description" value\="false"/>\n <setting id\="org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line" value\="false"/>\n <setting id\="org.eclipse.jdt.core.formatter.brace_position_for_record_constructor" value\="next_line"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_string_concatenation" value\="16"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields" value\="16"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.brace_position_for_array_initializer" value\="end_of_line"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_shift_operator" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_shift_operator" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.keep_simple_do_while_body_on_same_line" value\="false"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_record_components" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested" value\="true"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_for_loop_header" value\="16"/>\n <setting id\="org.eclipse.jdt.core.formatter.wrap_before_additive_operator" value\="true"/>\n <setting id\="org.eclipse.jdt.core.formatter.keep_simple_getter_setter_on_one_line" value\="false"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_string_concatenation" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.join_lines_in_comments" value\="true"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_record_declaration" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_relational_operator" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.blank_lines_between_import_groups" value\="1"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_logical_operator" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.parentheses_positions_in_method_invocation" value\="common_lines"/>\n <setting id\="org.eclipse.jdt.core.formatter.blank_lines_after_imports" value\="1"/>\n <setting id\="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.parentheses_positions_in_record_declaration" value\="common_lines"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.parentheses_positions_in_switch_statement" value\="common_lines"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_default" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.disabling_tag" value\="@formatter\:off"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value\="49"/>\n <setting id\="org.eclipse.jdt.core.formatter.blank_lines_before_imports" value\="1"/>\n <setting id\="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_method_body" value\="0"/>\n <setting id\="org.eclipse.jdt.core.formatter.parentheses_positions_in_if_while_statement" value\="common_lines"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_case" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations" value\="1"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column" value\="false"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.indent_statements_compare_to_block" value\="true"/>\n <setting id\="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value\="next_line"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.comment.align_tags_descriptions_grouped" value\="false"/>\n <setting id\="org.eclipse.jdt.core.formatter.comment.line_length" value\="100"/>\n <setting id\="org.eclipse.jdt.core.formatter.use_on_off_tags" value\="true"/>\n <setting id\="org.eclipse.jdt.core.formatter.keep_method_body_on_one_line" value\="one_line_never"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.keep_loop_body_block_on_one_line" value\="one_line_never"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration" value\="next_line"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.keep_type_declaration_on_one_line" value\="one_line_never"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_additive_operator" value\="16"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_record_constructor" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_relational_operator" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.keep_record_declaration_on_one_line" value\="one_line_never"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration" value\="next_line"/>\n <setting id\="org.eclipse.jdt.core.formatter.brace_position_for_lambda_body" value\="end_of_line"/>\n <setting id\="org.eclipse.jdt.core.formatter.compact_else_if" value\="true"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" value\="32"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" value\="17"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_parameter" value\="0"/>\n <setting id\="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment" value\="false"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_relational_operator" value\="0"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer" value\="16"/>\n <setting id\="org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve" value\="1"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_additive_operator" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_string_concatenation" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.comment.format_line_comments" value\="true"/>\n <setting id\="org.eclipse.jdt.core.formatter.brace_position_for_record_declaration" value\="next_line"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.number_of_blank_lines_after_code_block" value\="0"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration" value\="17"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression" value\="16"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_type" value\="49"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_local_variable" value\="0"/>\n <setting id\="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration" value\="next_line"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_default" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.comment.insert_new_line_between_different_tags" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_additive_operator" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.join_wrapped_lines" value\="true"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_field" value\="49"/>\n <setting id\="org.eclipse.jdt.core.formatter.wrap_before_conditional_operator" value\="true"/>\n <setting id\="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases" value\="true"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_shift_operator" value\="0"/>\n <setting id\="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations" value\="false"/>\n <setting id\="org.eclipse.jdt.core.formatter.parentheses_positions_in_try_clause" value\="common_lines"/>\n <setting id\="org.eclipse.jdt.core.formatter.keep_code_block_on_one_line" value\="one_line_never"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_record_components" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.tabulation.size" value\="4"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_bitwise_operator" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer" value\="1"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_record_declaration" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration" value\="17"/>\n <setting id\="org.eclipse.jdt.core.formatter.wrap_before_assignment_operator" value\="false"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.brace_position_for_switch" value\="end_of_line"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.keep_lambda_body_block_on_one_line" value\="one_line_never"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_method" value\="49"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.keep_record_constructor_on_one_line" value\="one_line_never"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_record_declaration" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line" value\="false"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_assertion_message" value\="0"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk" value\="1"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.blank_lines_before_member_type" value\="1"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_logical_operator" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression" value\="32"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_record_declaration" value\="17"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_semicolon" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.wrap_before_relational_operator" value\="true"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.comment.format_block_comments" value\="true"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration" value\="32"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.blank_lines_after_last_class_body_declaration" value\="0"/>\n <setting id\="org.eclipse.jdt.core.formatter.indent_statements_compare_to_body" value\="true"/>\n <setting id\="org.eclipse.jdt.core.formatter.keep_simple_while_body_on_same_line" value\="false"/>\n <setting id\="org.eclipse.jdt.core.formatter.wrap_before_logical_operator" value\="true"/>\n <setting id\="org.eclipse.jdt.core.formatter.blank_lines_between_statement_group_in_switch" value\="0"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.parentheses_positions_in_lambda_declaration" value\="common_lines"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.keep_enum_declaration_on_one_line" value\="one_line_never"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant" value\="next_line"/>\n <setting id\="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration" value\="next_line"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_multiplicative_operator" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.blank_lines_before_package" value\="0"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header" value\="true"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.comment.indent_parameter_description" value\="false"/>\n <setting id\="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_code_block" value\="0"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.tabulation.char" value\="space"/>\n <setting id\="org.eclipse.jdt.core.formatter.wrap_before_string_concatenation" value\="true"/>\n <setting id\="org.eclipse.jdt.core.formatter.lineSplit" value\="100"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch" value\="insert"/>\n </profile>\n <profile kind\="CodeFormatterProfile" name\="LAW Conventions" version\="20">\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment" value\="common_lines"/>\n <setting id\="org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries" value\="true"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.comment.format_javadoc_comments" value\="true"/>\n <setting id\="org.eclipse.jdt.core.formatter.indentation.size" value\="8"/>\n <setting id\="org.eclipse.jdt.core.formatter.parentheses_positions_in_enum_constant_declaration" value\="common_lines"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.align_with_spaces" value\="false"/>\n <setting id\="org.eclipse.jdt.core.formatter.continuation_indentation" value\="2"/>\n <setting id\="org.eclipse.jdt.core.formatter.number_of_blank_lines_before_code_block" value\="0"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_switch_case_expressions" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.blank_lines_after_package" value\="1"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant" value\="0"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.comment.indent_root_tags" value\="true"/>\n <setting id\="org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch" value\="true"/>\n <setting id\="org.eclipse.jdt.core.formatter.enabling_tag" value\="@formatter\:on"/>\n <setting id\="org.eclipse.jdt.core.formatter.comment.count_line_length_from_starting_position" value\="true"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_record_components" value\="0"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value\="0"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.wrap_before_multiplicative_operator" value\="true"/>\n <setting id\="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line" value\="true"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references" value\="0"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_logical_operator" value\="0"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.keep_annotation_declaration_on_one_line" value\="one_line_never"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_record_declaration" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_enum_constant" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_multiplicative_operator" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments" value\="false"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.blank_lines_before_abstract_method" value\="1"/>\n <setting id\="org.eclipse.jdt.core.formatter.keep_enum_constant_declaration_on_one_line" value\="one_line_never"/>\n <setting id\="org.eclipse.jdt.core.formatter.align_variable_declarations_on_columns" value\="false"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch" value\="0"/>\n <setting id\="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body" value\="0"/>\n <setting id\="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" value\="true"/>\n <setting id\="org.eclipse.jdt.core.formatter.parentheses_positions_in_catch_clause" value\="common_lines"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call" value\="0"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_multiplicative_operator" value\="0"/>\n <setting id\="org.eclipse.jdt.core.formatter.keep_anonymous_type_declaration_on_one_line" value\="one_line_never"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_switch_case_expressions" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.wrap_before_shift_operator" value\="true"/>\n <setting id\="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header" value\="true"/>\n <setting id\="org.eclipse.jdt.core.formatter.brace_position_for_block" value\="end_of_line"/>\n <setting id\="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_code_block" value\="0"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_bitwise_operator" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value\="true"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration" value\="0"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_type_parameters" value\="0"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_compact_loops" value\="0"/>\n <setting id\="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment" value\="false"/>\n <setting id\="org.eclipse.jdt.core.formatter.keep_simple_for_body_on_same_line" value\="true"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column" value\="true"/>\n <setting id\="org.eclipse.jdt.core.formatter.parentheses_positions_in_annotation" value\="common_lines"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_enum_constant" value\="49"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.text_block_indentation" value\="0"/>\n <setting id\="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value\="false"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_assignment" value\="0"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_module_statements" value\="16"/>\n <setting id\="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header" value\="true"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.comment.align_tags_names_descriptions" value\="false"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.keep_if_then_body_block_on_one_line" value\="one_line_never"/>\n <setting id\="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration" value\="0"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line" value\="false"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.align_assignment_statements_on_columns" value\="false"/>\n <setting id\="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case" value\="end_of_line"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression_chain" value\="0"/>\n <setting id\="org.eclipse.jdt.core.formatter.comment.format_header" value\="false"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_type_annotations" value\="0"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression" value\="0"/>\n <setting id\="org.eclipse.jdt.core.formatter.wrap_before_assertion_message_operator" value\="true"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_method_declaration" value\="0"/>\n <setting id\="org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines" value\="2147483647"/>\n <setting id\="org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries" value\="true"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_bitwise_operator" value\="0"/>\n <setting id\="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration" value\="end_of_line"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_resources_in_try" value\="0"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation" value\="0"/>\n <setting id\="org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column" value\="false"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.comment.format_source_code" value\="true"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.blank_lines_before_field" value\="0"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.blank_lines_before_method" value\="1"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" value\="0"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_not_operator" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.comment.format_html" value\="true"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.parentheses_positions_in_method_delcaration" value\="common_lines"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_compact_if" value\="0"/>\n <setting id\="org.eclipse.jdt.core.formatter.indent_empty_lines" value\="false"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_type_arguments" value\="0"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation" value\="0"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_package" value\="49"/>\n <setting id\="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch" value\="false"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_new_line_after_label" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header" value\="true"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_case" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_record_header" value\="true"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases" value\="true"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.wrap_before_bitwise_operator" value\="true"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.comment.indent_tag_description" value\="false"/>\n <setting id\="org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line" value\="false"/>\n <setting id\="org.eclipse.jdt.core.formatter.brace_position_for_record_constructor" value\="end_of_line"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_string_concatenation" value\="0"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields" value\="16"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.brace_position_for_array_initializer" value\="end_of_line"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_shift_operator" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_shift_operator" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.keep_simple_do_while_body_on_same_line" value\="true"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_record_components" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested" value\="true"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_for_loop_header" value\="0"/>\n <setting id\="org.eclipse.jdt.core.formatter.wrap_before_additive_operator" value\="true"/>\n <setting id\="org.eclipse.jdt.core.formatter.keep_simple_getter_setter_on_one_line" value\="false"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_string_concatenation" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.join_lines_in_comments" value\="true"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_record_declaration" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_relational_operator" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.blank_lines_between_import_groups" value\="1"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_logical_operator" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.parentheses_positions_in_method_invocation" value\="common_lines"/>\n <setting id\="org.eclipse.jdt.core.formatter.blank_lines_after_imports" value\="1"/>\n <setting id\="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.parentheses_positions_in_record_declaration" value\="common_lines"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.parentheses_positions_in_switch_statement" value\="common_lines"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_default" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.disabling_tag" value\="@formatter\:off"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value\="0"/>\n <setting id\="org.eclipse.jdt.core.formatter.blank_lines_before_imports" value\="1"/>\n <setting id\="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_method_body" value\="0"/>\n <setting id\="org.eclipse.jdt.core.formatter.parentheses_positions_in_if_while_statement" value\="common_lines"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_case" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations" value\="1"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column" value\="false"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.indent_statements_compare_to_block" value\="true"/>\n <setting id\="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value\="end_of_line"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.comment.align_tags_descriptions_grouped" value\="false"/>\n <setting id\="org.eclipse.jdt.core.formatter.comment.line_length" value\="100"/>\n <setting id\="org.eclipse.jdt.core.formatter.use_on_off_tags" value\="false"/>\n <setting id\="org.eclipse.jdt.core.formatter.keep_method_body_on_one_line" value\="one_line_never"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.keep_loop_body_block_on_one_line" value\="one_line_never"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration" value\="end_of_line"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.keep_type_declaration_on_one_line" value\="one_line_never"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_additive_operator" value\="0"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_record_constructor" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_relational_operator" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.keep_record_declaration_on_one_line" value\="one_line_never"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration" value\="end_of_line"/>\n <setting id\="org.eclipse.jdt.core.formatter.brace_position_for_lambda_body" value\="end_of_line"/>\n <setting id\="org.eclipse.jdt.core.formatter.compact_else_if" value\="true"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" value\="0"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" value\="0"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_parameter" value\="0"/>\n <setting id\="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment" value\="false"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_relational_operator" value\="0"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer" value\="16"/>\n <setting id\="org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve" value\="1"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_additive_operator" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_string_concatenation" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.comment.format_line_comments" value\="true"/>\n <setting id\="org.eclipse.jdt.core.formatter.brace_position_for_record_declaration" value\="end_of_line"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.number_of_blank_lines_after_code_block" value\="0"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration" value\="0"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression" value\="0"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_type" value\="49"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_local_variable" value\="49"/>\n <setting id\="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration" value\="end_of_line"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_default" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.comment.insert_new_line_between_different_tags" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_additive_operator" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.join_wrapped_lines" value\="true"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_field" value\="49"/>\n <setting id\="org.eclipse.jdt.core.formatter.wrap_before_conditional_operator" value\="true"/>\n <setting id\="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases" value\="true"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_shift_operator" value\="0"/>\n <setting id\="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations" value\="false"/>\n <setting id\="org.eclipse.jdt.core.formatter.parentheses_positions_in_try_clause" value\="common_lines"/>\n <setting id\="org.eclipse.jdt.core.formatter.keep_code_block_on_one_line" value\="one_line_never"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_record_components" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.tabulation.size" value\="4"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_bitwise_operator" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer" value\="2"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_record_declaration" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration" value\="0"/>\n <setting id\="org.eclipse.jdt.core.formatter.wrap_before_assignment_operator" value\="false"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.brace_position_for_switch" value\="end_of_line"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.keep_lambda_body_block_on_one_line" value\="one_line_never"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_method" value\="49"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.keep_record_constructor_on_one_line" value\="one_line_never"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_record_declaration" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line" value\="false"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_assertion_message" value\="0"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk" value\="1"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.blank_lines_before_member_type" value\="1"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_logical_operator" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression" value\="0"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_record_declaration" value\="0"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_semicolon" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.wrap_before_relational_operator" value\="true"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.comment.format_block_comments" value\="false"/>\n <setting id\="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration" value\="0"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.blank_lines_after_last_class_body_declaration" value\="0"/>\n <setting id\="org.eclipse.jdt.core.formatter.indent_statements_compare_to_body" value\="true"/>\n <setting id\="org.eclipse.jdt.core.formatter.keep_simple_while_body_on_same_line" value\="true"/>\n <setting id\="org.eclipse.jdt.core.formatter.wrap_before_logical_operator" value\="true"/>\n <setting id\="org.eclipse.jdt.core.formatter.blank_lines_between_statement_group_in_switch" value\="0"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.parentheses_positions_in_lambda_declaration" value\="common_lines"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.keep_enum_declaration_on_one_line" value\="one_line_never"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant" value\="end_of_line"/>\n <setting id\="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration" value\="end_of_line"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_multiplicative_operator" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.blank_lines_before_package" value\="0"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header" value\="true"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional" value\="insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.comment.indent_parameter_description" value\="true"/>\n <setting id\="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_code_block" value\="0"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.tabulation.char" value\="tab"/>\n <setting id\="org.eclipse.jdt.core.formatter.wrap_before_string_concatenation" value\="true"/>\n <setting id\="org.eclipse.jdt.core.formatter.lineSplit" value\="120"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation" value\="do not insert"/>\n <setting id\="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch" value\="insert"/>\n </profile>\n</profiles>\n | |
29 | org.eclipse.jdt.ui.formatterprofiles.version=21 | |
30 | org.eclipse.jdt.ui.gettersetter.use.is=true | |
31 | org.eclipse.jdt.ui.overrideannotation=true | |
32 | org.eclipse.jdt.ui.text.code_templates_migrated=true | |
33 | org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates/> | |
34 | org.eclipse.jdt.ui.text.custom_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates/> | |
35 | org.eclipse.jdt.ui.text.templates_migrated=true | |
36 | sourceHoverBackgroundColor=236,235,236 | |
37 | sp_cleanup.add_all=false | |
38 | sp_cleanup.add_default_serial_version_id=true | |
39 | sp_cleanup.add_generated_serial_version_id=false | |
40 | sp_cleanup.add_missing_annotations=true | |
41 | sp_cleanup.add_missing_deprecated_annotations=true | |
42 | sp_cleanup.add_missing_methods=false | |
43 | sp_cleanup.add_missing_nls_tags=false | |
44 | sp_cleanup.add_missing_override_annotations=true | |
45 | sp_cleanup.add_missing_override_annotations_interface_methods=true | |
46 | sp_cleanup.add_serial_version_id=false | |
47 | sp_cleanup.always_use_blocks=false | |
48 | sp_cleanup.always_use_parentheses_in_expressions=false | |
49 | sp_cleanup.always_use_this_for_non_static_field_access=false | |
50 | sp_cleanup.always_use_this_for_non_static_method_access=false | |
51 | sp_cleanup.arrays_fill=false | |
52 | sp_cleanup.bitwise_conditional_expression=false | |
53 | sp_cleanup.boolean_literal=false | |
54 | sp_cleanup.break_loop=false | |
55 | sp_cleanup.collection_cloning=false | |
56 | sp_cleanup.comparison_statement=false | |
57 | sp_cleanup.convert_functional_interfaces=true | |
58 | sp_cleanup.convert_to_enhanced_for_loop=true | |
59 | sp_cleanup.convert_to_enhanced_for_loop_if_loop_var_used=false | |
60 | sp_cleanup.convert_to_switch_expressions=false | |
61 | sp_cleanup.correct_indentation=false | |
62 | sp_cleanup.double_negation=false | |
63 | sp_cleanup.else_if=false | |
64 | sp_cleanup.embedded_if=false | |
65 | sp_cleanup.evaluate_nullable=false | |
66 | sp_cleanup.format_source_code=true | |
67 | sp_cleanup.format_source_code_changes_only=true | |
68 | sp_cleanup.hash=false | |
69 | sp_cleanup.if_condition=false | |
70 | sp_cleanup.insert_inferred_type_arguments=false | |
71 | sp_cleanup.instanceof=false | |
72 | sp_cleanup.join=false | |
73 | sp_cleanup.lazy_logical_operator=false | |
74 | sp_cleanup.make_local_variable_final=true | |
75 | sp_cleanup.make_parameters_final=true | |
76 | sp_cleanup.make_private_fields_final=true | |
77 | sp_cleanup.make_type_abstract_if_missing_method=false | |
78 | sp_cleanup.make_variable_declarations_final=true | |
79 | sp_cleanup.map_cloning=false | |
80 | sp_cleanup.merge_conditional_blocks=false | |
81 | sp_cleanup.never_use_blocks=true | |
82 | sp_cleanup.never_use_parentheses_in_expressions=true | |
83 | sp_cleanup.no_string_creation=false | |
84 | sp_cleanup.no_super=false | |
85 | sp_cleanup.number_suffix=false | |
86 | sp_cleanup.objects_equals=false | |
87 | sp_cleanup.on_save_use_additional_actions=true | |
88 | sp_cleanup.organize_imports=true | |
89 | sp_cleanup.overridden_assignment=false | |
90 | sp_cleanup.precompile_regex=false | |
91 | sp_cleanup.primitive_serialization=false | |
92 | sp_cleanup.pull_up_assignment=false | |
93 | sp_cleanup.push_down_negation=false | |
94 | sp_cleanup.qualify_static_field_accesses_with_declaring_class=false | |
95 | sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true | |
96 | sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true | |
97 | sp_cleanup.qualify_static_member_accesses_with_declaring_class=false | |
98 | sp_cleanup.qualify_static_method_accesses_with_declaring_class=false | |
99 | sp_cleanup.redundant_falling_through_block_end=false | |
100 | sp_cleanup.remove_private_constructors=true | |
101 | sp_cleanup.remove_redundant_modifiers=false | |
102 | sp_cleanup.remove_redundant_semicolons=true | |
103 | sp_cleanup.remove_redundant_type_arguments=true | |
104 | sp_cleanup.remove_trailing_whitespaces=true | |
105 | sp_cleanup.remove_trailing_whitespaces_all=true | |
106 | sp_cleanup.remove_trailing_whitespaces_ignore_empty=false | |
107 | sp_cleanup.remove_unnecessary_array_creation=false | |
108 | sp_cleanup.remove_unnecessary_casts=true | |
109 | sp_cleanup.remove_unnecessary_nls_tags=false | |
110 | sp_cleanup.remove_unused_imports=true | |
111 | sp_cleanup.remove_unused_local_variables=false | |
112 | sp_cleanup.remove_unused_private_fields=true | |
113 | sp_cleanup.remove_unused_private_members=false | |
114 | sp_cleanup.remove_unused_private_methods=true | |
115 | sp_cleanup.remove_unused_private_types=true | |
116 | sp_cleanup.simplify_lambda_expression_and_method_ref=false | |
117 | sp_cleanup.sort_members=false | |
118 | sp_cleanup.sort_members_all=false | |
119 | sp_cleanup.strictly_equal_or_different=false | |
120 | sp_cleanup.stringbuilder=false | |
121 | sp_cleanup.switch=false | |
122 | sp_cleanup.ternary_operator=false | |
123 | sp_cleanup.try_with_resource=false | |
124 | sp_cleanup.use_anonymous_class_creation=false | |
125 | sp_cleanup.use_autoboxing=false | |
126 | sp_cleanup.use_blocks=false | |
127 | sp_cleanup.use_blocks_only_for_return_and_throw=false | |
128 | sp_cleanup.use_directly_map_method=false | |
129 | sp_cleanup.use_lambda=true | |
130 | sp_cleanup.use_parentheses_in_expressions=false | |
131 | sp_cleanup.use_this_for_non_static_field_access=false | |
132 | sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true | |
133 | sp_cleanup.use_this_for_non_static_method_access=false | |
134 | sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true | |
135 | sp_cleanup.use_unboxing=false | |
136 | sp_cleanup.use_var=false | |
137 | sp_cleanup.useless_continue=false | |
138 | sp_cleanup.useless_return=false | |
139 | spelling_ignore_ampersand_in_properties=true | |
140 | spelling_ignore_digits=true | |
141 | spelling_ignore_java_strings=true | |
142 | spelling_ignore_mixed=true | |
143 | spelling_ignore_non_letters=true | |
144 | spelling_ignore_sentence=true | |
145 | spelling_ignore_single_letters=true | |
146 | spelling_ignore_upper=true | |
147 | spelling_ignore_urls=true | |
148 | spelling_locale_initialized=true | |
149 | spelling_user_dictionary=/Users/vigna/.aspell.en.pws | |
150 | spelling_user_dictionary_encoding= | |
151 | useAnnotationsPrefPage=true | |
152 | useQuickDiffPrefPage=true |
0 | 8.5.8 | |
1 | ||
2 | - Fixed erroneous switch to Java 9. | |
3 | ||
4 | - BinIO has been restructured to use java.nio whenever possible, and all | |
5 | load/store methods now accept a byte order. The performance improvements | |
6 | are very significant, in particular when handling data in native byte | |
7 | order. | |
8 | ||
9 | - Switched naming for mapped list to the standard type-first format. | |
10 | Hopefully this should not hurt anyone. | |
11 | ||
12 | 8.5.7 | |
13 | ||
14 | - Memory-mapped big lists. | |
15 | ||
16 | - Because of a wrong threshold radix sort in certain cases was much slower | |
17 | than it should have been. Thanks to Johan Nystrom-Persson for reporting | |
18 | this bug. | |
19 | ||
20 | - Fixed subtle bug in OpenHashMap.merge(). Thanks to Ben Manes for | |
21 | discovering this bug using Guava's testlib. | |
22 | ||
23 | - Fixed other minor divergences from JDK's behavior detected by | |
24 | Guava's testlib. | |
25 | ||
0 | 26 | 8.5.6 |
1 | 27 | |
2 | 28 | - Fixed broken export clause which was preventing it.unimi.dsi.fastutil |
0 | 0 | # Welcome to fastutil |
1 | 1 | |
2 | [fastutil](http://fastutil.di.unimi.it/) is a collection of type-specific | |
3 | Java classes that extend the Java Collections Framework by providing | |
4 | several containers, such as maps, sets, lists and prority queues, | |
5 | implementing the interfaces of the java.util package; it also provides big | |
6 | (64-bit) arrays, sets, lists, and fast, practical I/O classes for binary | |
7 | and text files. | |
8 | ||
9 | fastutil provides a huge collection of specialized classes generated | |
10 | starting from a parameterized version; the classes are much more compact | |
11 | and much faster than the general ones. Please read the package | |
12 | documentation for more information. | |
2 | [fastutil](http://fastutil.di.unimi.it/) extends the Java Collections | |
3 | Framework by providing type-specific maps, sets, lists, and queues with a | |
4 | small memory footprint and fast access and insertion; it provides also big | |
5 | (64-bit) arrays, sets, and lists, sorting algorithms, fast, practical I/O | |
6 | classes for binary and text files, and facilities for memory mapping large | |
7 | files. | |
13 | 8 | |
14 | 9 | Since version 8.5.5, fastutil is split into two jars for convenience: |
15 | 10 |
1 | 1 | - Check that binary insertion sort is maybe better |
2 | 2 | - radix sort for big arrays |
3 | 3 | - Navigable sets and maps |
4 | - Front-Coded Array BIG lists | |
5 | 4 | - Make digit array in radix sort shorter |
6 | 5 | - FastIterable interface |
7 | 6 | - Try tripartite quickSort or TimSort for generic sorting. |
98 | 98 | </target> |
99 | 99 | |
100 | 100 | <target name="pom-core" description="insert version into pom (core)"> |
101 | <copy tofile="pom-core.xml" file="pom-core-model.xml"> | |
101 | <copy tofile="pom-core.xml" file="pom-core-model.xml" overwrite="true"> | |
102 | 102 | <filterset> |
103 | 103 | <filter token="VERSION" value="${version}"/> |
104 | 104 | </filterset> |
106 | 106 | </target> |
107 | 107 | |
108 | 108 | <target name="pom" description="insert version into pom"> |
109 | <copy tofile="pom.xml" file="pom-model.xml"> | |
109 | <copy tofile="pom.xml" file="pom-model.xml" overwrite="true"> | |
110 | 110 | <filterset> |
111 | 111 | <filter token="VERSION" value="${version}"/> |
112 | 112 | </filterset> |
0 | 0 | /* |
1 | * Copyright (C) 2002-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2002-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
292 | 292 | * @param k the key |
293 | 293 | * @return a node with key k. If a node with key k already exists, then that node is returned, |
294 | 294 | * otherwise a new node with defRetValue is created ensuring that the tree is balanced |
295 | after creation of the node. | |
295 | * after creation of the node. | |
296 | 296 | */ |
297 | 297 | private Entry KEY_VALUE_GENERIC add(final KEY_GENERIC_TYPE k) { |
298 | /* After execution of this method, modified is true iff a new entry has | |
299 | been inserted. */ | |
298 | REQUIRE_KEY_NON_NULL(k) | |
299 | /* After execution of this method, modified is true iff a new entry has been inserted. */ | |
300 | 300 | modified = false; |
301 | 301 | |
302 | 302 | Entry KEY_VALUE_GENERIC e = null; |
1062 | 1062 | SUPPRESS_WARNINGS_KEY_UNCHECKED |
1063 | 1063 | @Override |
1064 | 1064 | public boolean containsKey(final KEY_TYPE k) { |
1065 | RETURN_FALSE_IF_KEY_NULL(k) | |
1065 | 1066 | return findKey(KEY_GENERIC_CAST k) != null; |
1066 | 1067 | } |
1067 | 1068 | |
1213 | 1214 | |
1214 | 1215 | |
1215 | 1216 | @Override |
1217 | SUPPRESS_WARNINGS_KEY_UNCHECKED | |
1216 | 1218 | public ObjectSortedSet<MAP.Entry KEY_VALUE_GENERIC> ENTRYSET() { |
1217 | 1219 | if (entries == null) entries = new AbstractObjectSortedSet<MAP.Entry KEY_VALUE_GENERIC>() { |
1218 | final Comparator<? super MAP.Entry KEY_VALUE_GENERIC> comparator = (Comparator<MAP.Entry KEY_VALUE_GENERIC>) (x, y) -> AVL_TREE_MAP.this.actualComparator.compare(x.ENTRY_GET_KEY(), y.ENTRY_GET_KEY()); | |
1220 | final Comparator<? super MAP.Entry KEY_VALUE_GENERIC> comparator = (AVL_TREE_MAP.this.actualComparator == null ? | |
1221 | (Comparator<MAP.Entry KEY_VALUE_GENERIC>) (x, y) -> KEY_CMP(x.ENTRY_GET_KEY(), y.ENTRY_GET_KEY()) : | |
1222 | (Comparator<MAP.Entry KEY_VALUE_GENERIC>) (x, y) -> AVL_TREE_MAP.this.actualComparator.compare(x.ENTRY_GET_KEY(), y.ENTRY_GET_KEY()) | |
1223 | ); | |
1219 | 1224 | |
1220 | 1225 | @Override |
1221 | 1226 | public Comparator<? super MAP.Entry KEY_VALUE_GENERIC> comparator() { return comparator; } |
1229 | 1234 | @Override |
1230 | 1235 | SUPPRESS_WARNINGS_KEY_UNCHECKED |
1231 | 1236 | public boolean contains(final Object o) { |
1232 | if (!(o instanceof Map.Entry)) return false; | |
1237 | if (o == null || !(o instanceof Map.Entry)) return false; | |
1233 | 1238 | final Map.Entry<?,?> e = (Map.Entry<?,?>)o; |
1239 | if (e.getKey() == null) return false; | |
1234 | 1240 | #if KEYS_PRIMITIVE |
1235 | if (e.getKey() == null || ! (e.getKey() instanceof KEY_CLASS)) return false; | |
1241 | if (! (e.getKey() instanceof KEY_CLASS)) return false; | |
1236 | 1242 | #endif |
1237 | 1243 | #if VALUES_PRIMITIVE |
1238 | 1244 | if (e.getValue() == null || ! (e.getValue() instanceof VALUE_CLASS)) return false; |
1246 | 1252 | public boolean remove(final Object o) { |
1247 | 1253 | if (!(o instanceof Map.Entry)) return false; |
1248 | 1254 | final Map.Entry<?,?> e = (Map.Entry<?,?>)o; |
1255 | if (e.getKey() == null) return false; | |
1249 | 1256 | #if KEYS_PRIMITIVE |
1250 | 1257 | if (e.getKey() == null || ! (e.getKey() instanceof KEY_CLASS)) return false; |
1251 | 1258 | #endif |
1252 | 1259 | #if VALUES_PRIMITIVE |
1253 | if (e.getValue() == null || ! (e.getValue() instanceof VALUE_CLASS)) return false; | |
1260 | if (! (e.getValue() instanceof VALUE_CLASS)) return false; | |
1254 | 1261 | #endif |
1255 | 1262 | final Entry KEY_VALUE_GENERIC f = findKey(KEY_OBJ2TYPE(KEY_GENERIC_CAST e.getKey())); |
1256 | 1263 | if (f == null || ! VALUE_EQUALS(f.ENTRY_GET_VALUE(), VALUE_OBJ2TYPE(e.getValue()))) return false; |
1526 | 1533 | @Override |
1527 | 1534 | SUPPRESS_WARNINGS_KEY_UNCHECKED |
1528 | 1535 | public boolean containsKey(final KEY_TYPE k) { |
1536 | RETURN_FALSE_IF_KEY_NULL(k) | |
1529 | 1537 | return in(KEY_GENERIC_CAST k) && AVL_TREE_MAP.this.containsKey(k); |
1530 | 1538 | } |
1531 | 1539 |
0 | 0 | /* |
1 | * Copyright (C) 2002-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2002-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
287 | 287 | |
288 | 288 | @Override |
289 | 289 | public boolean add(final KEY_GENERIC_TYPE k) { |
290 | REQUIRE_KEY_NON_NULL(k) | |
290 | 291 | |
291 | 292 | if (tree == null) { // The case of the empty tree is treated separately. |
292 | 293 | count++; |
0 | 0 | /* |
1 | * Copyright (C) 2002-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2002-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
18 | 18 | |
19 | 19 | /** An abstract class facilitating the creation of type-specific {@linkplain it.unimi.dsi.fastutil.BidirectionalIterator bidirectional iterators}. |
20 | 20 | * |
21 | * @deprecated As of fastutil 8 this class is no longer necessary, as its previous abstract | |
21 | * @deprecated As of {@code fastutil} 8 this class is no longer necessary, as its previous abstract | |
22 | 22 | * methods are now default methods of the type-specific interface. |
23 | 23 | */ |
24 | 24 |
0 | 0 | /* |
1 | * Copyright (C) 2010-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2010-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2002-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2002-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
18 | 18 | |
19 | 19 | /** An abstract class facilitating the creation of type-specific {@linkplain it.unimi.dsi.fastutil.BigListIterator big-list iterators}. |
20 | 20 | * |
21 | * @deprecated As of fastutil 8 this class is no longer necessary, as its previous abstract | |
21 | * @deprecated As of {@code fastutil} 8 this class is no longer necessary, as its previous abstract | |
22 | 22 | * methods are now default methods of the type-specific interface. |
23 | 23 | */ |
24 | 24 |
0 | 0 | /* |
1 | * Copyright (C) 2002-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2002-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
83 | 83 | /** {@inheritDoc} |
84 | 84 | * @deprecated Please use the corresponding type-specific method instead. |
85 | 85 | */ |
86 | @SuppressWarnings("deprecation") | |
87 | 86 | @Deprecated |
88 | 87 | @Override |
89 | 88 | public boolean add(final KEY_GENERIC_CLASS key) { |
0 | 0 | /* |
1 | * Copyright (C) 2002-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2002-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
19 | 19 | /** An abstract class facilitating the creation of type-specific {@linkplain java.util.Comparator comparators}. |
20 | 20 | * |
21 | 21 | * @see java.util.Comparator |
22 | * @deprecated As of fastutil 8 this class is no longer necessary, as its only previous abstract | |
22 | * @deprecated As of {@code fastutil} 8 this class is no longer necessary, as its only previous abstract | |
23 | 23 | * method is now a default method of the type-specific interface. |
24 | 24 | */ |
25 | 25 |
0 | 0 | /* |
1 | * Copyright (C) 2002-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2002-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2002-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2002-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2002-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2002-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2002-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2002-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
18 | 18 | |
19 | 19 | /** An abstract class facilitating the creation of type-specific {@linkplain java.util.ListIterator list iterators}. |
20 | 20 | * |
21 | * @deprecated As of fastutil 8 this class is no longer necessary, as its previous abstract | |
21 | * @deprecated As of {@code fastutil} 8 this class is no longer necessary, as its previous abstract | |
22 | 22 | * methods are now default methods of the type-specific interface. |
23 | 23 | */ |
24 | 24 |
0 | 0 | /* |
1 | * Copyright (C) 2002-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2002-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
357 | 357 | } |
358 | 358 | |
359 | 359 | /** {@inheritDoc} */ |
360 | @SuppressWarnings({"unchecked","deprecation"}) | |
360 | @SuppressWarnings({"unchecked", "deprecation"}) | |
361 | 361 | @Override |
362 | 362 | public void putAll(final Map<? extends KEY_GENERIC_CLASS,? extends VALUE_GENERIC_CLASS> m) { |
363 | 363 | if (m instanceof MAP) { |
0 | 0 | /* |
1 | * Copyright (C) 2002-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2002-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
17 | 17 | package PACKAGE; |
18 | 18 | |
19 | 19 | /** An abstract class providing basic methods for priority queues implementing a type-specific interface. |
20 | * @deprecated As of fastutil 8 this class is no longer necessary, as its previous abstract | |
20 | * @deprecated As of {@code fastutil} 8 this class is no longer necessary, as its previous abstract | |
21 | 21 | * methods are now default methods of the type-specific interface. |
22 | 22 | */ |
23 | 23 | @Deprecated |
0 | 0 | /* |
1 | * Copyright (C) 2002-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2002-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2002-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2002-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2003-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2003-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2020-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2020-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2002-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2002-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
18 | 18 | |
19 | 19 | /** An abstract class providing basic methods for implementing a type-specific stack interface. |
20 | 20 | * |
21 | * @deprecated As of fastutil 8 this class is no longer necessary, as its previous abstract | |
21 | * @deprecated As of {@code fastutil} 8 this class is no longer necessary, as its previous abstract | |
22 | 22 | * methods are now default methods of the type-specific interface. |
23 | 23 | */ |
24 | 24 | @Deprecated |
0 | 0 | /* |
1 | * Copyright (C) 2010-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2010-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2002-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2002-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
38 | 38 | import java.util.NoSuchElementException; |
39 | 39 | import java.util.RandomAccess; |
40 | 40 | |
41 | /** Compact storage of big lists of arrays using front coding. | |
41 | /** Compact storage of big lists of arrays using front-coding (also known as prefix-omission) compression. | |
42 | 42 | * |
43 | 43 | * <p>This class stores immutably a big list of arrays in a single {@linkplain it.unimi.dsi.fastutil.BigArrays big array} |
44 | 44 | * using front coding (of course, the compression will be reasonable only if |
47 | 47 | * calling {@link #get(long) get(<var>i</var>)}. The returned array may be |
48 | 48 | * freely modified. |
49 | 49 | * |
50 | * <p>Front coding is based on the idea that if the <var>i</var>-th and the | |
50 | * <p>Front-coding (also known as prefix-omission) compression is based on the idea that if the <var>i</var>-th and the | |
51 | 51 | * (<var>i</var>+1)-th array have a common prefix, we might store the length |
52 | 52 | * of the common prefix, and then the rest of the second array. |
53 | 53 | * |
123 | 123 | KEY_TYPE[][] a = new KEY_TYPE[2][]; |
124 | 124 | long curSize = 0; |
125 | 125 | long n = 0; |
126 | int b = 0, common, length, minLength; | |
126 | int b = 0, length; | |
127 | 127 | |
128 | 128 | while(arrays.hasNext()) { |
129 | 129 | a[b] = arrays.next(); |
139 | 139 | curSize += length; |
140 | 140 | } |
141 | 141 | else { |
142 | minLength = a[1 - b].length; | |
143 | if (length < minLength) minLength = length; | |
142 | final int minLength = Math.min(a[1 - b].length, length); | |
143 | int common; | |
144 | 144 | for(common = 0; common < minLength; common++) if (a[0][common] != a[1][common]) break; |
145 | 145 | length -= common; |
146 | 146 | |
447 | 447 | return p; |
448 | 448 | } |
449 | 449 | |
450 | public void dump(java.io.DataOutputStream array, java.io.DataOutputStream pointers) throws java.io.IOException { | |
451 | for(KEY_TYPE[] s: this.array) | |
452 | for(KEY_TYPE e :s) | |
453 | array.WRITE_KEY(e); | |
454 | ||
455 | for(long[] s: p) | |
456 | for(long e: s) | |
457 | pointers.writeLong(e); | |
458 | } | |
450 | 459 | |
451 | 460 | private void readObject(java.io.ObjectInputStream s) throws java.io.IOException, ClassNotFoundException { |
452 | 461 | s.defaultReadObject(); |
0 | 0 | /* |
1 | * Copyright (C) 2002-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2002-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
35 | 35 | import java.util.NoSuchElementException; |
36 | 36 | import java.util.RandomAccess; |
37 | 37 | |
38 | /** Compact storage of lists of arrays using front coding. | |
38 | /** Compact storage of lists of arrays using front-coding (also known as prefix-omission) compression. | |
39 | 39 | * |
40 | 40 | * <p>This class stores immutably a list of arrays in a single {@linkplain it.unimi.dsi.fastutil.BigArrays big array} |
41 | 41 | * using front coding (of course, the compression will be reasonable only if |
44 | 44 | * calling {@link #get(int) get(<var>i</var>)}. The returned array may be |
45 | 45 | * freely modified. |
46 | 46 | * |
47 | * <p>Front coding is based on the idea that if the <var>i</var>-th and the | |
47 | * <p>Front-coding (also known as prefix-omission) compression | |
48 | * is based on the idea that if the <var>i</var>-th and the | |
48 | 49 | * (<var>i</var>+1)-th array have a common prefix, we might store the length |
49 | 50 | * of the common prefix, and then the rest of the second array. |
50 | 51 | * |
119 | 120 | |
120 | 121 | KEY_TYPE[][] a = new KEY_TYPE[2][]; |
121 | 122 | long curSize = 0; |
122 | int n = 0, b = 0, common, length, minLength; | |
123 | int n = 0, b = 0, length; | |
123 | 124 | |
124 | 125 | while(arrays.hasNext()) { |
125 | 126 | a[b] = arrays.next(); |
135 | 136 | curSize += length; |
136 | 137 | } |
137 | 138 | else { |
138 | minLength = a[1 - b].length; | |
139 | if (length < minLength) minLength = length; | |
139 | final int minLength = Math.min(a[1 - b].length, length); | |
140 | int common; | |
140 | 141 | for(common = 0; common < minLength; common++) if (a[0][common] != a[1][common]) break; |
141 | 142 | length -= common; |
142 | 143 | |
253 | 254 | final int count = count(length); |
254 | 255 | BigArrays.set(a, pos + count - 1, (byte)(length & 0x7F)); |
255 | 256 | |
256 | if (count != 1) { | |
257 | int i = count - 1; | |
258 | while(i-- != 0) { | |
259 | length >>>= 7; | |
260 | BigArrays.set(a, pos + i, (byte)(- (length & 0x7F) - 1)); | |
261 | } | |
257 | for(int i = count -1; i-- != 0;) { | |
258 | length >>>= 7; | |
259 | BigArrays.set(a, pos + i, (byte)(- (length & 0x7F) - 1)); | |
262 | 260 | } |
263 | 261 | |
264 | 262 | return count; |
0 | 0 | /* |
1 | * Copyright (C) 2003-2021 Paolo Boldi and Sebastiano Vigna | |
1 | * Copyright (C) 2003-2022 Paolo Boldi and Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2002-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2002-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2007-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2007-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2003-2021 Paolo Boldi and Sebastiano Vigna | |
1 | * Copyright (C) 2003-2022 Paolo Boldi and Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2007-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2007-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2002-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2002-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
1236 | 1236 | * |
1237 | 1237 | * <p>This method implements a <em>lexicographical</em> sorting of the arguments. Pairs of |
1238 | 1238 | * elements in the same position in the two provided arrays will be considered a single key, and |
1239 | * permuted accordingly. In the end, either {@code x[i] < x[i + 1]} or <code>x[i] | |
1240 | * == x[i + 1]</code> and {@code y[i] ≤ y[i + 1]}. | |
1239 | * permuted accordingly. In the end, either {@code x[i] < x[i + 1]} or {@code x[i] | |
1240 | * == x[i + 1]} and {@code y[i] ≤ y[i + 1]}. | |
1241 | 1241 | * |
1242 | 1242 | * @param x the first array to be sorted. |
1243 | 1243 | * @param y the second array to be sorted. |
1298 | 1298 | * |
1299 | 1299 | * <p>This method implements a <em>lexicographical</em> sorting of the arguments. Pairs of |
1300 | 1300 | * elements in the same position in the two provided arrays will be considered a single key, and |
1301 | * permuted accordingly. In the end, either {@code x[i] < x[i + 1]} or <code>x[i] | |
1302 | * == x[i + 1]</code> and {@code y[i] ≤ y[i + 1]}. | |
1301 | * permuted accordingly. In the end, either {@code x[i] < x[i + 1]} or {@code x[i] | |
1302 | * == x[i + 1]} and {@code y[i] ≤ y[i + 1]}. | |
1303 | 1303 | * |
1304 | 1304 | * @param x the first array to be sorted. |
1305 | 1305 | * @param y the second array to be sorted. |
1381 | 1381 | * |
1382 | 1382 | * <p>This method implements a <em>lexicographical</em> sorting of the arguments. Pairs of |
1383 | 1383 | * elements in the same position in the two provided arrays will be considered a single key, and |
1384 | * permuted accordingly. In the end, either {@code x[i] < x[i + 1]} or <code>x[i] | |
1385 | * == x[i + 1]</code> and {@code y[i] ≤ y[i + 1]}. | |
1384 | * permuted accordingly. In the end, either {@code x[i] < x[i + 1]} or {@code x[i] | |
1385 | * == x[i + 1]} and {@code y[i] ≤ y[i + 1]}. | |
1386 | 1386 | * |
1387 | 1387 | * @param x the first array to be sorted. |
1388 | 1388 | * @param y the second array to be sorted. |
1406 | 1406 | * |
1407 | 1407 | * <p>This method implements a <em>lexicographical</em> sorting of the arguments. Pairs of |
1408 | 1408 | * elements in the same position in the two provided arrays will be considered a single key, and |
1409 | * permuted accordingly. In the end, either {@code x[i] < x[i + 1]} or <code>x[i] | |
1410 | * == x[i + 1]</code> and {@code y[i] ≤ y[i + 1]}. | |
1409 | * permuted accordingly. In the end, either {@code x[i] < x[i + 1]} or {@code x[i] | |
1410 | * == x[i + 1]} and {@code y[i] ≤ y[i + 1]}. | |
1411 | 1411 | * |
1412 | 1412 | * @param x the first array to be sorted. |
1413 | 1413 | * @param y the second array to be sorted. |
1836 | 1836 | /** The number of digits per element. */ |
1837 | 1837 | private static final int DIGITS_PER_ELEMENT = KEY_CLASS.SIZE / DIGIT_BITS; |
1838 | 1838 | private static final int RADIXSORT_NO_REC = 1024; |
1839 | private static final int RADIXSORT_NO_REC_SMALL = 64; | |
1839 | 1840 | private static final int PARALLEL_RADIXSORT_NO_FORK = 1024; |
1840 | 1841 | |
1841 | 1842 | // The thresholds were determined on an Intel i7 8700K. |
2115 | 2116 | */ |
2116 | 2117 | public static void radixSortIndirect(final int[] perm, final KEY_TYPE[] a, final int from, final int to, final boolean stable) { |
2117 | 2118 | if (to - from < RADIXSORT_NO_REC) { |
2118 | insertionSortIndirect(perm, a, from, to); | |
2119 | quickSortIndirect(perm, a, from, to); | |
2120 | if (stable) stabilize(perm, a, from, to); | |
2119 | 2121 | return; |
2120 | 2122 | } |
2121 | 2123 | |
2161 | 2163 | System.arraycopy(support, 0, perm, first, length); |
2162 | 2164 | for(int i = 0, p = first; i <= lastUsed; i++) { |
2163 | 2165 | if (level < maxLevel && count[i] > 1) { |
2164 | if (count[i] < RADIXSORT_NO_REC) insertionSortIndirect(perm, a, p, p + count[i]); | |
2166 | if (count[i] < RADIXSORT_NO_REC) { | |
2167 | quickSortIndirect(perm, a, p, p + count[i]); | |
2168 | if (stable) stabilize(perm, a, p, p + count[i]); | |
2169 | } | |
2165 | 2170 | else { |
2166 | 2171 | offsetStack[stackPos] = p; |
2167 | 2172 | lengthStack[stackPos] = count[i]; |
2190 | 2195 | } |
2191 | 2196 | |
2192 | 2197 | if (level < maxLevel && count[c] > 1) { |
2193 | if (count[c] < RADIXSORT_NO_REC) insertionSortIndirect(perm, a, i, i + count[c]); | |
2198 | if (count[c] < RADIXSORT_NO_REC) { | |
2199 | quickSortIndirect(perm, a, i, i + count[c]); | |
2200 | if (stable) stabilize(perm, a, i, i + count[c]); | |
2201 | } | |
2194 | 2202 | else { |
2195 | 2203 | offsetStack[stackPos] = i; |
2196 | 2204 | lengthStack[stackPos] = count[c]; |
2368 | 2376 | */ |
2369 | 2377 | public static void radixSort(final KEY_TYPE[] a, final KEY_TYPE[] b, final int from, final int to) { |
2370 | 2378 | if (to - from < RADIXSORT_NO_REC) { |
2371 | selectionSort(a, b, from, to); | |
2379 | quickSort(a, b, from, to); | |
2372 | 2380 | return; |
2373 | 2381 | } |
2374 | 2382 | |
2435 | 2443 | } |
2436 | 2444 | |
2437 | 2445 | if (level < maxLevel && count[c] > 1) { |
2438 | if (count[c] < RADIXSORT_NO_REC) selectionSort(a, b, i, i + count[c]); | |
2446 | if (count[c] < RADIXSORT_NO_REC) quickSort(a, b, i, i + count[c]); | |
2439 | 2447 | else { |
2440 | 2448 | offsetStack[stackPos] = i; |
2441 | 2449 | lengthStack[stackPos] = count[c]; |
2613 | 2621 | * @param stable whether the sorting algorithm should be stable. |
2614 | 2622 | */ |
2615 | 2623 | public static void radixSortIndirect(final int[] perm, final KEY_TYPE[] a, final KEY_TYPE[] b, final int from, final int to, final boolean stable) { |
2616 | if (to - from < RADIXSORT_NO_REC) { | |
2624 | if (to - from < RADIXSORT_NO_REC_SMALL) { | |
2617 | 2625 | insertionSortIndirect(perm, a, b, from, to); |
2618 | 2626 | return; |
2619 | 2627 | } |
2663 | 2671 | System.arraycopy(support, 0, perm, first, length); |
2664 | 2672 | for(int i = 0, p = first; i < 1 << DIGIT_BITS; i++) { |
2665 | 2673 | if (level < maxLevel && count[i] > 1) { |
2666 | if (count[i] < RADIXSORT_NO_REC) insertionSortIndirect(perm, a, b, p, p + count[i]); | |
2674 | if (count[i] < RADIXSORT_NO_REC_SMALL) insertionSortIndirect(perm, a, b, p, p + count[i]); | |
2667 | 2675 | else { |
2668 | 2676 | offsetStack[stackPos] = p; |
2669 | 2677 | lengthStack[stackPos] = count[i]; |
2693 | 2701 | |
2694 | 2702 | |
2695 | 2703 | if (level < maxLevel && count[c] > 1) { |
2696 | if (count[c] < RADIXSORT_NO_REC) insertionSortIndirect(perm, a, b, i, i + count[c]); | |
2704 | if (count[c] < RADIXSORT_NO_REC_SMALL) insertionSortIndirect(perm, a, b, i, i + count[c]); | |
2697 | 2705 | else { |
2698 | 2706 | offsetStack[stackPos] = i; |
2699 | 2707 | lengthStack[stackPos] = count[c]; |
2764 | 2772 | * @param to the index of the last element (exclusive) to be sorted. |
2765 | 2773 | */ |
2766 | 2774 | public static void radixSort(final KEY_TYPE[][] a, final int from, final int to) { |
2767 | if (to - from < RADIXSORT_NO_REC) { | |
2775 | if (to - from < RADIXSORT_NO_REC_SMALL) { | |
2768 | 2776 | selectionSort(a, from, to, 0); |
2769 | 2777 | return; |
2770 | 2778 | } |
2829 | 2837 | } |
2830 | 2838 | |
2831 | 2839 | if (level < maxLevel && count[c] > 1) { |
2832 | if (count[c] < RADIXSORT_NO_REC) selectionSort(a, i, i + count[c], level + 1); | |
2840 | if (count[c] < RADIXSORT_NO_REC_SMALL) selectionSort(a, i, i + count[c], level + 1); | |
2833 | 2841 | else { |
2834 | 2842 | offsetStack[stackPos] = i; |
2835 | 2843 | lengthStack[stackPos] = count[c]; |
0 | 0 | /* |
1 | * Copyright (C) 2002-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2002-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2002-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2002-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2002-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2002-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
856 | 856 | @Override |
857 | 857 | public void getElements(final long from, final KEY_TYPE[][] a, final long offset, final long length) { |
858 | 858 | BigArrays.copy(this.a, from, a, offset, length); |
859 | } | |
860 | ||
861 | /** Copies element of this type-specific list into the given array using optimized system calls. | |
862 | * | |
863 | * @param from the start index (inclusive). | |
864 | * @param a the destination array. | |
865 | * @param offset the offset into the destination array where to store the first element copied. | |
866 | * @param length the number of elements to be copied. | |
867 | */ | |
868 | ||
869 | @Override | |
870 | public void getElements(final long from, final KEY_TYPE[] a, final int offset, final int length) { | |
871 | BigArrays.copyFromBig(this.a, from, a, offset, length); | |
859 | 872 | } |
860 | 873 | |
861 | 874 | /** Removes elements of this type-specific list using optimized system calls. |
0 | 0 | /* |
1 | * Copyright (C) 2009-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2009-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
440 | 440 | * @deprecated Please use the version in {@link it.unimi.dsi.fastutil.BigArrays}. |
441 | 441 | */ |
442 | 442 | @Deprecated |
443 | SUPPRESS_WARNINGS_KEY_UNCHECKED | |
444 | 443 | public static KEY_GENERIC KEY_GENERIC_TYPE[][] ensureCapacity(final KEY_GENERIC_TYPE[][] array, final long length, final long preserve) { |
445 | 444 | return length > length(array) ? forceCapacity(array, length, preserve) : array; |
446 | 445 | } |
0 | 0 | /* |
1 | * Copyright (C) 2010-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2010-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2004-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2004-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
443 | 443 | * a big array with {@code length} entries whose first {@code preserve} |
444 | 444 | * entries are the same as those of {@code array}. |
445 | 445 | */ |
446 | SUPPRESS_WARNINGS_KEY_UNCHECKED | |
447 | 446 | public static KEY_GENERIC KEY_GENERIC_TYPE[][] ensureCapacity(final KEY_GENERIC_TYPE[][] array, final long length, final long preserve) { |
448 | 447 | return length > length(array) ? forceCapacity(array, length, preserve) : array; |
449 | 448 | } |
0 | 0 | /* |
1 | * Copyright (C) 2010-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2010-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
140 | 140 | * @param length the number of elements to be copied. |
141 | 141 | */ |
142 | 142 | void getElements(long from, KEY_TYPE a[][], long offset, long length); |
143 | ||
144 | /** Copies (hopefully quickly) elements of this type-specific big list into the given array. | |
145 | * | |
146 | * @param from the start index (inclusive). | |
147 | * @param a the destination array. | |
148 | * @param offset the offset into the destination array where to store the first element copied. | |
149 | * @param length the number of elements to be copied. | |
150 | */ | |
151 | default void getElements(long from, KEY_TYPE a[], int offset, int length) { | |
152 | #if KEYS_REFERENCE | |
153 | getElements(from, new KEY_TYPE[][]{a}, (long)offset, (long)length); | |
154 | #else | |
155 | getElements(from, new KEY_TYPE[][]{a}, offset, length); | |
156 | #endif | |
157 | } | |
143 | 158 | |
144 | 159 | /** Removes (hopefully quickly) elements of this type-specific big list. |
145 | 160 | * |
0 | 0 | /* |
1 | * Copyright (C) 2010-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2010-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2002-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2002-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2002-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2002-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2019-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2019-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2005-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2005-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
22 | 22 | import static it.unimi.dsi.fastutil.BigArrays.segment; |
23 | 23 | import static it.unimi.dsi.fastutil.BigArrays.displacement; |
24 | 24 | import static it.unimi.dsi.fastutil.BigArrays.ensureOffsetLength; |
25 | import static it.unimi.dsi.fastutil.Arrays.ensureOffsetLength; | |
26 | ||
27 | import java.nio.*; | |
28 | import java.nio.channels.*; | |
29 | import java.nio.file.*; | |
25 | 30 | |
26 | 31 | import java.io.*; |
27 | 32 | import java.util.*; |
50 | 55 | * resulting files from other languages. |
51 | 56 | * |
52 | 57 | * <p>For each primitive type, this class provides methods that read elements |
53 | * from a {@link DataInput} or from a filename into an array. Analogously, there are | |
54 | * methods that store the content of an array (fragment) or the elements | |
55 | * returned by an iterator to a {@link DataOutput} or to a given filename. Files | |
56 | * are buffered using {@link FastBufferedInputStream} and {@link FastBufferedOutputStream}. | |
58 | * from a {@link DataInput}, an {@link InputStream} or from a file into an array | |
59 | * or a {@linkplain it.unimi.dsi.fastutil.BigArrays big array}, or expose those elements as a type-specific {@link Iterator iterator}. | |
60 | * There are also methods that let you choose a {@linkplain ByteOrder byte order} and | |
61 | * that work with {@link ReadableByteChannel byte channels}. | |
62 | * Analogously, there are | |
63 | * methods that store the content of a (big) array (fragment) or the elements | |
64 | * returned by an iterator to a {@link DataOutput}, to an {@link OutputStream}, | |
65 | * to a {@link WritableByteChannel}, or to a given file. Files | |
66 | * are buffered using {@link FastBufferedInputStream} and {@link FastBufferedOutputStream}, | |
67 | * or, when possible, with a {@linkplain ByteBuffer byte buffer} allocated with | |
68 | * {@linkplain ByteBuffer#allocateDirect(int)}. | |
57 | 69 | * |
58 | 70 | * <p>Since bytes can be read from or written to any stream, additional methods |
59 | 71 | * makes it possible to {@linkplain #loadBytes(InputStream,byte[]) load bytes from} and |
61 | 73 | * use the bulk-read methods of {@link InputStream} and {@link OutputStream}, but they |
62 | 74 | * also include a workaround for <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6478546">bug #6478546</a>. |
63 | 75 | * |
64 | * <p>Finally, there are useful wrapper methods that {@linkplain #asIntIterator(CharSequence) | |
65 | * exhibit a file as a type-specific iterator}. | |
76 | * <p>The store methods with a specified byte order are particularly useful when writing | |
77 | * data that is intended to be {@linkplain mapped into memory it.unimi.dsi.fastutil.ints.IntMappedBigList}, | |
78 | * as using the {@linkplain ByteOrder#nativeOrder() native order} enhances performances significantly. | |
66 | 79 | * |
67 | 80 | * @since 4.4 |
68 | 81 | */ |
69 | 82 | |
70 | 83 | public class BinIO { |
84 | /** The size used with {@link ByteBuffer#allocateDirect(int)}. */ | |
85 | public static int BUFFER_SIZE = 8192; | |
71 | 86 | |
72 | 87 | private BinIO() {} |
73 | 88 | |
83 | 98 | oos.close(); |
84 | 99 | } |
85 | 100 | |
86 | /** Stores an object in a file given by a pathname. | |
101 | /** Stores an object in a file given by a filename. | |
87 | 102 | * |
88 | 103 | * @param o an object. |
89 | 104 | * @param filename a filename. |
107 | 122 | return result; |
108 | 123 | } |
109 | 124 | |
110 | /** Loads an object from a file given by a pathname. | |
125 | /** Loads an object from a file given by a filename. | |
111 | 126 | * |
112 | 127 | * @param filename a filename. |
113 | 128 | * @return the object stored under the given filename. |
0 | 0 | /* |
1 | * Copyright (C) 2004-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2004-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
63 | 63 | * @param length the number of elements of {@code array} to be filled. |
64 | 64 | * @return the number of elements actually read from {@code inputStream} (it might be less than {@code length} if {@code inputStream} ends). |
65 | 65 | */ |
66 | public static int LOAD_KEYS(final InputStream inputStream, final KEY_TYPE[] array, final int offset, final int length) throws IOException { | |
66 | public static int loadBytes(final InputStream inputStream, final byte[] array, final int offset, final int length) throws IOException { | |
67 | 67 | return read(inputStream, array, offset, length); |
68 | 68 | } |
69 | 69 | |
76 | 76 | * @param array an array which will be filled with data from {@code inputStream}. |
77 | 77 | * @return the number of elements actually read from {@code inputStream} (it might be less than the array length if {@code inputStream} ends). |
78 | 78 | */ |
79 | public static int LOAD_KEYS(final InputStream inputStream, final KEY_TYPE[] array) throws IOException { | |
79 | public static int loadBytes(final InputStream inputStream, final byte[] array) throws IOException { | |
80 | 80 | return read(inputStream, array, 0, array.length); |
81 | 81 | } |
82 | 82 | |
83 | /** Stores an array fragment to a given output stream. | |
83 | /** Stores an array fragment to a given writable channel. | |
84 | 84 | * |
85 | 85 | * <p>Note that this method is going to be significantly faster than {@link #storeBytes(byte[],int,int,DataOutput)} |
86 | * as it uses {@link OutputStream}'s bulk-read methods. | |
86 | * as it uses {@link OutputStream}'s bulk-write methods. | |
87 | 87 | * |
88 | 88 | * @param array an array whose elements will be written to {@code outputStream}. |
89 | 89 | * @param offset the index of the first element of {@code array} to be written. |
90 | 90 | * @param length the number of elements of {@code array} to be written. |
91 | 91 | * @param outputStream an output stream. |
92 | 92 | */ |
93 | public static void STORE_KEYS(final KEY_TYPE array[], final int offset, final int length, final OutputStream outputStream) throws IOException { | |
93 | public static void storeBytes(final byte array[], final int offset, final int length, final OutputStream outputStream) throws IOException { | |
94 | 94 | write(outputStream, array, offset, length); |
95 | 95 | } |
96 | 96 | |
97 | /** Stores an array to a given output stream. | |
97 | /** Stores an array to a given writable channel. | |
98 | 98 | * |
99 | 99 | * <p>Note that this method is going to be significantly faster than {@link #storeBytes(byte[],DataOutput)} |
100 | * as it uses {@link OutputStream}'s bulk-read methods. | |
100 | * as it uses {@link OutputStream}'s bulk-write methods. | |
101 | 101 | * |
102 | 102 | * @param array an array whose elements will be written to {@code outputStream}. |
103 | 103 | * @param outputStream an output stream. |
104 | 104 | */ |
105 | public static void STORE_KEYS(final KEY_TYPE array[], final OutputStream outputStream) throws IOException { | |
105 | public static void storeBytes(final byte array[], final OutputStream outputStream) throws IOException { | |
106 | 106 | write(outputStream, array, 0, array.length); |
107 | 107 | } |
108 | 108 | |
167 | 167 | // Additional read/write methods to work around the DataInput/DataOutput schizophrenia. |
168 | 168 | |
169 | 169 | |
170 | /** Loads bytes from a given input stream, storing them in a given big-array fragment. | |
170 | /** Loads bytes from a given readable channel, storing them in a given big-array fragment. | |
171 | 171 | * |
172 | 172 | * <p>Note that this method is going to be significantly faster than {@link #loadBytes(DataInput,byte[][],long,long)} |
173 | 173 | * as it uses {@link InputStream}'s bulk-read methods. |
178 | 178 | * @param length the number of elements of {@code array} to be filled. |
179 | 179 | * @return the number of elements actually read from {@code inputStream} (it might be less than {@code length} if {@code inputStream} ends). |
180 | 180 | */ |
181 | public static long LOAD_KEYS(final InputStream inputStream, final KEY_TYPE[][] array, final long offset, final long length) throws IOException { | |
181 | public static long loadBytes(final InputStream inputStream, final byte[][] array, final long offset, final long length) throws IOException { | |
182 | 182 | return read(inputStream, array, offset, length); |
183 | 183 | } |
184 | 184 | |
185 | /** Loads bytes from a given input stream, storing them in a given big array. | |
185 | /** Loads bytes from a given readable channel, storing them in a given big array. | |
186 | 186 | * |
187 | 187 | * <p>Note that this method is going to be significantly faster than {@link #loadBytes(DataInput,byte[][])} |
188 | 188 | * as it uses {@link InputStream}'s bulk-read methods. |
191 | 191 | * @param array a big array which will be filled with data from {@code inputStream}. |
192 | 192 | * @return the number of elements actually read from {@code inputStream} (it might be less than the array length if {@code inputStream} ends). |
193 | 193 | */ |
194 | public static long LOAD_KEYS(final InputStream inputStream, final KEY_TYPE[][] array) throws IOException { | |
194 | public static long loadBytes(final InputStream inputStream, final byte[][] array) throws IOException { | |
195 | 195 | return read(inputStream, array, 0, length(array)); |
196 | 196 | } |
197 | 197 | |
198 | /** Stores a big-array fragment to a given output stream. | |
198 | /** Stores a big-array fragment to a given writable channel. | |
199 | 199 | * |
200 | 200 | * <p>Note that this method is going to be significantly faster than {@link #storeBytes(byte[][],long,long,DataOutput)} |
201 | * as it uses {@link OutputStream}'s bulk-read methods. | |
201 | * as it uses {@link OutputStream}'s bulk-write methods. | |
202 | 202 | * |
203 | 203 | * @param array a big array whose elements will be written to {@code outputStream}. |
204 | 204 | * @param offset the index of the first element of {@code array} to be written. |
205 | 205 | * @param length the number of elements of {@code array} to be written. |
206 | 206 | * @param outputStream an output stream. |
207 | 207 | */ |
208 | public static void STORE_KEYS(final KEY_TYPE array[][], final long offset, final long length, final OutputStream outputStream) throws IOException { | |
208 | public static void storeBytes(final byte array[][], final long offset, final long length, final OutputStream outputStream) throws IOException { | |
209 | 209 | write(outputStream, array, offset, length); |
210 | 210 | } |
211 | 211 | |
212 | /** Stores a big array to a given output stream. | |
212 | /** Stores a big array to a given writable channel. | |
213 | 213 | * |
214 | 214 | * <p>Note that this method is going to be significantly faster than {@link #storeBytes(byte[][],DataOutput)} |
215 | * as it uses {@link OutputStream}'s bulk-read methods. | |
215 | * as it uses {@link OutputStream}'s bulk-write methods. | |
216 | 216 | * |
217 | 217 | * @param array a big array whose elements will be written to {@code outputStream}. |
218 | 218 | * @param outputStream an output stream. |
219 | 219 | */ |
220 | public static void STORE_KEYS(final KEY_TYPE array[][], final OutputStream outputStream) throws IOException { | |
220 | public static void storeBytes(final byte array[][], final OutputStream outputStream) throws IOException { | |
221 | 221 | write(outputStream, array, 0, length(array)); |
222 | } | |
223 | ||
224 | ||
225 | // Methods working with channels. | |
226 | ||
227 | /** Loads bytes from a given readable channel, storing them in a given array fragment. | |
228 | * | |
229 | * <p>Note that this method is going to be significantly faster than {@link #loadBytes(DataInput,byte[],int,int)} | |
230 | * as it uses {@link ReadableByteChannel}'s bulk-read methods. | |
231 | * | |
232 | * @param channel a readable channel. | |
233 | * @param array an array which will be filled with data from {@code channel}. | |
234 | * @param offset the index of the first element of {@code array} to be filled. | |
235 | * @param length the number of elements of {@code array} to be filled. | |
236 | * @return the number of elements actually read from {@code channel} (it might be less than {@code length} if {@code channel} ends). | |
237 | */ | |
238 | public static int loadBytes(final ReadableByteChannel channel, final byte[] array, int offset, int length) throws IOException { | |
239 | ensureOffsetLength(array.length, offset, length); | |
240 | ByteBuffer buffer = ByteBuffer.allocateDirect(BUFFER_SIZE); | |
241 | int read = 0; | |
242 | for (;;) { | |
243 | buffer.clear(); | |
244 | buffer.limit(Math.min(buffer.capacity(), length)); | |
245 | int r = channel.read(buffer); | |
246 | if (r <= 0) return read; | |
247 | read += r; | |
248 | buffer.flip(); | |
249 | buffer.get(array, offset, r); | |
250 | offset += r; | |
251 | length -= r; | |
252 | } | |
253 | } | |
254 | ||
255 | /** Loads bytes from a given readable channel, storing them in a given array. | |
256 | * | |
257 | * <p>Note that this method is going to be significantly faster than {@link #loadBytes(DataInput,byte[],int,int)} | |
258 | * as it uses {@link ReadableByteChannel}'s bulk-read methods. | |
259 | * | |
260 | * @param channel a readable channel. | |
261 | * @param array an array which will be filled with data from {@code channel}. | |
262 | * @return the number of elements actually read from {@code channel} (it might be less than the array length if {@code channel} ends). | |
263 | */ | |
264 | public static int loadBytes(final ReadableByteChannel channel, final byte[] array) throws IOException { | |
265 | return loadBytes(channel, array, 0, array.length); | |
266 | } | |
267 | ||
268 | /** Stores an array fragment to a given writable channel. | |
269 | * | |
270 | * <p>Note that this method is going to be significantly faster than {@link #loadBytes(DataInput,byte[],int,int)} | |
271 | * as it uses {@link WritableByteChannel}'s bulk-write methods. | |
272 | * | |
273 | * @param array an array whose elements will be written to {@code channel}. | |
274 | * @param offset the index of the first element of {@code array} to be written. | |
275 | * @param length the number of elements of {@code array} to be written. | |
276 | * @param channel a writable channel. | |
277 | */ | |
278 | public static void storeBytes(final byte array[], int offset, int length, final WritableByteChannel channel) throws IOException { | |
279 | ensureOffsetLength(array.length, offset, length); | |
280 | ByteBuffer buffer = ByteBuffer.allocateDirect(BUFFER_SIZE); | |
281 | ||
282 | while(length != 0) { | |
283 | final int l = Math.min(length, buffer.capacity()); | |
284 | buffer.clear(); | |
285 | buffer.put(array, offset, l); | |
286 | buffer.flip(); | |
287 | channel.write(buffer); | |
288 | ||
289 | offset += l; | |
290 | length -= l; | |
291 | } | |
292 | } | |
293 | ||
294 | /** Stores an array to a given writable channel. | |
295 | * | |
296 | * <p>Note that this method is going to be significantly faster than {@link #loadBytes(DataInput,byte[],int,int)} | |
297 | * as it uses {@link WritableByteChannel}'s bulk-write methods. | |
298 | * | |
299 | * @param array an array whose elements will be written to {@code channel}. | |
300 | * @param channel a writable channel. | |
301 | */ | |
302 | public static void storeBytes(final byte array[], final WritableByteChannel channel) throws IOException { | |
303 | storeBytes(array, 0, array.length, channel); | |
304 | } | |
305 | ||
306 | /** Loads bytes from a given readable channel, storing them in a given big-array fragment. | |
307 | * | |
308 | * <p>Note that this method is going to be significantly faster than {@link #loadBytes(DataInput,byte[],int,int)} | |
309 | * as it uses {@link ReadableByteChannel}'s bulk-read methods. | |
310 | * | |
311 | * @param channel a readable channel. | |
312 | * @param array a big array which will be filled with data from {@code channel}. | |
313 | * @param offset the index of the first element of {@code array} to be filled. | |
314 | * @param length the number of elements of {@code array} to be filled. | |
315 | * @return the number of elements actually read from {@code channel} (it might be less than {@code length} if {@code channel} ends). | |
316 | */ | |
317 | public static long loadBytes(final ReadableByteChannel channel, final byte[][] array, final long offset, final long length) throws IOException { | |
318 | ensureOffsetLength(array, offset, length); | |
319 | long read = 0; | |
320 | for(int i = segment(offset); i < segment(offset + length + SEGMENT_MASK); i++) { | |
321 | final byte[] t = array[i]; | |
322 | final int s = (int)Math.max(0, offset - start(i)); | |
323 | final int e = (int)Math.min(t.length, offset + length - start(i)); | |
324 | final int r = loadBytes(channel, t, s, e - s); | |
325 | read += r; | |
326 | if (r < e -s) break; | |
327 | } | |
328 | return read; | |
329 | } | |
330 | ||
331 | /** Loads bytes from a given readable channel, storing them in a given big array. | |
332 | * | |
333 | * <p>Note that this method is going to be significantly faster than {@link #loadBytes(DataInput,byte[],int,int)} | |
334 | * as it uses {@link ReadableByteChannel}'s bulk-read methods. | |
335 | * | |
336 | * @param channel a readable channel. | |
337 | * @param array a big array which will be filled with data from {@code channel}. | |
338 | * @return the number of elements actually read from {@code channel} (it might be less than the array length if {@code channel} ends). | |
339 | */ | |
340 | public static long loadBytes(final ReadableByteChannel channel, final byte[][] array) throws IOException { | |
341 | return loadBytes(channel, array, 0, length(array)); | |
342 | } | |
343 | ||
344 | /** Stores a big-array fragment to a given writable channel. | |
345 | * | |
346 | * <p>Note that this method is going to be significantly faster than {@link #loadBytes(DataInput,byte[],int,int)} | |
347 | * as it uses {@link WritableByteChannel}'s bulk-write methods. | |
348 | * | |
349 | * @param array a big array whose elements will be written to {@code channel}. | |
350 | * @param offset the index of the first element of {@code array} to be written. | |
351 | * @param length the number of elements of {@code array} to be written. | |
352 | * @param channel a writable channel. | |
353 | */ | |
354 | public static void storeBytes(final byte array[][], final long offset, final long length, final WritableByteChannel channel) throws IOException { | |
355 | for(int i = segment(offset); i < segment(offset + length + SEGMENT_MASK); i++) { | |
356 | final int s = (int)Math.max(0, offset - start(i)); | |
357 | final int l = (int)Math.min(array[i].length, offset + length - start(i)); | |
358 | storeBytes(array[i], s, l - s, channel); | |
359 | } | |
360 | } | |
361 | ||
362 | /** Stores a big array to a given writable channel. | |
363 | * | |
364 | * <p>Note that this method is going to be significantly faster than {@link #loadBytes(DataInput,byte[],int,int)} | |
365 | * as it uses {@link WritableByteChannel}'s bulk-write methods. | |
366 | * | |
367 | * @param array a big array whose elements will be written to {@code channel}. | |
368 | * @param channel a writable channel. | |
369 | */ | |
370 | public static void storeBytes(final byte array[][], final WritableByteChannel channel) throws IOException { | |
371 | for(byte[] t: array) storeBytes(t, channel); | |
372 | } | |
373 | ||
374 | #elif ! KEY_CLASS_Boolean | |
375 | ||
376 | /** Loads elements from a given readable channel, using the given byte order, storing them in a given array fragment. | |
377 | * | |
378 | * @param channel a readable channel. | |
379 | * @param byteOrder the byte order of the data from {@code channel}. | |
380 | * @param array an array which will be filled with data from {@code channel}. | |
381 | * @param offset the index of the first element of {@code array} to be filled. | |
382 | * @param length the number of elements of {@code array} to be filled. | |
383 | * @return the number of elements actually read from {@code channel} (it might be less than {@code length} if {@code channel} ends). | |
384 | */ | |
385 | public static int LOAD_KEYS(final ReadableByteChannel channel, final ByteOrder byteOrder, final KEY_TYPE[] array, int offset, int length) throws IOException { | |
386 | ensureOffsetLength(array.length, offset, length); | |
387 | ByteBuffer byteBuffer = ByteBuffer.allocateDirect(BUFFER_SIZE).order(byteOrder); | |
388 | final KEY_BUFFER buffer = byteBuffer.AS_KEY_BUFFER(); | |
389 | int read = 0; | |
390 | for (;;) { | |
391 | byteBuffer.clear(); | |
392 | byteBuffer.limit(Math.min(buffer.capacity(), length << MAPPED_BIG_LIST.LOG2_BYTES)); | |
393 | int r = channel.read(byteBuffer); | |
394 | if (r <= 0) return read; | |
395 | r >>>= MAPPED_BIG_LIST.LOG2_BYTES; | |
396 | read += r; | |
397 | // TODO: use the indexed get() method when switching to Java 13+ | |
398 | buffer.clear(); | |
399 | buffer.limit(r); | |
400 | buffer.get(array, offset, r); | |
401 | offset += r; | |
402 | length -= r; | |
403 | } | |
404 | } | |
405 | ||
406 | /** Loads elements from a given readable channel, using the given byte order, storing them in a given array. | |
407 | * | |
408 | * @param channel a readable channel. | |
409 | * @param byteOrder the byte order of the data from {@code channel}. | |
410 | * @param array an array which will be filled with data from {@code channel}. | |
411 | * @return the number of elements actually read from {@code channel} (it might be less than the array length if {@code channel} ends). | |
412 | */ | |
413 | public static int LOAD_KEYS(final ReadableByteChannel channel, final ByteOrder byteOrder, final KEY_TYPE[] array) throws IOException { | |
414 | return LOAD_KEYS(channel, byteOrder, array, 0, array.length); | |
415 | } | |
416 | ||
417 | /** Loads elements from a file given by a {@link File} object, using the given byte order, storing them in a given array fragment. | |
418 | * | |
419 | * @param file a file. | |
420 | * @param byteOrder the byte order of the data stored in {@code file}. | |
421 | * @param array an array which will be filled with data from the specified file. | |
422 | * @param offset the index of the first element of {@code array} to be filled. | |
423 | * @param length the number of elements of {@code array} to be filled. | |
424 | * @return the number of elements actually read from the given file (it might be less than {@code length} if the file is too short). | |
425 | */ | |
426 | public static int LOAD_KEYS(final File file, final ByteOrder byteOrder, final KEY_TYPE[] array, final int offset, final int length) throws IOException { | |
427 | ensureOffsetLength(array.length, offset, length); | |
428 | final FileChannel channel = FileChannel.open(file.toPath()); | |
429 | final int read = LOAD_KEYS(channel, byteOrder, array, offset, length); | |
430 | channel.close(); | |
431 | return read; | |
432 | } | |
433 | ||
434 | /** Loads elements from a file given by a filename, using the given byte order, storing them in a given array fragment. | |
435 | * | |
436 | * @param filename a filename. | |
437 | * @param byteOrder the byte order of the data stored in the file {@code filename}. | |
438 | * @param array an array which will be filled with data from the specified file. | |
439 | * @param offset the index of the first element of {@code array} to be filled. | |
440 | * @param length the number of elements of {@code array} to be filled. | |
441 | * @return the number of elements actually read from the given file (it might be less than {@code length} if the file is too short). | |
442 | */ | |
443 | public static int LOAD_KEYS(final CharSequence filename, final ByteOrder byteOrder, final KEY_TYPE[] array, final int offset, final int length) throws IOException { | |
444 | return LOAD_KEYS(new File(filename.toString()), byteOrder, array, offset, length); | |
445 | } | |
446 | ||
447 | /** Loads elements from a file given by a {@link File} object, using the given byte order, storing them in a given array. | |
448 | * | |
449 | * @param file a file. | |
450 | * @param byteOrder the byte order of the data stored in {@code file}. | |
451 | * @param array an array which will be filled with data from the specified file. | |
452 | * @return the number of elements actually read from the given file (it might be less than the array length if the file is too short). | |
453 | */ | |
454 | public static int LOAD_KEYS(final File file, final ByteOrder byteOrder, final KEY_TYPE[] array) throws IOException { | |
455 | return LOAD_KEYS(file, byteOrder, array, 0, array.length); | |
456 | } | |
457 | ||
458 | /** Loads elements from a file given by a filename, using the given byte order, storing them in a given array. | |
459 | * | |
460 | * @param filename a filename. | |
461 | * @param byteOrder the byte order of the data stored in the file {@code filename}. | |
462 | * @param array an array which will be filled with data from the specified file. | |
463 | * @return the number of elements actually read from the given file (it might be less than the array length if the file is too short). | |
464 | */ | |
465 | public static int LOAD_KEYS(final CharSequence filename, final ByteOrder byteOrder, final KEY_TYPE[] array) throws IOException { | |
466 | return LOAD_KEYS(new File(filename.toString()), byteOrder, array); | |
467 | } | |
468 | ||
469 | /** Loads elements from a file given by a {@link File} object, using the given byte order, storing them in a new array. | |
470 | * | |
471 | * <p>Note that the length of the returned array will be computed | |
472 | * dividing the specified file size by the number of bytes used to | |
473 | * represent each element. | |
474 | * | |
475 | * @param file a file. | |
476 | * @param byteOrder the byte order of the data stored in {@code file}. | |
477 | * @return an array filled with the content of the specified file. | |
478 | */ | |
479 | public static KEY_TYPE[] LOAD_KEYS(final File file, final ByteOrder byteOrder) throws IOException { | |
480 | final FileChannel channel = FileChannel.open(file.toPath()); | |
481 | final long length = channel.size() / KEY_CLASS.BYTES; | |
482 | ||
483 | if (length > Integer.MAX_VALUE) { | |
484 | channel.close(); | |
485 | throw new IllegalArgumentException("File too long: " + channel.size()+ " bytes (" + length + " elements)"); | |
486 | } | |
487 | ||
488 | final KEY_TYPE[] array = new KEY_TYPE[(int)length]; | |
489 | if (LOAD_KEYS(channel, byteOrder, array) < length) throw new EOFException(); | |
490 | channel.close(); | |
491 | return array; | |
492 | } | |
493 | ||
494 | /** Loads elements from a file given by a filename, using the given byte order, storing them in a new array. | |
495 | * | |
496 | * <p>Note that the length of the returned array will be computed | |
497 | * dividing the specified file size by the number of bytes used to | |
498 | * represent each element. | |
499 | * | |
500 | * @param filename a filename. | |
501 | * @return an array filled with the content of the specified file. | |
502 | */ | |
503 | public static KEY_TYPE[] LOAD_KEYS(final CharSequence filename, final ByteOrder byteOrder) throws IOException { | |
504 | return LOAD_KEYS(new File(filename.toString()), byteOrder); | |
505 | } | |
506 | ||
507 | /** Stores an array fragment to a given writable channel, using the given byte order. | |
508 | * | |
509 | * @param array an array whose elements will be written to {@code channel}. | |
510 | * @param offset the index of the first element of {@code array} to be written. | |
511 | * @param length the number of elements of {@code array} to be written. | |
512 | * @param channel a writable channel. | |
513 | * @param byteOrder the byte order to be used to store data in {@code channel}. | |
514 | */ | |
515 | public static void STORE_KEYS(final KEY_TYPE array[], int offset, int length, final WritableByteChannel channel, final ByteOrder byteOrder) throws IOException { | |
516 | ensureOffsetLength(array.length, offset, length); | |
517 | ||
518 | ByteBuffer byteBuffer = ByteBuffer.allocateDirect(BUFFER_SIZE).order(byteOrder); | |
519 | final KEY_BUFFER buffer = byteBuffer.AS_KEY_BUFFER(); | |
520 | ||
521 | while(length != 0) { | |
522 | final int l = Math.min(length, buffer.capacity()); | |
523 | buffer.clear(); | |
524 | buffer.put(array, offset, l); | |
525 | buffer.flip(); | |
526 | ||
527 | byteBuffer.clear(); | |
528 | byteBuffer.limit(buffer.limit() << MAPPED_BIG_LIST.LOG2_BYTES); | |
529 | channel.write(byteBuffer); | |
530 | ||
531 | offset += l; | |
532 | length -= l; | |
533 | } | |
534 | } | |
535 | ||
536 | /** Stores an array to a given writable channel, using the given byte order. | |
537 | * | |
538 | * @param array an array whose elements will be written to {@code channel}. | |
539 | * @param channel a writable channel. | |
540 | * @param byteOrder the byte order to be used to store data in {@code channel}. | |
541 | */ | |
542 | public static void STORE_KEYS(final KEY_TYPE array[], final WritableByteChannel channel, final ByteOrder byteOrder) throws IOException { | |
543 | STORE_KEYS(array, 0, array.length, channel, byteOrder); | |
544 | } | |
545 | ||
546 | /** Stores an array fragment to a file given by a {@link File} object, using the given byte order. | |
547 | * | |
548 | * @param array an array whose elements will be written to {@code file}. | |
549 | * @param offset the index of the first element of {@code array} to be written. | |
550 | * @param length the number of elements of {@code array} to be written. | |
551 | * @param file a file. | |
552 | * @param byteOrder the byte order to be used to store data in {@code file}. | |
553 | */ | |
554 | public static void STORE_KEYS(final KEY_TYPE array[], final int offset, final int length, final File file, final ByteOrder byteOrder) throws IOException { | |
555 | final FileChannel channel = FileChannel.open(file.toPath(), StandardOpenOption.WRITE, StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING); | |
556 | STORE_KEYS(array, offset, length, channel, byteOrder); | |
557 | channel.close(); | |
558 | } | |
559 | ||
560 | /** Stores an array fragment to a file given by a filename, using the given byte order. | |
561 | * | |
562 | * @param array an array whose elements will be written to the file {@code filename}. | |
563 | * @param offset the index of the first element of {@code array} to be written. | |
564 | * @param length the number of elements of {@code array} to be written. | |
565 | * @param filename a filename. | |
566 | * @param byteOrder the byte order to be used to store data in the file {@code filename}. | |
567 | */ | |
568 | public static void STORE_KEYS(final KEY_TYPE array[], final int offset, final int length, final CharSequence filename, final ByteOrder byteOrder) throws IOException { | |
569 | STORE_KEYS(array, offset, length, new File(filename.toString()), byteOrder); | |
570 | } | |
571 | ||
572 | /** Stores an array to a file given by a {@link File} object, using the given byte order. | |
573 | * | |
574 | * @param array an array whose elements will be written to {@code file}. | |
575 | * @param file a file. | |
576 | * @param byteOrder the byte order to be used to store data in {@code file}. | |
577 | */ | |
578 | public static void STORE_KEYS(final KEY_TYPE array[], final File file, final ByteOrder byteOrder) throws IOException { | |
579 | STORE_KEYS(array, 0, array.length, file, byteOrder); | |
580 | } | |
581 | ||
582 | /** Stores an array to a file given by a filename, using the given byte order. | |
583 | * | |
584 | * @param array an array whose elements will be written to the file {@code filename}. | |
585 | * @param filename a filename. | |
586 | * @param byteOrder the byte order to be used to store data in the file {@code filename}. | |
587 | */ | |
588 | public static void STORE_KEYS(final KEY_TYPE array[], final CharSequence filename, final ByteOrder byteOrder) throws IOException { | |
589 | STORE_KEYS(array, new File(filename.toString()), byteOrder); | |
590 | } | |
591 | ||
592 | ||
593 | ||
594 | /** Loads elements from a given readable channel, using the given byte order, storing them in a given big-array fragment. | |
595 | * | |
596 | * @param channel a readable channel. | |
597 | * @param byteOrder the byte order of the data from {@code channel}. | |
598 | * @param array a big array which will be filled with data from {@code channel}. | |
599 | * @param offset the index of the first element of {@code array} to be filled. | |
600 | * @param length the number of elements of {@code array} to be filled. | |
601 | * @return the number of elements actually read from {@code channel} (it might be less than {@code length} if {@code channel} ends). | |
602 | */ | |
603 | public static long LOAD_KEYS(final ReadableByteChannel channel, final ByteOrder byteOrder, final KEY_TYPE[][] array, final long offset, final long length) throws IOException { | |
604 | ensureOffsetLength(array, offset, length); | |
605 | long read = 0; | |
606 | for(int i = segment(offset); i < segment(offset + length + SEGMENT_MASK); i++) { | |
607 | final KEY_TYPE[] t = array[i]; | |
608 | final int s = (int)Math.max(0, offset - start(i)); | |
609 | final int e = (int)Math.min(t.length, offset + length - start(i)); | |
610 | final int r = LOAD_KEYS(channel, byteOrder, t, s, e - s); | |
611 | read += r; | |
612 | if (r < e -s) break; | |
613 | } | |
614 | return read; | |
615 | } | |
616 | ||
617 | /** Loads elements from a given readable channel, using the given byte order, storing them in a given big array. | |
618 | * | |
619 | * @param channel a readable channel. | |
620 | * @param byteOrder the byte order of the data from {@code channel}. | |
621 | * @param array a big array which will be filled with data from {@code channel}. | |
622 | * @return the number of elements actually read from {@code channel} (it might be less than the array length if {@code channel} ends). | |
623 | */ | |
624 | public static long LOAD_KEYS(final ReadableByteChannel channel, final ByteOrder byteOrder, final KEY_TYPE[][] array) throws IOException { | |
625 | return LOAD_KEYS(channel, byteOrder, array, 0, length(array)); | |
626 | } | |
627 | ||
628 | /** Loads elements from a file given by a {@link File} object, using the given byte order, storing them in a given big-array fragment. | |
629 | * | |
630 | * @param file a file. | |
631 | * @param byteOrder the byte order of the data stored in {@code file}. | |
632 | * @param array a big array which will be filled with data from the specified file. | |
633 | * @param offset the index of the first element of {@code array} to be filled. | |
634 | * @param length the number of elements of {@code array} to be filled. | |
635 | * @return the number of elements actually read from the given file (it might be less than {@code length} if the file is too short). | |
636 | */ | |
637 | public static long LOAD_KEYS(final File file, final ByteOrder byteOrder, final KEY_TYPE[][] array, final long offset, final long length) throws IOException { | |
638 | final FileChannel channel = FileChannel.open(file.toPath()); | |
639 | final long read = LOAD_KEYS(channel, byteOrder, array, offset, length); | |
640 | channel.close(); | |
641 | return read; | |
642 | } | |
643 | ||
644 | /** Loads elements from a file given by a filename, using the given byte order, storing them in a given big-array fragment. | |
645 | * | |
646 | * @param filename a filename. | |
647 | * @param byteOrder the byte order of the data stored in the file {@code filename}. | |
648 | * @param array an array which will be filled with data from the specified file. | |
649 | * @param offset the index of the first element of {@code array} to be filled. | |
650 | * @param length the number of elements of {@code array} to be filled. | |
651 | * @return the number of elements actually read from the given file (it might be less than {@code length} if the file is too short). | |
652 | */ | |
653 | public static long LOAD_KEYS(final CharSequence filename, final ByteOrder byteOrder, final KEY_TYPE[][] array, final long offset, final long length) throws IOException { | |
654 | return LOAD_KEYS(new File(filename.toString()), byteOrder, array, offset, length); | |
655 | } | |
656 | ||
657 | /** Loads elements from a file given by a {@link File} object, using the given byte order, storing them in a given big array. | |
658 | * | |
659 | * @param file a file. | |
660 | * @param byteOrder the byte order of the data stored in {@code file}. | |
661 | * @param array a big array which will be filled with data from the specified file. | |
662 | * @return the number of elements actually read from the given file (it might be less than the array length if the file is too short). | |
663 | */ | |
664 | public static long LOAD_KEYS(final File file, final ByteOrder byteOrder, final KEY_TYPE[][] array) throws IOException { | |
665 | return LOAD_KEYS(file, byteOrder, array, 0, length(array)); | |
666 | } | |
667 | ||
668 | /** Loads elements from a file given by a filename, using the given byte order, storing them in a given big array. | |
669 | * | |
670 | * @param filename a filename. | |
671 | * @param byteOrder the byte order of the data stored in the file {@code filename}. | |
672 | * @param array a big array which will be filled with data from the specified file. | |
673 | * @return the number of elements actually read from the given file (it might be less than the array length if the file is too short). | |
674 | */ | |
675 | public static long LOAD_KEYS(final CharSequence filename, final ByteOrder byteOrder, final KEY_TYPE[][] array) throws IOException { | |
676 | return LOAD_KEYS(new File(filename.toString()), byteOrder, array); | |
677 | } | |
678 | ||
679 | /** Loads elements from a file given by a {@link File} object, using the given byte order, storing them in a new big array. | |
680 | * | |
681 | * <p>Note that the length of the returned big array will be computed | |
682 | * dividing the specified file size by the number of bytes used to | |
683 | * represent each element. | |
684 | * | |
685 | * @param file a file. | |
686 | * @param byteOrder the byte order of the data stored in {@code file}. | |
687 | * @return a big array filled with the content of the specified file. | |
688 | */ | |
689 | public static KEY_TYPE[][] LOAD_KEYS_BIG(final File file, final ByteOrder byteOrder) throws IOException { | |
690 | final FileChannel channel = FileChannel.open(file.toPath()); | |
691 | final long length = channel.size() / KEY_CLASS.BYTES; | |
692 | final KEY_TYPE[][] array = BIG_ARRAYS.newBigArray(length); | |
693 | for(final KEY_TYPE[] t: array) LOAD_KEYS(channel, byteOrder, t); | |
694 | channel.close(); | |
695 | return array; | |
696 | } | |
697 | ||
698 | /** Loads elements from a file given by a filename, using the given byte order, storing them in a new big array. | |
699 | * | |
700 | * <p>Note that the length of the returned big array will be computed | |
701 | * dividing the specified file size by the number of bytes used to | |
702 | * represent each element. | |
703 | * | |
704 | * @param filename a filename. | |
705 | * @param byteOrder the byte order of the data stored in the file {@code filename}. | |
706 | * @return a big array filled with the content of the specified file. | |
707 | */ | |
708 | public static KEY_TYPE[][] LOAD_KEYS_BIG(final CharSequence filename, final ByteOrder byteOrder) throws IOException { | |
709 | return LOAD_KEYS_BIG(new File(filename.toString()), byteOrder); | |
710 | } | |
711 | ||
712 | /** Stores an array fragment to a given writable channel, using the given byte order. | |
713 | * | |
714 | * @param array an array whose elements will be written to {@code channel}. | |
715 | * @param offset the index of the first element of {@code array} to be written. | |
716 | * @param length the number of elements of {@code array} to be written. | |
717 | * @param channel a writable channel. | |
718 | * @param byteOrder the byte order to be used to store data in {@code channel}. | |
719 | */ | |
720 | public static void STORE_KEYS(final KEY_TYPE array[][], final long offset, final long length, final WritableByteChannel channel, final ByteOrder byteOrder) throws IOException { | |
721 | for(int i = segment(offset); i < segment(offset + length + SEGMENT_MASK); i++) { | |
722 | final int s = (int)Math.max(0, offset - start(i)); | |
723 | final int l = (int)Math.min(array[i].length, offset + length - start(i)); | |
724 | STORE_KEYS(array[i], s, l - s, channel, byteOrder); | |
725 | } | |
726 | } | |
727 | ||
728 | /** Stores a big array to a given writable channel, using the given byte order. | |
729 | * | |
730 | * @param array a big array whose elements will be written to {@code channel}. | |
731 | * @param channel a writable channel. | |
732 | * @param byteOrder the byte order to be used to store data in {@code channel}. | |
733 | */ | |
734 | public static void STORE_KEYS(final KEY_TYPE array[][], final WritableByteChannel channel, final ByteOrder byteOrder) throws IOException { | |
735 | for(KEY_TYPE[] t: array) STORE_KEYS(t, channel, byteOrder); | |
736 | } | |
737 | ||
738 | /** Stores a big-array fragment to a file given by a {@link File} object, using the given byte order. | |
739 | * | |
740 | * @param array a big array whose elements will be written to {@code file}. | |
741 | * @param offset the index of the first element of {@code array} to be written. | |
742 | * @param length the number of elements of {@code array} to be written. | |
743 | * @param file a file. | |
744 | * @param byteOrder the byte order to be used to store data in {@code file}. | |
745 | */ | |
746 | public static void STORE_KEYS(final KEY_TYPE array[][], final long offset, final long length, final File file, final ByteOrder byteOrder) throws IOException { | |
747 | final FileChannel channel = FileChannel.open(file.toPath(), StandardOpenOption.WRITE, StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING); | |
748 | STORE_KEYS(array, offset, length, channel, byteOrder); | |
749 | channel.close(); | |
750 | } | |
751 | ||
752 | /** Stores a big-array fragment to a file given by a filename, using the given byte order. | |
753 | * | |
754 | * @param array a big array whose elements will be written to the file {@code filename}. | |
755 | * @param offset the index of the first element of {@code array} to be written. | |
756 | * @param length the number of elements of {@code array} to be written. | |
757 | * @param filename a filename. | |
758 | * @param byteOrder the byte order to be used to store data in the file {@code filename}. | |
759 | */ | |
760 | public static void STORE_KEYS(final KEY_TYPE array[][], final long offset, final long length, final CharSequence filename, final ByteOrder byteOrder) throws IOException { | |
761 | STORE_KEYS(array, offset, length, new File(filename.toString()), byteOrder); | |
762 | } | |
763 | ||
764 | /** Stores an array to a file given by a {@link File} object, using the given byte order. | |
765 | * | |
766 | * @param array an array whose elements will be written to {@code file}. | |
767 | * @param file a file. | |
768 | * @param byteOrder the byte order to be used to store data in {@code file}. | |
769 | */ | |
770 | public static void STORE_KEYS(final KEY_TYPE array[][], final File file, final ByteOrder byteOrder) throws IOException { | |
771 | final FileChannel channel = FileChannel.open(file.toPath(), StandardOpenOption.WRITE, StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING); | |
772 | STORE_KEYS(array, channel, byteOrder); | |
773 | channel.close(); | |
774 | } | |
775 | ||
776 | /** Stores a big array to a file given by a filename, using the given byte order. | |
777 | * | |
778 | * @param array a big array whose elements will be written to the file {@code filename}. | |
779 | * @param filename a filename. | |
780 | * @param byteOrder the byte order to be used to store data in the file {@code filename}. | |
781 | */ | |
782 | public static void STORE_KEYS(final KEY_TYPE array[][], final CharSequence filename, final ByteOrder byteOrder) throws IOException { | |
783 | STORE_KEYS(array, new File(filename.toString()), byteOrder); | |
784 | } | |
785 | ||
786 | /** Stores the element returned by an iterator to a given writable channel, using the given byte order. | |
787 | * | |
788 | * @param i an iterator whose output will be written to {@code channel}. | |
789 | * @param channel a writable channel. | |
790 | * @param byteOrder the byte order to be used to store data in {@code channel}. | |
791 | */ | |
792 | public static void STORE_KEYS(final KEY_ITERATOR i, final WritableByteChannel channel, final ByteOrder byteOrder) throws IOException { | |
793 | ByteBuffer byteBuffer = ByteBuffer.allocateDirect(BUFFER_SIZE).order(byteOrder); | |
794 | final KEY_BUFFER buffer = byteBuffer.AS_KEY_BUFFER(); | |
795 | while(i.hasNext()) { | |
796 | if (! buffer.hasRemaining()) { | |
797 | buffer.flip(); | |
798 | byteBuffer.clear(); | |
799 | byteBuffer.limit(buffer.limit() << MAPPED_BIG_LIST.LOG2_BYTES); | |
800 | channel.write(byteBuffer); | |
801 | ||
802 | buffer.clear(); | |
803 | } | |
804 | buffer.put(i.NEXT_KEY()); | |
805 | } | |
806 | ||
807 | buffer.flip(); | |
808 | byteBuffer.clear(); | |
809 | byteBuffer.limit(buffer.limit() << MAPPED_BIG_LIST.LOG2_BYTES); | |
810 | channel.write(byteBuffer); | |
811 | } | |
812 | ||
813 | /** Stores the element returned by an iterator to a file given by a {@link File} object, using the given byte order. | |
814 | * | |
815 | * @param i an iterator whose output will be written to {@code file}. | |
816 | * @param file a file. | |
817 | * @param byteOrder the byte order to be used to store data in {@code file}. | |
818 | */ | |
819 | public static void STORE_KEYS(final KEY_ITERATOR i, final File file, final ByteOrder byteOrder) throws IOException { | |
820 | final FileChannel channel = FileChannel.open(file.toPath(), StandardOpenOption.WRITE, StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING); | |
821 | STORE_KEYS(i, channel, byteOrder); | |
822 | channel.close(); | |
823 | } | |
824 | ||
825 | /** Stores the element returned by an iterator to a file given by a filename, using the given byte order. | |
826 | * | |
827 | * @param i an iterator whose output will be written to the file {@code filename}. | |
828 | * @param filename a filename. | |
829 | * @param byteOrder the byte order to be used to store data in the file {@code filename}. | |
830 | */ | |
831 | public static void STORE_KEYS(final KEY_ITERATOR i, final CharSequence filename, final ByteOrder byteOrder) throws IOException { | |
832 | STORE_KEYS(i, new File(filename.toString()), byteOrder); | |
833 | } | |
834 | ||
835 | /** A wrapper that exhibits the content of a readable channel as a type-specific iterator. */ | |
836 | ||
837 | private static final class KEY_DATA_NIO_INPUT_WRAPPER implements KEY_ITERATOR { | |
838 | private final ReadableByteChannel channel; | |
839 | private final ByteBuffer byteBuffer; | |
840 | private final KEY_BUFFER buffer; | |
841 | ||
842 | public KEY_DATA_NIO_INPUT_WRAPPER(final ReadableByteChannel channel, final ByteOrder byteOrder) { | |
843 | this.channel = channel; | |
844 | byteBuffer = ByteBuffer.allocateDirect(BUFFER_SIZE).order(byteOrder); | |
845 | buffer = byteBuffer.AS_KEY_BUFFER(); | |
846 | buffer.clear().flip(); | |
847 | } | |
848 | ||
849 | @Override | |
850 | public boolean hasNext() { | |
851 | if (! buffer.hasRemaining()) { | |
852 | byteBuffer.clear(); | |
853 | try { | |
854 | channel.read(byteBuffer); | |
855 | } catch(IOException e) { | |
856 | throw new RuntimeException(e); | |
857 | } | |
858 | byteBuffer.flip(); | |
859 | ||
860 | buffer.clear(); | |
861 | buffer.limit(byteBuffer.limit() >>> MAPPED_BIG_LIST.LOG2_BYTES); | |
862 | } | |
863 | return buffer.hasRemaining(); | |
864 | } | |
865 | ||
866 | @Override | |
867 | public KEY_TYPE NEXT_KEY() { | |
868 | if (! hasNext()) throw new NoSuchElementException(); | |
869 | return buffer.get(); | |
870 | } | |
871 | } | |
872 | ||
873 | /** Wraps the given readable channel, using the given byte order, into an iterator. | |
874 | * | |
875 | * @param channel a readable channel. | |
876 | * @param byteOrder the byte order of the data from {@code channel}. | |
877 | */ | |
878 | public static KEY_ITERATOR AS_KEY_ITERATOR(final ReadableByteChannel channel, final ByteOrder byteOrder) { | |
879 | return new KEY_DATA_NIO_INPUT_WRAPPER(channel, byteOrder); | |
880 | } | |
881 | ||
882 | /** Wraps a file given by a {@link File} object, using the given byte order, into an iterator. | |
883 | * | |
884 | * @implNote This method opens a {@link FileChannel} that will not be closed until | |
885 | * it is garbage collected. | |
886 | * | |
887 | * @param file a file. | |
888 | * @param byteOrder the byte order of the data stored in {@code file}. | |
889 | */ | |
890 | public static KEY_ITERATOR AS_KEY_ITERATOR(final File file, final ByteOrder byteOrder) throws IOException { | |
891 | final FileChannel channel = FileChannel.open(file.toPath()); | |
892 | return new KEY_DATA_NIO_INPUT_WRAPPER(channel, byteOrder); | |
893 | } | |
894 | ||
895 | /** Wraps a file given by a filename, using the given byte order, into an iterator. | |
896 | * | |
897 | * @implNote This method opens a {@link FileChannel} that will not be closed until | |
898 | * it is garbage collected. | |
899 | * | |
900 | * @param filename a filename. | |
901 | * @param byteOrder the byte order of the data stored in the file {@code filename}. | |
902 | */ | |
903 | public static KEY_ITERATOR AS_KEY_ITERATOR(final CharSequence filename, final ByteOrder byteOrder) throws IOException { | |
904 | return AS_KEY_ITERATOR(new File(filename.toString()), byteOrder); | |
905 | } | |
906 | ||
907 | /** Wraps a file given by a {@link File} object, using the given byte order, into an iterable object. | |
908 | * | |
909 | * @implNote Each iterator returned by this class opens a {@link FileChannel} | |
910 | * that will not be closed until it is garbage collected. | |
911 | * | |
912 | * @param file a file. | |
913 | * @param byteOrder the byte order of the data stored in {@code file}. | |
914 | */ | |
915 | public static KEY_ITERABLE AS_KEY_ITERABLE(final File file, final ByteOrder byteOrder) { | |
916 | return () -> { | |
917 | try { return AS_KEY_ITERATOR(file, byteOrder); } | |
918 | catch(IOException e) { throw new RuntimeException(e); } | |
919 | }; | |
920 | } | |
921 | ||
922 | /** Wraps a file given by a filename, using the given byte order, into an iterable object. | |
923 | * | |
924 | * @implNote Each iterator returned by this class opens a {@link FileChannel} | |
925 | * that will not be closed until it is garbage collected. | |
926 | * | |
927 | * @param filename a filename. | |
928 | * @param byteOrder the byte order of the data stored in the file {@code filename}. | |
929 | */ | |
930 | public static KEY_ITERABLE AS_KEY_ITERABLE(final CharSequence filename, final ByteOrder byteOrder) { | |
931 | return () -> { | |
932 | try { return AS_KEY_ITERATOR(filename, byteOrder); } | |
933 | catch(IOException e) { throw new RuntimeException(e); } | |
934 | }; | |
222 | 935 | } |
223 | 936 | |
224 | 937 | #endif |
233 | 946 | * @return the number of elements actually read from {@code dataInput} (it might be less than {@code length} if {@code dataInput} ends). |
234 | 947 | */ |
235 | 948 | public static int LOAD_KEYS(final DataInput dataInput, final KEY_TYPE[] array, final int offset, final int length) throws IOException { |
236 | PACKAGE.ARRAYS.ensureOffsetLength(array, offset, length); | |
949 | ensureOffsetLength(array.length, offset, length); | |
237 | 950 | int i = 0; |
238 | 951 | try { |
239 | 952 | for(i = 0; i < length; i++) array[i + offset] = dataInput.READ_KEY(); |
267 | 980 | * @return the number of elements actually read from the given file (it might be less than {@code length} if the file is too short). |
268 | 981 | */ |
269 | 982 | public static int LOAD_KEYS(final File file, final KEY_TYPE[] array, final int offset, final int length) throws IOException { |
270 | PACKAGE.ARRAYS.ensureOffsetLength(array, offset, length); | |
271 | ||
272 | final FileInputStream fis = new FileInputStream(file); | |
273 | 983 | #if KEY_CLASS_Byte |
274 | final int result = read(fis, array, offset, length); | |
275 | fis.close(); | |
984 | final FileChannel channel = FileChannel.open(file.toPath()); | |
985 | final int result = loadBytes(channel, array, offset, length); | |
986 | channel.close(); | |
276 | 987 | return result; |
277 | #else | |
278 | final DataInputStream dis = new DataInputStream(new FastBufferedInputStream(fis)); | |
988 | #elif KEY_CLASS_Boolean | |
989 | ensureOffsetLength(array.length, offset, length); | |
990 | final DataInputStream dis = new DataInputStream(new FastBufferedInputStream(new FileInputStream(file))); | |
279 | 991 | |
280 | 992 | int i = 0; |
281 | 993 | try { |
285 | 997 | |
286 | 998 | dis.close(); |
287 | 999 | return i; |
1000 | #else | |
1001 | return LOAD_KEYS(file, ByteOrder.BIG_ENDIAN, array, offset, length); | |
288 | 1002 | #endif |
289 | 1003 | } |
290 | 1004 | |
291 | /** Loads elements from a file given by a pathname, storing them in a given array fragment. | |
1005 | /** Loads elements from a file given by a filename, storing them in a given array fragment. | |
292 | 1006 | * |
293 | 1007 | * @param filename a filename. |
294 | 1008 | * @param array an array which will be filled with data from the specified file. |
307 | 1021 | * @return the number of elements actually read from the given file (it might be less than the array length if the file is too short). |
308 | 1022 | */ |
309 | 1023 | public static int LOAD_KEYS(final File file, final KEY_TYPE[] array) throws IOException { |
310 | final FileInputStream fis = new FileInputStream(file); | |
311 | #if KEY_CLASS_Byte | |
312 | final int result = read(fis, array, 0, array.length); | |
313 | fis.close(); | |
314 | return result; | |
315 | #else | |
316 | final DataInputStream dis = new DataInputStream(new FastBufferedInputStream(fis)); | |
317 | ||
318 | int i = 0; | |
319 | try { | |
320 | final int length = array.length; | |
321 | for(i = 0; i < length; i++) array[i] = dis.READ_KEY(); | |
322 | } | |
323 | catch(EOFException itsOk) {} | |
324 | ||
325 | dis.close(); | |
326 | ||
327 | return i; | |
328 | #endif | |
329 | } | |
330 | ||
331 | /** Loads elements from a file given by a pathname, storing them in a given array. | |
1024 | return LOAD_KEYS(file, array, 0, array.length); | |
1025 | } | |
1026 | ||
1027 | /** Loads elements from a file given by a filename, storing them in a given array. | |
332 | 1028 | * |
333 | 1029 | * @param filename a filename. |
334 | 1030 | * @param array an array which will be filled with data from the specified file. |
348 | 1044 | * @return an array filled with the content of the specified file. |
349 | 1045 | */ |
350 | 1046 | public static KEY_TYPE[] LOAD_KEYS(final File file) throws IOException { |
1047 | #if KEY_CLASS_Byte | |
1048 | final FileChannel channel = FileChannel.open(file.toPath()); | |
1049 | final long length = channel.size(); | |
1050 | if (length > Integer.MAX_VALUE) { | |
1051 | channel.close(); | |
1052 | throw new IllegalArgumentException("File too long: " + channel.size()+ " bytes (" + length + " elements)"); | |
1053 | } | |
1054 | ||
1055 | final byte[] array = new byte[(int)length]; | |
1056 | if (loadBytes(channel, array) < length) throw new EOFException(); | |
1057 | return array; | |
1058 | #elif KEY_CLASS_Boolean | |
351 | 1059 | final FileInputStream fis = new FileInputStream(file); |
352 | ||
353 | #if KEY_CLASS_Boolean | |
354 | 1060 | final long length = fis.getChannel().size(); |
355 | #else | |
356 | final long length = fis.getChannel().size() / (KEY_CLASS.SIZE / 8); | |
357 | #endif | |
358 | 1061 | |
359 | 1062 | if (length > Integer.MAX_VALUE) { |
360 | 1063 | fis.close(); |
361 | 1064 | throw new IllegalArgumentException("File too long: " + fis.getChannel().size()+ " bytes (" + length + " elements)"); |
362 | 1065 | } |
363 | 1066 | |
364 | final KEY_TYPE[] array = new KEY_TYPE[(int)length]; | |
365 | ||
366 | #if KEY_CLASS_Byte | |
367 | if (read(fis, array, 0, (int)length) < length) throw new EOFException(); | |
368 | fis.close(); | |
369 | #else | |
1067 | final boolean[] array = new boolean[(int)length]; | |
370 | 1068 | final DataInputStream dis = new DataInputStream(new FastBufferedInputStream(fis)); |
371 | 1069 | for(int i = 0; i < length; i++) array[i] = dis.READ_KEY(); |
372 | 1070 | dis.close(); |
1071 | return array; | |
1072 | #else | |
1073 | return LOAD_KEYS(file, ByteOrder.BIG_ENDIAN); | |
373 | 1074 | #endif |
374 | return array; | |
375 | 1075 | } |
376 | 1076 | |
377 | 1077 | /** Loads elements from a file given by a filename, storing them in a new array. |
395 | 1095 | * @param dataOutput a data output. |
396 | 1096 | */ |
397 | 1097 | public static void STORE_KEYS(final KEY_TYPE array[], final int offset, final int length, final DataOutput dataOutput) throws IOException { |
398 | PACKAGE.ARRAYS.ensureOffsetLength(array, offset, length); | |
1098 | ensureOffsetLength(array.length, offset, length); | |
399 | 1099 | #if KEY_CLASS_Byte |
400 | 1100 | write(dataOutput, array, offset, length); |
401 | 1101 | #else |
419 | 1119 | |
420 | 1120 | /** Stores an array fragment to a file given by a {@link File} object. |
421 | 1121 | * |
422 | * @param array an array whose elements will be written to {@code filename}. | |
1122 | * @param array an array whose elements will be written to {@code file}. | |
423 | 1123 | * @param offset the index of the first element of {@code array} to be written. |
424 | 1124 | * @param length the number of elements of {@code array} to be written. |
425 | 1125 | * @param file a file. |
426 | 1126 | */ |
427 | 1127 | public static void STORE_KEYS(final KEY_TYPE array[], final int offset, final int length, final File file) throws IOException { |
428 | PACKAGE.ARRAYS.ensureOffsetLength(array, offset, length); | |
429 | 1128 | #if KEY_CLASS_Byte |
430 | final OutputStream os = new FastBufferedOutputStream(new FileOutputStream(file)); | |
431 | write(os, array, offset, length); | |
432 | os.close(); | |
1129 | final FileChannel channel = FileChannel.open(file.toPath(), StandardOpenOption.WRITE, StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING); | |
1130 | storeBytes(array, offset, length, channel); | |
1131 | channel.close(); | |
1132 | #elif KEY_CLASS_Boolean | |
1133 | ensureOffsetLength(array.length, offset, length); | |
1134 | final DataOutputStream dos = new DataOutputStream(new FastBufferedOutputStream(new FileOutputStream(file))); | |
1135 | for(int i = 0; i < length; i++) dos.writeBoolean(array[offset + i]); | |
1136 | dos.close(); | |
433 | 1137 | #else |
434 | final DataOutputStream dos = new DataOutputStream(new FastBufferedOutputStream(new FileOutputStream(file))); | |
435 | for(int i = 0; i < length; i++) dos.WRITE_KEY(array[offset + i]); | |
436 | dos.close(); | |
1138 | STORE_KEYS(array, offset, length, file, ByteOrder.BIG_ENDIAN); | |
437 | 1139 | #endif |
438 | 1140 | } |
439 | 1141 | |
440 | /** Stores an array fragment to a file given by a pathname. | |
441 | * | |
442 | * @param array an array whose elements will be written to {@code filename}. | |
1142 | /** Stores an array fragment to a file given by a filename. | |
1143 | * | |
1144 | * @param array an array whose elements will be written to the file {@code filename}. | |
443 | 1145 | * @param offset the index of the first element of {@code array} to be written. |
444 | 1146 | * @param length the number of elements of {@code array} to be written. |
445 | 1147 | * @param filename a filename. |
450 | 1152 | |
451 | 1153 | /** Stores an array to a file given by a {@link File} object. |
452 | 1154 | * |
453 | * @param array an array whose elements will be written to {@code filename}. | |
1155 | * @param array an array whose elements will be written to {@code file}. | |
454 | 1156 | * @param file a file. |
455 | 1157 | */ |
456 | 1158 | public static void STORE_KEYS(final KEY_TYPE array[], final File file) throws IOException { |
457 | #if KEY_CLASS_Byte | |
458 | final OutputStream os = new FastBufferedOutputStream(new FileOutputStream(file)); | |
459 | write(os, array, 0, array.length); | |
460 | os.close(); | |
461 | #else | |
462 | final int length = array.length; | |
463 | final DataOutputStream dos = new DataOutputStream(new FastBufferedOutputStream(new FileOutputStream(file))); | |
464 | for(int i = 0; i < length; i++) dos.WRITE_KEY(array[i]); | |
465 | dos.close(); | |
466 | #endif | |
467 | } | |
468 | ||
469 | /** Stores an array to a file given by a pathname. | |
470 | * | |
471 | * @param array an array whose elements will be written to {@code filename}. | |
1159 | STORE_KEYS(array, 0, array.length, file); | |
1160 | } | |
1161 | ||
1162 | /** Stores an array to a file given by a filename. | |
1163 | * | |
1164 | * @param array an array whose elements will be written to the file {@code filename}. | |
472 | 1165 | * @param filename a filename. |
473 | 1166 | */ |
474 | 1167 | public static void STORE_KEYS(final KEY_TYPE array[], final CharSequence filename) throws IOException { |
476 | 1169 | } |
477 | 1170 | |
478 | 1171 | |
479 | ||
480 | ||
481 | ||
482 | 1172 | /** Loads elements from a given data input, storing them in a given big-array fragment. |
483 | 1173 | * |
484 | 1174 | * @param dataInput a data input. |
485 | 1175 | * @param array a big array which will be filled with data from {@code dataInput}. |
486 | * @param offset the index of the first element of {@code bigArray} to be filled. | |
487 | * @param length the number of elements of {@code bigArray} to be filled. | |
1176 | * @param offset the index of the first element of {@code array} to be filled. | |
1177 | * @param length the number of elements of {@code array} to be filled. | |
488 | 1178 | * @return the number of elements actually read from {@code dataInput} (it might be less than {@code length} if {@code dataInput} ends). |
489 | 1179 | */ |
490 | 1180 | public static long LOAD_KEYS(final DataInput dataInput, final KEY_TYPE[][] array, final long offset, final long length) throws IOException { |
535 | 1225 | * @return the number of elements actually read from the given file (it might be less than {@code length} if the file is too short). |
536 | 1226 | */ |
537 | 1227 | public static long LOAD_KEYS(final File file, final KEY_TYPE[][] array, final long offset, final long length) throws IOException { |
1228 | #if KEY_CLASS_Byte | |
1229 | final FileChannel channel = FileChannel.open(file.toPath()); | |
1230 | final long read = LOAD_KEYS(channel, array, offset, length); | |
1231 | return read; | |
1232 | #elif KEY_CLASS_Boolean | |
538 | 1233 | ensureOffsetLength(array, offset, length); |
539 | ||
540 | 1234 | final FileInputStream fis = new FileInputStream(file); |
541 | #if KEY_CLASS_Byte | |
542 | final long result = read(fis, array, offset, length); | |
543 | fis.close(); | |
544 | return result; | |
545 | #else | |
546 | 1235 | final DataInputStream dis = new DataInputStream(new FastBufferedInputStream(fis)); |
547 | 1236 | |
548 | 1237 | long c = 0; |
551 | 1240 | final KEY_TYPE[] t = array[i]; |
552 | 1241 | final int l = (int)Math.min(t.length, offset + length - start(i)); |
553 | 1242 | for(int d = (int)Math.max(0, offset - start(i)); d < l; d++) { |
554 | t[d] = dis.READ_KEY(); | |
1243 | t[d] = dis.readBoolean(); | |
555 | 1244 | c++; |
556 | 1245 | } |
557 | 1246 | } |
559 | 1248 | catch(EOFException itsOk) {} |
560 | 1249 | dis.close(); |
561 | 1250 | return c; |
1251 | #else | |
1252 | return LOAD_KEYS(file, ByteOrder.BIG_ENDIAN, array, offset, length); | |
562 | 1253 | #endif |
563 | 1254 | } |
564 | 1255 | |
565 | /** Loads elements from a file given by a pathname, storing them in a given big-array fragment. | |
1256 | /** Loads elements from a file given by a filename, storing them in a given big-array fragment. | |
566 | 1257 | * |
567 | 1258 | * @param filename a filename. |
568 | 1259 | * @param array an array which will be filled with data from the specified file. |
581 | 1272 | * @return the number of elements actually read from the given file (it might be less than the array length if the file is too short). |
582 | 1273 | */ |
583 | 1274 | public static long LOAD_KEYS(final File file, final KEY_TYPE[][] array) throws IOException { |
1275 | #if KEY_CLASS_Byte | |
1276 | final FileChannel channel = FileChannel.open(file.toPath()); | |
1277 | final long read = LOAD_KEYS(channel, array); | |
1278 | return read; | |
1279 | #elif KEY_CLASS_Boolean | |
584 | 1280 | final FileInputStream fis = new FileInputStream(file); |
585 | #if KEY_CLASS_Byte | |
586 | final long result = read(fis, array, 0, length(array)); | |
587 | fis.close(); | |
588 | return result; | |
589 | #else | |
590 | 1281 | final DataInputStream dis = new DataInputStream(new FastBufferedInputStream(fis)); |
591 | 1282 | |
592 | 1283 | long c = 0; |
595 | 1286 | final KEY_TYPE[] t = array[i]; |
596 | 1287 | final int l = t.length; |
597 | 1288 | for(int d = 0; d < l; d++) { |
598 | t[d] = dis.READ_KEY(); | |
1289 | t[d] = dis.readBoolean(); | |
599 | 1290 | c++; |
600 | 1291 | } |
601 | 1292 | } |
602 | 1293 | } |
603 | 1294 | catch(EOFException itsOk) {} |
604 | ||
605 | 1295 | dis.close(); |
606 | 1296 | |
607 | 1297 | return c; |
1298 | #else | |
1299 | return LOAD_KEYS(file, ByteOrder.BIG_ENDIAN, array); | |
608 | 1300 | #endif |
609 | 1301 | } |
610 | 1302 | |
611 | /** Loads elements from a file given by a pathname, storing them in a given big array. | |
1303 | /** Loads elements from a file given by a filename, storing them in a given big array. | |
612 | 1304 | * |
613 | 1305 | * @param filename a filename. |
614 | 1306 | * @param array a big array which will be filled with data from the specified file. |
628 | 1320 | * @return a big array filled with the content of the specified file. |
629 | 1321 | */ |
630 | 1322 | public static KEY_TYPE[][] LOAD_KEYS_BIG(final File file) throws IOException { |
1323 | #if KEY_CLASS_Byte | |
1324 | final FileChannel channel = FileChannel.open(file.toPath()); | |
1325 | final long length = channel.size(); | |
1326 | final byte[][] array = ByteBigArrays.newBigArray(length); | |
1327 | loadBytes(channel, array); | |
1328 | channel.close(); | |
1329 | return array; | |
1330 | #elif KEY_CLASS_Boolean | |
631 | 1331 | final FileInputStream fis = new FileInputStream(file); |
632 | ||
633 | #if KEY_CLASS_Boolean | |
634 | 1332 | final long length = fis.getChannel().size(); |
1333 | final KEY_TYPE[][] array = BooleanBigArrays.newBigArray(length); | |
1334 | final DataInputStream dis = new DataInputStream(new FastBufferedInputStream(fis)); | |
1335 | ||
1336 | for(int i = 0; i < array.length; i++) { | |
1337 | final boolean[] t = array[i]; | |
1338 | final int l = t.length; | |
1339 | for(int d = 0; d < l; d++) t[d] = dis.readBoolean(); | |
1340 | } | |
1341 | dis.close(); | |
1342 | return array; | |
635 | 1343 | #else |
636 | final long length = fis.getChannel().size() / (KEY_CLASS.SIZE / 8); | |
1344 | return LOAD_KEYS_BIG(file, ByteOrder.BIG_ENDIAN); | |
637 | 1345 | #endif |
638 | ||
639 | final KEY_TYPE[][] array = BIG_ARRAYS.newBigArray(length); | |
640 | ||
641 | #if KEY_CLASS_Byte | |
642 | if (read(fis, array, 0, length) < length) throw new EOFException(); | |
643 | fis.close(); | |
644 | #else | |
645 | final DataInputStream dis = new DataInputStream(new FastBufferedInputStream(fis)); | |
646 | ||
647 | for(int i = 0; i < array.length; i++) { | |
648 | final KEY_TYPE[] t = array[i]; | |
649 | final int l = t.length; | |
650 | for(int d = 0; d < l; d++) t[d] = dis.READ_KEY(); | |
651 | } | |
652 | ||
653 | dis.close(); | |
654 | #endif | |
655 | return array; | |
656 | 1346 | } |
657 | 1347 | |
658 | 1348 | /** Loads elements from a file given by a filename, storing them in a new big array. |
707 | 1397 | |
708 | 1398 | /** Stores a big-array fragment to a file given by a {@link File} object. |
709 | 1399 | * |
710 | * @param array a big array whose elements will be written to {@code filename}. | |
1400 | * @param array a big array whose elements will be written to {@code file}. | |
711 | 1401 | * @param offset the index of the first element of {@code array} to be written. |
712 | 1402 | * @param length the number of elements of {@code array} to be written. |
713 | 1403 | * @param file a file. |
714 | 1404 | */ |
715 | 1405 | public static void STORE_KEYS(final KEY_TYPE array[][], final long offset, final long length, final File file) throws IOException { |
716 | ensureOffsetLength(array, offset, length); | |
717 | #if KEY_CLASS_Byte | |
718 | final OutputStream os = new FastBufferedOutputStream(new FileOutputStream(file)); | |
719 | write(os, array, offset, length); | |
720 | os.close(); | |
721 | #else | |
1406 | #if KEY_CLASS_Byte | |
1407 | final FileChannel channel = FileChannel.open(file.toPath(), StandardOpenOption.WRITE, StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING); | |
1408 | storeBytes(array, offset, length, channel); | |
1409 | channel.close(); | |
1410 | #elif KEY_CLASS_Boolean | |
722 | 1411 | final DataOutputStream dos = new DataOutputStream(new FastBufferedOutputStream(new FileOutputStream(file))); |
723 | 1412 | for(int i = segment(offset); i < segment(offset + length + SEGMENT_MASK); i++) { |
724 | 1413 | final KEY_TYPE[] t = array[i]; |
726 | 1415 | for(int d = (int)Math.max(0, offset - start(i)); d < l; d++) dos.WRITE_KEY(t[d]); |
727 | 1416 | } |
728 | 1417 | dos.close(); |
729 | ||
1418 | #else | |
1419 | STORE_KEYS(array, offset, length, file, ByteOrder.BIG_ENDIAN); | |
730 | 1420 | #endif |
731 | 1421 | } |
732 | 1422 | |
733 | /** Stores a big-array fragment to a file given by a pathname. | |
734 | * | |
735 | * @param array a big array whose elements will be written to {@code filename}. | |
1423 | /** Stores a big-array fragment to a file given by a filename. | |
1424 | * | |
1425 | * @param array a big array whose elements will be written to the file {@code filename}. | |
736 | 1426 | * @param offset the index of the first element of {@code array} to be written. |
737 | 1427 | * @param length the number of elements of {@code array} to be written. |
738 | 1428 | * @param filename a filename. |
743 | 1433 | |
744 | 1434 | /** Stores an array to a file given by a {@link File} object. |
745 | 1435 | * |
746 | * @param array an array whose elements will be written to {@code filename}. | |
1436 | * @param array an array whose elements will be written to {@code file}. | |
747 | 1437 | * @param file a file. |
748 | 1438 | */ |
749 | 1439 | public static void STORE_KEYS(final KEY_TYPE array[][], final File file) throws IOException { |
750 | 1440 | #if KEY_CLASS_Byte |
751 | final OutputStream os = new FastBufferedOutputStream(new FileOutputStream(file)); | |
752 | write(os, array, 0, length(array)); | |
753 | os.close(); | |
754 | #else | |
1441 | final FileChannel channel = FileChannel.open(file.toPath(), StandardOpenOption.WRITE, StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING); | |
1442 | storeBytes(array, channel); | |
1443 | channel.close(); | |
1444 | #elif KEY_CLASS_Boolean | |
755 | 1445 | final DataOutputStream dos = new DataOutputStream(new FastBufferedOutputStream(new FileOutputStream(file))); |
756 | 1446 | for(int i = 0; i < array.length; i++) { |
757 | 1447 | final KEY_TYPE[] t = array[i]; |
759 | 1449 | for(int d = 0; d < l; d++) dos.WRITE_KEY(t[d]); |
760 | 1450 | } |
761 | 1451 | dos.close(); |
1452 | #else | |
1453 | STORE_KEYS(array, file, ByteOrder.BIG_ENDIAN); | |
762 | 1454 | #endif |
763 | 1455 | } |
764 | 1456 | |
765 | /** Stores a big array to a file given by a pathname. | |
766 | * | |
767 | * @param array a big array whose elements will be written to {@code filename}. | |
1457 | /** Stores a big array to a file given by a filename. | |
1458 | * | |
1459 | * @param array a big array whose elements will be written to the file {@code filename}. | |
768 | 1460 | * @param filename a filename. |
769 | 1461 | */ |
770 | 1462 | public static void STORE_KEYS(final KEY_TYPE array[][], final CharSequence filename) throws IOException { |
782 | 1474 | |
783 | 1475 | /** Stores the element returned by an iterator to a file given by a {@link File} object. |
784 | 1476 | * |
785 | * @param i an iterator whose output will be written to {@code filename}. | |
1477 | * @param i an iterator whose output will be written to {@code file}. | |
786 | 1478 | * @param file a file. |
787 | 1479 | */ |
788 | 1480 | public static void STORE_KEYS(final KEY_ITERATOR i, final File file) throws IOException { |
1481 | #if KEY_CLASS_Boolean || KEY_CLASS_Byte | |
789 | 1482 | final DataOutputStream dos = new DataOutputStream(new FastBufferedOutputStream(new FileOutputStream(file))); |
790 | 1483 | while(i.hasNext()) dos.WRITE_KEY(i.NEXT_KEY()); |
791 | 1484 | dos.close(); |
792 | } | |
793 | ||
794 | /** Stores the element returned by an iterator to a file given by a pathname. | |
795 | * | |
796 | * @param i an iterator whose output will be written to {@code filename}. | |
1485 | #else | |
1486 | STORE_KEYS(i, file, ByteOrder.BIG_ENDIAN); | |
1487 | #endif | |
1488 | } | |
1489 | ||
1490 | /** Stores the element returned by an iterator to a file given by a filename. | |
1491 | * | |
1492 | * @param i an iterator whose output will be written to the file {@code filename}. | |
797 | 1493 | * @param filename a filename. |
798 | 1494 | */ |
799 | 1495 | public static void STORE_KEYS(final KEY_ITERATOR i, final CharSequence filename) throws IOException { |
843 | 1539 | |
844 | 1540 | /** Wraps a file given by a {@link File} object into an iterator. |
845 | 1541 | * |
1542 | * @implNote This method opens a {@link FileChannel} that will not be closed until | |
1543 | * it is garbage collected. | |
1544 | * | |
846 | 1545 | * @param file a file. |
847 | 1546 | */ |
848 | 1547 | public static KEY_ITERATOR AS_KEY_ITERATOR(final File file) throws IOException { |
1548 | #if KEY_CLASS_Boolean || KEY_CLASS_Byte | |
849 | 1549 | return new KEY_DATA_INPUT_WRAPPER(new DataInputStream(new FastBufferedInputStream(new FileInputStream(file)))); |
850 | } | |
851 | ||
852 | /** Wraps a file given by a pathname into an iterator. | |
1550 | #else | |
1551 | return AS_KEY_ITERATOR(file, ByteOrder.BIG_ENDIAN); | |
1552 | #endif | |
1553 | } | |
1554 | ||
1555 | /** Wraps a file given by a filename into an iterator. | |
1556 | * | |
1557 | * @implNote This method opens a {@link FileChannel} that will not be closed until | |
1558 | * it is garbage collected. | |
853 | 1559 | * |
854 | 1560 | * @param filename a filename. |
855 | 1561 | */ |
858 | 1564 | } |
859 | 1565 | |
860 | 1566 | /** Wraps a file given by a {@link File} object into an iterable object. |
1567 | * | |
1568 | * @implNote Each iterator returned by this class opens a {@link FileChannel} | |
1569 | * that will not be closed until it is garbage collected. | |
861 | 1570 | * |
862 | 1571 | * @param file a file. |
863 | 1572 | */ |
868 | 1577 | }; |
869 | 1578 | } |
870 | 1579 | |
871 | /** Wraps a file given by a pathname into an iterable object. | |
1580 | /** Wraps a file given by a filename into an iterable object. | |
1581 | * | |
1582 | * @implNote Each iterator returned by this class opens a {@link FileChannel} | |
1583 | * that will not be closed until it is garbage collected. | |
872 | 1584 | * |
873 | 1585 | * @param filename a filename. |
874 | 1586 | */ |
878 | 1590 | catch(IOException e) { throw new RuntimeException(e); } |
879 | 1591 | }; |
880 | 1592 | } |
881 |
0 | 0 | /* |
1 | * Copyright (C) 2020-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2020-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2002-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2002-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2002-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2002-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2002-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2002-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2003-2021 Paolo Boldi and Sebastiano Vigna | |
1 | * Copyright (C) 2003-2022 Paolo Boldi and Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2002-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2002-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2002-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2002-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2002-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2002-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2003-2021 Paolo Boldi and Sebastiano Vigna | |
1 | * Copyright (C) 2003-2022 Paolo Boldi and Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2003-2021 Paolo Boldi and Sebastiano Vigna | |
1 | * Copyright (C) 2003-2022 Paolo Boldi and Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2003-2021 Paolo Boldi and Sebastiano Vigna | |
1 | * Copyright (C) 2003-2022 Paolo Boldi and Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2003-2021 Paolo Boldi and Sebastiano Vigna | |
1 | * Copyright (C) 2003-2022 Paolo Boldi and Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2020-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2020-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2020-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2020-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2020-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2020-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2003-2021 Paolo Boldi and Sebastiano Vigna | |
1 | * Copyright (C) 2003-2022 Paolo Boldi and Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2003-2021 Paolo Boldi and Sebastiano Vigna | |
1 | * Copyright (C) 2003-2022 Paolo Boldi and Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2002-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2002-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2020-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2020-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2002-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2002-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2002-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2002-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2002-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2002-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
207 | 207 | /** Set (hopefully quickly) elements to match the array given. |
208 | 208 | * |
209 | 209 | * Sets each in this list to the corresponding elements in the array, as if by |
210 | * <pre><code> | |
210 | * <pre> | |
211 | 211 | * ListIterator iter = listIterator(index); |
212 | 212 | * int i = 0; |
213 | 213 | * while (i < length) { |
214 | 214 | * iter.next(); |
215 | 215 | * iter.set(a[offset + i++]); |
216 | 216 | * } |
217 | * </code></pre> | |
217 | * </pre> | |
218 | 218 | * However, the exact implementation may be more efficient, taking into account |
219 | 219 | * whether random access is faster or not, or at the discretion of subclasses, |
220 | 220 | * abuse internals. |
0 | 0 | /* |
1 | * Copyright (C) 2002-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2002-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2002-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2002-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2002-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2002-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
111 | 111 | /** Removes all of the mappings from this map (optional operation). |
112 | 112 | * The map will be empty after this call returns. |
113 | 113 | * |
114 | * @throws UnsupportedOperationException if the <code>clear()</code> operation is not supported by this map | |
114 | * @throws UnsupportedOperationException if the {@link #clear()} operation is not supported by this map | |
115 | 115 | */ |
116 | 116 | |
117 | 117 | @Override |
317 | 317 | // Defaultable methods |
318 | 318 | |
319 | 319 | @Override |
320 | SUPPRESS_WARNINGS_KEY_VALUE_UNCHECKED | |
321 | 320 | default void forEach(final java.util.function.BiConsumer<? super KEY_GENERIC_CLASS, ? super VALUE_GENERIC_CLASS> consumer) { |
322 | 321 | final ObjectSet<MAP.Entry KEY_VALUE_GENERIC> entrySet = ENTRYSET(); |
323 | 322 | final Consumer<MAP.Entry KEY_VALUE_GENERIC> wrappingConsumer = (entry) -> consumer.accept(KEY2OBJ(entry.ENTRY_GET_KEY()), VALUE2OBJ(entry.ENTRY_GET_VALUE())); |
508 | 507 | * in the given mapping function. |
509 | 508 | * |
510 | 509 | * <p>This version of {@linkplain java.util.Map#computeIfAbsent(Object, java.util.function.Function) computeIfAbsent()} |
511 | * uses a type-specific version of <code>fastutil</code>'s {@link it.unimi.dsi.fastutil.Function Function}. | |
510 | * uses a type-specific version of {@code fastutil}'s {@link it.unimi.dsi.fastutil.Function Function}. | |
512 | 511 | * Since {@link it.unimi.dsi.fastutil.Function Function} has a {@link it.unimi.dsi.fastutil.Function#containsKey(Object) containsKey()} |
513 | 512 | * method, it is possible to avoid adding a key by having {@code containsKey()} return {@code false} for that key. |
514 | 513 | * |
546 | 545 | |
547 | 546 | |
548 | 547 | /** If the value for the specified key is present, attempts to compute a new mapping given the key and its current mapped value. |
548 | * | |
549 | * @apiNote The JDK specification for this method equates not being associated with a value with being associated with {code null}. | |
550 | * This is not the case for this method. | |
549 | 551 | * |
550 | 552 | * @param key key with which the specified value is to be associated. |
551 | 553 | * @param remappingFunction the function to compute a value. |
627 | 629 | */ |
628 | 630 | default VALUE_GENERIC_TYPE merge(final KEY_GENERIC_TYPE key, final VALUE_GENERIC_TYPE value, final java.util.function.BiFunction<? super VALUE_GENERIC_CLASS, ? super VALUE_GENERIC_CLASS, ? extends VALUE_GENERIC_CLASS> remappingFunction) { |
629 | 631 | java.util.Objects.requireNonNull(remappingFunction); |
630 | #if VALUES_REFERENCE | |
631 | java.util.Objects.requireNonNull(value); | |
632 | #endif | |
632 | REQUIRE_VALUE_NON_NULL(value) | |
633 | ||
633 | 634 | final VALUE_GENERIC_TYPE oldValue = GET_VALUE(key), drv = defaultReturnValue(); |
634 | 635 | final VALUE_GENERIC_TYPE newValue; |
635 | 636 | if (oldValue != drv || containsKey(key)) { |
0 | /* | |
1 | * Copyright (C) 2002-2022 Sebastiano Vigna | |
2 | * | |
3 | * Licensed under the Apache License, Version 2.0 (the "License"); | |
4 | * you may not use this file except in compliance with the License. | |
5 | * You may obtain a copy of the License at | |
6 | * | |
7 | * http://www.apache.org/licenses/LICENSE-2.0 | |
8 | * | |
9 | * Unless required by applicable law or agreed to in writing, software | |
10 | * distributed under the License is distributed on an "AS IS" BASIS, | |
11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
12 | * See the License for the specific language governing permissions and | |
13 | * limitations under the License. | |
14 | */ | |
15 | ||
16 | ||
17 | package PACKAGE; | |
18 | ||
19 | import java.io.DataOutput; | |
20 | import java.io.IOException; | |
21 | import java.nio.KEY_BUFFER; | |
22 | import java.nio.ByteOrder; | |
23 | import java.nio.ByteBuffer; | |
24 | import java.nio.MappedByteBuffer; | |
25 | import java.nio.channels.FileChannel; | |
26 | import java.nio.channels.FileChannel.MapMode; | |
27 | import java.util.Arrays; | |
28 | ||
29 | /** A bridge between byte {@linkplain ByteBuffer buffers} and type-specific {@linkplain it.unimi.dsi.fastutil.BigList big lists}. | |
30 | * | |
31 | * <p>Java's {@linkplain FileChannel#map(MapMode, long, long) memory-mapping facilities} have | |
32 | * the severe limitation of mapping at most {@link Integer#MAX_VALUE} bytes, as they | |
33 | * expose the content of a file using a {@link MappedByteBuffer}. This class can {@linkplain #map(FileChannel, ByteOrder, FileChannel.MapMode) expose | |
34 | * a file of primitive types of arbitrary length} as a {@link it.unimi.dsi.fastutil.BigList} | |
35 | * that is actually based on an array of {@link MappedByteBuffer}s, each mapping | |
36 | * a <em>chunk</em> of {@link #CHUNK_SIZE} longs. | |
37 | * | |
38 | * <p>Mapping can happen with a specified byte order: saving and mapping data in {@linkplain ByteOrder#nativeOrder() native order} | |
39 | * using methods from {@link it.unimi.dsi.fastutil.io.BinIO} will enhance performance significantly. | |
40 | * | |
41 | * <p>Instances of this class are not thread safe, but the {@link #copy()} method provides a lightweight | |
42 | * duplicate that can be read independently by another thread. | |
43 | * Only chunks that are actually used will be {@linkplain ByteBuffer#duplicate() duplicated} lazily. | |
44 | * If you are modifiying the content of list, however, you will need to provide external synchronization. | |
45 | * | |
46 | * @author Sebastiano Vigna | |
47 | */ | |
48 | ||
49 | public class MAPPED_BIG_LIST extends ABSTRACT_BIG_LIST { | |
50 | /** The logarithm of the number of bytes of the primitive type of this list. */ | |
51 | public static int LOG2_BYTES = Long.SIZE - 1 - Long.numberOfLeadingZeros(KEY_CLASS.BYTES); | |
52 | ||
53 | /** @deprecated Use {@link #LOG2_BYTES}. */ | |
54 | @Deprecated | |
55 | public static int LOG2_BITS = Long.SIZE - 1 - Long.numberOfLeadingZeros(KEY_CLASS.BYTES); | |
56 | ||
57 | private static int CHUNK_SHIFT = 30 - LOG2_BYTES; | |
58 | ||
59 | /** The size in elements of a chunk created by {@link #map(FileChannel, ByteOrder, FileChannel.MapMode)}. */ | |
60 | public static final long CHUNK_SIZE = 1L << CHUNK_SHIFT; | |
61 | ||
62 | /** The mask used to compute the offset in the chunk in longs. */ | |
63 | private static final long CHUNK_MASK = CHUNK_SIZE - 1; | |
64 | ||
65 | /** The underlying buffers. */ | |
66 | private final KEY_BUFFER[] buffer; | |
67 | ||
68 | /** An array parallel to {@link #buffer} specifying which buffers do not need to be | |
69 | * duplicated before being used. */ | |
70 | private final boolean[] readyToUse; | |
71 | ||
72 | /** The number of byte buffers. */ | |
73 | private final int n; | |
74 | ||
75 | /** The overall size in elements. */ | |
76 | private final long size; | |
77 | ||
78 | /** Creates a new mapped big list. | |
79 | * | |
80 | * @param buffer the underlying buffers. | |
81 | * @param size the overall number of elements in the underlying buffers (i.e., the | |
82 | * sum of the capacities of the byte buffers divided by the size of an element in bytes). | |
83 | * @param readyToUse an array parallel to {@code buffer} specifying which buffers do not need to be | |
84 | * {@linkplain ByteBuffer#duplicate() duplicated} before being used (the process will happen lazily); the array | |
85 | * will be used internally by the newly created mapped big list. | |
86 | */ | |
87 | ||
88 | protected MAPPED_BIG_LIST(final KEY_BUFFER[] buffer, final long size, final boolean[] readyToUse) { | |
89 | this.buffer = buffer; | |
90 | this.n = buffer.length; | |
91 | this.size = size; | |
92 | this.readyToUse = readyToUse; | |
93 | ||
94 | for(int i = 0; i < n; i++) if (i < n - 1 && buffer[i].capacity() != CHUNK_SIZE) throw new IllegalArgumentException(); | |
95 | } | |
96 | ||
97 | /** Creates a new mapped big list by read-only mapping a given file channel using the | |
98 | * standard Java (i.e., {@link DataOutput}) byte order ({@link ByteOrder#BIG_ENDIAN}). | |
99 | * | |
100 | * @param fileChannel the file channel that will be mapped. | |
101 | * @return a new read-only mapped big list over the contents of {@code fileChannel}. | |
102 | * | |
103 | * @see #map(FileChannel, ByteOrder, MapMode) | |
104 | */ | |
105 | ||
106 | public static MAPPED_BIG_LIST map(final FileChannel fileChannel) throws IOException { | |
107 | return map(fileChannel, ByteOrder.BIG_ENDIAN); | |
108 | } | |
109 | ||
110 | /** Creates a new mapped big list by read-only mapping a given file channel. | |
111 | * | |
112 | * @param fileChannel the file channel that will be mapped. | |
113 | * @param byteOrder a prescribed byte order. | |
114 | * @return a new read-only mapped big list over the contents of {@code fileChannel}. | |
115 | * | |
116 | * @see #map(FileChannel, ByteOrder, MapMode) | |
117 | */ | |
118 | ||
119 | public static MAPPED_BIG_LIST map(final FileChannel fileChannel, final ByteOrder byteOrder) throws IOException { | |
120 | return map(fileChannel, byteOrder, MapMode.READ_ONLY); | |
121 | } | |
122 | ||
123 | /** Creates a new mapped big list by mapping a given file channel. | |
124 | * | |
125 | * @param fileChannel the file channel that will be mapped. | |
126 | * @param byteOrder a prescribed byte order. | |
127 | * @param mapMode the mapping mode: usually {@link MapMode#READ_ONLY}, but if intend to make the list | |
128 | * {@linkplain #set mutable}, you have to pass {@link MapMode#READ_WRITE}. | |
129 | * @return a new mapped big list over the contents of {@code fileChannel}. | |
130 | */ | |
131 | ||
132 | public static MAPPED_BIG_LIST map(final FileChannel fileChannel, final ByteOrder byteOrder, final MapMode mapMode) throws IOException { | |
133 | final long size = fileChannel.size() / KEY_CLASS.BYTES; | |
134 | final int chunks = (int)((size + (CHUNK_SIZE - 1)) / CHUNK_SIZE); | |
135 | final KEY_BUFFER[] buffer = new KEY_BUFFER[chunks]; | |
136 | #if KEY_CLASS_Byte | |
137 | for(int i = 0; i < chunks; i++) buffer[i] = fileChannel.map(mapMode, i * CHUNK_SIZE * KEY_CLASS.BYTES, Math.min(CHUNK_SIZE, size - i * CHUNK_SIZE) * KEY_CLASS.BYTES); | |
138 | #else | |
139 | for(int i = 0; i < chunks; i++) buffer[i] = fileChannel.map(mapMode, i * CHUNK_SIZE * KEY_CLASS.BYTES, Math.min(CHUNK_SIZE, size - i * CHUNK_SIZE) * KEY_CLASS.BYTES).order(byteOrder).AS_KEY_BUFFER(); | |
140 | #endif | |
141 | final boolean[] readyToUse = new boolean[chunks]; | |
142 | Arrays.fill(readyToUse, true); | |
143 | return new MAPPED_BIG_LIST(buffer, size, readyToUse); | |
144 | } | |
145 | ||
146 | private KEY_BUFFER KEY_BUFFER(final int n) { | |
147 | if (readyToUse[n]) return buffer[n]; | |
148 | readyToUse[n] = true; | |
149 | return buffer[n] = buffer[n].duplicate(); | |
150 | } | |
151 | ||
152 | /** Returns a lightweight duplicate that can be read independently by another thread. | |
153 | * | |
154 | * <p>Only chunks that are actually used will be {@linkplain ByteBuffer#duplicate() duplicated} lazily. | |
155 | * @return a lightweight duplicate that can be read independently by another thread. | |
156 | */ | |
157 | public MAPPED_BIG_LIST copy() { | |
158 | return new MAPPED_BIG_LIST(buffer.clone(), size, new boolean[n]); | |
159 | } | |
160 | ||
161 | @Override | |
162 | public KEY_TYPE GET_KEY(final long index) { | |
163 | return KEY_BUFFER((int)(index >>> CHUNK_SHIFT)).get((int)(index & CHUNK_MASK)); | |
164 | } | |
165 | ||
166 | @Override | |
167 | public void getElements(long from, KEY_TYPE a[], int offset, int length) { | |
168 | int chunk = (int)(from >>> CHUNK_SHIFT); | |
169 | int displ = (int)(from & CHUNK_MASK); | |
170 | ||
171 | while(length > 0) { | |
172 | KEY_BUFFER b = KEY_BUFFER(chunk); | |
173 | final int l = Math.min(b.capacity() - displ, length); | |
174 | if (l == 0) throw new ArrayIndexOutOfBoundsException(); | |
175 | ||
176 | // TODO: use chaining switching to Java 9+ | |
177 | b.position(displ); | |
178 | b.get(a, offset, l); | |
179 | ||
180 | if ((displ += l) == CHUNK_SIZE) { | |
181 | displ = 0; | |
182 | chunk++; | |
183 | } | |
184 | ||
185 | offset += l; | |
186 | length -= l; | |
187 | } | |
188 | } | |
189 | ||
190 | @Override | |
191 | public KEY_TYPE set(final long index, final KEY_TYPE value) { | |
192 | final KEY_BUFFER b = KEY_BUFFER((int)(index >>> CHUNK_SHIFT)); | |
193 | final int i = (int)(index & CHUNK_MASK); | |
194 | final KEY_TYPE previousValue = b.get(i); | |
195 | b.put(i, value); | |
196 | return previousValue; | |
197 | } | |
198 | ||
199 | @Override | |
200 | public long size64() { | |
201 | return size; | |
202 | } | |
203 | } |
0 | 0 | /* |
1 | * Copyright (C) 2002-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2002-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
124 | 124 | @Override |
125 | 125 | public void putAll(final Map<? extends KEY_GENERIC_CLASS, ? extends VALUE_GENERIC_CLASS> m) { throw new UnsupportedOperationException(); } |
126 | 126 | |
127 | @SuppressWarnings("unchecked") | |
128 | 127 | @Override |
129 | 128 | public ObjectSet<MAP.Entry KEY_VALUE_GENERIC> ENTRYSET() { return ObjectSets.EMPTY_SET; } |
130 | 129 |
0 | 0 | /* |
1 | * Copyright (C) 2020-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2020-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2002-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2002-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2002-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2002-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
1201 | 1201 | java.util.Objects.requireNonNull(remappingFunction); |
1202 | 1202 | final int pos = find(k); |
1203 | 1203 | if (pos < 0) return defRetValue; |
1204 | #if VALUES_REFERENCE | |
1205 | if (value[pos] == null) return defRetValue; | |
1206 | #endif | |
1204 | 1207 | final VALUE_GENERIC_CLASS newValue = remappingFunction.apply(KEY2OBJ(k), VALUE2OBJ(value[pos])); |
1205 | 1208 | if (newValue == null) { |
1206 | 1209 | if (KEY_EQUALS_NULL(k)) removeNullEntry(); |
1237 | 1240 | @Override |
1238 | 1241 | public VALUE_GENERIC_TYPE merge(final KEY_GENERIC_TYPE k, final VALUE_GENERIC_TYPE v, final java.util.function.BiFunction<? super VALUE_GENERIC_CLASS, ? super VALUE_GENERIC_CLASS, ? extends VALUE_GENERIC_CLASS> remappingFunction) { |
1239 | 1242 | java.util.Objects.requireNonNull(remappingFunction); |
1243 | REQUIRE_VALUE_NON_NULL(v) | |
1240 | 1244 | |
1241 | 1245 | final int pos = find(k); |
1242 | 1246 | #if VALUES_PRIMITIVE |
1243 | 1247 | if (pos < 0) { |
1244 | 1248 | #else |
1245 | 1249 | if (pos < 0 || value[pos] == null) { |
1246 | if (v == null) return defRetValue; | |
1247 | #endif | |
1248 | insert(-pos - 1, k, v); | |
1250 | #endif | |
1251 | if (pos < 0) insert(-pos - 1, k, v); | |
1252 | else value[pos] = v; | |
1253 | ||
1249 | 1254 | return v; |
1250 | 1255 | } |
1251 | 1256 |
0 | 0 | /* |
1 | * Copyright (C) 2002-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2002-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2020-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2020-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2020-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2020-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2003-2021 Paolo Boldi and Sebastiano Vigna | |
1 | * Copyright (C) 2003-2022 Paolo Boldi and Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2003-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2003-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2002-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2002-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
298 | 298 | */ |
299 | 299 | private Entry KEY_VALUE_GENERIC add(final KEY_GENERIC_TYPE k) { |
300 | 300 | /* After execution of this method, modified is true iff a new entry has been inserted. */ |
301 | REQUIRE_KEY_NON_NULL(k) | |
301 | 302 | modified = false; |
302 | 303 | int maxDepth = 0; |
303 | 304 | |
993 | 994 | SUPPRESS_WARNINGS_KEY_UNCHECKED |
994 | 995 | @Override |
995 | 996 | public boolean containsKey(final KEY_TYPE k) { |
997 | RETURN_FALSE_IF_KEY_NULL(k) | |
996 | 998 | return findKey(KEY_GENERIC_CAST k) != null; |
997 | 999 | } |
998 | 1000 | |
1136 | 1138 | |
1137 | 1139 | |
1138 | 1140 | @Override |
1141 | SUPPRESS_WARNINGS_KEY_UNCHECKED | |
1139 | 1142 | public ObjectSortedSet<MAP.Entry KEY_VALUE_GENERIC> ENTRYSET() { |
1140 | 1143 | if (entries == null) entries = new AbstractObjectSortedSet<MAP.Entry KEY_VALUE_GENERIC>() { |
1141 | final Comparator<? super MAP.Entry KEY_VALUE_GENERIC> comparator = (Comparator<MAP.Entry KEY_VALUE_GENERIC>) (x, y) -> RB_TREE_MAP.this.actualComparator.compare(x.ENTRY_GET_KEY(), y.ENTRY_GET_KEY()); | |
1144 | final Comparator<? super MAP.Entry KEY_VALUE_GENERIC> comparator = (RB_TREE_MAP.this.actualComparator == null ? | |
1145 | (Comparator<MAP.Entry KEY_VALUE_GENERIC>) (x, y) -> KEY_CMP(x.ENTRY_GET_KEY(), y.ENTRY_GET_KEY()) : | |
1146 | (Comparator<MAP.Entry KEY_VALUE_GENERIC>) (x, y) -> RB_TREE_MAP.this.actualComparator.compare(x.ENTRY_GET_KEY(), y.ENTRY_GET_KEY()) | |
1147 | ); | |
1148 | ||
1142 | 1149 | |
1143 | 1150 | @Override |
1144 | 1151 | public Comparator<? super MAP.Entry KEY_VALUE_GENERIC> comparator() { return comparator; } |
1152 | 1159 | @Override |
1153 | 1160 | SUPPRESS_WARNINGS_KEY_UNCHECKED |
1154 | 1161 | public boolean contains(final Object o) { |
1155 | if (!(o instanceof Map.Entry)) return false; | |
1162 | if (o == null || !(o instanceof Map.Entry)) return false; | |
1156 | 1163 | final Map.Entry<?,?> e = (Map.Entry<?,?>)o; |
1164 | if (e.getKey() == null) return false; | |
1157 | 1165 | #if KEYS_PRIMITIVE |
1158 | if (e.getKey() == null || ! (e.getKey() instanceof KEY_CLASS)) return false; | |
1166 | if (! (e.getKey() instanceof KEY_CLASS)) return false; | |
1159 | 1167 | #endif |
1160 | 1168 | #if VALUES_PRIMITIVE |
1161 | 1169 | if (e.getValue() == null || ! (e.getValue() instanceof VALUE_CLASS)) return false; |
1169 | 1177 | public boolean remove(final Object o) { |
1170 | 1178 | if (!(o instanceof Map.Entry)) return false; |
1171 | 1179 | final Map.Entry<?,?> e = (Map.Entry<?,?>)o; |
1180 | if (e.getKey() == null) return false; | |
1172 | 1181 | #if KEYS_PRIMITIVE |
1173 | if (e.getKey() == null || ! (e.getKey() instanceof KEY_CLASS)) return false; | |
1182 | if (! (e.getKey() instanceof KEY_CLASS)) return false; | |
1174 | 1183 | #endif |
1175 | 1184 | #if VALUES_PRIMITIVE |
1176 | 1185 | if (e.getValue() == null || ! (e.getValue() instanceof VALUE_CLASS)) return false; |
1468 | 1477 | |
1469 | 1478 | @Override |
1470 | 1479 | SUPPRESS_WARNINGS_KEY_UNCHECKED |
1471 | public boolean containsKey(final KEY_TYPE k) { return in(KEY_GENERIC_CAST k) && RB_TREE_MAP.this.containsKey(k); } | |
1480 | public boolean containsKey(final KEY_TYPE k) { | |
1481 | RETURN_FALSE_IF_KEY_NULL(k) | |
1482 | return in(KEY_GENERIC_CAST k) && RB_TREE_MAP.this.containsKey(k); | |
1483 | } | |
1472 | 1484 | |
1473 | 1485 | @Override |
1474 | 1486 | public boolean containsValue(final VALUE_TYPE v) { |
0 | 0 | /* |
1 | * Copyright (C) 2002-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2002-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
289 | 289 | |
290 | 290 | @Override |
291 | 291 | public boolean add(final KEY_GENERIC_TYPE k) { |
292 | REQUIRE_KEY_NON_NULL(k) | |
292 | 293 | int maxDepth = 0; |
293 | 294 | |
294 | 295 | if (tree == null) { // The case of the empty tree is treated separately. |
0 | 0 | /* |
1 | * Copyright (C) 2003-2021 Paolo Boldi and Sebastiano Vigna | |
1 | * Copyright (C) 2003-2022 Paolo Boldi and Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2002-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2002-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2002-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2002-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2002-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2002-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2002-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2002-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
86 | 86 | @Override |
87 | 87 | public KEY_COMPARATOR KEY_SUPER_GENERIC comparator() { return null; } |
88 | 88 | |
89 | @SuppressWarnings("unchecked") | |
90 | 89 | @Override |
91 | 90 | public ObjectSortedSet<MAP.Entry KEY_VALUE_GENERIC> ENTRYSET() { return ObjectSortedSets.EMPTY_SET; } |
92 | 91 | |
98 | 97 | /** {@inheritDoc} */ |
99 | 98 | #endif |
100 | 99 | @Override |
101 | @SuppressWarnings("unchecked") | |
102 | 100 | public ObjectSortedSet<Map.Entry<KEY_GENERIC_CLASS, VALUE_GENERIC_CLASS>> entrySet() { return ObjectSortedSets.EMPTY_SET; } |
103 | 101 | |
104 | 102 | SUPPRESS_WARNINGS_KEY_UNCHECKED |
284 | 282 | |
285 | 283 | public static KEY_VALUE_GENERIC SORTED_MAP KEY_VALUE_GENERIC singleton(final KEY_GENERIC_CLASS key, VALUE_GENERIC_CLASS value) { return new Singleton KEY_VALUE_GENERIC_DIAMOND(KEY_CLASS2TYPE(key), VALUE_CLASS2TYPE(value));} |
286 | 284 | |
287 | /** RETURNS a type-specific immutable sorted map containing only the specified pair. The returned sorted map is serializable and cloneable. | |
285 | /** Returns a type-specific immutable sorted map containing only the specified pair. The returned sorted map is serializable and cloneable. | |
288 | 286 | * |
289 | 287 | * <p>Note that albeit the returned map is immutable, its default return value may be changed. |
290 | 288 | * |
0 | 0 | |
1 | 1 | |
2 | 2 | /* |
3 | * Copyright (C) 2020-2021 Sebastiano Vigna | |
3 | * Copyright (C) 2020-2022 Sebastiano Vigna | |
4 | 4 | * |
5 | 5 | * Licensed under the Apache License, Version 2.0 (the "License"); |
6 | 6 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2002-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2002-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2002-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2002-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2002-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2002-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2002-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2002-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2002-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2002-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
43 | 43 | |
44 | 44 | /** Peeks at an element on the stack (optional operation). |
45 | 45 | * @param i an index from the stop of the stack (0 represents the top). |
46 | * @return the <code>i</code>-th element on the stack. | |
46 | * @return the {@code i}-th element on the stack. | |
47 | 47 | * @see Stack#peek(int) |
48 | 48 | */ |
49 | 49 | KEY_TYPE PEEK(int i); |
0 | 0 | /* |
1 | * Copyright (C) 2002-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2002-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2005-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2005-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2004-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2004-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2020-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2020-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
38 | 38 | |
39 | 39 | file=${2##*/} |
40 | 40 | name=${file%.*} |
41 | ||
41 | 42 | class=${name#Abstract} |
42 | if [[ "$class" == "$name" ]]; then | |
43 | abstract= | |
44 | else | |
45 | abstract=Abstract | |
46 | fi | |
47 | class=${class#Striped} | |
48 | 43 | |
49 | 44 | # Now we rip off the types. |
50 | 45 | rem=${class##[A-Z]+([a-z])} |
572 | 567 | "#define ARRAY_LIST ${TYPE_CAP[$k]}ArrayList\n"\ |
573 | 568 | "#define IMMUTABLE_LIST ${TYPE_CAP[$k]}ImmutableList\n"\ |
574 | 569 | "#define BIG_ARRAY_BIG_LIST ${TYPE_CAP[$k]}BigArrayBigList\n"\ |
570 | "#define MAPPED_BIG_LIST ${TYPE_CAP[$k]}MappedBigList\n"\ | |
575 | 571 | "#define ARRAY_FRONT_CODED_LIST ${TYPE_CAP[$k]}ArrayFrontCodedList\n"\ |
576 | 572 | "#define ARRAY_FRONT_CODED_BIG_LIST ${TYPE_CAP[$k]}ArrayFrontCodedBigList\n"\ |
577 | 573 | "#define HEAP_PRIORITY_QUEUE ${TYPE_CAP2[$k]}HeapPriorityQueue\n"\ |
583 | 579 | "#define ARRAY_PRIORITY_QUEUE ${TYPE_CAP2[$k]}ArrayPriorityQueue\n"\ |
584 | 580 | "#define ARRAY_INDIRECT_PRIORITY_QUEUE ${TYPE_CAP2[$k]}ArrayIndirectPriorityQueue\n"\ |
585 | 581 | "#define ARRAY_INDIRECT_DOUBLE_PRIORITY_QUEUE ${TYPE_CAP2[$k]}ArrayIndirectDoublePriorityQueue\n"\ |
582 | "#define KEY_BUFFER ${TYPE_CAP[$k]}Buffer\n"\ | |
586 | 583 | \ |
587 | 584 | \ |
588 | 585 | "/* Synchronized wrappers */\n"\ |
615 | 612 | \ |
616 | 613 | "#define KEY_READER_WRAPPER ${TYPE_CAP[$k]}ReaderWrapper\n"\ |
617 | 614 | "#define KEY_DATA_INPUT_WRAPPER ${TYPE_CAP[$k]}DataInputWrapper\n"\ |
615 | "#define KEY_DATA_NIO_INPUT_WRAPPER ${TYPE_CAP[$k]}DataNioInputWrapper\n"\ | |
618 | 616 | \ |
619 | 617 | \ |
620 | 618 | "/* Methods (keys) */\n"\ |
631 | 629 | "#define FIRST_KEY first${TYPE_STD[$k]}Key\n"\ |
632 | 630 | "#define LAST_KEY last${TYPE_STD[$k]}Key\n"\ |
633 | 631 | "#define GET_KEY get${TYPE_STD[$k]}\n"\ |
632 | "#define AS_KEY_BUFFER as${TYPE_STD[$k]}Buffer\n"\ | |
634 | 633 | "#define PAIR_LEFT left${TYPE_STD[$k]}\n"\ |
635 | 634 | "#define PAIR_FIRST first${TYPE_STD[$k]}\n"\ |
636 | 635 | "#define PAIR_KEY key${TYPE_STD[$k]}\n"\ |
664 | 663 | "#if KEYS_REFERENCE\n"\ |
665 | 664 | "#define MAP_TO_KEY map\n"\ |
666 | 665 | "#define MAP_TO_KEY_WIDENED map\n"\ |
666 | "#define RETURN_FALSE_IF_KEY_NULL(k) if (k == null) return false;\n"\ | |
667 | "#define REQUIRE_KEY_NON_NULL(k) java.util.Objects.requireNonNull(k);\n"\ | |
667 | 668 | "#else\n"\ |
668 | 669 | "#define MAP_TO_KEY mapTo${TYPE_CAP2[$k]}\n"\ |
669 | 670 | "#define MAP_TO_KEY_WIDENED mapTo${TYPE_CAP2[$wk]}\n"\ |
671 | "#define REQUIRE_KEY_NON_NULL(k)\n"\ | |
672 | "#define RETURN_FALSE_IF_KEY_NULL(k)\n"\ | |
670 | 673 | "#endif\n"\ |
671 | 674 | \ |
672 | 675 | \ |
686 | 689 | "#define PAIR_RIGHT right${TYPE_STD[$v]}\n"\ |
687 | 690 | "#define PAIR_SECOND second${TYPE_STD[$v]}\n"\ |
688 | 691 | "#define PAIR_VALUE value${TYPE_STD[$v]}\n"\ |
692 | "#if VALUES_REFERENCE\n"\ | |
693 | "#define REQUIRE_VALUE_NON_NULL(v) java.util.Objects.requireNonNull(v);\n"\ | |
694 | "#else\n"\ | |
695 | "#define REQUIRE_VALUE_NON_NULL(v)\n"\ | |
696 | "#endif\n"\ | |
689 | 697 | \ |
690 | 698 | \ |
691 | 699 | "/* Methods (keys/values) */\n"\ |
0 | /* | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | * | |
3 | * Licensed under the Apache License, Version 2.0 (the "License"); | |
4 | * you may not use this file except in compliance with the License. | |
5 | * You may obtain a copy of the License at | |
6 | * | |
7 | * http://www.apache.org/licenses/LICENSE-2.0 | |
8 | * | |
9 | * Unless required by applicable law or agreed to in writing, software | |
10 | * distributed under the License is distributed on an "AS IS" BASIS, | |
11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
12 | * See the License for the specific language governing permissions and | |
13 | * limitations under the License. | |
14 | */ | |
15 | ||
16 | package it.unimi.dsi.fastutil.ints; | |
17 | ||
18 | import java.lang.reflect.Method; | |
19 | import java.util.Arrays; | |
20 | import java.util.HashSet; | |
21 | import java.util.List; | |
22 | import java.util.Map; | |
23 | import java.util.Map.Entry; | |
24 | import java.util.function.Supplier; | |
25 | ||
26 | import com.google.common.collect.testing.Helpers; | |
27 | import com.google.common.collect.testing.MapTestSuiteBuilder; | |
28 | import com.google.common.collect.testing.SampleElements; | |
29 | import com.google.common.collect.testing.TestMapGenerator; | |
30 | import com.google.common.collect.testing.features.CollectionFeature; | |
31 | import com.google.common.collect.testing.features.CollectionSize; | |
32 | import com.google.common.collect.testing.features.MapFeature; | |
33 | import com.google.common.collect.testing.testers.CollectionToStringTester; | |
34 | import com.google.common.collect.testing.testers.MapToStringTester; | |
35 | ||
36 | import junit.framework.TestCase; | |
37 | import junit.framework.TestSuite; | |
38 | ||
39 | public class Int2IntOpenHashMapGuavaTest extends TestCase { | |
40 | ||
41 | public static TestSuite suite() { | |
42 | return suite("Int2IntOpenHashMap", Int2IntOpenHashMap::new); | |
43 | } | |
44 | ||
45 | public static TestSuite suite(final String name, final Supplier<Map<Integer, Integer>> factory) { | |
46 | final HashSet<Method> toStringTests = new HashSet<>(); | |
47 | toStringTests.addAll(Arrays.asList(MapToStringTester.class.getDeclaredMethods())); | |
48 | toStringTests.addAll(Arrays.asList(CollectionToStringTester.class.getDeclaredMethods())); | |
49 | ||
50 | return MapTestSuiteBuilder.using(new TestMapGenerator<Integer, Integer>() { | |
51 | ||
52 | @Override | |
53 | public SampleElements<Entry<Integer, Integer>> samples() { | |
54 | return new SampleElements<>(Helpers.mapEntry(Integer.valueOf(0), Integer.valueOf(1)), | |
55 | Helpers.mapEntry(Integer.valueOf(-2), Integer.valueOf(4)), | |
56 | Helpers.mapEntry(Integer.valueOf(100), Integer.valueOf(-1)), | |
57 | Helpers.mapEntry(Integer.valueOf(2), Integer.valueOf(1000)), | |
58 | Helpers.mapEntry(Integer.valueOf(1), Integer.valueOf(2))); | |
59 | } | |
60 | ||
61 | @Override | |
62 | public Map<Integer, Integer> create(final Object... entries) { | |
63 | Map<Integer, Integer> map = factory.get(); | |
64 | for (final Object o : entries) { | |
65 | @SuppressWarnings("unchecked") | |
66 | final Entry<Integer, Integer> e = (Entry<Integer, Integer>)o; | |
67 | map.put(e.getKey(), e.getValue()); | |
68 | } | |
69 | return map; | |
70 | } | |
71 | ||
72 | @Override | |
73 | @SuppressWarnings("unchecked") | |
74 | public final Map.Entry<Integer, Integer>[] createArray(final int length) { | |
75 | return new Map.Entry[length]; | |
76 | } | |
77 | ||
78 | @Override | |
79 | public final Integer[] createKeyArray(final int length) { | |
80 | return new Integer[length]; | |
81 | } | |
82 | ||
83 | @Override | |
84 | public final Integer[] createValueArray(final int length) { | |
85 | return new Integer[length]; | |
86 | } | |
87 | ||
88 | /** Returns the original element list, unchanged. */ | |
89 | @Override | |
90 | public Iterable<Entry<Integer, Integer>> order(final List<Entry<Integer, Integer>> insertionOrder) { | |
91 | return insertionOrder; | |
92 | } | |
93 | }).named(name).withFeatures(CollectionSize.ANY, MapFeature.GENERAL_PURPOSE, MapFeature.SUPPORTS_PUT, MapFeature.SUPPORTS_REMOVE, MapFeature.ALLOWS_ANY_NULL_QUERIES, CollectionFeature.SUPPORTS_ITERATOR_REMOVE).suppressing(toStringTests).createTestSuite(); | |
94 | } | |
95 | } |
0 | /* | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | * | |
3 | * Licensed under the Apache License, Version 2.0 (the "License"); | |
4 | * you may not use this file except in compliance with the License. | |
5 | * You may obtain a copy of the License at | |
6 | * | |
7 | * http://www.apache.org/licenses/LICENSE-2.0 | |
8 | * | |
9 | * Unless required by applicable law or agreed to in writing, software | |
10 | * distributed under the License is distributed on an "AS IS" BASIS, | |
11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
12 | * See the License for the specific language governing permissions and | |
13 | * limitations under the License. | |
14 | */ | |
15 | ||
16 | package it.unimi.dsi.fastutil.ints; | |
17 | ||
18 | import java.lang.reflect.Method; | |
19 | import java.util.Arrays; | |
20 | import java.util.HashSet; | |
21 | import java.util.List; | |
22 | import java.util.Set; | |
23 | import java.util.function.Supplier; | |
24 | ||
25 | import com.google.common.collect.testing.SampleElements; | |
26 | import com.google.common.collect.testing.SetTestSuiteBuilder; | |
27 | import com.google.common.collect.testing.TestSetGenerator; | |
28 | import com.google.common.collect.testing.features.CollectionFeature; | |
29 | import com.google.common.collect.testing.features.CollectionSize; | |
30 | import com.google.common.collect.testing.features.SetFeature; | |
31 | import com.google.common.collect.testing.testers.CollectionToStringTester; | |
32 | import com.google.common.collect.testing.testers.MapToStringTester; | |
33 | ||
34 | import junit.framework.TestCase; | |
35 | import junit.framework.TestSuite; | |
36 | ||
37 | public class IntSetGuavaTest extends TestCase { | |
38 | ||
39 | public static TestSuite suite() { | |
40 | return suite("IntOpenHashSet", IntOpenHashSet::new); | |
41 | } | |
42 | ||
43 | public static TestSuite suite(final String name, final Supplier<Set<Integer>> factory) { | |
44 | final HashSet<Method> toStringTests = new HashSet<>(); | |
45 | toStringTests.addAll(Arrays.asList(MapToStringTester.class.getDeclaredMethods())); | |
46 | toStringTests.addAll(Arrays.asList(CollectionToStringTester.class.getDeclaredMethods())); | |
47 | ||
48 | return SetTestSuiteBuilder.using(new TestSetGenerator<Integer>() { | |
49 | @Override | |
50 | public Integer[] createArray(final int n) { | |
51 | return new Integer[n]; | |
52 | } | |
53 | ||
54 | @Override | |
55 | public Iterable<Integer> order(final List<Integer> insertionOrder) { | |
56 | return insertionOrder; | |
57 | } | |
58 | ||
59 | @Override | |
60 | public Set<Integer> create(final Object... elements) { | |
61 | final Set<Integer> set = factory.get(); | |
62 | for (final Object e : elements) { | |
63 | set.add((Integer)e); | |
64 | } | |
65 | return set; | |
66 | } | |
67 | ||
68 | @Override | |
69 | public SampleElements<Integer> samples() { | |
70 | return new SampleElements<>(Integer.valueOf(0), Integer.valueOf(1), Integer.valueOf(2), Integer.valueOf(3), Integer.valueOf(4)); | |
71 | } | |
72 | }).named(name).withFeatures(CollectionSize.ANY, SetFeature.GENERAL_PURPOSE, CollectionFeature.ALLOWS_NULL_QUERIES, CollectionFeature.RESTRICTS_ELEMENTS, CollectionFeature.SUPPORTS_ADD, CollectionFeature.SUPPORTS_REMOVE, CollectionFeature.SERIALIZABLE, CollectionFeature.REMOVE_OPERATIONS, CollectionFeature.SUPPORTS_ITERATOR_REMOVE).suppressing(toStringTests).createTestSuite(); | |
73 | } | |
74 | } |
0 | /* | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | * | |
3 | * Licensed under the Apache License, Version 2.0 (the "License"); | |
4 | * you may not use this file except in compliance with the License. | |
5 | * You may obtain a copy of the License at | |
6 | * | |
7 | * http://www.apache.org/licenses/LICENSE-2.0 | |
8 | * | |
9 | * Unless required by applicable law or agreed to in writing, software | |
10 | * distributed under the License is distributed on an "AS IS" BASIS, | |
11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
12 | * See the License for the specific language governing permissions and | |
13 | * limitations under the License. | |
14 | */ | |
15 | ||
16 | package it.unimi.dsi.fastutil.objects; | |
17 | ||
18 | import java.lang.reflect.Method; | |
19 | import java.util.Arrays; | |
20 | import java.util.HashSet; | |
21 | import java.util.Map; | |
22 | import java.util.function.Supplier; | |
23 | ||
24 | import com.google.common.collect.testing.MapTestSuiteBuilder; | |
25 | import com.google.common.collect.testing.TestStringMapGenerator; | |
26 | import com.google.common.collect.testing.features.CollectionFeature; | |
27 | import com.google.common.collect.testing.features.CollectionSize; | |
28 | import com.google.common.collect.testing.features.MapFeature; | |
29 | import com.google.common.collect.testing.testers.CollectionToStringTester; | |
30 | import com.google.common.collect.testing.testers.MapComputeIfPresentTester; | |
31 | import com.google.common.collect.testing.testers.MapMergeTester; | |
32 | import com.google.common.collect.testing.testers.MapToStringTester; | |
33 | ||
34 | import junit.framework.TestCase; | |
35 | import junit.framework.TestSuite; | |
36 | ||
37 | public class Object2ObjectOpenHashMapGuavaTest extends TestCase { | |
38 | ||
39 | public static TestSuite suite() throws NoSuchMethodException, SecurityException { | |
40 | return suite("Object2ObjectOpenHashMap", Object2ObjectOpenHashMap::new); | |
41 | } | |
42 | ||
43 | public static TestSuite suite(final String name, final Supplier<Map<String, String>> factory) throws NoSuchMethodException, SecurityException { | |
44 | final HashSet<Method> suppressed = new HashSet<>(); | |
45 | suppressed.addAll(Arrays.asList(MapToStringTester.class.getDeclaredMethods())); | |
46 | suppressed.addAll(Arrays.asList(CollectionToStringTester.class.getDeclaredMethods())); | |
47 | // An @apiNote explains that our semantics is slightly different | |
48 | suppressed.add(MapMergeTester.class.getDeclaredMethod("testMappedToNull")); | |
49 | suppressed.add(MapComputeIfPresentTester.class.getDeclaredMethod("testComputeIfPresent_nullTreatedAsAbsent")); | |
50 | ||
51 | return MapTestSuiteBuilder.using(new TestStringMapGenerator() { | |
52 | ||
53 | @Override | |
54 | protected Map<String, String> create(final Map.Entry<String, String>[] entries) { | |
55 | final Map<String, String> map = factory.get(); | |
56 | for (final Map.Entry<String, String> entry : entries) { | |
57 | map.put(entry.getKey(), entry.getValue()); | |
58 | } | |
59 | return map; | |
60 | } | |
61 | }).named(name).withFeatures(CollectionSize.ANY, MapFeature.GENERAL_PURPOSE, MapFeature.SUPPORTS_PUT, MapFeature.SUPPORTS_REMOVE, MapFeature.ALLOWS_NULL_KEYS, MapFeature.ALLOWS_NULL_VALUES, MapFeature.ALLOWS_ANY_NULL_QUERIES, CollectionFeature.SUPPORTS_ITERATOR_REMOVE).suppressing(suppressed).createTestSuite(); | |
62 | } | |
63 | } |
0 | /* | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | * | |
3 | * Licensed under the Apache License, Version 2.0 (the "License"); | |
4 | * you may not use this file except in compliance with the License. | |
5 | * You may obtain a copy of the License at | |
6 | * | |
7 | * http://www.apache.org/licenses/LICENSE-2.0 | |
8 | * | |
9 | * Unless required by applicable law or agreed to in writing, software | |
10 | * distributed under the License is distributed on an "AS IS" BASIS, | |
11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
12 | * See the License for the specific language governing permissions and | |
13 | * limitations under the License. | |
14 | */ | |
15 | ||
16 | package it.unimi.dsi.fastutil.objects; | |
17 | ||
18 | import java.lang.reflect.Method; | |
19 | import java.util.Arrays; | |
20 | import java.util.HashSet; | |
21 | import java.util.Map; | |
22 | import java.util.SortedMap; | |
23 | import java.util.function.Supplier; | |
24 | ||
25 | import com.google.common.collect.testing.MapTestSuiteBuilder; | |
26 | import com.google.common.collect.testing.TestStringSortedMapGenerator; | |
27 | import com.google.common.collect.testing.features.CollectionFeature; | |
28 | import com.google.common.collect.testing.features.CollectionSize; | |
29 | import com.google.common.collect.testing.features.MapFeature; | |
30 | import com.google.common.collect.testing.testers.CollectionToStringTester; | |
31 | import com.google.common.collect.testing.testers.MapComputeIfPresentTester; | |
32 | import com.google.common.collect.testing.testers.MapMergeTester; | |
33 | import com.google.common.collect.testing.testers.MapToStringTester; | |
34 | ||
35 | import junit.framework.TestCase; | |
36 | import junit.framework.TestSuite; | |
37 | ||
38 | public class Object2ObjectRBTreeMapGuavaTest extends TestCase { | |
39 | ||
40 | public static TestSuite suite() throws NoSuchMethodException, SecurityException { | |
41 | return suite("Object2ObjectRBTreeMap", Object2ObjectRBTreeMap::new); | |
42 | } | |
43 | ||
44 | public static TestSuite suite(final String name, final Supplier<Map<String, String>> factory) throws NoSuchMethodException, SecurityException { | |
45 | final HashSet<Method> suppressed = new HashSet<>(); | |
46 | suppressed.addAll(Arrays.asList(MapToStringTester.class.getDeclaredMethods())); | |
47 | suppressed.addAll(Arrays.asList(CollectionToStringTester.class.getDeclaredMethods())); | |
48 | // An @apiNote explains that our semantics is slightly different | |
49 | suppressed.add(MapMergeTester.class.getDeclaredMethod("testMappedToNull")); | |
50 | suppressed.add(MapComputeIfPresentTester.class.getDeclaredMethod("testComputeIfPresent_nullTreatedAsAbsent")); | |
51 | ||
52 | return MapTestSuiteBuilder.using(new TestStringSortedMapGenerator() { | |
53 | ||
54 | @Override | |
55 | protected SortedMap<String, String> create(final Map.Entry<String, String>[] entries) { | |
56 | final Map<String, String> map = factory.get(); | |
57 | for (final Map.Entry<String, String> entry : entries) { | |
58 | map.put(entry.getKey(), entry.getValue()); | |
59 | } | |
60 | return (SortedMap<String, String>)map; | |
61 | } | |
62 | }).named(name).withFeatures(CollectionSize.ANY, CollectionFeature.KNOWN_ORDER, MapFeature.GENERAL_PURPOSE, MapFeature.SUPPORTS_PUT, MapFeature.SUPPORTS_REMOVE, MapFeature.ALLOWS_NULL_VALUES, CollectionFeature.SUPPORTS_ITERATOR_REMOVE).suppressing(suppressed).createTestSuite(); | |
63 | } | |
64 | } |
0 | /* | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | * | |
3 | * Licensed under the Apache License, Version 2.0 (the "License"); | |
4 | * you may not use this file except in compliance with the License. | |
5 | * You may obtain a copy of the License at | |
6 | * | |
7 | * http://www.apache.org/licenses/LICENSE-2.0 | |
8 | * | |
9 | * Unless required by applicable law or agreed to in writing, software | |
10 | * distributed under the License is distributed on an "AS IS" BASIS, | |
11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
12 | * See the License for the specific language governing permissions and | |
13 | * limitations under the License. | |
14 | */ | |
15 | ||
16 | package it.unimi.dsi.fastutil.objects; | |
17 | ||
18 | import java.lang.reflect.Method; | |
19 | import java.util.Arrays; | |
20 | import java.util.HashSet; | |
21 | import java.util.Set; | |
22 | import java.util.function.Supplier; | |
23 | ||
24 | import com.google.common.collect.testing.SetTestSuiteBuilder; | |
25 | import com.google.common.collect.testing.TestStringSetGenerator; | |
26 | import com.google.common.collect.testing.features.CollectionFeature; | |
27 | import com.google.common.collect.testing.features.CollectionSize; | |
28 | import com.google.common.collect.testing.features.SetFeature; | |
29 | import com.google.common.collect.testing.testers.CollectionToStringTester; | |
30 | import com.google.common.collect.testing.testers.MapToStringTester; | |
31 | ||
32 | import junit.framework.TestCase; | |
33 | import junit.framework.TestSuite; | |
34 | ||
35 | public class ObjectOpenHashSetGuavaTest extends TestCase { | |
36 | ||
37 | public static TestSuite suite() { | |
38 | return suite("ObjectOpenHashSet", ObjectOpenHashSet::new); | |
39 | } | |
40 | ||
41 | public static TestSuite suite(final String name, final Supplier<Set<String>> factory) { | |
42 | final HashSet<Method> toStringTests = new HashSet<>(); | |
43 | toStringTests.addAll(Arrays.asList(MapToStringTester.class.getDeclaredMethods())); | |
44 | toStringTests.addAll(Arrays.asList(CollectionToStringTester.class.getDeclaredMethods())); | |
45 | ||
46 | return SetTestSuiteBuilder.using(new TestStringSetGenerator() { | |
47 | ||
48 | @Override | |
49 | protected Set<String> create(final String[] elements) { | |
50 | final Set<String> set = factory.get(); | |
51 | for (final String e : elements) { | |
52 | set.add(e); | |
53 | } | |
54 | return set; | |
55 | } | |
56 | }).named(name).withFeatures(CollectionSize.ANY, SetFeature.GENERAL_PURPOSE, CollectionFeature.ALLOWS_NULL_VALUES, CollectionFeature.ALLOWS_NULL_QUERIES, CollectionFeature.RESTRICTS_ELEMENTS, CollectionFeature.SUPPORTS_ADD, CollectionFeature.SUPPORTS_REMOVE, CollectionFeature.SERIALIZABLE, CollectionFeature.REMOVE_OPERATIONS, CollectionFeature.SUPPORTS_ITERATOR_REMOVE).suppressing(toStringTests).createTestSuite(); | |
57 | } | |
58 | } |
438 | 438 | $(BIG_ARRAY_BIG_LISTS): drv/BigArrayBigList.drv; ./gencsource.sh $< $@ >$@ |
439 | 439 | |
440 | 440 | CSOURCES += $(BIG_ARRAY_BIG_LISTS) |
441 | ||
442 | MAPPED_BIG_LISTS := $(foreach k,$(TYPE_NOBOOL_NOOBJ), $(GEN_SRCDIR)/$(PKG_PATH)/$(PACKAGE_$(k))/$(k)MappedBigList.c) | |
443 | $(MAPPED_BIG_LISTS): drv/MappedBigList.drv; ./gencsource.sh $< $@ >$@ | |
444 | ||
445 | CSOURCES += $(MAPPED_BIG_LISTS) | |
441 | 446 | |
442 | 447 | IMMUTABLE_LISTS := $(foreach k,$(TYPE), $(GEN_SRCDIR)/$(PKG_PATH)/$(PACKAGE_$(k))/$(k)ImmutableList.c) |
443 | 448 | $(IMMUTABLE_LISTS): drv/ImmutableList.drv; ./gencsource.sh $< $@ >$@ |
4 | 4 | <packaging>jar</packaging> |
5 | 5 | <name>fastutil</name> |
6 | 6 | <version>@VERSION@</version> |
7 | <description>fastutil extends the Java Collections Framework by providing type-specific maps, sets, lists and priority queues with a small memory footprint and fast operations; it provides also big (64-bit) arrays, sets and lists, sorting algorithms, and fast, practical I/O classes for binary and text files. This jar (fastutil-core.jar) contains data structures based on integers, longs, doubles, and objects, only; fastutil.jar contains all classes. If you have both jars in your dependencies, this jar should be excluded.</description> | |
7 | <description>fastutil extends the Java Collections Framework by providing type-specific maps, sets, lists, and queues with a small memory footprint and fast operations; it provides also big (64-bit) arrays, sets, and lists, sorting algorithms, fast, practical I/O classes for binary and text files, and facilities for memory mapping large files. This jar (fastutil-core.jar) contains data structures based on integers, longs, doubles, and objects, only; fastutil.jar contains all classes. If you have both jars in your dependencies, this jar should be excluded.</description> | |
8 | 8 | <url>http://fastutil.di.unimi.it/</url> |
9 | 9 | <licenses> |
10 | 10 | <license> |
4 | 4 | <packaging>jar</packaging> |
5 | 5 | <name>fastutil</name> |
6 | 6 | <version>@VERSION@</version> |
7 | <description>fastutil extends the Java Collections Framework by providing type-specific maps, sets, lists and priority queues with a small memory footprint and fast access and insertion; provides also big (64-bit) arrays, sets and lists, sorting algorithms, and fast, practical I/O classes for binary and text files. Note that if you have both this jar and fastutil-core.jar in your dependencies, fastutil-core.jar should be excluded.</description> | |
7 | <description>fastutil extends the Java Collections Framework by providing type-specific maps, sets, lists, and queues with a small memory footprint and fast access and insertion; it provides also big (64-bit) arrays, sets and lists, sorting algorithms, fast, practical I/O classes for binary and text files, and facilities for memory mapping large files. Note that if you have both this jar and fastutil-core.jar in your dependencies, fastutil-core.jar should be excluded.</description> | |
8 | 8 | <url>http://fastutil.di.unimi.it/</url> |
9 | 9 | <licenses> |
10 | 10 | <license> |
0 | 0 | /* |
1 | * Copyright (C) 2003-2020 Paolo Boldi and Sebastiano Vigna | |
1 | * Copyright (C) 2003-2022 Paolo Boldi and Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
17 | 17 | |
18 | 18 | /** An abstract class providing basic methods for implementing the {@link IndirectPriorityQueue} interface. |
19 | 19 | * |
20 | * @deprecated As of fastutil 8 this class is no longer necessary, as its previous abstract | |
20 | * @deprecated As of {@code fastutil} 8 this class is no longer necessary, as its previous abstract | |
21 | 21 | * methods are now default methods of {@link IndirectPriorityQueue}. |
22 | 22 | */ |
23 | 23 | @Deprecated |
0 | 0 | /* |
1 | * Copyright (C) 2003-2021 Paolo Boldi and Sebastiano Vigna | |
1 | * Copyright (C) 2003-2022 Paolo Boldi and Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
17 | 17 | |
18 | 18 | /** An abstract class providing basic methods for implementing the {@link PriorityQueue} interface. |
19 | 19 | * |
20 | * @deprecated As of fastutil 8 this class is no longer necessary, as its previous abstract | |
20 | * @deprecated As of {@code fastutil} 8 this class is no longer necessary, as its previous abstract | |
21 | 21 | * methods are now default methods of {@link PriorityQueue}. |
22 | 22 | */ |
23 | 23 | @Deprecated |
0 | 0 | /* |
1 | * Copyright (C) 2002-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2002-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
17 | 17 | |
18 | 18 | /** An abstract class providing basic methods for implementing the {@link Stack} interface. |
19 | 19 | * |
20 | * @deprecated As of fastutil 8 this class is no longer necessary, as its previous abstract | |
20 | * @deprecated As of {@code fastutil} 8 this class is no longer necessary, as its previous abstract | |
21 | 21 | * methods are now default methods of {@link Stack}. |
22 | 22 | */ |
23 | 23 | @Deprecated |
0 | 0 | /* |
1 | * Copyright (C) 2002-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2002-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2002-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2002-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2010-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2010-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2010-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2010-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2010-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2010-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2002-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2002-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2002-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2002-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2002-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2002-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2003-2021 Paolo Boldi and Sebastiano Vigna | |
1 | * Copyright (C) 2003-2022 Paolo Boldi and Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2003-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2003-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2020-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2020-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2003-2021 Paolo Boldi and Sebastiano Vigna | |
1 | * Copyright (C) 2003-2022 Paolo Boldi and Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2003-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2003-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2010-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2010-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2020-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2020-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2002-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2002-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2010-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2010-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
1 | 1 | * Type-specific classes for boolean elements or keys. |
2 | 2 | * |
3 | 3 | * <p> |
4 | * Not all classes are provided in a boolean-specific version: sorted sets and | |
5 | * maps not generated, as they are useless. Unsorted sets and maps are kept | |
6 | * around for orthogonality, whereas | |
7 | * {@link it.unimi.dsi.fastutil.booleans.BooleanCollection} is used by maps with | |
8 | * boolean values. | |
4 | * Not all classes are provided in a boolean-specific version: sorted sets and maps not generated, | |
5 | * as they are useless. Unsorted sets and maps are kept around for orthogonality, whereas | |
6 | * {@link it.unimi.dsi.fastutil.booleans.BooleanCollection} is used by maps with boolean values. | |
9 | 7 | */ |
10 | 8 | package it.unimi.dsi.fastutil.booleans;⏎ |
0 | 0 | /* |
1 | * Copyright (C) 2005-2020 Sebastiano Vigna | |
1 | * Copyright (C) 2005-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2005-2020 Sebastiano Vigna | |
1 | * Copyright (C) 2005-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2005-2020 Sebastiano Vigna | |
1 | * Copyright (C) 2005-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2005-2020 Sebastiano Vigna | |
1 | * Copyright (C) 2005-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2005-2020 Sebastiano Vigna | |
1 | * Copyright (C) 2005-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2005-2020 Sebastiano Vigna | |
1 | * Copyright (C) 2005-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2005-2020 Sebastiano Vigna | |
1 | * Copyright (C) 2005-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2005-2020 Sebastiano Vigna | |
1 | * Copyright (C) 2005-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2005-2020 Sebastiano Vigna | |
1 | * Copyright (C) 2005-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2005-2020 Sebastiano Vigna | |
1 | * Copyright (C) 2005-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
1 | 1 | * Type-specific classes for object elements or keys. |
2 | 2 | * |
3 | 3 | * <p> |
4 | * Whenever possible and useful, {@code fastutil} provides both typical | |
5 | * collections, which compare objects using {@code equals()}, and | |
6 | * {@linkplain it.unimi.dsi.fastutil.objects.ReferenceSet | |
7 | * <em>reference-based</em> collections}, which use identity ({@code ==}). See | |
8 | * the related comments in the overview. | |
4 | * Whenever possible and useful, {@code fastutil} provides both typical collections, which compare | |
5 | * objects using {@code equals()}, and {@linkplain it.unimi.dsi.fastutil.objects.ReferenceSet | |
6 | * <em>reference-based</em> collections}, which use identity ({@code ==}). See the related comments | |
7 | * in the overview. | |
9 | 8 | */ |
10 | 9 | package it.unimi.dsi.fastutil.objects; |
57 | 57 | <p>To understand what's going on at a glance, the best thing is to look at |
58 | 58 | the examples provided below. If you already used the |
59 | 59 | Collections Framework, everything should look |
60 | rather natural. If, in particular, you use an IDE such as <A | |
61 | HREF="http://www.eclipse.org/">Eclipse</A>, which can suggest you the | |
60 | rather natural. If, in particular, you use an IDE that can suggest you the | |
62 | 61 | method names, all you need to know is the right name for |
63 | 62 | the class you need. |
64 | 63 | |
88 | 87 | The {@link it.unimi.dsi.fastutil.io.BinIO} and {@link it.unimi.dsi.fastutil.io.TextIO} static |
89 | 88 | containers contain dozens of methods that make it possible to load and save quickly |
90 | 89 | (big) arrays to disks, to adapt binary and text file to iterators, and so on. |
90 | Classes such as {@link it.unimi.dsi.fastutil.ints.MappedIntBigList} make it possible | |
91 | to map into memory large file of primitive types and access them as {@linkplain it.unimi.dsi.fastutil.BigList big lists}. | |
91 | 92 | |
92 | 93 | <h1>More on type-specific classes</h1> |
93 | 94 | |
94 | 95 | <p>All data structures in <code>fastutil</code> extend their standard |
95 | 96 | counterpart interface whenever possible (e.g., {@link java.util.Map} for maps). Thus, they |
96 | can be just plugged into existing code, using the standard access methods | |
97 | (of course, any attempt to use the wrong type for keys or values will | |
98 | produce a {@link java.lang.ClassCastException}). However, they also provide | |
97 | can be just plugged into existing code, using the standard access methods. However, they also provide | |
99 | 98 | (whenever possible) many polymorphic versions of the most used methods that |
100 | 99 | avoid boxing/unboxing. In doing so, they specify more stringent interfaces that |
101 | 100 | extend and strengthen the standard ones (e.g., {@link |
108 | 107 | We suggest that your programming environment is set so to mark boxing/unboxing as |
109 | 108 | a warning, or even better, as an error. |
110 | 109 | |
111 | <p>Of course, the main point of type-specific data structures is that the | |
110 | <p>The main point of type-specific data structures is that the | |
112 | 111 | absence of wrappers around primitive types can increase speed and reduce |
113 | 112 | space occupancy by several times. The presence of generics in Java |
114 | 113 | does not change this fact, since there is no genericity for primitive |
153 | 152 | java.lang.Object} or <code>Reference</code>. In the latter case, we |
154 | 153 | are treating objects, but their equality is established by reference |
155 | 154 | equality (that is, without invoking <code>equals()</code>), similarly |
156 | to {@link java.util.IdentityHashMap}. Of course, reference-based | |
155 | to {@link java.util.IdentityHashMap}. Note that reference-based | |
157 | 156 | classes are significantly faster.</p> |
158 | 157 | |
159 | 158 | <p>Thus, an {@link it.unimi.dsi.fastutil.ints.IntOpenHashSet} stores |
225 | 224 | <tr><td>Function<td>AbstractFunction<td> |
226 | 225 | <tr><td>Map<td>AbstractMap<td>OpenHashMap, OpenCustomHashMap, ArrayMap |
227 | 226 | <tr><td>SortedMap<td>AbstractSortedMap<td>RBTreeMap, AVLTreeMap, LinkedOpenHashMap |
228 | <tr><td>List, BigList†<td>AbstractList, AbstractBigList<td>ArrayList, BigArrayBigList, ArrayFrontCodedList, ImmutableList | |
227 | <tr><td>List, BigList†<td>AbstractList, AbstractBigList<td>ArrayList, BigArrayBigList, MappedBigList, ArrayFrontCodedList, ImmutableList | |
229 | 228 | <tr><td>PriorityQueue†<td><td>HeapPriorityQueue, ArrayPriorityQueue, ArrayFIFOQueue |
230 | 229 | <tr><td>IndirectPriorityQueue†<td><td>HeapSemiIndirectPriorityQueue, HeapIndirectPriorityQueue, ArrayIndirectPriorityQueue |
231 | 230 | <tr><td>Stack†<td><td>ArrayList |
246 | 245 | <p>‡: this class has <em>only</em> a non-type-specific implementation in {@link it.unimi.dsi.fastutil}. |
247 | 246 | |
248 | 247 | <p>Note that abstract implementations are named by prefixing the interface |
249 | name with <samp>Abstract</samp>. Thus, if you want to define a | |
248 | name with {@code Abstract}. Thus, if you want to define a | |
250 | 249 | type-specific structure holding a set of integers without the hassle of |
251 | 250 | defining object-based methods, you should inherit from {@link it.unimi.dsi.fastutil.ints.AbstractIntSet}. |
252 | 251 |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
9 | 9 | |
10 | 10 | public class IntIntPairTest { |
11 | 11 | |
12 | @SuppressWarnings("boxing") | |
13 | 12 | @Test |
14 | 13 | public void test() { |
15 | 14 | final Comparator<IntIntPair> comparator = IntIntPair.lexComparator(); |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
89 | 89 | return new ObjectIterator<Entry>() { |
90 | 90 | final IntIterator keyIter = keys.iterator(); |
91 | 91 | final IntIterator valueIter = values.iterator(); |
92 | ||
92 | ||
93 | 93 | @Override |
94 | 94 | public boolean hasNext() { |
95 | 95 | return keyIter.hasNext(); |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
32 | 32 | @Parameter(2) |
33 | 33 | public float loadFactor; |
34 | 34 | |
35 | @SuppressWarnings({ "AutoBoxing", "boxing" }) | |
35 | @SuppressWarnings({ "boxing" }) | |
36 | 36 | @Parameters(name = "{index}: lf {2}") |
37 | 37 | public static Iterable<Object[]> data() { |
38 | 38 | final EnumSet<Capability> capabilities = EnumSet.allOf(Capability.class); |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
556 | 556 | assertTrue(m.int2IntEntrySet().isEmpty()); |
557 | 557 | } |
558 | 558 | |
559 | @SuppressWarnings({ "SuspiciousMethodCalls", "unlikely-arg-type" }) | |
559 | @SuppressWarnings({ "unlikely-arg-type" }) | |
560 | 560 | @Test |
561 | 561 | public void testEntrySetContains() { |
562 | 562 | m.put(0, 0); |
617 | 617 | } |
618 | 618 | final Set<Entry> s = new HashSet<>(); |
619 | 619 | final Set<Entry> sIdentity = Collections.newSetFromMap(new IdentityHashMap<Entry, Boolean>()); |
620 | ||
620 | ||
621 | 621 | Int2IntMaps.fastIterator(m).forEachRemaining(x -> { |
622 | 622 | s.add(new AbstractInt2IntMap.BasicEntry(x.getIntKey(), x.getIntValue())); |
623 | 623 | sIdentity.add(x); |
660 | 660 | for (int i = 0; i < 100; i++) { |
661 | 661 | m.put(i, i); |
662 | 662 | } |
663 | Iterator<Entry> i = m.int2IntEntrySet().iterator(); | |
663 | final Iterator<Entry> i = m.int2IntEntrySet().iterator(); | |
664 | 664 | int key; |
665 | 665 | int value; |
666 | 666 | // This will be an invalid entry after the removal, so we can't trust it long term. |
667 | 667 | // Enforce this with scoping; get the contents and then not use it again. |
668 | 668 | { |
669 | Entry toRemoveEntry = i.next(); | |
669 | final Entry toRemoveEntry = i.next(); | |
670 | 670 | key = toRemoveEntry.getIntKey(); |
671 | 671 | value = toRemoveEntry.getIntValue(); |
672 | 672 | } |
677 | 677 | assertFalse(m.containsKey(key)); |
678 | 678 | assertFalse(m.containsValue(value)); |
679 | 679 | assertEquals(m.get(key), -1); |
680 | assertEquals(99, m.size()); | |
680 | assertEquals(99, m.size()); | |
681 | 681 | } |
682 | 682 | |
683 | 683 | @Test(expected = IllegalStateException.class) |
697 | 697 | iterator.remove(); |
698 | 698 | } |
699 | 699 | |
700 | @SuppressWarnings({ "SuspiciousMethodCalls", "unlikely-arg-type" }) | |
700 | @SuppressWarnings({ "unlikely-arg-type" }) | |
701 | 701 | @Test |
702 | 702 | public void testEntrySetRemove() { |
703 | 703 | m.put(0, 0); |
797 | 797 | assertEquals(1, m.getOrDefault(1, 2)); |
798 | 798 | } |
799 | 799 | |
800 | ||
800 | ||
801 | 801 | @Test |
802 | 802 | public void testKeySetIteration() { |
803 | 803 | for (int i = 0; i < 100; i++) { |
820 | 820 | assertEquals(m.keySet(), s); |
821 | 821 | } |
822 | 822 | |
823 | @SuppressWarnings("deprecation") | |
824 | 823 | @Test |
825 | 824 | public void testKeySetForEachObject() { |
826 | 825 | for (int i = 0; i < 100; i++) { |
847 | 846 | assertEquals(m.keySet(), s); |
848 | 847 | } |
849 | 848 | |
850 | @SuppressWarnings("deprecation") | |
851 | 849 | @Test |
852 | 850 | public void testKeySetIteratorForEachObject() { |
853 | 851 | for (int i = 0; i < 100; i++) { |
872 | 870 | for (int i = 0; i < 100; i++) { |
873 | 871 | m.put(i, i); |
874 | 872 | } |
875 | IntIterator i = m.keySet().iterator(); | |
876 | int toRemoveKey = i.nextInt(); | |
877 | ||
873 | final IntIterator i = m.keySet().iterator(); | |
874 | final int toRemoveKey = i.nextInt(); | |
875 | ||
878 | 876 | // Taking advantage of the fact we mapped keys to values |
879 | 877 | assertTrue(m.containsKey(toRemoveKey)); |
880 | 878 | assertEquals(m.get(toRemoveKey), toRemoveKey); |
1439 | 1437 | assertEquals(0, m.size()); |
1440 | 1438 | assertTrue(m.isEmpty()); |
1441 | 1439 | } |
1442 | ||
1440 | ||
1443 | 1441 | // No testValuesIteration; it would basically turn into a test whether |
1444 | 1442 | // new IntOpenHashSet(m.values()).equals(new IntOpenHashSet(m.values())) |
1445 | 1443 | // which is not very instructive. |
1520 | 1518 | for (int i = 0; i < 100; i++) { |
1521 | 1519 | m.put(i, i); |
1522 | 1520 | } |
1523 | IntIterator i = m.values().iterator(); | |
1524 | int toRemoveValue = i.nextInt(); | |
1525 | ||
1521 | final IntIterator i = m.values().iterator(); | |
1522 | final int toRemoveValue = i.nextInt(); | |
1523 | ||
1526 | 1524 | // Taking advantage of the fact we mapped keys to values |
1527 | 1525 | assertTrue(m.containsKey(toRemoveValue)); |
1528 | 1526 | assertTrue(m.containsValue(toRemoveValue)); |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
19 | 19 | |
20 | 20 | import org.junit.Test; |
21 | 21 | |
22 | @SuppressWarnings("rawtypes") | |
23 | 22 | public class Int2ObjectFunctionTest { |
24 | 23 | |
25 | 24 | @SuppressWarnings("deprecation") |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
15 | 15 | |
16 | 16 | package it.unimi.dsi.fastutil.ints; |
17 | 17 | |
18 | import it.unimi.dsi.fastutil.Hash; | |
19 | 18 | import java.util.ArrayList; |
20 | 19 | import java.util.Collection; |
21 | 20 | import java.util.EnumSet; |
22 | 21 | import java.util.function.Supplier; |
22 | ||
23 | 23 | import org.junit.runners.Parameterized.Parameter; |
24 | 24 | import org.junit.runners.Parameterized.Parameters; |
25 | ||
26 | import it.unimi.dsi.fastutil.Hash; | |
25 | 27 | |
26 | 28 | public class Int2ObjectMapGenericOpenHashTest extends Int2ObjectMapGenericTest<Int2ObjectOpenHashMap<Integer>> { |
27 | 29 | @Parameter(2) |
28 | 30 | public float loadFactor; |
29 | 31 | |
30 | @SuppressWarnings({"AutoBoxing", "boxing"}) | |
32 | @SuppressWarnings({ "boxing" }) | |
31 | 33 | @Parameters(name = "{index}: lf {2}") |
32 | 34 | public static Iterable<Object[]> data() { |
33 | 35 | final EnumSet<Capability> capabilities = EnumSet.allOf(Capability.class); |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
514 | 514 | assertTrue(m.int2ObjectEntrySet().isEmpty()); |
515 | 515 | } |
516 | 516 | |
517 | @SuppressWarnings({ "SuspiciousMethodCalls", "unlikely-arg-type" }) | |
517 | @SuppressWarnings({ "unlikely-arg-type" }) | |
518 | 518 | @Test |
519 | 519 | public void testEntrySetContains() { |
520 | 520 | m.put(0, ZERO); |
581 | 581 | } |
582 | 582 | final Set<Entry<Integer>> s = new HashSet<>(); |
583 | 583 | final Set<Entry<Integer>> sIdentity = Collections.newSetFromMap(new IdentityHashMap<Entry<Integer>, Boolean>()); |
584 | ||
584 | ||
585 | 585 | Int2ObjectMaps.fastIterator(m).forEachRemaining(x -> { |
586 | 586 | s.add(new AbstractInt2ObjectMap.BasicEntry<>(x.getIntKey(), x.getValue())); |
587 | 587 | sIdentity.add(x); |
622 | 622 | for (int i = 0; i < 100; i++) { |
623 | 623 | m.put(i, Integer.valueOf(i)); |
624 | 624 | } |
625 | Iterator<Entry<Integer>> i = m.int2ObjectEntrySet().iterator(); | |
625 | final Iterator<Entry<Integer>> i = m.int2ObjectEntrySet().iterator(); | |
626 | 626 | int key; |
627 | 627 | Integer value; |
628 | 628 | // This will be an invalid entry after the removal, so we can't trust it long term. |
629 | 629 | // Enforce this with scoping; get the contents and then not use it again. |
630 | 630 | { |
631 | Entry<Integer> toRemoveEntry = i.next(); | |
631 | final Entry<Integer> toRemoveEntry = i.next(); | |
632 | 632 | key = toRemoveEntry.getIntKey(); |
633 | 633 | value = toRemoveEntry.getValue(); |
634 | 634 | } |
652 | 652 | iterator.remove(); |
653 | 653 | } |
654 | 654 | |
655 | @SuppressWarnings({ "SuspiciousMethodCalls", "unlikely-arg-type" }) | |
655 | @SuppressWarnings({ "unlikely-arg-type" }) | |
656 | 656 | @Test |
657 | 657 | public void testEntrySetRemove() { |
658 | 658 | m.put(0, ZERO); |
670 | 670 | assertTrue(m.equals(new Object2ObjectOpenHashMap<>(new Integer[] {ONE}, new Integer[] {ONE}))); |
671 | 671 | } |
672 | 672 | |
673 | @SuppressWarnings("unchecked") | |
674 | 673 | @Test(expected = IllegalStateException.class) |
675 | 674 | public void testFastEntrySetEmptyIteratorRemove() { |
676 | 675 | final ObjectSet<Entry<Integer>> entries = m.int2ObjectEntrySet(); |
680 | 679 | iterator.remove(); |
681 | 680 | } |
682 | 681 | |
683 | @SuppressWarnings("unchecked") | |
684 | 682 | @Test(expected = IllegalStateException.class) |
685 | 683 | public void testFastEntrySetIteratorTwoRemoves() { |
686 | 684 | m.put(0, ZERO); |
763 | 761 | // Test symmetry of equals |
764 | 762 | assertEquals(s, m.keySet()); |
765 | 763 | } |
766 | ||
764 | ||
767 | 765 | @Test |
768 | 766 | public void testKeySetForEach() { |
769 | 767 | for (int i = 0; i < 100; i++) { |
831 | 829 | for (int i = 0; i < 100; i++) { |
832 | 830 | m.put(i, Integer.valueOf(i)); |
833 | 831 | } |
834 | IntIterator i = m.keySet().iterator(); | |
835 | int toRemoveKey = i.nextInt(); | |
832 | final IntIterator i = m.keySet().iterator(); | |
833 | final int toRemoveKey = i.nextInt(); | |
836 | 834 | assertTrue(m.containsKey(toRemoveKey)); |
837 | 835 | // Taking advantage of the fact we mapped keys to their Integer values |
838 | 836 | assertEquals(m.get(toRemoveKey), Integer.valueOf(toRemoveKey)); |
1386 | 1384 | // values() is a Collection without an equals, so need to convert to Set first. |
1387 | 1385 | assertEquals(new IntOpenHashSet(m.values()), s); |
1388 | 1386 | } |
1389 | ||
1387 | ||
1390 | 1388 | @Test |
1391 | 1389 | public void testValuesIteratorRemove() { |
1392 | 1390 | assumeTrue(capabilities.contains(Capability.ITERATOR_MODIFY)); |
1393 | 1391 | for (int i = 0; i < 100; i++) { |
1394 | 1392 | m.put(i, Integer.valueOf(i)); |
1395 | 1393 | } |
1396 | Iterator<Integer> i = m.values().iterator(); | |
1397 | Integer toRemoveValue = i.next(); | |
1394 | final Iterator<Integer> i = m.values().iterator(); | |
1395 | final Integer toRemoveValue = i.next(); | |
1398 | 1396 | // Taking advantage of the fact we mapped keys to their Integer values |
1399 | 1397 | assertTrue(m.containsKey(toRemoveValue.intValue())); |
1400 | 1398 | assertTrue(m.containsValue(toRemoveValue)); |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
98 | 98 | assertNull(m.get(ONE)); |
99 | 99 | } |
100 | 100 | |
101 | @SuppressWarnings("deprecation") | |
102 | 101 | @Test |
103 | 102 | public void testDefaultReplaceTernary() { |
104 | 103 | final Int2ObjectMap<Object> m = new SimpleInt2ObjectMap(new Int2ObjectArrayMap<>()); |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
26 | 26 | |
27 | 27 | @Test |
28 | 28 | public void testFront() { |
29 | int refArray[] = { 4, 3, 2, 1, 0, 3, 2, 1, 0, 2, 1, 0, 1, 0, 0 }; | |
30 | int tops[] = new int[refArray.length]; | |
29 | final int refArray[] = { 4, 3, 2, 1, 0, 3, 2, 1, 0, 2, 1, 0, 1, 0, 0 }; | |
30 | final int tops[] = new int[refArray.length]; | |
31 | 31 | final IntArrayIndirectPriorityQueue queue = new IntArrayIndirectPriorityQueue(refArray); |
32 | 32 | for (int i = refArray.length; i-- != 0;) |
33 | 33 | queue.enqueue(i); |
68 | 68 | |
69 | 69 | private int[] ref; |
70 | 70 | |
71 | private boolean heapEqual(int[] a, int[] b, int sizea, int sizeb) { | |
71 | private boolean heapEqual(final int[] a, final int[] b, int sizea, final int sizeb) { | |
72 | 72 | if (sizea != sizeb) return false; |
73 | int[] aa = new int[sizea]; | |
74 | int[] bb = new int[sizea]; | |
73 | final int[] aa = new int[sizea]; | |
74 | final int[] bb = new int[sizea]; | |
75 | 75 | for (int i = 0; i < sizea; i++) { |
76 | 76 | aa[i] = ref[a[i]]; |
77 | 77 | bb[i] = ref[b[i]]; |
83 | 83 | return true; |
84 | 84 | } |
85 | 85 | |
86 | public void test(int n, IntComparator comparator) { | |
86 | public void test(final int n, final IntComparator comparator) { | |
87 | 87 | Exception mThrowsIllegal, tThrowsIllegal, mThrowsOutOfBounds, tThrowsOutOfBounds, mThrowsNoElement, tThrowsNoElement; |
88 | 88 | int rm = 0, rt = 0; |
89 | Random r = new Random(0); | |
89 | final Random r = new Random(0); | |
90 | 90 | ref = new int[n]; |
91 | 91 | |
92 | 92 | for (int i = 0; i < n; i++) ref[i] = r.nextInt(); |
93 | 93 | |
94 | 94 | IntArrayIndirectPriorityQueue m = new IntArrayIndirectPriorityQueue(ref, comparator); |
95 | IntHeapIndirectPriorityQueue t = new IntHeapIndirectPriorityQueue(ref, comparator); | |
95 | final IntHeapIndirectPriorityQueue t = new IntHeapIndirectPriorityQueue(ref, comparator); | |
96 | 96 | |
97 | 97 | /* We add pairs to t. */ |
98 | 98 | for (int i = 0; i < n / 2; i++) { |
114 | 114 | } |
115 | 115 | } |
116 | 116 | |
117 | int T = r.nextInt(2 * n); | |
117 | final int T = r.nextInt(2 * n); | |
118 | 118 | |
119 | 119 | mThrowsNoElement = tThrowsNoElement = mThrowsOutOfBounds = tThrowsOutOfBounds = mThrowsIllegal = tThrowsIllegal = null; |
120 | 120 | |
121 | 121 | try { |
122 | 122 | t.enqueue(T); |
123 | 123 | } |
124 | catch (IndexOutOfBoundsException e) { | |
124 | catch (final IndexOutOfBoundsException e) { | |
125 | 125 | tThrowsOutOfBounds = e; |
126 | 126 | } |
127 | catch (IllegalArgumentException e) { | |
127 | catch (final IllegalArgumentException e) { | |
128 | 128 | tThrowsIllegal = e; |
129 | 129 | } |
130 | 130 | |
132 | 132 | try { |
133 | 133 | m.enqueue(T); |
134 | 134 | } |
135 | catch (IndexOutOfBoundsException e) { | |
135 | catch (final IndexOutOfBoundsException e) { | |
136 | 136 | mThrowsOutOfBounds = e; |
137 | 137 | } |
138 | catch (IllegalArgumentException e) { | |
138 | catch (final IllegalArgumentException e) { | |
139 | 139 | mThrowsIllegal = e; |
140 | 140 | } |
141 | 141 | } |
154 | 154 | ((ref[m.first()]) == (ref[t.first()]))); |
155 | 155 | } |
156 | 156 | |
157 | mThrowsNoElement = tThrowsNoElement = mThrowsOutOfBounds = tThrowsOutOfBounds = mThrowsIllegal = tThrowsIllegal = null; | |
157 | mThrowsOutOfBounds = tThrowsOutOfBounds = null; | |
158 | 158 | |
159 | 159 | try { |
160 | 160 | rm = m.dequeue(); |
161 | 161 | while (!m.isEmpty() && ((ref[m.first()]) == (ref[rm]))) m.dequeue(); |
162 | 162 | } |
163 | catch (IndexOutOfBoundsException e) { | |
163 | catch (final IndexOutOfBoundsException e) { | |
164 | 164 | mThrowsOutOfBounds = e; |
165 | 165 | } |
166 | catch (IllegalArgumentException e) { | |
166 | catch (final IllegalArgumentException e) { | |
167 | 167 | mThrowsIllegal = e; |
168 | 168 | } |
169 | catch (java.util.NoSuchElementException e) { | |
169 | catch (final java.util.NoSuchElementException e) { | |
170 | 170 | mThrowsNoElement = e; |
171 | 171 | } |
172 | 172 | |
175 | 175 | while (!t.isEmpty() && ((ref[t.first()]) == (ref[rt]))) |
176 | 176 | t.dequeue(); |
177 | 177 | } |
178 | catch (IndexOutOfBoundsException e) { | |
178 | catch (final IndexOutOfBoundsException e) { | |
179 | 179 | tThrowsOutOfBounds = e; |
180 | 180 | } |
181 | catch (IllegalArgumentException e) { | |
181 | catch (final IllegalArgumentException e) { | |
182 | 182 | tThrowsIllegal = e; |
183 | 183 | } |
184 | catch (java.util.NoSuchElementException e) { | |
184 | catch (final java.util.NoSuchElementException e) { | |
185 | 185 | tThrowsNoElement = e; |
186 | 186 | } |
187 | 187 | |
209 | 209 | try { |
210 | 210 | m.remove(pos); |
211 | 211 | } |
212 | catch (IndexOutOfBoundsException e) { | |
212 | catch (final IndexOutOfBoundsException e) { | |
213 | 213 | mThrowsOutOfBounds = e; |
214 | 214 | } |
215 | catch (IllegalArgumentException e) { | |
215 | catch (final IllegalArgumentException e) { | |
216 | 216 | mThrowsIllegal = e; |
217 | 217 | } |
218 | catch (java.util.NoSuchElementException e) { | |
218 | catch (final java.util.NoSuchElementException e) { | |
219 | 219 | mThrowsNoElement = e; |
220 | 220 | } |
221 | 221 | |
222 | 222 | try { |
223 | 223 | t.remove(pos); |
224 | 224 | } |
225 | catch (IndexOutOfBoundsException e) { | |
225 | catch (final IndexOutOfBoundsException e) { | |
226 | 226 | tThrowsOutOfBounds = e; |
227 | 227 | } |
228 | catch (IllegalArgumentException e) { | |
228 | catch (final IllegalArgumentException e) { | |
229 | 229 | tThrowsIllegal = e; |
230 | 230 | } |
231 | catch (java.util.NoSuchElementException e) { | |
231 | catch (final java.util.NoSuchElementException e) { | |
232 | 232 | tThrowsNoElement = e; |
233 | 233 | } |
234 | 234 | |
253 | 253 | try { |
254 | 254 | t.changed(pos); |
255 | 255 | } |
256 | catch (IndexOutOfBoundsException e) { | |
256 | catch (final IndexOutOfBoundsException e) { | |
257 | 257 | tThrowsOutOfBounds = e; |
258 | 258 | } |
259 | catch (IllegalArgumentException e) { | |
259 | catch (final IllegalArgumentException e) { | |
260 | 260 | tThrowsIllegal = e; |
261 | 261 | } |
262 | catch (java.util.NoSuchElementException e) { | |
262 | catch (final java.util.NoSuchElementException e) { | |
263 | 263 | tThrowsNoElement = e; |
264 | 264 | } |
265 | 265 | |
267 | 267 | try { |
268 | 268 | m.changed(pos); |
269 | 269 | } |
270 | catch (IndexOutOfBoundsException e) { | |
270 | catch (final IndexOutOfBoundsException e) { | |
271 | 271 | mThrowsOutOfBounds = e; |
272 | 272 | } |
273 | catch (IllegalArgumentException e) { | |
273 | catch (final IllegalArgumentException e) { | |
274 | 274 | mThrowsIllegal = e; |
275 | 275 | } |
276 | catch (java.util.NoSuchElementException e) { | |
276 | catch (final java.util.NoSuchElementException e) { | |
277 | 277 | mThrowsNoElement = e; |
278 | 278 | } |
279 | 279 | } |
293 | 293 | ((ref[m.first()]) == (ref[t.first()]))); |
294 | 294 | } |
295 | 295 | |
296 | int[] temp = t.heap.clone(); | |
296 | final int[] temp = t.heap.clone(); | |
297 | 297 | IntArrays.quickSort(temp, 0, t.size()); // To scramble a bit |
298 | 298 | m = new IntArrayIndirectPriorityQueue(m.refArray, temp, t.size(), comparator); |
299 | 299 | |
306 | 306 | |
307 | 307 | if (m.size() != 0 && ((new it.unimi.dsi.fastutil.ints.IntOpenHashSet(m.array, 0, m.size)).size() == m.size())) { |
308 | 308 | |
309 | int first = m.first(); | |
309 | final int first = m.first(); | |
310 | 310 | ref[first] = r.nextInt(); |
311 | 311 | |
312 | 312 | // System.err.println("Pre-change m: " +m); |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
37 | 37 | |
38 | 38 | @Test |
39 | 39 | public void testMergeSort() { |
40 | int[] a = { 2, 1, 5, 2, 1, 0, 9, 1, 4, 2, 4, 6, 8, 9, 10, 12, 1, 7 }, b = a.clone(), sorted = a.clone(); | |
40 | final int[] a = { 2, 1, 5, 2, 1, 0, 9, 1, 4, 2, 4, 6, 8, 9, 10, 12, 1, 7 }, b = a.clone(), sorted = a.clone(); | |
41 | 41 | Arrays.sort(sorted); |
42 | 42 | IntArrays.mergeSort(b); |
43 | 43 | assertArrayEquals(sorted, b); |
55 | 55 | |
56 | 56 | @Test |
57 | 57 | public void testMergeSortSmallSupport() { |
58 | int[] a = { 2, 1, 5, 2, 1, 0, 9, 1, 4, 2, 4, 6, 8, 9, 10, 12, 1, 7 }; | |
58 | final int[] a = { 2, 1, 5, 2, 1, 0, 9, 1, 4, 2, 4, 6, 8, 9, 10, 12, 1, 7 }; | |
59 | 59 | for(int to = 1; to < a.length; to++) |
60 | 60 | for(int from = 0; from <= to; from++) { |
61 | 61 | final int[] support = new int[to]; |
67 | 67 | |
68 | 68 | @Test |
69 | 69 | public void testStableSort() { |
70 | int[] a = { 2, 1, 5, 2, 1, 0, 9, 1, 4, 2, 4, 6, 8, 9, 10, 12, 1, 7 }, b = a.clone(), sorted = a.clone(); | |
70 | final int[] a = { 2, 1, 5, 2, 1, 0, 9, 1, 4, 2, 4, 6, 8, 9, 10, 12, 1, 7 }, b = a.clone(), sorted = a.clone(); | |
71 | 71 | Arrays.sort(sorted); |
72 | 72 | IntArrays.stableSort(b); |
73 | 73 | assertArrayEquals(sorted, b); |
84 | 84 | |
85 | 85 | @Test |
86 | 86 | public void testQuickSort() { |
87 | int[] a = { 2, 1, 5, 2, 1, 0, 9, 1, 4, 2, 4, 6, 8, 9, 10, 12, 1, 7 }, b = a.clone(), sorted = a.clone(); | |
87 | final int[] a = { 2, 1, 5, 2, 1, 0, 9, 1, 4, 2, 4, 6, 8, 9, 10, 12, 1, 7 }, b = a.clone(), sorted = a.clone(); | |
88 | 88 | Arrays.sort(sorted); |
89 | 89 | Arrays.sort(b); |
90 | 90 | assertArrayEquals(sorted, b); |
100 | 100 | |
101 | 101 | @Test |
102 | 102 | public void testParallelQuickSort() { |
103 | int[] a = { 2, 1, 5, 2, 1, 0, 9, 1, 4, 2, 4, 6, 8, 9, 10, 12, 1, 7 }, b = a.clone(), sorted = a.clone(); | |
103 | final int[] a = { 2, 1, 5, 2, 1, 0, 9, 1, 4, 2, 4, 6, 8, 9, 10, 12, 1, 7 }, b = a.clone(), sorted = a.clone(); | |
104 | 104 | Arrays.sort(sorted); |
105 | 105 | Arrays.sort(b); |
106 | 106 | assertArrayEquals(sorted, b); |
426 | 426 | |
427 | 427 | @Test |
428 | 428 | public void testQuickSort2() { |
429 | int[][] d = new int[2][]; | |
429 | final int[][] d = new int[2][]; | |
430 | 430 | |
431 | 431 | d[0] = new int[10]; |
432 | 432 | for(int i = d[0].length; i-- != 0;) d[0][i] = 3 - i % 3; |
472 | 472 | |
473 | 473 | @Test |
474 | 474 | public void testParallelQuickSort2() { |
475 | int[][] d = new int[2][]; | |
475 | final int[][] d = new int[2][]; | |
476 | 476 | |
477 | 477 | d[0] = new int[10]; |
478 | 478 | for(int i = d[0].length; i-- != 0;) d[0][i] = 3 - i % 3; |
517 | 517 | |
518 | 518 | @Test |
519 | 519 | public void testShuffle() { |
520 | int[] a = new int[100]; | |
520 | final int[] a = new int[100]; | |
521 | 521 | for(int i = a.length; i-- != 0;) a[i] = i; |
522 | 522 | IntArrays.shuffle(a, new Random()); |
523 | boolean[] b = new boolean[a.length]; | |
523 | final boolean[] b = new boolean[a.length]; | |
524 | 524 | for(int i = a.length; i-- != 0;) { |
525 | 525 | assertFalse(b[a[i]]); |
526 | 526 | b[a[i]] = true; |
529 | 529 | |
530 | 530 | @Test |
531 | 531 | public void testShuffleFragment() { |
532 | int[] a = new int[100]; | |
532 | final int[] a = new int[100]; | |
533 | 533 | for(int i = a.length; i-- != 0;) a[i] = -1; |
534 | 534 | for(int i = 10; i < 30; i++) a[i] = i - 10; |
535 | 535 | IntArrays.shuffle(a, 10, 30, new Random()); |
536 | boolean[] b = new boolean[20]; | |
536 | final boolean[] b = new boolean[20]; | |
537 | 537 | for(int i = 20; i-- != 0;) { |
538 | 538 | assertFalse(b[a[i + 10]]); |
539 | 539 | b[a[i + 10]] = true; |
614 | 614 | |
615 | 615 | @Test |
616 | 616 | public void testRadixSort2() { |
617 | int[][] d = new int[2][]; | |
617 | final int[][] d = new int[2][]; | |
618 | 618 | |
619 | 619 | d[0] = new int[10]; |
620 | 620 | for(int i = d[0].length; i-- != 0;) d[0][i] = 3 - i % 3; |
659 | 659 | |
660 | 660 | @Test |
661 | 661 | public void testParallelRadixSort2() { |
662 | int[][] d = new int[2][]; | |
662 | final int[][] d = new int[2][]; | |
663 | 663 | |
664 | 664 | d[0] = new int[10]; |
665 | 665 | for(int i = d[0].length; i-- != 0;) d[0][i] = 3 - i % 3; |
705 | 705 | |
706 | 706 | @Test |
707 | 707 | public void testRadixSort() { |
708 | int[][] t = { { 2, 1, 0, 4 } }; | |
708 | final int[][] t = { { 2, 1, 0, 4 } }; | |
709 | 709 | IntArrays.radixSort(t); |
710 | 710 | for(int i = t[0].length - 1; i-- != 0;) assertTrue(t[0][i] <= t[0][i + 1]); |
711 | 711 | |
713 | 713 | IntArrays.radixSort(t); |
714 | 714 | for(int i = t[0].length - 1; i-- != 0;) assertTrue(t[0][i] <= t[0][i + 1]); |
715 | 715 | |
716 | int[][] d = new int[2][]; | |
716 | final int[][] d = new int[2][]; | |
717 | 717 | |
718 | 718 | d[0] = new int[10]; |
719 | 719 | for(int i = d[0].length; i-- != 0;) d[0][i] = 3 - i % 3; |
1291 | 1291 | IntArrays.stabilize(perm, val, 1, 3); |
1292 | 1292 | assertArrayEquals(new int[] { 4, 2, 3, 1, 0 }, perm); |
1293 | 1293 | } |
1294 | ||
1294 | ||
1295 | 1295 | @Test |
1296 | 1296 | public void testLegacyMainMethodTests() throws Exception { |
1297 | 1297 | MainRunner.callMainIfExists(IntArrays.class, "test", /*num=*/"1000", /*seed=*/"848747"); |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
42 | 42 | assertEquals(IntBigLists.EMPTY_BIG_LIST, list); |
43 | 43 | } |
44 | 44 | |
45 | @SuppressWarnings("boxing") | |
46 | 45 | @Test |
47 | 46 | public void testRemoveAllSkipSegment() { |
48 | 47 | final IntBigList list = new IntBigArrayBigList(); |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | /* | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | * | |
3 | * Licensed under the Apache License, Version 2.0 (the "License"); | |
4 | * you may not use this file except in compliance with the License. | |
5 | * You may obtain a copy of the License at | |
6 | * | |
7 | * http://www.apache.org/licenses/LICENSE-2.0 | |
8 | * | |
9 | * Unless required by applicable law or agreed to in writing, software | |
10 | * distributed under the License is distributed on an "AS IS" BASIS, | |
11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
12 | * See the License for the specific language governing permissions and | |
13 | * limitations under the License. | |
14 | */ | |
15 | ||
16 | package it.unimi.dsi.fastutil.ints; | |
17 | ||
18 | import static org.junit.Assert.assertEquals; | |
19 | ||
20 | import java.io.DataOutputStream; | |
21 | import java.io.File; | |
22 | import java.io.FileOutputStream; | |
23 | import java.io.IOException; | |
24 | import java.nio.ByteOrder; | |
25 | import java.nio.channels.FileChannel; | |
26 | import java.nio.channels.FileChannel.MapMode; | |
27 | import java.nio.file.StandardOpenOption; | |
28 | import java.util.SplittableRandom; | |
29 | ||
30 | import org.junit.Test; | |
31 | ||
32 | import it.unimi.dsi.fastutil.io.FastBufferedOutputStream; | |
33 | ||
34 | public class IntMappedBigListTest { | |
35 | @Test | |
36 | public void testReadWrite() throws IOException { | |
37 | final File file = File.createTempFile(this.getClass().getName(), ".bin"); | |
38 | file.deleteOnExit(); | |
39 | SplittableRandom r = new SplittableRandom(0); | |
40 | final DataOutputStream dos = new DataOutputStream(new FastBufferedOutputStream(new FileOutputStream(file))); | |
41 | for (long i = 0; i < IntMappedBigList.CHUNK_SIZE + 10; i++) dos.writeInt(r.nextInt()); | |
42 | dos.close(); | |
43 | ||
44 | final IntMappedBigList list = IntMappedBigList.map(FileChannel.open(file.toPath(), StandardOpenOption.READ, StandardOpenOption.WRITE), ByteOrder.BIG_ENDIAN, MapMode.READ_WRITE); | |
45 | r = new SplittableRandom(0); | |
46 | for (long i = 0; i < IntMappedBigList.CHUNK_SIZE + 10; i++) assertEquals(Long.toString(i), r.nextInt(), list.getInt(i)); | |
47 | ||
48 | r = new SplittableRandom(0); | |
49 | for (long i = 0; i < IntMappedBigList.CHUNK_SIZE - 10; i++) r.nextInt(); | |
50 | final int[] a = new int[20]; | |
51 | list.getElements(IntMappedBigList.CHUNK_SIZE - 10, a, 0, 20); | |
52 | for (long i = IntMappedBigList.CHUNK_SIZE - 10; i < IntMappedBigList.CHUNK_SIZE + 10; i++) assertEquals(Long.toString(i), r.nextInt(), a[(int)(i - (IntMappedBigList.CHUNK_SIZE - 10))]); | |
53 | ||
54 | r = new SplittableRandom(0); | |
55 | list.getElements(1, a, 1, 19); | |
56 | r.nextInt(); | |
57 | for (int i = 1; i < 20; i++) assertEquals(Long.toString(i), r.nextInt(), a[i]); | |
58 | ||
59 | r = new SplittableRandom(1); | |
60 | for (long i = 0; i < IntMappedBigList.CHUNK_SIZE + 10; i++) list.set(i, r.nextInt()); | |
61 | ||
62 | r = new SplittableRandom(1); | |
63 | for (long i = 0; i < IntMappedBigList.CHUNK_SIZE + 10; i++) assertEquals(Long.toString(i), r.nextInt(), list.getInt(i)); | |
64 | ||
65 | ||
66 | file.delete(); | |
67 | ||
68 | } | |
69 | ||
70 | @Test | |
71 | public void testSmallEndian() throws IOException { | |
72 | final File file = File.createTempFile(this.getClass().getName(), ".bin"); | |
73 | file.deleteOnExit(); | |
74 | final java.nio.ByteBuffer buffer = java.nio.ByteBuffer.allocate(10000); | |
75 | ||
76 | buffer.order(ByteOrder.LITTLE_ENDIAN); | |
77 | SplittableRandom r = new SplittableRandom(0); | |
78 | for (long i = 0; i < 100; i++) buffer.putInt(r.nextInt()); | |
79 | buffer.flip(); | |
80 | ||
81 | final FileChannel channel = FileChannel.open(file.toPath(), StandardOpenOption.WRITE); | |
82 | channel.write(buffer); | |
83 | channel.close(); | |
84 | ||
85 | final IntMappedBigList list = IntMappedBigList.map(FileChannel.open(file.toPath()), ByteOrder.LITTLE_ENDIAN); | |
86 | r = new SplittableRandom(0); | |
87 | for (long i = 0; i < 100; i++) assertEquals(Long.toString(i), r.nextInt(), list.getInt(i)); | |
88 | ||
89 | final int[] a = new int[1]; | |
90 | r = new SplittableRandom(0); | |
91 | for (long i = 0; i < 100; i++) { | |
92 | list.getElements(i, a, 0, 1); | |
93 | assertEquals(Long.toString(i), r.nextInt(), a[0]); | |
94 | } | |
95 | ||
96 | final IntMappedBigList copy = list.copy(); | |
97 | r = new SplittableRandom(0); | |
98 | for (long i = 0; i < 100; i++) assertEquals(Long.toString(i), r.nextInt(), copy.getInt(i)); | |
99 | file.delete(); | |
100 | } | |
101 | ||
102 | @Test | |
103 | public void testBigEndian() throws IOException { | |
104 | final File file = File.createTempFile(this.getClass().getName(), ".bin"); | |
105 | file.deleteOnExit(); | |
106 | final java.nio.ByteBuffer buffer = java.nio.ByteBuffer.allocate(10000); | |
107 | ||
108 | buffer.order(ByteOrder.BIG_ENDIAN); | |
109 | SplittableRandom r = new SplittableRandom(0); | |
110 | for (long i = 0; i < 100; i++) buffer.putInt(r.nextInt()); | |
111 | buffer.flip(); | |
112 | ||
113 | final FileChannel channel = FileChannel.open(file.toPath(), StandardOpenOption.WRITE); | |
114 | channel.write(buffer); | |
115 | channel.close(); | |
116 | ||
117 | final IntMappedBigList list = IntMappedBigList.map(FileChannel.open(file.toPath()), ByteOrder.BIG_ENDIAN); | |
118 | r = new SplittableRandom(0); | |
119 | for (long i = 0; i < 100; i++) assertEquals(Long.toString(i), r.nextInt(), list.getInt(i)); | |
120 | ||
121 | final int[] a = new int[1]; | |
122 | r = new SplittableRandom(0); | |
123 | for (long i = 0; i < 100; i++) { | |
124 | list.getElements(i, a, 0, 1); | |
125 | assertEquals(Long.toString(i), r.nextInt(), a[0]); | |
126 | } | |
127 | ||
128 | final IntMappedBigList copy = list.copy(); | |
129 | r = new SplittableRandom(0); | |
130 | for (long i = 0; i < 100; i++) assertEquals(Long.toString(i), r.nextInt(), copy.getInt(i)); | |
131 | file.delete(); | |
132 | } | |
133 | } |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
20 | 20 | import static it.unimi.dsi.fastutil.BigArrays.length; |
21 | 21 | import static it.unimi.dsi.fastutil.BigArrays.set; |
22 | 22 | import static it.unimi.dsi.fastutil.BigArrays.wrap; |
23 | import static java.nio.ByteOrder.BIG_ENDIAN; | |
24 | import static java.nio.ByteOrder.LITTLE_ENDIAN; | |
23 | 25 | import static org.junit.Assert.assertArrayEquals; |
24 | 26 | import static org.junit.Assert.assertEquals; |
25 | 27 | import static org.junit.Assert.assertFalse; |
33 | 35 | import java.io.FileInputStream; |
34 | 36 | import java.io.FileOutputStream; |
35 | 37 | import java.io.IOException; |
38 | import java.nio.ByteOrder; | |
39 | import java.nio.channels.FileChannel; | |
40 | import java.util.Arrays; | |
41 | import java.util.SplittableRandom; | |
36 | 42 | |
37 | 43 | import org.junit.Test; |
38 | 44 | |
45 | import it.unimi.dsi.fastutil.BigArrays; | |
46 | import it.unimi.dsi.fastutil.booleans.BooleanBigArrays; | |
47 | import it.unimi.dsi.fastutil.booleans.BooleanIterator; | |
48 | import it.unimi.dsi.fastutil.booleans.BooleanIterators; | |
39 | 49 | import it.unimi.dsi.fastutil.bytes.ByteBigArrays; |
50 | import it.unimi.dsi.fastutil.bytes.ByteIterators; | |
51 | import it.unimi.dsi.fastutil.doubles.DoubleBigArrays; | |
40 | 52 | import it.unimi.dsi.fastutil.doubles.DoubleIterator; |
53 | import it.unimi.dsi.fastutil.doubles.DoubleIterators; | |
41 | 54 | |
42 | 55 | public class BinIOTest { |
43 | 56 | |
73 | 86 | assertEquals(a.length, BinIO.loadBytes(file, b, 0, a.length)); |
74 | 87 | assertArrayEquals(a, b); |
75 | 88 | |
89 | assertEquals(a.length, BinIO.loadBytes(file.toString(), b)); | |
90 | assertArrayEquals(a, b); | |
91 | assertEquals(a.length, BinIO.loadBytes(file.toString(), b, 0, a.length)); | |
92 | assertArrayEquals(a, b); | |
93 | ||
94 | assertArrayEquals(a, BinIO.loadBytes(file)); | |
95 | assertArrayEquals(a, BinIO.loadBytes(file.toString())); | |
96 | ||
76 | 97 | assertEquals(a.length, BinIO.loadBytes(new FileInputStream(file), b)); |
77 | 98 | assertArrayEquals(a, b); |
78 | 99 | assertEquals(a.length, BinIO.loadBytes(new FileInputStream(file), b, 0, a.length)); |
79 | 100 | assertArrayEquals(a, b); |
101 | ||
102 | final DataInputStream dis = new DataInputStream(new FileInputStream(file)); | |
103 | assertArrayEquals(a, ByteIterators.unwrap(BinIO.asByteIterator(dis))); | |
104 | dis.close(); | |
105 | assertArrayEquals(a, ByteIterators.unwrap(BinIO.asByteIterator(file))); | |
106 | assertArrayEquals(a, ByteIterators.unwrap(BinIO.asByteIterator(file.toString()))); | |
107 | assertArrayEquals(a, ByteIterators.unwrap(BinIO.asByteIterable(file).iterator())); | |
108 | assertArrayEquals(a, ByteIterators.unwrap(BinIO.asByteIterable(file.toString()).iterator())); | |
80 | 109 | |
81 | 110 | final byte[] c = new byte[a.length + 1]; |
82 | 111 | assertEquals(a.length, BinIO.loadBytes(new FileInputStream(file), c)); |
167 | 196 | testBigBytes(wrap(LARGE)); |
168 | 197 | } |
169 | 198 | |
199 | @Test | |
170 | 200 | public void testFileDataWrappers() throws IOException { |
171 | 201 | final File file = File.createTempFile(getClass().getSimpleName(), "dump"); |
172 | 202 | file.deleteOnExit(); |
226 | 256 | testInts(new int[1024]); |
227 | 257 | testInts(new int[1024 * 1024]); |
228 | 258 | } |
229 | } | |
259 | ||
260 | @Test | |
261 | public void testNioDataWrappersDoubles() throws IOException { | |
262 | final File file = File.createTempFile(getClass().getSimpleName(), "dump"); | |
263 | file.deleteOnExit(); | |
264 | for (final ByteOrder o : new ByteOrder[] { LITTLE_ENDIAN, BIG_ENDIAN }) { | |
265 | for (final int size : new int[] { 100, BinIO.BUFFER_SIZE / Double.BYTES, | |
266 | BinIO.BUFFER_SIZE / Double.BYTES + 100, BinIO.BUFFER_SIZE, 10000 }) { | |
267 | final SplittableRandom r = new SplittableRandom(0); | |
268 | final double[] d = new double[size]; | |
269 | for (int i = 0; i < size; i++) d[i] = r.nextDouble(); | |
270 | ||
271 | BinIO.storeDoubles(d, file, o); | |
272 | assertArrayEquals(d, BinIO.loadDoubles(file, o), 0); | |
273 | BinIO.storeDoubles(d, file.toString(), o); | |
274 | assertArrayEquals(d, BinIO.loadDoubles(file, o), 0); | |
275 | BinIO.storeDoubles(DoubleIterators.wrap(d), file, o); | |
276 | assertArrayEquals(d, BinIO.loadDoubles(file, o), 0); | |
277 | BinIO.storeDoubles(DoubleIterators.wrap(d), file.toString(), o); | |
278 | assertArrayEquals(d, BinIO.loadDoubles(file, o), 0); | |
279 | ||
280 | final FileChannel channel = FileChannel.open(file.toPath()); | |
281 | DoubleIterator di = BinIO.asDoubleIterator(channel, o); | |
282 | for (int i = 0; i < size; i++) assertEquals(d[i], di.nextDouble(), 0.); | |
283 | assertFalse(Integer.toString(size), di.hasNext()); | |
284 | channel.close(); | |
285 | ||
286 | di = BinIO.asDoubleIterator(file, o); | |
287 | for (int i = 0; i < size; i++) assertEquals(d[i], di.nextDouble(), 0.); | |
288 | assertFalse(Integer.toString(size), di.hasNext()); | |
289 | ||
290 | di = BinIO.asDoubleIterator(file.toString(), o); | |
291 | for (int i = 0; i < size; i++) assertEquals(d[i], di.nextDouble(), 0.); | |
292 | assertFalse(Integer.toString(size), di.hasNext()); | |
293 | ||
294 | di = BinIO.asDoubleIterable(file, o).iterator(); | |
295 | for (int i = 0; i < size; i++) assertEquals(d[i], di.nextDouble(), 0.); | |
296 | assertFalse(Integer.toString(size), di.hasNext()); | |
297 | ||
298 | di = BinIO.asDoubleIterable(file.toString(), o).iterator(); | |
299 | for (int i = 0; i < size; i++) assertEquals(d[i], di.nextDouble(), 0.); | |
300 | assertFalse(Integer.toString(size), di.hasNext()); | |
301 | ||
302 | di = BinIO.asDoubleIterator(file, o); | |
303 | for (int i = 0; i < size; i++) { | |
304 | assertTrue(di.hasNext()); | |
305 | assertEquals(d[i], di.nextDouble(), 0.); | |
306 | } | |
307 | ||
308 | di = BinIO.asDoubleIterator(file, o); | |
309 | int s = 1; | |
310 | for (int i = 0; i < size; i++) { | |
311 | assertEquals(Math.min(s, size - i), di.skip(s)); | |
312 | i += s; | |
313 | if (i >= size) break; | |
314 | assertEquals(d[i], di.nextDouble(), 0.); | |
315 | s *= 2; | |
316 | } | |
317 | ||
318 | di = BinIO.asDoubleIterator(file, o); | |
319 | s = 1; | |
320 | for (int i = 0; i < size; i++) { | |
321 | if (s > size - i) break; | |
322 | assertTrue(di.hasNext()); | |
323 | assertEquals(Math.min(s, size - i), di.skip(s)); | |
324 | i += s; | |
325 | if (i >= size) { | |
326 | assertFalse(di.hasNext()); | |
327 | break; | |
328 | } | |
329 | assertTrue(di.hasNext()); | |
330 | assertTrue(di.hasNext()); // To increase coverage | |
331 | assertEquals(d[i], di.nextDouble(), 0.); | |
332 | s *= 2; | |
333 | } | |
334 | } | |
335 | } | |
336 | } | |
337 | ||
338 | @Test | |
339 | public void testNioBigDoubles() throws IOException { | |
340 | final File file = File.createTempFile(getClass().getSimpleName(), "dump"); | |
341 | file.deleteOnExit(); | |
342 | for (final ByteOrder o : new ByteOrder[] { LITTLE_ENDIAN, BIG_ENDIAN }) { | |
343 | for (final int size : new int[] { 100, BinIO.BUFFER_SIZE / Double.BYTES, | |
344 | BinIO.BUFFER_SIZE / Double.BYTES + 100, BinIO.BUFFER_SIZE, 10000 }) { | |
345 | final int size2 = size / 2, size34 = 3 * size / 4; | |
346 | final SplittableRandom r = new SplittableRandom(0); | |
347 | final double[] d = new double[size]; | |
348 | for (int i = 0; i < size; i++) d[i] = r.nextDouble(); | |
349 | final double[][] dd = BigArrays.wrap(d); | |
350 | ||
351 | BinIO.storeDoubles(dd, file, o); | |
352 | assertArrayEquals(d, BinIO.loadDoubles(file, o), 0); | |
353 | BinIO.storeDoubles(dd, file.toString(), o); | |
354 | assertArrayEquals(d, BinIO.loadDoubles(file.toString(), o), 0); | |
355 | assertTrue(BigArrays.equals(dd, BinIO.loadDoublesBig(file, o))); | |
356 | ||
357 | final double[] e = new double[size]; | |
358 | assertEquals(size - size2, BinIO.loadDoubles(file, o, e, size2, size - size2)); | |
359 | for (int i = size2; i < size; i++) assertEquals(e[i], d[i - size2], 0); | |
360 | assertEquals(size - size2, BinIO.loadDoubles(file.toString(), o, e, size2, size - size2)); | |
361 | for (int i = size2; i < size; i++) assertEquals(e[i], d[i - size2], 0); | |
362 | ||
363 | final double[] h = new double[size2]; | |
364 | assertEquals(size2, BinIO.loadDoubles(file, o, h)); | |
365 | for (int i = 0; i < size2; i++) assertEquals(h[i], d[i], 0); | |
366 | assertEquals(size2, BinIO.loadDoubles(file.toString(), o, h)); | |
367 | for (int i = 0; i < size2; i++) assertEquals(h[i], d[i], 0); | |
368 | ||
369 | final double[][] ee = DoubleBigArrays.newBigArray(length(dd)); | |
370 | final double[][] hh = BigArrays.wrap(h); | |
371 | ||
372 | FileChannel channel = FileChannel.open(file.toPath()); | |
373 | assertEquals(size, BinIO.loadDoubles(channel, o, ee)); | |
374 | assertTrue(BigArrays.equals(dd, ee)); | |
375 | channel.close(); | |
376 | ||
377 | channel = FileChannel.open(file.toPath()); | |
378 | assertEquals(size2, BinIO.loadDoubles(channel, o, hh)); | |
379 | for (int i = 0; i < size2; i++) assertEquals(h[i], get(hh, i), 0); | |
380 | channel.close(); | |
381 | ||
382 | assertEquals(size, BinIO.loadDoubles(file, o, ee, 0, size)); | |
383 | assertTrue(BigArrays.equals(dd, ee)); | |
384 | assertEquals(size, BinIO.loadDoubles(file, o, ee)); | |
385 | assertEquals(size, BinIO.loadDoubles(file, o, DoubleBigArrays.newBigArray(size * 2))); | |
386 | assertTrue(BigArrays.equals(dd, ee)); | |
387 | assertEquals(size, BinIO.loadDoubles(file.toString(), o, ee, 0, size)); | |
388 | assertTrue(BigArrays.equals(dd, ee)); | |
389 | assertEquals(size, BinIO.loadDoubles(file.toString(), o, ee)); | |
390 | assertTrue(BigArrays.equals(dd, ee)); | |
391 | assertTrue(BigArrays.equals(dd, BinIO.loadDoublesBig(file, o))); | |
392 | assertTrue(BigArrays.equals(dd, BinIO.loadDoublesBig(file.toString(), o))); | |
393 | ||
394 | assertEquals(size - size2, BinIO.loadDoubles(file, o, ee, size2, size - size2)); | |
395 | for (int i = size2; i < size; i++) assertEquals(get(ee, i), get(dd, i - size2), 0); | |
396 | ||
397 | assertEquals(size - size2, BinIO.loadDoubles(file, o, ee, size2, size - size2)); | |
398 | for (int i = size2; i < size; i++) assertEquals(get(ee, i), get(dd, i - size2), 0); | |
399 | ||
400 | assertEquals(size34 - size2, BinIO.loadDoubles(file.toString(), o, ee, size2, size34 - size2)); | |
401 | for (int i = size2; i < size34; i++) assertEquals(get(ee, i), get(dd, i - size2), 0); | |
402 | ||
403 | BinIO.storeDoubles(dd, size2, size - size2, file, o); | |
404 | assertArrayEquals(Arrays.copyOfRange(d, size2, size), BinIO.loadDoubles(file, o), 0); | |
405 | BinIO.storeDoubles(dd, size2, size - size2, file.toString(), o); | |
406 | assertArrayEquals(Arrays.copyOfRange(d, size2, size), BinIO.loadDoubles(file, o), 0); | |
407 | ||
408 | BinIO.storeDoubles(dd, size2, size34 - size2, file, o); | |
409 | assertArrayEquals(Arrays.copyOfRange(d, size2, size34), BinIO.loadDoubles(file, o), 0); | |
410 | ||
411 | BinIO.storeDoubles(d, size2, size - size2, file, o); | |
412 | assertArrayEquals(Arrays.copyOfRange(d, size2, size), BinIO.loadDoubles(file, o), 0); | |
413 | BinIO.storeDoubles(d, size2, size - size2, file.toString(), o); | |
414 | assertArrayEquals(Arrays.copyOfRange(d, size2, size), BinIO.loadDoubles(file, o), 0); | |
415 | ||
416 | BinIO.storeDoubles(d, size2, size34 - size2, file, o); | |
417 | assertArrayEquals(Arrays.copyOfRange(d, size2, size34), BinIO.loadDoubles(file, o), 0); | |
418 | ||
419 | } | |
420 | } | |
421 | } | |
422 | ||
423 | @SuppressWarnings("boxing") | |
424 | @Test | |
425 | public void testNioDataWrappersBooleans() throws IOException { | |
426 | final File file = File.createTempFile(getClass().getSimpleName(), "dump"); | |
427 | file.deleteOnExit(); | |
428 | for (final int size : new int[] { 100, BinIO.BUFFER_SIZE / Double.BYTES, | |
429 | BinIO.BUFFER_SIZE / Double.BYTES + 100, BinIO.BUFFER_SIZE, 10000 }) { | |
430 | final int size2 = size / 2, size34 = 3 * size / 4; | |
431 | final SplittableRandom r = new SplittableRandom(0); | |
432 | final boolean[] d = new boolean[size]; | |
433 | final boolean[] e = new boolean[size]; | |
434 | for (int i = 0; i < size; i++) d[i] = r.nextBoolean(); | |
435 | ||
436 | BinIO.storeBooleans(d, file); | |
437 | assertArrayEquals(d, BinIO.loadBooleans(file)); | |
438 | BinIO.storeBooleans(d, file.toString()); | |
439 | assertArrayEquals(d, BinIO.loadBooleans(file)); | |
440 | BinIO.storeBooleans(BooleanIterators.wrap(d), file); | |
441 | assertArrayEquals(d, BinIO.loadBooleans(file)); | |
442 | BinIO.storeBooleans(BooleanIterators.wrap(d), file.toString()); | |
443 | assertArrayEquals(d, BinIO.loadBooleans(file)); | |
444 | ||
445 | DataInputStream dis = new DataInputStream(new FileInputStream(file)); | |
446 | assertEquals(size, BinIO.loadBooleans(dis, e)); | |
447 | assertArrayEquals(d, e); | |
448 | dis.close(); | |
449 | ||
450 | dis = new DataInputStream(new FileInputStream(file)); | |
451 | assertEquals(size, BinIO.loadBooleans(dis, new boolean[size * 2])); | |
452 | dis.close(); | |
453 | ||
454 | DataOutputStream dos = new DataOutputStream(new FileOutputStream(file)); | |
455 | BinIO.storeBooleans(d, size2, size34 - size2, dos); | |
456 | assertArrayEquals(Arrays.copyOfRange(d, size2, size34), BinIO.loadBooleans(file)); | |
457 | dos.close(); | |
458 | ||
459 | BinIO.storeBooleans(d, file); | |
460 | ||
461 | dis = new DataInputStream(new FileInputStream(file)); | |
462 | assertEquals(size, BinIO.loadBooleans(dis, new boolean[size * 3], size, 2 * size)); | |
463 | dis.close(); | |
464 | ||
465 | assertEquals(size, BinIO.loadBooleans(file, new boolean[size * 3], size, 2 * size)); | |
466 | ||
467 | dos = new DataOutputStream(new FileOutputStream(file)); | |
468 | BinIO.storeBooleans(BooleanIterators.wrap(d), dos); | |
469 | assertArrayEquals(d, BinIO.loadBooleans(file)); | |
470 | dos.close(); | |
471 | ||
472 | BinIO.storeBooleans(BooleanIterators.wrap(d), file); | |
473 | assertArrayEquals(d, BinIO.loadBooleans(file)); | |
474 | ||
475 | BinIO.storeBooleans(BooleanIterators.wrap(d), file.toString()); | |
476 | assertArrayEquals(d, BinIO.loadBooleans(file)); | |
477 | ||
478 | dos = new DataOutputStream(new FileOutputStream(file)); | |
479 | BinIO.storeBooleans(d, dos); | |
480 | assertArrayEquals(d, BinIO.loadBooleans(file)); | |
481 | dos.close(); | |
482 | ||
483 | dis = new DataInputStream(new FileInputStream(file)); | |
484 | assertEquals(size34 - size2, BinIO.loadBooleans(dis, e, size2, size34 - size2)); | |
485 | for (int i = size2; i < size34; i++) assertEquals(d[i - size2], e[i]); | |
486 | dis.close(); | |
487 | ||
488 | dis = new DataInputStream(new FileInputStream(file)); | |
489 | BooleanIterator di = BinIO.asBooleanIterator(dis); | |
490 | for (int i = 0; i < size; i++) assertEquals(d[i], di.nextBoolean()); | |
491 | assertFalse(Integer.toString(size), di.hasNext()); | |
492 | dis.close(); | |
493 | ||
494 | di = BinIO.asBooleanIterator(file); | |
495 | for (int i = 0; i < size; i++) assertEquals(d[i], di.nextBoolean()); | |
496 | assertFalse(Integer.toString(size), di.hasNext()); | |
497 | ||
498 | di = BinIO.asBooleanIterator(file.toString()); | |
499 | for (int i = 0; i < size; i++) assertEquals(d[i], di.nextBoolean()); | |
500 | assertFalse(Integer.toString(size), di.hasNext()); | |
501 | ||
502 | di = BinIO.asBooleanIterable(file).iterator(); | |
503 | for (int i = 0; i < size; i++) assertEquals(d[i], di.nextBoolean()); | |
504 | assertFalse(Integer.toString(size), di.hasNext()); | |
505 | ||
506 | di = BinIO.asBooleanIterable(file.toString()).iterator(); | |
507 | for (int i = 0; i < size; i++) assertEquals(d[i], di.nextBoolean()); | |
508 | assertFalse(Integer.toString(size), di.hasNext()); | |
509 | ||
510 | di = BinIO.asBooleanIterator(file); | |
511 | for (int i = 0; i < size; i++) { | |
512 | assertTrue(di.hasNext()); | |
513 | assertEquals(d[i], di.nextBoolean()); | |
514 | } | |
515 | ||
516 | di = BinIO.asBooleanIterator(file); | |
517 | int s = 1; | |
518 | for (int i = 0; i < size; i++) { | |
519 | assertEquals(Math.min(s, size - i), di.skip(s)); | |
520 | i += s; | |
521 | if (i >= size) break; | |
522 | assertEquals(d[i], di.nextBoolean()); | |
523 | s *= 2; | |
524 | } | |
525 | ||
526 | di = BinIO.asBooleanIterator(file); | |
527 | s = 1; | |
528 | for (int i = 0; i < size; i++) { | |
529 | if (s > size - i) break; | |
530 | assertTrue(di.hasNext()); | |
531 | assertEquals(Math.min(s, size - i), di.skip(s)); | |
532 | i += s; | |
533 | if (i >= size) { | |
534 | assertFalse(di.hasNext()); | |
535 | break; | |
536 | } | |
537 | assertTrue(di.hasNext()); | |
538 | assertTrue(di.hasNext()); // To increase coverage | |
539 | assertEquals(d[i], di.nextBoolean()); | |
540 | s *= 2; | |
541 | } | |
542 | } | |
543 | } | |
544 | ||
545 | @SuppressWarnings("boxing") | |
546 | @Test | |
547 | public void testNioBigBooleans() throws IOException { | |
548 | final File file = File.createTempFile(getClass().getSimpleName(), "dump"); | |
549 | file.deleteOnExit(); | |
550 | for (final int size : new int[] { 100, BinIO.BUFFER_SIZE / Double.BYTES, | |
551 | BinIO.BUFFER_SIZE / Double.BYTES + 100, BinIO.BUFFER_SIZE, 10000 }) { | |
552 | final int size2 = size / 2, size34 = 3 * size / 4; | |
553 | final SplittableRandom r = new SplittableRandom(0); | |
554 | final boolean[] d = new boolean[size]; | |
555 | for (int i = 0; i < size; i++) d[i] = r.nextBoolean(); | |
556 | final boolean[][] dd = BigArrays.wrap(d); | |
557 | ||
558 | BinIO.storeBooleans(dd, file); | |
559 | assertArrayEquals(d, BinIO.loadBooleans(file)); | |
560 | BinIO.storeBooleans(dd, file.toString()); | |
561 | assertArrayEquals(d, BinIO.loadBooleans(file.toString())); | |
562 | assertTrue(BigArrays.equals(dd, BinIO.loadBooleansBig(file))); | |
563 | ||
564 | final boolean[] e = new boolean[size]; | |
565 | assertEquals(size - size2, BinIO.loadBooleans(file, e, size2, size - size2)); | |
566 | for (int i = size2; i < size; i++) assertEquals(e[i], d[i - size2]); | |
567 | assertEquals(size - size2, BinIO.loadBooleans(file.toString(), e, size2, size - size2)); | |
568 | for (int i = size2; i < size; i++) assertEquals(e[i], d[i - size2]); | |
569 | ||
570 | final boolean[] h = new boolean[size2]; | |
571 | assertEquals(size2, BinIO.loadBooleans(file, h)); | |
572 | for (int i = 0; i < size2; i++) assertEquals(h[i], d[i]); | |
573 | assertEquals(size2, BinIO.loadBooleans(file.toString(), h)); | |
574 | for (int i = 0; i < size2; i++) assertEquals(h[i], d[i]); | |
575 | ||
576 | final boolean[][] ee = BooleanBigArrays.newBigArray(length(dd)); | |
577 | final boolean[][] hh = BigArrays.wrap(h); | |
578 | ||
579 | DataInputStream dis = new DataInputStream(new FileInputStream(file)); | |
580 | assertEquals(size, BinIO.loadBooleans(dis, ee)); | |
581 | assertTrue(BigArrays.equals(dd, ee)); | |
582 | dis.close(); | |
583 | ||
584 | dis = new DataInputStream(new FileInputStream(file)); | |
585 | assertEquals(size, BinIO.loadBooleans(dis, BooleanBigArrays.newBigArray(size * 3))); | |
586 | dis.close(); | |
587 | ||
588 | dis = new DataInputStream(new FileInputStream(file)); | |
589 | assertEquals(size, BinIO.loadBooleans(dis, BooleanBigArrays.newBigArray(size * 3), size, 2 * size)); | |
590 | dis.close(); | |
591 | ||
592 | dis = new DataInputStream(new FileInputStream(file)); | |
593 | assertEquals(size2, BinIO.loadBooleans(dis, hh)); | |
594 | for (int i = 0; i < size2; i++) assertEquals(h[i], get(hh, i)); | |
595 | dis.close(); | |
596 | ||
597 | dis = new DataInputStream(new FileInputStream(file)); | |
598 | assertEquals(size34 - size2, BinIO.loadBooleans(dis, ee, size2, size34 - size2)); | |
599 | for (int i = size2; i < size34 - size2; i++) assertEquals(d[i - size2], get(ee, i)); | |
600 | dis.close(); | |
601 | ||
602 | assertEquals(size, BinIO.loadBooleans(file, ee, 0, size)); | |
603 | assertTrue(BigArrays.equals(dd, ee)); | |
604 | assertEquals(size, BinIO.loadBooleans(file, ee)); | |
605 | assertTrue(BigArrays.equals(dd, ee)); | |
606 | assertEquals(size, BinIO.loadBooleans(file.toString(), ee, 0, size)); | |
607 | assertTrue(BigArrays.equals(dd, ee)); | |
608 | assertEquals(size, BinIO.loadBooleans(file.toString(), ee)); | |
609 | assertTrue(BigArrays.equals(dd, ee)); | |
610 | assertTrue(BigArrays.equals(dd, BinIO.loadBooleansBig(file))); | |
611 | assertTrue(BigArrays.equals(dd, BinIO.loadBooleansBig(file.toString()))); | |
612 | ||
613 | assertEquals(size - size2, BinIO.loadBooleans(file, ee, size2, size - size2)); | |
614 | for (int i = size2; i < size; i++) assertEquals(get(ee, i), get(dd, i - size2)); | |
615 | ||
616 | assertEquals(size34 - size2, BinIO.loadBooleans(file, ee, size2, size34 - size2)); | |
617 | for (int i = size2; i < size34; i++) assertEquals(get(ee, i), get(dd, i - size2)); | |
618 | ||
619 | BinIO.storeBooleans(dd, size2, size - size2, file); | |
620 | assertArrayEquals(Arrays.copyOfRange(d, size2, size), BinIO.loadBooleans(file)); | |
621 | BinIO.storeBooleans(dd, size2, size - size2, file.toString()); | |
622 | assertArrayEquals(Arrays.copyOfRange(d, size2, size), BinIO.loadBooleans(file)); | |
623 | ||
624 | BinIO.storeBooleans(dd, size2, size34 - size2, file); | |
625 | assertArrayEquals(Arrays.copyOfRange(d, size2, size34), BinIO.loadBooleans(file)); | |
626 | ||
627 | BinIO.storeBooleans(d, size2, size - size2, file); | |
628 | assertArrayEquals(Arrays.copyOfRange(d, size2, size), BinIO.loadBooleans(file)); | |
629 | BinIO.storeBooleans(d, size2, size - size2, file.toString()); | |
630 | assertArrayEquals(Arrays.copyOfRange(d, size2, size), BinIO.loadBooleans(file)); | |
631 | ||
632 | BinIO.storeBooleans(d, size2, size34 - size2, file); | |
633 | assertArrayEquals(Arrays.copyOfRange(d, size2, size34), BinIO.loadBooleans(file)); | |
634 | ||
635 | DataOutputStream dos = new DataOutputStream(new FileOutputStream(file)); | |
636 | BinIO.storeBooleans(dd, dos); | |
637 | dos.close(); | |
638 | assertTrue(BigArrays.equals(dd, BinIO.loadBooleansBig(file))); | |
639 | ||
640 | dos = new DataOutputStream(new FileOutputStream(file)); | |
641 | BinIO.storeBooleans(dd, size2, size34 - size2, dos); | |
642 | dos.close(); | |
643 | assertTrue(BigArrays.equals(BigArrays.copy(dd, size2, size34 - size2), BinIO.loadBooleansBig(file))); | |
644 | ||
645 | } | |
646 | } | |
647 | ||
648 | }⏎ |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2019-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2019-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
59 | 59 | assertFalse(map.containsKey("def")); |
60 | 60 | } |
61 | 61 | } |
62 |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
0 | 0 | /* |
1 | * Copyright (C) 2017-2021 Sebastiano Vigna | |
1 | * Copyright (C) 2017-2022 Sebastiano Vigna | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |