# Copyright: Copyright 2009 Topic Maps Lab, University of Leipzig. # License: Apache License, Version 2.0 module Java::OrgTmapiCore::Construct extend Superiseable #include RTM::Construct # Returns the TopicMap instance this Construct belongs to. # # :call-seq: # topic_map -> TopicMap # def topic_map getTopicMap end # Returns true if the construct fulfills all constraints defined in the TMDM def valid? # This is defined in RTM::AR and we test it. I guess from the API perspective, in TMAPI the validness of an object is guaranteed. true end unless self.method_defined?(:valid?) superised # Adds an item identifier to this construct. # Identifier may be a String or Locator. # # :call-seq: # item_identifiers=(identifier) # def add_item_identifier(identifier) # TODO Spec if identifier.is_a? Java::OrgTmapiCore::Locator addItemIdentifier(identifier) else addItemIdentifier(topic_map.create_locator(identifier)) end end alias :item_identifiers= :add_item_identifier superised # Removes an item identifer from this construct, # if present. # # Identifier may be a String or Locator. # # :call-seq: # remove_item_identifier(identifier) # def remove_item_identifier(identifier) identifier = topic_map.create_locator(identifier) if identifier.is_a? String removeItemIdentifier(identifier) if identifier.is_a? Java::OrgTmapiCore::Locator end # Returns the identifier of this construct. # This property has no representation in the Topic Maps - Data Model. # The ID can be anything, so long as no other Construct in the # same topic map has the same ID. # # :call_spec: # id -> String # def id getId end end