-
-
- /** compare if two DasSources are identical
- *
- */
- public boolean equals(DasSource other){
-
- if ( this == other)
- return true;
-
- if ( ( other == null) || (other.getClass() != this.getClass()))
- return false;
-
- // to compare if two Das2Sources are identical we do the following:
- // we check the capabilities
-
- Das2SourceImpl d2o = (Das2SourceImpl)other;
-
- if ( nickname.equals(d2o.getNickname()))
- return true;
-
- Das2Capability[] othercaps = d2o.getDas2Capabilities();
-
- if ( ! (capabilities.length == othercaps.length))
- return false;
-
- for ( int x=0;x<capabilities.length;x++){
- Das2Capability tmpcap = capabilities[x];
- boolean foundCap = false;
- for (int y=0; y< othercaps.length;y++){
- Das2Capability tmpcapo = othercaps[y];
- if ( tmpcap.equals(tmpcapo))
- foundCap = true;
- }
- if ( ! foundCap)
- return false;
- }
-
-
- //TODO?
- // should we add a check for coordinate systems?
- // but we already check for the endpoints, that should be enough...
-
- return true;
-