package org.helioviewer.jhv.plugins.eveplugin.radio.data;

/**
 * @author bramb
 * 
 */
public class FrequencyInterval {

    private int start;
    private int end;

    public static final FrequencyInterval ALL = new FrequencyInterval(Integer.MIN_VALUE, Integer.MAX_VALUE);

    public FrequencyInterval() {
        this.start = 0;
        this.end = 0;
    }

    public FrequencyInterval(int start, int end) {
        this.start = start;
        this.end = end;
    }

    public int getStart() {
        return start;
    }

    public void setStart(int start) {
        this.start = start;
    }

    public int getEnd() {
        return end;
    }

    public void setEnd(int end) {
        this.end = end;
    }

    @Override
    public boolean equals(Object o) {
        if (!(o instanceof FrequencyInterval)) {
            return false;
        }
        FrequencyInterval interval = (FrequencyInterval) o;
        return interval.getStart() == start && interval.getEnd() == end;
    }

    @Override
    public int hashCode() {
        assert false : "hashCode not designed";
        return 42;
    }

    public boolean overlaps(FrequencyInterval otherInterval) {
        return !(this.getStart() > otherInterval.getEnd() || this.getEnd() < otherInterval.getStart());
    }

    public int squeeze(int element) {
         if (element >= start && element <= end) {
             return element;
         }else{
             if (element < start) {
                 return start;
             }else{
                 return end;
             }
         }
    }

    public boolean containsInclusive(int value) {
        return value >= start || value <= end;
    }

}

@@ -79,10 +79,9 @@
 b%0A *
- 
 %0A
+
  */%0A
@@ -302,37 +302,32 @@
 val() %7B%0A        
-this.
 start = 0;%0A     
@@ -325,29 +325,24 @@
  0;%0A        
-this.
 end = 0;%0A   
@@ -1070,20 +1070,16 @@
 igned%22;%0A
-    
     retu
@@ -1085,16 +1085,16 @@
 urn 42;%0A
+
     %7D%0A%0A 
@@ -1304,33 +1304,32 @@
 ment) %7B%0A        
- 
 if (element %3E= s
@@ -1358,33 +1358,32 @@
 ) %7B%0A            
- 
 return element;%0A
@@ -1386,33 +1386,33 @@
 nt;%0A        
- 
 %7D
+ 
 else
+ 
 %7B%0A
- 
             
@@ -1430,25 +1430,24 @@
  %3C start) %7B%0A
- 
             
@@ -1480,17 +1480,17 @@
     
- 
 %7D
+ 
 else
+ 
 %7B%0A
- 
     
@@ -1521,28 +1521,26 @@
             
- 
 %7D%0A
- 
         %7D%0A  
@@ -1648,10 +1648,109 @@
 %0A    %7D%0A%0A
+    @Override%0A    public String toString() %7B%0A        return %22%5B%22 + start + %22, %22 + end + %22%5D%22;%0A%0A    %7D%0A
 %7D%0A

Add testing