Class AuthorityCodes
- All Implemented Interfaces:
Serializable,Iterable<String>,Collection<String>,Set<String>
A set of EPSG authority codes. This set requires a living connection to the EPSG database. All
iterator()
method call creates a new ResultSet holding the codes. However, call to contains(java.lang.Object) map directly to a
SQL call.
Serialization of this class store a copy of all authority codes. The serialization do not preserve any connection to the database.
- Since:
- 2.2
- Author:
- Martin Desruisseaux (IRD)
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAuthorityCodes(TableInfo table, Class<?> type, DirectEpsgFactory factory) Creates a new set of authority codes for the specified type. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturnstrueif this collection contains the specified element.protected voidfinalize()Closes the underlying statements.booleanisEmpty()Returnstrueif this collection contains no elements.iterator()Returns an iterator over the codes.intsize()Count the number of elements in the underlying result set.Methods inherited from class AbstractSet
equals, hashCode, removeAllMethods inherited from class AbstractCollection
add, addAll, clear, containsAll, remove, retainAll, toArray, toArray, toStringMethods inherited from interface Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface Set
add, addAll, clear, containsAll, remove, retainAll, spliterator, toArray, toArray
-
Field Details
-
type
The type for this code set. This is translated to the most appropriate interface type even if the user supplied an implementation type.
-
-
Constructor Details
-
AuthorityCodes
Creates a new set of authority codes for the specified type.- Parameters:
table- The table to query.type- The type to query.factory- The factory originator.
-
-
Method Details
-
isEmpty
public boolean isEmpty()Returnstrueif this collection contains no elements. This method fetch at most one row instead of counting all rows.- Specified by:
isEmptyin interfaceCollection<String>- Specified by:
isEmptyin interfaceSet<String>- Overrides:
isEmptyin classAbstractCollection<String>
-
size
public int size()Count the number of elements in the underlying result set.- Specified by:
sizein interfaceCollection<String>- Specified by:
sizein interfaceSet<String>- Specified by:
sizein classAbstractCollection<String>
-
contains
Returnstrueif this collection contains the specified element.- Specified by:
containsin interfaceCollection<String>- Specified by:
containsin interfaceSet<String>- Overrides:
containsin classAbstractCollection<String>
-
iterator
Returns an iterator over the codes. The iterator is backed by a livingResultSet, which will be closed as soon as the iterator reach the last element. -
finalize
Closes the underlying statements. Note: this method is also invoked directly byDirectEpsgFactory.dispose(), which is okay in this particular case since the implementation of this method can be executed an arbitrary amount of times.- Overrides:
finalizein classObject- Throws:
SQLException
-