Class: When::TM::Coordinate
- Inherits:
-
TemporalPosition
- Object
- TemporalPosition
- When::TM::Coordinate
- Defined in:
- lib/when_exe/tmptypes.rb
Overview
時間座標 - 単一の時間間隔によって定義する連続な間隔尺度を基礎とする
see gml schema
Direct Known Subclasses
Constant Summary
Constants inherited from TemporalPosition
TemporalPosition::AMPM, TemporalPosition::DateTimeInstanceMethods, TemporalPosition::Format, TemporalPosition::HashProperty
Constants included from Coordinates
Coordinates::Bahai, Coordinates::Chinese, Coordinates::Common, Coordinates::DefaultDateIndices, Coordinates::DefaultDayIndex, Coordinates::DefaultTimeIndices, Coordinates::Indian, Coordinates::Iranian, Coordinates::Javanese, Coordinates::LocationTable, Coordinates::MATCH, Coordinates::Mayan, Coordinates::PERIOD, Coordinates::PERIOD_NAME, Coordinates::PRECISION, Coordinates::PRECISION_NAME, Coordinates::Russian, Coordinates::Tibetan, Coordinates::VALUE, Coordinates::Yi
Constants included from When
AUTHOR, CENTURY, COPYRIGHT, DAY, DECADE, EUCJP, HOUR, MINUTE, MONTH, MinusInfinity, Month, P1D, P1M, P1W, P1Y, PT1H, PT1M, PT1S, PlusInfinity, RootDir, SECOND, STRING, SYSTEM, SourceURI, When::TimeValue, UTF8, VERSION, W31J, WEEK, Week, YEAR, YEARS
Constants included from Parts::Resource
Parts::Resource::ConstList, Parts::Resource::ConstTypes, Parts::Resource::IRIDecode, Parts::Resource::IRIDecodeTable, Parts::Resource::IRIEncode, Parts::Resource::IRIEncodeTable, Parts::Resource::IRIHeader, Parts::Resource::LabelProperty
Constants included from Namespace
Namespace::DC, Namespace::DCQ, Namespace::DCT, Namespace::FOAF, Namespace::OWL, Namespace::RDF, Namespace::RDFC, Namespace::RDFS, Namespace::RSS, Namespace::XSD
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
オブジェクトの生成.
-
#local_time ⇒ Numeric
内部時間(ローカル).
-
#prev ⇒ When::TM::TemporalPosition
前の時刻.
-
#succ ⇒ When::TM::TemporalPosition
(also: #next)
次の時刻.
Methods inherited from TemporalPosition
#+@, #<=>, #==, #[], #^, #_attr, _instance, _instance_element, #_notes, _options, _setup_, _setup_info, _temporal_position, #_to_h, #_to_s, _verify, #apply_delayed_options, #calendar_name, #clock_name, #copy, #dynamical_time, #floor, format, #has_next?, #has_time?, #include?, #inspect, #is?, #month_included, #note?, #notes, #period, #rate_of_clock, #reference_label, #scan, #strftime, #time_standard, #to_clock_time, #to_date, #to_datetime, #to_f, #to_i, #to_m17n, #to_residue, #to_s, #to_time, #to_uri, #to_uri_escape, #week_included, #year_included
Methods included from Coordinates
to_deg, to_deg_225, to_dms, utf_gets
Methods included from When
Border, Calendar, CalendarEra, CalendarNote, Clock, Duration, Index, Location, M17n, MonthName, Pair, Residue, Resource, TemporalPosition, Wikipedia, _const_missing, _define_common_calendar_types, _setup_, _setup_info, at, client, column, config, const_missing, date_or_era, era, free_conv, m17n, now, server, strptime, today, when?, where?
Methods included from TemporalPosition::Conversion
Methods included from Parts::Resource
#[], #^, _abbreviation_to_iri, _decode, _encode, _extract_prefix, _instance, _instantiate, _parse, _path_with_prefix, _replace_tags, _setup_, _setup_info, _simplify_path, base_uri, #each, #enum_for, #hierarchy, #include?, #included?, #iri, #leaf?, #m17n, #map, #parent, #registered?, root_dir
Methods included from Parts::Resource::Pool
#[], #[]=, #_pool, #_setup_, #pool_keys
Methods included from Parts::Resource::Synchronize
Constructor Details
#initialize(universal_time, options = {}) ⇒ Coordinate
オブジェクトの生成
165 166 167 168 |
# File 'lib/when_exe/tmptypes.rb', line 165 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
内部時間による時間座標値
92 93 94 |
# File 'lib/when_exe/tmptypes.rb', line 92 def universal_time @universal_time end |
Class Method Details
.dynamical_time(dynamical_time, options = {}) ⇒ When::TM::Coordinate
外部時間によるオブジェクトの生成
30 31 32 |
# File 'lib/when_exe/tmptypes.rb', line 30 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
他種の時間位置によるオブジェクトの生成
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/when_exe/tmptypes.rb', line 44 def new(time, ={}) = .dup [:frame] = Clock.get_clock_option() case time when Numeric [:frame] ||= When::UTC unless time.kind_of?(Integer) universal_time = (2*time - (2*JulianDate::JD19700101-1)) * Duration::DAY.to_i / 2.0 when ClockTime [:frame] ||= time.clock universal_time = time.clk_time[0] + time.universal_time when ::Time [:frame] ||= When.Clock(time.gmtoff) universal_time = [:frame].time_standard.from_time_object(time) when TimeValue [:frame] ||= time.clock universal_time = time.universal_time else if ::Object.const_defined?(:Date) && ::Date.method_defined?(:+) && time.respond_to?(:ajd) case time when ::DateTime [:frame] ||= When.Clock((time.offset * 86400).to_i) universal_time = (2*time.ajd - (2*JulianDate::JD19700101-1)) * Duration::DAY.to_i / 2.0 when ::Date universal_time = JulianDate._d_to_t(time.jd) if [:frame] && [:frame].rate_of_clock != 1.0 universal_time = [:frame].time_standard.from_dynamical_time( When::TimeStandard.to_dynamical_time(universal_time)) end end end end raise TypeError, "Can't create #{self} from #{time.class}" unless universal_time universal_time(universal_time, ) end |
.universal_time ⇒ Object
内部時間によるオブジェクトの生成
19 |
# File 'lib/when_exe/tmptypes.rb', line 19 alias :universal_time :new |
Instance Method Details
#+(other) ⇒ When::TM::TemporalPosition
加算
120 121 122 123 |
# File 'lib/when_exe/tmptypes.rb', line 120 def +(other) other = other.to_interval_length if other.kind_of?(PeriodDuration) super(other) end |
#-(other) ⇒ When::TM::TemporalPosition, When::TM::IntervalLength
減算
132 133 134 135 |
# File 'lib/when_exe/tmptypes.rb', line 132 def -(other) other = other.to_interval_length if other.kind_of?(PeriodDuration) super(other) end |
#local_time ⇒ Numeric
内部時間(ローカル)
102 103 104 |
# File 'lib/when_exe/tmptypes.rb', line 102 def local_time @universal_time end |
#prev ⇒ When::TM::TemporalPosition
前の時刻
143 144 145 |
# File 'lib/when_exe/tmptypes.rb', line 143 def prev self - period end |
#succ ⇒ When::TM::TemporalPosition Also known as: next
次の時刻
153 154 155 |
# File 'lib/when_exe/tmptypes.rb', line 153 def succ self + period end |