]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.spreadsheet/src/org/simantics/spreadsheet/Range.java
Adopt spreadsheet changes made in Balas development
[simantics/platform.git] / bundles / org.simantics.spreadsheet / src / org / simantics / spreadsheet / Range.java
index 3c9d4b87e4d6bd62cf949e6371489f7351fd3122..b4a31c316f65a794614ec197e93a7172401472d3 100644 (file)
@@ -13,26 +13,26 @@ package org.simantics.spreadsheet;
 
 
 public class Range {
-       public static final int MAXROWSPEC = Integer.MAX_VALUE;//1048576;//
-       public static final int MAXCOLUMNSPEC = Integer.MAX_VALUE;//16384;//
-       
+    public static final int MAXROWSPEC = Integer.MAX_VALUE;//1048576;//
+    public static final int MAXCOLUMNSPEC = Integer.MAX_VALUE;//16384;//
+
     public int startRow;
     public int endRow;
     public int startColumn;
     public int endColumn;
-    
+
     public Range(int startRow, int endRow, int startColumn, int endColumn) {
         this.startRow = startRow;
         this.endRow = endRow;
         this.startColumn = startColumn;
         this.endColumn = endColumn;
-        
+
         if(startRow == -1) this.startRow = MAXROWSPEC;
-       if(endRow == -1) this.endRow = MAXROWSPEC;
-       if(startColumn == -1) this.startColumn = MAXCOLUMNSPEC;
-       if(endColumn == -1) this.endColumn = MAXCOLUMNSPEC;
+        if(endRow == -1) this.endRow = MAXROWSPEC;
+        if(startColumn == -1) this.startColumn = MAXCOLUMNSPEC;
+        if(endColumn == -1) this.endColumn = MAXCOLUMNSPEC;
     }
-    
+
     public Range(Range copy) {
         this.startRow = copy.startRow;
         this.endRow = copy.endRow;
@@ -43,46 +43,46 @@ public class Range {
     public static Range combine(Range from, Range to) {
         return new Range(from.startRow, to.endRow, from.startColumn, to.endColumn);
     }
-    
+
     public boolean isFull() {
-       return endRow == MAXROWSPEC && endColumn == MAXCOLUMNSPEC;
+        return endRow == MAXROWSPEC && endColumn == MAXCOLUMNSPEC;
     }
 
     public boolean isFullRows() {
-       return endRow == MAXROWSPEC;
+        return endRow == MAXROWSPEC;
     }
 
     public boolean isFullColumns() {
-       return endColumn == MAXCOLUMNSPEC;
+        return endColumn == MAXCOLUMNSPEC;
     }
 
     public int size() {
         return (endRow-startRow + 1) * (endColumn - startColumn + 1);
     }
-    
+
     public int width() {
-       return (endColumn - startColumn + 1);
+        return (endColumn - startColumn + 1);
     }
-    
+
     public int height() {
-       return (endRow-startRow + 1);
+        return (endRow-startRow + 1);
     }
-    
+
     public boolean contains(Range r) {
-       if(endRow >= 0) {
-               if(r.endRow > endRow) return false;
-               if(r.startRow < startRow) return false;
-       }
-       if(endColumn >= 0) {
-               if(r.startColumn < startColumn) return false;
-               if(r.endColumn > endColumn) return false;
-       }
-       return true;
+        if(endRow >= 0) {
+            if(r.endRow > endRow) return false;
+            if(r.startRow < startRow) return false;
+        }
+        if(endColumn >= 0) {
+            if(r.startColumn < startColumn) return false;
+            if(r.endColumn > endColumn) return false;
+        }
+        return true;
     }
-    
+
     @Override
     public String toString() {
         return "Range[(" + startRow + "," + startColumn + ")-(" + endRow + "," + endColumn + ")]";
     }
-    
+
 }