From: Daniel Kirschten Date: Mon, 20 May 2019 17:28:26 +0000 (+0200) Subject: Merged logic into master X-Git-Url: https://mograsim.net/gitweb/?a=commitdiff_plain;h=e7180dd9040734555e6a07f2561fb688118b7002;p=Mograsim.git Merged logic into master --- e7180dd9040734555e6a07f2561fb688118b7002 diff --cc .gitmodules index 7ab23881,00000000..a128354d mode 100644,000000..100644 --- a/.gitmodules +++ b/.gitmodules @@@ -1,12 -1,0 +1,8 @@@ - [submodule "logic"] - path = logic - url =
- branch = logic +[submodule "logicui"] + path = logicui + url =
+ branch = logicui +[submodule "SampleERCP"] + path = SampleERCP + url =
+ branch = SampleERCP diff --cc era.mi/.classpath index 00000000,d286d860..be855233 mode 000000,100644..100644 --- a/era.mi/.classpath +++ b/era.mi/.classpath @@@ -1,0 -1,13 +1,13 @@@ - - - - - - - - - - - ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ diff --cc era.mi/.settings/org.eclipse.jdt.core.prefs index 00000000,0fc9edde..82c6671b mode 000000,100644..100644 --- a/era.mi/.settings/org.eclipse.jdt.core.prefs +++ b/era.mi/.settings/org.eclipse.jdt.core.prefs @@@ -1,0 -1,367 +1,367 @@@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=10 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=10 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.release=enabled -org.eclipse.jdt.core.compiler.source=10 -org.eclipse.jdt.core.formatter.align_assignment_statements_on_columns=false -org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines=2147483647 -org.eclipse.jdt.core.formatter.align_type_members_on_columns=false -org.eclipse.jdt.core.formatter.align_variable_declarations_on_columns=false -org.eclipse.jdt.core.formatter.align_with_spaces=false -org.eclipse.jdt.core.formatter.alignment_for_additive_operator=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_assignment=0 -org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_bitwise_operator=16 -org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 -org.eclipse.jdt.core.formatter.alignment_for_compact_loops=16 -org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 -org.eclipse.jdt.core.formatter.alignment_for_conditional_expression_chain=0 -org.eclipse.jdt.core.formatter.alignment_for_enum_constants=16 -org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 -org.eclipse.jdt.core.formatter.alignment_for_expressions_in_for_loop_header=0 -org.eclipse.jdt.core.formatter.alignment_for_logical_operator=16 -org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 -org.eclipse.jdt.core.formatter.alignment_for_module_statements=16 -org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 -org.eclipse.jdt.core.formatter.alignment_for_multiplicative_operator=16 -org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references=0 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_relational_operator=0 -org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 -org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_shift_operator=0 -org.eclipse.jdt.core.formatter.alignment_for_string_concatenation=16 -org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_type_arguments=0 -org.eclipse.jdt.core.formatter.alignment_for_type_parameters=0 -org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 -org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_after_package=1 -org.eclipse.jdt.core.formatter.blank_lines_before_field=0 -org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 -org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 -org.eclipse.jdt.core.formatter.blank_lines_before_method=1 -org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 -org.eclipse.jdt.core.formatter.blank_lines_before_package=0 -org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 -org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 -org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=next_line -org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=next_line -org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block=next_line -org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=next_line -org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=next_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=next_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=next_line -org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=next_line -org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=next_line -org.eclipse.jdt.core.formatter.brace_position_for_switch=next_line -org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=next_line -org.eclipse.jdt.core.formatter.comment.align_tags_descriptions_grouped=true -org.eclipse.jdt.core.formatter.comment.align_tags_names_descriptions=false -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false -org.eclipse.jdt.core.formatter.comment.count_line_length_from_starting_position=true -org.eclipse.jdt.core.formatter.comment.format_block_comments=true -org.eclipse.jdt.core.formatter.comment.format_header=false -org.eclipse.jdt.core.formatter.comment.format_html=true -org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true -org.eclipse.jdt.core.formatter.comment.format_line_comments=true -org.eclipse.jdt.core.formatter.comment.format_source_code=true -org.eclipse.jdt.core.formatter.comment.indent_parameter_description=false -org.eclipse.jdt.core.formatter.comment.indent_root_tags=false -org.eclipse.jdt.core.formatter.comment.indent_tag_description=false -org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert -org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert -org.eclipse.jdt.core.formatter.comment.line_length=140 -org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true -org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true -org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false -org.eclipse.jdt.core.formatter.compact_else_if=true -org.eclipse.jdt.core.formatter.continuation_indentation=2 -org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 -org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off -org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on -org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false -org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=false -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true -org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_empty_lines=false -org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true -org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false -org.eclipse.jdt.core.formatter.indentation.size=4 -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=insert -org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=insert -org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_after_additive_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_bitwise_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert -org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert -org.eclipse.jdt.core.formatter.insert_space_after_logical_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_multiplicative_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_relational_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert -org.eclipse.jdt.core.formatter.insert_space_after_shift_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_string_concatenation=insert -org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_additive_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_bitwise_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert -org.eclipse.jdt.core.formatter.insert_space_before_logical_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_multiplicative_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert -org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_relational_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_shift_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_string_concatenation=insert -org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.join_lines_in_comments=true -org.eclipse.jdt.core.formatter.join_wrapped_lines=true -org.eclipse.jdt.core.formatter.keep_annotation_declaration_on_one_line=one_line_never -org.eclipse.jdt.core.formatter.keep_anonymous_type_declaration_on_one_line=one_line_never -org.eclipse.jdt.core.formatter.keep_code_block_on_one_line=one_line_never -org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false -org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false -org.eclipse.jdt.core.formatter.keep_enum_constant_declaration_on_one_line=one_line_never -org.eclipse.jdt.core.formatter.keep_enum_declaration_on_one_line=one_line_never -org.eclipse.jdt.core.formatter.keep_if_then_body_block_on_one_line=one_line_never -org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false -org.eclipse.jdt.core.formatter.keep_lambda_body_block_on_one_line=one_line_never -org.eclipse.jdt.core.formatter.keep_loop_body_block_on_one_line=one_line_never -org.eclipse.jdt.core.formatter.keep_method_body_on_one_line=one_line_never -org.eclipse.jdt.core.formatter.keep_simple_do_while_body_on_same_line=false -org.eclipse.jdt.core.formatter.keep_simple_for_body_on_same_line=false -org.eclipse.jdt.core.formatter.keep_simple_getter_setter_on_one_line=false -org.eclipse.jdt.core.formatter.keep_simple_while_body_on_same_line=false -org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false -org.eclipse.jdt.core.formatter.keep_type_declaration_on_one_line=one_line_never -org.eclipse.jdt.core.formatter.lineSplit=140 -org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false -org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false -org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 -org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 -org.eclipse.jdt.core.formatter.parentheses_positions_in_annotation=common_lines -org.eclipse.jdt.core.formatter.parentheses_positions_in_catch_clause=common_lines -org.eclipse.jdt.core.formatter.parentheses_positions_in_enum_constant_declaration=common_lines -org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment=common_lines -org.eclipse.jdt.core.formatter.parentheses_positions_in_if_while_statement=common_lines -org.eclipse.jdt.core.formatter.parentheses_positions_in_lambda_declaration=common_lines -org.eclipse.jdt.core.formatter.parentheses_positions_in_method_delcaration=common_lines -org.eclipse.jdt.core.formatter.parentheses_positions_in_method_invocation=common_lines -org.eclipse.jdt.core.formatter.parentheses_positions_in_switch_statement=common_lines -org.eclipse.jdt.core.formatter.parentheses_positions_in_try_clause=common_lines -org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true -org.eclipse.jdt.core.formatter.tabulation.char=tab -org.eclipse.jdt.core.formatter.tabulation.size=4 -org.eclipse.jdt.core.formatter.use_on_off_tags=true -org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false -org.eclipse.jdt.core.formatter.wrap_before_additive_operator=true -org.eclipse.jdt.core.formatter.wrap_before_assignment_operator=false -org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true -org.eclipse.jdt.core.formatter.wrap_before_bitwise_operator=true -org.eclipse.jdt.core.formatter.wrap_before_conditional_operator=true -org.eclipse.jdt.core.formatter.wrap_before_logical_operator=true -org.eclipse.jdt.core.formatter.wrap_before_multiplicative_operator=true -org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true -org.eclipse.jdt.core.formatter.wrap_before_relational_operator=true -org.eclipse.jdt.core.formatter.wrap_before_shift_operator=true -org.eclipse.jdt.core.formatter.wrap_before_string_concatenation=true -org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true -org.eclipse.jdt.core.javaFormatter=org.eclipse.jdt.core.defaultJavaFormatter ++eclipse.preferences.version=1 ++org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled ++org.eclipse.jdt.core.compiler.codegen.targetPlatform=10 ++org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve ++org.eclipse.jdt.core.compiler.compliance=10 ++org.eclipse.jdt.core.compiler.debug.lineNumber=generate ++org.eclipse.jdt.core.compiler.debug.localVariable=generate ++org.eclipse.jdt.core.compiler.debug.sourceFile=generate ++org.eclipse.jdt.core.compiler.problem.assertIdentifier=error ++org.eclipse.jdt.core.compiler.problem.enumIdentifier=error ++org.eclipse.jdt.core.compiler.release=enabled ++org.eclipse.jdt.core.compiler.source=10 ++org.eclipse.jdt.core.formatter.align_assignment_statements_on_columns=false ++org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines=2147483647 ++org.eclipse.jdt.core.formatter.align_type_members_on_columns=false ++org.eclipse.jdt.core.formatter.align_variable_declarations_on_columns=false ++org.eclipse.jdt.core.formatter.align_with_spaces=false ++org.eclipse.jdt.core.formatter.alignment_for_additive_operator=16 ++org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 ++org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 ++org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 ++org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 ++org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 ++org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 ++org.eclipse.jdt.core.formatter.alignment_for_assignment=0 ++org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 ++org.eclipse.jdt.core.formatter.alignment_for_bitwise_operator=16 ++org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 ++org.eclipse.jdt.core.formatter.alignment_for_compact_loops=16 ++org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 ++org.eclipse.jdt.core.formatter.alignment_for_conditional_expression_chain=0 ++org.eclipse.jdt.core.formatter.alignment_for_enum_constants=16 ++org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 ++org.eclipse.jdt.core.formatter.alignment_for_expressions_in_for_loop_header=0 ++org.eclipse.jdt.core.formatter.alignment_for_logical_operator=16 ++org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 ++org.eclipse.jdt.core.formatter.alignment_for_module_statements=16 ++org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 ++org.eclipse.jdt.core.formatter.alignment_for_multiplicative_operator=16 ++org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references=0 ++org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 ++org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 ++org.eclipse.jdt.core.formatter.alignment_for_relational_operator=0 ++org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 ++org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 ++org.eclipse.jdt.core.formatter.alignment_for_shift_operator=0 ++org.eclipse.jdt.core.formatter.alignment_for_string_concatenation=16 ++org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 ++org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 ++org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 ++org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 ++org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 ++org.eclipse.jdt.core.formatter.alignment_for_type_arguments=0 ++org.eclipse.jdt.core.formatter.alignment_for_type_parameters=0 ++org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 ++org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 ++org.eclipse.jdt.core.formatter.blank_lines_after_package=1 ++org.eclipse.jdt.core.formatter.blank_lines_before_field=0 ++org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 ++org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 ++org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 ++org.eclipse.jdt.core.formatter.blank_lines_before_method=1 ++org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 ++org.eclipse.jdt.core.formatter.blank_lines_before_package=0 ++org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 ++org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 ++org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=next_line ++org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=next_line ++org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line ++org.eclipse.jdt.core.formatter.brace_position_for_block=next_line ++org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=next_line ++org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=next_line ++org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=next_line ++org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=next_line ++org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=next_line ++org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=next_line ++org.eclipse.jdt.core.formatter.brace_position_for_switch=next_line ++org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=next_line ++org.eclipse.jdt.core.formatter.comment.align_tags_descriptions_grouped=true ++org.eclipse.jdt.core.formatter.comment.align_tags_names_descriptions=false ++org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false ++org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false ++org.eclipse.jdt.core.formatter.comment.count_line_length_from_starting_position=true ++org.eclipse.jdt.core.formatter.comment.format_block_comments=true ++org.eclipse.jdt.core.formatter.comment.format_header=false ++org.eclipse.jdt.core.formatter.comment.format_html=true ++org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true ++org.eclipse.jdt.core.formatter.comment.format_line_comments=true ++org.eclipse.jdt.core.formatter.comment.format_source_code=true ++org.eclipse.jdt.core.formatter.comment.indent_parameter_description=false ++org.eclipse.jdt.core.formatter.comment.indent_root_tags=false ++org.eclipse.jdt.core.formatter.comment.indent_tag_description=false ++org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert ++org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert ++org.eclipse.jdt.core.formatter.comment.line_length=140 ++org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true ++org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true ++org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false ++org.eclipse.jdt.core.formatter.compact_else_if=true ++org.eclipse.jdt.core.formatter.continuation_indentation=2 ++org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 ++org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off ++org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on ++org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false ++org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=false ++org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true ++org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true ++org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true ++org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true ++org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true ++org.eclipse.jdt.core.formatter.indent_empty_lines=false ++org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true ++org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true ++org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true ++org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false ++org.eclipse.jdt.core.formatter.indentation.size=4 ++org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_enum_constant=insert ++org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert ++org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert ++org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert ++org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert ++org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert ++org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert ++org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert ++org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert ++org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert ++org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert ++org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=insert ++org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert ++org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert ++org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=insert ++org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert ++org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert ++org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert ++org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert ++org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert ++org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert ++org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert ++org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert ++org.eclipse.jdt.core.formatter.insert_space_after_additive_operator=insert ++org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert ++org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert ++org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert ++org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert ++org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert ++org.eclipse.jdt.core.formatter.insert_space_after_bitwise_operator=insert ++org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=do not insert ++org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert ++org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert ++org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert ++org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert ++org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert ++org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert ++org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert ++org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert ++org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert ++org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert ++org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert ++org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert ++org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert ++org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert ++org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert ++org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert ++org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert ++org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert ++org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert ++org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert ++org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert ++org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert ++org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert ++org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert ++org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert ++org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert ++org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert ++org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert ++org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert ++org.eclipse.jdt.core.formatter.insert_space_after_logical_operator=insert ++org.eclipse.jdt.core.formatter.insert_space_after_multiplicative_operator=insert ++org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert ++org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert ++org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert ++org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert ++org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert ++org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert ++org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert ++org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert ++org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert ++org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert ++org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert ++org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert ++org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert ++org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert ++org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert ++org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert ++org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert ++org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert ++org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert ++org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert ++org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert ++org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert ++org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert ++org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert ++org.eclipse.jdt.core.formatter.insert_space_after_relational_operator=insert ++org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert ++org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert ++org.eclipse.jdt.core.formatter.insert_space_after_shift_operator=insert ++org.eclipse.jdt.core.formatter.insert_space_after_string_concatenation=insert ++org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert ++org.eclipse.jdt.core.formatter.insert_space_before_additive_operator=insert ++org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert ++org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert ++org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert ++org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert ++org.eclipse.jdt.core.formatter.insert_space_before_bitwise_operator=insert ++org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert ++org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert ++org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert ++org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert ++org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert ++org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert ++org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert ++org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert ++org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert ++org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert ++org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert ++org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert ++org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert ++org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert ++org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert ++org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert ++org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert ++org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert ++org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert ++org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert ++org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert ++org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert ++org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert ++org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert ++org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert ++org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert ++org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert ++org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert ++org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert ++org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert ++org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert ++org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert ++org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert ++org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert ++org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert ++org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert ++org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert ++org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert ++org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert ++org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert ++org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert ++org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert ++org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert ++org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert ++org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert ++org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert ++org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert ++org.eclipse.jdt.core.formatter.insert_space_before_logical_operator=insert ++org.eclipse.jdt.core.formatter.insert_space_before_multiplicative_operator=insert ++org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert ++org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert ++org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert ++org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert ++org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert ++org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert ++org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert ++org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert ++org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert ++org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert ++org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert ++org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert ++org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert ++org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert ++org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert ++org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert ++org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert ++org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert ++org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert ++org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert ++org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert ++org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert ++org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert ++org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert ++org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert ++org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert ++org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert ++org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert ++org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert ++org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert ++org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert ++org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert ++org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert ++org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert ++org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert ++org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert ++org.eclipse.jdt.core.formatter.insert_space_before_relational_operator=insert ++org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert ++org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert ++org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert ++org.eclipse.jdt.core.formatter.insert_space_before_shift_operator=insert ++org.eclipse.jdt.core.formatter.insert_space_before_string_concatenation=insert ++org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert ++org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert ++org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert ++org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert ++org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert ++org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert ++org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert ++org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert ++org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert ++org.eclipse.jdt.core.formatter.join_lines_in_comments=true ++org.eclipse.jdt.core.formatter.join_wrapped_lines=true ++org.eclipse.jdt.core.formatter.keep_annotation_declaration_on_one_line=one_line_never ++org.eclipse.jdt.core.formatter.keep_anonymous_type_declaration_on_one_line=one_line_never ++org.eclipse.jdt.core.formatter.keep_code_block_on_one_line=one_line_never ++org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false ++org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false ++org.eclipse.jdt.core.formatter.keep_enum_constant_declaration_on_one_line=one_line_never ++org.eclipse.jdt.core.formatter.keep_enum_declaration_on_one_line=one_line_never ++org.eclipse.jdt.core.formatter.keep_if_then_body_block_on_one_line=one_line_never ++org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false ++org.eclipse.jdt.core.formatter.keep_lambda_body_block_on_one_line=one_line_never ++org.eclipse.jdt.core.formatter.keep_loop_body_block_on_one_line=one_line_never ++org.eclipse.jdt.core.formatter.keep_method_body_on_one_line=one_line_never ++org.eclipse.jdt.core.formatter.keep_simple_do_while_body_on_same_line=false ++org.eclipse.jdt.core.formatter.keep_simple_for_body_on_same_line=false ++org.eclipse.jdt.core.formatter.keep_simple_getter_setter_on_one_line=false ++org.eclipse.jdt.core.formatter.keep_simple_while_body_on_same_line=false ++org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false ++org.eclipse.jdt.core.formatter.keep_type_declaration_on_one_line=one_line_never ++org.eclipse.jdt.core.formatter.lineSplit=140 ++org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false ++org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false ++org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 ++org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 ++org.eclipse.jdt.core.formatter.parentheses_positions_in_annotation=common_lines ++org.eclipse.jdt.core.formatter.parentheses_positions_in_catch_clause=common_lines ++org.eclipse.jdt.core.formatter.parentheses_positions_in_enum_constant_declaration=common_lines ++org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment=common_lines ++org.eclipse.jdt.core.formatter.parentheses_positions_in_if_while_statement=common_lines ++org.eclipse.jdt.core.formatter.parentheses_positions_in_lambda_declaration=common_lines ++org.eclipse.jdt.core.formatter.parentheses_positions_in_method_delcaration=common_lines ++org.eclipse.jdt.core.formatter.parentheses_positions_in_method_invocation=common_lines ++org.eclipse.jdt.core.formatter.parentheses_positions_in_switch_statement=common_lines ++org.eclipse.jdt.core.formatter.parentheses_positions_in_try_clause=common_lines ++org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true ++org.eclipse.jdt.core.formatter.tabulation.char=tab ++org.eclipse.jdt.core.formatter.tabulation.size=4 ++org.eclipse.jdt.core.formatter.use_on_off_tags=true ++org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false ++org.eclipse.jdt.core.formatter.wrap_before_additive_operator=true ++org.eclipse.jdt.core.formatter.wrap_before_assignment_operator=false ++org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true ++org.eclipse.jdt.core.formatter.wrap_before_bitwise_operator=true ++org.eclipse.jdt.core.formatter.wrap_before_conditional_operator=true ++org.eclipse.jdt.core.formatter.wrap_before_logical_operator=true ++org.eclipse.jdt.core.formatter.wrap_before_multiplicative_operator=true ++org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true ++org.eclipse.jdt.core.formatter.wrap_before_relational_operator=true ++org.eclipse.jdt.core.formatter.wrap_before_shift_operator=true ++org.eclipse.jdt.core.formatter.wrap_before_string_concatenation=true ++org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true ++org.eclipse.jdt.core.javaFormatter=org.eclipse.jdt.core.defaultJavaFormatter diff --cc era.mi/src/era/mi/logic/Simulation.java index 00000000,ca2c9e92..0468ec1e mode 000000,100644..100644 --- a/era.mi/src/era/mi/logic/Simulation.java +++ b/era.mi/src/era/mi/logic/Simulation.java @@@ -1,0 -1,9 +1,9 @@@ -package era.mi.logic; - -import era.mi.logic.timeline.Timeline; - -public class Simulation -{ - public final static Timeline TIMELINE = new Timeline(11); - ++package era.mi.logic; ++ ++import era.mi.logic.timeline.Timeline; ++ ++public class Simulation ++{ ++ public final static Timeline TIMELINE = new Timeline(11); ++ + } diff --cc era.mi/src/era/mi/logic/Util.java index 00000000,05671387..d621a44c mode 000000,100644..100644 --- a/era.mi/src/era/mi/logic/Util.java +++ b/era.mi/src/era/mi/logic/Util.java @@@ -1,0 -1,110 +1,110 @@@ -package era.mi.logic; - -import java.util.Arrays; - -import era.mi.logic.types.Bit; - -public final class Util -{ - - @SuppressWarnings("unchecked") - public static T[] concat(T[]... arrays) - { - if (arrays.length == 0) - throw new IllegalArgumentException("Cannot concatenate 0 arrays."); - - int length = 0; - for (T[] array : arrays) - length += array.length; - - T[] newArray = Arrays.copyOf(arrays[0], length); - int appendIndex = arrays[0].length; - for (int i = 1; i < arrays.length; i++) - { - System.arraycopy(arrays[i], 0, newArray, appendIndex, arrays[i].length); - appendIndex += arrays[i].length; - } - - return newArray; - } - -// @SuppressWarnings("unchecked") -// public static T[][] split(T[] array, int... lengths) -// { -// //TODO: implement array split again; This version contains an illegal cast -// int totalLength = 0; -// for(int length : lengths) -// totalLength += length; -// -// if(totalLength != array.length) -// throw new IllegalArgumentException(); //TODO: add proper error message -// -// Object[][] newArray = new Object[lengths.length][]; -// int splitIndex = 0; -// for(int i = 0; i < lengths.length; i++) -// { -// System.arraycopy(array, splitIndex, newArray, 0, lengths[i]); -// splitIndex += lengths[i]; -// } -// -// return (T[][]) newArray; -// } - - public static Bit[] and(Bit[] a, Bit[] b) - { - return binBitOp(a, b, Bit::and); - } - - public static Bit[] or(Bit[] a, Bit[] b) - { - return binBitOp(a, b, Bit::or); - } - - public static Bit[] xor(Bit[] a, Bit[] b) - { - return binBitOp(a, b, Bit::xor); - } - - private static Bit[] binBitOp(Bit[] a, Bit[] b, BitOp op) - { - if (a.length != b.length) - throw new IllegalArgumentException("Bit Arrays were not of equal length."); - Bit[] out = new Bit[a.length]; - for (int i = 0; i < a.length; i++) - { - out[i] = op.execute(a[i], b[i]); - } - return out; - } - - public static Bit[] not(Bit[] a) - { - Bit[] out = new Bit[a.length]; - for (int i = 0; i < a.length; i++) - { - out[i] = a[i].not(); - } - return out; - } - - /** - * uses the {@link Bit#combineWith(Bit)} method, does not create a new array, the result is stored in the first array. - * - * @author Christian Femers - */ - public static Bit[] combineInto(Bit[] dest, Bit[] addition) - { - if (dest.length != addition.length) - throw new IllegalArgumentException("Bit Arrays were not of equal length."); - for (int i = 0; i < addition.length; i++) - { - dest[i] = dest[i].join(addition[i]); - } - return dest; - } - - interface BitOp - { - Bit execute(Bit a, Bit b); - } -} ++package era.mi.logic; ++ ++import java.util.Arrays; ++ ++import era.mi.logic.types.Bit; ++ ++public final class Util ++{ ++ ++ @SuppressWarnings("unchecked") ++ public static T[] concat(T[]... arrays) ++ { ++ if (arrays.length == 0) ++ throw new IllegalArgumentException("Cannot concatenate 0 arrays."); ++ ++ int length = 0; ++ for (T[] array : arrays) ++ length += array.length; ++ ++ T[] newArray = Arrays.copyOf(arrays[0], length); ++ int appendIndex = arrays[0].length; ++ for (int i = 1; i < arrays.length; i++) ++ { ++ System.arraycopy(arrays[i], 0, newArray, appendIndex, arrays[i].length); ++ appendIndex += arrays[i].length; ++ } ++ ++ return newArray; ++ } ++ ++// @SuppressWarnings("unchecked") ++// public static T[][] split(T[] array, int... lengths) ++// { ++// //TODO: implement array split again; This version contains an illegal cast ++// int totalLength = 0; ++// for(int length : lengths) ++// totalLength += length; ++// ++// if(totalLength != array.length) ++// throw new IllegalArgumentException(); //TODO: add proper error message ++// ++// Object[][] newArray = new Object[lengths.length][]; ++// int splitIndex = 0; ++// for(int i = 0; i < lengths.length; i++) ++// { ++// System.arraycopy(array, splitIndex, newArray, 0, lengths[i]); ++// splitIndex += lengths[i]; ++// } ++// ++// return (T[][]) newArray; ++// } ++ ++ public static Bit[] and(Bit[] a, Bit[] b) ++ { ++ return binBitOp(a, b, Bit::and); ++ } ++ ++ public static Bit[] or(Bit[] a, Bit[] b) ++ { ++ return binBitOp(a, b, Bit::or); ++ } ++ ++ public static Bit[] xor(Bit[] a, Bit[] b) ++ { ++ return binBitOp(a, b, Bit::xor); ++ } ++ ++ private static Bit[] binBitOp(Bit[] a, Bit[] b, BitOp op) ++ { ++ if (a.length != b.length) ++ throw new IllegalArgumentException("Bit Arrays were not of equal length."); ++ Bit[] out = new Bit[a.length]; ++ for (int i = 0; i < a.length; i++) ++ { ++ out[i] = op.execute(a[i], b[i]); ++ } ++ return out; ++ } ++ ++ public static Bit[] not(Bit[] a) ++ { ++ Bit[] out = new Bit[a.length]; ++ for (int i = 0; i < a.length; i++) ++ { ++ out[i] = a[i].not(); ++ } ++ return out; ++ } ++ ++ /** ++ * uses the {@link Bit#combineWith(Bit)} method, does not create a new array, the result is stored in the first array. ++ * ++ * @author Christian Femers ++ */ ++ public static Bit[] combineInto(Bit[] dest, Bit[] addition) ++ { ++ if (dest.length != addition.length) ++ throw new IllegalArgumentException("Bit Arrays were not of equal length."); ++ for (int i = 0; i < addition.length; i++) ++ { ++ dest[i] = dest[i].join(addition[i]); ++ } ++ return dest; ++ } ++ ++ interface BitOp ++ { ++ Bit execute(Bit a, Bit b); ++ } ++} diff --cc era.mi/src/era/mi/logic/components/BasicComponent.java index 00000000,61935d15..e6952838 mode 000000,100644..100644 --- a/era.mi/src/era/mi/logic/components/BasicComponent.java +++ b/era.mi/src/era/mi/logic/components/BasicComponent.java @@@ -1,0 -1,35 +1,35 @@@ -package era.mi.logic.components; - -import era.mi.logic.Simulation; -import era.mi.logic.types.BitVector; -import era.mi.logic.wires.Wire; -import era.mi.logic.wires.WireObserver; - -/** - * A basic component that recomputes all outputs (with a delay), when it is updated. - * - * @author Fabian Stemmler - */ -public abstract class BasicComponent implements WireObserver, Component -{ - private int processTime; - - /** - * - * @param processTime Amount of time this component takes to update its outputs. Must be more than 0, otherwise 1 is assumed. - * - * @author Fabian Stemmler - */ - public BasicComponent(int processTime) - { - this.processTime = processTime > 0 ? processTime : 1; - } - - @Override - public void update(Wire initiator, BitVector oldValues) - { - Simulation.TIMELINE.addEvent(e -> compute(), processTime); - } - - protected abstract void compute(); -} ++package era.mi.logic.components; ++ ++import era.mi.logic.Simulation; ++import era.mi.logic.types.BitVector; ++import era.mi.logic.wires.Wire; ++import era.mi.logic.wires.WireObserver; ++ ++/** ++ * A basic component that recomputes all outputs (with a delay), when it is updated. ++ * ++ * @author Fabian Stemmler ++ */ ++public abstract class BasicComponent implements WireObserver, Component ++{ ++ private int processTime; ++ ++ /** ++ * ++ * @param processTime Amount of time this component takes to update its outputs. Must be more than 0, otherwise 1 is assumed. ++ * ++ * @author Fabian Stemmler ++ */ ++ public BasicComponent(int processTime) ++ { ++ this.processTime = processTime > 0 ? processTime : 1; ++ } ++ ++ @Override ++ public void update(Wire initiator, BitVector oldValues) ++ { ++ Simulation.TIMELINE.addEvent(e -> compute(), processTime); ++ } ++ ++ protected abstract void compute(); ++} diff --cc era.mi/src/era/mi/logic/components/BitDisplay.java index 00000000,f11fdf86..971eb7a7 mode 000000,100644..100644 --- a/era.mi/src/era/mi/logic/components/BitDisplay.java +++ b/era.mi/src/era/mi/logic/components/BitDisplay.java @@@ -1,0 -1,49 +1,49 @@@ -package era.mi.logic.components; - -import java.util.List; - -import era.mi.logic.types.Bit; -import era.mi.logic.types.BitVector; -import era.mi.logic.wires.Wire.WireEnd; - -public class BitDisplay extends BasicComponent -{ - private final WireEnd in; - private BitVector displayedValue; - - public BitDisplay(WireEnd in) - { - super(1); - this.in = in; - in.addObserver(this); - compute(); - } - - @Override - protected void compute() - { - displayedValue = in.getValues(); - } - - public BitVector getDisplayedValue() - { - return displayedValue; - } - - public boolean isDisplaying(Bit... values) - { - return displayedValue.equals(BitVector.of(values)); - } - - @Override - public List getAllInputs() - { - return List.of(in); - } - - @Override - public List getAllOutputs() - { - return List.of(); - } -} ++package era.mi.logic.components; ++ ++import java.util.List; ++ ++import era.mi.logic.types.Bit; ++import era.mi.logic.types.BitVector; ++import era.mi.logic.wires.Wire.WireEnd; ++ ++public class BitDisplay extends BasicComponent ++{ ++ private final WireEnd in; ++ private BitVector displayedValue; ++ ++ public BitDisplay(WireEnd in) ++ { ++ super(1); ++ this.in = in; ++ in.addObserver(this); ++ compute(); ++ } ++ ++ @Override ++ protected void compute() ++ { ++ displayedValue = in.getValues(); ++ } ++ ++ public BitVector getDisplayedValue() ++ { ++ return displayedValue; ++ } ++ ++ public boolean isDisplaying(Bit... values) ++ { ++ return displayedValue.equals(BitVector.of(values)); ++ } ++ ++ @Override ++ public List getAllInputs() ++ { ++ return List.of(in); ++ } ++ ++ @Override ++ public List getAllOutputs() ++ { ++ return List.of(); ++ } ++} diff --cc era.mi/src/era/mi/logic/components/Clock.java index 00000000,a31f20c8..07419b46 mode 000000,100644..100644 --- a/era.mi/src/era/mi/logic/components/Clock.java +++ b/era.mi/src/era/mi/logic/components/Clock.java @@@ -1,0 -1,59 +1,59 @@@ -package era.mi.logic.components; - -import java.util.List; - -import era.mi.logic.Simulation; -import era.mi.logic.timeline.TimelineEvent; -import era.mi.logic.timeline.TimelineEventHandler; -import era.mi.logic.types.Bit; -import era.mi.logic.wires.Wire; -import era.mi.logic.wires.Wire.WireEnd; - -public class Clock implements TimelineEventHandler, Component -{ - private boolean toggle = false; - private WireEnd out; - private int delta; - - /** - * - * @param out {@link Wire} the clock's impulses are fed into - * @param delta ticks between rising and falling edge - */ - public Clock(WireEnd out, int delta) - { - this.delta = delta; - this.out = out; - addToTimeline(); - } - - @Override - public void handle(TimelineEvent e) - { - addToTimeline(); - out.feedSignals(toggle ? Bit.ONE : Bit.ZERO); - toggle = !toggle; - } - - public WireEnd getOut() - { - return out; - } - - private void addToTimeline() - { - Simulation.TIMELINE.addEvent(this, delta); - } - - @Override - public List getAllInputs() - { - return List.of(); - } - - @Override - public List getAllOutputs() - { - return List.of(out); - } -} ++package era.mi.logic.components; ++ ++import java.util.List; ++ ++import era.mi.logic.Simulation; ++import era.mi.logic.timeline.TimelineEvent; ++import era.mi.logic.timeline.TimelineEventHandler; ++import era.mi.logic.types.Bit; ++import era.mi.logic.wires.Wire; ++import era.mi.logic.wires.Wire.WireEnd; ++ ++public class Clock implements TimelineEventHandler, Component ++{ ++ private boolean toggle = false; ++ private WireEnd out; ++ private int delta; ++ ++ /** ++ * ++ * @param out {@link Wire} the clock's impulses are fed into ++ * @param delta ticks between rising and falling edge ++ */ ++ public Clock(WireEnd out, int delta) ++ { ++ this.delta = delta; ++ this.out = out; ++ addToTimeline(); ++ } ++ ++ @Override ++ public void handle(TimelineEvent e) ++ { ++ addToTimeline(); ++ out.feedSignals(toggle ? Bit.ONE : Bit.ZERO); ++ toggle = !toggle; ++ } ++ ++ public WireEnd getOut() ++ { ++ return out; ++ } ++ ++ private void addToTimeline() ++ { ++ Simulation.TIMELINE.addEvent(this, delta); ++ } ++ ++ @Override ++ public List getAllInputs() ++ { ++ return List.of(); ++ } ++ ++ @Override ++ public List getAllOutputs() ++ { ++ return List.of(out); ++ } ++} diff --cc era.mi/src/era/mi/logic/components/Merger.java index 00000000,32321597..34ba217c mode 000000,100644..100644 --- a/era.mi/src/era/mi/logic/components/Merger.java +++ b/era.mi/src/era/mi/logic/components/Merger.java @@@ -1,0 -1,82 +1,82 @@@ -package era.mi.logic.components; - -import java.util.List; - -import era.mi.logic.types.BitVector; -import era.mi.logic.wires.Wire; -import era.mi.logic.wires.Wire.WireEnd; -import era.mi.logic.wires.WireObserver; - -public class Merger implements WireObserver, Component -{ - private WireEnd out; - private WireEnd[] inputs; - private int[] beginningIndex; - - /** - * - * @param union The output of merging n {@link Wire}s into one. Must have length = a1.length() + a2.length() + ... + an.length(). - * @param inputs The inputs to be merged into the union - */ - public Merger(WireEnd union, WireEnd... inputs) - { - this.inputs = inputs; - this.out = union; - this.beginningIndex = new int[inputs.length]; - - int length = 0; - for (int i = 0; i < inputs.length; i++) - { - beginningIndex[i] = length; - length += inputs[i].length(); - inputs[i].addObserver(this); - } - - if (length != union.length()) - throw new IllegalArgumentException( - "The output of merging n WireArrays into one must have length = a1.length() + a2.length() + ... + an.length()."); - } - - public WireEnd getInput(int index) - { - return inputs[index]; - } - - public WireEnd getUnion() - { - return out; - } - - @Override - public void update(Wire initiator, BitVector oldValues) - { - int index = find(initiator); - int beginning = beginningIndex[index]; - out.feedSignals(beginning, inputs[index].getValues()); - } - - private int find(Wire w) - { - for (int i = 0; i < inputs.length; i++) - if (inputs[i].getWire() == w) - return i; - return -1; - } - - public WireEnd[] getInputs() - { - return inputs.clone(); - } - - @Override - public List getAllInputs() - { - return List.of(inputs); - } - - @Override - public List getAllOutputs() - { - return List.of(out); - } -} ++package era.mi.logic.components; ++ ++import java.util.List; ++ ++import era.mi.logic.types.BitVector; ++import era.mi.logic.wires.Wire; ++import era.mi.logic.wires.Wire.WireEnd; ++import era.mi.logic.wires.WireObserver; ++ ++public class Merger implements WireObserver, Component ++{ ++ private WireEnd out; ++ private WireEnd[] inputs; ++ private int[] beginningIndex; ++ ++ /** ++ * ++ * @param union The output of merging n {@link Wire}s into one. Must have length = a1.length() + a2.length() + ... + an.length(). ++ * @param inputs The inputs to be merged into the union ++ */ ++ public Merger(WireEnd union, WireEnd... inputs) ++ { ++ this.inputs = inputs; ++ this.out = union; ++ this.beginningIndex = new int[inputs.length]; ++ ++ int length = 0; ++ for (int i = 0; i < inputs.length; i++) ++ { ++ beginningIndex[i] = length; ++ length += inputs[i].length(); ++ inputs[i].addObserver(this); ++ } ++ ++ if (length != union.length()) ++ throw new IllegalArgumentException( ++ "The output of merging n WireArrays into one must have length = a1.length() + a2.length() + ... + an.length()."); ++ } ++ ++ public WireEnd getInput(int index) ++ { ++ return inputs[index]; ++ } ++ ++ public WireEnd getUnion() ++ { ++ return out; ++ } ++ ++ @Override ++ public void update(Wire initiator, BitVector oldValues) ++ { ++ int index = find(initiator); ++ int beginning = beginningIndex[index]; ++ out.feedSignals(beginning, inputs[index].getValues()); ++ } ++ ++ private int find(Wire w) ++ { ++ for (int i = 0; i < inputs.length; i++) ++ if (inputs[i].getWire() == w) ++ return i; ++ return -1; ++ } ++ ++ public WireEnd[] getInputs() ++ { ++ return inputs.clone(); ++ } ++ ++ @Override ++ public List getAllInputs() ++ { ++ return List.of(inputs); ++ } ++ ++ @Override ++ public List getAllOutputs() ++ { ++ return List.of(out); ++ } ++} diff --cc era.mi/src/era/mi/logic/components/Mux.java index 00000000,675c070a..aea71166 mode 000000,100644..100644 --- a/era.mi/src/era/mi/logic/components/Mux.java +++ b/era.mi/src/era/mi/logic/components/Mux.java @@@ -1,0 -1,93 +1,93 @@@ -package era.mi.logic.components; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; - -import era.mi.logic.wires.Wire; -import era.mi.logic.wires.Wire.WireEnd; - -/** - * Models a multiplexer. Takes an arbitrary amount of input {@link Wire}s, one of which, as determined by select, is put through to the - * output. - * - * @author Fabian Stemmler - * - */ -public class Mux extends BasicComponent -{ - private WireEnd select; - private WireEnd out; - private WireEnd[] inputs; - private final int outputSize; - - /** - * Input {@link Wire}s and out must be of uniform length - * - * @param out Must be of uniform length with all inputs. - * @param select Indexes the input array which is to be mapped to the output. Must have enough bits to index all inputs. - * @param inputs One of these inputs is mapped to the output, depending on the select bits - */ - public Mux(int processTime, WireEnd out, WireEnd select, WireEnd... inputs) - { - super(processTime); - outputSize = out.length(); - - this.inputs = inputs.clone(); - for (int i = 0; i < this.inputs.length; i++) - { - if (inputs[i].length() != outputSize) - throw new IllegalArgumentException("All MUX wire arrays must be of uniform length!"); - inputs[i].addObserver(this); - } - - this.select = select; - select.addObserver(this); - - int maxInputs = 1 << select.length(); - if (this.inputs.length > maxInputs) - throw new IllegalArgumentException("There are more inputs (" + this.inputs.length + ") to the MUX than supported by " - + select.length() + " select bits (" + maxInputs + ")."); - - this.out = out; - } - - public WireEnd getOut() - { - return out; - } - - public WireEnd getSelect() - { - return select; - } - - @Override - public void compute() - { - int selectValue; - if (!select.hasNumericValue() || (selectValue = (int) select.getUnsignedValue()) >= inputs.length) - { - out.clearSignals(); - return; - } - - WireEnd active = inputs[selectValue]; - out.feedSignals(active.getValues()); - } - - @Override - public List getAllInputs() - { - ArrayList wires = new ArrayList(Arrays.asList(inputs)); - wires.add(select); - return Collections.unmodifiableList(wires); - } - - @Override - public List getAllOutputs() - { - return List.of(out); - } -} ++package era.mi.logic.components; ++ ++import java.util.ArrayList; ++import java.util.Arrays; ++import java.util.Collections; ++import java.util.List; ++ ++import era.mi.logic.wires.Wire; ++import era.mi.logic.wires.Wire.WireEnd; ++ ++/** ++ * Models a multiplexer. Takes an arbitrary amount of input {@link Wire}s, one of which, as determined by select, is put through to the ++ * output. ++ * ++ * @author Fabian Stemmler ++ * ++ */ ++public class Mux extends BasicComponent ++{ ++ private WireEnd select; ++ private WireEnd out; ++ private WireEnd[] inputs; ++ private final int outputSize; ++ ++ /** ++ * Input {@link Wire}s and out must be of uniform length ++ * ++ * @param out Must be of uniform length with all inputs. ++ * @param select Indexes the input array which is to be mapped to the output. Must have enough bits to index all inputs. ++ * @param inputs One of these inputs is mapped to the output, depending on the select bits ++ */ ++ public Mux(int processTime, WireEnd out, WireEnd select, WireEnd... inputs) ++ { ++ super(processTime); ++ outputSize = out.length(); ++ ++ this.inputs = inputs.clone(); ++ for (int i = 0; i < this.inputs.length; i++) ++ { ++ if (inputs[i].length() != outputSize) ++ throw new IllegalArgumentException("All MUX wire arrays must be of uniform length!"); ++ inputs[i].addObserver(this); ++ } ++ ++ this.select = select; ++ select.addObserver(this); ++ ++ int maxInputs = 1 << select.length(); ++ if (this.inputs.length > maxInputs) ++ throw new IllegalArgumentException("There are more inputs (" + this.inputs.length + ") to the MUX than supported by " ++ + select.length() + " select bits (" + maxInputs + ")."); ++ ++ this.out = out; ++ } ++ ++ public WireEnd getOut() ++ { ++ return out; ++ } ++ ++ public WireEnd getSelect() ++ { ++ return select; ++ } ++ ++ @Override ++ public void compute() ++ { ++ int selectValue; ++ if (!select.hasNumericValue() || (selectValue = (int) select.getUnsignedValue()) >= inputs.length) ++ { ++ out.clearSignals(); ++ return; ++ } ++ ++ WireEnd active = inputs[selectValue]; ++ out.feedSignals(active.getValues()); ++ } ++ ++ @Override ++ public List getAllInputs() ++ { ++ ArrayList wires = new ArrayList(Arrays.asList(inputs)); ++ wires.add(select); ++ return Collections.unmodifiableList(wires); ++ } ++ ++ @Override ++ public List getAllOutputs() ++ { ++ return List.of(out); ++ } ++} diff --cc era.mi/src/era/mi/logic/components/Splitter.java index 00000000,e936c82e..4764c27a mode 000000,100644..100644 --- a/era.mi/src/era/mi/logic/components/Splitter.java +++ b/era.mi/src/era/mi/logic/components/Splitter.java @@@ -1,0 -1,43 +1,43 @@@ -package era.mi.logic.components; - -import era.mi.logic.types.BitVector; -import era.mi.logic.wires.Wire; -import era.mi.logic.wires.Wire.WireEnd; -import era.mi.logic.wires.WireObserver; - -public class Splitter implements WireObserver -{ - private WireEnd input; - private WireEnd[] outputs; - - public Splitter(WireEnd input, WireEnd... outputs) - { - this.input = input; - this.outputs = outputs; - input.addObserver(this); - int length = 0; - for (WireEnd out : outputs) - length += out.length(); - - if (input.length() != length) - throw new IllegalArgumentException( - "The input of splitting one into n WireArrays must have length = a1.length() + a2.length() + ... + an.length()."); - } - - protected void compute() - { - BitVector inputBits = input.getValues(); - int startIndex = 0; - for (int i = 0; i < outputs.length; i++) - { - outputs[i].feedSignals(inputBits.subVector(startIndex, startIndex + outputs[i].length())); - startIndex += outputs[i].length(); - } - } - - @Override - public void update(Wire initiator, BitVector oldValues) - { - compute(); - } -} ++package era.mi.logic.components; ++ ++import era.mi.logic.types.BitVector; ++import era.mi.logic.wires.Wire; ++import era.mi.logic.wires.Wire.WireEnd; ++import era.mi.logic.wires.WireObserver; ++ ++public class Splitter implements WireObserver ++{ ++ private WireEnd input; ++ private WireEnd[] outputs; ++ ++ public Splitter(WireEnd input, WireEnd... outputs) ++ { ++ this.input = input; ++ this.outputs = outputs; ++ input.addObserver(this); ++ int length = 0; ++ for (WireEnd out : outputs) ++ length += out.length(); ++ ++ if (input.length() != length) ++ throw new IllegalArgumentException( ++ "The input of splitting one into n WireArrays must have length = a1.length() + a2.length() + ... + an.length()."); ++ } ++ ++ protected void compute() ++ { ++ BitVector inputBits = input.getValues(); ++ int startIndex = 0; ++ for (int i = 0; i < outputs.length; i++) ++ { ++ outputs[i].feedSignals(inputBits.subVector(startIndex, startIndex + outputs[i].length())); ++ startIndex += outputs[i].length(); ++ } ++ } ++ ++ @Override ++ public void update(Wire initiator, BitVector oldValues) ++ { ++ compute(); ++ } ++} diff --cc era.mi/src/era/mi/logic/components/gates/AndGate.java index 00000000,a24acc72..5da680e4 mode 000000,100644..100644 --- a/era.mi/src/era/mi/logic/components/gates/AndGate.java +++ b/era.mi/src/era/mi/logic/components/gates/AndGate.java @@@ -1,0 -1,12 +1,12 @@@ -package era.mi.logic.components.gates; - -import era.mi.logic.types.BitVector.BitVectorMutator; -import era.mi.logic.wires.Wire.WireEnd; - -public class AndGate extends MultiInputGate -{ - public AndGate(int processTime, WireEnd out, WireEnd... in) - { - super(processTime, BitVectorMutator::and, out, in); - } -} ++package era.mi.logic.components.gates; ++ ++import era.mi.logic.types.BitVector.BitVectorMutator; ++import era.mi.logic.wires.Wire.WireEnd; ++ ++public class AndGate extends MultiInputGate ++{ ++ public AndGate(int processTime, WireEnd out, WireEnd... in) ++ { ++ super(processTime, BitVectorMutator::and, out, in); ++ } ++} diff --cc era.mi/src/era/mi/logic/components/gates/NotGate.java index 00000000,7baf6066..1c0d8330 mode 000000,100644..100644 --- a/era.mi/src/era/mi/logic/components/gates/NotGate.java +++ b/era.mi/src/era/mi/logic/components/gates/NotGate.java @@@ -1,0 -1,48 +1,48 @@@ -package era.mi.logic.components.gates; - -import java.util.List; - -import era.mi.logic.components.BasicComponent; -import era.mi.logic.wires.Wire.WireEnd; - -public class NotGate extends BasicComponent -{ - private WireEnd in; - private WireEnd out; - - public NotGate(int processTime, WireEnd in, WireEnd out) - { - super(processTime); - this.in = in; - in.addObserver(this); - this.out = out; - } - - @Override - protected void compute() - { - out.feedSignals(in.getValues().not()); - } - - public WireEnd getIn() - { - return in; - } - - public WireEnd getOut() - { - return out; - } - - @Override - public List getAllInputs() - { - return List.of(in); - } - - @Override - public List getAllOutputs() - { - return List.of(out); - } -} ++package era.mi.logic.components.gates; ++ ++import java.util.List; ++ ++import era.mi.logic.components.BasicComponent; ++import era.mi.logic.wires.Wire.WireEnd; ++ ++public class NotGate extends BasicComponent ++{ ++ private WireEnd in; ++ private WireEnd out; ++ ++ public NotGate(int processTime, WireEnd in, WireEnd out) ++ { ++ super(processTime); ++ this.in = in; ++ in.addObserver(this); ++ this.out = out; ++ } ++ ++ @Override ++ protected void compute() ++ { ++ out.feedSignals(in.getValues().not()); ++ } ++ ++ public WireEnd getIn() ++ { ++ return in; ++ } ++ ++ public WireEnd getOut() ++ { ++ return out; ++ } ++ ++ @Override ++ public List getAllInputs() ++ { ++ return List.of(in); ++ } ++ ++ @Override ++ public List getAllOutputs() ++ { ++ return List.of(out); ++ } ++} diff --cc era.mi/src/era/mi/logic/components/gates/OrGate.java index 00000000,0a8047cb..8c1775fd mode 000000,100644..100644 --- a/era.mi/src/era/mi/logic/components/gates/OrGate.java +++ b/era.mi/src/era/mi/logic/components/gates/OrGate.java @@@ -1,0 -1,12 +1,12 @@@ -package era.mi.logic.components.gates; - -import era.mi.logic.types.BitVector.BitVectorMutator; -import era.mi.logic.wires.Wire.WireEnd; - -public class OrGate extends MultiInputGate -{ - public OrGate(int processTime, WireEnd out, WireEnd... in) - { - super(processTime, BitVectorMutator::or, out, in); - } -} ++package era.mi.logic.components.gates; ++ ++import era.mi.logic.types.BitVector.BitVectorMutator; ++import era.mi.logic.wires.Wire.WireEnd; ++ ++public class OrGate extends MultiInputGate ++{ ++ public OrGate(int processTime, WireEnd out, WireEnd... in) ++ { ++ super(processTime, BitVectorMutator::or, out, in); ++ } ++} diff --cc era.mi/src/era/mi/logic/components/gates/XorGate.java index 00000000,9311a1db..73a25568 mode 000000,100644..100644 --- a/era.mi/src/era/mi/logic/components/gates/XorGate.java +++ b/era.mi/src/era/mi/logic/components/gates/XorGate.java @@@ -1,0 -1,18 +1,18 @@@ -package era.mi.logic.components.gates; - -import era.mi.logic.types.BitVector.BitVectorMutator; -import era.mi.logic.wires.Wire.WireEnd; - -/** - * Outputs 1 when the number of 1 inputs is odd. - * - * @author Fabian Stemmler - */ -public class XorGate extends MultiInputGate -{ - public XorGate(int processTime, WireEnd out, WireEnd... in) - { - super(processTime, BitVectorMutator::xor, out, in); - } - -} ++package era.mi.logic.components.gates; ++ ++import era.mi.logic.types.BitVector.BitVectorMutator; ++import era.mi.logic.wires.Wire.WireEnd; ++ ++/** ++ * Outputs 1 when the number of 1 inputs is odd. ++ * ++ * @author Fabian Stemmler ++ */ ++public class XorGate extends MultiInputGate ++{ ++ public XorGate(int processTime, WireEnd out, WireEnd... in) ++ { ++ super(processTime, BitVectorMutator::xor, out, in); ++ } ++ ++} diff --cc era.mi/src/era/mi/logic/tests/ComponentTest.java index 00000000,d25de9e5..8a9bc5a4 mode 000000,100644..100644 --- a/era.mi/src/era/mi/logic/tests/ComponentTest.java +++ b/era.mi/src/era/mi/logic/tests/ComponentTest.java @@@ -1,0 -1,384 +1,384 @@@ -package era.mi.logic.tests; - -import static org.junit.jupiter.api.Assertions.*; - -import java.util.function.LongConsumer; - -import org.junit.jupiter.api.Test; - -import era.mi.logic.Simulation; -import era.mi.logic.components.Connector; -import era.mi.logic.components.Demux; -import era.mi.logic.components.Merger; -import era.mi.logic.components.Mux; -import era.mi.logic.components.Splitter; -import era.mi.logic.components.TriStateBuffer; -import era.mi.logic.components.gates.AndGate; -import era.mi.logic.components.gates.NotGate; -import era.mi.logic.components.gates.OrGate; -import era.mi.logic.components.gates.XorGate; -import era.mi.logic.types.Bit; -import era.mi.logic.types.BitVector; -import era.mi.logic.wires.Wire; -import era.mi.logic.wires.Wire.WireEnd; - -@SuppressWarnings("unused") -class ComponentTest -{ - - @Test - void circuitExampleTest() - { - Simulation.TIMELINE.reset(); - Wire a = new Wire(1, 1), b = new Wire(1, 1), c = new Wire(1, 10), d = new Wire(2, 1), e = new Wire(1, 1), f = new Wire(1, 1), - g = new Wire(1, 1), h = new Wire(2, 1), i = new Wire(2, 1), j = new Wire(1, 1), k = new Wire(1, 1); - new AndGate(1, f.createEnd(), a.createReadOnlyEnd(), b.createReadOnlyEnd()); - new NotGate(1, f.createReadOnlyEnd(), g.createEnd()); - new Merger(h.createEnd(), c.createReadOnlyEnd(), g.createReadOnlyEnd()); - new Mux(1, i.createEnd(), e.createReadOnlyEnd(), h.createReadOnlyEnd(), d.createReadOnlyEnd()); - new Splitter(i.createReadOnlyEnd(), k.createEnd(), j.createEnd()); - - a.createEnd().feedSignals(Bit.ZERO); - b.createEnd().feedSignals(Bit.ONE); - c.createEnd().feedSignals(Bit.ZERO); - d.createEnd().feedSignals(Bit.ONE, Bit.ONE); - e.createEnd().feedSignals(Bit.ZERO); - - Simulation.TIMELINE.executeAll(); - - assertEquals(Bit.ONE, j.getValue()); - assertEquals(Bit.ZERO, k.getValue()); - } - - @Test - void splitterTest() - { - Simulation.TIMELINE.reset(); - Wire a = new Wire(3, 1), b = new Wire(2, 1), c = new Wire(3, 1), in = new Wire(8, 1); - in.createEnd().feedSignals(Bit.ZERO, Bit.ONE, Bit.ZERO, Bit.ONE, Bit.ZERO, Bit.ONE, Bit.ZERO, Bit.ONE); - new Splitter(in.createReadOnlyEnd(), a.createEnd(), b.createEnd(), c.createEnd()); - - Simulation.TIMELINE.executeAll(); - - assertBitArrayEquals(a.getValues(), Bit.ZERO, Bit.ONE, Bit.ZERO); - assertBitArrayEquals(b.getValues(), Bit.ONE, Bit.ZERO); - assertBitArrayEquals(c.getValues(), Bit.ONE, Bit.ZERO, Bit.ONE); - } - - @Test - void mergerTest() - { - Simulation.TIMELINE.reset(); - Wire a = new Wire(3, 1), b = new Wire(2, 1), c = new Wire(3, 1), out = new Wire(8, 1); - a.createEnd().feedSignals(Bit.ZERO, Bit.ONE, Bit.ZERO); - b.createEnd().feedSignals(Bit.ONE, Bit.ZERO); - c.createEnd().feedSignals(Bit.ONE, Bit.ZERO, Bit.ONE); - - new Merger(out.createEnd(), a.createReadOnlyEnd(), b.createReadOnlyEnd(), c.createReadOnlyEnd()); - - Simulation.TIMELINE.executeAll(); - - assertBitArrayEquals(out.getValues(), Bit.ZERO, Bit.ONE, Bit.ZERO, Bit.ONE, Bit.ZERO, Bit.ONE, Bit.ZERO, Bit.ONE); - } - - @Test - void triStateBufferTest() - { - Wire a = new Wire(1, 1), b = new Wire(1, 1), en = new Wire(1, 1), notEn = new Wire(1, 1); - new NotGate(1, en.createReadOnlyEnd(), notEn.createEnd()); - new TriStateBuffer(1, a.createReadOnlyEnd(), b.createEnd(), en.createReadOnlyEnd()); - new TriStateBuffer(1, b.createReadOnlyEnd(), a.createEnd(), notEn.createReadOnlyEnd()); - - WireEnd enI = en.createEnd(), aI = a.createEnd(), bI = b.createEnd(); - enI.feedSignals(Bit.ONE); - aI.feedSignals(Bit.ONE); - bI.feedSignals(Bit.Z); - - Simulation.TIMELINE.executeAll(); - - assertEquals(Bit.ONE, b.getValue()); - - bI.feedSignals(Bit.ZERO); - - Simulation.TIMELINE.executeAll(); - - assertEquals(Bit.X, b.getValue()); - assertEquals(Bit.ONE, a.getValue()); - - aI.clearSignals(); - enI.feedSignals(Bit.ZERO); - - Simulation.TIMELINE.executeAll(); - - assertEquals(Bit.ZERO, a.getValue()); - - } - - @Test - void muxTest() - { - Simulation.TIMELINE.reset(); - Wire a = new Wire(4, 3), b = new Wire(4, 6), c = new Wire(4, 4), select = new Wire(2, 5), out = new Wire(4, 1); - WireEnd selectIn = select.createEnd(); - - selectIn.feedSignals(Bit.ZERO, Bit.ZERO); - a.createEnd().feedSignals(Bit.ONE, Bit.ZERO, Bit.ONE, Bit.ZERO); - c.createEnd().feedSignals(Bit.ZERO, Bit.ONE, Bit.ZERO, Bit.ONE); - - new Mux(1, out.createEnd(), select.createReadOnlyEnd(), a.createReadOnlyEnd(), b.createReadOnlyEnd(), c.createReadOnlyEnd()); - Simulation.TIMELINE.executeAll(); - - assertBitArrayEquals(out.getValues(), Bit.ONE, Bit.ZERO, Bit.ONE, Bit.ZERO); - selectIn.feedSignals(Bit.ZERO, Bit.ONE); - Simulation.TIMELINE.executeAll(); - - assertBitArrayEquals(out.getValues(), Bit.ZERO, Bit.ONE, Bit.ZERO, Bit.ONE); - - selectIn.feedSignals(Bit.ONE, Bit.ONE); - Simulation.TIMELINE.executeAll(); - - assertBitArrayEquals(out.getValues(), Bit.Z, Bit.Z, Bit.Z, Bit.Z); - - } - - @Test - void demuxTest() - { - Simulation.TIMELINE.reset(); - Wire a = new Wire(4, 3), b = new Wire(4, 6), c = new Wire(4, 4), select = new Wire(2, 5), in = new Wire(4, 1); - WireEnd selectIn = select.createEnd(); - - selectIn.feedSignals(Bit.ZERO, Bit.ZERO); - in.createEnd().feedSignals(Bit.ONE, Bit.ZERO, Bit.ONE, Bit.ZERO); - - new Demux(1, in.createReadOnlyEnd(), select.createReadOnlyEnd(), a.createEnd(), b.createEnd(), c.createEnd()); - Simulation.TIMELINE.executeAll(); - - assertBitArrayEquals(a.getValues(), Bit.ONE, Bit.ZERO, Bit.ONE, Bit.ZERO); - assertBitArrayEquals(b.getValues(), Bit.U, Bit.U, Bit.U, Bit.U); - assertBitArrayEquals(c.getValues(), Bit.U, Bit.U, Bit.U, Bit.U); - selectIn.feedSignals(Bit.ZERO, Bit.ONE); - Simulation.TIMELINE.executeAll(); - - assertBitArrayEquals(a.getValues(), Bit.Z, Bit.Z, Bit.Z, Bit.Z); - assertBitArrayEquals(b.getValues(), Bit.U, Bit.U, Bit.U, Bit.U); - assertBitArrayEquals(c.getValues(), Bit.ONE, Bit.ZERO, Bit.ONE, Bit.ZERO); - - selectIn.feedSignals(Bit.ONE, Bit.ONE); - Simulation.TIMELINE.executeAll(); - - assertBitArrayEquals(a.getValues(), Bit.Z, Bit.Z, Bit.Z, Bit.Z); - assertBitArrayEquals(b.getValues(), Bit.U, Bit.U, Bit.U, Bit.U); - assertBitArrayEquals(c.getValues(), Bit.Z, Bit.Z, Bit.Z, Bit.Z); - - } - - @Test - void andTest() - { - Simulation.TIMELINE.reset(); - Wire a = new Wire(4, 1), b = new Wire(4, 3), c = new Wire(4, 1); - new AndGate(1, c.createEnd(), a.createReadOnlyEnd(), b.createReadOnlyEnd()); - a.createEnd().feedSignals(Bit.ONE, Bit.ONE, Bit.ZERO, Bit.ZERO); - b.createEnd().feedSignals(Bit.ZERO, Bit.ONE, Bit.ZERO, Bit.ONE); - - Simulation.TIMELINE.executeAll(); - - assertBitArrayEquals(c.getValues(), Bit.ZERO, Bit.ONE, Bit.ZERO, Bit.ZERO); - } - - @Test - void orTest() - { - Simulation.TIMELINE.reset(); - Wire a = new Wire(4, 1), b = new Wire(4, 3), c = new Wire(4, 1); - new OrGate(1, c.createEnd(), a.createReadOnlyEnd(), b.createReadOnlyEnd()); - a.createEnd().feedSignals(Bit.ONE, Bit.ONE, Bit.ZERO, Bit.ZERO); - b.createEnd().feedSignals(Bit.ZERO, Bit.ONE, Bit.ZERO, Bit.ONE); - - Simulation.TIMELINE.executeAll(); - - assertBitArrayEquals(c.getValues(), Bit.ONE, Bit.ONE, Bit.ZERO, Bit.ONE); - } - - @Test - void xorTest() - { - Simulation.TIMELINE.reset(); - Wire a = new Wire(3, 1), b = new Wire(3, 2), c = new Wire(3, 1), d = new Wire(3, 1); - new XorGate(1, d.createEnd(), a.createReadOnlyEnd(), b.createReadOnlyEnd(), c.createReadOnlyEnd()); - a.createEnd().feedSignals(Bit.ZERO, Bit.ONE, Bit.ONE); - b.createEnd().feedSignals(Bit.ONE, Bit.ZERO, Bit.ONE); - c.createEnd().feedSignals(Bit.ONE, Bit.ZERO, Bit.ONE); - - Simulation.TIMELINE.executeAll(); - - assertBitArrayEquals(d.getValues(), Bit.ZERO, Bit.ONE, Bit.ONE); - } - - @Test - void notTest() - { - Simulation.TIMELINE.reset(); - Wire a = new Wire(3, 1), b = new Wire(3, 2); - new NotGate(1, a.createReadOnlyEnd(), b.createEnd()); - a.createEnd().feedSignals(Bit.ZERO, Bit.ONE, Bit.ONE); - - Simulation.TIMELINE.executeAll(); - - assertBitArrayEquals(b.getValues(), Bit.ONE, Bit.ZERO, Bit.ZERO); - } - - @Test - void rsLatchCircuitTest() - { - Simulation.TIMELINE.reset(); - Wire r = new Wire(1, 1), s = new Wire(1, 1), t1 = new Wire(1, 15), t2 = new Wire(1, 1), q = new Wire(1, 1), nq = new Wire(1, 1); - - new OrGate(1, t2.createEnd(), r.createReadOnlyEnd(), nq.createReadOnlyEnd()); - new OrGate(1, t1.createEnd(), s.createReadOnlyEnd(), q.createReadOnlyEnd()); - new NotGate(1, t2.createReadOnlyEnd(), q.createEnd()); - new NotGate(1, t1.createReadOnlyEnd(), nq.createEnd()); - - WireEnd sIn = s.createEnd(), rIn = r.createEnd(); - - sIn.feedSignals(Bit.ONE); - rIn.feedSignals(Bit.ZERO); - - Simulation.TIMELINE.executeAll(); - - assertEquals(Bit.ONE, q.getValue()); - assertEquals(Bit.ZERO, nq.getValue()); - - sIn.feedSignals(Bit.ZERO); - - Simulation.TIMELINE.executeAll(); - assertEquals(Bit.ONE, q.getValue()); - assertEquals(Bit.ZERO, nq.getValue()); - - rIn.feedSignals(Bit.ONE); - - Simulation.TIMELINE.executeAll(); - - assertEquals(Bit.ZERO, q.getValue()); - assertEquals(Bit.ONE, nq.getValue()); - } - - @Test - void numericValueTest() - { - Simulation.TIMELINE.reset(); - - Wire a = new Wire(4, 1); - a.createEnd().feedSignals(Bit.ONE, Bit.ONE, Bit.ONE, Bit.ONE); - - Simulation.TIMELINE.executeAll(); - - assertEquals(15, a.getUnsignedValue()); - assertEquals(-1, a.getSignedValue()); - } - - @Test - void multipleInputs() - { - Simulation.TIMELINE.reset(); - Wire w = new Wire(2, 1); - WireEnd wI1 = w.createEnd(), wI2 = w.createEnd(); - wI1.feedSignals(Bit.ONE, Bit.Z); - wI2.feedSignals(Bit.Z, Bit.X); - Simulation.TIMELINE.executeAll(); - assertBitArrayEquals(w.getValues(), Bit.ONE, Bit.X); - - wI2.feedSignals(Bit.ZERO, Bit.Z); - Simulation.TIMELINE.executeAll(); - assertBitArrayEquals(w.getValues(), Bit.X, Bit.Z); - - wI2.feedSignals(Bit.Z, Bit.Z); - Simulation.TIMELINE.executeAll(); - assertBitArrayEquals(w.getValues(), Bit.ONE, Bit.Z); - - wI2.feedSignals(Bit.ONE, Bit.Z); - w.addObserver((i, oldValues) -> fail("WireArray notified observer, although value did not change.")); - Simulation.TIMELINE.executeAll(); - assertBitArrayEquals(w.getValues(), Bit.ONE, Bit.Z); - } - - @Test - void wireConnections() - { - // Nur ein Experiment, was über mehrere 'passive' Bausteine hinweg passieren würde - - Simulation.TIMELINE.reset(); - - Wire a = new Wire(1, 2); - Wire b = new Wire(1, 2); - Wire c = new Wire(1, 2); - WireEnd aI = a.createEnd(); - WireEnd bI = b.createEnd(); - WireEnd cI = c.createEnd(); - - TestBitDisplay test = new TestBitDisplay(c.createReadOnlyEnd()); - TestBitDisplay test2 = new TestBitDisplay(a.createReadOnlyEnd()); - LongConsumer print = time -> System.out.format("Time %2d\n a: %s\n b: %s\n c: %s\n", time, a, b, c); - - cI.feedSignals(Bit.ONE); - test.assertAfterSimulationIs(print, Bit.ONE); - - cI.feedSignals(Bit.X); - test.assertAfterSimulationIs(print, Bit.X); - - cI.feedSignals(Bit.X); - cI.feedSignals(Bit.Z); - test.assertAfterSimulationIs(print, Bit.Z); - - new Connector(b.createEnd(), c.createEnd()).connect(); - test.assertAfterSimulationIs(print, Bit.Z); - System.err.println("ONE"); - bI.feedSignals(Bit.ONE); - test.assertAfterSimulationIs(print, Bit.ONE); - System.err.println("ZERO"); - bI.feedSignals(Bit.ZERO); - test.assertAfterSimulationIs(print, Bit.ZERO); - System.err.println("Z"); - bI.feedSignals(Bit.Z); - test.assertAfterSimulationIs(print, Bit.Z); - - new Connector(a.createEnd(), b.createEnd()).connect(); - System.err.println("Z 2"); - aI.feedSignals(Bit.Z); - test.assertAfterSimulationIs(print, Bit.Z); - test2.assertAfterSimulationIs(Bit.Z); - System.err.println("ONE 2"); - aI.feedSignals(Bit.ONE); - test.assertAfterSimulationIs(print, Bit.ONE); - test2.assertAfterSimulationIs(Bit.ONE); - System.err.println("ZERO 2"); - aI.feedSignals(Bit.ZERO); - test.assertAfterSimulationIs(print, Bit.ZERO); - test2.assertAfterSimulationIs(Bit.ZERO); - System.err.println("Z 2 II"); - aI.feedSignals(Bit.Z); - test.assertAfterSimulationIs(print, Bit.Z); - test2.assertAfterSimulationIs(Bit.Z); - - System.err.println("No Conflict yet"); - bI.feedSignals(Bit.ONE); - test.assertAfterSimulationIs(print, Bit.ONE); - test2.assertAfterSimulationIs(Bit.ONE); - aI.feedSignals(Bit.ONE); - test.assertAfterSimulationIs(print, Bit.ONE); - test2.assertAfterSimulationIs(Bit.ONE); - System.err.println("Conflict"); - aI.feedSignals(Bit.ZERO); - test.assertAfterSimulationIs(print, Bit.X); - test2.assertAfterSimulationIs(Bit.X); - aI.feedSignals(Bit.ONE); - test.assertAfterSimulationIs(print, Bit.ONE); - test2.assertAfterSimulationIs(Bit.ONE); - } - - private static void assertBitArrayEquals(BitVector actual, Bit... expected) - { - assertArrayEquals(expected, actual.getBits()); - } -} ++package era.mi.logic.tests; ++ ++import static org.junit.jupiter.api.Assertions.*; ++ ++import java.util.function.LongConsumer; ++ ++import org.junit.jupiter.api.Test; ++ ++import era.mi.logic.Simulation; ++import era.mi.logic.components.Connector; ++import era.mi.logic.components.Demux; ++import era.mi.logic.components.Merger; ++import era.mi.logic.components.Mux; ++import era.mi.logic.components.Splitter; ++import era.mi.logic.components.TriStateBuffer; ++import era.mi.logic.components.gates.AndGate; ++import era.mi.logic.components.gates.NotGate; ++import era.mi.logic.components.gates.OrGate; ++import era.mi.logic.components.gates.XorGate; ++import era.mi.logic.types.Bit; ++import era.mi.logic.types.BitVector; ++import era.mi.logic.wires.Wire; ++import era.mi.logic.wires.Wire.WireEnd; ++ ++@SuppressWarnings("unused") ++class ComponentTest ++{ ++ ++ @Test ++ void circuitExampleTest() ++ { ++ Simulation.TIMELINE.reset(); ++ Wire a = new Wire(1, 1), b = new Wire(1, 1), c = new Wire(1, 10), d = new Wire(2, 1), e = new Wire(1, 1), f = new Wire(1, 1), ++ g = new Wire(1, 1), h = new Wire(2, 1), i = new Wire(2, 1), j = new Wire(1, 1), k = new Wire(1, 1); ++ new AndGate(1, f.createEnd(), a.createReadOnlyEnd(), b.createReadOnlyEnd()); ++ new NotGate(1, f.createReadOnlyEnd(), g.createEnd()); ++ new Merger(h.createEnd(), c.createReadOnlyEnd(), g.createReadOnlyEnd()); ++ new Mux(1, i.createEnd(), e.createReadOnlyEnd(), h.createReadOnlyEnd(), d.createReadOnlyEnd()); ++ new Splitter(i.createReadOnlyEnd(), k.createEnd(), j.createEnd()); ++ ++ a.createEnd().feedSignals(Bit.ZERO); ++ b.createEnd().feedSignals(Bit.ONE); ++ c.createEnd().feedSignals(Bit.ZERO); ++ d.createEnd().feedSignals(Bit.ONE, Bit.ONE); ++ e.createEnd().feedSignals(Bit.ZERO); ++ ++ Simulation.TIMELINE.executeAll(); ++ ++ assertEquals(Bit.ONE, j.getValue()); ++ assertEquals(Bit.ZERO, k.getValue()); ++ } ++ ++ @Test ++ void splitterTest() ++ { ++ Simulation.TIMELINE.reset(); ++ Wire a = new Wire(3, 1), b = new Wire(2, 1), c = new Wire(3, 1), in = new Wire(8, 1); ++ in.createEnd().feedSignals(Bit.ZERO, Bit.ONE, Bit.ZERO, Bit.ONE, Bit.ZERO, Bit.ONE, Bit.ZERO, Bit.ONE); ++ new Splitter(in.createReadOnlyEnd(), a.createEnd(), b.createEnd(), c.createEnd()); ++ ++ Simulation.TIMELINE.executeAll(); ++ ++ assertBitArrayEquals(a.getValues(), Bit.ZERO, Bit.ONE, Bit.ZERO); ++ assertBitArrayEquals(b.getValues(), Bit.ONE, Bit.ZERO); ++ assertBitArrayEquals(c.getValues(), Bit.ONE, Bit.ZERO, Bit.ONE); ++ } ++ ++ @Test ++ void mergerTest() ++ { ++ Simulation.TIMELINE.reset(); ++ Wire a = new Wire(3, 1), b = new Wire(2, 1), c = new Wire(3, 1), out = new Wire(8, 1); ++ a.createEnd().feedSignals(Bit.ZERO, Bit.ONE, Bit.ZERO); ++ b.createEnd().feedSignals(Bit.ONE, Bit.ZERO); ++ c.createEnd().feedSignals(Bit.ONE, Bit.ZERO, Bit.ONE); ++ ++ new Merger(out.createEnd(), a.createReadOnlyEnd(), b.createReadOnlyEnd(), c.createReadOnlyEnd()); ++ ++ Simulation.TIMELINE.executeAll(); ++ ++ assertBitArrayEquals(out.getValues(), Bit.ZERO, Bit.ONE, Bit.ZERO, Bit.ONE, Bit.ZERO, Bit.ONE, Bit.ZERO, Bit.ONE); ++ } ++ ++ @Test ++ void triStateBufferTest() ++ { ++ Wire a = new Wire(1, 1), b = new Wire(1, 1), en = new Wire(1, 1), notEn = new Wire(1, 1); ++ new NotGate(1, en.createReadOnlyEnd(), notEn.createEnd()); ++ new TriStateBuffer(1, a.createReadOnlyEnd(), b.createEnd(), en.createReadOnlyEnd()); ++ new TriStateBuffer(1, b.createReadOnlyEnd(), a.createEnd(), notEn.createReadOnlyEnd()); ++ ++ WireEnd enI = en.createEnd(), aI = a.createEnd(), bI = b.createEnd(); ++ enI.feedSignals(Bit.ONE); ++ aI.feedSignals(Bit.ONE); ++ bI.feedSignals(Bit.Z); ++ ++ Simulation.TIMELINE.executeAll(); ++ ++ assertEquals(Bit.ONE, b.getValue()); ++ ++ bI.feedSignals(Bit.ZERO); ++ ++ Simulation.TIMELINE.executeAll(); ++ ++ assertEquals(Bit.X, b.getValue()); ++ assertEquals(Bit.ONE, a.getValue()); ++ ++ aI.clearSignals(); ++ enI.feedSignals(Bit.ZERO); ++ ++ Simulation.TIMELINE.executeAll(); ++ ++ assertEquals(Bit.ZERO, a.getValue()); ++ ++ } ++ ++ @Test ++ void muxTest() ++ { ++ Simulation.TIMELINE.reset(); ++ Wire a = new Wire(4, 3), b = new Wire(4, 6), c = new Wire(4, 4), select = new Wire(2, 5), out = new Wire(4, 1); ++ WireEnd selectIn = select.createEnd(); ++ ++ selectIn.feedSignals(Bit.ZERO, Bit.ZERO); ++ a.createEnd().feedSignals(Bit.ONE, Bit.ZERO, Bit.ONE, Bit.ZERO); ++ c.createEnd().feedSignals(Bit.ZERO, Bit.ONE, Bit.ZERO, Bit.ONE); ++ ++ new Mux(1, out.createEnd(), select.createReadOnlyEnd(), a.createReadOnlyEnd(), b.createReadOnlyEnd(), c.createReadOnlyEnd()); ++ Simulation.TIMELINE.executeAll(); ++ ++ assertBitArrayEquals(out.getValues(), Bit.ONE, Bit.ZERO, Bit.ONE, Bit.ZERO); ++ selectIn.feedSignals(Bit.ZERO, Bit.ONE); ++ Simulation.TIMELINE.executeAll(); ++ ++ assertBitArrayEquals(out.getValues(), Bit.ZERO, Bit.ONE, Bit.ZERO, Bit.ONE); ++ ++ selectIn.feedSignals(Bit.ONE, Bit.ONE); ++ Simulation.TIMELINE.executeAll(); ++ ++ assertBitArrayEquals(out.getValues(), Bit.Z, Bit.Z, Bit.Z, Bit.Z); ++ ++ } ++ ++ @Test ++ void demuxTest() ++ { ++ Simulation.TIMELINE.reset(); ++ Wire a = new Wire(4, 3), b = new Wire(4, 6), c = new Wire(4, 4), select = new Wire(2, 5), in = new Wire(4, 1); ++ WireEnd selectIn = select.createEnd(); ++ ++ selectIn.feedSignals(Bit.ZERO, Bit.ZERO); ++ in.createEnd().feedSignals(Bit.ONE, Bit.ZERO, Bit.ONE, Bit.ZERO); ++ ++ new Demux(1, in.createReadOnlyEnd(), select.createReadOnlyEnd(), a.createEnd(), b.createEnd(), c.createEnd()); ++ Simulation.TIMELINE.executeAll(); ++ ++ assertBitArrayEquals(a.getValues(), Bit.ONE, Bit.ZERO, Bit.ONE, Bit.ZERO); ++ assertBitArrayEquals(b.getValues(), Bit.U, Bit.U, Bit.U, Bit.U); ++ assertBitArrayEquals(c.getValues(), Bit.U, Bit.U, Bit.U, Bit.U); ++ selectIn.feedSignals(Bit.ZERO, Bit.ONE); ++ Simulation.TIMELINE.executeAll(); ++ ++ assertBitArrayEquals(a.getValues(), Bit.Z, Bit.Z, Bit.Z, Bit.Z); ++ assertBitArrayEquals(b.getValues(), Bit.U, Bit.U, Bit.U, Bit.U); ++ assertBitArrayEquals(c.getValues(), Bit.ONE, Bit.ZERO, Bit.ONE, Bit.ZERO); ++ ++ selectIn.feedSignals(Bit.ONE, Bit.ONE); ++ Simulation.TIMELINE.executeAll(); ++ ++ assertBitArrayEquals(a.getValues(), Bit.Z, Bit.Z, Bit.Z, Bit.Z); ++ assertBitArrayEquals(b.getValues(), Bit.U, Bit.U, Bit.U, Bit.U); ++ assertBitArrayEquals(c.getValues(), Bit.Z, Bit.Z, Bit.Z, Bit.Z); ++ ++ } ++ ++ @Test ++ void andTest() ++ { ++ Simulation.TIMELINE.reset(); ++ Wire a = new Wire(4, 1), b = new Wire(4, 3), c = new Wire(4, 1); ++ new AndGate(1, c.createEnd(), a.createReadOnlyEnd(), b.createReadOnlyEnd()); ++ a.createEnd().feedSignals(Bit.ONE, Bit.ONE, Bit.ZERO, Bit.ZERO); ++ b.createEnd().feedSignals(Bit.ZERO, Bit.ONE, Bit.ZERO, Bit.ONE); ++ ++ Simulation.TIMELINE.executeAll(); ++ ++ assertBitArrayEquals(c.getValues(), Bit.ZERO, Bit.ONE, Bit.ZERO, Bit.ZERO); ++ } ++ ++ @Test ++ void orTest() ++ { ++ Simulation.TIMELINE.reset(); ++ Wire a = new Wire(4, 1), b = new Wire(4, 3), c = new Wire(4, 1); ++ new OrGate(1, c.createEnd(), a.createReadOnlyEnd(), b.createReadOnlyEnd()); ++ a.createEnd().feedSignals(Bit.ONE, Bit.ONE, Bit.ZERO, Bit.ZERO); ++ b.createEnd().feedSignals(Bit.ZERO, Bit.ONE, Bit.ZERO, Bit.ONE); ++ ++ Simulation.TIMELINE.executeAll(); ++ ++ assertBitArrayEquals(c.getValues(), Bit.ONE, Bit.ONE, Bit.ZERO, Bit.ONE); ++ } ++ ++ @Test ++ void xorTest() ++ { ++ Simulation.TIMELINE.reset(); ++ Wire a = new Wire(3, 1), b = new Wire(3, 2), c = new Wire(3, 1), d = new Wire(3, 1); ++ new XorGate(1, d.createEnd(), a.createReadOnlyEnd(), b.createReadOnlyEnd(), c.createReadOnlyEnd()); ++ a.createEnd().feedSignals(Bit.ZERO, Bit.ONE, Bit.ONE); ++ b.createEnd().feedSignals(Bit.ONE, Bit.ZERO, Bit.ONE); ++ c.createEnd().feedSignals(Bit.ONE, Bit.ZERO, Bit.ONE); ++ ++ Simulation.TIMELINE.executeAll(); ++ ++ assertBitArrayEquals(d.getValues(), Bit.ZERO, Bit.ONE, Bit.ONE); ++ } ++ ++ @Test ++ void notTest() ++ { ++ Simulation.TIMELINE.reset(); ++ Wire a = new Wire(3, 1), b = new Wire(3, 2); ++ new NotGate(1, a.createReadOnlyEnd(), b.createEnd()); ++ a.createEnd().feedSignals(Bit.ZERO, Bit.ONE, Bit.ONE); ++ ++ Simulation.TIMELINE.executeAll(); ++ ++ assertBitArrayEquals(b.getValues(), Bit.ONE, Bit.ZERO, Bit.ZERO); ++ } ++ ++ @Test ++ void rsLatchCircuitTest() ++ { ++ Simulation.TIMELINE.reset(); ++ Wire r = new Wire(1, 1), s = new Wire(1, 1), t1 = new Wire(1, 15), t2 = new Wire(1, 1), q = new Wire(1, 1), nq = new Wire(1, 1); ++ ++ new OrGate(1, t2.createEnd(), r.createReadOnlyEnd(), nq.createReadOnlyEnd()); ++ new OrGate(1, t1.createEnd(), s.createReadOnlyEnd(), q.createReadOnlyEnd()); ++ new NotGate(1, t2.createReadOnlyEnd(), q.createEnd()); ++ new NotGate(1, t1.createReadOnlyEnd(), nq.createEnd()); ++ ++ WireEnd sIn = s.createEnd(), rIn = r.createEnd(); ++ ++ sIn.feedSignals(Bit.ONE); ++ rIn.feedSignals(Bit.ZERO); ++ ++ Simulation.TIMELINE.executeAll(); ++ ++ assertEquals(Bit.ONE, q.getValue()); ++ assertEquals(Bit.ZERO, nq.getValue()); ++ ++ sIn.feedSignals(Bit.ZERO); ++ ++ Simulation.TIMELINE.executeAll(); ++ assertEquals(Bit.ONE, q.getValue()); ++ assertEquals(Bit.ZERO, nq.getValue()); ++ ++ rIn.feedSignals(Bit.ONE); ++ ++ Simulation.TIMELINE.executeAll(); ++ ++ assertEquals(Bit.ZERO, q.getValue()); ++ assertEquals(Bit.ONE, nq.getValue()); ++ } ++ ++ @Test ++ void numericValueTest() ++ { ++ Simulation.TIMELINE.reset(); ++ ++ Wire a = new Wire(4, 1); ++ a.createEnd().feedSignals(Bit.ONE, Bit.ONE, Bit.ONE, Bit.ONE); ++ ++ Simulation.TIMELINE.executeAll(); ++ ++ assertEquals(15, a.getUnsignedValue()); ++ assertEquals(-1, a.getSignedValue()); ++ } ++ ++ @Test ++ void multipleInputs() ++ { ++ Simulation.TIMELINE.reset(); ++ Wire w = new Wire(2, 1); ++ WireEnd wI1 = w.createEnd(), wI2 = w.createEnd(); ++ wI1.feedSignals(Bit.ONE, Bit.Z); ++ wI2.feedSignals(Bit.Z, Bit.X); ++ Simulation.TIMELINE.executeAll(); ++ assertBitArrayEquals(w.getValues(), Bit.ONE, Bit.X); ++ ++ wI2.feedSignals(Bit.ZERO, Bit.Z); ++ Simulation.TIMELINE.executeAll(); ++ assertBitArrayEquals(w.getValues(), Bit.X, Bit.Z); ++ ++ wI2.feedSignals(Bit.Z, Bit.Z); ++ Simulation.TIMELINE.executeAll(); ++ assertBitArrayEquals(w.getValues(), Bit.ONE, Bit.Z); ++ ++ wI2.feedSignals(Bit.ONE, Bit.Z); ++ w.addObserver((i, oldValues) -> fail("WireArray notified observer, although value did not change.")); ++ Simulation.TIMELINE.executeAll(); ++ assertBitArrayEquals(w.getValues(), Bit.ONE, Bit.Z); ++ } ++ ++ @Test ++ void wireConnections() ++ { ++ // Nur ein Experiment, was über mehrere 'passive' Bausteine hinweg passieren würde ++ ++ Simulation.TIMELINE.reset(); ++ ++ Wire a = new Wire(1, 2); ++ Wire b = new Wire(1, 2); ++ Wire c = new Wire(1, 2); ++ WireEnd aI = a.createEnd(); ++ WireEnd bI = b.createEnd(); ++ WireEnd cI = c.createEnd(); ++ ++ TestBitDisplay test = new TestBitDisplay(c.createReadOnlyEnd()); ++ TestBitDisplay test2 = new TestBitDisplay(a.createReadOnlyEnd()); ++ LongConsumer print = time -> System.out.format("Time %2d\n a: %s\n b: %s\n c: %s\n", time, a, b, c); ++ ++ cI.feedSignals(Bit.ONE); ++ test.assertAfterSimulationIs(print, Bit.ONE); ++ ++ cI.feedSignals(Bit.X); ++ test.assertAfterSimulationIs(print, Bit.X); ++ ++ cI.feedSignals(Bit.X); ++ cI.feedSignals(Bit.Z); ++ test.assertAfterSimulationIs(print, Bit.Z); ++ ++ new Connector(b.createEnd(), c.createEnd()).connect(); ++ test.assertAfterSimulationIs(print, Bit.Z); ++ System.err.println("ONE"); ++ bI.feedSignals(Bit.ONE); ++ test.assertAfterSimulationIs(print, Bit.ONE); ++ System.err.println("ZERO"); ++ bI.feedSignals(Bit.ZERO); ++ test.assertAfterSimulationIs(print, Bit.ZERO); ++ System.err.println("Z"); ++ bI.feedSignals(Bit.Z); ++ test.assertAfterSimulationIs(print, Bit.Z); ++ ++ new Connector(a.createEnd(), b.createEnd()).connect(); ++ System.err.println("Z 2"); ++ aI.feedSignals(Bit.Z); ++ test.assertAfterSimulationIs(print, Bit.Z); ++ test2.assertAfterSimulationIs(Bit.Z); ++ System.err.println("ONE 2"); ++ aI.feedSignals(Bit.ONE); ++ test.assertAfterSimulationIs(print, Bit.ONE); ++ test2.assertAfterSimulationIs(Bit.ONE); ++ System.err.println("ZERO 2"); ++ aI.feedSignals(Bit.ZERO); ++ test.assertAfterSimulationIs(print, Bit.ZERO); ++ test2.assertAfterSimulationIs(Bit.ZERO); ++ System.err.println("Z 2 II"); ++ aI.feedSignals(Bit.Z); ++ test.assertAfterSimulationIs(print, Bit.Z); ++ test2.assertAfterSimulationIs(Bit.Z); ++ ++ System.err.println("No Conflict yet"); ++ bI.feedSignals(Bit.ONE); ++ test.assertAfterSimulationIs(print, Bit.ONE); ++ test2.assertAfterSimulationIs(Bit.ONE); ++ aI.feedSignals(Bit.ONE); ++ test.assertAfterSimulationIs(print, Bit.ONE); ++ test2.assertAfterSimulationIs(Bit.ONE); ++ System.err.println("Conflict"); ++ aI.feedSignals(Bit.ZERO); ++ test.assertAfterSimulationIs(print, Bit.X); ++ test2.assertAfterSimulationIs(Bit.X); ++ aI.feedSignals(Bit.ONE); ++ test.assertAfterSimulationIs(print, Bit.ONE); ++ test2.assertAfterSimulationIs(Bit.ONE); ++ } ++ ++ private static void assertBitArrayEquals(BitVector actual, Bit... expected) ++ { ++ assertArrayEquals(expected, actual.getBits()); ++ } ++} diff --cc era.mi/src/era/mi/logic/tests/TestBitDisplay.java index 00000000,d821752b..cb0494e1 mode 000000,100644..100644 --- a/era.mi/src/era/mi/logic/tests/TestBitDisplay.java +++ b/era.mi/src/era/mi/logic/tests/TestBitDisplay.java @@@ -1,0 -1,47 +1,47 @@@ -package era.mi.logic.tests; - -import static org.junit.jupiter.api.Assertions.assertArrayEquals; - -import java.util.function.LongConsumer; - -import era.mi.logic.Simulation; -import era.mi.logic.components.BitDisplay; -import era.mi.logic.types.Bit; -import era.mi.logic.wires.Wire.WireEnd; - -public final class TestBitDisplay extends BitDisplay -{ - - public TestBitDisplay(WireEnd in) - { - super(in); - } - - public void assertDisplays(Bit... expected) - { - assertArrayEquals(expected, getDisplayedValue().getBits()); - } - - public void assertAfterSimulationIs(Bit... expected) - { - Simulation.TIMELINE.executeAll(); - assertDisplays(expected); - } - - public void assertAfterSimulationIs(LongConsumer r, Bit... expected) - { - while (Simulation.TIMELINE.hasNext()) - { - Simulation.TIMELINE.executeNext(); - r.accept(Simulation.TIMELINE.getSimulationTime()); - } - assertDisplays(expected); - } - - @Override - protected void compute() - { - super.compute(); - System.out.println("update: value is " + getDisplayedValue()); - } -} ++package era.mi.logic.tests; ++ ++import static org.junit.jupiter.api.Assertions.assertArrayEquals; ++ ++import java.util.function.LongConsumer; ++ ++import era.mi.logic.Simulation; ++import era.mi.logic.components.BitDisplay; ++import era.mi.logic.types.Bit; ++import era.mi.logic.wires.Wire.WireEnd; ++ ++public final class TestBitDisplay extends BitDisplay ++{ ++ ++ public TestBitDisplay(WireEnd in) ++ { ++ super(in); ++ } ++ ++ public void assertDisplays(Bit... expected) ++ { ++ assertArrayEquals(expected, getDisplayedValue().getBits()); ++ } ++ ++ public void assertAfterSimulationIs(Bit... expected) ++ { ++ Simulation.TIMELINE.executeAll(); ++ assertDisplays(expected); ++ } ++ ++ public void assertAfterSimulationIs(LongConsumer r, Bit... expected) ++ { ++ while (Simulation.TIMELINE.hasNext()) ++ { ++ Simulation.TIMELINE.executeNext(); ++ r.accept(Simulation.TIMELINE.getSimulationTime()); ++ } ++ assertDisplays(expected); ++ } ++ ++ @Override ++ protected void compute() ++ { ++ super.compute(); ++ System.out.println("update: value is " + getDisplayedValue()); ++ } ++} diff --cc era.mi/src/era/mi/logic/timeline/Timeline.java index 00000000,9e649388..8107db96 mode 000000,100644..100644 --- a/era.mi/src/era/mi/logic/timeline/Timeline.java +++ b/era.mi/src/era/mi/logic/timeline/Timeline.java @@@ -1,0 -1,178 +1,178 @@@ -package era.mi.logic.timeline; - -import java.util.ArrayList; -import java.util.List; -import java.util.PriorityQueue; -import java.util.function.Consumer; - -/** - * Orders Events by the time they are due to be executed. Can execute Events individually. - * - * @author Fabian Stemmler - * - */ -public class Timeline -{ - private PriorityQueue events; - private long currentTime = 0; - - private final List> eventAddedListener; - - public Timeline(int initCapacity) - { - events = new PriorityQueue(initCapacity, (a, b) -> - { - long difference = a.getTiming() - b.getTiming(); - if (difference == 0) - return 0; - return difference < 0 ? -1 : 1; - }); - - eventAddedListener = new ArrayList<>(); - } - - public boolean hasNext() - { - return !events.isEmpty(); - } - - public void executeNext() - { - InnerEvent first = events.poll(); - currentTime = first.getTiming(); - first.run(); - } - - public void executeAll() - { - while (hasNext()) - executeNext(); - } - - /** - * Executes all events up to a given simulation timestamp. The simulation process can be constrained by a real world timestamp. - * - * @param timestamp the simulation timestamp up to which the events will be processed - * @param stopMillis the System.currentTimeMillis() when simulation definitely needs to stop. - * @return if it was possible to fulfil the goal in the given real world time. - * @author Christian Femers - */ - public ExecutionResult executeUpTo(long timestamp, long stopMillis) - { - if (events.isEmpty()) - { - currentTime = timestamp; - return ExecutionResult.NOTHING_DONE; - } - int checkStop = 0; - InnerEvent first = events.peek(); - while (first != null && first.getTiming() <= timestamp) - { - events.remove(); - currentTime = first.getTiming(); - first.run(); - // Don't check after every run - checkStop = (checkStop + 1) % 10; - if (checkStop == 0 && System.currentTimeMillis() >= stopMillis) - return ExecutionResult.RAN_OUT_OF_TIME; - first = events.peek(); - } - currentTime = timestamp; - return ExecutionResult.DONE_IN_TIME; - } - - public long getSimulationTime() - { - return currentTime; - } - - public long nextEventTime() - { - if (!hasNext()) - return -1; - return events.peek().timing; - } - - public void reset() - { - events.clear(); - currentTime = 0; - } - - public void addEventAddedListener(Consumer listener) - { - eventAddedListener.add(listener); - } - - public void removeEventAddedListener(Consumer listener) - { - eventAddedListener.remove(listener); - } - - /** - * Adds an Event to the {@link Timeline} - * - * @param function The {@link TimelineEventHandler} that will be executed, when the {@link InnerEvent} occurs on the timeline. - * @param relativeTiming The amount of MI ticks in which the {@link InnerEvent} is called, starting from the current time. - */ - public void addEvent(TimelineEventHandler function, int relativeTiming) - { - long timing = currentTime + relativeTiming; - TimelineEvent event = new TimelineEvent(timing); - events.add(new InnerEvent(function, event, timing)); - eventAddedListener.forEach(l -> l.accept(event)); - } - - private class InnerEvent - { - - final long timing; - private final TimelineEventHandler function; - private final TimelineEvent event; - - /** - * Creates an {@link InnerEvent} - * - * @param function {@link TimelineEventHandler} to be executed when the {@link InnerEvent} occurs - * @param timing Point in the MI simulation {@link Timeline}, at which the {@link InnerEvent} is executed; - */ - InnerEvent(TimelineEventHandler function, TimelineEvent event, long timing) - { - this.function = function; - this.event = event; - this.timing = timing; - } - - public long getTiming() - { - return timing; - } - - public void run() - { - function.handle(event); - } - - @Override - public String toString() - { - return event.toString(); - } - } - - @Override - public String toString() - { - return "simulation time: " + currentTime + ", " + events.toString(); - } - - public static long toNanoseconds(long ticks) - { - return ticks; // TODO: Alter this when it has been determined how ticks should relate to real time. - } - - public enum ExecutionResult - { - NOTHING_DONE, DONE_IN_TIME, RAN_OUT_OF_TIME - } ++package era.mi.logic.timeline; ++ ++import java.util.ArrayList; ++import java.util.List; ++import java.util.PriorityQueue; ++import java.util.function.Consumer; ++ ++/** ++ * Orders Events by the time they are due to be executed. Can execute Events individually. ++ * ++ * @author Fabian Stemmler ++ * ++ */ ++public class Timeline ++{ ++ private PriorityQueue events; ++ private long currentTime = 0; ++ ++ private final List> eventAddedListener; ++ ++ public Timeline(int initCapacity) ++ { ++ events = new PriorityQueue(initCapacity, (a, b) -> ++ { ++ long difference = a.getTiming() - b.getTiming(); ++ if (difference == 0) ++ return 0; ++ return difference < 0 ? -1 : 1; ++ }); ++ ++ eventAddedListener = new ArrayList<>(); ++ } ++ ++ public boolean hasNext() ++ { ++ return !events.isEmpty(); ++ } ++ ++ public void executeNext() ++ { ++ InnerEvent first = events.poll(); ++ currentTime = first.getTiming(); ++ first.run(); ++ } ++ ++ public void executeAll() ++ { ++ while (hasNext()) ++ executeNext(); ++ } ++ ++ /** ++ * Executes all events up to a given simulation timestamp. The simulation process can be constrained by a real world timestamp. ++ * ++ * @param timestamp the simulation timestamp up to which the events will be processed ++ * @param stopMillis the System.currentTimeMillis() when simulation definitely needs to stop. ++ * @return if it was possible to fulfil the goal in the given real world time. ++ * @author Christian Femers ++ */ ++ public ExecutionResult executeUpTo(long timestamp, long stopMillis) ++ { ++ if (events.isEmpty()) ++ { ++ currentTime = timestamp; ++ return ExecutionResult.NOTHING_DONE; ++ } ++ int checkStop = 0; ++ InnerEvent first = events.peek(); ++ while (first != null && first.getTiming() <= timestamp) ++ { ++ events.remove(); ++ currentTime = first.getTiming(); ++ first.run(); ++ // Don't check after every run ++ checkStop = (checkStop + 1) % 10; ++ if (checkStop == 0 && System.currentTimeMillis() >= stopMillis) ++ return ExecutionResult.RAN_OUT_OF_TIME; ++ first = events.peek(); ++ } ++ currentTime = timestamp; ++ return ExecutionResult.DONE_IN_TIME; ++ } ++ ++ public long getSimulationTime() ++ { ++ return currentTime; ++ } ++ ++ public long nextEventTime() ++ { ++ if (!hasNext()) ++ return -1; ++ return events.peek().timing; ++ } ++ ++ public void reset() ++ { ++ events.clear(); ++ currentTime = 0; ++ } ++ ++ public void addEventAddedListener(Consumer listener) ++ { ++ eventAddedListener.add(listener); ++ } ++ ++ public void removeEventAddedListener(Consumer listener) ++ { ++ eventAddedListener.remove(listener); ++ } ++ ++ /** ++ * Adds an Event to the {@link Timeline} ++ * ++ * @param function The {@link TimelineEventHandler} that will be executed, when the {@link InnerEvent} occurs on the timeline. ++ * @param relativeTiming The amount of MI ticks in which the {@link InnerEvent} is called, starting from the current time. ++ */ ++ public void addEvent(TimelineEventHandler function, int relativeTiming) ++ { ++ long timing = currentTime + relativeTiming; ++ TimelineEvent event = new TimelineEvent(timing); ++ events.add(new InnerEvent(function, event, timing)); ++ eventAddedListener.forEach(l -> l.accept(event)); ++ } ++ ++ private class InnerEvent ++ { ++ ++ final long timing; ++ private final TimelineEventHandler function; ++ private final TimelineEvent event; ++ ++ /** ++ * Creates an {@link InnerEvent} ++ * ++ * @param function {@link TimelineEventHandler} to be executed when the {@link InnerEvent} occurs ++ * @param timing Point in the MI simulation {@link Timeline}, at which the {@link InnerEvent} is executed; ++ */ ++ InnerEvent(TimelineEventHandler function, TimelineEvent event, long timing) ++ { ++ this.function = function; ++ this.event = event; ++ this.timing = timing; ++ } ++ ++ public long getTiming() ++ { ++ return timing; ++ } ++ ++ public void run() ++ { ++ function.handle(event); ++ } ++ ++ @Override ++ public String toString() ++ { ++ return event.toString(); ++ } ++ } ++ ++ @Override ++ public String toString() ++ { ++ return "simulation time: " + currentTime + ", " + events.toString(); ++ } ++ ++ public static long toNanoseconds(long ticks) ++ { ++ return ticks; // TODO: Alter this when it has been determined how ticks should relate to real time. ++ } ++ ++ public enum ExecutionResult ++ { ++ NOTHING_DONE, DONE_IN_TIME, RAN_OUT_OF_TIME ++ } + } diff --cc era.mi/src/era/mi/logic/timeline/TimelineEvent.java index 00000000,cc37c992..46decf5f mode 000000,100644..100644 --- a/era.mi/src/era/mi/logic/timeline/TimelineEvent.java +++ b/era.mi/src/era/mi/logic/timeline/TimelineEvent.java @@@ -1,0 -1,30 +1,30 @@@ -package era.mi.logic.timeline; - -/** - * A class that stores all relevant information about an event in the {@link Timeline}. Currently, there is not much relevant information to - * store. - * - * @author Fabian Stemmler - * - */ -public class TimelineEvent -{ - private final long timing; - - TimelineEvent(long timing) - { - super(); - this.timing = timing; - } - - public long getTiming() - { - return timing; - } - - @Override - public String toString() - { - return "timestamp: " + timing; - } ++package era.mi.logic.timeline; ++ ++/** ++ * A class that stores all relevant information about an event in the {@link Timeline}. Currently, there is not much relevant information to ++ * store. ++ * ++ * @author Fabian Stemmler ++ * ++ */ ++public class TimelineEvent ++{ ++ private final long timing; ++ ++ TimelineEvent(long timing) ++ { ++ super(); ++ this.timing = timing; ++ } ++ ++ public long getTiming() ++ { ++ return timing; ++ } ++ ++ @Override ++ public String toString() ++ { ++ return "timestamp: " + timing; ++ } + } diff --cc era.mi/src/era/mi/logic/timeline/TimelineEventHandler.java index 00000000,c2dcb986..59a91c95 mode 000000,100644..100644 --- a/era.mi/src/era/mi/logic/timeline/TimelineEventHandler.java +++ b/era.mi/src/era/mi/logic/timeline/TimelineEventHandler.java @@@ -1,0 -1,6 +1,6 @@@ -package era.mi.logic.timeline; - -public interface TimelineEventHandler -{ - public void handle(TimelineEvent e); ++package era.mi.logic.timeline; ++ ++public interface TimelineEventHandler ++{ ++ public void handle(TimelineEvent e); + }