@@ -44,47 +44,6 @@ public enum GranuleField {
4444 TARGET , INS_MODE , NIGHT ;
4545 }
4646
47- public final static Matcher <Granule > MATCHER_LIKE = new Matcher <Granule >() {
48-
49- @ Override
50- public boolean match (final Granule pattern , final Granule candidate ) {
51- if (pattern == candidate ) {
52- return true ;
53- }
54- if ((pattern .getTarget () != null ) && (candidate .getTarget () != null )) {
55- if (!pattern .getTarget ().equals (candidate .getTarget ())) {
56- return false ;
57- }
58- }
59- if ((pattern .getInsMode () != null ) && (candidate .getInsMode () != null )) {
60- if (!pattern .getInsMode ().equals (candidate .getInsMode ())) {
61- return false ;
62- }
63- }
64- if ((pattern .getNight () != null ) && (candidate .getNight () != null )) {
65- if (!pattern .getNight ().equals (candidate .getNight ())) {
66- return false ;
67- }
68- }
69- if (pattern .hasDistinctStaNames () && candidate .hasDistinctStaNames ()) {
70- if (!Granule .match (pattern .getDistinctStaNames (), candidate .getDistinctStaNames ())) {
71- return false ;
72- }
73- }
74- if (pattern .hasDistinctMjdRanges () && candidate .hasDistinctMjdRanges ()) {
75- if (!Range .matchRanges (pattern .getDistinctMjdRanges (), candidate .getDistinctMjdRanges ())) {
76- return false ;
77- }
78- }
79- if (pattern .hasDistinctWavelengthRanges () && (candidate .getInsMode () != null )) {
80- if (!Range .matchRange (pattern .getDistinctWavelengthRanges (), candidate .getInsMode ().getWavelengthRange ())) {
81- return false ;
82- }
83- }
84- return true ;
85- }
86- };
87-
8847 /* members */
8948 private Target target ;
9049 private InstrumentMode insMode ;
@@ -94,8 +53,6 @@ public boolean match(final Granule pattern, final Granule candidate) {
9453 private Set <String > distinctStaNames = null ;
9554 /** distinct MJD values */
9655 private Set <Range > distinctMjdRanges = null ;
97- /** distinct Wavelength values */
98- private Set <Range > distinctWavelengthRanges = null ;
9956
10057 public Granule () {
10158 this (null , null , null );
@@ -171,7 +128,7 @@ public boolean equals(Object obj) {
171128
172129 public boolean isEmpty () {
173130 return (this .target == null ) && (this .insMode == null ) && (this .night == null )
174- && !hasDistinctStaNames () && !hasDistinctMjdRanges () && ! hasDistinctWavelengthRanges () ;
131+ && !hasDistinctStaNames () && !hasDistinctMjdRanges ();
175132 }
176133
177134 /* extra information (filters) */
@@ -197,23 +154,11 @@ public Set<Range> getDistinctMjdRanges() {
197154 return distinctMjdRanges ;
198155 }
199156
200- public boolean hasDistinctWavelengthRanges () {
201- return (distinctWavelengthRanges != null ) && !distinctWavelengthRanges .isEmpty ();
202- }
203-
204- public Set <Range > getDistinctWavelengthRanges () {
205- if (distinctWavelengthRanges == null ) {
206- distinctWavelengthRanges = new LinkedHashSet <Range >();
207- }
208- return distinctWavelengthRanges ;
209- }
210-
211157 @ Override
212158 public String toString () {
213159 return "Granule{" + "target=" + target + ", insMode=" + insMode + ", night=" + night
214160 + ", distinctStaNames=" + distinctStaNames
215161 + ", distinctMjdRanges=" + distinctMjdRanges
216- + ", distinctWavelengthRanges=" + distinctWavelengthRanges
217162 + '}' ;
218163 }
219164
@@ -231,13 +176,4 @@ public static <K> List<K> getSortedDistinctGranuleField(final Collection<Granule
231176 Collections .sort (sorted , GranuleComparator .getComparator (field ));
232177 return sorted ;
233178 }
234-
235- public static boolean match (final Set <String > selected , final Set <String > candidates ) {
236- for (String sel : selected ) {
237- if (candidates .contains (sel )) {
238- return true ;
239- }
240- }
241- return false ;
242- }
243179}
0 commit comments