Package uk.ac.starlink.fits
Class BasicInputThreadLocal
- java.lang.Object
-
- java.lang.ThreadLocal<BasicInput>
-
- uk.ac.starlink.fits.BasicInputThreadLocal
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
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
- Author:
- Mark Taylor
-
-
Constructor Summary
Constructors Constructor Description BasicInputThreadLocal(InputFactory inputFact, boolean isSeq)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()protected BasicInputinitialValue()
-
-
-
Constructor Detail
-
BasicInputThreadLocal
public BasicInputThreadLocal(InputFactory inputFact, boolean isSeq)
Constructor.- Parameters:
inputFact- factory for BasicInput objectsisSeq- true if created inputs are sequential, false for random
-
-
Method Detail
-
initialValue
protected BasicInput initialValue()
- Overrides:
initialValuein classjava.lang.ThreadLocal<BasicInput>
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable
-
-