Module: Java::OrgTmapiCore::Scoped

Extends:
Superiseable
Includes:
RTM::Scoped
Defined in:
rtm-javatmapi/lib/rtm/javatmapi/core/scoped.rb

Overview

Copyright: Copyright 2009 Topic Maps Lab, University of Leipzig. License: Apache License, Version 2.0

Instance Method Summary

Methods included from Superiseable

method_added, register_java_implementation, superised, superising

Instance Method Details

- (Object) add_theme(identifier)

Adds a topic given by the identifier to the scope.

Identifier may be a topic reference.

:call-seq:

  add_theme(identifier)


28
29
30
31
32
33
34
35
36
# File 'rtm-javatmapi/lib/rtm/javatmapi/core/scoped.rb', line 28

def add_theme(identifier)
  if identifier.is_a?(Java::OrgTmapiCore::Topic)
    addTheme(identifier)
  elsif identifier.is_a?(Java::OrgTmapiCore::Locator) || identifier.is_a?(String)
    addTheme(topic_map.get!(identifier))
  else
    raise("Identifier must be a Topic, String or Locator")
  end
end

- (Object) add_themes(*args) Also known as: add_scope

Adds one or several topics to the scope.

An identifier may be a topic reference.

:call-seq:

  add_themes(identifier)
  add_themes(identifier1, identifier2, ...)


46
47
48
49
50
51
# File 'rtm-javatmapi/lib/rtm/javatmapi/core/scoped.rb', line 46

def add_themes(*args)
  args.flatten!
  args.each do |identifier|
    add_theme(identifier)
  end
end

- (Object) remove_theme(identifier)

Removes a topic given by the identifier from the current scope.

Identifier may be a topic reference.

:call-seq:

  remove_theme(identifier)


68
69
70
71
# File 'rtm-javatmapi/lib/rtm/javatmapi/core/scoped.rb', line 68

def remove_theme(identifier)
  identifier = topic_map.get(identifier)
  removeTheme(identifier) if identifier.is_a?(Java::OrgTmapiCore::Topic)
end

- (Object) remove_themes(*args) Also known as: remove_scope

Removes one or several topics from the scope.

An identifier may be a topic reference.

:call-seq:

  remove_themes(identifier)
  remove_themes(identifier1, identifier2, ...)


81
82
83
84
85
86
# File 'rtm-javatmapi/lib/rtm/javatmapi/core/scoped.rb', line 81

def remove_themes(*args)
  args.flatten!
  args.each do |identifier|
    remove_theme(identifier)
  end
end

- (Object) scope Also known as: themes

Returns the Topics which define the scope of this scoped Construct. An empty Set represents the unconstrained scope.

:call-seq:

  scope -> Set of Topics


15
16
17
# File 'rtm-javatmapi/lib/rtm/javatmapi/core/scoped.rb', line 15

def scope
  getScope
end