KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > SOFA > SOFAnode > Made > CDL > DetectedConnectors


1 /* $Id: DetectedConnectors.java,v 1.2 2004/05/20 14:23:51 bures Exp $ */
2 package SOFA.SOFAnode.Made.CDL;
3
4 public class DetectedConnectors extends java.util.ArrayList JavaDoc {
5   public DetectedConnector getConn(int i) { return (DetectedConnector) get(i); }
6
7   public DetectedConnector containsConnWithCRole(CompBindOper cR) {
8     DetectedConnector ret;
9     for (int i=0; i<size(); i++) {
10       ret = getConn(i);
11
12       if (ret.containsSameCRole(cR)) {
13         return ret;
14       }
15     }
16     return null;
17   }
18
19   public DetectedConnector containsConnWithSRole(CompBindOper sR) {
20     DetectedConnector ret;
21     for (int i=0; i<size(); i++) {
22       ret = getConn(i);
23
24       if (ret.containsSameSRole(sR)) {
25         return ret;
26       }
27     }
28     return null;
29   }
30
31   /** Returns number of connectors with "bind" mode. */
32   public int numOfBind() {
33     int ret = 0;
34     for (int i=0; i<size(); i++) {
35       if (getConn(i).bindMode == CompBind.m_bind)
36        ret++;
37     }
38     return ret;
39   }
40 }
41
Popular Tags