/** * INTERNAL: Assign the given scopes to the specified scoped topic map * construct. */ private void setScopes(ScopedIF object, Collection<TopicIF> scopes) { if (scopes != null) { for (TopicIF scope : scopes) { object.addTheme(scope); } } }
protected void propagateThemes(ScopedIF scoped) { if (propagated_themes != null) { for (TopicIF scope : propagated_themes) { scoped.addTheme(scope); } } }
private void addScope(final ScopedIF obj) { for(TopicIF theme: scope) { obj.addTheme(theme); } }
protected void addScope(ScopedIF scoped, Collection<TopicIF> scope) { for (TopicIF theme : scope) scoped.addTheme(theme); }
private void addScope(ScopedIF scoped) { Iterator it = scope.iterator(); while (it.hasNext()) scoped.addTheme((TopicIF) it.next()); scope = null; }
private static void addScope(ScopedIF scoped, Collection<TopicIF> scope) { Iterator<TopicIF> it = scope.iterator(); while (it.hasNext()) scoped.addTheme(it.next()); }
protected void addScope(ScopedIF scoped, Collection scope) { if (!scope.isEmpty()) { Iterator iter = scope.iterator(); while (iter.hasNext()) { scoped.addTheme((TopicIF)iter.next()); } } }
private static <S extends ScopedIF> void replaceTopicInScope(Collection<S> objects, TopicIF t1, TopicIF t2) { Iterator<S> it = objects.iterator(); while (it.hasNext()) { S object = it.next(); object.removeTheme(t2); object.addTheme(t1); } }
public void addScope(ScopedIF scoped) { if (!translated) resolveScope(); Iterator it = scope.iterator(); while (it.hasNext()) scoped.addTheme((TopicIF) it.next()); }
private static void copyScope(ScopedIF target, ScopedIF source) { Iterator<TopicIF> it = source.getScope().iterator(); while (it.hasNext()) target.addTheme(it.next()); }
/** * INTERNAL: Adds the specified scope to the scoped construct. * * @param scoped * The scoped construct. * @param scope * The scope, must not be <tt>null</tt>. */ private void applyScope(ScopedIF scoped, Topic... scope) { for (Topic theme : scope) { scoped.addTheme(topicMap.unwrapTopic(theme)); } }
private static void copyScope(ScopedIF target, ScopedIF source) { Iterator<TopicIF> it = source.getScope().iterator(); while (it.hasNext()) target.addTheme(copyTopic(target.getTopicMap(), it.next())); }
private static void copyScope(ScopedIF target, ScopedIF source, Map<TopicIF, TopicIF> mergemap) { Iterator<TopicIF> it = source.getScope().iterator(); while (it.hasNext()) { TopicIF replacement = it.next(); target.addTheme(resolveTopic(target.getTopicMap(), replacement, mergemap)); } }
public void add(ScopedIF scoped, Topic scope) { scoped.addTheme( topic.resolve(scoped.getTopicMap(), scope) ); }
protected static void addScope(ScopedIF scoped, String[] scope, Entity entity, String[] tuple, Context ctx) { // TODO: should really remove any existing scope for (int i = 0; i < scope.length; i++) { TopicIF theme = Utils.getTopic(scope[i], ctx); if (theme != null) scoped.addTheme(theme); else throw new DB2TMInputException("Scoping topic not found", entity, tuple, scope[i]); } }
protected static void addScope(ScopedIF scoped, String[] scope, Entity entity, String[] tuple, Context ctx) { // TODO: should really remove any existing scope for (int i = 0; i < scope.length; i++) { TopicIF theme = Utils.getTopic(scope[i], ctx); if (theme != null) scoped.addTheme(theme); else throw new DB2TMInputException("Scoping topic not found", entity, tuple, scope[i]); } }
public void setScope(ScopedIF scoped, Collection<Topic> scope) { if (scope != null) { Collection<TopicIF> newScope = new HashSet<>(scope.size()); for (Topic t : scope) { TopicIF resolved = topic.resolve(scoped.getTopicMap(), t); newScope.add(resolved); scoped.addTheme(resolved); } for (TopicIF remove : CollectionUtils.subtract(scoped.getScope(), newScope)) { scoped.removeTheme(remove); } } }
public void perform(ActionParametersIF params, ActionResponseIF response) { //test params ActionSignature paramsType = ActionSignature.getSignature("baov"); paramsType.validateArguments(params, this); ScopedIF scoped = (ScopedIF) params.get(0); TopicIF theme = (TopicIF) params.getTMObjectValue(); if (theme == null) throw new ActionRuntimeException("No topic ID given to AddTheme action"); scoped.addTheme(theme); }
@Override public void addTheme(Topic theme) { Check.themeNotNull(this, theme); Check.scopeInTopicMap(getTopicMap(), theme); ((ScopedIF) getWrapped()).addTheme(topicMap.unwrapTopic(theme)); }
protected void scopedTest(ScopedIF scoped) { LocatorIF loc = base.resolveAbsolute("#theme-1"); TopicIF theme = (TopicIF)tm.getObjectByItemIdentifier(loc); assertTrue("getScope (type check)", scoped.getScope() instanceof java.util.Collection); int scope_count = scoped.getScope().size(); scoped.addTheme(theme); assertTrue("getScope (size check after add)", scoped.getScope().size() == scope_count + 1); scoped.removeTheme(theme); assertTrue("getScope (size check after remove)", scoped.getScope().size() == scope_count); }