[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r18030 - in gnunet-java: . .settings lib src/org/gnunet/uti
From: |
gnunet |
Subject: |
[GNUnet-SVN] r18030 - in gnunet-java: . .settings lib src/org/gnunet/util/network src/org/gnunet/util/scheduler src/org/gnunet/util/time |
Date: |
Sun, 6 Nov 2011 22:46:08 +0100 |
Author: dold
Date: 2011-11-06 22:46:08 +0100 (Sun, 06 Nov 2011)
New Revision: 18030
Added:
gnunet-java/.checkstyle
gnunet-java/.settings/org.eclipse.jdt.ui.prefs
gnunet-java/lib/
gnunet-java/lib/slf4j-api-1.6.4.jar
Modified:
gnunet-java/.classpath
gnunet-java/.settings/org.eclipse.jdt.core.prefs
gnunet-java/src/org/gnunet/util/network/Client.java
gnunet-java/src/org/gnunet/util/scheduler/Scheduler.java
gnunet-java/src/org/gnunet/util/time/AbsoluteTime.java
gnunet-java/src/org/gnunet/util/time/RelativeTime.java
Log:
time implementation, logging
Added: gnunet-java/.checkstyle
===================================================================
--- gnunet-java/.checkstyle (rev 0)
+++ gnunet-java/.checkstyle 2011-11-06 21:46:08 UTC (rev 18030)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<fileset-config file-format-version="1.2.0" simple-config="false"
sync-formatter="false">
+ <fileset name="all" enabled="true" check-config-name="Sun Checks (Eclipse)"
local="false">
+ <file-match-pattern match-pattern="." include-pattern="true"/>
+ </fileset>
+</fileset-config>
Modified: gnunet-java/.classpath
===================================================================
--- gnunet-java/.classpath 2011-11-05 19:23:48 UTC (rev 18029)
+++ gnunet-java/.classpath 2011-11-06 21:46:08 UTC (rev 18030)
@@ -2,5 +2,7 @@
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con"
path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
+ <classpathentry kind="lib" path="lib/slf4j-api-1.6.4.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Modified: gnunet-java/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- gnunet-java/.settings/org.eclipse.jdt.core.prefs 2011-11-05 19:23:48 UTC
(rev 18029)
+++ gnunet-java/.settings/org.eclipse.jdt.core.prefs 2011-11-06 21:46:08 UTC
(rev 18030)
@@ -1,4 +1,4 @@
-#Wed Nov 02 18:12:37 CET 2011
+#Sun Nov 06 13:14:08 CET 2011
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
@@ -10,3 +10,283 @@
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.6
+org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_assignment=0
+org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
+org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
+org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
+org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
+org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
+org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_after_package=1
+org.eclipse.jdt.core.formatter.blank_lines_before_field=0
+org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
+org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
+org.eclipse.jdt.core.formatter.blank_lines_before_method=1
+org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
+org.eclipse.jdt.core.formatter.blank_lines_before_package=0
+org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
+org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
+org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
+org.eclipse.jdt.core.formatter.comment.format_block_comments=true
+org.eclipse.jdt.core.formatter.comment.format_header=false
+org.eclipse.jdt.core.formatter.comment.format_html=true
+org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
+org.eclipse.jdt.core.formatter.comment.format_line_comments=true
+org.eclipse.jdt.core.formatter.comment.format_source_code=true
+org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
+org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
+org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
+org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
+org.eclipse.jdt.core.formatter.comment.line_length=80
+org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
+org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
+org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
+org.eclipse.jdt.core.formatter.compact_else_if=true
+org.eclipse.jdt.core.formatter.continuation_indentation=2
+org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
address@hidden:off
address@hidden:on
+org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
+org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
+org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_empty_lines=false
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
+org.eclipse.jdt.core.formatter.indentation.size=4
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do
not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do
not insert
+org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do
not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do
not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do
not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do
not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do
not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not
insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not
insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not
insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not
insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not
insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not
insert
+org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not
insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
+org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not
insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not
insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not
insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not
insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not
insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not
insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
+org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not
insert
+org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not
insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not
insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not
insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do
not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do
not insert
+org.eclipse.jdt.core.formatter.join_lines_in_comments=true
+org.eclipse.jdt.core.formatter.join_wrapped_lines=true
+org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.lineSplit=80
+org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
+org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
+org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
+org.eclipse.jdt.core.formatter.tabulation.char=space
+org.eclipse.jdt.core.formatter.tabulation.size=4
+org.eclipse.jdt.core.formatter.use_on_off_tags=false
+org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
+org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
+org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
Added: gnunet-java/.settings/org.eclipse.jdt.ui.prefs
===================================================================
--- gnunet-java/.settings/org.eclipse.jdt.ui.prefs
(rev 0)
+++ gnunet-java/.settings/org.eclipse.jdt.ui.prefs 2011-11-06 21:46:08 UTC
(rev 18030)
@@ -0,0 +1,57 @@
+#Sun Nov 06 13:14:08 CET 2011
+cleanup.add_default_serial_version_id=true
+cleanup.add_generated_serial_version_id=false
+cleanup.add_missing_annotations=true
+cleanup.add_missing_deprecated_annotations=true
+cleanup.add_missing_methods=false
+cleanup.add_missing_nls_tags=false
+cleanup.add_missing_override_annotations=true
+cleanup.add_missing_override_annotations_interface_methods=true
+cleanup.add_serial_version_id=false
+cleanup.always_use_blocks=true
+cleanup.always_use_parentheses_in_expressions=false
+cleanup.always_use_this_for_non_static_field_access=false
+cleanup.always_use_this_for_non_static_method_access=false
+cleanup.convert_to_enhanced_for_loop=false
+cleanup.correct_indentation=false
+cleanup.format_source_code=false
+cleanup.format_source_code_changes_only=false
+cleanup.make_local_variable_final=true
+cleanup.make_parameters_final=true
+cleanup.make_private_fields_final=true
+cleanup.make_type_abstract_if_missing_method=false
+cleanup.make_variable_declarations_final=true
+cleanup.never_use_blocks=false
+cleanup.never_use_parentheses_in_expressions=true
+cleanup.organize_imports=true
+cleanup.qualify_static_field_accesses_with_declaring_class=false
+cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+cleanup.qualify_static_member_accesses_with_declaring_class=true
+cleanup.qualify_static_method_accesses_with_declaring_class=false
+cleanup.remove_private_constructors=true
+cleanup.remove_trailing_whitespaces=false
+cleanup.remove_trailing_whitespaces_all=true
+cleanup.remove_trailing_whitespaces_ignore_empty=false
+cleanup.remove_unnecessary_casts=true
+cleanup.remove_unnecessary_nls_tags=true
+cleanup.remove_unused_imports=true
+cleanup.remove_unused_local_variables=false
+cleanup.remove_unused_private_fields=true
+cleanup.remove_unused_private_members=false
+cleanup.remove_unused_private_methods=true
+cleanup.remove_unused_private_types=true
+cleanup.sort_members=false
+cleanup.sort_members_all=false
+cleanup.use_blocks=true
+cleanup.use_blocks_only_for_return_and_throw=false
+cleanup.use_parentheses_in_expressions=false
+cleanup.use_this_for_non_static_field_access=false
+cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+cleanup.use_this_for_non_static_method_access=false
+cleanup.use_this_for_non_static_method_access_only_if_necessary=true
+cleanup_profile=_eclipse-cs gnunet-java
+cleanup_settings_version=2
+eclipse.preferences.version=1
+formatter_profile=_eclipse-cs gnunet-java
+formatter_settings_version=12
Added: gnunet-java/lib/slf4j-api-1.6.4.jar
===================================================================
(Binary files differ)
Property changes on: gnunet-java/lib/slf4j-api-1.6.4.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified: gnunet-java/src/org/gnunet/util/network/Client.java
===================================================================
--- gnunet-java/src/org/gnunet/util/network/Client.java 2011-11-05 19:23:48 UTC
(rev 18029)
+++ gnunet-java/src/org/gnunet/util/network/Client.java 2011-11-06 21:46:08 UTC
(rev 18030)
@@ -1,7 +1,6 @@
package org.gnunet.util.network;
import org.gnunet.util.config.Configuration;
-import org.gnunet.util.scheduler.Task;
import org.gnunet.util.time.RelativeTime;
Modified: gnunet-java/src/org/gnunet/util/scheduler/Scheduler.java
===================================================================
--- gnunet-java/src/org/gnunet/util/scheduler/Scheduler.java 2011-11-05
19:23:48 UTC (rev 18029)
+++ gnunet-java/src/org/gnunet/util/scheduler/Scheduler.java 2011-11-06
21:46:08 UTC (rev 18030)
@@ -16,7 +16,7 @@
};
public enum Reason {
- // XXX: do these values need to be 2^n? are they used in a bit
mask? YES
+ // XXX: do these values need to be 2^n? are they used in a bit
mask? YES => what about EnumSet?
STARTUP, SHUTDOWN, TIMEOUT, READ_READY, WRITE_READY, PREREQ_DONE
};
@@ -35,10 +35,6 @@
};
}
-
- /*
- * Task subsumes gnunet-c's TaskContext and TaskIdentifier
- */
public static abstract class TaskIdentifier {
Modified: gnunet-java/src/org/gnunet/util/time/AbsoluteTime.java
===================================================================
--- gnunet-java/src/org/gnunet/util/time/AbsoluteTime.java 2011-11-05
19:23:48 UTC (rev 18029)
+++ gnunet-java/src/org/gnunet/util/time/AbsoluteTime.java 2011-11-06
21:46:08 UTC (rev 18030)
@@ -1,92 +1,143 @@
package org.gnunet.util.time;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
public class AbsoluteTime {
+ private static final Logger logger = LoggerFactory
+ .getLogger(AbsoluteTime.class);
- public final static AbsoluteTime ZERO = new AbsoluteTime(0);
- public final static AbsoluteTime FOREVER = new
AbsoluteTime(Long.MAX_VALUE);
+ public final static AbsoluteTime ZERO = new AbsoluteTime(0);
+ public final static AbsoluteTime FOREVER = new
AbsoluteTime(Long.MAX_VALUE);
- private static long offset;
+ private static long offset = 0;
- private final long abs_value;
+ private final long abs_value;
- public static void setOffset(long offset) {
- AbsoluteTime.offset = offset;
- }
-
- public static AbsoluteTime now() {
- return new AbsoluteTime(System.currentTimeMillis());
- }
+ /**
+ * Set the timestamp offset for this instance.
+ *
+ * @param offset
+ * the offset to skew the locale time by
+ */
+ public static void setOffset(final long offset) {
+ AbsoluteTime.offset = offset;
+ }
- public AbsoluteTime(long abs_value) {
- this.abs_value = abs_value;
- }
+ /**
+ * Get the current time (works just as "time", just that we use the unit of
+ * time that the cron-jobs use (and is 64 bit)).
+ *
+ * @return the current time
+ */
+ public static AbsoluteTime now() {
+ return new AbsoluteTime(System.currentTimeMillis() + offset);
+ }
- public long getMilliseconds() {
- return abs_value;
- }
+ public AbsoluteTime(final long abs_value) {
+ this.abs_value = abs_value;
+ }
- public AbsoluteTime min(AbsoluteTime other) {
- throw new UnsupportedOperationException();
- }
+ public long getMilliseconds() {
+ return abs_value;
+ }
- public AbsoluteTime max(AbsoluteTime other) {
- throw new UnsupportedOperationException();
+ /**
+ * Returns the minimum of two time values.
+ *
+ * @param other
+ * @return min(this,other)
+ */
+ public AbsoluteTime min(final AbsoluteTime other) {
+ return (abs_value <= other.abs_value) ? this : other;
+ }
- }
+ public AbsoluteTime max(final AbsoluteTime other) {
+ return (abs_value >= other.abs_value) ? this : other;
- public RelativeTime getRemaining() {
- throw new UnsupportedOperationException();
+ }
- }
+ public RelativeTime getRemaining() {
+ if (abs_value == Long.MAX_VALUE) {
+ return RelativeTime.FOREVER;
+ }
+ final AbsoluteTime now = AbsoluteTime.now();
+ if (now.abs_value > abs_value) {
+ return RelativeTime.ZERO;
+ }
+ return new RelativeTime(abs_value - now.abs_value);
- /**
- * Calculate the estimate time of arrival/completion for an operation.
- *
- * @param start
- * when did the operation start?
- * @param finished
- * how much has been done?
- * @param total
- * how much must be done overall (same unit as for
"finished")
- * @return remaining duration for the operation, assuming it continues
at
- * the same speed
- */
- public RelativeTime calculateETA(AbsoluteTime start, long finished,
- long total) {
- if (finished >= total) {
- return RelativeTime.ZERO;
- }
- if (finished == 0) {
- return RelativeTime.FOREVER;
- }
- RelativeTime dur = start.getDuration(start);
- double exp = ((double) dur.getMilliseconds()) * ((double) total)
- / ((double) finished);
- return new RelativeTime((long) exp);
- }
+ }
- public RelativeTime getDifference(AbsoluteTime other) {
- throw new UnsupportedOperationException();
- }
+ /**
+ * Calculate the estimate time of arrival/completion for an operation.
+ *
+ * @param start
+ * when did the operation start?
+ * @param finished
+ * how much has been done?
+ * @param total
+ * how much must be done overall (same unit as for "finished")
+ * @return remaining duration for the operation, assuming it continues at
+ * the same speed
+ */
+ public RelativeTime calculateETA(final AbsoluteTime start, final long
finished,
+ final long total) {
+ if (finished >= total) {
+ return RelativeTime.ZERO;
+ }
+ if (finished == 0) {
+ return RelativeTime.FOREVER;
+ }
+ final RelativeTime dur = start.getDuration();
+ final double exp = ((double) dur.getMilliseconds()) * ((double) total)
+ / finished;
+ return new RelativeTime((long) exp);
+ }
- public RelativeTime getDuration(AbsoluteTime whence) {
- throw new UnsupportedOperationException();
- }
+ public RelativeTime getDifference(final AbsoluteTime other) {
+ if (other.abs_value == Long.MAX_VALUE) {
+ return RelativeTime.FOREVER;
+ }
+ if (other.abs_value < abs_value) {
+ return RelativeTime.ZERO;
+ }
+ return new RelativeTime(abs_value - other.abs_value);
+ }
- public AbsoluteTime add(RelativeTime duration) {
- throw new UnsupportedOperationException();
- }
+ public RelativeTime getDuration() {
+ assert abs_value != Long.MAX_VALUE;
+ return getDifference(AbsoluteTime.now());
+ }
- public AbsoluteTime subtract(RelativeTime duration) {
- throw new UnsupportedOperationException();
- }
+ public AbsoluteTime add(final RelativeTime duration) {
+ if (abs_value == Long.MAX_VALUE
+ || duration.getMilliseconds() == Long.MAX_VALUE) {
+ return this;
+ }
+ if (abs_value + duration.getMilliseconds() < abs_value) {
+ logger.warn("time overflow");
+ return AbsoluteTime.FOREVER;
+ }
+ return new AbsoluteTime(abs_value + duration.getMilliseconds());
+ }
- public byte[] toNetwork() {
- throw new UnsupportedOperationException();
- }
+ public AbsoluteTime subtract(final RelativeTime duration) {
+ if (abs_value <= duration.getMilliseconds()) {
+ return AbsoluteTime.ZERO;
+ }
+ if (abs_value == Long.MAX_VALUE) {
+ return this;
+ }
+ return new AbsoluteTime(abs_value - duration.getMilliseconds());
+ }
- static AbsoluteTime fromNetwork(byte[] b) {
- throw new UnsupportedOperationException();
- }
+ public byte[] toNetwork() {
+ throw new UnsupportedOperationException();
+ }
+ static AbsoluteTime fromNetwork(final byte[] b) {
+ throw new UnsupportedOperationException();
+ }
+
}
Modified: gnunet-java/src/org/gnunet/util/time/RelativeTime.java
===================================================================
--- gnunet-java/src/org/gnunet/util/time/RelativeTime.java 2011-11-05
19:23:48 UTC (rev 18029)
+++ gnunet-java/src/org/gnunet/util/time/RelativeTime.java 2011-11-06
21:46:08 UTC (rev 18030)
@@ -1,149 +1,149 @@
package org.gnunet.util.time;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
/**
- *
* @author Florian Dold
- *
*/
-public class RelativeTime {
- public final static RelativeTime MILLISECOND = new RelativeTime(1);
- public final static RelativeTime SECOND = MILLISECOND.multiply(1000);
- public final static RelativeTime MINUTE = SECOND.multiply(60);
- public final static RelativeTime HOUR = MINUTE.multiply(60);
- public final static RelativeTime DAY = HOUR.multiply(24);
- public final static RelativeTime WEEK = DAY.multiply(7);
- public final static RelativeTime MONTH = DAY.multiply(30);
- public final static RelativeTime YEAR = DAY.multiply(365);
+public final class RelativeTime {
+ private static final Logger logger = LoggerFactory
+ .getLogger(RelativeTime.class);
- public final static RelativeTime ZERO = new RelativeTime(0);
- public final static RelativeTime FOREVER = new
RelativeTime(Long.MAX_VALUE);
+ public static final RelativeTime MILLISECOND = new RelativeTime(1);
+ public static final RelativeTime SECOND = MILLISECOND.multiply(1000);
+ public static final RelativeTime MINUTE = SECOND.multiply(60);
+ public static final RelativeTime HOUR = MINUTE.multiply(60);
+ public static final RelativeTime DAY = HOUR.multiply(24);
+ public static final RelativeTime WEEK = DAY.multiply(7);
+ public static final RelativeTime MONTH = DAY.multiply(30);
+ public static final RelativeTime YEAR = DAY.multiply(365);
- private final long rel_value;
+ public static final RelativeTime ZERO = new RelativeTime(0);
+ public static final RelativeTime FOREVER = new
RelativeTime(Long.MAX_VALUE);
- public RelativeTime(long abs_value) {
- this.rel_value = abs_value;
- }
+ private final long rel_value;
- public long getMilliseconds() {
- return rel_value;
- }
+ public RelativeTime(final long abs_value) {
+ this.rel_value = abs_value;
+ }
- /**
- * Convert relative time to an absolute time in the
- * future.
- *
- * @return timestamp that is "rel" in the future, or FOREVER if
rel==FOREVER (or if we would overflow)
- */
- public AbsoluteTime toAbsolute() {
- return AbsoluteTime.now().add(this);
- }
+ public long getMilliseconds() {
+ return rel_value;
+ }
- /**
- * Return the minimum of two relative time values.
- */
- public RelativeTime min(RelativeTime other) {
- // XXX: use guava for null checks?
- if (this.rel_value < other.rel_value) {
- return this;
- } else {
- return other;
- }
- }
+ /**
+ * Convert relative time to an absolute time in the future.
+ *
+ * @return timestamp that is "rel" in the future, or FOREVER if
rel==FOREVER
+ * (or if we would overflow)
+ */
+ public AbsoluteTime toAbsolute() {
+ return AbsoluteTime.now().add(this);
+ }
- public RelativeTime max(RelativeTime other) {
- if (this.rel_value > other.rel_value) {
- return this;
- } else {
- return other;
- }
- }
+ /**
+ * Return the minimum of two relative time values.
+ *
+ * @return the smaller time value
+ */
+ public RelativeTime min(final RelativeTime other) {
+ return (rel_value <= other.rel_value) ? this : other;
+ }
- /**
- * Multiply relative time by a given factor.
- *
- * @return FOREVER if rel=FOREVER or on overflow; otherwise rel*factor
- */
- public RelativeTime multiply(int factor) {
- if (factor == 0) {
- return RelativeTime.ZERO;
- }
- // XXX: better way of overflow checking??
- long ret = this.rel_value * factor;
- if (ret / factor != rel_value) {
- // XXX: logging
- return RelativeTime.FOREVER;
- }
- return new RelativeTime(ret);
- }
+ /**
+ * Return the maximum of two relative time values.
+ *
+ * @return the bigger time value
+ */
+ public RelativeTime max(final RelativeTime other) {
+ return (rel_value >= other.rel_value) ? this : other;
+ }
- /**
- * Divide relative time by a given factor.
- *
- * @param rel
- * some duration
- * @param factor
- * integer to divide by
- * @return FOREVER if rel=FOREVER or factor==0; otherwise rel/factor
- */
- public RelativeTime divide(int factor) {
- if (factor == 0 || this.rel_value == Long.MAX_VALUE) {
- return RelativeTime.FOREVER;
- }
- return new RelativeTime(this.rel_value / (long) factor);
- }
+ /**
+ * Multiply relative time by a given factor.
+ *
+ * @return FOREVER if rel=FOREVER or on overflow; otherwise rel*factor
+ */
+ public RelativeTime multiply(final int factor) {
+ if (factor == 0) {
+ return RelativeTime.ZERO;
+ }
+ final long ret = this.rel_value * factor;
+ if (ret / factor != rel_value) {
+ logger.warn("time overflow");
+ return RelativeTime.FOREVER;
+ }
+ return new RelativeTime(ret);
+ }
- /**
- * Add relative times together.
- */
- public RelativeTime add(RelativeTime other) {
- if (this.rel_value == Long.MAX_VALUE
- || other.rel_value == Long.MAX_VALUE) {
- return RelativeTime.FOREVER;
- }
- long new_rel_value = this.rel_value + other.rel_value;
- // check for numeric overflow
- if (new_rel_value < this.rel_value) {
- // XXX: do logging
- return RelativeTime.FOREVER;
- }
- return new RelativeTime(new_rel_value);
- }
+ /**
+ * Divide relative time by a given factor.
+ *
+ * @param rel
+ * some duration
+ * @param factor
+ * integer to divide by
+ * @return FOREVER if rel=FOREVER or factor==0; otherwise rel/factor
+ */
+ public RelativeTime divide(final int factor) {
+ if (factor == 0 || this.rel_value == Long.MAX_VALUE) {
+ return RelativeTime.FOREVER;
+ }
+ return new RelativeTime(this.rel_value / factor);
+ }
- /**
- * Subtract relative timestamp from the other.
- *
- * @param other
- * second timestamp
- * @return ZERO if a2>=a1 (including both FOREVER), FOREVER if a1 is
- * FOREVER, a1-a2 otherwise
- */
- public RelativeTime subtract(RelativeTime other) {
- if (this.rel_value >= other.rel_value) {
- return RelativeTime.ZERO;
- } else if (this.rel_value == Long.MAX_VALUE) {
- return this;
- } else {
- return new RelativeTime(this.rel_value -
other.rel_value);
- }
- }
-
- /**
- * Convert a relative time to a string.
- *
- * @return string form of the time (as milliseconds)
- */
- @Override
- public String toString() {
- return "" + this.rel_value;
- }
+ /**
+ * Add relative times together.
+ */
+ public RelativeTime add(final RelativeTime other) {
+ if (this.rel_value == Long.MAX_VALUE
+ || other.rel_value == Long.MAX_VALUE) {
+ return RelativeTime.FOREVER;
+ }
+ final long new_rel_value = this.rel_value + other.rel_value;
+ // check for numeric overflow
+ if (new_rel_value < this.rel_value) {
+ logger.warn("time overflow");
+ return RelativeTime.FOREVER;
+ }
+ return new RelativeTime(new_rel_value);
+ }
- public byte[] toNetwork() {
- throw new UnsupportedOperationException();
- }
+ /**
+ * Subtract relative timestamp from the other.
+ *
+ * @param other
+ * second timestamp
+ * @return ZERO if a2>=a1 (including both FOREVER), FOREVER if a1 is
+ * FOREVER, a1-a2 otherwise
+ */
+ public RelativeTime subtract(final RelativeTime other) {
+ if (this.rel_value >= other.rel_value) {
+ return RelativeTime.ZERO;
+ } else if (this.rel_value == Long.MAX_VALUE) {
+ return this;
+ } else {
+ return new RelativeTime(this.rel_value - other.rel_value);
+ }
+ }
- static RelativeTime fromNetwork(byte[] b) {
- throw new UnsupportedOperationException();
- }
+ /**
+ * Convert a relative time to a string.
+ *
+ * @return string form of the time (as milliseconds)
+ */
+ @Override
+ public String toString() {
+ return "" + this.rel_value;
+ }
+ public byte[] toNetwork() {
+ throw new UnsupportedOperationException();
+ }
+ static RelativeTime fromNetwork(final byte[] b) {
+ throw new UnsupportedOperationException();
+ }
+
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r18030 - in gnunet-java: . .settings lib src/org/gnunet/util/network src/org/gnunet/util/scheduler src/org/gnunet/util/time,
gnunet <=