Class: When::TM::Coordinate
- Inherits:
-
TemporalPosition
- Object
- TemporalPosition
- When::TM::Coordinate
- Defined in:
- lib/when_exe/tmposition.rb
Overview
時間座標 - 単一の時間間隔によって定義する連続な間隔尺度を基礎とする
see gml schema
Direct Known Subclasses
Constant Summary
Constants inherited from TemporalPosition
TemporalPosition::AMPM, TemporalPosition::Format, TemporalPosition::HashProperty
Constants included from Coordinates
Coordinates::Bahai, Coordinates::CommonResidue, Coordinates::DefaultDateIndices, Coordinates::DefaultDayIndex, Coordinates::DefaultTimeIndices, Coordinates::IndianCities, Coordinates::Javanese, Coordinates::MATCH, Coordinates::Mayan, Coordinates::PERIOD, Coordinates::PERIOD_NAME, Coordinates::PRECISION, Coordinates::PRECISION_NAME, Coordinates::VALUE, Coordinates::Yi
Constants included from When
CENTURY, DAY, DECADE, DurationP1D, DurationP1M, DurationP1W, DurationP1Y, EUCJP, HOUR, MINUTE, MONTH, MinusInfinity, PlusInfinity, SECOND, STRING, SYSTEM, SourceURI, When::TimeValue, UTF8, VERSION, W31J, WEEK, YEAR
Constants included from Parts::Resource
Parts::Resource::LabelProperty
Constants included from IndeterminateValue
IndeterminateValue::After, IndeterminateValue::Before, IndeterminateValue::I, IndeterminateValue::Max, IndeterminateValue::Min, IndeterminateValue::Now, IndeterminateValue::S, IndeterminateValue::Unknown
Instance Attribute Summary collapse
-
#universal_time ⇒ Numeric
(also: #coordinateValue)
readonly
内部時間による時間座標値.
Attributes inherited from TemporalPosition
#events, #frame, #indeterminated_position, #location, #options, #precision, #query, #trans
Attributes included from Parts::Resource
#_pool, #child, #keys, #locale, #namespace
Class Method Summary collapse
-
.dynamical_time(dynamical_time, options = {}) ⇒ When::TM::Coordinate
外部時間によるオブジェクトの生成.
-
.new(time, options = {}) ⇒ When::TM::Coordinate
他種の時間位置によるオブジェクトの生成.
-
.universal_time ⇒ Object
内部時間によるオブジェクトの生成.
Instance Method Summary collapse
-
#+(other) ⇒ When::TM::TemporalPosition
加算.
-
#-(other) ⇒ When::TM::TemporalPosition, When::TM::IntervalLength
減算.
-
#initialize(universal_time, options = {}) ⇒ Coordinate
constructor
オブジェクトの生成.
Methods inherited from TemporalPosition
#+@, #<=>, #[], #^, #_attr, _instance, #_notes, _options, _setup_, #_to_hash, #_to_s, #calendar_name, #clock_name, #copy, #dynamical_time, #floor, #has_next?, #has_time?, #include?, #is?, #month_included, #note?, #notes, #period, #prev, #rate_of_clock, #reference_label, #scan, #strftime, #succ, #term, #time_standard, #to_clock_time, #to_date, #to_date_time, #to_date_uri, #to_f, #to_i, #to_m17n, #to_residue, #to_s, #to_time, #to_uri, #week_included, #year_included
Methods included from Coordinates
Methods included from When
Calendar, CalendarEra, CalendarNote, Clock, Duration, M17n, MonthName, Pair, Residue, Resource, TemporalPosition, _free_conv, _parse, _setup_, _to_string, _to_symbol, at, client, config, era, free_conv, m17n, now, server, today, utc, when?
Methods included from TemporalPosition::Conversion
Methods included from Parts::Resource
#[], #^, _extract_prefix, _instance, _parse, _path_with_prefix, _setup_, #each, #enum_for, #hierarchy, #include?, #included?, #iri, #leaf?, #m17n, #map, #next, #parent, #prev, #registered?
Methods included from Parts::Resource::Pool
#[], #[]=, #_pool, #_setup_, #pool_keys
Methods included from Parts::Resource::Synchronize
Constructor Details
#initialize(universal_time, options = {}) ⇒ Coordinate
オブジェクトの生成
1099 1100 1101 1102 |
# File 'lib/when_exe/tmposition.rb', line 1099 def initialize(universal_time, ={}) super() @universal_time = universal_time end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class When::TM::TemporalPosition
Instance Attribute Details
#universal_time ⇒ Numeric Also known as: coordinateValue
内部時間による時間座標値
1057 1058 1059 |
# File 'lib/when_exe/tmposition.rb', line 1057 def universal_time @universal_time end |
Class Method Details
.dynamical_time(dynamical_time, options = {}) ⇒ When::TM::Coordinate
外部時間によるオブジェクトの生成
999 1000 1001 |
# File 'lib/when_exe/tmposition.rb', line 999 def dynamical_time(dynamical_time, ={}) universal_time(When.Resource([:time_standard] || 'UniversalTime', '_t:').from_dynamical_time(dynamical_time), ) end |
.new(time, options = {}) ⇒ When::TM::Coordinate
他種の時間位置によるオブジェクトの生成
1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 |
# File 'lib/when_exe/tmposition.rb', line 1013 def new(time, ={}) = .dup [:frame] = Clock.get_clock_option() case time when Numeric [:frame] ||= When.utc unless time.kind_of?(Integer) external_time = (2*time - (2*JulianDate::JD19700101-1)) * Duration::DAY.to_i / 2.0 when ClockTime [:frame] ||= time.clock external_time = time.clk_time[0] + time.universal_time when ::Time [:frame] ||= When.Clock(time.gmtoff) external_time = When.Resource('_t:UniversalTime').from_time_object(time) when TimeValue [:frame] ||= time.clock external_time = time.universal_time else if ::Object.const_defined?(:Date) && time.respond_to?(:ajd) case time when ::DateTime [:frame] ||= When.Clock((time.offset * 86400).to_i) external_time = (2*time.ajd - (2*JulianDate::JD19700101-1)) * Duration::DAY.to_i / 2.0 when ::Date external_time = JulianDate._d_to_t(time.jd) end end end raise TypeError, "Can't create #{self} from #{time.class}" unless external_time universal_time(external_time, ) end |
.universal_time ⇒ Object
内部時間によるオブジェクトの生成
988 |
# File 'lib/when_exe/tmposition.rb', line 988 alias :universal_time :new |
Instance Method Details
#+(other) ⇒ When::TM::TemporalPosition
加算
1075 1076 1077 1078 |
# File 'lib/when_exe/tmposition.rb', line 1075 def +(other) raise TypeError,"The right operand should be IntervalLength" if other.kind_of?(PeriodDuration) super end |
#-(other) ⇒ When::TM::TemporalPosition, When::TM::IntervalLength
減算
1087 1088 1089 1090 |
# File 'lib/when_exe/tmposition.rb', line 1087 def -(other) raise TypeError,"The right operand should be IntervalLength or (Temporal)Position" if other.kind_of?(PeriodDuration) super end |