From: <lh...@us...> - 2008-11-13 13:19:45
|
Revision: 180 http://tinytim.svn.sourceforge.net/tinytim/?rev=180&view=rev Author: lheuer Date: 2008-11-13 13:19:39 +0000 (Thu, 13 Nov 2008) Log Message: ----------- - Package reorg - Introduced more internal interfaces - Simplified ITopicMap - Utility classes work on interfaces and rely not on implementations (changed casts to internal interfaces, not implementations) Modified Paths: -------------- tinytim/trunk/src/main/java/org/tinytim/Version.java tinytim/trunk/src/main/java/org/tinytim/core/AbstractTopicMapSystem.java tinytim/trunk/src/main/java/org/tinytim/core/AssociationImpl.java tinytim/trunk/src/main/java/org/tinytim/core/ConstructImpl.java tinytim/trunk/src/main/java/org/tinytim/core/DatatypeAwareConstruct.java tinytim/trunk/src/main/java/org/tinytim/core/IdentityManager.java tinytim/trunk/src/main/java/org/tinytim/core/MemoryTopicMap.java tinytim/trunk/src/main/java/org/tinytim/core/MemoryTopicMapSystem.java tinytim/trunk/src/main/java/org/tinytim/core/NameImpl.java tinytim/trunk/src/main/java/org/tinytim/core/OccurrenceImpl.java tinytim/trunk/src/main/java/org/tinytim/core/RoleImpl.java tinytim/trunk/src/main/java/org/tinytim/core/Scope.java tinytim/trunk/src/main/java/org/tinytim/core/ScopedImpl.java tinytim/trunk/src/main/java/org/tinytim/core/TopicImpl.java tinytim/trunk/src/main/java/org/tinytim/core/TopicMapSystemFactoryImpl.java tinytim/trunk/src/main/java/org/tinytim/core/TypedImpl.java tinytim/trunk/src/main/java/org/tinytim/core/VariantImpl.java tinytim/trunk/src/main/java/org/tinytim/index/AbstractIndex.java tinytim/trunk/src/main/java/org/tinytim/index/IIndexManager.java tinytim/trunk/src/main/java/org/tinytim/index/IndexManager.java tinytim/trunk/src/main/java/org/tinytim/index/LiteralIndexImpl.java tinytim/trunk/src/main/java/org/tinytim/index/ScopedIndexImpl.java tinytim/trunk/src/main/java/org/tinytim/index/TypeInstanceIndexImpl.java tinytim/trunk/src/main/java/org/tinytim/utils/DuplicateRemovalUtils.java tinytim/trunk/src/main/java/org/tinytim/utils/Property.java tinytim/trunk/src/main/java/org/tinytim/utils/TopicUtils.java tinytim/trunk/src/main/java/org/tinytim/utils/TypeInstanceConverter.java tinytim/trunk/src/main/java/org/tinytim/voc/Namespace.java tinytim/trunk/src/main/java/org/tinytim/voc/Vocabulary.java tinytim/trunk/src/test/java/org/tinytim/core/AllTests.java tinytim/trunk/src/test/java/org/tinytim/core/TestIConstruct.java tinytim/trunk/src/test/java/org/tinytim/core/TestScope.java tinytim/trunk/src/test/java/org/tinytim/core/TinyTimTestCase.java Added Paths: ----------- tinytim/trunk/src/main/java/org/tinytim/core/MemoryConstructFactory.java tinytim/trunk/src/main/java/org/tinytim/core/value/ tinytim/trunk/src/main/java/org/tinytim/core/value/DecimalLiteral.java tinytim/trunk/src/main/java/org/tinytim/core/value/IntegerLiteral.java tinytim/trunk/src/main/java/org/tinytim/core/value/Literal.java tinytim/trunk/src/main/java/org/tinytim/core/value/LiteralNormalizer.java tinytim/trunk/src/main/java/org/tinytim/core/value/LocatorImpl.java tinytim/trunk/src/main/java/org/tinytim/internal/api/ tinytim/trunk/src/main/java/org/tinytim/internal/api/Event.java tinytim/trunk/src/main/java/org/tinytim/internal/api/IConstant.java tinytim/trunk/src/main/java/org/tinytim/internal/api/IConstruct.java tinytim/trunk/src/main/java/org/tinytim/internal/api/IConstructFactory.java tinytim/trunk/src/main/java/org/tinytim/internal/api/IEventHandler.java tinytim/trunk/src/main/java/org/tinytim/internal/api/IEventPublisher.java tinytim/trunk/src/main/java/org/tinytim/internal/api/IEventPublisherAware.java tinytim/trunk/src/main/java/org/tinytim/internal/api/IIndexManagerAware.java tinytim/trunk/src/main/java/org/tinytim/internal/api/ILiteral.java tinytim/trunk/src/main/java/org/tinytim/internal/api/ILiteralAware.java tinytim/trunk/src/main/java/org/tinytim/internal/api/ILocator.java tinytim/trunk/src/main/java/org/tinytim/internal/api/IMovable.java tinytim/trunk/src/main/java/org/tinytim/internal/api/IName.java tinytim/trunk/src/main/java/org/tinytim/internal/api/IOccurrence.java tinytim/trunk/src/main/java/org/tinytim/internal/api/IScope.java tinytim/trunk/src/main/java/org/tinytim/internal/api/IScoped.java tinytim/trunk/src/main/java/org/tinytim/internal/api/ITopic.java tinytim/trunk/src/main/java/org/tinytim/internal/api/ITopicMap.java tinytim/trunk/src/main/java/org/tinytim/internal/api/IVariant.java tinytim/trunk/src/main/java/org/tinytim/internal/utils/CopyUtils.java tinytim/trunk/src/main/java/org/tinytim/internal/utils/MergeUtils.java tinytim/trunk/src/main/java/org/tinytim/internal/utils/SignatureGenerator.java tinytim/trunk/src/test/java/org/tinytim/core/value/ tinytim/trunk/src/test/java/org/tinytim/core/value/TestLiteral.java tinytim/trunk/src/test/java/org/tinytim/core/value/TestLiteralNormalizer.java tinytim/trunk/src/test/java/org/tinytim/core/value/TestLocatorImpl.java tinytim/trunk/src/test/java/org/tinytim/internal/ tinytim/trunk/src/test/java/org/tinytim/internal/utils/ tinytim/trunk/src/test/java/org/tinytim/internal/utils/TestSignatureGenerator.java Removed Paths: ------------- tinytim/trunk/src/main/java/org/tinytim/core/CopyUtils.java tinytim/trunk/src/main/java/org/tinytim/core/DecimalLiteral.java tinytim/trunk/src/main/java/org/tinytim/core/Event.java tinytim/trunk/src/main/java/org/tinytim/core/IConstant.java tinytim/trunk/src/main/java/org/tinytim/core/IConstruct.java tinytim/trunk/src/main/java/org/tinytim/core/IEventHandler.java tinytim/trunk/src/main/java/org/tinytim/core/IEventPublisher.java tinytim/trunk/src/main/java/org/tinytim/core/IEventPublisherAware.java tinytim/trunk/src/main/java/org/tinytim/core/IIndexManagerAware.java tinytim/trunk/src/main/java/org/tinytim/core/ILiteral.java tinytim/trunk/src/main/java/org/tinytim/core/ILiteralAware.java tinytim/trunk/src/main/java/org/tinytim/core/ILocator.java tinytim/trunk/src/main/java/org/tinytim/core/IMovable.java tinytim/trunk/src/main/java/org/tinytim/core/IScope.java tinytim/trunk/src/main/java/org/tinytim/core/IScoped.java tinytim/trunk/src/main/java/org/tinytim/core/ITopicMap.java tinytim/trunk/src/main/java/org/tinytim/core/IntegerLiteral.java tinytim/trunk/src/main/java/org/tinytim/core/Literal.java tinytim/trunk/src/main/java/org/tinytim/core/LiteralNormalizer.java tinytim/trunk/src/main/java/org/tinytim/core/LocatorImpl.java tinytim/trunk/src/main/java/org/tinytim/core/MergeUtils.java tinytim/trunk/src/main/java/org/tinytim/core/SignatureGenerator.java tinytim/trunk/src/test/java/org/tinytim/core/TestItemIdentifierConstraint.java tinytim/trunk/src/test/java/org/tinytim/core/TestLiteral.java tinytim/trunk/src/test/java/org/tinytim/core/TestLiteralNormalizer.java tinytim/trunk/src/test/java/org/tinytim/core/TestLocatorImpl.java tinytim/trunk/src/test/java/org/tinytim/core/TestSignatureGenerator.java Modified: tinytim/trunk/src/main/java/org/tinytim/Version.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/Version.java 2008-11-12 15:26:11 UTC (rev 179) +++ tinytim/trunk/src/main/java/org/tinytim/Version.java 2008-11-13 13:19:39 UTC (rev 180) @@ -19,7 +19,7 @@ * Provides the version information. * * @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a> - * @version $Rev:$ - $Date:$ + * @version $Rev$ - $Date$ */ public class Version { @@ -32,6 +32,7 @@ /** * The release information. */ - public static final String RELEASE = _MAJOR + "." + _MINOR + "." + _MICRO + _STATE + _DATE; + // Not final since Java compilers copy the string into classes + public static String RELEASE = _MAJOR + "." + _MINOR + "." + _MICRO + _STATE + _DATE; } Modified: tinytim/trunk/src/main/java/org/tinytim/core/AbstractTopicMapSystem.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/core/AbstractTopicMapSystem.java 2008-11-12 15:26:11 UTC (rev 179) +++ tinytim/trunk/src/main/java/org/tinytim/core/AbstractTopicMapSystem.java 2008-11-13 13:19:39 UTC (rev 180) @@ -17,6 +17,8 @@ import java.util.Map; +import org.tinytim.core.value.Literal; + import org.tmapi.core.FeatureNotRecognizedException; import org.tmapi.core.Locator; import org.tmapi.core.TMAPIException; @@ -28,7 +30,7 @@ * * * @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a> - * @version $Rev:$ - $Date:$ + * @version $Rev$ - $Date$ */ abstract class AbstractTopicMapSystem implements TopicMapSystem { Modified: tinytim/trunk/src/main/java/org/tinytim/core/AssociationImpl.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/core/AssociationImpl.java 2008-11-12 15:26:11 UTC (rev 179) +++ tinytim/trunk/src/main/java/org/tinytim/core/AssociationImpl.java 2008-11-13 13:19:39 UTC (rev 180) @@ -18,8 +18,13 @@ import java.util.Collections; import java.util.Set; +import org.tinytim.internal.api.Event; +import org.tinytim.internal.api.IConstant; +import org.tinytim.internal.api.IScope; +import org.tinytim.internal.api.ITopicMap; import org.tinytim.internal.utils.Check; import org.tinytim.internal.utils.CollectionFactory; + import org.tmapi.core.Association; import org.tmapi.core.Role; import org.tmapi.core.Topic; Modified: tinytim/trunk/src/main/java/org/tinytim/core/ConstructImpl.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/core/ConstructImpl.java 2008-11-12 15:26:11 UTC (rev 179) +++ tinytim/trunk/src/main/java/org/tinytim/core/ConstructImpl.java 2008-11-13 13:19:39 UTC (rev 180) @@ -18,7 +18,12 @@ import java.util.Collections; import java.util.Set; +import org.tinytim.internal.api.Event; +import org.tinytim.internal.api.IConstant; +import org.tinytim.internal.api.IConstruct; +import org.tinytim.internal.api.ITopicMap; import org.tinytim.internal.utils.CollectionFactory; + import org.tmapi.core.Construct; import org.tmapi.core.Locator; import org.tmapi.core.ModelConstraintException; Deleted: tinytim/trunk/src/main/java/org/tinytim/core/CopyUtils.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/core/CopyUtils.java 2008-11-12 15:26:11 UTC (rev 179) +++ tinytim/trunk/src/main/java/org/tinytim/core/CopyUtils.java 2008-11-13 13:19:39 UTC (rev 180) @@ -1,375 +0,0 @@ -/* - * Copyright 2008 Lars Heuer (heuer[at]semagia.com) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.tinytim.core; - -import java.util.Map; -import java.util.Set; - -import org.tinytim.internal.utils.CollectionFactory; -import org.tinytim.internal.utils.IIntObjectMap; -import org.tmapi.core.Association; -import org.tmapi.core.Construct; -import org.tmapi.core.Locator; -import org.tmapi.core.Name; -import org.tmapi.core.Occurrence; -import org.tmapi.core.Reifiable; -import org.tmapi.core.Role; -import org.tmapi.core.Scoped; -import org.tmapi.core.Topic; -import org.tmapi.core.TopicMap; -import org.tmapi.core.Typed; -import org.tmapi.core.Variant; - -/** - * This class provides methods to copy Topic Maps constructs from one - * topic map to another without creating duplicates. - * - * @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a> - * @version $Rev$ - $Date$ - */ -final class CopyUtils { - - private CopyUtils() { - // noop. - } - - /** - * Copies the topics and associations from the <tt>source</tt> to the - * <tt>target</tt> topic map. - * - * @param source The topic map to take the topics and associations from. - * @param target The topic map which should receive the topics and associations. - */ - public static void copy(TopicMap source, TopicMap target) { - _copy(source, (ITopicMap) target); - } - - /** - * @see #copy(TopicMap, TopicMap) - */ - private static void _copy(TopicMap source, ITopicMap target) { - if (source == null || target == null) { - throw new IllegalArgumentException("Neither the source topic map nor the target topic map must be null"); - } - if (source == target) { - return; - } - Map<Topic, Topic> mergeMap = CollectionFactory.createIdentityMap(); - Topic existing = null; - Construct existingConstruct = null; - for (Topic topic: source.getTopics()) { - for (Locator slo: topic.getSubjectLocators()) { - existing = target.getTopicBySubjectLocator(slo); - if (existing != null) { - _addMerge(topic, existing, mergeMap); - } - } - for (Locator sid: topic.getSubjectIdentifiers()) { - existing = target.getTopicBySubjectIdentifier(sid); - if (existing != null) { - _addMerge(topic, existing, mergeMap); - } - existingConstruct = target.getConstructByItemIdentifier(sid); - if (existingConstruct instanceof Topic) { - _addMerge(topic, (Topic) existingConstruct, mergeMap); - } - } - for (Locator iid: topic.getItemIdentifiers()) { - existingConstruct = target.getConstructByItemIdentifier(iid); - if (existingConstruct instanceof Topic) { - _addMerge(topic, (Topic) existingConstruct, mergeMap); - } - existing = target.getTopicBySubjectIdentifier(iid); - if (existing != null) { - _addMerge(topic, existing, mergeMap); - } - } - } - if (source.getReifier() != null && target.getReifier() != null) { - _addMerge(source.getReifier(), target.getReifier(), mergeMap); - } - for (Topic topic: source.getTopics()) { - if (!mergeMap.containsKey(topic)) { - _copyTopic(topic, target, mergeMap); - } - } - for (Topic topic: mergeMap.keySet()) { - Topic targetTopic = mergeMap.get(topic); - _copyIdentities(topic, targetTopic); - _copyTypes(topic, targetTopic, mergeMap); - _copyCharacteristics(topic, (TopicImpl)targetTopic, mergeMap); - } - _copyAssociations(source, target, mergeMap); - } - - /** - * Copies the <tt>topic</tt> to the <tt>target</tt> topic map. - * - * @param topic The topic to copy. - * @param target The target topic map. - * @param mergeMap The map which holds the merge mappings. - * @return The newly created topic in the target topic map. - */ - private static Topic _copyTopic(Topic topic, ITopicMap target, - Map<Topic, Topic> mergeMap) { - Topic targetTopic = target.createTopicWithoutIdentity(); - _copyIdentities(topic, targetTopic); - _copyTypes(topic, targetTopic, mergeMap); - _copyCharacteristics(topic, (TopicImpl)targetTopic, mergeMap); - return targetTopic; - } - - /** - * Copies the identities (item identifiers, subject identifiers and subject - * locators) from the <tt>source/tt> to the <tt>targetTopic</tt>. - * - * @param topic The topic to take the identities from. - * @param targetTopic The topic which gets the identities. - */ - private static void _copyIdentities(Topic topic, Topic targetTopic) { - for(Locator sid: topic.getSubjectIdentifiers()) { - targetTopic.addSubjectIdentifier(sid); - } - for(Locator slo: topic.getSubjectLocators()) { - targetTopic.addSubjectLocator(slo); - } - _copyItemIdentifiers(topic, targetTopic); - } - - /** - * Copies the types from the <tt>topic</tt> to the <tt>targetTopic</tt>. - * - * @param topic The topic to take the types from. - * @param targetTopic The topic which receives the types. - * @param mergeMap The map which holds the merge mappings. - */ - private static void _copyTypes(Topic topic, Topic targetTopic, - Map<Topic, Topic> mergeMap) { - for (Topic type: topic.getTypes()) { - Topic targetType = mergeMap.get(type); - if (targetType == null) { - targetType = _copyTopic(type, (ITopicMap) targetTopic.getTopicMap(), mergeMap); - } - targetTopic.addType(targetType); - } - } - - /** - * Copies the occurrences and names from <tt>topic</tt> to the - * <tt>targetTopic</tt>. - * - * @param topic The topic to take the characteristics from. - * @param targetTopic The target topic which gets the charateristics. - * @param mergeMap The map which holds the merge mappings. - */ - private static void _copyCharacteristics(Topic topic, TopicImpl targetTopic, - Map<Topic, Topic> mergeMap) { - IIntObjectMap<Reifiable> sigs = CollectionFactory.createIntObjectMap(); - for (Occurrence occ: targetTopic.getOccurrences()) { - sigs.put(SignatureGenerator.generateSignature(occ), occ); - } - Reifiable existing = null; - final TopicMap tm = targetTopic.getTopicMap(); - Topic type = null; - Set<Topic> scope = null; - Occurrence targetOcc = null; - for (Occurrence occ: topic.getOccurrences()) { - type = _copyType(occ, tm, mergeMap); - scope = _copyScope(occ, tm, mergeMap); - targetOcc = targetTopic._createOccurrence(type, ((ILiteralAware) occ).getLiteral(), scope); - existing = sigs.get(SignatureGenerator.generateSignature(targetOcc)); - if (existing != null) { - targetOcc.remove(); - targetOcc = (Occurrence)existing; - } - _copyReifier(occ, targetOcc, mergeMap); - _copyItemIdentifiers(occ, targetOcc); - } - sigs.clear(); - for (Name name: targetTopic.getNames()) { - sigs.put(SignatureGenerator.generateSignature(name), name); - } - - for (Name name: topic.getNames()) { - type = _copyType(name, tm, mergeMap); - scope = _copyScope(name, tm, mergeMap); - Name targetName = targetTopic._createName(type, ((ILiteralAware) name).getLiteral(), scope); - existing = sigs.get(SignatureGenerator.generateSignature(targetName)); - if (existing != null) { - targetName.remove(); - targetName = (Name) existing; - } - _copyReifier(name, targetName, mergeMap); - _copyItemIdentifiers(name, targetName); - _copyVariants(name, (NameImpl)targetName, mergeMap); - } - } - - /** - * Copies the variants from <tt>source</tt> to the <tt>target</tt>. - * - * @param source The name to take the variants from. - * @param target The target name which receives the variants. - * @param mergeMap The map which holds the merge mappings. - */ - private static void _copyVariants(Name source, NameImpl target, - Map<Topic, Topic> mergeMap) { - IIntObjectMap<Variant> sigs = CollectionFactory.createIntObjectMap(); - for (Variant variant: target.getVariants()) { - sigs.put(SignatureGenerator.generateSignature(variant), variant); - } - final TopicMap tm = target.getTopicMap(); - Variant existing = null; - Set<Topic> scope = null; - for (Variant variant: source.getVariants()) { - scope = _copyScope( variant, tm, mergeMap); - Variant targetVar = target._createVariant(((ILiteralAware) variant).getLiteral(), scope); - existing = sigs.get(SignatureGenerator.generateSignature(targetVar)); - if (existing != null) { - targetVar.remove(); - targetVar = existing; - } - _copyReifier(variant, targetVar, mergeMap); - _copyItemIdentifiers(variant, targetVar); - } - } - - /** - * Copies the reifier of <tt>source</tt> (if any) to the <tt>target</tt>. - * - * @param source The reifiable Topic Maps construct to take the reifier from. - * @param target The target Topic Maps construct. - * @param mergeMap The map which holds the merge mappings. - */ - private static void _copyReifier(Reifiable source, Reifiable target, - Map<Topic, Topic> mergeMap) { - Topic sourceReifier = source.getReifier(); - if (sourceReifier == null) { - return; - } - Topic reifier = mergeMap.containsKey(sourceReifier) ? mergeMap.get(sourceReifier) - : _copyTopic(sourceReifier, (ITopicMap) target.getTopicMap(), mergeMap); - target.setReifier(reifier); - } - - /** - * Copies the type of the <tt>source</tt> (if any) to the <tt>target</tt>. - * - * @param source The Topic Maps construct to take the type from. - * @param target The Topic Maps construct which receives the type. - * @param mergeMap The map which holds the merge mappings. - */ - private static Topic _copyType(Typed source, TopicMap tm, - Map<Topic, Topic> mergeMap) { - Topic sourceType = source.getType(); - return mergeMap.containsKey(sourceType) ? mergeMap.get(sourceType) - : _copyTopic(sourceType, (ITopicMap) tm, mergeMap); - } - - /** - * Copies all themes from the <tt>source</tt> scoped Topic Maps construct - * to the <tt>target</tt>. - * - * @param source The source to take the scope from. - * @param target The target which receives the scope. - * @param mergeMap The map which holds the merge mappings. - */ - private static Set<Topic>_copyScope(Scoped source, TopicMap tm, - Map<Topic, Topic> mergeMap) { - Set<Topic> themes = CollectionFactory.createIdentitySet(source.getScope().size()); - Topic theme = null; - for (Topic sourceTheme: source.getScope()) { - theme = mergeMap.containsKey(sourceTheme) ? mergeMap.get(sourceTheme) - : _copyTopic(sourceTheme, (ITopicMap) tm, mergeMap); - themes.add(theme); - } - return themes; - } - - /** - * Copies the item identifiers from <tt>source</tt> to <tt>target</tt>. - * - * @param source The source Topic Maps construct. - * @param target The target Topic Maps construct. - */ - private static void _copyItemIdentifiers(Construct source, Construct target) { - for(Locator iid: source.getItemIdentifiers()) { - target.addItemIdentifier(iid); - } - } - - /** - * Copies the associations from the <tt>source</tt> topic map to the - * <tt>target</tt> topic map. - * - * @param source The topic map to take the associations from. - * @param target The topic map which receives the associations. - * @param mergeMap The map which holds the merge mappings. - */ - private static void _copyAssociations(TopicMap source, - TopicMap target, Map<Topic, Topic> mergeMap) { - Set<Association> assocs = target.getAssociations(); - IIntObjectMap<Association> sigs = CollectionFactory.createIntObjectMap(assocs.size()); - for (Association assoc: assocs) { - sigs.put(SignatureGenerator.generateSignature(assoc), assoc); - } - Association existing = null; - Topic type = null; - Set<Topic> scope = null; - for (Association assoc: source.getAssociations()) { - type = _copyType(assoc, target, mergeMap); - scope = _copyScope(assoc, target, mergeMap); - Association targetAssoc = target.createAssociation(type, scope); - for (Role role: assoc.getRoles()) { - Role targetRole = targetAssoc.createRole(role.getType(), role.getPlayer()); - _copyItemIdentifiers(role, targetRole); - _copyReifier(role, targetRole, mergeMap); - } - existing = sigs.get(SignatureGenerator.generateSignature(targetAssoc)); - if (existing != null) { - MergeUtils.moveRoleCharacteristics(targetAssoc, existing); - targetAssoc.remove(); - targetAssoc = existing; - } - _copyReifier(assoc, targetAssoc, mergeMap); - _copyItemIdentifiers(assoc, targetAssoc); - } - } - - /** - * Adds a mapping from <tt>source</tt> to <tt>target</tt> into the - * <tt>mergeMap</tt>. - * - * If <tt>source</tt> has already a mapping to another target topic, - * <tt>target</tt> is merged with the existing target topic. - * - * @param source The source topic. - * @param target The target topic. - * @param mergeMap The map which holds the merge mappings. - */ - private static void _addMerge(Topic source, Topic target, Map<Topic, Topic> mergeMap) { - Topic prevTarget = mergeMap.get(source); - if (prevTarget != null) { - if (!prevTarget.equals(target)) { - MergeUtils.merge(target, prevTarget); - } - } - else { - mergeMap.put(source, target); - } - } - -} Modified: tinytim/trunk/src/main/java/org/tinytim/core/DatatypeAwareConstruct.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/core/DatatypeAwareConstruct.java 2008-11-12 15:26:11 UTC (rev 179) +++ tinytim/trunk/src/main/java/org/tinytim/core/DatatypeAwareConstruct.java 2008-11-13 13:19:39 UTC (rev 180) @@ -18,8 +18,15 @@ import java.math.BigDecimal; import java.math.BigInteger; +import org.tinytim.core.value.Literal; +import org.tinytim.internal.api.Event; +import org.tinytim.internal.api.ILiteral; +import org.tinytim.internal.api.ILiteralAware; +import org.tinytim.internal.api.IScope; +import org.tinytim.internal.api.ITopicMap; import org.tinytim.internal.utils.Check; import org.tinytim.voc.XSD; + import org.tmapi.core.DatatypeAware; import org.tmapi.core.Locator; import org.tmapi.core.Topic; Deleted: tinytim/trunk/src/main/java/org/tinytim/core/DecimalLiteral.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/core/DecimalLiteral.java 2008-11-12 15:26:11 UTC (rev 179) +++ tinytim/trunk/src/main/java/org/tinytim/core/DecimalLiteral.java 2008-11-13 13:19:39 UTC (rev 180) @@ -1,110 +0,0 @@ -/* - * Copyright 2008 Lars Heuer (heuer[at]semagia.com) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.tinytim.core; - -import java.math.BigDecimal; -import java.math.BigInteger; - -import org.tinytim.voc.XSD; -import org.tmapi.core.Locator; - -/** - * - * - * @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a> - * @version $Rev:$ - $Date:$ - */ -final class DecimalLiteral implements ILiteral { - - private final BigDecimal _decimal; - private final String _lexicalForm; - - public DecimalLiteral(BigDecimal decimal) { - _decimal = decimal; - _lexicalForm = LiteralNormalizer.normalizeDecimal(decimal.toPlainString()); - } - - public DecimalLiteral(String value) { - _lexicalForm = LiteralNormalizer.normalizeDecimal(value); - _decimal = new BigDecimal(_lexicalForm); - } - - /* (non-Javadoc) - * @see org.tinytim.core.ILiteral#decimalValue() - */ - public BigDecimal decimalValue() { - return _decimal; - } - - /* (non-Javadoc) - * @see org.tinytim.core.ILiteral#floatValue() - */ - public float floatValue() { - return _decimal.floatValue(); - } - - /* (non-Javadoc) - * @see org.tinytim.core.ILiteral#getDatatype() - */ - public Locator getDatatype() { - return XSD.DECIMAL; - } - - /* (non-Javadoc) - * @see org.tinytim.core.ILiteral#getValue() - */ - public String getValue() { - return _lexicalForm; - } - - /* (non-Javadoc) - * @see org.tinytim.core.ILiteral#intValue() - */ - public int intValue() { - return _decimal.intValue(); - } - - /* (non-Javadoc) - * @see org.tinytim.core.ILiteral#integerValue() - */ - public BigInteger integerValue() { - return _decimal.toBigInteger(); - } - - /* (non-Javadoc) - * @see org.tinytim.core.ILiteral#longValue() - */ - public long longValue() { - return _decimal.longValue(); - } - - /* (non-Javadoc) - * @see java.lang.Object#hashCode() - */ - @Override - public int hashCode() { - return _decimal.hashCode(); - } - - /* (non-Javadoc) - * @see java.lang.Object#equals(java.lang.Object) - */ - @Override - public boolean equals(Object obj) { - return this == obj || (obj instanceof DecimalLiteral) && ((DecimalLiteral) obj)._lexicalForm.equals(_lexicalForm); - } - -} Deleted: tinytim/trunk/src/main/java/org/tinytim/core/Event.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/core/Event.java 2008-11-12 15:26:11 UTC (rev 179) +++ tinytim/trunk/src/main/java/org/tinytim/core/Event.java 2008-11-13 13:19:39 UTC (rev 180) @@ -1,158 +0,0 @@ -/* - * Copyright 2008 Lars Heuer (heuer[at]semagia.com) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.tinytim.core; - -/** - * Event constants. - * <p> - * All events are sent before a change happens. This allows to check - * some constraints. - * </p> - * <p> - * This class is not meant to be used outside of the tinyTiM package. - * </p> - * - * @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a> - * @version $Rev$ - $Date$ - */ -public enum Event { - - /** - * Notification that a topic should be added. - */ - ADD_TOPIC, - /** - * Notification that a topic should be removed. - */ - REMOVE_TOPIC, - /** - * Notification that an association should be added. - */ - ADD_ASSOCIATION, - /** - * Notification that an association should be removed. - */ - REMOVE_ASSOCIATION, - /** - * Notification that a role should be added. - */ - ADD_ROLE, - /** - * Notification that a role should be removed. - */ - REMOVE_ROLE, - /** - * Notification that an occurrence should be added. - */ - ADD_OCCURRENCE, - /** - * Notification that an occurrence should be removed. - */ - REMOVE_OCCURRENCE, - /** - * Notification that a name should be added. - */ - ADD_NAME, - /** - * Notification that a name should be removed. - */ - REMOVE_NAME, - /** - * Notification that a variant should be added. - */ - ADD_VARIANT, - /** - * Notification that a variant should be removed. - */ - REMOVE_VARIANT, - - - /** - * Notification that a subject identifier should be added. - */ - ADD_SID, - /** - * Notification that a subject identifier should be removed. - */ - REMOVE_SID, - /** - * Notification that a subject locator should be added. - */ - ADD_SLO, - /** - * Notification that a subject locator should be removed. - */ - REMOVE_SLO, - /** - * Notification that an item identifier should be added. - */ - ADD_IID, - /** - * Notification that an item identifier should be removed. - */ - REMOVE_IID, - - /** - * Notification that a type should be added to a topic. - */ - ADD_TYPE, - /** - * Notification that a type should be removed from a topic. - */ - REMOVE_TYPE, - /** - * Notification that the type of a {@link ITyped} construct should be set. - */ - SET_TYPE, - - /** - * Notification that the scope is changed. - */ - SET_SCOPE, - - /** - * Notification that the player of a role should be set. - */ - SET_PLAYER, - - /** - * Notification that the reifier of a {@link IReifiable} construct - * should be set. - */ - SET_REIFIER, - - /** - * Notification that the literal value of a name, an occurrence or variant - * should be set. - */ - SET_LITERAL, - - /** - * Notification that an occurrence should be moved from one topic to another. - */ - MOVED_OCCURRENCE, - /** - * Notification that a name should be moved from one topic to another. - */ - MOVED_NAME, - /** - * Notification that a variant should be moved from one name to another. - */ - MOVED_VARIANT, - - ATTACHED_NAME, DETACHED_NAME, ATTACHED_OCCURRENCE, DETACHED_OCCURRENCE, - -} Deleted: tinytim/trunk/src/main/java/org/tinytim/core/IConstant.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/core/IConstant.java 2008-11-12 15:26:11 UTC (rev 179) +++ tinytim/trunk/src/main/java/org/tinytim/core/IConstant.java 2008-11-13 13:19:39 UTC (rev 180) @@ -1,107 +0,0 @@ -/* - * Copyright 2008 Lars Heuer (heuer[at]semagia.com) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.tinytim.core; - -/** - * Provides constants. - * - * This interface is not meant to be used outside of the tinyTiM package. - * - * @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a> - * @version $Rev$ - $Date$ - */ -interface IConstant { - /** - * Initial size of the {@link MemoryTopicMap} topic set - */ - public static final int TM_TOPIC_SIZE = 100; - /** - * Initial size of the {@link MemoryTopicMap} association set - */ - public static final int TM_ASSOCIATION_SIZE = 100; - /** - * Initial size of the {@link ConstructImpl} item identifier set. - */ - public static final int CONSTRUCT_IID_SIZE = 4; - /** - * Initial size of the {@link TopicImpl} subject identifier set. - */ - public static final int TOPIC_SID_SIZE = 4; - /** - * Initial size of the {@link TopicImpl} subject locator set. - */ - public static final int TOPIC_SLO_SIZE = 2; - /** - * Initial size of the {@link TopicImpl} types set. - */ - public static final int TOPIC_TYPE_SIZE = 2; - /** - * Initial size of the {@link TopicImpl} name set. - */ - public static final int TOPIC_NAME_SIZE = 2; - /** - * Initial size of the {@link TopicImpl} occurrence set. - */ - public static final int TOPIC_OCCURRENCE_SIZE = 2; - /** - * Initial size of the {@link TopicImpl} roles-played set. - */ - public static final int TOPIC_ROLE_SIZE = 2; - /** - * Initial size of the {@link AssociationImpl} roles set. - */ - public static final int ASSOC_ROLE_SIZE = 2; - /** - * Initial size of the {@link NameImpl} variants set. - */ - public static final int NAME_VARIANT_SIZE = 2; - /** - * Initial size of the {@link IdentityManager} id->construct map. - */ - public static final int IDENTITY_ID2CONSTRUCT_SIZE = 200; - /** - * Initial size of the {@link IdentityManager} item identifier->construct map. - */ - public static final int IDENTITY_IID2CONSTRUCT_SIZE = 50; - /** - * Initial size of the {@link IdentityManager} subject identifier->topic map. - */ - public static final int IDENTITY_SID2TOPIC_SIZE = 50; - /** - * Initial size of the {@link IdentityManager} subject locator -> topic map. - */ - public static final int IDENTITY_SLO2TOPIC_SIZE = 20; - /** - * Initial size of the {@link Literal}'s IRI registry. - */ - public static final int LITERAL_IRI_SIZE = 100; - /** - * Initial size of the {@link Literal}'s String registry. - */ - public static final int LITERAL_STRING_SIZE = 50; - /** - * Initial size of the {@link Literal}'s literal (!= String/IRI) registry. - */ - public static final int LITERAL_OTHER_SIZE = 50; - /** - * Initial size of the {@link Scope}'s scope registry. - */ - public static final int SCOPE_SCOPES_SIZE = 10; - /** - * Initial size of the {@link MemoryTopicMapSystem} topic map map. - */ - public static final int SYSTEM_TM_SIZE = 4; -} Deleted: tinytim/trunk/src/main/java/org/tinytim/core/IConstruct.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/core/IConstruct.java 2008-11-12 15:26:11 UTC (rev 179) +++ tinytim/trunk/src/main/java/org/tinytim/core/IConstruct.java 2008-11-13 13:19:39 UTC (rev 180) @@ -1,83 +0,0 @@ -/* - * Copyright 2008 Lars Heuer (heuer[at]semagia.com) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.tinytim.core; - -import org.tmapi.core.Construct; - -/** - * Enhancement of the {@link org.tmapi.core.Construct} interface. - * <p> - * Avoids <tt>foo instanceof Bar</tt> checks. Each construct knows its type. - * </p> - * <p> - * This interface is not meant to be used outside of the tinyTiM package. - * </p> - * - * @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a> - * @version $Rev$ - $Date$ - */ -public interface IConstruct extends Construct { - - /** - * Returns <tt>true</tt> if this is a topic map. - * - * @return <tt>true</tt> if this is a topic map, <tt>false</tt> otherwise. - */ - public boolean isTopicMap(); - - /** - * Returns <tt>true</tt> if this is a topic. - * - * @return <tt>true</tt> if this is a topic, <tt>false</tt> otherwise. - */ - public boolean isTopic(); - - /** - * Returns <tt>true</tt> if this is an association. - * - * @return <tt>true</tt> if this is an association, <tt>false</tt> otherwise. - */ - public boolean isAssociation(); - - /** - * Returns <tt>true</tt> if this is a role. - * - * @return <tt>true</tt> if this is a role, <tt>false</tt> otherwise. - */ - public boolean isRole(); - - /** - * Returns <tt>true</tt> if this is an occurrence. - * - * @return <tt>true</tt> if this is an occurrence, <tt>false</tt> otherwise. - */ - public boolean isOccurrence(); - - /** - * Returns <tt>true</tt> if this is a name. - * - * @return <tt>true</tt> if this is a name, <tt>false</tt> otherwise. - */ - public boolean isName(); - - /** - * Returns <tt>true</tt> if this is a variant. - * - * @return <tt>true</tt> if this is a variant, <tt>false</tt> otherwise. - */ - public boolean isVariant(); - -} Deleted: tinytim/trunk/src/main/java/org/tinytim/core/IEventHandler.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/core/IEventHandler.java 2008-11-12 15:26:11 UTC (rev 179) +++ tinytim/trunk/src/main/java/org/tinytim/core/IEventHandler.java 2008-11-13 13:19:39 UTC (rev 180) @@ -1,43 +0,0 @@ -/* - * Copyright 2008 Lars Heuer (heuer[at]semagia.com) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.tinytim.core; - -/** - * Event handler that is able to handle Topic Maps events. - * <p> - * This interface is not meant to be used outside of the tinyTiM package. - * </p> - * - * @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a> - * @version $Rev$ - $Date$ - */ -public interface IEventHandler { - - /** - * Callback method if a {@link IEventPublisher} sends an event to which - * this handler is subscribed to. - * - * @param evt The event. - * @param sender The sender of the event (this is not necessarily the - * publisher). - * @param oldValue The old value or <code>null</code> if the old value - * is not available or was <code>null</code>. - * @param newValue The new value or <code>null</code> if the new value - * is not available or should become <code>null</code>. - */ - public void handleEvent(Event evt, IConstruct sender, Object oldValue, Object newValue); - -} Deleted: tinytim/trunk/src/main/java/org/tinytim/core/IEventPublisher.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/core/IEventPublisher.java 2008-11-12 15:26:11 UTC (rev 179) +++ tinytim/trunk/src/main/java/org/tinytim/core/IEventPublisher.java 2008-11-13 13:19:39 UTC (rev 180) @@ -1,45 +0,0 @@ -/* - * Copyright 2008 Lars Heuer (heuer[at]semagia.com) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.tinytim.core; - -/** - * Publisher for Topic Maps events. - * <p> - * This interface is not meant to be used outside of the tinyTiM package. - * </p> - * - * @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a> - * @version $Rev$ - $Date$ - */ -public interface IEventPublisher { - - /** - * Subscribes the handler for the specified event. - * - * @param event The event of interesst. - * @param handler The event handler. - */ - public void subscribe(Event event, IEventHandler handler); - - /** - * Removes the handler from the publisher. - * - * @param event The event. - * @param handler The event handler. - */ - public void unsubscribe(Event event, IEventHandler handler); - -} Deleted: tinytim/trunk/src/main/java/org/tinytim/core/IEventPublisherAware.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/core/IEventPublisherAware.java 2008-11-12 15:26:11 UTC (rev 179) +++ tinytim/trunk/src/main/java/org/tinytim/core/IEventPublisherAware.java 2008-11-13 13:19:39 UTC (rev 180) @@ -1,48 +0,0 @@ -/* - * Copyright 2008 Lars Heuer (heuer[at]semagia.com) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.tinytim.core; - -/** - * Something that subscribes and unsubscribes itself to an - * {org.tinytim.core.IEventPublisher}. - * <p> - * Implementations MUST have a default (public) constructor. - * </p> - * - * @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a> - * @version $Rev:$ - $Date:$ - */ -public interface IEventPublisherAware { - - /** - * Subscribes this instance to the specified <tt>publisher</tt>. - * - * @param publisher An event publisher. - */ - public void subscribe(IEventPublisher publisher); - - /** - * Unsubscribes this instance from the specified <tt>publisher</tt>. - * <p> - * This method is only invoked if this instance has been subscribed to - * the <tt>publisher</tt>. - * </p> - * - * @param publisher The publisher to unsubscribe from. - */ - public void unsubscribe(IEventPublisher publisher); - -} Deleted: tinytim/trunk/src/main/java/org/tinytim/core/IIndexManagerAware.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/core/IIndexManagerAware.java 2008-11-12 15:26:11 UTC (rev 179) +++ tinytim/trunk/src/main/java/org/tinytim/core/IIndexManagerAware.java 2008-11-13 13:19:39 UTC (rev 180) @@ -1,30 +0,0 @@ -/* - * Copyright 2008 Lars Heuer (heuer[at]semagia.com) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.tinytim.core; - -import org.tinytim.index.IIndexManager; - -/** - * - * - * @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a> - * @version $Rev:$ - $Date:$ - */ -public interface IIndexManagerAware { - - IIndexManager getIndexManager(); - -} Deleted: tinytim/trunk/src/main/java/org/tinytim/core/ILiteral.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/core/ILiteral.java 2008-11-12 15:26:11 UTC (rev 179) +++ tinytim/trunk/src/main/java/org/tinytim/core/ILiteral.java 2008-11-13 13:19:39 UTC (rev 180) @@ -1,83 +0,0 @@ -/* - * Copyright 2008 Lars Heuer (heuer[at]semagia.com) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.tinytim.core; - -import java.math.BigDecimal; -import java.math.BigInteger; - -import org.tmapi.core.Locator; - -/** - * Represents an immutable value with a datatype. - * <p> - * This interface is not meant to be used outside of the tinyTiM package. - * </p> - * - * @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a> - * @version $Rev$ - $Date$ - */ -public interface ILiteral { - - /** - * Returns the string value. - * - * @return The string value. - */ - public String getValue(); - - /** - * Returns the datatype. - * - * @return The datatype. - */ - public Locator getDatatype(); - - /** - * Returns the BigDecimal value. - * - * @return BigDecimal value. - */ - public BigDecimal decimalValue(); - - /** - * Returns the float value. - * - * @return Float value. - */ - public float floatValue(); - - /** - * Returns the BigInteger value. - * - * @return BigInteger value. - */ - public BigInteger integerValue(); - - /** - * Returns the int value. - * - * @return Int value. - */ - public int intValue(); - - /** - * Returns the long value. - * - * @return Long value. - */ - public long longValue(); - -} Deleted: tinytim/trunk/src/main/java/org/tinytim/core/ILiteralAware.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/core/ILiteralAware.java 2008-11-12 15:26:11 UTC (rev 179) +++ tinytim/trunk/src/main/java/org/tinytim/core/ILiteralAware.java 2008-11-13 13:19:39 UTC (rev 180) @@ -1,43 +0,0 @@ -/* - * Copyright 2008 Lars Heuer (heuer[at]semagia.com) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.tinytim.core; - -/** - * Indicates that a literal can be attached to a construct. - * <p> - * This interface is not meant to be used outside of the tinyTiM package. - * </p> - * - * @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a> - * @version $Rev$ - $Date$ - */ -public interface ILiteralAware { - - /** - * Returns the literal. - * - * @return The literal. - */ - public ILiteral getLiteral(); - - /** - * Sets the literal. - * - * @param literal The literal. - */ - public void setLiteral(ILiteral literal); - -} Deleted: tinytim/trunk/src/main/java/org/tinytim/core/ILocator.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/core/ILocator.java 2008-11-12 15:26:11 UTC (rev 179) +++ tinytim/trunk/src/main/java/org/tinytim/core/ILocator.java 2008-11-13 13:19:39 UTC (rev 180) @@ -1,32 +0,0 @@ -/* - * Copyright 2008 Lars Heuer (heuer[at]semagia.com) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.tinytim.core; - -import org.tmapi.core.Locator; - -/** - * Marker interface which unifies the {@link org.tmapi.core.Locator} and - * tinyTiM's {@link ILiteral}. - * <p> - * This interface is not meant to be used outside of the tinyTiM package. - * </p> - * - * @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a> - * @version $Rev$ - $Date$ - */ -public interface ILocator extends ILiteral, Locator { - -} Deleted: tinytim/trunk/src/main/java/org/tinytim/core/IMovable.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/core/IMovable.java 2008-11-12 15:26:11 UTC (rev 179) +++ tinytim/trunk/src/main/java/org/tinytim/core/IMovable.java 2008-11-13 13:19:39 UTC (rev 180) @@ -1,39 +0,0 @@ -/* - * Copyright 2008 Lars Heuer (heuer[at]semagia.com) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.tinytim.core; - -import org.tmapi.core.Construct; - -/** - * Indicates that a Topic Maps construct is able to be detached from the - * current parent and attached to another parent. - * <p> - * This interface is not meant to be used outside of the tinyTiM package. - * </p> - * - * @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a> - * @version $Rev$ - $Date$ - */ -interface IMovable<T extends Construct> { - - /** - * Moves this Topic Maps construct to the new parent. - * - * @param newParent The parent to move this construct to. - */ - public void moveTo(T newParent); - -} Deleted: tinytim/trunk/src/main/java/org/tinytim/core/IScope.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/core/IScope.java 2008-11-12 15:26:11 UTC (rev 179) +++ tinytim/trunk/src/main/java/org/tinytim/core/IScope.java 2008-11-13 13:19:39 UTC (rev 180) @@ -1,92 +0,0 @@ -/* - * Copyright 2008 Lars Heuer (heuer[at]semagia.com) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.tinytim.core; - -import java.util.Collection; -import java.util.Set; - -import org.tmapi.core.Topic; - -/** - * Represents an immutable set of {@link org.tmapi.core.Topic}s. - * <p> - * This interface is not meant to be used outside of the tinyTiM package. - * </p> - * - * @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a> - * @version $Rev$ - $Date$ - */ -public interface IScope extends Iterable<Topic> { - - /** - * Returns the scope as set of topics. - * - * @return A set of topics. - */ - public Set<Topic> asSet(); - - /** - * Returns <tt>true</tt> if the theme is part of this scope. - * - * @param theme A topic. - * @return <tt>true</tt> if the theme is part of this scope, otherwise <tt>false</tt>. - */ - public boolean contains(Topic theme); - - /** - * Returns <tt>true</tt> if all themes of the other <tt>scope</tt> are part - * of this scope. - * - * @param scope A collection of themes. - * @return <tt>true</tt> if all themes are part of this scope, otherwise <tt>false</tt>. - */ - public boolean containsAll(Collection<Topic> scope); - - /** - * Returns a <tt>IScope</tt> consisting of all themes contained in this - * scope and the <tt>theme</tt>. - * - * @param theme The theme to add. - * @return A scope instance which is contains all themes of this scope plus - * the specified <tt>theme</tt>. - */ - public IScope add(Topic theme); - - /** - * Returns a <tt>IScope</tt> where the <tt>theme</tt> is removed from this - * set of themes.. - * - * @param theme The theme to remove. - * @return A scope instance which is contains all themes of this scope minus - * the specified <tt>theme</tt>. - */ - public IScope remove(Topic theme); - - /** - * Returns if this scope is unconstrained (empty). - * - * @return <tt>true</tt> if the scope is unconstrained, <tt>false</tt> otherwise. - */ - public boolean isUnconstrained(); - - /** - * Returns the number of themes contained in this scope. - * - * @return Number of themes. - */ - public int size(); - -} Deleted: tinytim/trunk/src/main/java/org/tinytim/core/IScoped.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/core/IScoped.java 2008-11-12 15:26:11 UTC (rev 179) +++ tinytim/trunk/src/main/java/org/tinytim/core/IScoped.java 2008-11-13 13:19:39 UTC (rev 180) @@ -1,46 +0,0 @@ -/* - * Copyright 2008 Lars Heuer (heuer[at]semagia.com) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.tinytim.core; - -import org.tmapi.core.Scoped; - -/** - * Enhancement of the {@link org.tmapi.core.Scoped} interface which is - * {@link IScope} aware. - * <p> - * This interface is not meant to be used outside of the tinyTiM package. - * </p> - * - * @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a> - * @version $Rev$ - $Date$ - */ -public interface IScoped extends Scoped, IConstruct { - - /** - * Returns the scope. - * - * @return The scope. - */ - public IScope getScopeObject(); - - /** - * Sets the scope. - * - * @param scope The scope. - */ - public void setScopeObject(IScope scope); - -} Deleted: tinytim/trunk/src/main/ja... [truncated message content] |