Changeset 3395


Ignore:
Timestamp:
11/21/07 13:17:55 (12 years ago)
Author:
melissa
Message:

Added new IFormatReader API method - "IFormatReader[] getUnderlyingReaders()".

Location:
trunk/loci/formats
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/loci/formats/FileStitcher.java

    r3359 r3395  
    717717  } 
    718718 
     719  /* @see IFormatReader#getUnderlyingReaders() */ 
     720  public IFormatReader[] getUnderlyingReaders() { 
     721    return readers; 
     722  } 
     723 
    719724  // -- IFormatHandler API methods -- 
    720725 
  • trunk/loci/formats/FormatReader.java

    r3357 r3395  
    645645  } 
    646646 
     647  /* @see IFormatReader#getUnderlyingReaders() */ 
     648  public IFormatReader[] getUnderlyingReaders() { 
     649    return null; 
     650  } 
     651 
    647652  // -- IFormatHandler API methods -- 
    648653 
  • trunk/loci/formats/FormatTools.java

    r3392 r3395  
    465465  } 
    466466 
     467  // -- Utility methods -- other 
     468 
     469  /** 
     470   * Recursively look for the first underlying reader that is an 
     471   * instance of the given class. 
     472   */ 
     473  public static IFormatReader getReader(IFormatReader r, Class c) { 
     474    IFormatReader[] underlying = r.getUnderlyingReaders(); 
     475    if (underlying != null) { 
     476      for (int i=0; i<underlying.length; i++) { 
     477        if (underlying[i].getClass().equals(c)) return underlying[i]; 
     478      } 
     479      for (int i=0; i<underlying.length; i++) { 
     480        IFormatReader t = getReader(underlying[i], c); 
     481        if (t != null) return t; 
     482      } 
     483    } 
     484    return null; 
     485  } 
     486 
    467487} 
  • trunk/loci/formats/IFormatReader.java

    r3357 r3395  
    361361  Object getMetadataStoreRoot(); 
    362362 
     363  /** 
     364   * Retrieves all underlying readers.  Returns null if there are no underlying 
     365   * readers. 
     366   */ 
     367  IFormatReader[] getUnderlyingReaders(); 
     368 
    363369  // -- Deprecated API methods -- 
    364370 
  • trunk/loci/formats/ImageReader.java

    r3357 r3395  
    519519  } 
    520520 
     521  /* @see IFormatReader#getUnderlyingReaders() */ 
     522  public IFormatReader[] getUnderlyingReaders() { 
     523    return getReaders(); 
     524  } 
     525 
    521526  // -- IFormatHandler API methods -- 
    522527 
  • trunk/loci/formats/ReaderWrapper.java

    r3358 r3395  
    312312  } 
    313313 
     314  public IFormatReader[] getUnderlyingReaders() { 
     315    return new IFormatReader[] {reader}; 
     316  } 
     317 
    314318  // -- IFormatHandler API methods -- 
    315319 
Note: See TracChangeset for help on using the changeset viewer.