Class Iterables
- java.lang.Object
-
- org.jquantlib.lang.iterators.Iterables
-
public class Iterables extends java.lang.ObjectThis class contains a static factory methods intended to createIterableobjects backed by different data structures.The documentation for the methods contained in this class includes briefs description of the implementations. Such descriptions should be regarded as implementation notes, rather than parts of the specification. Implementors should feel free to substitute other algorithms, so long as the specification itself is adhered to. (For example, the algorithm used by a certain method can be changed, but must satisfy the requirements stated in the documentation.)
-
-
Constructor Summary
Constructors Constructor and Description Iterables()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static <T> java.lang.Iterable<T>unmodifiableIterable(java.util.Enumeration<T> en)Returns an unmodifiable view of the specifiedEnumeration.static <T> java.lang.Iterable<T>unmodifiableIterable(java.util.Iterator<T> it)Returns an unmodifiable view of the specifiedIterator.static <T> java.lang.Iterable<T>unmodifiableIterable(java.util.List<T> list)Returns an unmodifiable view of the specifiedList.static <T> java.lang.Iterable<T>unmodifiableIterable(java.util.Set<T> set)Returns an unmodifiable view of the specifiedSet.
-
-
-
Method Detail
-
unmodifiableIterable
public static <T> java.lang.Iterable<T> unmodifiableIterable(java.util.Enumeration<T> en)
Returns an unmodifiable view of the specifiedEnumeration.This method allows modules to provide users with "read-only" access to internal enumerations. Query operations on the returned list "read through" to the specified Enumeration, and attempts to modify the returned Enumeration, whether direct or via its iterator, result in an UnsupportedOperationException.
- Type Parameters:
T- is the type of elements in the specified Enumeration- Parameters:
en- is an Enumeration- Returns:
- an Iterable
-
unmodifiableIterable
public static <T> java.lang.Iterable<T> unmodifiableIterable(java.util.Iterator<T> it)
Returns an unmodifiable view of the specifiedIterator.This method allows modules to provide users with "read-only" access to internal iterators. Query operations on the returned list "read through" to the specified Iterator, and attempts to modify the returned Iterator, result in an UnsupportedOperationException.
- Type Parameters:
T- is the type of elements in the specified Iterator- Parameters:
en- is an Iterator- Returns:
- an Iterable
-
unmodifiableIterable
public static <T> java.lang.Iterable<T> unmodifiableIterable(java.util.List<T> list)
Returns an unmodifiable view of the specifiedList.This method allows modules to provide users with "read-only" access to internal enumerations. Query operations on the returned list "read through" to the specified List, and attempts to modify the returned List, whether direct or via its iterator, result in an UnsupportedOperationException.
- Type Parameters:
T- is the type of elements in the specified List- Parameters:
en- is an List- Returns:
- an Iterable
-
unmodifiableIterable
public static <T> java.lang.Iterable<T> unmodifiableIterable(java.util.Set<T> set)
Returns an unmodifiable view of the specifiedSet.This method allows modules to provide users with "read-only" access to internal enumerations. Query operations on the returned list "read through" to the specified Set, and attempts to modify the returned Set, whether direct or via its iterator, result in an UnsupportedOperationException.
- Type Parameters:
T- is the type of elements in the specified Set- Parameters:
en- is an Set- Returns:
- an Iterable
-
-
DataMelt 3.0 © DataMelt by jWork.ORG