ui/src/main/java/ucar/nc2/ui/gis/shapefile/EsriShapefileRenderer.java
static public EsriShapefileRenderer factory(String filename) {
    if (sfileHash == null)
      sfileHash = new HashMap<String, EsriShapefileRenderer>();

    if (sfileHash.containsKey(filename))
      return sfileHash.get(filename);

    try {
      EsriShapefileRenderer sfile = new EsriShapefileRenderer(filename);
      sfileHash.put(filename, sfile);
      return sfile;
    } catch (Exception ex) {
      //System.err.println("EsriShapefileRenderer failed on " + filename + "\n" + ex);
      //ex.printStackTrace();
      return null;
    }
  }
static public EsriShapefileRenderer factory(String filename) {
    if (sfileHash == null)
      sfileHash = new HashMap<String, EsriShapefileRenderer>();

    if (sfileHash.containsKey(filename))
      return sfileHash.get(filename);

    try {
      EsriShapefileRenderer sfile = new EsriShapefileRenderer(filename);
      sfileHash.put(filename, sfile);
      return sfile;
    } catch (Exception ex) {
      //System.err.println("EsriShapefileRenderer failed on " + filename + "\n" + ex);
      //ex.printStackTrace();
      return null;
    }
  }
static public EsriShapefileRenderer factory ( String filename ) { if ( sfileHash == null ) sfileHash = new HashMap < String , EsriShapefileRenderer > ( ) ; if ( sfileHash . containsKey ( filename ) ) return sfileHash . get ( filename ) ; try { EsriShapefileRenderer sfile = new EsriShapefileRenderer ( filename ) ; sfileHash . put ( filename , sfile ) ; return sfile ; } catch ( Exception ex ) { //System.err.println("EsriShapefileRenderer failed on " + filename + "\n" + ex);
 //ex.printStackTrace();
 return null ; } }
Use factory to obtain a EsriShapefileRenderer.  This caches the EsriShapefile for reuse.
<p/>
Implementation note: should switch to weak references.
Use factory to obtain a EsriShapefileRenderer . This caches the EsriShapefile for reuse . <p / > Implementation note : should switch to weak references .