java.lang.Object
org.newsclub.net.unix.CloseablePair<T>
- Type Parameters:
T- The type of the items.
- All Implemented Interfaces:
Closeable,AutoCloseable
- Direct Known Subclasses:
AFSocketPair
A pair of two closeable items.
- Author:
- Christian Kohlschütter
-
Constructor Summary
ConstructorsConstructorDescriptionCloseablePair(T a, T b) Creates a pair of two items.CloseablePair(T a, T b, Closeable alsoClose) Creates a pair of two items. -
Method Summary
-
Constructor Details
-
CloseablePair
Creates a pair of two items.- Parameters:
a- The first item.b- The second item.
-
CloseablePair
Creates a pair of two items.- Parameters:
a- The first item.b- The second item.alsoClose- Some closeable that is also closed uponclose(), ornull.
-
-
Method Details
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
getFirst
Returns the pair's first item.- Returns:
- The first item.
-
getSecond
Returns the pair's second item.- Returns:
- The second item.
-