Changeset 2947 for trunk


Ignore:
Timestamp:
07/10/07 08:59:20 (13 years ago)
Author:
curtis
Message:

Eliminate superfluous Utils class.

Location:
trunk/loci/formats/cache
Files:
1 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/loci/formats/cache/CacheStrategy.java

    r2871 r2947  
    1818  protected int[] lengths; 
    1919 
     20  // -- Constructor -- 
     21 
    2022  public CacheStrategy(boolean forwardFirst, int[] lengths,  
    2123    int[] forward, int[] backward)  
     
    2729    priorities = new int[lengths.length]; 
    2830  } 
     31 
     32  // -- Abstract ICacheStrategy API methods -- 
     33 
     34  /* @see ICacheStrategy#getLoadList(int[]) */ 
     35  public abstract int[][] getLoadList(int[] pos) throws CacheException;  
    2936 
    3037  // -- ICacheStrategy API methods -- 
     
    6572  public int[] getLengths() { return lengths; } 
    6673 
    67   /* @see ICacheStrategy#getLoadList(int[]) */ 
    68   public abstract int[][] getLoadList(int[] pos) throws CacheException;  
     74  // -- Utility methods -- 
     75 
     76  public static int nextPriority(int ndx, int[] priorities) { 
     77    int basePriority = priorities[ndx]; 
     78    for (int i=0; i<priorities.length; i++) { 
     79      if (priorities[i] >= basePriority && i != ndx) { 
     80        if (!(priorities[i] == basePriority && i < ndx)) {  
     81          return i; 
     82        }  
     83      } 
     84    } 
     85    return -1;  
     86  } 
    6987 
    7088} 
  • trunk/loci/formats/cache/strategies/CrosshairStrategy.java

    r2866 r2947  
    55package loci.formats.cache.strategies; 
    66 
     7import java.util.Arrays; 
    78import java.util.Vector; 
    89import loci.formats.cache.*; 
     
    5455      positions =  
    5556        increment(positions, firstNdx, begins[firstNdx], ends[firstNdx]); 
    56       if (Utils.equals(positions, pos)) { 
    57         firstNdx = Utils.nextPriority(firstNdx, priorities);  
     57      if (Arrays.equals(positions, pos)) { 
     58        firstNdx = nextPriority(firstNdx, priorities);  
    5859      } 
    5960 
  • trunk/loci/formats/cache/strategies/RectangleStrategy.java

    r2866 r2947  
    55package loci.formats.cache.strategies; 
    66 
     7import java.util.Arrays; 
    78import java.util.Vector; 
    89import loci.formats.cache.*; 
     
    6061      list.add(tmp); 
    6162      positions = increment(positions, firstNdx); 
    62       if (Utils.equals(positions, pos)) { 
    63         firstNdx = Utils.nextPriority(firstNdx, priorities); 
     63      if (Arrays.equals(positions, pos)) { 
     64        firstNdx = nextPriority(firstNdx, priorities); 
    6465      } 
    6566      if (firstNdx == -1) { 
     
    8283      if (pos[ndx] > ends[ndx]) { 
    8384        pos[ndx] = begins[ndx]; 
    84         return increment(pos, Utils.nextPriority(ndx, priorities)); 
     85        return increment(pos, nextPriority(ndx, priorities)); 
    8586      } 
    8687    } 
     
    9091      if (pos[ndx] < begins[ndx]) { 
    9192        pos[ndx] = ends[ndx]; 
    92         return increment(pos, Utils.nextPriority(ndx, priorities)); 
     93        return increment(pos, nextPriority(ndx, priorities)); 
    9394      } 
    9495    } 
Note: See TracChangeset for help on using the changeset viewer.