Class Index [+]

Quicksearch

When::TM::Period

期間 - 一次元幾何プリミティブ

see gml schema

Attributes

begin[R]

この期間が始まる瞬間 (relation - Beginning)

  type : When::TM::Instant
end[R]

この期間が終わる瞬間 (relation - Ending)

  type : When::TM::Instant
topology[R]

対応するエッジ (relation - Realization)

  type : When::TM::Edge

Public Class Methods

new(begun, ended) click to toggle source

オブジェクトの生成

  begun : When::TM::Instant
    始点

  ended : When::TM::Instant
    終点
     # File when/tmobjects.rb, line 363
363:     def initialize(begun, ended)
364:       raise ArgumentError, 'Order mismatch: begun > ended' if begun > ended
365:       @begin = begun
366:       @end   = ended
367:       @begin.begun_by << self
368:       @end.ended_by   << self
369:     end

Public Instance Methods

distance(other) click to toggle source

他のWhen::TM::GeometricPrimitiveとの時間位置の差の絶対値

  other   : When::TM::GeometricPrimitive
  returns : When::TM::Duration
     # File when/tmobjects.rb, line 307
307:     def distance(other)
308:       case other
309:       when Instant
310:         return other.distance(self)
311:       when Period
312:         verify = other.begin.position - self.end.position
313:         return verify if +verify >= 0
314:         return [self.begin.position - other.end.position, When.Duration(0)].max
315:       else
316:         raise TypeError, "The right operand should be Instant or Period"
317:       end
318:     end
length() click to toggle source

When::TM::GeometricPrimitive 自身の持続時間

  returns : When::TM::Duration
     # File when/tmobjects.rb, line 298
298:     def length()
299:       @length ||= @end - @begin
300:     end
relativePosition(other) click to toggle source
Alias for: relative_position
relative_position(other) click to toggle source

他のPrimitiveとの相対的な時間位置

  other   : When::TM::Primitive
  returns : When::TM::RelativePosition
     # File when/tmobjects.rb, line 325
325:     def relative_position(other)
326:       case other
327:       when Instant
328:         verify = self.end.position <=> other.position
329:         return RelativePosition::Before   if verify <  0
330:         return RelativePosition::EndedBy  if verify == 0
331:         verify = self.begin.position <=> other.position
332:         return RelativePosition::Contains if verify <  0
333:         return RelativePosition::BegunBy  if verify == 0
334:         return RelativePosition::After
335:       when Period
336:         verify_b = relative_position(other.begin)
337:         case verify_b
338:         when RelativePosition::Before  ; return RelativePosition::Before
339:         when RelativePosition::EndedBy ; return RelativePosition::Meets
340:         end
341:         verify_e = relative_position(other.end)
342:         case verify_e
343:         when RelativePosition::BegunBy ; return RelativePosition::MetBy
344:         when RelativePosition::After   ; return RelativePosition::After
345:         else                           ; return RELATIVE_POSITION[verify_b][verify_e]
346:         end
347:       else
348:         raise TypeError, "The right operand should be Instant or Period"
349:       end
350:     end
Also aliased as: relativePosition

Private Instance Methods

method_missing(name, *args, &block) click to toggle source

その他のメソッド

  When::TM::Period で定義されていないメソッドは
  処理を @begin (type: When::TM::Instant) に委譲する
     # File when/tmobjects.rb, line 375
375:     def method_missing(name, *args, &block)
376:       @begin.send(name.to_sym, *args, &block)
377:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.