X-Git-Url: http://wamblee.org/gitweb/?a=blobdiff_plain;f=system%2Fgeneral%2Fsrc%2Fmain%2Fjava%2Forg%2Fwamblee%2Fsystem%2Fgraph%2Fcomponent%2FConnectRequiredProvidedEdgeFilter.java;h=4984b7d805942a07c2a65fae5a5a2258a38dc199;hb=7042aa5a7068951276ee78396030937e490d0b48;hp=bb6b1343631d04b39c7e611ddafec1ee9519ea82;hpb=f4d446b84fa1a38ed83cd157f79fdb8233822145;p=utils diff --git a/system/general/src/main/java/org/wamblee/system/graph/component/ConnectRequiredProvidedEdgeFilter.java b/system/general/src/main/java/org/wamblee/system/graph/component/ConnectRequiredProvidedEdgeFilter.java index bb6b1343..4984b7d8 100644 --- a/system/general/src/main/java/org/wamblee/system/graph/component/ConnectRequiredProvidedEdgeFilter.java +++ b/system/general/src/main/java/org/wamblee/system/graph/component/ConnectRequiredProvidedEdgeFilter.java @@ -1,12 +1,12 @@ /* - * Copyright 2008 the original author or authors. - * + * Copyright 2005-2010 the original author or authors. + * * 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. @@ -18,48 +18,31 @@ package org.wamblee.system.graph.component; import org.wamblee.system.graph.Edge; import org.wamblee.system.graph.EdgeFilter; - /** - * Filter used to explicitly connect required and provided interfaces - * within a container. - * + * Filter used to explicitly connect required and provided interfaces within a + * container. + * * @author Erik Brakkee */ public class ConnectRequiredProvidedEdgeFilter implements EdgeFilter { - /** - * DOCUMENT ME! - */ private String client; - /** - * DOCUMENT ME! - */ private String required; - /** - * DOCUMENT ME! - */ private String server; - /** - * DOCUMENT ME! - */ private String provided; /** * Creates a new ConnectRequiredProvidedEdgeFilter object. - * - * @param aClient DOCUMENT ME! - * @param aRequired DOCUMENT ME! - * @param aServer DOCUMENT ME! - * @param aProvided DOCUMENT ME! + * */ public ConnectRequiredProvidedEdgeFilter(String aClient, String aRequired, String aServer, String aProvided) { - client = aClient; - required = aRequired; - server = aServer; - provided = aProvided; + client = aClient; + required = aRequired; + server = aServer; + provided = aProvided; if (client == null) { throw new IllegalArgumentException( @@ -67,17 +50,10 @@ public class ConnectRequiredProvidedEdgeFilter implements EdgeFilter { } } - /** - * DOCUMENT ME! - * - * @param aEdge DOCUMENT ME! - * - * @return DOCUMENT ME! - */ @Override public boolean isViolated(Edge aEdge) { - if (aEdge.getFrom() instanceof RequiredInterfaceNode - && aEdge.getTo() instanceof ProvidedInterfaceNode) { + if (aEdge.getFrom() instanceof RequiredInterfaceNode && + aEdge.getTo() instanceof ProvidedInterfaceNode) { return isViolated((RequiredInterfaceNode) aEdge.getFrom(), (ProvidedInterfaceNode) aEdge.getTo()); } @@ -85,36 +61,26 @@ public class ConnectRequiredProvidedEdgeFilter implements EdgeFilter { return false; } - /** - * DOCUMENT ME! - * - * @param aFrom DOCUMENT ME! - * @param aTo DOCUMENT ME! - * - * @return DOCUMENT ME! - */ private boolean isViolated(RequiredInterfaceNode aFrom, ProvidedInterfaceNode aTo) { - if (client.equals(aFrom.getComponent().getName()) - && ((required == null) - || required.equals(aFrom.getRequired().getName()))) { + if (client.equals(aFrom.getComponent().getName()) && + ((required == null) || required.equals(aFrom.getRequired() + .getName()))) { // From part matches. if (server == null) { return true; // all connections are eliminated } - if (server.equals(aTo.getComponent().getName()) - && ((provided == null) - || provided.equals(aTo.getProvided().getName()))) { + if (server.equals(aTo.getComponent().getName()) && + ((provided == null) || provided.equals(aTo.getProvided() + .getName()))) { // to part matches also return false; - } else { - // From matches and to doesn't so edgefilter is violated. - return true; } - } else { - // From part does not match, restriction does not apply. - return false; + // From matches and to doesn't so edgefilter is violated. + return true; } + // From part does not match, restriction does not apply. + return false; } }