uk.ac.starlink.fits
Class BasicInputThreadLocal

java.lang.Object
  extended by java.lang.ThreadLocal<BasicInput>
      extended by uk.ac.starlink.fits.BasicInputThreadLocal
All Implemented Interfaces:
java.io.Closeable

public class BasicInputThreadLocal
extends java.lang.ThreadLocal<BasicInput>
implements java.io.Closeable

ThreadLocal based on an InputFactory. This can dispense a BasicInput object private to the current thread. The close method will close all the BasicInput objects that this has created so far.

Since:
30 Jun 2017

Constructor Summary
BasicInputThreadLocal(InputFactory inputFact, boolean isSeq)
          Constructor.
 
Method Summary
 void close()
           
protected  BasicInput initialValue()
           
 
Methods inherited from class java.lang.ThreadLocal
get, remove, set
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicInputThreadLocal

public BasicInputThreadLocal(InputFactory inputFact,
                             boolean isSeq)
Constructor.

Parameters:
inputFact - factory for BasicInput objects
isSeq - true if created inputs are sequential, false for random
Method Detail

initialValue

protected BasicInput initialValue()
Overrides:
initialValue in class java.lang.ThreadLocal<BasicInput>

close

public void close()
Specified by:
close in interface java.io.Closeable