diff --git a/.gitignore b/.gitignore
index 2f9595f68cdf8b6e340a6450b1313fe1b97b4dd6..be49e74eacab574fa1325517346af712eb242e24 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,9 +8,6 @@
# SPDX-License-Identifier: EPL-2.0
#################################################################################
-# m2e-code-quality Eclipse IDE plugin
-.checkstyle
-
# Maven build folder
**/bin/
**/target/
diff --git a/TRACE4CPS.setup b/TRACE4CPS.setup
index ae331e4296abf5075a35fbdfc94ec3898fdc2918..812d06bf87c11207be1d75345a8bbdd4428310a5 100644
--- a/TRACE4CPS.setup
+++ b/TRACE4CPS.setup
@@ -80,6 +80,14 @@
+
+
+
@@ -114,11 +122,11 @@
+ value="19"/>
+ value="<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<profiles version="21">
<profile kind="CodeFormatterProfile" name="Eclipse TRACE4CPS profile" version="19">
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_logical_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_method_invocation" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_imports" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_record_declaration" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_switch_statement" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.comment.format_javadoc_comments" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.indentation.size" value="4"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_enum_constant_declaration" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_default" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.align_with_spaces" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.disabling_tag" value="@formatter:off"/>
<setting id="org.eclipse.jdt.core.formatter.continuation_indentation" value="2"/>
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_before_code_block" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_switch_case_expressions" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_imports" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_method_body" value="-1"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_package" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_if_while_statement" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.indent_root_tags" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.enabling_tag" value="@formatter:on"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.count_line_length_from_starting_position" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_record_components" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_case" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_before_multiplicative_operator" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_logical_operator" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.keep_annotation_declaration_on_one_line" value="one_line_never"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_record_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_enum_constant" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_multiplicative_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_block" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="next_line_on_wrap"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.align_tags_descriptions_grouped" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="120"/>
<setting id="org.eclipse.jdt.core.formatter.use_on_off_tags" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.keep_method_body_on_one_line" value="one_line_never"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.keep_loop_body_block_on_one_line" value="one_line_never"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration" value="next_line_on_wrap"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_abstract_method" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.keep_enum_constant_declaration_on_one_line" value="one_line_never"/>
<setting id="org.eclipse.jdt.core.formatter.align_variable_declarations_on_columns" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.keep_type_declaration_on_one_line" value="one_line_never"/>
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body" value="-1"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_catch_clause" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_additive_operator" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_record_constructor" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_relational_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_multiplicative_operator" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.keep_anonymous_type_declaration_on_one_line" value="one_line_never"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_switch_case_expressions" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_before_shift_operator" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.keep_record_declaration_on_one_line" value="one_line_never"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block" value="next_line_on_wrap"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration" value="next_line_on_wrap"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_lambda_body" value="next_line_on_wrap"/>
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_code_block" value="-1"/>
<setting id="org.eclipse.jdt.core.formatter.compact_else_if" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_bitwise_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_type_parameters" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_loops" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.keep_simple_for_body_on_same_line" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_relational_operator" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_annotation" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_additive_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_string_concatenation" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.format_line_comments" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_record_declaration" value="next_line_on_wrap"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.text_block_indentation" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_assignment" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_module_statements" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_after_code_block" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.comment.align_tags_names_descriptions" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.keep_if_then_body_block_on_one_line" value="one_line_never"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration" value="-1"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.align_assignment_statements_on_columns" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration" value="next_line_on_wrap"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case" value="next_line_on_wrap"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_default" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_between_different_tags" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression_chain" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.comment.format_header" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_additive_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_method_declaration" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.join_wrapped_lines" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_before_conditional_operator" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_shift_operator" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines" value="2147483647"/>
<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_bitwise_operator" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration" value="next_line_on_wrap"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_resources_in_try" value="82"/>
<setting id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_try_clause" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.keep_code_block_on_one_line" value="one_line_never"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_record_components" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="4"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_bitwise_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.format_source_code" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_field" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer" value="2"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_method" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_record_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_before_assignment_operator" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_not_operator" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch" value="next_line_on_wrap"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.format_html" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_method_delcaration" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_if" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.keep_lambda_body_block_on_one_line" value="one_line_if_single_item"/>
<setting id="org.eclipse.jdt.core.formatter.indent_empty_lines" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_type_arguments" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.keep_record_constructor_on_one_line" value="one_line_never"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_record_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_label" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_case" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_member_type" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_logical_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_record_header" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_record_declaration" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_before_bitwise_operator" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_before_relational_operator" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.format_block_comments" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.indent_tag_description" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_record_constructor" value="next_line_on_wrap"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_string_concatenation" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_last_class_body_declaration" value="-1"/>
<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_body" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.keep_simple_while_body_on_same_line" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_array_initializer" value="next_line_on_wrap"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_before_logical_operator" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_shift_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_statement_group_in_switch" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_lambda_declaration" value="separate_lines_if_wrapped"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_shift_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.keep_simple_do_while_body_on_same_line" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.keep_enum_declaration_on_one_line" value="one_line_never"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_record_components" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant" value="next_line_on_wrap"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration" value="next_line_on_wrap"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_multiplicative_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_package" value="-2"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_for_loop_header" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_before_additive_operator" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.keep_simple_getter_setter_on_one_line" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_string_concatenation" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.join_lines_in_comments" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.indent_parameter_description" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_code_block" value="-1"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_record_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="space"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_relational_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_before_string_concatenation" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_import_groups" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="120"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch" value="insert"/>
</profile>
</profiles>
"/>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ name="net.sf.eclipsecs.feature.group"/>
+ name="de.jcup.asciidoctoreditor.feature.group"/>
+
+
+
+
+
+
diff --git a/jfreechart/org.eclipse.trace4cps.common.jfreechart.ui/.project b/jfreechart/org.eclipse.trace4cps.common.jfreechart.ui/.project
index 7a38e7848d8b085dafd145749dbb33f1a6628145..eda9443b482f3412a7f3c537df5b21a2c916da49 100644
--- a/jfreechart/org.eclipse.trace4cps.common.jfreechart.ui/.project
+++ b/jfreechart/org.eclipse.trace4cps.common.jfreechart.ui/.project
@@ -20,9 +20,15 @@
+
+ net.sf.eclipsecs.core.CheckstyleBuilder
+
+
+ org.eclipse.pde.PluginNatureorg.eclipse.jdt.core.javanature
+ net.sf.eclipsecs.core.CheckstyleNature
diff --git a/jfreechart/org.eclipse.trace4cps.common.jfreechart.ui/src/org/eclipse/trace4cps/common/jfreechart/ui/JFreeChartUIPlugin.java b/jfreechart/org.eclipse.trace4cps.common.jfreechart.ui/src/org/eclipse/trace4cps/common/jfreechart/ui/JFreeChartUIPlugin.java
index c73d60c9d9d0c6e97ca0b9d32e0458db6edd08a9..ad920dd730a2873b026390e28fd5eb320a54573d 100644
--- a/jfreechart/org.eclipse.trace4cps.common.jfreechart.ui/src/org/eclipse/trace4cps/common/jfreechart/ui/JFreeChartUIPlugin.java
+++ b/jfreechart/org.eclipse.trace4cps.common.jfreechart.ui/src/org/eclipse/trace4cps/common/jfreechart/ui/JFreeChartUIPlugin.java
@@ -7,6 +7,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.common.jfreechart.ui;
import static org.eclipse.core.runtime.IStatus.ERROR;
@@ -32,8 +33,7 @@ public class JFreeChartUIPlugin extends AbstractUIPlugin {
// The plug-in ID
public static final String PLUGIN_ID = "org.eclipse.trace4cps.common.jfreechart.ui"; //$NON-NLS-1$
- private static final String EXTENSION_CHART_THEME_SUPPLIER = PLUGIN_ID
- + ".chartthemesupplier";
+ private static final String EXTENSION_CHART_THEME_SUPPLIER = PLUGIN_ID + ".chartthemesupplier";
// The shared instance
private static JFreeChartUIPlugin plugin;
@@ -56,12 +56,11 @@ public class JFreeChartUIPlugin extends AbstractUIPlugin {
private void configureLookAndFeel() {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
- } catch (ClassNotFoundException | InstantiationException
- | IllegalAccessException | UnsupportedLookAndFeelException e) {
+ } catch (ClassNotFoundException | InstantiationException | IllegalAccessException
+ | UnsupportedLookAndFeelException e)
+ {
IStatus status = new Status(ERROR, PLUGIN_ID,
- "Failed to install system look-and-feel: "
- + e.getLocalizedMessage(),
- e);
+ "Failed to install system look-and-feel: " + e.getLocalizedMessage(), e);
getLog().log(status);
}
}
@@ -71,14 +70,13 @@ public class JFreeChartUIPlugin extends AbstractUIPlugin {
.getConfigurationElementsFor(EXTENSION_CHART_THEME_SUPPLIER);
int highestRank = Integer.MIN_VALUE;
IConfigurationElement highestElement = null;
- for (IConfigurationElement element : elements) {
+ for (IConfigurationElement element: elements) {
if (!"chart_theme_supplier".equals(element.getName())) {
continue;
}
String rankStr = element.getAttribute("rank");
if (null == rankStr) {
- IStatus status = new Status(ERROR,
- element.getContributor().getName(),
+ IStatus status = new Status(ERROR, element.getContributor().getName(),
"Chart theme supplier is missing mandatory attribute 'rank'");
getLog().log(status);
}
@@ -89,22 +87,18 @@ public class JFreeChartUIPlugin extends AbstractUIPlugin {
highestElement = element;
}
} catch (NumberFormatException e) {
- IStatus status = new Status(ERROR,
- element.getContributor().getName(),
- "Chart theme supplier attribute 'rank' not a valid integer",
- e);
+ IStatus status = new Status(ERROR, element.getContributor().getName(),
+ "Chart theme supplier attribute 'rank' not a valid integer", e);
getLog().log(status);
}
}
if (null != highestElement) {
try {
- ChartThemeSupplier supplier = (ChartThemeSupplier) highestElement
- .createExecutableExtension("class");
+ ChartThemeSupplier supplier = (ChartThemeSupplier)highestElement.createExecutableExtension("class");
ChartFactory.setChartTheme(supplier.getChartTheme());
} catch (CoreException e) {
- IStatus status = new Status(ERROR,
- highestElement.getContributor().getName(),
+ IStatus status = new Status(ERROR, highestElement.getContributor().getName(),
"Chart theme supplier could not be instantiated", e);
getLog().log(status);
}
@@ -125,5 +119,4 @@ public class JFreeChartUIPlugin extends AbstractUIPlugin {
public static JFreeChartUIPlugin getDefault() {
return plugin;
}
-
}
diff --git a/jfreechart/org.eclipse.trace4cps.common.jfreechart.ui/src/org/eclipse/trace4cps/common/jfreechart/ui/gantt/XYGanttDataItem.java b/jfreechart/org.eclipse.trace4cps.common.jfreechart.ui/src/org/eclipse/trace4cps/common/jfreechart/ui/gantt/XYGanttDataItem.java
index 89bff77d45d82e227ae3b64db76fb25c0988389d..d6b5d05514d15666bfb8c1706c553a10efe76f84 100644
--- a/jfreechart/org.eclipse.trace4cps.common.jfreechart.ui/src/org/eclipse/trace4cps/common/jfreechart/ui/gantt/XYGanttDataItem.java
+++ b/jfreechart/org.eclipse.trace4cps.common.jfreechart.ui/src/org/eclipse/trace4cps/common/jfreechart/ui/gantt/XYGanttDataItem.java
@@ -7,6 +7,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.common.jfreechart.ui.gantt;
import static org.jfree.chart.plot.PlotOrientation.VERTICAL;
@@ -18,12 +19,13 @@ import org.jfree.chart.plot.PlotOrientation;
import org.jfree.data.Range;
import org.jfree.data.xy.XYIntervalDataItem;
-public class XYGanttDataItem extends XYIntervalDataItem
- implements BackReferenceProvider {
+public class XYGanttDataItem extends XYIntervalDataItem implements BackReferenceProvider {
private static final long serialVersionUID = 3004235510100651118L;
public static final double DEFAULT_OCCUPATION = 0.9;
+
public static final double DEFAULT_OFFSET = 0.05;
+
public static final double DEFAULT_RESOURCE_LENGTH = 1;
private final transient T backReference;
@@ -32,39 +34,35 @@ public class XYGanttDataItem extends XYIntervalDataItem
this(calculateResourceRange(resourceIndex), start, end);
}
- public XYGanttDataItem(Number resourceIndex, Number start, Number end,
- T backReference) {
+ public XYGanttDataItem(Number resourceIndex, Number start, Number end, T backReference) {
this(calculateResourceRange(resourceIndex), start, end, backReference);
}
- public XYGanttDataItem(Number resourceIndex, Number resourceOccupation,
- Number resourceOffset, Number start, Number end,
- PlotOrientation orientation, T backReference) {
- this(calculateResourceRange(resourceIndex), resourceOccupation,
- resourceOffset, start, end, orientation, backReference);
+ public XYGanttDataItem(Number resourceIndex, Number resourceOccupation, Number resourceOffset, Number start,
+ Number end, PlotOrientation orientation, T backReference)
+ {
+ this(calculateResourceRange(resourceIndex), resourceOccupation, resourceOffset, start, end, orientation,
+ backReference);
}
public XYGanttDataItem(Range resourceRange, Number start, Number end) {
- this(resourceRange, DEFAULT_OCCUPATION, DEFAULT_OFFSET, start, end,
- VERTICAL, null);
+ this(resourceRange, DEFAULT_OCCUPATION, DEFAULT_OFFSET, start, end, VERTICAL, null);
}
- public XYGanttDataItem(Range resourceRange, Number start, Number end,
- T backReference) {
- this(resourceRange, DEFAULT_OCCUPATION, DEFAULT_OFFSET, start, end,
- VERTICAL, backReference);
+ public XYGanttDataItem(Range resourceRange, Number start, Number end, T backReference) {
+ this(resourceRange, DEFAULT_OCCUPATION, DEFAULT_OFFSET, start, end, VERTICAL, backReference);
}
- public XYGanttDataItem(Range resourceRange, Number resourceOccupation,
- Number resourceOffset, Number start, Number end,
- PlotOrientation orientation, T backReference) {
- this(calculateBounds(resourceRange, resourceOccupation, resourceOffset,
- start, end, orientation), backReference);
+ public XYGanttDataItem(Range resourceRange, Number resourceOccupation, Number resourceOffset, Number start,
+ Number end, PlotOrientation orientation, T backReference)
+ {
+ this(calculateBounds(resourceRange, resourceOccupation, resourceOffset, start, end, orientation),
+ backReference);
}
private XYGanttDataItem(Rectangle2D bounds, T backReference) {
- super(bounds.getCenterX(), bounds.getMinX(), bounds.getMaxX(),
- bounds.getCenterY(), bounds.getMinY(), bounds.getMaxY());
+ super(bounds.getCenterX(), bounds.getMinX(), bounds.getMaxX(), bounds.getCenterY(), bounds.getMinY(),
+ bounds.getMaxY());
this.backReference = backReference;
}
@@ -75,13 +73,12 @@ public class XYGanttDataItem extends XYIntervalDataItem
return new Range(lower, upper);
}
- private static Rectangle2D calculateBounds(Range resourceRange,
- Number occupation, Number offset, Number start, Number end,
- PlotOrientation orientation) {
+ private static Rectangle2D calculateBounds(Range resourceRange, Number occupation, Number offset, Number start,
+ Number end, PlotOrientation orientation)
+ {
double x = start.doubleValue();
double w = end.doubleValue() - start.doubleValue();
- double y = resourceRange.getLowerBound()
- + (offset.doubleValue() * resourceRange.getLength());
+ double y = resourceRange.getLowerBound() + (offset.doubleValue() * resourceRange.getLength());
double h = occupation.doubleValue() * resourceRange.getLength();
if (PlotOrientation.VERTICAL == orientation) {
return new Rectangle2D.Double(x, y, w, h);
diff --git a/jfreechart/org.eclipse.trace4cps.common.jfreechart.ui/src/org/eclipse/trace4cps/common/jfreechart/ui/gantt/XYGanttDependencyItem.java b/jfreechart/org.eclipse.trace4cps.common.jfreechart.ui/src/org/eclipse/trace4cps/common/jfreechart/ui/gantt/XYGanttDependencyItem.java
index 06b3740e533e702cd4c88782cfb0d7803e989e5f..abbefad5057d82c366e1bfda20037b0df624db42 100644
--- a/jfreechart/org.eclipse.trace4cps.common.jfreechart.ui/src/org/eclipse/trace4cps/common/jfreechart/ui/gantt/XYGanttDependencyItem.java
+++ b/jfreechart/org.eclipse.trace4cps.common.jfreechart.ui/src/org/eclipse/trace4cps/common/jfreechart/ui/gantt/XYGanttDependencyItem.java
@@ -7,49 +7,50 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.common.jfreechart.ui.gantt;
import org.eclipse.trace4cps.common.jfreechart.data.xy.XYEdgeDataItem;
import org.eclipse.trace4cps.common.jfreechart.ui.viewers.BackReferenceProvider;
public class XYGanttDependencyItem extends XYEdgeDataItem implements BackReferenceProvider {
- private static final long serialVersionUID = -2205873637869057094L;
-
- public enum DependencyType {
- START_START(true, true), START_END(true, false), END_START(false, true), END_END(false, false);
- private final boolean fromStart;
- private final boolean toStart;
-
- private DependencyType(boolean fromStart, boolean toStart) {
- this.fromStart = fromStart;
- this.toStart = toStart;
- }
-
- public boolean isFromStart() {
- return fromStart;
- }
-
- public boolean isToStart() {
- return toStart;
- }
- };
-
- private final transient T backReference;
-
- public XYGanttDependencyItem(XYGanttDataItem> from, XYGanttDataItem> to, DependencyType type) {
- this(from, to, type, null);
- }
-
- public XYGanttDependencyItem(XYGanttDataItem> from, XYGanttDataItem> to, DependencyType type, T backReference) {
- super(type.isFromStart() ? from.getXLowValue() : from.getXHighValue(),
- from.getYValue(),
- type.isToStart() ? to.getXLowValue() : to.getXHighValue(),
- to.getYValue());
- this.backReference = backReference;
- }
-
- @Override
- public T getBackReference() {
- return backReference;
- }
+ private static final long serialVersionUID = -2205873637869057094L;
+
+ public enum DependencyType {
+ START_START(true, true), START_END(true, false), END_START(false, true), END_END(false, false);
+
+ private final boolean fromStart;
+
+ private final boolean toStart;
+
+ private DependencyType(boolean fromStart, boolean toStart) {
+ this.fromStart = fromStart;
+ this.toStart = toStart;
+ }
+
+ public boolean isFromStart() {
+ return fromStart;
+ }
+
+ public boolean isToStart() {
+ return toStart;
+ }
+ }
+
+ private final transient T backReference;
+
+ public XYGanttDependencyItem(XYGanttDataItem> from, XYGanttDataItem> to, DependencyType type) {
+ this(from, to, type, null);
+ }
+
+ public XYGanttDependencyItem(XYGanttDataItem> from, XYGanttDataItem> to, DependencyType type, T backReference) {
+ super(type.isFromStart() ? from.getXLowValue() : from.getXHighValue(), from.getYValue(),
+ type.isToStart() ? to.getXLowValue() : to.getXHighValue(), to.getYValue());
+ this.backReference = backReference;
+ }
+
+ @Override
+ public T getBackReference() {
+ return backReference;
+ }
}
diff --git a/jfreechart/org.eclipse.trace4cps.common.jfreechart.ui/src/org/eclipse/trace4cps/common/jfreechart/ui/gantt/XYGanttMeasurement.java b/jfreechart/org.eclipse.trace4cps.common.jfreechart.ui/src/org/eclipse/trace4cps/common/jfreechart/ui/gantt/XYGanttMeasurement.java
index 584df0d62621533194abba286f829d0e7007bf08..24550863d1ef1d49b1c82fb05eed592ea58f0eb8 100644
--- a/jfreechart/org.eclipse.trace4cps.common.jfreechart.ui/src/org/eclipse/trace4cps/common/jfreechart/ui/gantt/XYGanttMeasurement.java
+++ b/jfreechart/org.eclipse.trace4cps.common.jfreechart.ui/src/org/eclipse/trace4cps/common/jfreechart/ui/gantt/XYGanttMeasurement.java
@@ -7,64 +7,61 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.common.jfreechart.ui.gantt;
public interface XYGanttMeasurement {
- public enum Snap {
- START, END
- };
+ public enum Snap {
+ START, END
+ }
+
+ /**
+ * We do not assume measurements going from left to right or low to high, etc. We only know the first and second
+ * item which where selected for this measurement, hence the name of this method.
+ *
+ * @return a reference to the first measurement item
+ */
+ T getBackReference1();
- /**
- * We do not assume measurements going from left to right or low to high, etc.
- * We only know the first and second item which where selected for this
- * measurement, hence the name of this method.
- *
- * @return a reference to the first measurement item
- */
- T getBackReference1();
+ /**
+ * @return if the measurement is either from/to the start or the end of the first measurement item.
+ * @see #getBackReference1()
+ */
+ Snap getSnap1();
- /**
- * @return if the measurement is either from/to the start or the end of the
- * first measurement item.
- * @see #getBackReference1()
- */
- Snap getSnap1();
+ /**
+ * @return the time of the first selection.
+ */
+ Number getTime1();
- /**
- * @return the time of the first selection.
- */
- Number getTime1();
+ /**
+ * We do not assume measurements going from left to right or low to high, etc. We only know the first and second
+ * item which where selected for this measurement, hence the name of this method.
+ *
+ * @return a reference to the second measurement item
+ */
+ T getBackReference2();
- /**
- * We do not assume measurements going from left to right or low to high, etc.
- * We only know the first and second item which where selected for this
- * measurement, hence the name of this method.
- *
- * @return a reference to the second measurement item
- */
- T getBackReference2();
+ /**
+ * @return if the measurement is either from/to the start or the end of the second measurement item.
+ * @see #getBackReference2()
+ */
+ Snap getSnap2();
- /**
- * @return if the measurement is either from/to the start or the end of the
- * second measurement item.
- * @see #getBackReference2()
- */
- Snap getSnap2();
+ /**
+ * @return the time of the second selection.
+ */
+ Number getTime2();
- /**
- * @return the time of the second selection.
- */
- Number getTime2();
+ /**
+ * @return the absolute duration between the two measurement points.
+ */
+ Number getDuration();
- /**
- * @return the absolute duration between the two measurement points.
- */
- Number getDuration();
-
- /**
- * @return the text that describes this measurement
- */
- default String getText() {
- return String.valueOf(getDuration());
- }
+ /**
+ * @return the text that describes this measurement
+ */
+ default String getText() {
+ return String.valueOf(getDuration());
+ }
}
diff --git a/jfreechart/org.eclipse.trace4cps.common.jfreechart.ui/src/org/eclipse/trace4cps/common/jfreechart/ui/gantt/XYGanttMeasurementAnnotation.java b/jfreechart/org.eclipse.trace4cps.common.jfreechart.ui/src/org/eclipse/trace4cps/common/jfreechart/ui/gantt/XYGanttMeasurementAnnotation.java
index 31a994beb24915d78f8bb3f8b9ab64d330507d33..567cec2c25f025bba159ba0240fbafd1ec476106 100644
--- a/jfreechart/org.eclipse.trace4cps.common.jfreechart.ui/src/org/eclipse/trace4cps/common/jfreechart/ui/gantt/XYGanttMeasurementAnnotation.java
+++ b/jfreechart/org.eclipse.trace4cps.common.jfreechart.ui/src/org/eclipse/trace4cps/common/jfreechart/ui/gantt/XYGanttMeasurementAnnotation.java
@@ -7,6 +7,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.common.jfreechart.ui.gantt;
import java.math.BigDecimal;
@@ -14,104 +15,109 @@ import java.math.BigDecimal;
import org.eclipse.trace4cps.common.jfreechart.ui.viewers.BackReferenceProvider;
import org.jfree.chart.annotations.XYMeasurementAnnotation;
-public class XYGanttMeasurementAnnotation extends XYMeasurementAnnotation implements XYGanttMeasurement, BackReferenceProvider> {
- private static final long serialVersionUID = -5836943007613577145L;
-
- private final XYGanttMeasurementAnnotationDescriptor descriptor = new XYGanttMeasurementAnnotationDescriptor(this);
- private final XYGanttDataItem extends T> item1;
- private final Snap snap1;
- private final XYGanttDataItem extends T> item2;
- private final Snap snap2;
-
- public XYGanttMeasurementAnnotation(Orientation orientation, String label, XYGanttDataItem extends T> item1, Snap snap1, XYGanttDataItem extends T> item2,
- Snap snap2) {
- super(orientation, label,
- snap1 == Snap.START ? item1.getXLowValue() : item1.getXHighValue(),
- item1.getYValue(),
- snap2 == Snap.START ? item2.getXLowValue() : item2.getXHighValue(),
- item2.getYValue());
- setBaseCreateEntity(true);
- this.item1 = item1;
- this.snap1 = snap1;
- this.item2 = item2;
- this.snap2 = snap2;
- }
-
- @Override
- public XYGanttMeasurementAnnotationDescriptor getBackReference() {
- return descriptor;
- }
-
- @Override
- public T getBackReference1() {
- return item1.getBackReference();
- }
-
- @Override
- public T getBackReference2() {
- return item2.getBackReference();
- }
-
- @Override
- public Snap getSnap1() {
- return snap1;
- }
-
- @Override
- public Snap getSnap2() {
- return snap2;
- }
-
- @Override
- public Number getTime1() {
- return getX();
- }
-
- @Override
- public Number getTime2() {
- return getX2();
- }
-
- @Override
- public Number getDuration() {
- // Try to avoid rounding errors as much as possible
- return BigDecimal.valueOf(getX2()).subtract(BigDecimal.valueOf(getX())).abs();
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = super.hashCode();
- result = prime * result + ((item1 == null) ? 0 : item1.hashCode());
- result = prime * result + ((item2 == null) ? 0 : item2.hashCode());
- result = prime * result + ((snap1 == null) ? 0 : snap1.hashCode());
- result = prime * result + ((snap2 == null) ? 0 : snap2.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (!super.equals(obj))
- return false;
- if (getClass() != obj.getClass())
- return false;
- XYGanttMeasurementAnnotation> other = (XYGanttMeasurementAnnotation>) obj;
- if (item1 == null) {
- if (other.item1 != null)
- return false;
- } else if (!item1.equals(other.item1))
- return false;
- if (item2 == null) {
- if (other.item2 != null)
- return false;
- } else if (!item2.equals(other.item2))
- return false;
- if (snap1 != other.snap1)
- return false;
- if (snap2 != other.snap2)
- return false;
- return true;
- }
+public class XYGanttMeasurementAnnotation extends XYMeasurementAnnotation
+ implements XYGanttMeasurement, BackReferenceProvider>
+{
+ private static final long serialVersionUID = -5836943007613577145L;
+
+ private final XYGanttMeasurementAnnotationDescriptor descriptor = new XYGanttMeasurementAnnotationDescriptor(
+ this);
+
+ private final XYGanttDataItem extends T> item1;
+
+ private final Snap snap1;
+
+ private final XYGanttDataItem extends T> item2;
+
+ private final Snap snap2;
+
+ public XYGanttMeasurementAnnotation(Orientation orientation, String label, XYGanttDataItem extends T> item1,
+ Snap snap1, XYGanttDataItem extends T> item2, Snap snap2)
+ {
+ super(orientation, label, snap1 == Snap.START ? item1.getXLowValue() : item1.getXHighValue(), item1.getYValue(),
+ snap2 == Snap.START ? item2.getXLowValue() : item2.getXHighValue(), item2.getYValue());
+ setBaseCreateEntity(true);
+ this.item1 = item1;
+ this.snap1 = snap1;
+ this.item2 = item2;
+ this.snap2 = snap2;
+ }
+
+ @Override
+ public XYGanttMeasurementAnnotationDescriptor getBackReference() {
+ return descriptor;
+ }
+
+ @Override
+ public T getBackReference1() {
+ return item1.getBackReference();
+ }
+
+ @Override
+ public T getBackReference2() {
+ return item2.getBackReference();
+ }
+
+ @Override
+ public Snap getSnap1() {
+ return snap1;
+ }
+
+ @Override
+ public Snap getSnap2() {
+ return snap2;
+ }
+
+ @Override
+ public Number getTime1() {
+ return getX();
+ }
+
+ @Override
+ public Number getTime2() {
+ return getX2();
+ }
+
+ @Override
+ public Number getDuration() {
+ // Try to avoid rounding errors as much as possible
+ return BigDecimal.valueOf(getX2()).subtract(BigDecimal.valueOf(getX())).abs();
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = super.hashCode();
+ result = prime * result + ((item1 == null) ? 0 : item1.hashCode());
+ result = prime * result + ((item2 == null) ? 0 : item2.hashCode());
+ result = prime * result + ((snap1 == null) ? 0 : snap1.hashCode());
+ result = prime * result + ((snap2 == null) ? 0 : snap2.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (!super.equals(obj))
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ XYGanttMeasurementAnnotation> other = (XYGanttMeasurementAnnotation>)obj;
+ if (item1 == null) {
+ if (other.item1 != null)
+ return false;
+ } else if (!item1.equals(other.item1))
+ return false;
+ if (item2 == null) {
+ if (other.item2 != null)
+ return false;
+ } else if (!item2.equals(other.item2))
+ return false;
+ if (snap1 != other.snap1)
+ return false;
+ if (snap2 != other.snap2)
+ return false;
+ return true;
+ }
}
diff --git a/jfreechart/org.eclipse.trace4cps.common.jfreechart.ui/src/org/eclipse/trace4cps/common/jfreechart/ui/gantt/XYGanttMeasurementAnnotationDescriptor.java b/jfreechart/org.eclipse.trace4cps.common.jfreechart.ui/src/org/eclipse/trace4cps/common/jfreechart/ui/gantt/XYGanttMeasurementAnnotationDescriptor.java
index ffe186bfd0733e875d31907c14160dc9f3292676..9f071a65b6f0f14325a1d0e3226f5fc5b910f6e7 100644
--- a/jfreechart/org.eclipse.trace4cps.common.jfreechart.ui/src/org/eclipse/trace4cps/common/jfreechart/ui/gantt/XYGanttMeasurementAnnotationDescriptor.java
+++ b/jfreechart/org.eclipse.trace4cps.common.jfreechart.ui/src/org/eclipse/trace4cps/common/jfreechart/ui/gantt/XYGanttMeasurementAnnotationDescriptor.java
@@ -7,6 +7,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.common.jfreechart.ui.gantt;
import org.eclipse.ui.views.properties.IPropertyDescriptor;
@@ -15,93 +16,97 @@ import org.eclipse.ui.views.properties.PropertyDescriptor;
import org.eclipse.ui.views.properties.TextPropertyDescriptor;
class XYGanttMeasurementAnnotationDescriptor implements IPropertySource, XYGanttMeasurement {
- private enum Properties { Label, Duration };
-
- private final XYGanttMeasurementAnnotation annotation;
-
- private IPropertyDescriptor[] propertyDescriptors;
-
- public XYGanttMeasurementAnnotationDescriptor(XYGanttMeasurementAnnotation annotation) {
- this.annotation = annotation;
- }
-
- @Override
- public Object getEditableValue() {
- return this;
- }
-
- @Override
- public IPropertyDescriptor[] getPropertyDescriptors() {
- if (null == propertyDescriptors) {
- TextPropertyDescriptor labelProperty = new TextPropertyDescriptor(Properties.Label, Properties.Label.name());
- PropertyDescriptor durationProperty = new PropertyDescriptor(Properties.Duration, Properties.Duration.name());
- propertyDescriptors = new IPropertyDescriptor[] { labelProperty, durationProperty };
- }
- return propertyDescriptors;
- }
-
- @Override
- public Object getPropertyValue(Object id) {
- switch ((XYGanttMeasurementAnnotationDescriptor.Properties) id) {
- case Label:
- return annotation.getText();
- case Duration:
- return annotation.getDuration();
- }
- return null;
- }
-
- @Override
- public boolean isPropertySet(Object id) {
- return true;
- }
-
- @Override
- public void resetPropertyValue(Object id) {
- if (id == Properties.Label) {
- annotation.setText("");
- }
- }
-
- @Override
- public void setPropertyValue(Object id, Object value) {
- if (id == Properties.Label) {
- annotation.setText(String.valueOf(value));
- }
- }
-
- @Override
- public T getBackReference1() {
- return annotation.getBackReference1();
- }
-
- @Override
- public Snap getSnap1() {
- return annotation.getSnap1();
- }
-
- @Override
- public Number getTime1() {
- return annotation.getTime1();
- }
-
- @Override
- public T getBackReference2() {
- return annotation.getBackReference2();
- }
-
- @Override
- public Snap getSnap2() {
- return annotation.getSnap2();
- }
-
- @Override
- public Number getTime2() {
- return annotation.getTime2();
- }
-
- @Override
- public Number getDuration() {
- return annotation.getDuration();
- }
-}
\ No newline at end of file
+ private enum Properties {
+ Label, Duration
+ }
+
+ private final XYGanttMeasurementAnnotation annotation;
+
+ private IPropertyDescriptor[] propertyDescriptors;
+
+ public XYGanttMeasurementAnnotationDescriptor(XYGanttMeasurementAnnotation annotation) {
+ this.annotation = annotation;
+ }
+
+ @Override
+ public Object getEditableValue() {
+ return this;
+ }
+
+ @Override
+ public IPropertyDescriptor[] getPropertyDescriptors() {
+ if (null == propertyDescriptors) {
+ TextPropertyDescriptor labelProperty = new TextPropertyDescriptor(Properties.Label,
+ Properties.Label.name());
+ PropertyDescriptor durationProperty = new PropertyDescriptor(Properties.Duration,
+ Properties.Duration.name());
+ propertyDescriptors = new IPropertyDescriptor[] {labelProperty, durationProperty};
+ }
+ return propertyDescriptors;
+ }
+
+ @Override
+ public Object getPropertyValue(Object id) {
+ switch ((XYGanttMeasurementAnnotationDescriptor.Properties)id) {
+ case Label:
+ return annotation.getText();
+ case Duration:
+ return annotation.getDuration();
+ }
+ return null;
+ }
+
+ @Override
+ public boolean isPropertySet(Object id) {
+ return true;
+ }
+
+ @Override
+ public void resetPropertyValue(Object id) {
+ if (id == Properties.Label) {
+ annotation.setText("");
+ }
+ }
+
+ @Override
+ public void setPropertyValue(Object id, Object value) {
+ if (id == Properties.Label) {
+ annotation.setText(String.valueOf(value));
+ }
+ }
+
+ @Override
+ public T getBackReference1() {
+ return annotation.getBackReference1();
+ }
+
+ @Override
+ public Snap getSnap1() {
+ return annotation.getSnap1();
+ }
+
+ @Override
+ public Number getTime1() {
+ return annotation.getTime1();
+ }
+
+ @Override
+ public T getBackReference2() {
+ return annotation.getBackReference2();
+ }
+
+ @Override
+ public Snap getSnap2() {
+ return annotation.getSnap2();
+ }
+
+ @Override
+ public Number getTime2() {
+ return annotation.getTime2();
+ }
+
+ @Override
+ public Number getDuration() {
+ return annotation.getDuration();
+ }
+}
diff --git a/jfreechart/org.eclipse.trace4cps.common.jfreechart.ui/src/org/eclipse/trace4cps/common/jfreechart/ui/internal/ChartPanelFactory.java b/jfreechart/org.eclipse.trace4cps.common.jfreechart.ui/src/org/eclipse/trace4cps/common/jfreechart/ui/internal/ChartPanelFactory.java
index 8146b1cbcea2ff61a5935c4d9de935857fd9e545..7717a938e7d2feb7512d4fd47d600e8db3d8e3a1 100644
--- a/jfreechart/org.eclipse.trace4cps.common.jfreechart.ui/src/org/eclipse/trace4cps/common/jfreechart/ui/internal/ChartPanelFactory.java
+++ b/jfreechart/org.eclipse.trace4cps.common.jfreechart.ui/src/org/eclipse/trace4cps/common/jfreechart/ui/internal/ChartPanelFactory.java
@@ -7,6 +7,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.common.jfreechart.ui.internal;
import java.awt.event.InputEvent;
@@ -28,7 +29,7 @@ public class ChartPanelFactory {
public static ChartPanel createChartPanel(JFreeChart chart) {
return configureChartPanel(new OfflineRenderingChartPanel(chart));
}
-
+
public static ChartPanel configureChartPanel(ChartPanel chartPanel) {
chartPanel.setZoomAroundAnchor(true);
chartPanel.setZoomOutFactor(1.25);
diff --git a/jfreechart/org.eclipse.trace4cps.common.jfreechart.ui/src/org/eclipse/trace4cps/common/jfreechart/ui/internal/ChartPanelScrollbarHandler.java b/jfreechart/org.eclipse.trace4cps.common.jfreechart.ui/src/org/eclipse/trace4cps/common/jfreechart/ui/internal/ChartPanelScrollbarHandler.java
index 6d6746d1c51457d6dc597f08dff46529900914aa..baebeaf538f27faac748ee3d3fecd111c1055fd8 100644
--- a/jfreechart/org.eclipse.trace4cps.common.jfreechart.ui/src/org/eclipse/trace4cps/common/jfreechart/ui/internal/ChartPanelScrollbarHandler.java
+++ b/jfreechart/org.eclipse.trace4cps.common.jfreechart.ui/src/org/eclipse/trace4cps/common/jfreechart/ui/internal/ChartPanelScrollbarHandler.java
@@ -7,6 +7,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.common.jfreechart.ui.internal;
import static org.eclipse.core.runtime.IStatus.WARNING;
@@ -36,21 +37,24 @@ import org.jfree.chart.plot.PlotOrientation;
import org.jfree.chart.plot.XYPlot;
import org.jfree.data.Range;
-public class ChartPanelScrollbarHandler extends SelectionAdapter
- implements PropertyChangeListener, PlotChangeListener {
+public class ChartPanelScrollbarHandler extends SelectionAdapter implements PropertyChangeListener, PlotChangeListener {
// Numbers bigger than this lead to unwanted scrollbar behavior
// i.e. sometimes the scroll direction changes when using the mouse wheel
- private static int SCROLLBAR_LENGTH = 50_000_000;
+ private static final int SCROLLBAR_LENGTH = 50_000_000;
private final Map axesAutoRanges = new WeakHashMap<>();
+
private final ChartPanelComposite chartPanelComposite;
private double incrementFactor = 0.1;
+
private double pageIncrementFactor = 0.9;
private XYPlot currentPlot;
+
private Range lastDomainRange;
+
private Range lastRangeRange;
public ChartPanelScrollbarHandler(ChartPanelComposite composite) {
@@ -75,8 +79,7 @@ public class ChartPanelScrollbarHandler extends SelectionAdapter
public void dispose() {
boolean scroll = false;
if (null != chartPanelComposite.getHorizontalBar()) {
- chartPanelComposite.getHorizontalBar()
- .removeSelectionListener(this);
+ chartPanelComposite.getHorizontalBar().removeSelectionListener(this);
scroll = true;
}
if (null != chartPanelComposite.getVerticalBar()) {
@@ -85,8 +88,7 @@ public class ChartPanelScrollbarHandler extends SelectionAdapter
}
if (scroll) {
setChart(null);
- chartPanelComposite.getChartPanel()
- .removePropertyChangeListener(this);
+ chartPanelComposite.getChartPanel().removePropertyChangeListener(this);
}
}
@@ -109,7 +111,7 @@ public class ChartPanelScrollbarHandler extends SelectionAdapter
@Override
public void propertyChange(PropertyChangeEvent event) {
if (ChartPanel.PROPERTY_CHART.equals(event.getPropertyName())) {
- setChart((JFreeChart) event.getNewValue());
+ setChart((JFreeChart)event.getNewValue());
}
}
@@ -118,7 +120,7 @@ public class ChartPanelScrollbarHandler extends SelectionAdapter
currentPlot.removeChangeListener(this);
}
if (null != chart && chart.getPlot() instanceof XYPlot) {
- currentPlot = (XYPlot) chart.getPlot();
+ currentPlot = (XYPlot)chart.getPlot();
currentPlot.addChangeListener(this);
}
currentPlotChanged();
@@ -134,17 +136,14 @@ public class ChartPanelScrollbarHandler extends SelectionAdapter
private void currentPlotChanged() {
boolean autoRangesChanged = cacheAutoRanges();
- ValueAxis domainAxis = null == currentPlot ? null
- : currentPlot.getDomainAxis();
+ ValueAxis domainAxis = null == currentPlot ? null : currentPlot.getDomainAxis();
if (null != domainAxis) {
final Range domainRange = domainAxis.getRange();
- if (autoRangesChanged
- || !Objects.equals(domainRange, lastDomainRange)) {
+ if (autoRangesChanged || !Objects.equals(domainRange, lastDomainRange)) {
lastDomainRange = domainRange;
final Range domainAutoRange = axesAutoRanges.get(domainAxis);
if (null != domainAutoRange) {
- updateScrollBar(this::getDomainBar, domainRange,
- domainAutoRange);
+ updateScrollBar(this::getDomainBar, domainRange, domainAutoRange);
} else {
IStatus status = new Status(WARNING, PLUGIN_ID,
"Skipped update: Unknown auto range for domain axis");
@@ -155,17 +154,14 @@ public class ChartPanelScrollbarHandler extends SelectionAdapter
disableScrollBar(this::getDomainBar);
}
- ValueAxis rangeAxis = null == currentPlot ? null
- : currentPlot.getRangeAxis();
+ ValueAxis rangeAxis = null == currentPlot ? null : currentPlot.getRangeAxis();
if (null != rangeAxis) {
final Range rangeRange = rangeAxis.getRange();
- if (autoRangesChanged
- || !Objects.equals(rangeRange, lastRangeRange)) {
+ if (autoRangesChanged || !Objects.equals(rangeRange, lastRangeRange)) {
lastRangeRange = rangeRange;
final Range rangeAutoRange = axesAutoRanges.get(rangeAxis);
if (null != rangeAutoRange) {
- updateScrollBar(this::getRangeBar, rangeRange,
- rangeAutoRange);
+ updateScrollBar(this::getRangeBar, rangeRange, rangeAutoRange);
} else {
IStatus status = new Status(WARNING, PLUGIN_ID,
"Skipped update: Unknown auto range for range axis");
@@ -180,25 +176,20 @@ public class ChartPanelScrollbarHandler extends SelectionAdapter
private void disableScrollBar(final Supplier scrollBarSupplier) {
chartPanelComposite.getDisplay().asyncExec(() -> {
ScrollBar scrollBar = scrollBarSupplier.get();
- if (scrollBar != null && !scrollBar.isDisposed()
- && scrollBar.isEnabled()) {
+ if (scrollBar != null && !scrollBar.isDisposed() && scrollBar.isEnabled()) {
scrollBar.setEnabled(false);
}
});
}
- private void updateScrollBar(final Supplier scrollBarSupplier,
- Range viewRange, Range autoRange) {
+ private void updateScrollBar(final Supplier scrollBarSupplier, Range viewRange, Range autoRange) {
chartPanelComposite.getDisplay().asyncExec(() -> {
ScrollBar scrollBar = scrollBarSupplier.get();
if (null == scrollBar || scrollBar.isDisposed()) {
return;
}
- SCROLLBAR_LENGTH = 50_000_000;
-
- double thumbPercentage = viewRange.getLength()
- / autoRange.getLength();
+ double thumbPercentage = viewRange.getLength() / autoRange.getLength();
double thumb = thumbPercentage * SCROLLBAR_LENGTH;
boolean enabled = thumb >= 1 && thumb < SCROLLBAR_LENGTH;
scrollBar.setEnabled(enabled);
@@ -208,8 +199,8 @@ public class ChartPanelScrollbarHandler extends SelectionAdapter
double increment = Math.max(thumb * incrementFactor, 1);
double pageIncrement = Math.max(thumb * pageIncrementFactor, 1);
- double selectionPercentage = (viewRange.getLowerBound()
- - autoRange.getLowerBound()) / autoRange.getLength();
+ double selectionPercentage = (viewRange.getLowerBound() - autoRange.getLowerBound())
+ / autoRange.getLength();
double selection = selectionPercentage * SCROLLBAR_LENGTH;
if (selection < 0) {
selection = 0;
@@ -221,8 +212,8 @@ public class ChartPanelScrollbarHandler extends SelectionAdapter
selection = SCROLLBAR_LENGTH - selection - thumb;
}
- scrollBar.setValues(round(selection), 0, SCROLLBAR_LENGTH,
- round(thumb), round(increment), round(pageIncrement));
+ scrollBar.setValues(round(selection), 0, SCROLLBAR_LENGTH, round(thumb), round(increment),
+ round(pageIncrement));
});
}
@@ -242,14 +233,14 @@ public class ChartPanelScrollbarHandler extends SelectionAdapter
for (int i = 0; i < currentPlot.getDomainAxisCount(); i++) {
final ValueAxis domainAxis = currentPlot.getDomainAxis(i);
if (domainAxis != null) {
- updateAxisRange((ScrollBar) source, domainAxis);
+ updateAxisRange((ScrollBar)source, domainAxis);
}
}
} else if (source == getRangeBar()) {
for (int i = 0; i < currentPlot.getRangeAxisCount(); i++) {
final ValueAxis rangeAxis = currentPlot.getRangeAxis(i);
if (rangeAxis != null) {
- updateAxisRange((ScrollBar) source, rangeAxis);
+ updateAxisRange((ScrollBar)source, rangeAxis);
}
}
}
@@ -262,9 +253,9 @@ public class ChartPanelScrollbarHandler extends SelectionAdapter
}
Range autoRange = axesAutoRanges.get(axis);
if (null == autoRange) {
- IStatus status = new Status(WARNING, PLUGIN_ID, String.format(
- "Skipped update: Unknown auto range for axis: %s (type: %s)",
- axis.getLabel(), axis.getClass().getName()));
+ IStatus status = new Status(WARNING, PLUGIN_ID,
+ String.format("Skipped update: Unknown auto range for axis: %s (type: %s)", axis.getLabel(),
+ axis.getClass().getName()));
JFreeChartUIPlugin.getDefault().getLog().log(status);
return;
}
@@ -279,8 +270,7 @@ public class ChartPanelScrollbarHandler extends SelectionAdapter
double selectionPercentage = selection / length;
double thumbPercentage = thumb / length;
- double lower = autoRange.getLowerBound()
- + (selectionPercentage * autoRange.getLength());
+ double lower = autoRange.getLowerBound() + (selectionPercentage * autoRange.getLength());
double upper = lower + (thumbPercentage * autoRange.getLength());
axis.setRange(new Range(lower, upper), true, true);
}
@@ -312,24 +302,23 @@ public class ChartPanelScrollbarHandler extends SelectionAdapter
*/
protected boolean cacheAutoRange(ValueAxis axis) {
Range newRange = axis.calculateAutoRange(false);
- Range oldRange = null == newRange ? axesAutoRanges.remove(axis)
- : axesAutoRanges.put(axis, newRange);
+ Range oldRange = null == newRange ? axesAutoRanges.remove(axis) : axesAutoRanges.put(axis, newRange);
return !Objects.equals(oldRange, newRange);
}
protected ScrollBar getDomainBar() {
- if (null == currentPlot)
+ if (null == currentPlot) {
return null;
- return currentPlot.getOrientation() == PlotOrientation.VERTICAL
- ? chartPanelComposite.getHorizontalBar()
+ }
+ return currentPlot.getOrientation() == PlotOrientation.VERTICAL ? chartPanelComposite.getHorizontalBar()
: chartPanelComposite.getVerticalBar();
}
protected ScrollBar getRangeBar() {
- if (null == currentPlot)
+ if (null == currentPlot) {
return null;
- return currentPlot.getOrientation() == PlotOrientation.VERTICAL
- ? chartPanelComposite.getVerticalBar()
+ }
+ return currentPlot.getOrientation() == PlotOrientation.VERTICAL ? chartPanelComposite.getVerticalBar()
: chartPanelComposite.getHorizontalBar();
}
}
diff --git a/jfreechart/org.eclipse.trace4cps.common.jfreechart.ui/src/org/eclipse/trace4cps/common/jfreechart/ui/internal/DefaultChartThemeSupplier.java b/jfreechart/org.eclipse.trace4cps.common.jfreechart.ui/src/org/eclipse/trace4cps/common/jfreechart/ui/internal/DefaultChartThemeSupplier.java
index b774529f2de458a36a0e9af5b1b4758b2645720e..a4ca789f24a71a602fdc233ddfc23834cbdbf8e4 100644
--- a/jfreechart/org.eclipse.trace4cps.common.jfreechart.ui/src/org/eclipse/trace4cps/common/jfreechart/ui/internal/DefaultChartThemeSupplier.java
+++ b/jfreechart/org.eclipse.trace4cps.common.jfreechart.ui/src/org/eclipse/trace4cps/common/jfreechart/ui/internal/DefaultChartThemeSupplier.java
@@ -7,6 +7,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.common.jfreechart.ui.internal;
import org.eclipse.trace4cps.common.jfreechart.ui.theme.ChartThemeSupplier;
diff --git a/jfreechart/org.eclipse.trace4cps.common.jfreechart.ui/src/org/eclipse/trace4cps/common/jfreechart/ui/theme/ChartThemeSupplier.java b/jfreechart/org.eclipse.trace4cps.common.jfreechart.ui/src/org/eclipse/trace4cps/common/jfreechart/ui/theme/ChartThemeSupplier.java
index 185cd87eb113108d87f453871610b01bdcc0446b..3e40436f18cb26d2eef9345f0baa22040f67800c 100644
--- a/jfreechart/org.eclipse.trace4cps.common.jfreechart.ui/src/org/eclipse/trace4cps/common/jfreechart/ui/theme/ChartThemeSupplier.java
+++ b/jfreechart/org.eclipse.trace4cps.common.jfreechart.ui/src/org/eclipse/trace4cps/common/jfreechart/ui/theme/ChartThemeSupplier.java
@@ -7,6 +7,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.common.jfreechart.ui.theme;
import org.jfree.chart.ChartTheme;
diff --git a/jfreechart/org.eclipse.trace4cps.common.jfreechart.ui/src/org/eclipse/trace4cps/common/jfreechart/ui/theme/DefaultChartTheme.java b/jfreechart/org.eclipse.trace4cps.common.jfreechart.ui/src/org/eclipse/trace4cps/common/jfreechart/ui/theme/DefaultChartTheme.java
index b1cf6cd1df13abdc2b43a307028a1345d48d9139..14d9c8f845157aa98deb9cfbbcf6bc5dedee414c 100644
--- a/jfreechart/org.eclipse.trace4cps.common.jfreechart.ui/src/org/eclipse/trace4cps/common/jfreechart/ui/theme/DefaultChartTheme.java
+++ b/jfreechart/org.eclipse.trace4cps.common.jfreechart.ui/src/org/eclipse/trace4cps/common/jfreechart/ui/theme/DefaultChartTheme.java
@@ -7,6 +7,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.common.jfreechart.ui.theme;
import java.awt.Color;
@@ -77,22 +78,14 @@ public class DefaultChartTheme extends StandardChartTheme {
if (PlatformUI.isWorkbenchRunning()) {
IWorkbench workbench = PlatformUI.getWorkbench();
Display display = workbench.getDisplay();
- FontRegistry fontRegistry = workbench.getThemeManager()
- .getCurrentTheme().getFontRegistry();
+ FontRegistry fontRegistry = workbench.getThemeManager().getCurrentTheme().getFontRegistry();
// JFace doesn't define 'small' font, so derive it from the regular font
- Font regularFont = toAwtFont(display,
- fontRegistry.getFontData(JFaceResources.DIALOG_FONT)[0],
- true);
- Font smallFont = regularFont
- .deriveFont(Math.max(regularFont.getSize() - 1.0f, 1));
-
- setExtraLargeFont(toAwtFont(display,
- fontRegistry.getFontData(JFaceResources.HEADER_FONT)[0],
- true));
- setLargeFont(toAwtFont(display,
- fontRegistry.getFontData(JFaceResources.BANNER_FONT)[0],
- true));
+ Font regularFont = toAwtFont(display, fontRegistry.getFontData(JFaceResources.DIALOG_FONT)[0], true);
+ Font smallFont = regularFont.deriveFont(Math.max(regularFont.getSize() - 1.0f, 1));
+
+ setExtraLargeFont(toAwtFont(display, fontRegistry.getFontData(JFaceResources.HEADER_FONT)[0], true));
+ setLargeFont(toAwtFont(display, fontRegistry.getFontData(JFaceResources.BANNER_FONT)[0], true));
setRegularFont(regularFont);
setSmallFont(smallFont);
} else {
@@ -156,7 +149,7 @@ public class DefaultChartTheme extends StandardChartTheme {
renderer.setItemLabelInsets(new RectangleInsets(1, 5, 1, 5));
renderer.setDefaultPositiveItemLabelPosition(
- new ItemLabelPosition(ItemLabelAnchor.CENTER, TextAnchor.CENTER, ItemLabelClip.FIT));
+ new ItemLabelPosition(ItemLabelAnchor.CENTER, TextAnchor.CENTER, ItemLabelClip.FIT));
}
@Override
@@ -164,7 +157,7 @@ public class DefaultChartTheme extends StandardChartTheme {
super.applyToXYItemRenderer(renderer);
if (renderer instanceof XYBarRenderer) {
- applyToXYBarRenderer((XYBarRenderer) renderer);
+ applyToXYBarRenderer((XYBarRenderer)renderer);
}
}
@@ -174,7 +167,7 @@ public class DefaultChartTheme extends StandardChartTheme {
renderer.setAutoPopulateSeriesOutlinePaint(true);
renderer.setComputeItemLabelContrastColor(true);
}
-
+
// Prevent to draw label in small bars
final Font font = renderer.getDefaultItemLabelFont();
final FontRenderContext fontRenderContext = new FontRenderContext(font.getTransform(), true, true);
@@ -187,24 +180,24 @@ public class DefaultChartTheme extends StandardChartTheme {
new ItemLabelPosition(ItemLabelAnchor.INSIDE9, TextAnchor.CENTER_LEFT, ItemLabelClip.CLIP));
}
- @Override
- protected void applyToXYAnnotation(XYAnnotation annotation) {
- super.applyToXYAnnotation(annotation);
- if (annotation instanceof XYMeasurementAnnotation) {
- applyToXYMeasurementAnnotation((XYMeasurementAnnotation) annotation);
- }
- }
+ @Override
+ protected void applyToXYAnnotation(XYAnnotation annotation) {
+ super.applyToXYAnnotation(annotation);
+ if (annotation instanceof XYMeasurementAnnotation) {
+ applyToXYMeasurementAnnotation((XYMeasurementAnnotation)annotation);
+ }
+ }
- protected void applyToXYMeasurementAnnotation(XYMeasurementAnnotation annotation) {
- annotation.setFont(getRegularFont());
- annotation.setPaint(Color.RED);
- }
+ protected void applyToXYMeasurementAnnotation(XYMeasurementAnnotation annotation) {
+ annotation.setFont(getRegularFont());
+ annotation.setPaint(Color.RED);
+ }
@Override
protected void applyToValueAxis(ValueAxis axis) {
super.applyToValueAxis(axis);
if (axis instanceof SectionAxis) {
- applyToSectionsAxis((SectionAxis) axis);
+ applyToSectionsAxis((SectionAxis)axis);
}
}
@@ -223,45 +216,35 @@ public class DefaultChartTheme extends StandardChartTheme {
}
}
- private static final String Az = "ABCpqr";
+ private static final String AZ = "ABCpqr";
- private static final FontRenderContext DEFAULT_FONT_RENDER_CONTEXT = new FontRenderContext(
- null, true, true);
+ private static final FontRenderContext DEFAULT_FONT_RENDER_CONTEXT = new FontRenderContext(null, true, true);
/**
- * Create an awt font by converting as much information as possible from the
- * provided swt FontData.
+ * Create an awt font by converting as much information as possible from the provided swt FontData.
*
- * Generally speaking, given a font size, an swt font will display
- * differently on the screen than the corresponding awt one. Because the SWT
- * toolkit use native graphical ressources whenever it is possible, this
- * fact is platform dependent. To address this issue, it is possible to
- * enforce the method to return an awt font with the same height as the swt
- * one.
+ * Generally speaking, given a font size, an swt font will display differently on the screen than the corresponding
+ * awt one. Because the SWT toolkit use native graphical ressources whenever it is possible, this fact is platform
+ * dependent. To address this issue, it is possible to enforce the method to return an awt font with the same height
+ * as the swt one.
+ *
*
- * @param device The swt device being drawn on (display or gc
- * device).
- * @param fontData The swt font to convert.
- * @param ensureSameSize A boolean used to enforce the same size (in pixels)
- * between the swt font and the newly created awt
- * font.
+ * @param device The swt device being drawn on (display or gc device).
+ * @param fontData The swt font to convert.
+ * @param ensureSameSize A boolean used to enforce the same size (in pixels) between the swt font and the newly
+ * created awt font.
* @return An awt font converted from the provided swt font.
* @see org.jfree.experimental.swt.SwtUtils#toAwtFont
*/
- public static Font toAwtFont(Device device, FontData fontData,
- boolean ensureSameSize) {
- Font font = new Font(fontData.getName(), fontData.getStyle(),
- fontData.getHeight());
+ public static Font toAwtFont(Device device, FontData fontData, boolean ensureSameSize) {
+ Font font = new Font(fontData.getName(), fontData.getStyle(), fontData.getHeight());
if (ensureSameSize) {
GC tmpGC = new GC(device);
- org.eclipse.swt.graphics.Font tmpFont = new org.eclipse.swt.graphics.Font(
- device, fontData);
+ org.eclipse.swt.graphics.Font tmpFont = new org.eclipse.swt.graphics.Font(device, fontData);
tmpGC.setFont(tmpFont);
- int swtHeight = tmpGC.textExtent(Az).y;
- float awtHeight = (float) font
- .getStringBounds(Az, DEFAULT_FONT_RENDER_CONTEXT)
- .getHeight();
+ int swtHeight = tmpGC.textExtent(AZ).y;
+ float awtHeight = (float)font.getStringBounds(AZ, DEFAULT_FONT_RENDER_CONTEXT).getHeight();
float scaledSize = (swtHeight * fontData.getHeight()) / awtHeight;
font = font.deriveFont(scaledSize);
diff --git a/jfreechart/org.eclipse.trace4cps.common.jfreechart.ui/src/org/eclipse/trace4cps/common/jfreechart/ui/viewers/BackReferenceProvider.java b/jfreechart/org.eclipse.trace4cps.common.jfreechart.ui/src/org/eclipse/trace4cps/common/jfreechart/ui/viewers/BackReferenceProvider.java
index 81608da19d63cf8a4f629a153fdbd8baa653cae9..241dea560193023544dec0f98d5738a56ed421ac 100644
--- a/jfreechart/org.eclipse.trace4cps.common.jfreechart.ui/src/org/eclipse/trace4cps/common/jfreechart/ui/viewers/BackReferenceProvider.java
+++ b/jfreechart/org.eclipse.trace4cps.common.jfreechart.ui/src/org/eclipse/trace4cps/common/jfreechart/ui/viewers/BackReferenceProvider.java
@@ -7,6 +7,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.common.jfreechart.ui.viewers;
public interface BackReferenceProvider {
diff --git a/jfreechart/org.eclipse.trace4cps.common.jfreechart.ui/src/org/eclipse/trace4cps/common/jfreechart/ui/viewers/BackReferenceResolver.java b/jfreechart/org.eclipse.trace4cps.common.jfreechart.ui/src/org/eclipse/trace4cps/common/jfreechart/ui/viewers/BackReferenceResolver.java
index 7da50fe16fd7369a380fff6c9119ecaad6695b3e..ef6ff57d9fca396e03869bf6efcb6e4bff17a495 100644
--- a/jfreechart/org.eclipse.trace4cps.common.jfreechart.ui/src/org/eclipse/trace4cps/common/jfreechart/ui/viewers/BackReferenceResolver.java
+++ b/jfreechart/org.eclipse.trace4cps.common.jfreechart.ui/src/org/eclipse/trace4cps/common/jfreechart/ui/viewers/BackReferenceResolver.java
@@ -7,6 +7,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.common.jfreechart.ui.viewers;
import org.eclipse.trace4cps.common.jfreechart.data.xy.XYEdgeSeriesCollection;
@@ -29,94 +30,74 @@ import org.jfree.data.xy.YIntervalSeriesCollection;
public class BackReferenceResolver {
public static final BackReferenceResolver DEFAULT = new BackReferenceResolver();
- public BackReferenceProvider> resolveBackReferenceProvider(
- ChartMouseEvent event) {
+ public BackReferenceProvider> resolveBackReferenceProvider(ChartMouseEvent event) {
return resolveBackReferenceProvider(event.getEntity());
}
- public BackReferenceProvider> resolveBackReferenceProvider(
- ChartEntity chartEntity) {
+ public BackReferenceProvider> resolveBackReferenceProvider(ChartEntity chartEntity) {
return doResolveBackReferenceProvider(chartEntity);
}
- public BackReferenceProvider> resolveBackReferenceProvider(
- Annotation annotation) {
+ public BackReferenceProvider> resolveBackReferenceProvider(Annotation annotation) {
return doResolveBackReferenceProvider(annotation);
}
- public BackReferenceProvider> resolveBackReferenceProvider(
- XYDataset dataset, int series, int item) {
- return doResolveBackReferenceProvider(
- resolveDataItem(dataset, series, item));
+ public BackReferenceProvider> resolveBackReferenceProvider(XYDataset dataset, int series, int item) {
+ return doResolveBackReferenceProvider(resolveDataItem(dataset, series, item));
}
- protected BackReferenceProvider> doResolveBackReferenceProvider(
- Object o) {
+ protected BackReferenceProvider> doResolveBackReferenceProvider(Object o) {
BackReferenceProvider> backReferenceProvider = null;
if (o instanceof BackReferenceProvider>) {
- backReferenceProvider = (BackReferenceProvider>) o;
+ backReferenceProvider = (BackReferenceProvider>)o;
} else if (o instanceof XYItemEntity) {
- final XYItemEntity entity = (XYItemEntity) o;
- backReferenceProvider = resolveBackReferenceProvider(
- entity.getDataset(), entity.getSeriesIndex(),
+ final XYItemEntity entity = (XYItemEntity)o;
+ backReferenceProvider = resolveBackReferenceProvider(entity.getDataset(), entity.getSeriesIndex(),
entity.getItem());
} else if (o instanceof PieSectionEntity) {
- final PieSectionEntity entity = (PieSectionEntity) o;
- backReferenceProvider = doResolveBackReferenceProvider(
- entity.getSectionKey());
+ final PieSectionEntity entity = (PieSectionEntity)o;
+ backReferenceProvider = doResolveBackReferenceProvider(entity.getSectionKey());
} else if (o instanceof CategoryItemEntity) {
- final CategoryItemEntity entity = (CategoryItemEntity) o;
- backReferenceProvider = doResolveBackReferenceProvider(
- entity.getColumnKey());
+ final CategoryItemEntity entity = (CategoryItemEntity)o;
+ backReferenceProvider = doResolveBackReferenceProvider(entity.getColumnKey());
if (backReferenceProvider == null) {
- backReferenceProvider = doResolveBackReferenceProvider(
- entity.getRowKey());
+ backReferenceProvider = doResolveBackReferenceProvider(entity.getRowKey());
}
}
return backReferenceProvider;
}
protected Object resolveDataItem(XYDataset dataset, int series, int item) {
- if (series >= dataset.getSeriesCount()
- || item >= dataset.getItemCount(series)) {
+ if (series >= dataset.getSeriesCount() || item >= dataset.getItemCount(series)) {
// Avoiding java.lang.IndexOutOfBoundsException
return null;
}
if (dataset instanceof XYIntervalSeriesCollection) {
- return ((XYIntervalSeriesCollection) dataset).getSeries(series)
- .getDataItem(item);
+ return ((XYIntervalSeriesCollection)dataset).getSeries(series).getDataItem(item);
}
if (dataset instanceof XYSeriesCollection) {
- return ((XYSeriesCollection) dataset).getSeries(series)
- .getDataItem(item);
+ return ((XYSeriesCollection)dataset).getSeries(series).getDataItem(item);
}
if (dataset instanceof XYEdgeSeriesCollection) {
- return ((XYEdgeSeriesCollection) dataset).getSeries(series)
- .getDataItem(item);
+ return ((XYEdgeSeriesCollection)dataset).getSeries(series).getDataItem(item);
}
if (dataset instanceof XIntervalSeriesCollection) {
- return ((XIntervalSeriesCollection) dataset).getSeries(series)
- .getDataItem(item);
+ return ((XIntervalSeriesCollection)dataset).getSeries(series).getDataItem(item);
}
if (dataset instanceof YIntervalSeriesCollection) {
- return ((YIntervalSeriesCollection) dataset).getSeries(series)
- .getDataItem(item);
+ return ((YIntervalSeriesCollection)dataset).getSeries(series).getDataItem(item);
}
if (dataset instanceof OHLCSeriesCollection) {
- return ((OHLCSeriesCollection) dataset).getSeries(series)
- .getDataItem(item);
+ return ((OHLCSeriesCollection)dataset).getSeries(series).getDataItem(item);
}
if (dataset instanceof TimePeriodValuesCollection) {
- return ((TimePeriodValuesCollection) dataset).getSeries(series)
- .getDataItem(item);
+ return ((TimePeriodValuesCollection)dataset).getSeries(series).getDataItem(item);
}
if (dataset instanceof TimeSeriesCollection) {
- return ((TimeSeriesCollection) dataset).getSeries(series)
- .getDataItem(item);
+ return ((TimeSeriesCollection)dataset).getSeries(series).getDataItem(item);
}
if (dataset instanceof VectorSeriesCollection) {
- return ((VectorSeriesCollection) dataset).getSeries(series)
- .getDataItem(item);
+ return ((VectorSeriesCollection)dataset).getSeries(series).getDataItem(item);
}
return null;
}
diff --git a/jfreechart/org.eclipse.trace4cps.common.jfreechart.ui/src/org/eclipse/trace4cps/common/jfreechart/ui/viewers/BackReferenceTextGenerator.java b/jfreechart/org.eclipse.trace4cps.common.jfreechart.ui/src/org/eclipse/trace4cps/common/jfreechart/ui/viewers/BackReferenceTextGenerator.java
index 87bc98c7f87584673f82f19ae357d90137705518..56b21f9d4f6b06f66f5e2dabee7af43375f01c06 100644
--- a/jfreechart/org.eclipse.trace4cps.common.jfreechart.ui/src/org/eclipse/trace4cps/common/jfreechart/ui/viewers/BackReferenceTextGenerator.java
+++ b/jfreechart/org.eclipse.trace4cps.common.jfreechart.ui/src/org/eclipse/trace4cps/common/jfreechart/ui/viewers/BackReferenceTextGenerator.java
@@ -7,6 +7,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.common.jfreechart.ui.viewers;
import org.eclipse.jface.viewers.ILabelProvider;
@@ -15,9 +16,9 @@ import org.jfree.chart.labels.XYItemLabelGenerator;
import org.jfree.chart.labels.XYToolTipGenerator;
import org.jfree.data.xy.XYDataset;
-public class BackReferenceTextGenerator
- implements XYItemLabelGenerator, XYToolTipGenerator {
+public class BackReferenceTextGenerator implements XYItemLabelGenerator, XYToolTipGenerator {
private final ILabelProvider labelProvider;
+
private final BackReferenceResolver backReferenceResolver;
public BackReferenceTextGenerator() {
@@ -28,8 +29,7 @@ public class BackReferenceTextGenerator
this(labelProvider, BackReferenceResolver.DEFAULT);
}
- public BackReferenceTextGenerator(ILabelProvider labelProvider,
- BackReferenceResolver backReferenceResolver) {
+ public BackReferenceTextGenerator(ILabelProvider labelProvider, BackReferenceResolver backReferenceResolver) {
this.labelProvider = labelProvider;
this.backReferenceResolver = backReferenceResolver;
}
diff --git a/jfreechart/org.eclipse.trace4cps.common.jfreechart.ui/src/org/eclipse/trace4cps/common/jfreechart/ui/viewers/ChartPanelContentViewer.java b/jfreechart/org.eclipse.trace4cps.common.jfreechart.ui/src/org/eclipse/trace4cps/common/jfreechart/ui/viewers/ChartPanelContentViewer.java
index bccee966052e8deb9dc3dfb4c340532ed8a54cba..88433389842fb55f5ad59afb307bc704b01a1317 100644
--- a/jfreechart/org.eclipse.trace4cps.common.jfreechart.ui/src/org/eclipse/trace4cps/common/jfreechart/ui/viewers/ChartPanelContentViewer.java
+++ b/jfreechart/org.eclipse.trace4cps.common.jfreechart.ui/src/org/eclipse/trace4cps/common/jfreechart/ui/viewers/ChartPanelContentViewer.java
@@ -7,6 +7,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.common.jfreechart.ui.viewers;
import org.eclipse.jface.viewers.ContentViewer;
@@ -23,10 +24,10 @@ import org.jfree.chart.plot.Plot;
import org.jfree.chart.util.Args;
public abstract class ChartPanelContentViewer extends ContentViewer {
-
private final Composite parentComposite;
private ISelection selection = StructuredSelection.EMPTY;
+
private boolean preserveSelection = false;
private ChartPanelControlTuple controlTuple = null;
@@ -56,29 +57,23 @@ public abstract class ChartPanelContentViewer extends ContentViewer {
private ChartPanelControlTuple getControlTuple() {
if (null == controlTuple) {
- controlTuple = createControl(parentComposite,
- SWT.H_SCROLL | SWT.V_SCROLL, SelectionType.Multi);
+ controlTuple = createControl(parentComposite, SWT.H_SCROLL | SWT.V_SCROLL, SelectionType.Multi);
}
return controlTuple;
}
/**
* Creates a {@link ChartPanelComposite} for this viewer.
- * NOTE: This method should not call any other method of
- * {@link ChartPanelContentViewer}, except for its super method.
- *
- * @param parent the composite to add the {@link ChartPanelComposite}
- * to
- * @param style the style to apply to the
- * {@link ChartPanelComposite}
- * @param selectionType the selection type to apply to this
- * {@link ChartPanelContentViewer}
- * @return a tuple containing both the {@link ChartPanelComposite} and the
- * {@link Control} it is added to which may be the
- * {@link ChartPanelComposite} itself.
+ * NOTE: This method should not call any other method of {@link ChartPanelContentViewer}, except for its
+ * super method.
+ *
+ * @param parent the composite to add the {@link ChartPanelComposite} to
+ * @param style the style to apply to the {@link ChartPanelComposite}
+ * @param selectionType the selection type to apply to this {@link ChartPanelContentViewer}
+ * @return a tuple containing both the {@link ChartPanelComposite} and the {@link Control} it is added to which may
+ * be the {@link ChartPanelComposite} itself.
*/
- protected ChartPanelControlTuple createControl(Composite parent, int style,
- SelectionType selectionType) {
+ protected ChartPanelControlTuple createControl(Composite parent, int style, SelectionType selectionType) {
ChartPanelComposite composite = new ChartPanelComposite(parent, style);
return new ChartPanelControlTuple(composite, composite, selectionType);
}
@@ -146,32 +141,31 @@ public abstract class ChartPanelContentViewer extends ContentViewer {
protected final class ChartPanelControlTuple {
private final Control control;
+
private final ChartPanelComposite chartPanelComposite;
+
private final ChartPanelSelectionHandler chartPanelSelectionHandler;
/**
- * @param control the SWT control which displays this
- * viewer's content
- * @param chartPanelComposite the SWT composite which displays this
- * viewer's {@link JFreeChart}
- * @param selectionType the selection type to use for this viewer
+ * @param control the SWT control which displays this viewer's content
+ * @param chartPanelComposite the SWT composite which displays this viewer's {@link JFreeChart}
+ * @param selectionType the selection type to use for this viewer
*/
- public ChartPanelControlTuple(Control control,
- ChartPanelComposite chartPanelComposite,
- SelectionType selectionType) {
+ public ChartPanelControlTuple(Control control, ChartPanelComposite chartPanelComposite,
+ SelectionType selectionType)
+ {
Args.nullNotPermitted(control, "control");
Args.nullNotPermitted(chartPanelComposite, "chartPanelComposite");
Args.nullNotPermitted(selectionType, "selectionType");
this.control = control;
this.chartPanelComposite = chartPanelComposite;
- this.chartPanelSelectionHandler = new ChartPanelSelectionHandler(
- chartPanelComposite.getChartPanel(),
+ this.chartPanelSelectionHandler = new ChartPanelSelectionHandler(chartPanelComposite.getChartPanel(),
ChartPanelContentViewer.this, selectionType);
}
/**
* Returns the primary control associated with this viewer.
- *
+ *
* @return the SWT control which displays this viewer's content
* @see ContentViewer#getControl()
*/
@@ -181,9 +175,8 @@ public abstract class ChartPanelContentViewer extends ContentViewer {
/**
* Returns the chart-panel composite associated with this viewer.
- *
- * @return the SWT composite which displays this viewer's
- * {@link JFreeChart}
+ *
+ * @return the SWT composite which displays this viewer's {@link JFreeChart}
*/
public ChartPanelComposite getChartPanelComposite() {
return chartPanelComposite;
@@ -191,11 +184,11 @@ public abstract class ChartPanelContentViewer extends ContentViewer {
/**
* Returns the selection handler for this viewer
- *
+ *
* @return the selection handler for this viewer
*/
public ChartPanelSelectionHandler getChartPanelSelectionHandler() {
return chartPanelSelectionHandler;
}
}
-}
\ No newline at end of file
+}
diff --git a/jfreechart/org.eclipse.trace4cps.common.jfreechart.ui/src/org/eclipse/trace4cps/common/jfreechart/ui/viewers/ChartPanelSelectionHandler.java b/jfreechart/org.eclipse.trace4cps.common.jfreechart.ui/src/org/eclipse/trace4cps/common/jfreechart/ui/viewers/ChartPanelSelectionHandler.java
index 6e6f60996067cfb26c26650e44402f3d5f4e1638..0a0209611951debaaf281b8a2a0f1cd1d1dd3225 100644
--- a/jfreechart/org.eclipse.trace4cps.common.jfreechart.ui/src/org/eclipse/trace4cps/common/jfreechart/ui/viewers/ChartPanelSelectionHandler.java
+++ b/jfreechart/org.eclipse.trace4cps.common.jfreechart.ui/src/org/eclipse/trace4cps/common/jfreechart/ui/viewers/ChartPanelSelectionHandler.java
@@ -7,6 +7,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.common.jfreechart.ui.viewers;
import java.awt.BasicStroke;
@@ -59,24 +60,28 @@ public class ChartPanelSelectionHandler {
}
private final MouseSelectionListener mouseSelectionListener = new MouseSelectionListener();
+
private final SelectionOverlay selectionOverlay = new SelectionOverlay();
private final ChartPanel chartPanel;
+
private final ISelectionProvider selectionProvider;
private BackReferenceResolver backReferenceResolver = BackReferenceResolver.DEFAULT;
+
private double zoomToSelectionMargin = 0;
+
private SelectionType selectionType;
- public static ChartPanelSelectionHandler connectSelection(
- ChartPanel chartPanel, ISelectionProvider selectionProvider,
- SelectionType selectionType) {
- return new ChartPanelSelectionHandler(chartPanel, selectionProvider,
- selectionType);
+ public static ChartPanelSelectionHandler connectSelection(ChartPanel chartPanel,
+ ISelectionProvider selectionProvider, SelectionType selectionType)
+ {
+ return new ChartPanelSelectionHandler(chartPanel, selectionProvider, selectionType);
}
- public ChartPanelSelectionHandler(ChartPanel chartPanel,
- ISelectionProvider selectionProvider, SelectionType selectionType) {
+ public ChartPanelSelectionHandler(ChartPanel chartPanel, ISelectionProvider selectionProvider,
+ SelectionType selectionType)
+ {
Args.nullNotPermitted(chartPanel, "chartPanel");
Args.nullNotPermitted(selectionProvider, "selectionProvider");
this.chartPanel = chartPanel;
@@ -109,17 +114,16 @@ public class ChartPanelSelectionHandler {
this.selectionType = selectionType;
switch (selectionType) {
- case Single:
- case Multi:
- this.chartPanel.addChartMouseListener(mouseSelectionListener);
- // No break, continue next case
- case ReadOnly:
- this.selectionProvider
- .addSelectionChangedListener(selectionOverlay);
- this.chartPanel.addOverlay(selectionOverlay);
- break;
- case None:
- // Do nothing, already deregistered
+ case Single:
+ case Multi:
+ this.chartPanel.addChartMouseListener(mouseSelectionListener);
+ // No break, continue next case
+ case ReadOnly:
+ this.selectionProvider.addSelectionChangedListener(selectionOverlay);
+ this.chartPanel.addOverlay(selectionOverlay);
+ break;
+ case None:
+ // Do nothing, already deregistered
}
}
@@ -151,8 +155,7 @@ public class ChartPanelSelectionHandler {
return backReferenceResolver;
}
- public void setBackReferenceResolver(
- BackReferenceResolver backReferenceResolver) {
+ public void setBackReferenceResolver(BackReferenceResolver backReferenceResolver) {
this.backReferenceResolver = backReferenceResolver;
}
@@ -170,7 +173,7 @@ public class ChartPanelSelectionHandler {
double minY = Double.POSITIVE_INFINITY;
double maxX = Double.NEGATIVE_INFINITY;
double maxY = Double.NEGATIVE_INFINITY;
- for (Rectangle2D bounds : selectionBounds.values()) {
+ for (Rectangle2D bounds: selectionBounds.values()) {
minX = Math.min(minX, bounds.getMinX());
minY = Math.min(minY, bounds.getMinY());
maxX = Math.max(maxX, bounds.getMaxX());
@@ -186,20 +189,19 @@ public class ChartPanelSelectionHandler {
maxY += marginY;
// Keep zoom if specified
- Rectangle2D dataArea = chartPanel.getChartRenderingInfo().getPlotInfo()
- .getDataArea();
+ Rectangle2D dataArea = chartPanel.getChartRenderingInfo().getPlotInfo().getDataArea();
switch (zoomType) {
- case X:
- minY = dataArea.getMinY();
- maxY = dataArea.getMaxY();
- break;
- case Y:
- minX = dataArea.getMinX();
- maxX = dataArea.getMaxX();
- break;
- default:
- // Nothing to do
- break;
+ case X:
+ minY = dataArea.getMinY();
+ maxY = dataArea.getMaxY();
+ break;
+ case Y:
+ minX = dataArea.getMinX();
+ maxX = dataArea.getMaxX();
+ break;
+ default:
+ // Nothing to do
+ break;
}
// Zooming with a width or height of 0 will be ignored, hence max with
@@ -214,41 +216,33 @@ public class ChartPanelSelectionHandler {
protected Map
* A constraint {@code e2 -- -w --> e1} gives an upper bound of {@code w} time units between the occurrence of
* {@code e1} and {@code e2}.
*/
public class Constraint {
-
private final ConstraintGraphNode src;
private final ConstraintGraphNode dst;
@@ -40,9 +40,10 @@ public class Constraint {
public final boolean isClaimDurationConstraint() {
if (src instanceof ClaimNode && dst instanceof ClaimNode) {
- ClaimNode e1 = (ClaimNode) src;
- ClaimNode e2 = (ClaimNode) dst;
- return ((e1.isClaimStart() && e2.isClaimStop() || (e2.isClaimStart() && e1.isClaimStop()))) && e1.getClaim() == e2.getClaim();
+ ClaimNode e1 = (ClaimNode)src;
+ ClaimNode e2 = (ClaimNode)dst;
+ return ((e1.isClaimStart() && e2.isClaimStop() || (e2.isClaimStart() && e1.isClaimStop())))
+ && e1.getClaim() == e2.getClaim();
}
return false;
}
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/constraintgraph/impl/ConstraintGraph.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/constraintgraph/impl/ConstraintGraph.java
index 552dfc30616d080a4ab53a76343d95d99cc2b02c..4d5bea68455cad8f6b30dad225d7ac2ea0f0c325 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/constraintgraph/impl/ConstraintGraph.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/constraintgraph/impl/ConstraintGraph.java
@@ -7,6 +7,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.analysis.constraintgraph.impl;
import java.util.ArrayList;
@@ -43,10 +44,10 @@ public class ConstraintGraph {
}
/**
- * Creates the core constraint graph from a set of claims. Only intra-claim constraints are added, i.e.,
- * the claim durations. Use {@link #applyOrderHeuristic(double)} and
- * {@link #applyNonElasticityConstraint(Collection)} to add more constraints.
- *
+ * Creates the core constraint graph from a set of claims. Only intra-claim constraints are added, i.e., the claim
+ * durations. Use {@link #applyOrderHeuristic(double)} and {@link #applyNonElasticityConstraint(Collection)} to add
+ * more constraints.
+ *
* @param events the events for which to build a core constraint graph
*/
public ConstraintGraph(List events, List deps, ConstraintConfig config) {
@@ -84,7 +85,7 @@ public class ConstraintGraph {
public final int edgeSize() {
int cnt = 0;
- for (ConstraintGraphNode n : nodes) {
+ for (ConstraintGraphNode n: nodes) {
cnt += n.constraints().size();
}
return cnt;
@@ -92,9 +93,9 @@ public class ConstraintGraph {
private void createNodeList(List events, boolean addSourceAndSink) {
int id = addSourceAndSink ? 1 : 0;
- for (IEvent event : events) {
+ for (IEvent event: events) {
if (event instanceof IClaimEvent) {
- nodes.add(new ClaimNode(id, (IClaimEvent) event));
+ nodes.add(new ClaimNode(id, (IClaimEvent)event));
} else {
nodes.add(new EventNode(id, event));
}
@@ -111,13 +112,14 @@ public class ConstraintGraph {
// adds constraints w.r.t. the duration of claims
for (int i = 0; i < nodes.size(); i++) {
ConstraintGraphNode node = nodes.get(i);
- if (node instanceof ClaimNode && ((ClaimNode) node).isClaimStart()) {
- ClaimNode startNode = (ClaimNode) node;
+ if (node instanceof ClaimNode && ((ClaimNode)node).isClaimStart()) {
+ ClaimNode startNode = (ClaimNode)node;
// find the end node:
for (int j = findStartIndex(startNode, i); j < nodes.size(); j++) {
ConstraintGraphNode nj = nodes.get(j);
- if (nj instanceof ClaimNode && ((ClaimNode) nj).isClaimStop()
- && ((ClaimNode) nj).getClaim() == startNode.getClaim()) {
+ if (nj instanceof ClaimNode && ((ClaimNode)nj).isClaimStop()
+ && ((ClaimNode)nj).getClaim() == startNode.getClaim())
+ {
double duration = nj.timestamp() - startNode.timestamp();
if (cfg.isAddClaimLowerBoundConstraints()) {
startNode.addConstraint(nj, duration);
@@ -145,10 +147,11 @@ public class ConstraintGraph {
}
private void applyNonElasticityConstraint(Map nonElasticGroupFilter,
- String nonElasticGroupPartitioning) {
- Collection> nonElasticCells =
- computeNonElasticGroups(nonElasticGroupFilter, nonElasticGroupPartitioning);
- for (List cell : nonElasticCells) {
+ String nonElasticGroupPartitioning)
+ {
+ Collection> nonElasticCells = computeNonElasticGroups(nonElasticGroupFilter,
+ nonElasticGroupPartitioning);
+ for (List cell: nonElasticCells) {
Collections.sort(cell); // to be sure: sort by timestamp
// The inter-event distances from claims in this cell are fixed and
// given by the current timing
@@ -163,11 +166,12 @@ public class ConstraintGraph {
}
}
- private Collection> computeNonElasticGroups(
- Map nonElasticGroupFilter, String nonElasticGroupPartitioning) {
+ private Collection> computeNonElasticGroups(Map nonElasticGroupFilter,
+ String nonElasticGroupPartitioning)
+ {
Map> neg = new HashMap>();
- for (ConstraintGraphNode ce : nodes) {
- EventNode eventNode = (EventNode) ce; // SrcSnk nodes not yet added!
+ for (ConstraintGraphNode ce: nodes) {
+ EventNode eventNode = (EventNode)ce; // SrcSnk nodes not yet added!
if (matches(eventNode, nonElasticGroupFilter)) {
String pid = eventNode.getEvent().getAttributeValue(nonElasticGroupPartitioning);
if (pid != null) { // skip claim events without partitioning attribute
@@ -185,7 +189,7 @@ public class ConstraintGraph {
private static boolean matches(EventNode ce, Map filter) {
if (filter != null && filter.size() > 0) {
- for (Map.Entry entry : filter.entrySet()) {
+ for (Map.Entry entry: filter.entrySet()) {
String val = ce.getEvent().getAttributeValue(entry.getKey());
if (!entry.getValue().equals(val)) {
return false;
@@ -197,7 +201,7 @@ public class ConstraintGraph {
private void applyDependencies(List deps) {
Map> succs = new HashMap<>();
- for (IDependency dep : deps) {
+ for (IDependency dep: deps) {
IEvent src = dep.getSrc();
IEvent dst = dep.getDst();
Set s = succs.get(src);
@@ -208,20 +212,20 @@ public class ConstraintGraph {
s.add(dst);
}
Map eventMap = new HashMap<>();
- for (ConstraintGraphNode node : nodes) {
+ for (ConstraintGraphNode node: nodes) {
if (node instanceof EventNode) {
- EventNode en = (EventNode) node;
+ EventNode en = (EventNode)node;
IEvent event = en.getEvent();
eventMap.put(event, en);
}
}
- for (ConstraintGraphNode node : nodes) {
+ for (ConstraintGraphNode node: nodes) {
if (node instanceof EventNode) {
- EventNode en = (EventNode) node;
+ EventNode en = (EventNode)node;
IEvent src = en.getEvent();
Set ss = succs.get(src);
if (ss != null) {
- for (IEvent s : ss) {
+ for (IEvent s: ss) {
EventNode dst = eventMap.get(s);
en.addConstraint(dst, 0);
}
@@ -231,52 +235,49 @@ public class ConstraintGraph {
}
/**
- * Adds constraints between end event {@code e1} and start event {@code e2} with weight {@code 0} if and
- * only if {@code e1.timestamp <= e2.timestamp() <= e1.timestamp + epsilon}. Furthermore, the transitive
- * reduction of the implied constraints is taken.
- *
- * @param epsilon
+ * Adds constraints between end event {@code e1} and start event {@code e2} with weight {@code 0} if and only if
+ * {@code e1.timestamp <= e2.timestamp() <= e1.timestamp + epsilon}. Furthermore, the transitive reduction of the
+ * implied constraints is taken.
*/
private void applyOrderHeuristic(double epsilon) {
if (epsilon < 0) {
throw new IllegalArgumentException("epsilon must be at least 0");
}
// only end events of the front of finished tasks
- List F = new ArrayList();
- for (ConstraintGraphNode v : nodes) {
+ List f = new ArrayList();
+ for (ConstraintGraphNode v: nodes) {
if (v instanceof ClaimNode) {
- ClaimNode claimNode = (ClaimNode) v;
+ ClaimNode claimNode = (ClaimNode)v;
if (claimNode.isClaimStart()) {
- for (ClaimNode w : F) {
- if (epsilon == Double.POSITIVE_INFINITY
- || (v.timestamp() - w.timestamp() <= epsilon)) {
+ for (ClaimNode w: f) {
+ if (epsilon == Double.POSITIVE_INFINITY || (v.timestamp() - w.timestamp() <= epsilon)) {
w.addConstraint(v, 0);
}
}
} else if (claimNode.isClaimStop()) {
Set toRemove = new HashSet();
- for (ClaimNode w : F) {
+ for (ClaimNode w: f) {
// w is an end event, and so is v. Check whether w goes to the start event of v
- for (Constraint succw : w.constraints()) {
+ for (Constraint succw: w.constraints()) {
ConstraintGraphNode s = succw.getDst();
if (s instanceof ClaimNode) {
- if (((ClaimNode) s).isClaimStart()
- && ((ClaimNode) s).getClaim() == claimNode.getClaim()) {
+ if (((ClaimNode)s).isClaimStart()
+ && ((ClaimNode)s).getClaim() == claimNode.getClaim())
+ {
toRemove.add(w);
}
}
}
// removed end events from F that can never lead to a constraint anymore
// because the nodes are sorted by timestamp
- if (epsilon != Double.POSITIVE_INFINITY
- && (v.timestamp() - w.timestamp() > epsilon)) {
+ if (epsilon != Double.POSITIVE_INFINITY && (v.timestamp() - w.timestamp() > epsilon)) {
toRemove.add(w);
}
}
- for (ConstraintGraphNode k : toRemove) {
- F.remove(k);
+ for (ConstraintGraphNode k: toRemove) {
+ f.remove(k);
}
- F.add(claimNode);
+ f.add(claimNode);
}
}
}
@@ -285,10 +286,10 @@ public class ConstraintGraph {
private void addSourceAndSink() {
ConstraintGraphNode src = new SrcSnkNode(0, true);
ConstraintGraphNode snk = new SrcSnkNode(nodes.size() + 1, false);
- for (ConstraintGraphNode e : nodes) {
+ for (ConstraintGraphNode e: nodes) {
e.addConstraint(snk, 0);
}
- for (ConstraintGraphNode e : nodes) {
+ for (ConstraintGraphNode e: nodes) {
src.addConstraint(e, 0);
}
// Add src and snk
@@ -296,33 +297,12 @@ public class ConstraintGraph {
nodes.add(snk);
}
- private Set getNodesWithPositiveIncomingEdges() {
- Set withPositiveIncomingEdges = new HashSet<>();
- for (ConstraintGraphNode e : nodes) {
- for (Constraint c : e.constraints()) {
- if (c.weight() >= 0) {
- withPositiveIncomingEdges.add(c.getDst());
- }
- }
- }
- return withPositiveIncomingEdges;
- }
-
- private boolean hasPositiveOutgoingEdge(ConstraintGraphNode e) {
- for (Constraint c : e.constraints()) {
- if (c.weight() >= 0) {
- return true;
- }
- }
- return false;
- }
-
@Override
public final String toString() {
StringBuilder b = new StringBuilder("ConstraintGraph[size=");
b.append(nodes.size()).append("]:\n");
- for (ConstraintGraphNode e : nodes) {
- for (Constraint edge : e.constraints()) {
+ for (ConstraintGraphNode e: nodes) {
+ for (Constraint edge: e.constraints()) {
if (!edge.isClaimDurationConstraint()) {
b.append("\t\t").append(edge).append("\n");
}
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/constraintgraph/impl/ConstraintGraphNode.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/constraintgraph/impl/ConstraintGraphNode.java
index 1248a556f3ee61924eb6e433265b0cc98809c906..66ced3aa485931e7d18714e154e83cb71ed03378 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/constraintgraph/impl/ConstraintGraphNode.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/constraintgraph/impl/ConstraintGraphNode.java
@@ -7,6 +7,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.analysis.constraintgraph.impl;
import java.util.ArrayList;
@@ -18,7 +19,6 @@ import org.eclipse.trace4cps.core.IEvent;
* Implementation that wraps {@link IEvent} instances.
*/
public abstract class ConstraintGraphNode implements Comparable {
-
private final List succ = new ArrayList();
// id starts at 0
@@ -29,14 +29,11 @@ public abstract class ConstraintGraphNode implements Comparable
+ * ClaimEvents belong to a {@link ConstraintGraph} {@code cg}. The ids range from 0 to {@code cg.size()-1}, and
+ * every ClaimEvent has an unique id within the ConstraintGraph. The ids can thus be used to index an array.
+ *
* If the constraint graph has source and sink nodes, then the source has id 0, and the sink has id
* {@code cg.size() - 1}.
- *
- * @return
*/
public int getId() {
return id;
@@ -58,7 +55,7 @@ public abstract class ConstraintGraphNode implements Comparable criticalDeps;
public CpaResult(List criticalDeps) {
@@ -29,7 +29,7 @@ public final class CpaResult {
public List getCriticalDeps() {
return criticalDeps;
}
-
+
public static boolean isNonAppDependency(IDependency dep, DependencyProvider p) {
if (p == null || p.isApplicationDependency(dep.getSrc(), dep.getDst())) {
return false;
@@ -37,8 +37,8 @@ public final class CpaResult {
// p != null && !p.isApplicationDependency
// also ensure that this is not an intra-claim dependency
if (dep.getSrc() instanceof IClaimEvent && dep.getDst() instanceof IClaimEvent) {
- IClaim src = ((IClaimEvent) dep.getSrc()).getClaim();
- IClaim dst = ((IClaimEvent) dep.getDst()).getClaim();
+ IClaim src = ((IClaimEvent)dep.getSrc()).getClaim();
+ IClaim dst = ((IClaimEvent)dep.getDst()).getClaim();
if (src == dst) {
return false;
}
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/cpa/CriticalPathAnalysis.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/cpa/CriticalPathAnalysis.java
index df51665c3544dc3d372d27bec8dbed73e3832836..41a86d5d77b664dc4de4fa68b2a635d6aff76843 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/cpa/CriticalPathAnalysis.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/cpa/CriticalPathAnalysis.java
@@ -7,6 +7,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.analysis.cpa;
import java.util.ArrayList;
@@ -28,18 +29,17 @@ import org.eclipse.trace4cps.core.ITrace;
import org.eclipse.trace4cps.core.impl.Dependency;
/**
- * This class implements critical-path analysis based on the constraint graph representation of the
- * {@link IEvent} instances of an {@link ITrace}. References:
+ * This class implements critical-path analysis based on the constraint graph representation of the {@link IEvent}
+ * instances of an {@link ITrace}. References:
*
*
M. Hendriks and F. W. Vaandrager. Reconstructing critical paths from execution traces. In International
* Conference on Embedded and Ubiquitous Computing (EUC 2012). IEEE Computer Society Press, 2012.
- *
M. Hendriks, J. Verriet, T. Basten, B. Theelen, M. Brasse, L. Somers. Analyzing Execution Traces -
- * Critical-Path Analysis and Distance Analysis. International Journal on Software Tools for Technology
- * Transfer, STTT. 19(4):487-510, August 2017.
+ *
M. Hendriks, J. Verriet, T. Basten, B. Theelen, M. Brasse, L. Somers. Analyzing Execution Traces - Critical-Path
+ * Analysis and Distance Analysis. International Journal on Software Tools for Technology Transfer, STTT. 19(4):487-510,
+ * August 2017.
*
*/
public final class CriticalPathAnalysis {
-
public static final String CPA_ATT_TYPE = "type";
public static final String CPA_ATT_TYPE_CG = "cg";
@@ -55,7 +55,6 @@ public final class CriticalPathAnalysis {
public static IAttributeFilter getCriticalDependencyFilter() {
return new IAttributeFilter() {
-
@Override
public boolean include(IAttributeAware a) {
return CPA_ATT_CRITICAL_TRUE.equals(a.getAttributeValue(CPA_ATT_CRITICAL));
@@ -65,11 +64,11 @@ public final class CriticalPathAnalysis {
/**
* Default configuration for constraint graph: ordering heuristic with {@code epsilon = 0}.
- *
+ *
* @param trace the {@link ITrace} whose events to analyze for a critical-path
* @return the result
- * @throws PositiveCycleException if there are cyclic dependencies that make that critical-path analysis
- * is not possible
+ * @throws PositiveCycleException if there are cyclic dependencies that make that critical-path analysis is not
+ * possible
*/
public static CpaResult run(ITrace trace) throws PositiveCycleException {
ConstraintConfig config = ConstraintConfig.getDefault();
@@ -80,12 +79,12 @@ public final class CriticalPathAnalysis {
/**
* Manual configuration for the constraint graph of the critical-path analysis.
- *
+ *
* @param trace the {@link ITrace} whose events to analyze for a critical-path
* @param config the manual configuration for the analysis
* @return the result
- * @throws PositiveCycleException if there are cyclic dependencies that make that critical-path analysis
- * is not possible
+ * @throws PositiveCycleException if there are cyclic dependencies that make that critical-path analysis is not
+ * possible
*/
public static CpaResult run(ITrace trace, ConstraintConfig config) throws PositiveCycleException {
if (!config.isAddSourceAndSink()) {
@@ -94,16 +93,16 @@ public final class CriticalPathAnalysis {
return applyBellmanFord(trace, config);
}
- private static CpaResult applyBellmanFord(ITrace trace, ConstraintConfig config)
- throws PositiveCycleException {
+ private static CpaResult applyBellmanFord(ITrace trace, ConstraintConfig config) throws PositiveCycleException {
if (config.isUseDependencies() && config.isApplyOrderingHeuristic()) {
throw new IllegalArgumentException("cannot use dependencies and ordering heuristic");
}
ConstraintGraph cg = new ConstraintGraph(trace, config);
ConstraintGraphNode cgSrc = cg.getNodes().get(0);
ConstraintGraphNode cgSnk = cg.getNodes().get(cg.getNodes().size() - 1);
- double dist[] = new double[cg.size()];
- Set pre[] = new HashSet[cg.size()]; // FIXME: list of constraints
+ double[] dist = new double[cg.size()];
+ @SuppressWarnings("unchecked")
+ Set[] pre = new HashSet[cg.size()]; // FIXME: list of constraints
initializeBFdata(cg, dist, pre, cgSrc);
// relax edges at most |V| times
for (int i = 0; i < cg.size(); i++) {
@@ -111,7 +110,7 @@ public final class CriticalPathAnalysis {
boolean change = false;
for (int j = 0; j < cg.size(); j++) {
ConstraintGraphNode src = cg.getNodes().get(j);
- for (Constraint edge : src.constraints()) {
+ for (Constraint edge: src.constraints()) {
ConstraintGraphNode dst = edge.getDst();
if (dist[src.getId()] + edge.weight() > dist[dst.getId()]) {
dist[dst.getId()] = dist[src.getId()] + edge.weight();
@@ -134,7 +133,8 @@ public final class CriticalPathAnalysis {
}
private static void initializeBFdata(ConstraintGraph cg, double[] dist, Set[] pre,
- ConstraintGraphNode startNode) {
+ ConstraintGraphNode startNode)
+ {
for (int i = 0; i < cg.size(); i++) {
pre[i] = new HashSet();
}
@@ -144,10 +144,9 @@ public final class CriticalPathAnalysis {
dist[startNode.getId()] = 0;
}
- private static void assertNoPositiveCycles(ConstraintGraph cg, double[] dist)
- throws PositiveCycleException {
- for (ConstraintGraphNode ei : cg.getNodes()) {
- for (Constraint edge : ei.constraints()) {
+ private static void assertNoPositiveCycles(ConstraintGraph cg, double[] dist) throws PositiveCycleException {
+ for (ConstraintGraphNode ei: cg.getNodes()) {
+ for (Constraint edge: ei.constraints()) {
if (dist[ei.getId()] + edge.weight() > dist[edge.getDst().getId()]) {
throw new PositiveCycleException("graph contains a positive-weight cycle: " + ei);
}
@@ -156,21 +155,22 @@ public final class CriticalPathAnalysis {
}
private static CpaResult computeResult(ConstraintGraphNode srcNode, ConstraintGraphNode snkNode,
- Collection[] pre, ConstraintGraph cg) {
+ Collection[] pre, ConstraintGraph cg)
+ {
List criticalDeps = new ArrayList<>();
List waiting = new ArrayList<>();
waiting.add(cg.getNodes().get(cg.size() - 1)); // add the sink
Set passed = new HashSet<>();
while (!waiting.isEmpty()) {
ConstraintGraphNode dst = waiting.remove(waiting.size() - 1);
- for (Constraint constraint : pre[dst.getId()]) {
+ for (Constraint constraint: pre[dst.getId()]) {
ConstraintGraphNode src = constraint.getSrc();
if (!passed.contains(src)) {
waiting.add(src);
}
if (src instanceof EventNode && dst instanceof EventNode) {
- IEvent srcEvent = ((EventNode) src).getEvent();
- IEvent dstEvent = ((EventNode) dst).getEvent();
+ IEvent srcEvent = ((EventNode)src).getEvent();
+ IEvent dstEvent = ((EventNode)dst).getEvent();
IDependency dep = new Dependency(srcEvent, dstEvent);
dep.setAttribute(CPA_ATT_CRITICAL, CPA_ATT_CRITICAL_TRUE);
criticalDeps.add(dep);
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/cpa/DependencyProvider.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/cpa/DependencyProvider.java
index 7455b55142aba14908563fe869e18c799d4bf5fd..5ba2f6a523fa063c75d9b959ea59028dc687bfbd 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/cpa/DependencyProvider.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/cpa/DependencyProvider.java
@@ -7,19 +7,19 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.analysis.cpa;
import org.eclipse.trace4cps.core.IEvent;
/**
- * This type can be used to refine the critical-path analysis by adding information on the logical
- * dependencies between claims that are due to the application.
+ * This type can be used to refine the critical-path analysis by adding information on the logical dependencies between
+ * claims that are due to the application.
*/
public interface DependencyProvider {
-
/**
* Indicates whether a dependency between two events is a logical/data/application dependency.
- *
+ *
* @param src the source event
* @param dst the destination event
* @return whether a dependency from src to dst is due to the application
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/cpa/PositiveCycleException.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/cpa/PositiveCycleException.java
index 24ff157db3d548b342037bfbb71cb8813e682e63..73223aa50612e5aea3b1cd60c01a448f15bbb012 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/cpa/PositiveCycleException.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/cpa/PositiveCycleException.java
@@ -7,12 +7,12 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.analysis.cpa;
import org.eclipse.trace4cps.analysis.AnalysisException;
public class PositiveCycleException extends AnalysisException {
-
private static final long serialVersionUID = 1L;
public PositiveCycleException() {
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/dist/DefaultRepresentation.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/dist/DefaultRepresentation.java
index da6e9ee00c1a3c2d9156357ec63a9b4a5e5d1503..bf4b4d17edf309c8c5a391123b83b0e319be0f94 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/dist/DefaultRepresentation.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/dist/DefaultRepresentation.java
@@ -7,19 +7,19 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.analysis.dist;
import org.eclipse.trace4cps.core.IEvent;
import org.eclipse.trace4cps.core.impl.TraceHelper;
/**
- * Default implementation of the {@link Representation} interface. An {@link IEvent} is represented by a
- * string with the keys and values of its attributes (in lexicographical order w.r.t. the keys). Furthermore,
- * {@link IClaimEvent} instances also have the keys and values of the resource attributes, the amount and
- * offset that is claimed, and the type of {@link IClaimEvent}.
+ * Default implementation of the {@link Representation} interface. An {@link IEvent} is represented by a string with the
+ * keys and values of its attributes (in lexicographical order w.r.t. the keys). Furthermore, {@link IClaimEvent}
+ * instances also have the keys and values of the resource attributes, the amount and offset that is claimed, and the
+ * type of {@link IClaimEvent}.
*/
public class DefaultRepresentation implements Representation {
-
/**
* {@inheritDoc}
*/
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/dist/DependencyInclusionCheck.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/dist/DependencyInclusionCheck.java
index 52ad0c51de92a4ec58f7f50f7bf8cda7bc72a761..b68396493e819861924a8fb6909fa40cf727aa13 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/dist/DependencyInclusionCheck.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/dist/DependencyInclusionCheck.java
@@ -7,6 +7,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.analysis.dist;
import java.util.ArrayList;
@@ -22,28 +23,24 @@ import org.eclipse.trace4cps.core.impl.Dependency;
/**
*
- * This type provides a check on two traces. One trace typically comes from a model (e.g., an LSAT model) and
- * contains dependencies between claims and/or events. The other trace typically is from a system. The
- * assumption is that a mapping exists between the claims and events in the two traces. This mapping is the
- * equality of attribute-values. E.g., a claim in the model trace is equivalent to a claim in the system trace
- * if and only if they have exactly the same set of attributes and values. Furthermore, we assume that a
- * dependency in the model trace encodes a timing/ordering dependency: the destination of the dependency does
- * not happen before the source of the dependency. We can also quantify the minimal time distance by a special
- * attribute of the dependency that is interpreted as a time duration in the time unit of the traces (which
- * must be equal). The algorithm in this class then checks whether every dependency in the model trace is
- * respected in the system trace.
+ * This type provides a check on two traces. One trace typically comes from a model (e.g., an LSAT model) and contains
+ * dependencies between claims and/or events. The other trace typically is from a system. The assumption is that a
+ * mapping exists between the claims and events in the two traces. This mapping is the equality of attribute-values.
+ * E.g., a claim in the model trace is equivalent to a claim in the system trace if and only if they have exactly the
+ * same set of attributes and values. Furthermore, we assume that a dependency in the model trace encodes a
+ * timing/ordering dependency: the destination of the dependency does not happen before the source of the dependency. We
+ * can also quantify the minimal time distance by a special attribute of the dependency that is interpreted as a time
+ * duration in the time unit of the traces (which must be equal). The algorithm in this class then checks whether every
+ * dependency in the model trace is respected in the system trace.
*
*/
public class DependencyInclusionCheck {
-
private DependencyInclusionCheck() {
}
/**
- * @param modelTrace
- * @param systemTrace
- * @param weightAttribute the attribute to interpret as the minimum time distance for the dependencies
- * (can be {@code null} in which case a value of 0 is used)
+ * @param weightAttribute the attribute to interpret as the minimum time distance for the dependencies (can be
+ * {@code null} in which case a value of 0 is used)
* @return constraints from the model trace which are not satisfied by the system trace
*/
public static List check(ITrace modelTrace, ITrace systemTrace, String weightAttribute) {
@@ -53,8 +50,7 @@ public class DependencyInclusionCheck {
List systemDependencies = new ArrayList<>();
Map cache = new HashMap<>();
- int cnt = 0;
- for (IDependency d : modelTrace.getDependencies()) {
+ for (IDependency d: modelTrace.getDependencies()) {
IEvent e1 = get(cache, d.getSrc(), systemTrace);
IEvent e2 = get(cache, d.getDst(), systemTrace);
if (e1 != null && e2 != null) {
@@ -63,7 +59,6 @@ public class DependencyInclusionCheck {
IDependency annotatedDep = new Dependency(e1, e2);
annotatedDep.setAttribute(weightAttribute, Double.toString(weight));
systemDependencies.add(annotatedDep);
- cnt++;
}
}
}
@@ -86,9 +81,9 @@ public class DependencyInclusionCheck {
}
/**
- * Gets a system event from the system trace that is the equivalent of the given model event. Already
- * computed pairs are stored in the cache.
- *
+ * Gets a system event from the system trace that is the equivalent of the given model event. Already computed pairs
+ * are stored in the cache.
+ *
* @param cache the cache of model-system event pairs
* @param modelEvent the model event for which to find the equivalent system event
* @param systemTrace the trace with all system events
@@ -99,9 +94,8 @@ public class DependencyInclusionCheck {
if (r != null) {
return r;
}
- for (IEvent sysEvent : systemTrace.getEvents()) {
- if (eventTypeEquals(modelEvent, sysEvent)
- && modelEvent.getAttributes().equals(sysEvent.getAttributes())) {
+ for (IEvent sysEvent: systemTrace.getEvents()) {
+ if (eventTypeEquals(modelEvent, sysEvent) && modelEvent.getAttributes().equals(sysEvent.getAttributes())) {
cache.put(modelEvent, sysEvent);
return sysEvent;
}
@@ -115,7 +109,7 @@ public class DependencyInclusionCheck {
} else if (!(lsatEvent instanceof IClaimEvent) && sysEvent instanceof IClaimEvent) {
return false;
} else if (lsatEvent instanceof IClaimEvent && sysEvent instanceof IClaimEvent) {
- if (((IClaimEvent) lsatEvent).getType() != ((IClaimEvent) sysEvent).getType()) {
+ if (((IClaimEvent)lsatEvent).getType() != ((IClaimEvent)sysEvent).getType()) {
return false;
}
}
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/dist/DistanceAnalysis.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/dist/DistanceAnalysis.java
index 1589385b78ef60ae7b8b276dd20b85ec32b0a4a4..4fd3a7ff523f5b625ebd39db2fdd01037ec34af9 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/dist/DistanceAnalysis.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/dist/DistanceAnalysis.java
@@ -7,6 +7,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.analysis.dist;
import java.util.ArrayList;
@@ -28,24 +29,23 @@ import org.eclipse.trace4cps.core.ITrace;
/**
* This class provides methods to compute a distance between sets of {@link IEvent} instances. References:
*
- *
M. Hendriks, J. Verriet, T. Basten, B. Theelen, M. Brasse, L. Somers. Analyzing Execution Traces -
- * Critical-Path Analysis and Distance Analysis. International Journal on Software Tools for Technology
- * Transfer, STTT. 19(4):487-510, August 2017.
+ *
M. Hendriks, J. Verriet, T. Basten, B. Theelen, M. Brasse, L. Somers. Analyzing Execution Traces - Critical-Path
+ * Analysis and Distance Analysis. International Journal on Software Tools for Technology Transfer, STTT. 19(4):487-510,
+ * August 2017.
*
*
- * The algorithm needs a {@link Representation} implementation to represents {@link IEvent} instances as
- * strings. This is used by the algorithm to determine equality of events of the different given event sets.
- * It is essential that within each event within a list of events has a unique string representation.
+ * The algorithm needs a {@link Representation} implementation to represents {@link IEvent} instances as strings. This
+ * is used by the algorithm to determine equality of events of the different given event sets. It is essential that
+ * within each event within a list of events has a unique string representation.
*
*/
public final class DistanceAnalysis {
-
private DistanceAnalysis() {
}
/**
* Computes the distance between two lists of events as a natural number ({@code >= 0}).
- *
+ *
* @param e1 the first list of events
* @param e2 the second list of events
* @param r the representation used for equality computation
@@ -81,19 +81,17 @@ public final class DistanceAnalysis {
}
/**
- * Computes the distance between two lists of events as a natural number ({@code >=0}). It also annotates
- * the reference list of events through the {@link DistanceResult#getInterestCount()} interest count
- * map.
- *
+ * Computes the distance between two lists of events as a natural number ({@code >=0}). It also annotates the
+ * reference list of events through the {@link DistanceResult#getInterestCount()} interest count map.
+ *
* @param e1 a list of events (the "reference")
* @param e2 a list of events
* @param r a representation function for the events
* @param annotateReference whether the reference trace will be included in the annotation of
- * {@link DistanceResult#getInterestCount()}
+ * {@link DistanceResult#getInterestCount()}
* @return a {@link DistanceResult}
*/
- public static DistanceResult distance(ITrace e1, ITrace e2, Representation r,
- boolean annotateReference) {
+ public static DistanceResult distance(ITrace e1, ITrace e2, Representation r, boolean annotateReference) {
ConstraintConfig cfg = ConstraintConfig.getDefault();
cfg.setApplyOrderingHeuristic(Double.POSITIVE_INFINITY);
ConstraintGraph g1 = new ConstraintGraph(e1, cfg);
@@ -102,7 +100,8 @@ public final class DistanceAnalysis {
}
private static DistanceResult run(ConstraintGraph g1, ConstraintGraph g2, Representation r,
- boolean annotateReference) {
+ boolean annotateReference)
+ {
long distance = 0;
Map interestCount = new HashMap<>();
@@ -113,11 +112,11 @@ public final class DistanceAnalysis {
Set v2minv1 = computeSetMinus(v2.values(), v1.values());
distance += (v1minv2.size() + v2minv1.size());
if (annotateReference) {
- for (VertexClaimWrapper v : v1minv2) {
+ for (VertexClaimWrapper v: v1minv2) {
interestCount.put(v.node.getEvent(), new InterestWrapper(v.node.getEvent()));
}
}
- for (VertexClaimWrapper v : v2minv1) {
+ for (VertexClaimWrapper v: v2minv1) {
interestCount.put(v.node.getEvent(), new InterestWrapper(v.node.getEvent()));
}
@@ -132,7 +131,7 @@ public final class DistanceAnalysis {
// Convert:
Map> ic = new HashMap<>();
- for (InterestWrapper w : interestCount.values()) {
+ for (InterestWrapper w: interestCount.values()) {
List list = ic.get(w.cnt);
if (list == null) {
list = new ArrayList<>();
@@ -145,8 +144,9 @@ public final class DistanceAnalysis {
}
private static void annotateEdges(Map interestCount, boolean annotateV1,
- boolean annotateV2, Set e1mine2, Map v2) {
- for (EdgeClaimWrapper e : e1mine2) {
+ boolean annotateV2, Set e1mine2, Map v2)
+ {
+ for (EdgeClaimWrapper e: e1mine2) {
// e.src and e.dst are in V1, the reference trace:
if (annotateV1) {
increment(e.getSrc(), interestCount);
@@ -178,13 +178,13 @@ public final class DistanceAnalysis {
private static Map getVertices(ConstraintGraph g, Representation repr) {
Map r = new HashMap();
int dup = 1;
- for (ConstraintGraphNode n : g.getNodes()) {
- VertexClaimWrapper w = new VertexClaimWrapper((EventNode) n, repr);
+ for (ConstraintGraphNode n: g.getNodes()) {
+ VertexClaimWrapper w = new VertexClaimWrapper((EventNode)n, repr);
if (r.containsKey(w.representation)) {
// we have a claims/vertices with identical attributes (e.g., due to
// preemption,...)
// add a duplication counter: the nodes in CG are ordered according to timestamp
- w = new VertexClaimWrapper((EventNode) n, repr, dup);
+ w = new VertexClaimWrapper((EventNode)n, repr, dup);
dup++;
}
r.put(w.representation, w);
@@ -194,16 +194,16 @@ public final class DistanceAnalysis {
private static Set getVerticesAsSet(ConstraintGraph g, Representation repr) {
Set r = new HashSet();
- for (ConstraintGraphNode n : g.getNodes()) {
- r.add(new VertexClaimWrapper((EventNode) n, repr));
+ for (ConstraintGraphNode n: g.getNodes()) {
+ r.add(new VertexClaimWrapper((EventNode)n, repr));
}
return r;
}
private static Set getEdges(ConstraintGraph g, Representation repr) {
Set r = new HashSet();
- for (ConstraintGraphNode e : g.getNodes()) {
- for (Constraint c : e.constraints()) {
+ for (ConstraintGraphNode e: g.getNodes()) {
+ for (Constraint c: e.constraints()) {
r.add(new EdgeClaimWrapper(c, repr));
}
}
@@ -212,12 +212,12 @@ public final class DistanceAnalysis {
private static Set computeSymDif(Set s1, Set s2) {
Set result = new HashSet();
- for (T o1 : s1) {
+ for (T o1: s1) {
if (!s2.contains(o1)) {
result.add(o1);
}
}
- for (T o2 : s2) {
+ for (T o2: s2) {
if (!s1.contains(o2)) {
result.add(o2);
}
@@ -226,13 +226,11 @@ public final class DistanceAnalysis {
}
/**
- * @param s1
- * @param s2
* @return s1 \ s2
*/
private static Set computeSetMinus(Collection s1, Collection s2) {
Set result = new HashSet();
- for (T o1 : s1) {
+ for (T o1: s1) {
if (!s2.contains(o1)) {
result.add(o1);
}
@@ -241,7 +239,6 @@ public final class DistanceAnalysis {
}
private static final class VertexClaimWrapper {
-
private final String representation;
private final EventNode node;
@@ -272,7 +269,7 @@ public final class DistanceAnalysis {
if (getClass() != obj.getClass()) {
return false;
}
- VertexClaimWrapper other = (VertexClaimWrapper) obj;
+ VertexClaimWrapper other = (VertexClaimWrapper)obj;
if (representation == null) {
if (other.representation != null) {
return false;
@@ -290,11 +287,8 @@ public final class DistanceAnalysis {
}
private static final class EdgeClaimWrapper {
-
private final String representation;
- private final Constraint c;
-
private final EventNode src;
private final EventNode dst;
@@ -304,9 +298,8 @@ public final class DistanceAnalysis {
private final String dstRep;
private EdgeClaimWrapper(Constraint c, Representation r) {
- this.c = c;
- this.src = (EventNode) c.getSrc();
- this.dst = (EventNode) c.getDst();
+ this.src = (EventNode)c.getSrc();
+ this.dst = (EventNode)c.getDst();
this.srcRep = r.represent(src.getEvent());
this.dstRep = r.represent(dst.getEvent());
StringBuilder b = new StringBuilder();
@@ -338,7 +331,7 @@ public final class DistanceAnalysis {
if (getClass() != obj.getClass()) {
return false;
}
- EdgeClaimWrapper other = (EdgeClaimWrapper) obj;
+ EdgeClaimWrapper other = (EdgeClaimWrapper)obj;
if (representation == null) {
if (other.representation != null) {
return false;
@@ -356,7 +349,6 @@ public final class DistanceAnalysis {
}
private static final class InterestWrapper {
-
private int cnt;
private final IEvent event;
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/dist/DistanceResult.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/dist/DistanceResult.java
index 376a92cb761fcb5af7f1c4fb76811f85f9cf774c..8919d7877be2c28eac28b6f4f4b3c4395cf4f1db 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/dist/DistanceResult.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/dist/DistanceResult.java
@@ -7,6 +7,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.analysis.dist;
import java.util.List;
@@ -18,7 +19,6 @@ import org.eclipse.trace4cps.core.IEvent;
* The result of a {@link DistanceAnalysis} computation.
*/
public final class DistanceResult {
-
private final long distance;
private final Map> interestCount;
@@ -36,10 +36,10 @@ public final class DistanceResult {
}
/**
- * This method returns a map that gives a heuristic interest number to a subset of events. The
- * higher the interest number, the more the event is involved in the distance. This information can, e.g.,
- * be used for visualization purposes.
- *
+ * This method returns a map that gives a heuristic interest number to a subset of events. The higher the
+ * interest number, the more the event is involved in the distance. This information can, e.g., be used for
+ * visualization purposes.
+ *
* @return the interest map
*/
public Map> getInterestCount() {
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/dist/Representation.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/dist/Representation.java
index ffaaeb668bfa80ba72bb3da877b2c2b810cffc47..e06e570f086b86a1786cf0ef4d85da978754aa67 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/dist/Representation.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/dist/Representation.java
@@ -7,6 +7,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.analysis.dist;
import org.eclipse.trace4cps.core.IEvent;
@@ -15,10 +16,9 @@ import org.eclipse.trace4cps.core.IEvent;
* Provides a string representation of an {@link IEvent} for the difference analysis.
*/
public interface Representation {
-
/**
* @param e the {@link IEvent} to represent
* @return the string representation of the event
*/
String represent(IEvent e);
-}
\ No newline at end of file
+}
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/AtomicProposition.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/AtomicProposition.java
index 9be7f27c5c3320f1b65ec8c696eee040c262ccc9..0f9ec3ec0a616c9a74eb1d1876f875d17fb34852 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/AtomicProposition.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/AtomicProposition.java
@@ -7,31 +7,31 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.analysis.mtl;
import org.eclipse.trace4cps.core.ClaimEventType;
import org.eclipse.trace4cps.core.IAttributeAware;
+import org.eclipse.trace4cps.core.IClaimEvent;
+import org.eclipse.trace4cps.core.IEvent;
/**
- * An atomic proposition is a core building block for {@link MtlFormula}. It is specified by the set of
- * attributes and the (possibly null) {@link ClaimEventType}. The atomic proposition is designed to work
- * together with the {@link IEvent} and {@link IClaimEvent} instances, which both extend the {@link State}
- * interface. Implementations of the {@link State} have a {@link State#satisfies(AtomicProposition)}
- * method that typically must the attributes and the type of the atomic proposition. I.e., a state {@code s}
- * satisfies an atomic proposition {@code p} if and only if
+ * An atomic proposition is a core building block for {@link MtlFormula}. It is specified by the set of attributes and
+ * the (possibly null) {@link ClaimEventType}. The atomic proposition is designed to work together with the
+ * {@link IEvent} and {@link IClaimEvent} instances, which both extend the {@link State} interface. Implementations of
+ * the {@link State} have a {@link State#satisfies(AtomicProposition)} method that typically must the attributes and the
+ * type of the atomic proposition. I.e., a state {@code s} satisfies an atomic proposition {@code p} if and only if
*
- *
all attribute-value pairs of the atomic proposition {@code p} are also present in the state {@code s},
- * and
+ *
all attribute-value pairs of the atomic proposition {@code p} are also present in the state {@code s}, and
*
{@code p.}{@link #getType()}{@code == null} or state {@code s} has the same type as
* {@code p.}{@link #getType()}}
*
- *
+ *
*/
public interface AtomicProposition extends MtlFormula, IAttributeAware {
-
/**
* Maybe {@code null} to specify any event type
- *
+ *
* @return the type of this atomic proposition
*/
ClaimEventType getType();
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/DefaultAtomicProposition.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/DefaultAtomicProposition.java
index f38a684f0b8fb2ebd522564cc3380169da8942e6..bdf78a72c59abfe7436df5152e5ea0f3259efc1a 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/DefaultAtomicProposition.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/DefaultAtomicProposition.java
@@ -7,6 +7,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.analysis.mtl;
import java.util.Collections;
@@ -20,7 +21,6 @@ import org.eclipse.trace4cps.core.ClaimEventType;
* A default implementation of an {@link AtomicProposition} based on a key-value mapping of strings.
*/
public class DefaultAtomicProposition extends AbstractMTLformula implements AtomicProposition {
-
private final Map properties = new HashMap<>();
private final ClaimEventType type;
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/ExplanationTable.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/ExplanationTable.java
index fea63f1a7410ca24aea1070ff0838e730bd55fac..a99d6f040776a5ea6097ae5f96d3ea006de0770a 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/ExplanationTable.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/ExplanationTable.java
@@ -7,16 +7,16 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.analysis.mtl;
import java.util.List;
/**
- * An explanation table gives for all subformulas of some {@link MtlFormula} the indices in the trace on which
- * it has been checked and the truth value ({@link InformativePrefix}) on that index.
+ * An explanation table gives for all subformulas of some {@link MtlFormula} the indices in the trace on which it has
+ * been checked and the truth value ({@link InformativePrefix}) on that index.
*/
public interface ExplanationTable {
-
/**
* @return the list of states to which this table belongs
*/
@@ -32,7 +32,6 @@ public interface ExplanationTable {
* A region gives for parts of the trace (list of states) the computed satisfaction value.
*/
public interface Region {
-
/**
* @return the start index of this region (inclusive)
*/
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/InformativePrefix.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/InformativePrefix.java
index fc565ccffa34a0322a56142cf7e61a545caf6ce8..1d50a49bff5040a7f6a60bee15e1fdf40ab24d72 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/InformativePrefix.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/InformativePrefix.java
@@ -7,6 +7,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.analysis.mtl;
/**
@@ -15,21 +16,21 @@ package org.eclipse.trace4cps.analysis.mtl;
public enum InformativePrefix {
/**
- * The formula is satisfied. If the state sequence is interpreted as a prefix, then any extension of the
- * state sequence will not invalidate the formula.
+ * The formula is satisfied. If the state sequence is interpreted as a prefix, then any extension of the state
+ * sequence will not invalidate the formula.
*/
GOOD,
/**
- * This value can only occur when the state sequence is interpreted as a prefix. The state sequence does
- * not give evidence that the formula is not satisfied. An extension of the state sequence may or may not
- * invalidate the formula.
+ * This value can only occur when the state sequence is interpreted as a prefix. The state sequence does not give
+ * evidence that the formula is not satisfied. An extension of the state sequence may or may not invalidate the
+ * formula.
*/
NON_INFORMATIVE,
/**
- * The state sequence contains a counter example for the formula. If the state sequence is interpreted as
- * a prefix, then any extension of the state sequence will not satisfy the formula.
+ * The state sequence contains a counter example for the formula. If the state sequence is interpreted as a prefix,
+ * then any extension of the state sequence will not satisfy the formula.
*/
BAD,
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/MtlBuilder.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/MtlBuilder.java
index 0ccd22059fa5edeafede42680a82cdd42a34b418..57b8c0c57023e6c080eab056b8947536693844ab 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/MtlBuilder.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/MtlBuilder.java
@@ -7,6 +7,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.analysis.mtl;
import org.eclipse.trace4cps.analysis.mtl.impl.MTLand;
@@ -21,19 +22,18 @@ import org.eclipse.trace4cps.core.impl.Interval;
* A utility class for building {@link MtlFormula} instances.
*/
public final class MtlBuilder {
-
- private static final MTLtrue mtlTrue = new MTLtrue();
+ private static final MTLtrue MTL_TRUE = new MTLtrue();
private MtlBuilder() {
}
public static MtlFormula TRUE() {
- return mtlTrue;
+ return MTL_TRUE;
}
public static MtlFormula NOT(MtlFormula f) {
if (f instanceof MTLnot) {
- return ((MTLnot) f).getChild();
+ return ((MTLnot)f).getChild();
} else {
return new MTLnot(f);
}
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/MtlChecker.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/MtlChecker.java
index 948849b12b421a168a6160c73e4f23fbe7aa04c4..c2a95016132e64488ab00657e6f30123d4ecb21f 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/MtlChecker.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/MtlChecker.java
@@ -7,6 +7,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.analysis.mtl;
import java.util.Collection;
@@ -24,23 +25,23 @@ import org.eclipse.trace4cps.core.ITrace;
/**
* This class is the main entry point for runtime verification of STL-mx specifications on traces. Use the
- * {@link MtlBuilder} class for construction of {@link MtlFormula} instances. The list of states typically is
- * provided by {@link ITrace#getEvents()}}.
- *
+ * {@link MtlBuilder} class for construction of {@link MtlFormula} instances. The list of states typically is provided
+ * by {@link ITrace#getEvents()}}.
+ *
* References:
*
- *
M. Hendriks, M. Geilen, A. R. B. Behrouzian, T. Basten, H. Alizadeh, and D. Goswami. Checking metric
- * temporal logic with trace. In 2016 16th International Conference on Application of Concurrency to System
- * Design (ACSD), pages 19-24, June 2016.
M. Hendriks, M. Geilen, A. R. B. Behrouzian, T. Basten, H. Alizadeh, and D. Goswami. Checking metric temporal
+ * logic with trace. ESR-2016-01, 11 April 2016. (http://www.es.ele.tue.nl/esreports/esr-2016-01.pdf)
- *
T. Ferrere, O. Maler, D. Nickovic. Mixed-Time Signal Temporal Logic. In 2019 International Conference
- * on Formal Modeling and Analysis of Timed Systems (FORMATS), 2019.
+ *
T. Ferrere, O. Maler, D. Nickovic. Mixed-Time Signal Temporal Logic. In 2019 International Conference on Formal
+ * Modeling and Analysis of Timed Systems (FORMATS), 2019.
*
+ *
*/
public final class MtlChecker {
-
private final int numThreads;
/**
@@ -52,7 +53,7 @@ public final class MtlChecker {
/**
* A checker that uses at most a given number of threads.
- *
+ *
* @param numThreads maximum number of threads to use
*/
public MtlChecker(int numThreads) {
@@ -63,7 +64,7 @@ public final class MtlChecker {
* Synchronously checks an STL-mx formula (i.e., an {@link MtlFormula} which may have {@link StlFormula}
* subformulas). The trace is interpreted as a prefix if and only if the given formula does not contain
* {@link StlFormula} parts.
- *
+ *
* @param trace the execution trace
* @param phi the formula to check
* @return the result
@@ -75,10 +76,10 @@ public final class MtlChecker {
/**
* Synchronously checks an STL-mx formula (i.e., an {@link MtlFormula} which may have {@link StlFormula}
- * subformulas). The result will contain an explanation of the formulas whose satisfaction value is
- * contained in the given {@code explain} set. The trace can be interpreted as a prefix if and only if the
- * given formula does not contain {@link StlFormula} parts.
- *
+ * subformulas). The result will contain an explanation of the formulas whose satisfaction value is contained in the
+ * given {@code explain} set. The trace can be interpreted as a prefix if and only if the given formula does not
+ * contain {@link StlFormula} parts.
+ *
* @param trace the execution trace
* @param phi the formula to check
* @param explain the set of truth values for which to generate an explanation (typically only BAD)
@@ -86,10 +87,10 @@ public final class MtlChecker {
* @return the result
*/
public MtlResult check(List extends State> trace, MtlFormula phi, Set explain,
- boolean interpretAsPrefix) {
+ boolean interpretAsPrefix)
+ {
if (interpretAsPrefix && !MtlUtil.isMtl(phi)) {
- throw new IllegalArgumentException(
- "trace can only be interpreted as a prefix for pure MTL formulas");
+ throw new IllegalArgumentException("trace can only be interpreted as a prefix for pure MTL formulas");
}
SingleFormulaChecker c = new RecursiveMemoizationChecker();
InformativePrefix r = c.check(trace, phi, explain, interpretAsPrefix);
@@ -97,10 +98,10 @@ public final class MtlChecker {
}
/**
- * A-synchronously checks a list of STL-mx formula (i.e., an {@link MtlFormula} which may have
- * {@link StlFormula} subformulas). The trace is interpreted as a prefix if the given formula does not
- * contain {@link StlFormula} parts.
- *
+ * A-synchronously checks a list of STL-mx formula (i.e., an {@link MtlFormula} which may have {@link StlFormula}
+ * subformulas). The trace is interpreted as a prefix if the given formula does not contain {@link StlFormula}
+ * parts.
+ *
* @param trace the execution trace
* @param phis the formulas to check
* @return the result
@@ -110,24 +111,25 @@ public final class MtlChecker {
}
/**
- * A-synchronously checks a list of STL-mx formula (i.e., an {@link MtlFormula} which may have
- * {@link StlFormula} subformulas). The result will contain an explanation of the formulas whose
- * satisfaction value is contained in the given {@code explain} set.The trace is interpreted as a prefix
- * if the given formula does not contain {@link StlFormula} parts and {@code interpretAsPrefix = true}.
- *
+ * A-synchronously checks a list of STL-mx formula (i.e., an {@link MtlFormula} which may have {@link StlFormula}
+ * subformulas). The result will contain an explanation of the formulas whose satisfaction value is contained in the
+ * given {@code explain} set.The trace is interpreted as a prefix if the given formula does not contain
+ * {@link StlFormula} parts and {@code interpretAsPrefix = true}.
+ *
* @param trace the execution trace
* @param phis the formulas to check
* @param explain the set of truth values for which to generate an explanation (typically only BAD)
- * @param tryInterpretAsPrefix whether to interpret the trace as a prefix (if true, then this is only
- * applied if the formula is a pure MTL formula)
+ * @param tryInterpretAsPrefix whether to interpret the trace as a prefix (if true, then this is only applied if the
+ * formula is a pure MTL formula)
* @return the result
*/
- public MtlFuture checkAll(List extends State> trace, Collection phis,
- Set explain, boolean tryInterpretAsPrefix) {
+ public MtlFuture checkAll(List extends State> trace, Collection phis, Set explain,
+ boolean tryInterpretAsPrefix)
+ {
List safeList = new CopyOnWriteArrayList(trace);
ExecutorService exec = Executors.newFixedThreadPool(numThreads);
MtlFuture future = new MtlFuture(phis.size(), exec);
- for (MtlFormula phi : phis) {
+ for (MtlFormula phi: phis) {
boolean pref = tryInterpretAsPrefix && MtlUtil.isMtl(phi);
exec.submit(new CheckTask(safeList, phi, future, explain, pref));
}
@@ -143,7 +145,6 @@ public final class MtlChecker {
}
private static final class CheckTask implements Runnable {
-
private final List trace;
private final MtlFormula phi;
@@ -155,7 +156,8 @@ public final class MtlChecker {
private final boolean interpretAsPrefix;
public CheckTask(List trace, MtlFormula phi, MtlFuture result, Set explain,
- boolean interpretAsPrefix) {
+ boolean interpretAsPrefix)
+ {
this.trace = trace;
this.phi = phi;
this.result = result;
@@ -163,6 +165,7 @@ public final class MtlChecker {
this.interpretAsPrefix = interpretAsPrefix;
}
+ @Override
public void run() {
try {
SingleFormulaChecker c = new RecursiveMemoizationChecker();
@@ -170,7 +173,7 @@ public final class MtlChecker {
result.addToResult(phi, r, c.getExplanation());
} catch (Throwable th) {
// th.printStackTrace();
- result.addError(th);
+ result.addError(th);
}
}
}
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/MtlException.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/MtlException.java
index fc28b5bc6380c443d5af7b048ab4a5ac5c00f90a..c3d23328cb5ea6c6771b5b2ce82f51a527b2725e 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/MtlException.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/MtlException.java
@@ -7,12 +7,12 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.analysis.mtl;
import org.eclipse.trace4cps.analysis.AnalysisException;
public class MtlException extends AnalysisException {
-
private static final long serialVersionUID = 1L;
public MtlException() {
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/MtlFormula.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/MtlFormula.java
index 40cdd9b7710c06d95c9fc451352ee052128d5890..e07e954a8d9cd68886f459d0888f461302dbeaed 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/MtlFormula.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/MtlFormula.java
@@ -7,6 +7,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.analysis.mtl;
import java.util.List;
@@ -15,7 +16,6 @@ import java.util.List;
* Top-level interface for metric-temporal logic formulas.
*/
public interface MtlFormula {
-
/**
* @return sub formulas of this formula
*/
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/MtlFuture.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/MtlFuture.java
index e6d01549c8dfe0a4fbd4c583c2f1a4b96be4f533..ba19c6ddc494d96b524b42685a51a5587d5879a7 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/MtlFuture.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/MtlFuture.java
@@ -7,6 +7,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.analysis.mtl;
import java.util.ArrayList;
@@ -21,7 +22,6 @@ import java.util.concurrent.TimeoutException;
* A future for an asynchronous temporal-logic verification.
*/
public final class MtlFuture implements Future> {
-
private final Object lock = new Object();
private final int total;
@@ -161,7 +161,8 @@ public final class MtlFuture implements Future> {
*/
@Override
public List get(long timeout, TimeUnit unit)
- throws InterruptedException, ExecutionException, TimeoutException {
+ throws InterruptedException, ExecutionException, TimeoutException
+ {
throw new UnsupportedOperationException();
}
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/MtlResult.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/MtlResult.java
index a3ad67edd0f5c86974d33786ee4ab51fec12d2e4..f2b4ed013605118c9d2c2a8d035ca991a0690077 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/MtlResult.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/MtlResult.java
@@ -7,13 +7,13 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.analysis.mtl;
/**
* The result of a computation of the {@link MtlChecker}.
*/
public final class MtlResult {
-
private final MtlFormula phi;
private final InformativePrefix informativePrefix;
@@ -42,9 +42,8 @@ public final class MtlResult {
/**
* An explanation is only available when it is explicitly asked to the {@link MtlChecker}. The
- * {@link ExplanationTable} is a representation of the data structure that has been used to check the
- * formula.
- *
+ * {@link ExplanationTable} is a representation of the data structure that has been used to check the formula.
+ *
* @return an explanation, or {@code null} if no explanation has been asked
*/
public ExplanationTable getExplanation() {
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/MtlUtil.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/MtlUtil.java
index 11465ee342be098553ac2afbbfa7a912dfaa0232..3af3196b10fa849f15eb8264e403f388803c8697 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/MtlUtil.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/MtlUtil.java
@@ -7,6 +7,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.analysis.mtl;
import java.util.ArrayList;
@@ -22,33 +23,32 @@ import org.eclipse.trace4cps.analysis.stl.StlFormula;
* A utility class for handling MTL-related things.
*/
public final class MtlUtil {
-
private MtlUtil() {
}
public static boolean isMtl(MtlFormula phi) {
- for (MtlFormula sub : getSubformulas(phi)) {
+ for (MtlFormula sub: getSubformulas(phi)) {
if (sub instanceof StlFormula) {
return false;
}
}
return true;
}
-
+
public static boolean isStl(MtlFormula phi) {
return phi instanceof StlFormula;
}
-
+
public static boolean isStlMx(MtlFormula phi) {
- return !(isStl(phi) || isMtl(phi));
+ return !(isStl(phi) || isMtl(phi));
}
-
+
public static Collection getAtomicPropIndices(MtlResult r) {
Set aps = getAtomicPropositions(r.getPhi());
ExplanationTable tab = r.getExplanation();
Set result = new HashSet();
- for (AtomicProposition ap : aps) {
- for (Region region : tab.getRegions(ap)) {
+ for (AtomicProposition ap: aps) {
+ for (Region region: tab.getRegions(ap)) {
if (region.getValue() == InformativePrefix.GOOD) {
for (int i = region.getStartIndex(); i <= region.getEndIndex(); i++) {
result.add(i);
@@ -60,9 +60,8 @@ public final class MtlUtil {
}
/**
- *
* Returns all subformulas of a given formula in a depth-first order (including the formula itself).
- *
+ *
* @param phi the formula
* @return a list of subformulas
*/
@@ -80,17 +79,17 @@ public final class MtlUtil {
private static void depthFirstAP(MtlFormula phi, Set r) {
if (!phi.getChildren().isEmpty()) {
- for (MtlFormula c : phi.getChildren()) {
+ for (MtlFormula c: phi.getChildren()) {
depthFirstAP(c, r);
}
} else if (phi instanceof AtomicProposition) {
- r.add((AtomicProposition) phi);
+ r.add((AtomicProposition)phi);
}
}
private static void depthFirstSub(MtlFormula phi, List r) {
if (!phi.getChildren().isEmpty()) {
- for (MtlFormula c : phi.getChildren()) {
+ for (MtlFormula c: phi.getChildren()) {
depthFirstSub(c, r);
}
}
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/State.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/State.java
index c9962395d9b3dcda9596b4cab09472504c144955..b81f5af1e3d8f9f68843fb9555409f7d7f84a1a3 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/State.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/State.java
@@ -7,20 +7,22 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.analysis.mtl;
import org.eclipse.trace4cps.core.IAttributeAware;
+import org.eclipse.trace4cps.core.IEvent;
/**
- * Temporal-logic checking works on a sequence of {@link State} instances. Note that {@link IEvent} extends
- * the {@link State} type.
- *
+ * Temporal-logic checking works on a sequence of {@link State} instances. Note that {@link IEvent} extends the
+ * {@link State} type.
+ *
* Each state has a timestamp, a number of attributes, and a method that gives the truth-value of a given
- * {@link AtomicProposition}. Both {@link State} and {@link AtomicProposition} are {@link IAttributeAware}.
- * The satisfaction relation uses the attributes, and also the {@link AtomicProposition#getType()} method.
+ * {@link AtomicProposition}. Both {@link State} and {@link AtomicProposition} are {@link IAttributeAware}. The
+ * satisfaction relation uses the attributes, and also the {@link AtomicProposition#getType()} method.
+ *
*/
public interface State extends IAttributeAware {
-
/**
* @return the timestamp of this state
*/
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/check/CompactExplanationTableImpl.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/check/CompactExplanationTableImpl.java
index 8e565a046cfe8b7b020942ea4c9e624a5eaeae30..aa48f576346845e65ce11a7de0f3031791735ce9 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/check/CompactExplanationTableImpl.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/check/CompactExplanationTableImpl.java
@@ -7,6 +7,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.analysis.mtl.check;
import java.util.ArrayList;
@@ -22,7 +23,6 @@ import org.eclipse.trace4cps.analysis.mtl.impl.MTLtrue;
* We need 4 bits per index,formula. Optimization for locality in Until computation: put all formulas together
*/
public final class CompactExplanationTableImpl implements TabularExplanationTable {
-
private final List extends State> trace;
private final Map subForms;
@@ -30,22 +30,22 @@ public final class CompactExplanationTableImpl implements TabularExplanationTabl
private int trueIndex = -1;
// Number of 32-bit ints to encode the truth values of 1 state
- private final int P;
+ private final int p;
private final int[] table;
public CompactExplanationTableImpl(List extends State> trace, Map subForms) {
this.trace = trace;
this.subForms = subForms;
- for (Map.Entry e : subForms.entrySet()) {
+ for (Map.Entry e: subForms.entrySet()) {
if (e.getKey() instanceof MTLtrue) {
trueIndex = e.getValue();
}
}
// We don't encode the true atom:
- this.P = (subForms.size() / 8) + 1;
- this.table = new int[P * trace.size()];
- for (int i = 0; i < P * trace.size(); i++) {
+ this.p = (subForms.size() / 8) + 1;
+ this.table = new int[p * trace.size()];
+ for (int i = 0; i < p * trace.size(); i++) {
table[i] = 0;
}
}
@@ -62,12 +62,12 @@ public final class CompactExplanationTableImpl implements TabularExplanationTabl
}
// unpack value for formula:
// return (table[stateIndex * P + formulaIndex / 8] >> (4 * (formulaIndex % 8))) & 15;
- return (table[(stateIndex * P) + (formulaIndex >> 3)] >> ((formulaIndex & 7) << 2)) & 15;
+ return (table[(stateIndex * p) + (formulaIndex >> 3)] >> ((formulaIndex & 7) << 2)) & 15;
}
public int put(int formulaIndex, int stateIndex, int c) {
// table[stateIndex * P + formulaIndex / 8] |= (c << (4 * (formulaIndex % 8)));
- table[stateIndex * P + (formulaIndex >> 3)] |= (c << ((formulaIndex & 7) << 2));
+ table[stateIndex * p + (formulaIndex >> 3)] |= (c << ((formulaIndex & 7) << 2));
return c;
}
@@ -103,16 +103,16 @@ public final class CompactExplanationTableImpl implements TabularExplanationTabl
public InformativePrefix getValue(int formulaIndex, int index) {
switch (get(formulaIndex, index)) {
- case YES:
- return InformativePrefix.GOOD;
- case NO:
- return InformativePrefix.BAD;
- case MAYBE:
- return InformativePrefix.NON_INFORMATIVE;
- case UNKNOWN:
- return InformativePrefix.NOT_COMPUTED;
- default:
- throw new IllegalStateException();
+ case YES:
+ return InformativePrefix.GOOD;
+ case NO:
+ return InformativePrefix.BAD;
+ case MAYBE:
+ return InformativePrefix.NON_INFORMATIVE;
+ case UNKNOWN:
+ return InformativePrefix.NOT_COMPUTED;
+ default:
+ throw new IllegalStateException();
}
}
}
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/check/RecursiveMemoizationChecker.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/check/RecursiveMemoizationChecker.java
index 80e4c5f172da33f649d5531d4df165cb6d09f0a5..f1be37077488305a00095593f4ffc30fcb19828e 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/check/RecursiveMemoizationChecker.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/check/RecursiveMemoizationChecker.java
@@ -7,6 +7,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.analysis.mtl.check;
import static org.eclipse.trace4cps.analysis.mtl.check.TabularExplanationTable.MAYBE;
@@ -36,7 +37,6 @@ import org.eclipse.trace4cps.analysis.stl.StlFormula;
import org.eclipse.trace4cps.core.impl.Interval;
public final class RecursiveMemoizationChecker implements SingleFormulaChecker {
-
private List extends State> trace;
private Set log;
@@ -49,8 +49,10 @@ public final class RecursiveMemoizationChecker implements SingleFormulaChecker {
private final Map depthMap = new HashMap();
+ @Override
public InformativePrefix check(List extends State> trace, MtlFormula phi, Set log,
- boolean interpretAsPrefix) {
+ boolean interpretAsPrefix)
+ {
this.trace = trace;
if (log != null) {
this.log = log;
@@ -61,7 +63,7 @@ public final class RecursiveMemoizationChecker implements SingleFormulaChecker {
List sub = MtlUtil.getSubformulas(phi);
idMap.clear();
int i = 0;
- for (MtlFormula f : sub) {
+ for (MtlFormula f: sub) {
idMap.put(f, i);
i++;
}
@@ -80,7 +82,7 @@ public final class RecursiveMemoizationChecker implements SingleFormulaChecker {
private int fillDepthMap(MtlFormula phi) {
int max = 0;
- for (MtlFormula child : phi.getChildren()) {
+ for (MtlFormula child: phi.getChildren()) {
max = Math.max(max, fillDepthMap(child));
}
depthMap.put(phi, max);
@@ -98,25 +100,26 @@ public final class RecursiveMemoizationChecker implements SingleFormulaChecker {
/**
* {@inheritDoc}
*/
+ @Override
public ExplanationTable getExplanation() {
return l;
}
private int fillTable(MtlFormula f, int i) {
if (f instanceof AtomicProposition) {
- return fillAP((AtomicProposition) f, i);
+ return fillAP((AtomicProposition)f, i);
} else if (f instanceof MTLnot) {
- return fillNot((MTLnot) f, i);
+ return fillNot((MTLnot)f, i);
} else if (f instanceof MTLand) {
- return fillAnd((MTLand) f, i);
+ return fillAnd((MTLand)f, i);
} else if (f instanceof MTLimply) {
- return fillImply((MTLimply) f, i);
+ return fillImply((MTLimply)f, i);
} else if (f instanceof MTLor) {
- return fillOr((MTLor) f, i);
+ return fillOr((MTLor)f, i);
} else if (f instanceof MTLuntil) {
- return fillUntil((MTLuntil) f, i);
+ return fillUntil((MTLuntil)f, i);
} else if (f instanceof StlFormula) {
- return fillStlSubformula((StlFormula) f, i);
+ return fillStlSubformula((StlFormula)f, i);
} else {
throw new IllegalStateException("use of " + f.getClass().toString() + " constructs unsupported!");
}
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/check/RegionImpl.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/check/RegionImpl.java
index d783a5ec6f7b19817c0ebc23e137dfd5a2a2bcf4..73ac1f0b4612744b2abd70186127d81763107923 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/check/RegionImpl.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/check/RegionImpl.java
@@ -7,13 +7,13 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.analysis.mtl.check;
-import org.eclipse.trace4cps.analysis.mtl.InformativePrefix;
import org.eclipse.trace4cps.analysis.mtl.ExplanationTable.Region;
+import org.eclipse.trace4cps.analysis.mtl.InformativePrefix;
public final class RegionImpl implements Region {
-
private double startTime = -1;
private double endTime = -1;
@@ -38,22 +38,27 @@ public final class RegionImpl implements Region {
this.endTime = timeStamp;
}
+ @Override
public int getStartIndex() {
return startIndex;
}
+ @Override
public int getEndIndex() {
return endIndex;
}
+ @Override
public double getStartTime() {
return startTime;
}
+ @Override
public double getEndTime() {
return endTime;
}
+ @Override
public InformativePrefix getValue() {
return val;
}
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/check/SingleFormulaChecker.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/check/SingleFormulaChecker.java
index b62516947ec81d85b90d917ed142756d1bef3dea..d6fa447ab392e78e1eb11a497f5d8e85cfeb10b7 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/check/SingleFormulaChecker.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/check/SingleFormulaChecker.java
@@ -7,6 +7,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.analysis.mtl.check;
import java.util.List;
@@ -18,7 +19,6 @@ import org.eclipse.trace4cps.analysis.mtl.MtlFormula;
import org.eclipse.trace4cps.analysis.mtl.State;
public interface SingleFormulaChecker {
-
InformativePrefix check(List extends State> trace, MtlFormula phi, Set log,
boolean interpretAsPrefix);
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/check/TabularExplanationTable.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/check/TabularExplanationTable.java
index 6c29705a9d6fb817e3604a39e3d6bff1c310691c..2b651ade5ad2a25184ee1410b23190c9be506d34 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/check/TabularExplanationTable.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/check/TabularExplanationTable.java
@@ -7,6 +7,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.analysis.mtl.check;
import org.eclipse.trace4cps.analysis.mtl.ExplanationTable;
@@ -14,7 +15,6 @@ import org.eclipse.trace4cps.analysis.mtl.InformativePrefix;
import org.eclipse.trace4cps.analysis.mtl.MtlFormula;
public interface TabularExplanationTable extends ExplanationTable {
-
public static final int YES = 1;
public static final int NO = 2;
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/impl/AbstractBinopMTLformula.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/impl/AbstractBinopMTLformula.java
index cf3522ac95b8c200df244f69a5f6d1c7a538b976..1d60e2263ce790fc93974777fbb63bcc2ad22bed 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/impl/AbstractBinopMTLformula.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/impl/AbstractBinopMTLformula.java
@@ -7,12 +7,12 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.analysis.mtl.impl;
import org.eclipse.trace4cps.analysis.mtl.MtlFormula;
public abstract class AbstractBinopMTLformula extends AbstractMTLformula {
-
public AbstractBinopMTLformula(MtlFormula left, MtlFormula right) {
super(left, right);
}
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/impl/AbstractMTLformula.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/impl/AbstractMTLformula.java
index 1aa71553fb01fd73438b2996b5c8607c5042274c..d847f9cda890bbf4523b50ffec8625298c1edc06 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/impl/AbstractMTLformula.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/impl/AbstractMTLformula.java
@@ -7,6 +7,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.analysis.mtl.impl;
import java.util.ArrayList;
@@ -15,12 +16,11 @@ import java.util.List;
import org.eclipse.trace4cps.analysis.mtl.MtlFormula;
public abstract class AbstractMTLformula implements MtlFormula {
-
protected final List children = new ArrayList();
public AbstractMTLformula(MtlFormula... c) {
if (c != null) {
- for (MtlFormula f : c) {
+ for (MtlFormula f: c) {
children.add(f);
}
}
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/impl/DoubleIExp.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/impl/DoubleIExp.java
index 2938e21094724d0f10bd6d6c15a8baea59a892aa..b9064fa9be62be1a2e230ed3d96ae14d5698fad2 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/impl/DoubleIExp.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/impl/DoubleIExp.java
@@ -7,12 +7,12 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.analysis.mtl.impl;
import java.util.Map;
public class DoubleIExp implements IExp {
-
private final double value;
public DoubleIExp(double value) {
@@ -24,7 +24,7 @@ public class DoubleIExp implements IExp {
}
public long evaluateLong(Map valuation) {
- return (long) value;
+ return (long)value;
}
public boolean isNaturalNumber() {
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/impl/IExp.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/impl/IExp.java
index a3b5e27583066b35b70dd0cb763da1b547d1308c..3c955da7472547265af85484fe54470c8e4d2009 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/impl/IExp.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/impl/IExp.java
@@ -7,12 +7,12 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.analysis.mtl.impl;
import java.util.Map;
public interface IExp {
-
public enum Iop {
PLUS("+"), MINUS("-"), MULT("*"), DIV("/"), MOD("%");
@@ -22,6 +22,7 @@ public interface IExp {
this.rep = rep;
}
+ @Override
public String toString() {
return rep;
}
@@ -33,7 +34,7 @@ public interface IExp {
/**
* A variable can only come from a top-level conjunction and is a natural number
- *
+ *
* @return whether a variable is used in the expression
*/
boolean hasVariable();
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/impl/IntIExp.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/impl/IntIExp.java
index aa6d97ec9a0e23067fa7037a1edb2314e4d5c006..822b5d0a9a85e5af0e48275567c5ae67d99fa012 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/impl/IntIExp.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/impl/IntIExp.java
@@ -7,12 +7,12 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.analysis.mtl.impl;
import java.util.Map;
public class IntIExp implements IExp {
-
private final long value;
public IntIExp(long value) {
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/impl/MTLand.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/impl/MTLand.java
index 8334516c5b4574675f982ef30c473c61de1c5db3..6917749d066e6eba98e886a31944de4e3fc3867d 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/impl/MTLand.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/impl/MTLand.java
@@ -7,12 +7,12 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.analysis.mtl.impl;
import org.eclipse.trace4cps.analysis.mtl.MtlFormula;
public class MTLand extends AbstractBinopMTLformula {
-
public MTLand(MtlFormula a, MtlFormula b) {
super(a, b);
}
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/impl/MTLimply.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/impl/MTLimply.java
index 2215656d5caee83a04c33c0074a3833839d43128..f5016f7aabfe06fc6ee78b2be570e4d8c42be185 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/impl/MTLimply.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/impl/MTLimply.java
@@ -7,12 +7,12 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.analysis.mtl.impl;
import org.eclipse.trace4cps.analysis.mtl.MtlFormula;
public class MTLimply extends AbstractBinopMTLformula {
-
public MTLimply(MtlFormula a, MtlFormula b) {
super(a, b);
}
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/impl/MTLnot.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/impl/MTLnot.java
index 658f279bdd255d89ec2f07046e619a9f8353ad14..e46ab315e8fed2d6b8c4694042fd39f47855b1d6 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/impl/MTLnot.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/impl/MTLnot.java
@@ -7,13 +7,13 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.analysis.mtl.impl;
import org.eclipse.trace4cps.analysis.mtl.MtlFormula;
import org.eclipse.trace4cps.core.impl.Interval;
public class MTLnot extends AbstractMTLformula {
-
public MTLnot(MtlFormula p) {
super(p);
}
@@ -25,7 +25,7 @@ public class MTLnot extends AbstractMTLformula {
@Override
public String toString() {
if (getChild() instanceof MTLuntil) {
- MTLuntil u = (MTLuntil) getChild();
+ MTLuntil u = (MTLuntil)getChild();
Interval i = u.getInterval();
String interval = "";
if (!i.isTrivial()) {
@@ -33,7 +33,7 @@ public class MTLnot extends AbstractMTLformula {
}
if (u.getLeft() instanceof MTLtrue) {
if (u.getRight() instanceof MTLnot) {
- MTLnot n = (MTLnot) u.getRight();
+ MTLnot n = (MTLnot)u.getRight();
return "G" + interval + " " + n.getChild();
} else {
return "G" + interval + " !" + u.getRight();
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/impl/MTLor.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/impl/MTLor.java
index a452cc0ed000519615f4303ab88466d544c50ebd..55be60d03b85e9e72a6b010a0ad2a23cd70082eb 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/impl/MTLor.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/impl/MTLor.java
@@ -7,12 +7,12 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.analysis.mtl.impl;
import org.eclipse.trace4cps.analysis.mtl.MtlFormula;
public class MTLor extends AbstractBinopMTLformula {
-
public MTLor(MtlFormula a, MtlFormula b) {
super(a, b);
}
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/impl/MTLtrue.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/impl/MTLtrue.java
index b3b885829cc085a0a35191abed975de1a1e7aca9..642eb4c2edc53a3977f56abfa7fc16ab9b8be689 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/impl/MTLtrue.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/impl/MTLtrue.java
@@ -7,10 +7,10 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.analysis.mtl.impl;
public class MTLtrue extends AbstractMTLformula {
-
@Override
public String toString() {
return "true";
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/impl/MTLuntil.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/impl/MTLuntil.java
index a2e43fdd8ba1febb865b127a9303f3e68bc48149..e3300156c3c5be0a577eb49c7ba7158346bc7236 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/impl/MTLuntil.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/impl/MTLuntil.java
@@ -7,13 +7,13 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.analysis.mtl.impl;
import org.eclipse.trace4cps.analysis.mtl.MtlFormula;
import org.eclipse.trace4cps.core.impl.Interval;
public class MTLuntil extends AbstractBinopMTLformula {
-
private final Interval interval;
public MTLuntil(MtlFormula a, MtlFormula b, Interval i) {
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/impl/OpIExp.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/impl/OpIExp.java
index 31c18192b686158a94063721161687ee81778c6a..0b438e6c30cc6cd18c730ad80280d86234cbed33 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/impl/OpIExp.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/impl/OpIExp.java
@@ -7,12 +7,12 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.analysis.mtl.impl;
import java.util.Map;
public class OpIExp implements IExp {
-
private final Iop op;
private final IExp left;
@@ -29,18 +29,18 @@ public class OpIExp implements IExp {
double v1 = left.evaluate(valuation);
double v2 = right.evaluate(valuation);
switch (op) {
- case PLUS:
- return v1 + v2;
- case MINUS:
- return v1 - v2;
- case MULT:
- return v1 * v2;
- case DIV:
- return v1 / v2;
- case MOD:
- return v1 % v2;
- default:
- throw new IllegalStateException("Unknown operator: " + op);
+ case PLUS:
+ return v1 + v2;
+ case MINUS:
+ return v1 - v2;
+ case MULT:
+ return v1 * v2;
+ case DIV:
+ return v1 / v2;
+ case MOD:
+ return v1 % v2;
+ default:
+ throw new IllegalStateException("Unknown operator: " + op);
}
}
@@ -48,18 +48,18 @@ public class OpIExp implements IExp {
long v1 = left.evaluateLong(valuation);
long v2 = right.evaluateLong(valuation);
switch (op) {
- case PLUS:
- return v1 + v2;
- case MINUS:
- return v1 - v2;
- case MULT:
- return v1 * v2;
- case DIV:
- return v1 / v2;
- case MOD:
- return v1 % v2;
- default:
- throw new IllegalStateException("Unknown operator: " + op);
+ case PLUS:
+ return v1 + v2;
+ case MINUS:
+ return v1 - v2;
+ case MULT:
+ return v1 * v2;
+ case DIV:
+ return v1 / v2;
+ case MOD:
+ return v1 % v2;
+ default:
+ throw new IllegalStateException("Unknown operator: " + op);
}
}
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/impl/VarIExp.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/impl/VarIExp.java
index b353e37836f18e973277eabf69f61b830a547490..a051c5067e640efe1d8d97e9187755c6f4163907 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/impl/VarIExp.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/mtl/impl/VarIExp.java
@@ -7,12 +7,12 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.analysis.mtl.impl;
import java.util.Map;
public class VarIExp implements IExp {
-
private final String value;
public VarIExp(String value) {
@@ -23,16 +23,14 @@ public class VarIExp implements IExp {
Long l = valuation.get(value);
if (l == null) {
throw new IllegalStateException("No value for free variable \"" + value + "\"");
-
}
- return (double) l;
+ return (double)l;
}
public long evaluateLong(Map valuation) {
Long l = valuation.get(value);
if (l == null) {
throw new IllegalStateException("No value for free variable \"" + value + "\"");
-
}
return l;
}
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/resource/ResourceAnalysis.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/resource/ResourceAnalysis.java
index e65d589f4e2ea87c18415c9b380ab50497c7a3eb..3e1c7872bc16fe72119f2230ba5494f80e7b6ceb 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/resource/ResourceAnalysis.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/resource/ResourceAnalysis.java
@@ -7,6 +7,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.analysis.resource;
import java.util.HashMap;
@@ -23,21 +24,21 @@ import org.eclipse.trace4cps.core.ITrace;
* This class provides a straightforward resource-usage analysis of a given {@link ITrace}.
*/
public class ResourceAnalysis {
-
private ResourceAnalysis() {
}
/**
* Computes the resource-usage of selected resources.
- *
+ *
* @param trace the {@link ITrace}
* @param selected the {@link IResource} instances to include
* @param cumulative whether the result is shown as a cumulative value
- * @return a map that for each selected resource gives a map that for a number of concurrent clients on
- * the resource gives the amount of time (% of the trace time, possible cumulative)
+ * @return a map that for each selected resource gives a map that for a number of concurrent clients on the resource
+ * gives the amount of time (% of the trace time, possible cumulative)
*/
public static Map> compute(ITrace trace, List selected,
- boolean cumulative) {
+ boolean cumulative)
+ {
return convertHistos(getHistos(trace), selected, cumulative);
}
@@ -45,7 +46,7 @@ public class ResourceAnalysis {
Map histos = new HashMap();
double min = Double.POSITIVE_INFINITY;
double max = Double.NEGATIVE_INFINITY;
- for (IClaim c : trace.getClaims()) {
+ for (IClaim c: trace.getClaims()) {
IResource r = c.getResource();
ResourceClientHistogram h = histos.get(r);
if (h == null) {
@@ -57,16 +58,17 @@ public class ResourceAnalysis {
min = Math.min(min, c.getStartTime().doubleValue());
max = Math.max(max, c.getEndTime().doubleValue());
}
- for (ResourceClientHistogram h : histos.values()) {
+ for (ResourceClientHistogram h: histos.values()) {
h.done(min, max);
}
return histos;
}
- private static Map> convertHistos(
- Map histos, List selected, boolean cumulative) {
+ private static Map>
+ convertHistos(Map histos, List selected, boolean cumulative)
+ {
Map> h = new HashMap>();
- for (Map.Entry e : histos.entrySet()) {
+ for (Map.Entry e: histos.entrySet()) {
IResource r = e.getKey();
if (selected.contains(r)) {
if (cumulative) {
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/resource/impl/ResourceClientHistogram.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/resource/impl/ResourceClientHistogram.java
index 569d251e9bf86a1515c51b4fdd9d1c7ec29fad4f..4e06e685d63894ef88da44da421d29576f300e26 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/resource/impl/ResourceClientHistogram.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/resource/impl/ResourceClientHistogram.java
@@ -7,6 +7,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.analysis.resource.impl;
import java.util.ArrayList;
@@ -20,9 +21,8 @@ import java.util.TreeMap;
* This class provides a histogram of the time that the resource has n clients.
*/
public final class ResourceClientHistogram {
-
private static final Comparator COMP = new Comparator() {
-
+ @Override
public int compare(Event o1, Event o2) {
return Double.compare(o1.timeStamp, o2.timeStamp);
}
@@ -40,7 +40,7 @@ public final class ResourceClientHistogram {
/**
* For building the histogram from a list of claims.
- *
+ *
* @param start start timestamp of a single claim
* @param end end timestamp of a single claim
*/
@@ -86,7 +86,7 @@ public final class ResourceClientHistogram {
/**
* Finishes building the histogram. Needs to be called before {@link #getClientUsage()}.
- *
+ *
* @param lastTimeStamp the last timestamp in the trace
*/
public void done(double firstTimeStamp, double lastTimeStamp) {
@@ -107,7 +107,7 @@ public final class ResourceClientHistogram {
throw new IllegalStateException("timestamps from claims are before the first timestamp");
}
process(firstTimeStamp, prevTimeStamp, 0);
- for (Event e : events) {
+ for (Event e: events) {
process(prevTimeStamp, e.timeStamp, cnt);
prevTimeStamp = e.timeStamp;
if (e.isStart) {
@@ -122,11 +122,11 @@ public final class ResourceClientHistogram {
process(prevTimeStamp, lastTimeStamp, cnt);
// Create normalized
double sum = 0d;
- for (Double t : histogram.values()) {
+ for (Double t: histogram.values()) {
sum += t;
}
double prevV = 0d;
- for (Map.Entry e : histogram.entrySet()) {
+ for (Map.Entry e: histogram.entrySet()) {
double v = (e.getValue() * 100d) / sum;
normalizedHistogram.put(e.getKey(), v);
normalizedCumulHistogram.put(e.getKey(), v + prevV);
@@ -145,7 +145,6 @@ public final class ResourceClientHistogram {
}
private static final class Event {
-
private final double timeStamp;
private boolean isStart;
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/signal/SignalModifier.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/signal/SignalModifier.java
index a757a3706e8de55469a92b47e231402a1407c9ce..18aadb9abb8cf2426e5a9808efdd19008d01eb73 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/signal/SignalModifier.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/signal/SignalModifier.java
@@ -7,6 +7,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.analysis.signal;
import java.util.concurrent.TimeUnit;
@@ -15,8 +16,7 @@ import java.util.concurrent.TimeUnit;
* A signal modifier to modify the scaling of the signal, and the applied convolution.
*/
public class SignalModifier {
-
- public static SignalModifier NONE = new SignalModifier(1d);
+ public static final SignalModifier NONE = new SignalModifier(1d);
private final double scaleFactor;
@@ -26,7 +26,7 @@ public class SignalModifier {
/**
* Creates a new signal modifier without convolution.
- *
+ *
* @param scaleFactor the scaling
*/
public SignalModifier(double scaleFactor) {
@@ -37,7 +37,7 @@ public class SignalModifier {
/**
* Creates a new signal modifier.
- *
+ *
* @param scaleFactor the scale factor
* @param windowWidth the width of the convolution window ({@code <= 0}) means no convolution)
* @param windowTimeUnit the time unit of the convolution window width
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/signal/SignalUtil.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/signal/SignalUtil.java
index e3fcfc749ba2dfc2c27e64878d4a62bb3678d5d5..422742ece78d3f58664e2057f144bb507aa35b0d 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/signal/SignalUtil.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/signal/SignalUtil.java
@@ -7,6 +7,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.analysis.signal;
import java.util.ArrayList;
@@ -27,17 +28,16 @@ import org.eclipse.trace4cps.core.impl.Interval;
import org.eclipse.trace4cps.core.impl.TraceHelper;
/**
- * Utility methods for computing the Little's law signals of an {@link ITrace}. The signals here are all
- * computed based on the {@link IClaim} instances of an {@link ITrace}.
+ * Utility methods for computing the Little's law signals of an {@link ITrace}. The signals here are all computed based
+ * on the {@link IClaim} instances of an {@link ITrace}.
*/
public class SignalUtil {
-
private SignalUtil() {
}
/**
* Converts a time value from one unit to another.
- *
+ *
* @param dst the destination unit
* @param v the value
* @param src the source unit
@@ -51,25 +51,25 @@ public class SignalUtil {
return w;
}
- private static double getTraceWindowWidth(TimeUnit traceTimeUnit, double windowWidth,
- TimeUnit windowTimeUnit) {
+ private static double getTraceWindowWidth(TimeUnit traceTimeUnit, double windowWidth, TimeUnit windowTimeUnit) {
return convert(traceTimeUnit, windowWidth, windowTimeUnit);
}
/**
- * Creates a latency signal based on grouping of events by an {@code idAtt} attribute: all events with the
- * same value for this attribute are assumed to belong to the processing of a single object.
- *
+ * Creates a latency signal based on grouping of events by an {@code idAtt} attribute: all events with the same
+ * value for this attribute are assumed to belong to the processing of a single object.
+ *
* @param trace the trace
* @param idAttribute the attribute used for grouping of the events
* @param scaleUnit the unit in which the latency is expressed (unit of the range of the function, e.g.,
- * MILLISECOND)
+ * MILLISECOND)
* @param windowWidth the width of the convolution window
* @param windowUnit the time unit of the convolution window width
* @return a signal for the latency of object processing
*/
public static IPsop getLatency(ITrace trace, String idAttribute, TimeUnit scaleUnit, double windowWidth,
- TimeUnit windowUnit) {
+ TimeUnit windowUnit)
+ {
double scaleFactor = convert(scaleUnit, 1, trace.getTimeUnit());
SignalModifier mod = new SignalModifier(scaleFactor, windowWidth, windowUnit);
List wip = createWipEventSignal(trace, idAttribute);
@@ -83,9 +83,9 @@ public class SignalUtil {
}
/**
- * Creates a throughput signal based on grouping of events by an {@code idAtt} attribute: all events with
- * the same value for this attribute are assumed to belong to the processing of a single object.
- *
+ * Creates a throughput signal based on grouping of events by an {@code idAtt} attribute: all events with the same
+ * value for this attribute are assumed to belong to the processing of a single object.
+ *
* @param trace the trace
* @param idAttribute the attribute used for grouping of the events
* @param scaleUnit 1 / the unit in which the throughput is expressed (e.g., per SECOND)
@@ -93,18 +93,16 @@ public class SignalUtil {
* @param windowUnit the time unit of the convolution window width
* @return a signal for the throughput of object processing
*/
- public static IPsop getTP(ITrace trace, String idAtt, TimeUnit scaleUnit, double windowWidth,
- TimeUnit windowUnit) {
+ public static IPsop getTP(ITrace trace, String idAtt, TimeUnit scaleUnit, double windowWidth, TimeUnit windowUnit) {
double scaleFactor = convert(trace.getTimeUnit(), 1, scaleUnit);
SignalModifier mod = new SignalModifier(scaleFactor, windowWidth, windowUnit);
- return modifySignal(trace.getTimeUnit(), TraceHelper.getDomain(trace),
- createTpEventSignal(trace, idAtt), mod);
+ return modifySignal(trace.getTimeUnit(), TraceHelper.getDomain(trace), createTpEventSignal(trace, idAtt), mod);
}
/**
- * Creates a throughput signal based on events. Each event is assumed to represent the processing of a
- * single object. NOTE: a convolution must be specified, i.e., {@code windowWidth > 0}
- *
+ * Creates a throughput signal based on events. Each event is assumed to represent the processing of a single
+ * object. NOTE: a convolution must be specified, i.e., {@code windowWidth > 0}
+ *
* @param traceTimeUnit the time unit of the trace (and thus also of the events)
* @param dom the domain to which to project the result to
* @param events the events for the throughput signal
@@ -114,7 +112,8 @@ public class SignalUtil {
* @return the event-based throughput signal
*/
public static IPsop getTP(TimeUnit traceTimeUnit, IInterval dom, List events, TimeUnit scaleUnit,
- double windowWidth, TimeUnit windowUnit) {
+ double windowWidth, TimeUnit windowUnit)
+ {
double scaleFactor = convert(traceTimeUnit, 1, scaleUnit);
SignalModifier mod = new SignalModifier(scaleFactor, windowWidth, windowUnit);
if (!mod.appliesConvolution()) {
@@ -124,22 +123,21 @@ public class SignalUtil {
}
/**
- * Creates a work-in-progress signal based on grouping of events by an {@code idAtt} attribute: all events
- * with the same value for this attribute are assumed to belong to the processing of a single object.
- *
+ * Creates a work-in-progress signal based on grouping of events by an {@code idAtt} attribute: all events with the
+ * same value for this attribute are assumed to belong to the processing of a single object.
+ *
* @param trace the trace
* @param idAttribute the attribute used for grouping of the events
* @param mod the modifier (see {@link SignalModifier#forWip(double, TimeUnit)})
* @return a signal for the wip of object processing
*/
public static IPsop getWip(ITrace trace, String idAtt, SignalModifier mod) {
- return modifySignal(trace.getTimeUnit(), TraceHelper.getDomain(trace),
- createWipEventSignal(trace, idAtt), mod);
+ return modifySignal(trace.getTimeUnit(), TraceHelper.getDomain(trace), createWipEventSignal(trace, idAtt), mod);
}
/**
* Creates a signal with the number of concurrent clients on a given resource.
- *
+ *
* @param trace the trace
* @param resource the resource
* @param mod the signal modifier
@@ -147,12 +145,12 @@ public class SignalUtil {
*/
public static IPsop getResourceClients(ITrace trace, IResource resource, SignalModifier mod) {
return modifySignal(trace.getTimeUnit(), TraceHelper.getDomain(trace),
- createResourceUtilizationSignal(trace, resource), mod);
+ createResourceUtilizationSignal(trace, resource), mod);
}
/**
* Creates a signal with the total claimed amount of a given resource.
- *
+ *
* @param trace the trace
* @param resource the resource
* @param mod the signal modifier
@@ -160,11 +158,12 @@ public class SignalUtil {
*/
public static IPsop getResourceAmount(ITrace trace, IResource resource, SignalModifier mod) {
return modifySignal(trace.getTimeUnit(), TraceHelper.getDomain(trace),
- createResourceAmountSignal(trace, resource), mod);
+ createResourceAmountSignal(trace, resource), mod);
}
- private static IPsop modifySignal(TimeUnit traceTimeUnit, IInterval dom,
- List events, SignalModifier mod) {
+ private static IPsop modifySignal(TimeUnit traceTimeUnit, IInterval dom, List events,
+ SignalModifier mod)
+ {
if (mod.appliesConvolution()) {
return applyConvolution(traceTimeUnit, dom, mod, events);
} else {
@@ -172,14 +171,14 @@ public class SignalUtil {
}
}
- private static IPsop applyInstantaneous(IInterval dom, SignalModifier mod,
- List events) {
+ private static IPsop applyInstantaneous(IInterval dom, SignalModifier mod, List events) {
List inst = EventSignalUtil.computeInstantaneous(events, mod.getScale(), dom);
return EventSignalUtil.toIPsop(inst);
}
private static IPsop applyConvolution(TimeUnit traceTimeUnit, IInterval tdom, SignalModifier mod,
- List lsfs) {
+ List lsfs)
+ {
double scale = mod.getScale();
double w = getTraceWindowWidth(traceTimeUnit, mod.getWindowWidth(), mod.getWindowTimeUnit());
Interval dom = new Interval(tdom.lb(), false, tdom.ub().doubleValue() + w * 1.1, true);
@@ -187,13 +186,13 @@ public class SignalUtil {
}
/**
- * Returns a list of constant fragments with value 1 (thus counting the number of objects that are being
- * processed). The fragments are ordered ascending by their start time.
+ * Returns a list of constant fragments with value 1 (thus counting the number of objects that are being processed).
+ * The fragments are ordered ascending by their start time.
*/
private static List createWipEventSignal(ITrace trace, String idAtt) {
Map timeStampsAndValue = createTimeStampValueMap(trace, idAtt);
List events = new ArrayList<>();
- for (Map.Entry e : timeStampsAndValue.entrySet()) {
+ for (Map.Entry e: timeStampsAndValue.entrySet()) {
double[] ts = e.getValue();
events.add(new LinearSignalFragment(ts[0], ts[1], 1d, 1d));
}
@@ -202,13 +201,13 @@ public class SignalUtil {
}
/**
- * Returns a list of constant fragments with value 1/(t1-t0), which is a measure for the items processed
- * per timeunit (throughput). The fragments are ordered ascending by their start time.
+ * Returns a list of constant fragments with value 1/(t1-t0), which is a measure for the items processed per
+ * timeunit (throughput). The fragments are ordered ascending by their start time.
*/
private static List createTpEventSignal(ITrace trace, String idAtt) {
Map timeStampsAndValue = createTimeStampValueMap(trace, idAtt);
List events = new ArrayList<>();
- for (Map.Entry e : timeStampsAndValue.entrySet()) {
+ for (Map.Entry e: timeStampsAndValue.entrySet()) {
double[] ts = e.getValue();
double val = 1d / (ts[1] - ts[0]);
events.add(new LinearSignalFragment(ts[0], ts[1], val, val));
@@ -219,11 +218,10 @@ public class SignalUtil {
/**
* @param list a list of events, sorted ascending on their timestamp
- * @return
*/
private static List createTpEventSignal(List list) {
List events = new ArrayList<>();
- for (IEvent e : list) {
+ for (IEvent e: list) {
events.add(new LinearSignalFragment(e.getTimestamp().doubleValue(), 1d));
}
return events;
@@ -231,7 +229,7 @@ public class SignalUtil {
private static Map createTimeStampValueMap(ITrace trace, String idAtt) {
Map timeStampsAndValue = new HashMap<>();
- for (IEvent e : trace.getEvents()) {
+ for (IEvent e: trace.getEvents()) {
if (e.getAttributeValue(idAtt) != null) {
double[] vals = getOrCreate(idAtt, timeStampsAndValue, e);
vals[0] = Math.min(vals[0], e.getTimestamp().doubleValue());
@@ -270,13 +268,12 @@ public class SignalUtil {
return idAtt + "=" + val;
}
- private static List createResourceUtilizationSignal(ITrace trace,
- IResource resource) {
+ private static List createResourceUtilizationSignal(ITrace trace, IResource resource) {
List events = new ArrayList();
- for (IClaim c : trace.getClaims()) {
+ for (IClaim c: trace.getClaims()) {
if (c.getResource().equals(resource)) {
- events.add(new LinearSignalFragment(c.getStartTime().doubleValue(),
- c.getEndTime().doubleValue(), 1d, 1d));
+ events.add(
+ new LinearSignalFragment(c.getStartTime().doubleValue(), c.getEndTime().doubleValue(), 1d, 1d));
}
}
EventSignalUtil.sortStartAsc(events);
@@ -285,12 +282,12 @@ public class SignalUtil {
private static List createResourceAmountSignal(ITrace trace, IResource resource) {
List events = new ArrayList();
- for (IClaim c : trace.getClaims()) {
+ for (IClaim c: trace.getClaims()) {
if (c.getResource().equals(resource)) {
double v = c.getAmount().doubleValue();
if (v > 0d) {
- events.add(new LinearSignalFragment(c.getStartTime().doubleValue(),
- c.getEndTime().doubleValue(), v, v));
+ events.add(new LinearSignalFragment(c.getStartTime().doubleValue(), c.getEndTime().doubleValue(), v,
+ v));
}
}
}
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/signal/impl/EventSignalUtil.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/signal/impl/EventSignalUtil.java
index 1b165b1b81776c5a30d8c2875774c276d9ab6c14..183d928a8139b271606788a33d59f277931607c3 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/signal/impl/EventSignalUtil.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/signal/impl/EventSignalUtil.java
@@ -7,6 +7,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.analysis.signal.impl;
import java.util.ArrayList;
@@ -22,18 +23,16 @@ import org.eclipse.trace4cps.core.impl.Psop;
import org.eclipse.trace4cps.core.impl.PsopFragment;
public final class EventSignalUtil {
-
private EventSignalUtil() {
}
/**
* Sorts ascending with respect to the start timestamp of the event signal instances.
- *
+ *
* @param events a list of event signal instances
*/
public static void sortStartAsc(List events) {
Collections.sort(events, new Comparator() {
-
@Override
public int compare(LinearSignalFragment o1, LinearSignalFragment o2) {
return Double.compare(o1.getT0(), o2.getT0());
@@ -46,7 +45,7 @@ public final class EventSignalUtil {
*/
public static Psop toIPsop(List events) {
Psop r = new Psop();
- for (LinearSignalFragment e : events) {
+ for (LinearSignalFragment e: events) {
Interval i = new Interval(e.getT0(), false, e.getT1(), true);
r.add(new PsopFragment(e.getY0(), e.getCoefficient(), 0d, i));
}
@@ -54,15 +53,15 @@ public final class EventSignalUtil {
}
/**
- * @param eventSignal a list of possibly overlapping {@link LinearSignalFragment} instances; all must be
- * constant
+ * @param eventSignal a list of possibly overlapping {@link LinearSignalFragment} instances; all must be constant
* @param scale the scale factor of the result; e.g., using 60 gives the value per 60 time units
* @param dom the domain for which to compute the result
* @return a list of {@link LinearSignalFragment} instances that represents the sum of the given list of
- * {@link LinearSignalFragment} instances
+ * {@link LinearSignalFragment} instances
*/
- public static List computeInstantaneous(List eventSignal,
- double scale, IInterval dom) {
+ public static List computeInstantaneous(List eventSignal, double scale,
+ IInterval dom)
+ {
List events = createEventList(eventSignal);
List r = createConstantSignal(scale, events);
return setDomain(r, dom, true);
@@ -70,15 +69,15 @@ public final class EventSignalUtil {
/**
* @param events the events for which to compute the sliding-window average; these must all be constant!
- * @param scale the result is multiplied with this scale factor; e.g., using 60 gives the sliding window
- * average per 60 time units
- * @param w the width of the convolution window: larger means smoother graphs, 0 gives the instantaneous
- * value
+ * @param scale the result is multiplied with this scale factor; e.g., using 60 gives the sliding window average per
+ * 60 time units
+ * @param w the width of the convolution window: larger means smoother graphs, 0 gives the instantaneous value
* @param dom the domain of the result
* @return the resulting psop
*/
- public static final IPsop convoluteScaleAndProject(List events, double scale,
- double w, Interval dom) {
+ public static final IPsop convoluteScaleAndProject(List events, double scale, double w,
+ Interval dom)
+ {
List cl = convolution(events, w);
cl = scale(cl, scale);
return toIPsop(setDomain(cl, dom, true));
@@ -87,10 +86,10 @@ public final class EventSignalUtil {
/**
* @param dividend must be constant fragments
* @param divisor must be constant fragments
- * @return
*/
public static List divide(List dividend,
- List divisor, double undefinedValue) {
+ List divisor, double undefinedValue)
+ {
List l1 = createEventList(dividend);
List l2 = createEventList(divisor);
if (l1.isEmpty() || l2.isEmpty()) {
@@ -127,7 +126,7 @@ public final class EventSignalUtil {
private static void splitAtEvents(List cl, List el) {
int i = 0;
- for (Event e : el) {
+ for (Event e: el) {
// find the next fragment that contains e.t
while (cl.get(i).getT1() < e.t) {
i++;
@@ -143,7 +142,7 @@ public final class EventSignalUtil {
List r = new ArrayList<>();
Event prev = null;
double value = 0d;
- for (Event e : events) {
+ for (Event e: events) {
if (prev != null) {
value += (prev.delta * scale);
r.add(new LinearSignalFragment(prev.t, e.t, value, value));
@@ -156,7 +155,7 @@ public final class EventSignalUtil {
private static List createEventList(List eventSignal) {
// precondition: all constant fragments
List events = new ArrayList();
- for (LinearSignalFragment s : eventSignal) {
+ for (LinearSignalFragment s: eventSignal) {
if (s.isInstantaneousEvent()) {
throw new UnsupportedOperationException("instantaneous events not suppprted");
}
@@ -171,14 +170,13 @@ public final class EventSignalUtil {
/**
* Scales the given linear signal fragments: multiplied by {@code c}
- *
+ *
* @param fl the list of linear signal fragments.
- * @param c
* @return the scaled signal
*/
public static List scale(List fl, double c) {
List r = new ArrayList();
- for (LinearSignalFragment f : fl) {
+ for (LinearSignalFragment f: fl) {
r.add(new LinearSignalFragment(f.getT0(), f.getT1(), f.getY0() * c, f.getY1() * c));
}
return r;
@@ -188,7 +186,7 @@ public final class EventSignalUtil {
// checkAndPad(fl, false);
List result = new ArrayList<>();
List conv = new ArrayList<>();
- for (LinearSignalFragment f : fl) {
+ for (LinearSignalFragment f: fl) {
conv.clear();
convolutionWithBlock(conv, f, w);
addTo(result, conv);
@@ -213,7 +211,7 @@ public final class EventSignalUtil {
// non-overlapping.
// This is guaranteed from the beginning as a single convolution result is added
// Now guarantee that the following merge function preserves it:
- for (LinearSignalFragment f : l) {
+ for (LinearSignalFragment f: l) {
double t0cl = result.get(0).getT0();
double t1cl = result.get(result.size() - 1).getT1();
// There are six cases how f can overlap with cl
@@ -251,8 +249,9 @@ public final class EventSignalUtil {
private static void checkAndPad(List fl, boolean pad) {
// non-overlapping and consecutive
+ int i = 0;
int ub = fl.size() - 1;
- for (int i = 0; i < ub; i++) {
+ while (i < ub) {
LinearSignalFragment f1 = fl.get(i);
LinearSignalFragment f2 = fl.get(i + 1);
if (f1.getT1() > f2.getT0()) {
@@ -267,23 +266,23 @@ public final class EventSignalUtil {
i++;
ub++;
}
+ i++;
}
}
/**
- * Convolutes the given {@link ConstantSignalFragment} with a block function on domain [b0, b0 + w] with
- * value 1/w. The result is put into the given list of {@link LinearSignalFragment} instances to avoid
- * allocation and deallocation of many List instances.
- *
- * By default, b0 = 0, such that this gives the average value over the last w time units. If b0 = - w/2
- * for instance, then the average value around t with window width w is computed.
- *
+ * Convolutes the given {@link ConstantSignalFragment} with a block function on domain [b0, b0 + w] with value 1/w.
+ * The result is put into the given list of {@link LinearSignalFragment} instances to avoid allocation and
+ * deallocation of many List instances.
+ *
+ * By default, b0 = 0, such that this gives the average value over the last w time units. If b0 = - w/2 for
+ * instance, then the average value around t with window width w is computed.
+ *
* @param r the result list
* @param f the event signal to convolute
* @param w the width of the block function
*/
- private static void convolutionWithBlock(List r, LinearSignalFragment f,
- double w) {
+ private static void convolutionWithBlock(List r, LinearSignalFragment f, double w) {
if (!f.isConstant()) {
throw new IllegalStateException("convolution only supported for constant signal fragments");
}
@@ -329,8 +328,9 @@ public final class EventSignalUtil {
}
private static List merge(List events) {
+ int i = 0;
List r = new ArrayList();
- for (int i = 0; i < events.size(); i++) {
+ while (i < events.size()) {
Event ei = events.get(i);
int j = i + 1;
double extraDelta = 0d;
@@ -340,12 +340,14 @@ public final class EventSignalUtil {
}
i = j - 1;
r.add(new Event(ei.t, ei.delta + extraDelta));
+ i++;
}
return r;
}
private static List setDomain(List ls, IInterval dom,
- boolean padWithZeros) {
+ boolean padWithZeros)
+ {
if (ls.isEmpty()) {
throw new IllegalArgumentException("cannot set the domain of an empty signal");
}
@@ -362,8 +364,7 @@ public final class EventSignalUtil {
return projectTo(ls, dom.lb().doubleValue(), dom.ub().doubleValue());
}
- private static List projectTo(List ls, double tmin,
- double tmax) {
+ private static List projectTo(List ls, double tmin, double tmax) {
int i1 = split(ls, tmin);
int i2 = split(ls, tmax);
// if (i1 == -1) {
@@ -411,7 +412,6 @@ public final class EventSignalUtil {
}
private static final class Event implements Comparable {
-
private final double t;
private final double delta;
@@ -431,5 +431,4 @@ public final class EventSignalUtil {
return "Event [t=" + t + ", delta=" + delta + "]";
}
}
-
}
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/signal/impl/LinearSignalFragment.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/signal/impl/LinearSignalFragment.java
index 3944cdadcde1999ff7c036bcaa4a296e22a80a61..e4a59edcd78dd9fee712b517fcfc42439aa6f1a7 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/signal/impl/LinearSignalFragment.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/signal/impl/LinearSignalFragment.java
@@ -7,13 +7,13 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.analysis.signal.impl;
/**
* A linear fragment to construct piecewise-linear signals. Immutable.
*/
public class LinearSignalFragment {
-
private final double t0;
private final double t1;
@@ -24,9 +24,6 @@ public class LinearSignalFragment {
/**
* Constructs an instantaneaous fragment.
- *
- * @param t
- * @param y
*/
public LinearSignalFragment(double t, double y) {
this.t0 = t;
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/signal/impl/PsopHelper.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/signal/impl/PsopHelper.java
index c19e70dee77e746862421f48dae8dcb3ebac7ea7..812aee455a9ac78c8effc3515748c97df572e47e 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/signal/impl/PsopHelper.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/signal/impl/PsopHelper.java
@@ -7,6 +7,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.analysis.signal.impl;
import java.math.BigDecimal;
@@ -31,7 +32,6 @@ import org.eclipse.trace4cps.core.impl.Resource;
* A utility class with methods for {@link IPsop} instances.
*/
public class PsopHelper {
-
private PsopHelper() {
}
@@ -41,14 +41,12 @@ public class PsopHelper {
public static IPsop translate(IPsop p, double delta) {
Psop p2 = new Psop();
- for (Map.Entry e : p.getAttributes().entrySet()) {
+ for (Map.Entry e: p.getAttributes().entrySet()) {
p2.setAttribute(e.getKey(), e.getValue());
}
- for (IPsopFragment f : p.getFragments()) {
- double lb =
- BigDecimal.valueOf(f.dom().lb().doubleValue()).add(BigDecimal.valueOf(delta)).doubleValue();
- double ub =
- BigDecimal.valueOf(f.dom().ub().doubleValue()).add(BigDecimal.valueOf(delta)).doubleValue();
+ for (IPsopFragment f: p.getFragments()) {
+ double lb = BigDecimal.valueOf(f.dom().lb().doubleValue()).add(BigDecimal.valueOf(delta)).doubleValue();
+ double ub = BigDecimal.valueOf(f.dom().ub().doubleValue()).add(BigDecimal.valueOf(delta)).doubleValue();
if (lb < ub) { // rounding errors can cause lb >= ub; in that case we ignore the fragment as it
// was really small
IInterval i2 = new Interval(lb, f.dom().isOpenLb(), ub, f.dom().isOpenUb());
@@ -84,7 +82,7 @@ public class PsopHelper {
public static IPsop add(IPsop p, double cnst) {
Psop r = new Psop();
- for (IPsopFragment f : p.getFragments()) {
+ for (IPsopFragment f: p.getFragments()) {
double c = BigDecimal.valueOf(f.getC().doubleValue()).add(BigDecimal.valueOf(cnst)).doubleValue();
r.add(new PsopFragment(c, f.getB(), f.getA(), f.dom()));
}
@@ -111,20 +109,20 @@ public class PsopHelper {
IPsopFragment f1 = g1.getFragments().get(i);
IPsopFragment f2 = g2.getFragments().get(i);
if (isAdd) {
- double c = BigDecimal.valueOf(f1.getC().doubleValue())
- .add(BigDecimal.valueOf(f2.getC().doubleValue())).doubleValue();
- double b = BigDecimal.valueOf(f1.getB().doubleValue())
- .add(BigDecimal.valueOf(f2.getB().doubleValue())).doubleValue();
- double a = BigDecimal.valueOf(f1.getA().doubleValue())
- .add(BigDecimal.valueOf(f2.getA().doubleValue())).doubleValue();
+ double c = BigDecimal.valueOf(f1.getC().doubleValue()).add(BigDecimal.valueOf(f2.getC().doubleValue()))
+ .doubleValue();
+ double b = BigDecimal.valueOf(f1.getB().doubleValue()).add(BigDecimal.valueOf(f2.getB().doubleValue()))
+ .doubleValue();
+ double a = BigDecimal.valueOf(f1.getA().doubleValue()).add(BigDecimal.valueOf(f2.getA().doubleValue()))
+ .doubleValue();
r.add(new PsopFragment(c, b, a, f1.dom()));
} else {
double c = BigDecimal.valueOf(f1.getC().doubleValue())
- .subtract(BigDecimal.valueOf(f2.getC().doubleValue())).doubleValue();
+ .subtract(BigDecimal.valueOf(f2.getC().doubleValue())).doubleValue();
double b = BigDecimal.valueOf(f1.getB().doubleValue())
- .subtract(BigDecimal.valueOf(f2.getB().doubleValue())).doubleValue();
+ .subtract(BigDecimal.valueOf(f2.getB().doubleValue())).doubleValue();
double a = BigDecimal.valueOf(f1.getA().doubleValue())
- .subtract(BigDecimal.valueOf(f2.getA().doubleValue())).doubleValue();
+ .subtract(BigDecimal.valueOf(f2.getA().doubleValue())).doubleValue();
r.add(new PsopFragment(c, b, a, f1.dom()));
}
}
@@ -133,13 +131,10 @@ public class PsopHelper {
public static IPsop mult(IPsop p, double cnst) {
Psop r = new Psop();
- for (IPsopFragment f : p.getFragments()) {
- double c =
- BigDecimal.valueOf(f.getC().doubleValue()).multiply(BigDecimal.valueOf(cnst)).doubleValue();
- double b =
- BigDecimal.valueOf(f.getB().doubleValue()).multiply(BigDecimal.valueOf(cnst)).doubleValue();
- double a =
- BigDecimal.valueOf(f.getA().doubleValue()).multiply(BigDecimal.valueOf(cnst)).doubleValue();
+ for (IPsopFragment f: p.getFragments()) {
+ double c = BigDecimal.valueOf(f.getC().doubleValue()).multiply(BigDecimal.valueOf(cnst)).doubleValue();
+ double b = BigDecimal.valueOf(f.getB().doubleValue()).multiply(BigDecimal.valueOf(cnst)).doubleValue();
+ double a = BigDecimal.valueOf(f.getA().doubleValue()).multiply(BigDecimal.valueOf(cnst)).doubleValue();
r.add(new PsopFragment(c, b, a, f.dom()));
}
return r;
@@ -157,7 +152,7 @@ public class PsopHelper {
public static IPsop createDerivativeOf(IPsop p) {
Psop der = new Psop();
der.setAttributes(p.getAttributes());
- for (IPsopFragment f : p.getFragments()) {
+ for (IPsopFragment f: p.getFragments()) {
IPsopFragment fn = new PsopFragment(f.getB(), 2 * f.getA().doubleValue(), 0d, f.dom());
der.add(fn);
}
@@ -181,7 +176,7 @@ public class PsopHelper {
public static Psop copy(IPsop p) {
Psop f = new Psop();
f.setAttributes(p.getAttributes());
- for (IPsopFragment frag : p.getFragments()) {
+ for (IPsopFragment frag: p.getFragments()) {
f.addAtEnd(copy(frag));
}
return f;
@@ -213,7 +208,7 @@ public class PsopHelper {
throw new IllegalStateException("function is empty");
}
MinMaxResult r = new MinMaxResult();
- for (IPsopFragment f : p.getFragments()) {
+ for (IPsopFragment f: p.getFragments()) {
r.combineWith(computeMinMax(f));
}
return r.getMin();
@@ -224,7 +219,7 @@ public class PsopHelper {
throw new IllegalStateException("function is empty");
}
MinMaxResult r = new MinMaxResult();
- for (IPsopFragment f : p.getFragments()) {
+ for (IPsopFragment f: p.getFragments()) {
r.combineWith(computeMinMax(f));
}
return r.getMax();
@@ -232,9 +227,6 @@ public class PsopHelper {
/**
* Possibly splits the fragments in the given Psop.
- *
- * @param p
- * @return
*/
public static List createMonotonicSegmentation(IPsop p) {
int startIndex = 0;
@@ -263,7 +255,6 @@ public class PsopHelper {
startIndex = endIndex;
i++;
} else {
-
if (shape == Shape.CONSTANT) {
endIndex++;
i++;
@@ -306,17 +297,18 @@ public class PsopHelper {
return Math.abs(frag.getC().doubleValue() - valueAt(prev, prev.dom().ub()).doubleValue()) > 1e-9;
}
- private static void splitFragment(List fragments, int fragIndex, IPsopFragment frag,
- Number xSplit) {
+ private static void splitFragment(List fragments, int fragIndex, IPsopFragment frag, Number xSplit) {
Number c = valueAt(frag, xSplit);
Number b = valueDerivativeAt(frag, xSplit);
splitFragment(fragments, fragIndex, frag, xSplit, c, b);
}
- private static void splitFragment(List fragments, int fragIndex, IPsopFragment frag,
- Number xSplit, Number c, Number b) {
+ private static void splitFragment(List fragments, int fragIndex, IPsopFragment frag, Number xSplit,
+ Number c, Number b)
+ {
if (xSplit.doubleValue() == frag.dom().lb().doubleValue()
- || xSplit.doubleValue() == frag.dom().ub().doubleValue()) {
+ || xSplit.doubleValue() == frag.dom().ub().doubleValue())
+ {
return;
}
Number lb = frag.dom().lb();
@@ -358,8 +350,8 @@ public class PsopHelper {
Number c = valueAt(frag, d.lb());
Number b = valueDerivativeAt(frag, d.lb());
p.getFragments().remove(i);
- p.getFragments().add(i, new PsopFragment(c, b, frag.getA(),
- new Interval(d.lb(), false, frag.dom().ub(), true)));
+ p.getFragments().add(i,
+ new PsopFragment(c, b, frag.getA(), new Interval(d.lb(), false, frag.dom().ub(), true)));
}
break;
}
@@ -398,10 +390,10 @@ public class PsopHelper {
}
/**
- * Aligns this IPsop with the given IPsop. The domain of the result function is the intersection of the
- * domains of this IPsop and the given IPsop. The fragments are split in such a way that they align with
- * the fragments of the given IPsop.
- *
+ * Aligns this IPsop with the given IPsop. The domain of the result function is the intersection of the domains of
+ * this IPsop and the given IPsop. The fragments are split in such a way that they align with the fragments of the
+ * given IPsop.
+ *
* @param p the IPsop to align
* @param g the IPsop to align to
*/
@@ -501,9 +493,9 @@ public class PsopHelper {
/**
* Requires that both fragments have the same time domain.
- *
+ *
* Empty list iff constant distance, or no intersections
- *
+ *
* @param f1 fragment 1
* @param f2 fragment 2
* @return a list of domain points where the fragments intersect
@@ -556,51 +548,51 @@ public class PsopHelper {
double t0 = PsopHelper.getDomainLowerBound(signal).doubleValue();
boolean sat = PsopHelper.getStartValue(signal).doubleValue() >= 0d;
- for (ShapeSegment seg : PsopHelper.createMonotonicSegmentation(signal)) {
+ for (ShapeSegment seg: PsopHelper.createMonotonicSegmentation(signal)) {
switch (seg.getShape()) {
- case CONSTANT:
- double startT = signal.getFragments().get(seg.getBeginFragment()).dom().lb().doubleValue();
- double value = signal.getFragments().get(seg.getBeginFragment()).getC().doubleValue();
- if ((sat && value < 0d) || (!sat && value >= 0d)) {
- createClaim(claims, claimName, r, t0, startT, sat);
- t0 = startT;
- sat = !sat;
- }
- break;
- case INCREASING:
- if (!sat) {
- // check whether we get sat
- for (int i = seg.getBeginFragment(); i <= seg.getEndFragment(); i++) {
- IPsopFragment frag = signal.getFragments().get(i);
- double v1 = PsopHelper.valueAt(frag, frag.dom().ub()).doubleValue();
- if (v1 >= 0d) {
- double t1 = PsopHelper.argZeroValue(frag).doubleValue();
- createClaim(claims, claimName, r, t0, t1, sat);
- t0 = t1;
- sat = !sat;
- break;
+ case CONSTANT:
+ double startT = signal.getFragments().get(seg.getBeginFragment()).dom().lb().doubleValue();
+ double value = signal.getFragments().get(seg.getBeginFragment()).getC().doubleValue();
+ if ((sat && value < 0d) || (!sat && value >= 0d)) {
+ createClaim(claims, claimName, r, t0, startT, sat);
+ t0 = startT;
+ sat = !sat;
+ }
+ break;
+ case INCREASING:
+ if (!sat) {
+ // check whether we get sat
+ for (int i = seg.getBeginFragment(); i <= seg.getEndFragment(); i++) {
+ IPsopFragment frag = signal.getFragments().get(i);
+ double v1 = PsopHelper.valueAt(frag, frag.dom().ub()).doubleValue();
+ if (v1 >= 0d) {
+ double t1 = PsopHelper.argZeroValue(frag).doubleValue();
+ createClaim(claims, claimName, r, t0, t1, sat);
+ t0 = t1;
+ sat = !sat;
+ break;
+ }
}
}
- }
- break;
- case DECREASING:
- if (sat) {
- // check whether we get unsat
- for (int i = seg.getBeginFragment(); i <= seg.getEndFragment(); i++) {
- IPsopFragment frag = signal.getFragments().get(i);
- double v1 = PsopHelper.valueAt(frag, frag.dom().ub()).doubleValue();
- if (v1 < 0d) {
- double t1 = PsopHelper.argZeroValue(frag).doubleValue();
- createClaim(claims, claimName, r, t0, t1, sat);
- t0 = t1;
- sat = !sat;
- break;
+ break;
+ case DECREASING:
+ if (sat) {
+ // check whether we get unsat
+ for (int i = seg.getBeginFragment(); i <= seg.getEndFragment(); i++) {
+ IPsopFragment frag = signal.getFragments().get(i);
+ double v1 = PsopHelper.valueAt(frag, frag.dom().ub()).doubleValue();
+ if (v1 < 0d) {
+ double t1 = PsopHelper.argZeroValue(frag).doubleValue();
+ createClaim(claims, claimName, r, t0, t1, sat);
+ t0 = t1;
+ sat = !sat;
+ break;
+ }
}
}
- }
- break;
- default:
- throw new IllegalStateException();
+ break;
+ default:
+ throw new IllegalStateException();
}
}
// add the last claim
@@ -611,7 +603,6 @@ public class PsopHelper {
}
private static Number argZeroValue(IPsopFragment f) {
-
if (f.getShape() == Shape.CONSTANT) {
if (f.getC().doubleValue() == 0d) {
return f.dom().lb();
@@ -647,8 +638,7 @@ public class PsopHelper {
}
}
- private static void createClaim(List claims, String name, Resource r, double t0, double t1,
- boolean sat) {
+ private static void createClaim(List claims, String name, Resource r, double t0, double t1, boolean sat) {
Claim c = new Claim(t0, t1, r, 1);
c.setAttribute("phi", name);
c.setAttribute("type", "STL");
@@ -658,7 +648,6 @@ public class PsopHelper {
}
public static final class MinMaxResult {
-
private double min = Double.POSITIVE_INFINITY;
private double max = Double.NEGATIVE_INFINITY;
@@ -710,11 +699,10 @@ public class PsopHelper {
}
/**
- * Immutable. A block of consecutive indices of {@link PsopFragment} instances which, when considered as a
- * whole, have an INCREASING, DECREASING or CONSTANT shape. Begin and end indices are inclusive.
+ * Immutable. A block of consecutive indices of {@link PsopFragment} instances which, when considered as a whole,
+ * have an INCREASING, DECREASING or CONSTANT shape. Begin and end indices are inclusive.
*/
public static final class ShapeSegment {
-
private final int beginFragment;
private final int endFragment;
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/stl/StlBuilder.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/stl/StlBuilder.java
index e72da707fffc7f486107d28e00b97d3882b4288f..d77874580642cb74a5d9159ce764130b4845e22e 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/stl/StlBuilder.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/stl/StlBuilder.java
@@ -7,23 +7,23 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.analysis.stl;
import org.eclipse.trace4cps.analysis.stl.impl.StlBinBool;
+import org.eclipse.trace4cps.analysis.stl.impl.StlBinBool.BinOp;
import org.eclipse.trace4cps.analysis.stl.impl.StlEq;
import org.eclipse.trace4cps.analysis.stl.impl.StlGeq;
import org.eclipse.trace4cps.analysis.stl.impl.StlLeq;
import org.eclipse.trace4cps.analysis.stl.impl.StlNeg;
import org.eclipse.trace4cps.analysis.stl.impl.StlTrue;
import org.eclipse.trace4cps.analysis.stl.impl.StlUntil;
-import org.eclipse.trace4cps.analysis.stl.impl.StlBinBool.BinOp;
import org.eclipse.trace4cps.core.IPsop;
/**
* This utility class provides methods to build {@link StlFormula} instances.
*/
public class StlBuilder {
-
private static final StlFormula T = new StlTrue();
private StlBuilder() {
@@ -55,7 +55,7 @@ public class StlBuilder {
*/
public static StlFormula NOT(StlFormula f) {
if (f instanceof StlNeg) {
- return ((StlNeg) f).getFormula();
+ return ((StlNeg)f).getFormula();
}
return new StlNeg(f);
}
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/stl/StlException.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/stl/StlException.java
index 69d2a6bc43cb5a9d7cb6216068aa9f50abb22276..5ed5038683d6b834fda4c93ac82321c8b9b1bc7a 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/stl/StlException.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/stl/StlException.java
@@ -7,12 +7,12 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.analysis.stl;
import org.eclipse.trace4cps.analysis.AnalysisException;
public class StlException extends AnalysisException {
-
private static final long serialVersionUID = 1L;
public StlException() {
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/stl/StlFormula.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/stl/StlFormula.java
index 7b8a6e3d51fdac24c551d0389145bfc90bab9546..419622003a2c7655eb690c6979e792aea771db18 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/stl/StlFormula.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/stl/StlFormula.java
@@ -7,19 +7,18 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.analysis.stl;
import org.eclipse.trace4cps.analysis.mtl.MtlFormula;
import org.eclipse.trace4cps.core.IPsop;
/**
- * A Signal Temporal Logic formula. Its space-robustness is given by the {@link #getRho()} method. Instances
- * are created by the {@link StlBuilder} type. The {@link MtlFormula} is extended so that STL formulas can be
- * used as subformulas of an MTL formula. This realizes (a subset of) the logic STL-mx of the FORMATS 2019
- * paper by T. Ferrere et al.
+ * A Signal Temporal Logic formula. Its space-robustness is given by the {@link #getRho()} method. Instances are created
+ * by the {@link StlBuilder} type. The {@link MtlFormula} is extended so that STL formulas can be used as subformulas of
+ * an MTL formula. This realizes (a subset of) the logic STL-mx of the FORMATS 2019 paper by T. Ferrere et al.
*/
public interface StlFormula extends MtlFormula {
-
/**
* @return the space robustness of the formula
*/
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/stl/impl/AbstractStlFormula.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/stl/impl/AbstractStlFormula.java
index 796a76d1242efd26e4a284bcc285d815220cfc58..d6944f01b809b80c4fc5f06dcbb431c80e0c0ee8 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/stl/impl/AbstractStlFormula.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/stl/impl/AbstractStlFormula.java
@@ -7,6 +7,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.analysis.stl.impl;
import org.eclipse.trace4cps.analysis.signal.impl.PsopHelper;
@@ -14,7 +15,6 @@ import org.eclipse.trace4cps.analysis.stl.StlFormula;
import org.eclipse.trace4cps.core.IPsop;
public abstract class AbstractStlFormula implements StlFormula {
-
private IPsop signal;
@Override
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/stl/impl/STLUtil.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/stl/impl/STLUtil.java
index 6169e0f7d88c515df61dbc5e84c10108ff485b8a..d110fc9aa7b2263f6f005cc9bb222e3a1c654794 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/stl/impl/STLUtil.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/stl/impl/STLUtil.java
@@ -7,6 +7,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.analysis.stl.impl;
import java.util.Collections;
@@ -28,7 +29,6 @@ import org.eclipse.trace4cps.core.impl.PsopFragment;
* All functions create new Psop instances!
*/
public class STLUtil {
-
private STLUtil() {
}
@@ -47,8 +47,8 @@ public class STLUtil {
r.add(phi);
}
if (phi instanceof StlBinBool) {
- getFormulas(((StlBinBool) phi).getLeft(), r);
- getFormulas(((StlBinBool) phi).getRight(), r);
+ getFormulas(((StlBinBool)phi).getLeft(), r);
+ getFormulas(((StlBinBool)phi).getRight(), r);
} else if (phi instanceof StlEq) {
//
} else if (phi instanceof StlGeq) {
@@ -56,16 +56,16 @@ public class STLUtil {
} else if (phi instanceof StlLeq) {
//
} else if (phi instanceof StlNeg) {
- getFormulas(((StlNeg) phi).getFormula(), r);
+ getFormulas(((StlNeg)phi).getFormula(), r);
} else if (phi instanceof StlUntil) {
- getFormulas(((StlUntil) phi).getLeft(), r);
- getFormulas(((StlUntil) phi).getRight(), r);
+ getFormulas(((StlUntil)phi).getLeft(), r);
+ getFormulas(((StlUntil)phi).getRight(), r);
}
}
public static IPsop signal_greaterEqual(IPsop f, double c) {
Psop r = new Psop();
- for (IPsopFragment frag : f.getFragments()) {
+ for (IPsopFragment frag: f.getFragments()) {
r.add(new PsopFragment(frag.getC().doubleValue() - c, frag.getB(), frag.getA(), frag.dom()));
}
return r;
@@ -73,7 +73,7 @@ public class STLUtil {
public static IPsop signal_lessEqual(IPsop f, double c) {
Psop r = new Psop();
- for (IPsopFragment frag : f.getFragments()) {
+ for (IPsopFragment frag: f.getFragments()) {
r.add(new PsopFragment(c - frag.getC().doubleValue(), -frag.getB().doubleValue(),
-frag.getA().doubleValue(), frag.dom()));
}
@@ -88,9 +88,9 @@ public class STLUtil {
public static Psop signalNegate(IPsop f) {
Psop r = new Psop();
- for (IPsopFragment frag : f.getFragments()) {
- r.add(new PsopFragment(-frag.getC().doubleValue(), -frag.getB().doubleValue(),
- -frag.getA().doubleValue(), frag.dom()));
+ for (IPsopFragment frag: f.getFragments()) {
+ r.add(new PsopFragment(-frag.getC().doubleValue(), -frag.getB().doubleValue(), -frag.getA().doubleValue(),
+ frag.dom()));
}
return r;
}
@@ -143,14 +143,16 @@ public class STLUtil {
}
}
- private static void splitSingleIntersection(Psop r, double tSplit, IPsopFragment frag1,
- IPsopFragment frag2, boolean applyMin) {
+ private static void splitSingleIntersection(Psop r, double tSplit, IPsopFragment frag1, IPsopFragment frag2,
+ boolean applyMin)
+ {
if (tSplit == frag1.dom().lb().doubleValue()) {
// special case for when the intersect point coincides with a domain boundary
double size = frag1.dom().ub().doubleValue() - frag1.dom().lb().doubleValue();
double tHalfway = frag1.dom().lb().doubleValue() + (0.5 * size);
if ((PsopHelper.valueAt(frag1, tHalfway).doubleValue() < PsopHelper.valueAt(frag2, tHalfway)
- .doubleValue()) == applyMin) {
+ .doubleValue()) == applyMin)
+ {
r.add(PsopHelper.copy(frag1));
} else {
r.add(PsopHelper.copy(frag2));
@@ -166,7 +168,8 @@ public class STLUtil {
}
private static void splitDoubleIntersection(Psop r, double tSplit1, double tSplit2, IPsopFragment frag1,
- IPsopFragment frag2, boolean applyMin) {
+ IPsopFragment frag2, boolean applyMin)
+ {
if (tSplit1 == frag1.dom().lb().doubleValue()) {
splitSingleIntersection(r, tSplit2, frag1, frag2, applyMin);
return;
@@ -223,7 +226,7 @@ public class STLUtil {
f = PsopHelper.copy(f); // overwrite with a copy, because monotonization changes the psop
List monoseg = PsopHelper.createMonotonicSegmentation(f);
- for (ShapeSegment seg : monoseg) {
+ for (ShapeSegment seg: monoseg) {
double t0 = f.getFragments().get(seg.getBeginFragment()).dom().lb().doubleValue();
double t1 = f.getFragments().get(seg.getEndFragment()).dom().ub().doubleValue();
double valt0 = f.getFragments().get(seg.getBeginFragment()).getC().doubleValue();
@@ -252,8 +255,7 @@ public class STLUtil {
}
/**
- * Shifts the fragments from src that are specified in the segment b to the left and adds the result to
- * dst.
+ * Shifts the fragments from src that are specified in the segment b to the left and adds the result to dst.
*/
private static void shiftLeft(ShapeSegment seg, IPsop src, Psop dst, double b) {
for (int i = seg.getBeginFragment(); i <= seg.getEndFragment(); i++) {
@@ -266,8 +268,7 @@ public class STLUtil {
double lb = frag.dom().lb().doubleValue() - b;
double ub = frag.dom().ub().doubleValue() - b;
if (lb < ub) { // lb can get equal to ub due to rounding in floating point arithmetic
- PsopFragment shifted =
- new PsopFragment(frag.getC(), frag.getB(), frag.getA(), new Interval(lb, ub));
+ PsopFragment shifted = new PsopFragment(frag.getC(), frag.getB(), frag.getA(), new Interval(lb, ub));
dst.add(shifted);
}
}
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/stl/impl/StlBinBool.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/stl/impl/StlBinBool.java
index 78f6aaf683de9c79bb9450945eb0519d0f7ad0af..3f079ef513c73c0485523411bf57cf60b2c897cf 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/stl/impl/StlBinBool.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/stl/impl/StlBinBool.java
@@ -7,10 +7,10 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.analysis.stl.impl;
import java.util.Arrays;
-import java.util.Collections;
import java.util.List;
import org.eclipse.trace4cps.analysis.mtl.MtlFormula;
@@ -18,10 +18,9 @@ import org.eclipse.trace4cps.analysis.stl.StlFormula;
import org.eclipse.trace4cps.core.IPsop;
public class StlBinBool extends AbstractStlFormula {
-
public enum BinOp {
AND, OR, IMPLY
- };
+ }
private final StlFormula left;
@@ -43,14 +42,14 @@ public class StlBinBool extends AbstractStlFormula {
@Override
protected IPsop computeSignal() {
switch (bop) {
- case AND:
- return STLUtil.signalAnd(left.getSignal(), right.getSignal());
- case OR:
- return STLUtil.signalOr(left.getSignal(), right.getSignal());
- case IMPLY:
- return STLUtil.signalImply(left.getSignal(), right.getSignal());
- default:
- throw new IllegalStateException();
+ case AND:
+ return STLUtil.signalAnd(left.getSignal(), right.getSignal());
+ case OR:
+ return STLUtil.signalOr(left.getSignal(), right.getSignal());
+ case IMPLY:
+ return STLUtil.signalImply(left.getSignal(), right.getSignal());
+ default:
+ throw new IllegalStateException();
}
}
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/stl/impl/StlEq.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/stl/impl/StlEq.java
index a885a11d2d4c234502f886a603d18c5fbb09933d..d2a807e4e3c6ee4b3034885fb2289431bf085e1a 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/stl/impl/StlEq.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/stl/impl/StlEq.java
@@ -7,6 +7,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.analysis.stl.impl;
import java.util.Collections;
@@ -16,7 +17,6 @@ import org.eclipse.trace4cps.analysis.mtl.MtlFormula;
import org.eclipse.trace4cps.core.IPsop;
public class StlEq extends AbstractStlFormula {
-
private final IPsop f;
private final double c;
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/stl/impl/StlGeq.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/stl/impl/StlGeq.java
index b4773b8831c878833ca622c4fcc1b81a65ee6577..e4688cda59a95f82cbabb52b95e75603b777549d 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/stl/impl/StlGeq.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/stl/impl/StlGeq.java
@@ -7,6 +7,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.analysis.stl.impl;
import java.util.Collections;
@@ -16,7 +17,6 @@ import org.eclipse.trace4cps.analysis.mtl.MtlFormula;
import org.eclipse.trace4cps.core.IPsop;
public class StlGeq extends AbstractStlFormula {
-
private final IPsop f;
private final double c;
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/stl/impl/StlLeq.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/stl/impl/StlLeq.java
index 978b7b01a9e1342e7e7cb29c0747b08ae9bdd941..5be0db80ec0591480419a3a7add6cbe1e7cb6fdf 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/stl/impl/StlLeq.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/stl/impl/StlLeq.java
@@ -7,6 +7,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.analysis.stl.impl;
import java.util.Collections;
@@ -16,7 +17,6 @@ import org.eclipse.trace4cps.analysis.mtl.MtlFormula;
import org.eclipse.trace4cps.core.IPsop;
public class StlLeq extends AbstractStlFormula {
-
private final IPsop f;
private final double c;
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/stl/impl/StlNeg.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/stl/impl/StlNeg.java
index 0e53654b15e65715dbcc61a3553e335a5f16c8b4..6faafcfb641244229c12bbf838f7f9ae71ebc7e7 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/stl/impl/StlNeg.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/stl/impl/StlNeg.java
@@ -7,6 +7,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.analysis.stl.impl;
import java.util.Arrays;
@@ -17,7 +18,6 @@ import org.eclipse.trace4cps.analysis.stl.StlFormula;
import org.eclipse.trace4cps.core.IPsop;
public class StlNeg extends AbstractStlFormula {
-
private final StlFormula f;
public StlNeg(StlFormula f) {
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/stl/impl/StlTrue.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/stl/impl/StlTrue.java
index 9bb6c73ac72b95ad1227542f337e0a73702f7b9b..9ecb65d1e2a8f27cb8ec888c889e01efe24c9f7e 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/stl/impl/StlTrue.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/stl/impl/StlTrue.java
@@ -7,6 +7,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.analysis.stl.impl;
import java.util.Collections;
@@ -19,7 +20,6 @@ import org.eclipse.trace4cps.core.impl.Psop;
import org.eclipse.trace4cps.core.impl.PsopFragment;
public class StlTrue extends AbstractStlFormula {
-
@Override
protected IPsop computeSignal() {
Psop signal = new Psop();
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/stl/impl/StlUntil.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/stl/impl/StlUntil.java
index 5f8c323bd4cc8a00860e3fe28727e237bf884e03..e3d9056d0df72841c07534a85b86e72943ee73b4 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/stl/impl/StlUntil.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/stl/impl/StlUntil.java
@@ -7,6 +7,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.analysis.stl.impl;
import java.util.Arrays;
@@ -17,7 +18,6 @@ import org.eclipse.trace4cps.analysis.stl.StlFormula;
import org.eclipse.trace4cps.core.IPsop;
public class StlUntil extends AbstractStlFormula {
-
private final StlFormula f1;
private final StlFormula f2;
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/timing/NormalStatistics.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/timing/NormalStatistics.java
index dd7184d51152a49f36a4492195da4041bbdd0fbc..fe0fa1730bf17fdec4351f30034caa17fbd8412b 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/timing/NormalStatistics.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/timing/NormalStatistics.java
@@ -7,12 +7,12 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.analysis.timing;
import java.util.List;
public class NormalStatistics {
-
private final double mean;
private final double stddev;
@@ -33,7 +33,6 @@ public class NormalStatistics {
}
stddev = Math.sqrt(powSum / timings.size());
-
}
public double getMean() {
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/timing/StatisticsManager.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/timing/StatisticsManager.java
index 4dd32eeb02a75b7c8ef4a35e1907c6cc88fed0ca..d76ca44d69221fe0ebda53b44b5ee9a52aea0503 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/timing/StatisticsManager.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/timing/StatisticsManager.java
@@ -7,6 +7,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.analysis.timing;
import java.math.BigDecimal;
@@ -15,7 +16,6 @@ import java.util.List;
import java.util.concurrent.TimeUnit;
public class StatisticsManager {
-
private TimeUnit timeUnit;
private final List samples = new ArrayList<>();
@@ -45,8 +45,7 @@ public class StatisticsManager {
}
/**
- * Tries to get all samples to the format with at least 1 digit and at most 3 digits before the decimal
- * separator.
+ * Tries to get all samples to the format with at least 1 digit and at most 3 digits before the decimal separator.
*/
public void autoScale() {
if (getNumSamples() <= 0) {
@@ -87,28 +86,29 @@ public class StatisticsManager {
*/
private boolean scaleUp() {
switch (timeUnit) {
- case NANOSECONDS:
- scaleSamples(1000, false);
- timeUnit = TimeUnit.MICROSECONDS;
- return true;
- case MICROSECONDS:
- scaleSamples(1000, false);
- timeUnit = TimeUnit.MILLISECONDS;
- return true;
- case MILLISECONDS:
- scaleSamples(1000, false);
- timeUnit = TimeUnit.SECONDS;
- return true;
- case SECONDS:
- scaleSamples(60, false);
- timeUnit = TimeUnit.MINUTES;
- return true;
- case MINUTES:
- scaleSamples(60, false);
- timeUnit = TimeUnit.HOURS;
- return true;
+ case NANOSECONDS:
+ scaleSamples(1000, false);
+ timeUnit = TimeUnit.MICROSECONDS;
+ return true;
+ case MICROSECONDS:
+ scaleSamples(1000, false);
+ timeUnit = TimeUnit.MILLISECONDS;
+ return true;
+ case MILLISECONDS:
+ scaleSamples(1000, false);
+ timeUnit = TimeUnit.SECONDS;
+ return true;
+ case SECONDS:
+ scaleSamples(60, false);
+ timeUnit = TimeUnit.MINUTES;
+ return true;
+ case MINUTES:
+ scaleSamples(60, false);
+ timeUnit = TimeUnit.HOURS;
+ return true;
+ default:
+ return false;
}
- return false;
}
/**
@@ -116,36 +116,37 @@ public class StatisticsManager {
*/
private boolean scaleDown() {
switch (timeUnit) {
- case MICROSECONDS:
- scaleSamples(1000, true);
- timeUnit = TimeUnit.NANOSECONDS;
- return true;
- case MILLISECONDS:
- scaleSamples(1000, true);
- timeUnit = TimeUnit.MICROSECONDS;
- return true;
- case SECONDS:
- scaleSamples(1000, true);
- timeUnit = TimeUnit.MILLISECONDS;
- return true;
- case MINUTES:
- scaleSamples(60, true);
- timeUnit = TimeUnit.SECONDS;
- return true;
- case HOURS:
- scaleSamples(60, true);
- timeUnit = TimeUnit.MINUTES;
- return true;
+ case MICROSECONDS:
+ scaleSamples(1000, true);
+ timeUnit = TimeUnit.NANOSECONDS;
+ return true;
+ case MILLISECONDS:
+ scaleSamples(1000, true);
+ timeUnit = TimeUnit.MICROSECONDS;
+ return true;
+ case SECONDS:
+ scaleSamples(1000, true);
+ timeUnit = TimeUnit.MILLISECONDS;
+ return true;
+ case MINUTES:
+ scaleSamples(60, true);
+ timeUnit = TimeUnit.SECONDS;
+ return true;
+ case HOURS:
+ scaleSamples(60, true);
+ timeUnit = TimeUnit.MINUTES;
+ return true;
+ default:
+ return false;
}
- return false;
}
private void scaleSamples(long f, boolean mult) {
List newSamples = new ArrayList<>();
- for (double d : samples) {
+ for (double d: samples) {
if (!mult) {
- newSamples.add(BigDecimal.valueOf(d).divide(BigDecimal.valueOf(f), BigDecimal.ROUND_HALF_DOWN)
- .doubleValue());
+ newSamples.add(
+ BigDecimal.valueOf(d).divide(BigDecimal.valueOf(f), BigDecimal.ROUND_HALF_DOWN).doubleValue());
} else {
newSamples.add(BigDecimal.valueOf(d).multiply(BigDecimal.valueOf(f)).doubleValue());
}
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/timing/TimingAnalysis.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/timing/TimingAnalysis.java
index 0e48f925b6fa8a04402a823bbd9bf4bf125b3212..4769c48be2ae66a0e842a964826548ad6fe34625 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/timing/TimingAnalysis.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/analysis/timing/TimingAnalysis.java
@@ -7,6 +7,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.analysis.timing;
import java.math.BigDecimal;
@@ -21,21 +22,20 @@ import org.eclipse.trace4cps.core.ITrace;
import org.eclipse.trace4cps.core.impl.TraceHelper;
public class TimingAnalysis {
-
private TimingAnalysis() {
}
public static Map analyse(ITrace trace, Collection claimGroupingAttributes) {
Map r = new HashMap<>();
Map> p = createPartition(trace, claimGroupingAttributes);
- for (Map.Entry> e : p.entrySet()) {
+ for (Map.Entry> e: p.entrySet()) {
String name = e.getKey();
StatisticsManager stat = new StatisticsManager(trace.getTimeUnit());
r.put(name, stat);
List claims = e.getValue();
- for (IClaim c : claims) {
+ for (IClaim c: claims) {
double t = BigDecimal.valueOf(c.getEndTime().doubleValue())
- .subtract(BigDecimal.valueOf(c.getStartTime().doubleValue())).doubleValue();
+ .subtract(BigDecimal.valueOf(c.getStartTime().doubleValue())).doubleValue();
stat.addSample(t);
}
stat.autoScale();
@@ -43,10 +43,9 @@ public class TimingAnalysis {
return r;
}
- private static Map> createPartition(ITrace trace,
- Collection claimGroupingAttributes) {
+ private static Map> createPartition(ITrace trace, Collection claimGroupingAttributes) {
Map> p = new HashMap<>();
- for (IClaim c : trace.getClaims()) {
+ for (IClaim c: trace.getClaims()) {
String attVals = TraceHelper.getValues(c, claimGroupingAttributes, false);
List cell = p.get(attVals);
if (cell == null) {
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/ClaimEventType.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/ClaimEventType.java
index 3e7c338b63d0bf537067a2fe6358eabb59222c5b..ab9fd0e0da69de2db7296f184806869f346621b7 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/ClaimEventType.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/ClaimEventType.java
@@ -7,6 +7,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.core;
/**
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/IAttributeAware.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/IAttributeAware.java
index 33b9dbaee91c99bd19401d34eff9bcd832f597c1..8c398ef772c729abe40cf17f06f4f339fcdd483f 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/IAttributeAware.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/IAttributeAware.java
@@ -7,6 +7,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.core;
import java.util.Map;
@@ -16,7 +17,6 @@ import java.util.Map;
* attributes that can be read and written through this interface.
*/
public interface IAttributeAware {
-
/**
* Gets the attribute value with the specific key value
*
@@ -34,12 +34,12 @@ public interface IAttributeAware {
/**
* Sets a new attribute value, or overwrites an existing one.
- *
+ *
* @param key the key
* @param value the attribute value
*/
void setAttribute(String key, String value);
-
+
/**
* Removes all attributes.
*/
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/IAttributeFilter.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/IAttributeFilter.java
index 5a94983e25ebdc021d8a8187ee4598a80b234bf3..2edb886cbd7f641d81c047c4559d66e406742e66 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/IAttributeFilter.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/IAttributeFilter.java
@@ -7,14 +7,14 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.core;
/**
- * A generic filter interface to filter parts of the TRACE data model which are based on the
- * {@link IAttributeAware} interface.
+ * A generic filter interface to filter parts of the TRACE data model which are based on the {@link IAttributeAware}
+ * interface.
*/
public interface IAttributeFilter {
-
/**
* @param a the TRACE part to evaluate
* @return whether to include the given TRACE part
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/IClaim.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/IClaim.java
index 2c4d9a33b7467cd25c61c26f00bc76110579ba62..9486916fece8747457c832fa0cb56c1dd5bac887 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/IClaim.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/IClaim.java
@@ -7,18 +7,17 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.core;
/**
* One of the central types of the TRACE data model.
*
- * A {@link IClaim} models the start and end time of a claim on a certain amount of some {@link IResource}.
- * Every {@link IClaim} instance is associated with two {@link IClaimEvent} instances: one for its start and
- * one for its end.
- *
+ * A {@link IClaim} models the start and end time of a claim on a certain amount of some {@link IResource}. Every
+ * {@link IClaim} instance is associated with two {@link IClaimEvent} instances: one for its start and one for its end.
+ *
*/
public interface IClaim extends IAttributeAware {
-
/**
* @return the start time of the claim
*/
@@ -41,7 +40,7 @@ public interface IClaim extends IAttributeAware {
/**
* @return the offset of the claimed amount, only meaningful if the resource uses an offset:
- * {@link IResource#useOffset()}
+ * {@link IResource#useOffset()}
*/
Number getOffset();
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/IClaimEvent.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/IClaimEvent.java
index 2641e34a3ccaffba2a02ce5aadc487c252a2abfb..3f8d9011f7894a5a4a2a0b2d752e186a42afe6ac 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/IClaimEvent.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/IClaimEvent.java
@@ -7,16 +7,16 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.core;
/**
- * An {@link IClaimEvent} is a special event that is associated with an {@link IClaim} instance. Each
- * {@link IClaim} instance has exactly two {@link IClaimEvent} instances: one for its start and one for its
- * end. The manipulation of the attributes is delegated to the parent {@link IClaim} instance. That thus means
- * that the {@link IClaim} and its two {@link IClaimEvent} instances have exactly the same set of attributes.
+ * An {@link IClaimEvent} is a special event that is associated with an {@link IClaim} instance. Each {@link IClaim}
+ * instance has exactly two {@link IClaimEvent} instances: one for its start and one for its end. The manipulation of
+ * the attributes is delegated to the parent {@link IClaim} instance. That thus means that the {@link IClaim} and its
+ * two {@link IClaimEvent} instances have exactly the same set of attributes.
*/
public interface IClaimEvent extends IEvent {
-
/**
* @return the type of this claim event
*/
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/IDependency.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/IDependency.java
index 31b025fdcc477a418ff885a7565530a092fcc46a..e2fec8aa68c813fa673a5f214687e521c8b1a33b 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/IDependency.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/IDependency.java
@@ -7,13 +7,13 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.core;
/**
* A dependency between two {@link IEvent} instances. The semantics of a dependency is user-defined.
*/
public interface IDependency extends IAttributeAware {
-
/**
* @return the source event
*/
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/IEvent.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/IEvent.java
index 249481e0c354220ac460d497b871713e7cca5026..6eee4aab63cb2acad84d18db57fc29d43390d47a 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/IEvent.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/IEvent.java
@@ -7,6 +7,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.core;
import org.eclipse.trace4cps.analysis.mtl.State;
@@ -14,12 +15,11 @@ import org.eclipse.trace4cps.analysis.mtl.State;
/**
* One of the central types of the TRACE data model.
*
- * An {@link IEvent} has a timestamp (also see {@link ITrace}) and a number of attributes. Furthermore, an {@link IEvent} extends the
- * {@link State} type, which enables temporal-logic checking on sequences of events.
- *
+ * An {@link IEvent} has a timestamp (also see {@link ITrace}) and a number of attributes. Furthermore, an
+ * {@link IEvent} extends the {@link State} type, which enables temporal-logic checking on sequences of events.
+ *
*/
public interface IEvent extends State {
-
/**
* @return the timestamp of the event
*/
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/IExtendableTrace.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/IExtendableTrace.java
index deccd25b80d21f2d289a8e8ee07a1d9dc6f604d4..6660fa9bc0db3f8c6053f67eccb10eae154d28c6 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/IExtendableTrace.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/IExtendableTrace.java
@@ -7,12 +7,12 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.core;
import java.util.Collection;
public interface IExtendableTrace {
-
void addSignal(IPsop p);
void addDependencies(Collection dependencies);
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/IFilteredTrace.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/IFilteredTrace.java
index 28be3a6d426857fddf78f7b83d183880a22efafd..aedb54c08ad2d75a3d6fa02fcddeb7c6ae455d37 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/IFilteredTrace.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/IFilteredTrace.java
@@ -7,37 +7,34 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.core;
import org.eclipse.trace4cps.core.impl.ModifiableTrace;
/**
- * This type adds filtering methods to the {@link ITrace} interface. The default implementation
- * {@link ModifiableTrace} can be wrapped around any {@link ITrace} instance.
+ * This type adds filtering methods to the {@link ITrace} interface. The default implementation {@link ModifiableTrace}
+ * can be wrapped around any {@link ITrace} instance.
*/
public interface IFilteredTrace extends ITrace {
-
/**
- * Adds a filter for a specific part of an {@link ITrace}. The filter is added to the already existing
- * filters. The conjunction of all {@link IAttributeFilter#include(IAttributeAware)} is taken for whether
- * an element is included
- *
- * The result is not recalculated, because this can be a relatively expensive operation and more filters
- * might be added. An explicit call to {@link #recalculate()} is needed for the new filters to take
- * effect.
- *
+ * Adds a filter for a specific part of an {@link ITrace}. The filter is added to the already existing filters. The
+ * conjunction of all {@link IAttributeFilter#include(IAttributeAware)} is taken for whether an element is included
+ *
+ * The result is not recalculated, because this can be a relatively expensive operation and more filters might be
+ * added. An explicit call to {@link #recalculate()} is needed for the new filters to take effect.
+ *
* @param type the part of the trace to which the filter applies
* @param filter a new filter element to add
*/
void addFilter(TracePart type, T filter);
/**
- * Adds a filter for a specific part of an {@link ITrace}. The filter is added to the already existing
- * filters. The conjunction of all {@link IAttributeFilter#include(IAttributeAware)} is taken for whether
- * an element is included
- *
+ * Adds a filter for a specific part of an {@link ITrace}. The filter is added to the already existing filters. The
+ * conjunction of all {@link IAttributeFilter#include(IAttributeAware)} is taken for whether an element is included
+ *
* The result is not recalculated.
- *
+ *
* @param type the part of the trace to which the filter applies
* @param filter a new filter element to add
*/
@@ -50,7 +47,7 @@ public interface IFilteredTrace extends ITrace {
/**
* Clears the filters for the given parts of the trace.
- *
+ *
* @param type the type of filters to clear
*/
void clearFilter(TracePart type);
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/IInterval.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/IInterval.java
index 747a6c762a476c2e0356cbb9d531a9ee1d3bb94d..0ee4ade67107b9b78b10a1377d4e2fe755ddf438 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/IInterval.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/IInterval.java
@@ -7,6 +7,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.core;
/**
@@ -15,7 +16,6 @@ package org.eclipse.trace4cps.core;
* respectively.
*/
public interface IInterval {
-
/**
* @return the lower bound of the interval
*/
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/IPsop.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/IPsop.java
index b2da70ac7819764b6ccf2964ccee8ce8f30b3d7d..2753c8faa6ab2911b3175328f827a5aee2a38916 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/IPsop.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/IPsop.java
@@ -7,22 +7,24 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.core;
import java.util.List;
+import org.eclipse.trace4cps.core.impl.Psop;
+
/**
* One of the central types of the TRACE data model.
- *
+ *
*
* A piecewise second-order polynomial, consisting of consecutive {@link IPsopFragment} instances.
- *
+ *
*/
public interface IPsop extends IAttributeAware {
-
/**
* The fragments are ordered by their time-domain, are consecutive, and have no overlap.
- *
+ *
* @return the fragments that define this {@link Psop}
*/
List getFragments();
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/IPsopFragment.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/IPsopFragment.java
index e49a580396334f8f1763dc67324b1fbfeba83082..0206484e85d5a8ebe7e0d385365713060c129d31 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/IPsopFragment.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/IPsopFragment.java
@@ -7,15 +7,15 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.core;
/**
- * Encodes a second-order polynomial {@code f(t)} on the time domain {@link #dom()}. The time domain is a
- * left-closed, right-open interval: {@code [t0, t1)}. For all {@code t} in {@code dom}, we have
+ * Encodes a second-order polynomial {@code f(t)} on the time domain {@link #dom()}. The time domain is a left-closed,
+ * right-open interval: {@code [t0, t1)}. For all {@code t} in {@code dom}, we have
* {@code f(t) = a*(t-t_0)^2 + b * (t - t_0) + c}.
*/
public interface IPsopFragment {
-
/**
* @return the second-order coefficient
*/
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/IResource.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/IResource.java
index 866bb942c4ff2753c2988dd78eade2382c620c84..b25dda11868bab99108c45efedd0514dfee3d887 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/IResource.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/IResource.java
@@ -7,17 +7,17 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.core;
/**
* One of the central types of the TRACE data model.
*
- * An {@link IResource} has a positive capacity and indicates whether claims on it use an offset or not.
- * This offset can be used, for instance, to model memory fragmentation.
- *
+ * An {@link IResource} has a positive capacity and indicates whether claims on it use an offset or not. This offset can
+ * be used, for instance, to model memory fragmentation.
+ *
*/
public interface IResource extends IAttributeAware {
-
/**
* @return the capacity of the resource
*/
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/ITrace.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/ITrace.java
index 30328f1175486569467c326bdd9db6b685c5b2ad..b929d7d0c608f8269105ceca957458139902ab99 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/ITrace.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/ITrace.java
@@ -7,6 +7,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.core;
import java.util.List;
@@ -14,24 +15,23 @@ import java.util.concurrent.TimeUnit;
/**
* The central type of the TRACE data model.
- *
+ *
*
- * Caveat: All computations in this library involving {@link Number} instances use
- * {@link Number#doubleValue()} and double arithmetic. This may cause rounding effects.
+ * Caveat: All computations in this library involving {@link Number} instances use {@link Number#doubleValue()}
+ * and double arithmetic. This may cause rounding effects.
*
*/
public interface ITrace extends IAttributeAware {
-
/**
* @return the {@link TimeUnit} of the time stamps in this trace
*/
TimeUnit getTimeUnit();
/**
- * Specifies the time offset for the time stamps in this trace. All methods in the API that return
- * time stamps, return time stamps relative to this offset. Note that time stamp getters typically
- * return a {@link Number} instance, thereby allowing an arbitrary precision.
- *
+ * Specifies the time offset for the time stamps in this trace. All methods in the API that return time stamps,
+ * return time stamps relative to this offset. Note that time stamp getters typically return a {@link Number}
+ * instance, thereby allowing an arbitrary precision.
+ *
* @return the time offset as number of milliseconds since the epoch
*/
Number getTimeOffset();
@@ -45,16 +45,16 @@ public interface ITrace extends IAttributeAware {
/**
* Gets the {@link IResource} instances used by the {@link IClaim} instances.
- *
+ *
* @return the {@link IResource} instances used by the {@link IClaim} instances
*/
List getResources();
/**
- * Gets the {@link IEvent} instances, ordered ascending by their timestamp. This list includes the events
- * that belong to start and end of {@link IClaim} instances, i.e., the events obtained via
- * {@link IClaim#getStartEvent()} and {@link IClaim#getEndEvent()}. These "derived" events of the
- * {@link IClaimEvent} type delegate the attribute manipulation to their {@link IClaim} instance.
+ * Gets the {@link IEvent} instances, ordered ascending by their timestamp. This list includes the events that
+ * belong to start and end of {@link IClaim} instances, i.e., the events obtained via {@link IClaim#getStartEvent()}
+ * and {@link IClaim#getEndEvent()}. These "derived" events of the {@link IClaimEvent} type delegate the attribute
+ * manipulation to their {@link IClaim} instance.
*
* @return the events
*/
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/Shape.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/Shape.java
index 060a42c301403cdad3b9ebe18bf97b399fa5974c..3d47a0f0bcc3fa832bf7c2215c1b554f77472fdf 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/Shape.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/Shape.java
@@ -7,6 +7,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.core;
/**
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/TraceException.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/TraceException.java
index f846e76571f34915944cb2993b0c2b457e416ae9..ca0c1197c49800e49f8baece96a35bfbe1ba3c9c 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/TraceException.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/TraceException.java
@@ -7,13 +7,13 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.core;
/**
* The top-level exception in the TRACE library.
*/
public class TraceException extends Exception {
-
private static final long serialVersionUID = 1L;
public TraceException() {
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/TracePart.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/TracePart.java
index 260da0f32a52385c948b8fff81ea39b20ce98898..99e5c350cd2f8147fc832e6129132e7e05c27b3b 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/TracePart.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/TracePart.java
@@ -7,6 +7,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.core;
/**
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/impl/AttributeAware.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/impl/AttributeAware.java
index a0861412dbaa66fd5f064e877ad5034b3bdc1997..d4a21a51a8237e7a9cc4271261b81ee665d7f6fd 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/impl/AttributeAware.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/impl/AttributeAware.java
@@ -7,6 +7,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.core.impl;
import java.util.Collections;
@@ -16,11 +17,10 @@ import java.util.Map;
import org.eclipse.trace4cps.core.IAttributeAware;
/**
- * Default implementation of the {@link IAttributeAware} type. This class can be subclassed to implement the
- * various parts of the TRACE data model.
+ * Default implementation of the {@link IAttributeAware} type. This class can be subclassed to implement the various
+ * parts of the TRACE data model.
*/
public class AttributeAware implements IAttributeAware {
-
private final Map attributes = new HashMap<>();
/**
@@ -57,14 +57,15 @@ public class AttributeAware implements IAttributeAware {
/**
* Replaces the existing attributes with a new set.
- *
+ *
* @param atts the new set of attributes to replace the ecisting ones
*/
public void setAttributes(Map atts) {
attributes.clear();
if (atts != null) {
- for (Map.Entry e : atts.entrySet())
+ for (Map.Entry e: atts.entrySet()) {
setAttribute(e.getKey(), e.getValue());
+ }
}
}
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/impl/Claim.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/impl/Claim.java
index e81a0105be8e83f0690bf4f55cb66e6c3ef90431..a901accbdf09dc7b1a42cf593b1f26241760631b 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/impl/Claim.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/impl/Claim.java
@@ -7,6 +7,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.core.impl;
import java.util.Map;
@@ -17,11 +18,10 @@ import org.eclipse.trace4cps.core.IClaimEvent;
import org.eclipse.trace4cps.core.IResource;
/**
- * Default implementation of the {@link IClaim} type. The constructors create new instances for the start and
- * end events.
+ * Default implementation of the {@link IClaim} type. The constructors create new instances for the start and end
+ * events.
*/
public class Claim extends AttributeAware implements IClaim {
-
private final Number startTime;
private final Number endTime;
@@ -48,15 +48,14 @@ public class Claim extends AttributeAware implements IClaim {
this(t0, t1, r, offset, amount, null);
}
- public Claim(Number t0, Number t1, IResource r, Number offset, Number amount,
- Map attMap) {
+ public Claim(Number t0, Number t1, IResource r, Number offset, Number amount, Map attMap) {
this.startTime = t0;
this.endTime = t1;
this.resource = r;
if ((r.useOffset() && Double.isNaN(offset.doubleValue()))
- || (!r.useOffset() && !Double.isNaN(offset.doubleValue()))) {
- throw new IllegalArgumentException(
- "offset must be specified if and only if the resource uses an offset");
+ || (!r.useOffset() && !Double.isNaN(offset.doubleValue())))
+ {
+ throw new IllegalArgumentException("offset must be specified if and only if the resource uses an offset");
}
this.offset = offset;
this.amount = amount;
@@ -129,7 +128,7 @@ public class Claim extends AttributeAware implements IClaim {
*/
@Override
public String toString() {
- return "Claim[" + startTime + "-" + endTime + ", amount=" + amount + ", offset=" + offset
- + ", resoure=" + resource + ", attributes=" + getAttributes() + "]";
+ return "Claim[" + startTime + "-" + endTime + ", amount=" + amount + ", offset=" + offset + ", resoure="
+ + resource + ", attributes=" + getAttributes() + "]";
}
}
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/impl/ClaimEvent.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/impl/ClaimEvent.java
index 268a0c1109cc3ffffb6ed1be0178669d1e35462a..1ac45dda5df1c4aaadbf2611fe258e90d2af1276 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/impl/ClaimEvent.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/impl/ClaimEvent.java
@@ -7,6 +7,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.core.impl;
import java.util.Map;
@@ -20,7 +21,6 @@ import org.eclipse.trace4cps.core.IClaimEvent;
* Default implementation of the {@link IClaimEvent}.
*/
public class ClaimEvent extends Event implements IClaimEvent {
-
private final IClaim claim;
private final ClaimEventType type;
@@ -46,7 +46,7 @@ public class ClaimEvent extends Event implements IClaimEvent {
public ClaimEventType getType() {
return type;
}
-
+
/**
* {@inheritDoc}
*/
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/impl/Dependency.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/impl/Dependency.java
index d985970c824b5787fa38879064cb47120711c9a5..580319d438ee85e5a8aa96011f21c9337be64254 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/impl/Dependency.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/impl/Dependency.java
@@ -7,6 +7,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.core.impl;
import org.eclipse.trace4cps.core.IDependency;
@@ -16,7 +17,6 @@ import org.eclipse.trace4cps.core.IEvent;
* Default implementation of the {@link IDependency} type.
*/
public class Dependency extends AttributeAware implements IDependency {
-
private final IEvent src;
private final IEvent dst;
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/impl/Event.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/impl/Event.java
index c21f3cc802899f0b68b7ec6153eba134319515c4..59c27106cfd034c5784420cb4d7a5b2917846026 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/impl/Event.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/impl/Event.java
@@ -7,6 +7,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.core.impl;
import org.eclipse.trace4cps.analysis.mtl.AtomicProposition;
@@ -16,7 +17,6 @@ import org.eclipse.trace4cps.core.IEvent;
* Default implementation of the {@link IEvent} type.
*/
public class Event extends AttributeAware implements IEvent {
-
private Number timestamp;
public Event(Number timestamp) {
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/impl/Interval.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/impl/Interval.java
index d962033593470c751807c3ecbb3b8b711cf99cc1..3047a737ff84ba4142576ece75f723c566d45594 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/impl/Interval.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/impl/Interval.java
@@ -7,6 +7,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.core.impl;
import org.eclipse.trace4cps.core.IInterval;
@@ -15,7 +16,6 @@ import org.eclipse.trace4cps.core.IInterval;
* Default implementation of the {@link IInterval} type, immutable.
*/
public final class Interval implements IInterval {
-
private final Number lb;
private final Number ub;
@@ -26,7 +26,7 @@ public final class Interval implements IInterval {
/**
* Constructs a left-closed right-open interval
- *
+ *
* @param lb the lower bound
* @param ub the upper bound
*/
@@ -104,8 +104,7 @@ public final class Interval implements IInterval {
@Override
public boolean isEmpty() {
- return lb.doubleValue() > ub.doubleValue()
- || (lb.doubleValue() == ub.doubleValue() && (openLb || openUb));
+ return lb.doubleValue() > ub.doubleValue() || (lb.doubleValue() == ub.doubleValue() && (openLb || openUb));
}
@Override
@@ -140,7 +139,7 @@ public final class Interval implements IInterval {
ub = i2.ub;
openUb = i2.openUb;
}
- return new Interval(lb, openLb, ub, openUb);
+ return new Interval(lb, openLb, ub, openUb);
}
@Override
@@ -156,27 +155,36 @@ public final class Interval implements IInterval {
@Override
public boolean equals(Object obj) {
- if (this == obj)
+ if (this == obj) {
return true;
- if (obj == null)
+ }
+ if (obj == null) {
return false;
- if (getClass() != obj.getClass())
+ }
+ if (getClass() != obj.getClass()) {
return false;
- Interval other = (Interval) obj;
+ }
+ Interval other = (Interval)obj;
if (lb == null) {
- if (other.lb != null)
+ if (other.lb != null) {
return false;
- } else if (!lb.equals(other.lb))
+ }
+ } else if (!lb.equals(other.lb)) {
return false;
- if (openLb != other.openLb)
+ }
+ if (openLb != other.openLb) {
return false;
- if (openUb != other.openUb)
+ }
+ if (openUb != other.openUb) {
return false;
+ }
if (ub == null) {
- if (other.ub != null)
+ if (other.ub != null) {
return false;
- } else if (!ub.equals(other.ub))
+ }
+ } else if (!ub.equals(other.ub)) {
return false;
+ }
return true;
}
}
diff --git a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/impl/ModifiableTrace.java b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/impl/ModifiableTrace.java
index 027ba4d00a995448b5c1aa233415270a19e6e765..11d76e189b7827b7cfa6f60bae4eabc0eb8c462b 100644
--- a/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/impl/ModifiableTrace.java
+++ b/trace/org.eclipse.trace4cps.core/src/org/eclipse/trace4cps/core/impl/ModifiableTrace.java
@@ -7,6 +7,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
+
package org.eclipse.trace4cps.core.impl;
import java.util.ArrayList;
@@ -34,7 +35,6 @@ import org.eclipse.trace4cps.core.TracePart;
* Default implementation of the {@link IFilteredTrace} and {@link IExtendableTrace} types.
*/
public class ModifiableTrace implements IFilteredTrace, IExtendableTrace {
-
private final List claimFilters = new ArrayList<>();
private final List resourceFilters = new ArrayList<>();
@@ -68,7 +68,6 @@ public class ModifiableTrace implements IFilteredTrace, IExtendableTrace {
private List extResources = new ArrayList<>();
private static final Comparator EVENT_COMP = new Comparator() {
-
@Override
public int compare(IEvent e1, IEvent e2) {
return Double.compare(e1.getTimestamp().doubleValue(), e2.getTimestamp().doubleValue());
@@ -77,7 +76,7 @@ public class ModifiableTrace implements IFilteredTrace, IExtendableTrace {
/**
* Wraps the given trace with this filtering facade.
- *
+ *
* @param trace the wrapped trace
*/
public ModifiableTrace(ITrace trace) {
@@ -118,7 +117,7 @@ public class ModifiableTrace implements IFilteredTrace, IExtendableTrace {
@Override
public void addClaims(Collection claims) {
extClaims.addAll(claims);
- for (IClaim claim : claims) {
+ for (IClaim claim: claims) {
extEvents.add(claim.getStartEvent());
extEvents.add(claim.getEndEvent());
if (!extResources.contains(claim.getResource())) {
@@ -134,18 +133,18 @@ public class ModifiableTrace implements IFilteredTrace, IExtendableTrace {
@Override
public boolean hasExtension(TracePart part) {
switch (part) {
- case ALL:
- return !extSignals.isEmpty() || !extDependencies.isEmpty() || !extEvents.isEmpty();
- case SIGNAL:
- return !extSignals.isEmpty();
- case DEPENDENCY:
- return !extDependencies.isEmpty();
- case EVENT:
- return !extEvents.isEmpty();
- case CLAIM:
- return !extClaims.isEmpty();
- default:
- return false;
+ case ALL:
+ return !extSignals.isEmpty() || !extDependencies.isEmpty() || !extEvents.isEmpty();
+ case SIGNAL:
+ return !extSignals.isEmpty();
+ case DEPENDENCY:
+ return !extDependencies.isEmpty();
+ case EVENT:
+ return !extEvents.isEmpty();
+ case CLAIM:
+ return !extClaims.isEmpty();
+ default:
+ return false;
}
}
@@ -155,38 +154,38 @@ public class ModifiableTrace implements IFilteredTrace, IExtendableTrace {
@Override
public void clearExtension(TracePart part) {
switch (part) {
- case ALL:
- extSignals.clear();
- extDependencies.clear();
- extEvents.clear();
- extClaims.clear();
- extResources.clear();
- break;
- case SIGNAL:
- extSignals.clear();
- break;
- case DEPENDENCY:
- extDependencies.clear();
- break;
- case EVENT:
- // do not remove the claim events from the extClaims
- extEvents.clear();
- for (IClaim c : extClaims) {
- extEvents.add(c.getStartEvent());
- extEvents.add(c.getEndEvent());
- }
- Collections.sort(extEvents, EVENT_COMP);
- break;
- case CLAIM:
- extResources.clear();
- for (IClaim c : extClaims) {
- extEvents.remove(c.getStartEvent());
- extEvents.remove(c.getEndEvent());
- }
- extClaims.clear();
- break;
- default:
- throw new IllegalStateException();
+ case ALL:
+ extSignals.clear();
+ extDependencies.clear();
+ extEvents.clear();
+ extClaims.clear();
+ extResources.clear();
+ break;
+ case SIGNAL:
+ extSignals.clear();
+ break;
+ case DEPENDENCY:
+ extDependencies.clear();
+ break;
+ case EVENT:
+ // do not remove the claim events from the extClaims
+ extEvents.clear();
+ for (IClaim c: extClaims) {
+ extEvents.add(c.getStartEvent());
+ extEvents.add(c.getEndEvent());
+ }
+ Collections.sort(extEvents, EVENT_COMP);
+ break;
+ case CLAIM:
+ extResources.clear();
+ for (IClaim c: extClaims) {
+ extEvents.remove(c.getStartEvent());
+ extEvents.remove(c.getEndEvent());
+ }
+ extClaims.clear();
+ break;
+ default:
+ throw new IllegalStateException();
}
recalculate();
}
@@ -210,23 +209,23 @@ public class ModifiableTrace implements IFilteredTrace, IExtendableTrace {
private void clearInt(TracePart type) {
switch (type) {
- case CLAIM:
- claimFilters.clear();
- break;
- case EVENT:
- eventFilters.clear();
- break;
- case RESOURCE:
- resourceFilters.clear();
- break;
- case DEPENDENCY:
- dependencyFilters.clear();
- break;
- case SIGNAL:
- signalFilters.clear();
- break;
- case ALL:
- throw new IllegalStateException("should not be called");
+ case CLAIM:
+ claimFilters.clear();
+ break;
+ case EVENT:
+ eventFilters.clear();
+ break;
+ case RESOURCE:
+ resourceFilters.clear();
+ break;
+ case DEPENDENCY:
+ dependencyFilters.clear();
+ break;
+ case SIGNAL:
+ signalFilters.clear();
+ break;
+ case ALL:
+ throw new IllegalStateException("should not be called");
}
}
@@ -248,28 +247,28 @@ public class ModifiableTrace implements IFilteredTrace, IExtendableTrace {
private void addFilter(TracePart type, boolean recalc, IAttributeFilter filter) {
switch (type) {
- case CLAIM:
- addFilter(claimFilters, filter);
- break;
- case RESOURCE:
- addFilter(resourceFilters, filter);
- break;
- case EVENT:
- addFilter(eventFilters, filter);
- break;
- case SIGNAL:
- addFilter(signalFilters, filter);
- break;
- case DEPENDENCY:
- addFilter(dependencyFilters, filter);
- break;
- case ALL:
- addFilter(claimFilters, filter);
- addFilter(resourceFilters, filter);
- addFilter(eventFilters, filter);
- addFilter(signalFilters, filter);
- addFilter(dependencyFilters, filter);
- break;
+ case CLAIM:
+ addFilter(claimFilters, filter);
+ break;
+ case RESOURCE:
+ addFilter(resourceFilters, filter);
+ break;
+ case EVENT:
+ addFilter(eventFilters, filter);
+ break;
+ case SIGNAL:
+ addFilter(signalFilters, filter);
+ break;
+ case DEPENDENCY:
+ addFilter(dependencyFilters, filter);
+ break;
+ case ALL:
+ addFilter(claimFilters, filter);
+ addFilter(resourceFilters, filter);
+ addFilter(eventFilters, filter);
+ addFilter(signalFilters, filter);
+ addFilter(dependencyFilters, filter);
+ break;
}
if (recalc) {
recalculate();
@@ -311,9 +310,9 @@ public class ModifiableTrace implements IFilteredTrace, IExtendableTrace {
dependencies.addAll(extDependencies);
// Then filter if needed
if (!dependencyFilters.isEmpty() || !eventFilters.isEmpty() || !claimFilters.isEmpty()
- || !resourceFilters.isEmpty()) {
+ || !resourceFilters.isEmpty())
+ {
dependencies = recalc(dependencies, dependencyFilters, new InclusionConstraint() {
-
@Override
boolean include(IDependency a) {
return events.contains(a.getSrc()) && events.contains(a.getDst());
@@ -330,11 +329,10 @@ public class ModifiableTrace implements IFilteredTrace, IExtendableTrace {
// Filter if needed
if (!eventFilters.isEmpty() || !claimFilters.isEmpty() || !resourceFilters.isEmpty()) {
events = recalc(events, eventFilters, new InclusionConstraint() {
-
@Override
boolean include(IEvent a) {
if (a instanceof IClaimEvent) {
- return claims.contains(((IClaimEvent) a).getClaim());
+ return claims.contains(((IClaimEvent)a).getClaim());
}
return true;
}
@@ -349,10 +347,10 @@ public class ModifiableTrace implements IFilteredTrace, IExtendableTrace {
// Filter if needed
if (!claimFilters.isEmpty() || !resourceFilters.isEmpty()) {
claims = recalc(claims, claimFilters, new InclusionConstraint() {
-
+ @Override
boolean include(IClaim c) {
return resources.contains(c.getResource());
- };
+ }
});
}
}
@@ -368,14 +366,14 @@ public class ModifiableTrace implements IFilteredTrace, IExtendableTrace {
}
private abstract class InclusionConstraint {
-
abstract boolean include(T a);
}
private List recalc(List