Interface Table<K extends Comparable<? super K>,R extends Row<K,?>>
- All Superinterfaces:
Collection<R>
,Iterable<R>
-
Method Summary
Modifier and TypeMethodDescriptiondefault boolean
default boolean
addAll
(Collection<? extends R> c) default K
canonicalize
(K key) Gets the canonical key used for internal indexing.default void
clear()
default void
Clears the caches for this table that apply to the current thread.default boolean
default boolean
containsAll
(Collection<?> c) Gets the row with the provided key.Iterates the rows in sorted order.getMap()
Gets a map view of this table.getModel()
Gets the model this table is part of.default String
getName()
Gets the table name.getOrderedRows
(Iterable<? extends K> keys) Gets an unmodifiable set of each object corresponding to the set of keys.getRows()
Gets all rows, sorted by their natural ordering.Gets an unmodifiable sorted set of each object corresponding to the set of keys, sorted by their natural ordering.default int
getSize()
Gets the number of accessible rows in this table.Gets a sorted map view of this table.Gets all rows in no particular order.default boolean
isEmpty()
iterator()
Iterates the rows in sorted order.default boolean
default boolean
removeAll
(Collection<?> c) default boolean
retainAll
(Collection<?> c) default int
size()
default void
Called after the table is updated to ensure cache integrity.default Object[]
toArray()
default <T> T[]
toArray
(T[] a) Methods inherited from interface java.util.Collection
equals, hashCode, parallelStream, removeIf, spliterator, stream, toArray
-
Method Details
-
getModel
Model getModel()Gets the model this table is part of. -
clearCaches
default void clearCaches()Clears the caches for this table that apply to the current thread. This is used to end a caching session, generally short-term and associated with a single request or process.Any overriding method should call super.clearCaches().
-
tableUpdated
default void tableUpdated()Called after the table is updated to ensure cache integrity. Cache coherency is maintained between users for global tables. For per-user caches only your own view is affected; no updates will be seen until the end of their caching transaction, generally a web request.Any overriding method should call super.tableUpdated().
-
clear
default void clear()- Specified by:
clear
in interfaceCollection<K extends Comparable<? super K>>
-
retainAll
- Specified by:
retainAll
in interfaceCollection<K extends Comparable<? super K>>
-
removeAll
- Specified by:
removeAll
in interfaceCollection<K extends Comparable<? super K>>
-
addAll
- Specified by:
addAll
in interfaceCollection<K extends Comparable<? super K>>
-
containsAll
- Specified by:
containsAll
in interfaceCollection<K extends Comparable<? super K>>
-
remove
- Specified by:
remove
in interfaceCollection<K extends Comparable<? super K>>
-
add
- Specified by:
add
in interfaceCollection<K extends Comparable<? super K>>
-
toArray
default <T> T[] toArray(T[] a) - Specified by:
toArray
in interfaceCollection<K extends Comparable<? super K>>
-
toArray
- Specified by:
toArray
in interfaceCollection<K extends Comparable<? super K>>
-
contains
- Specified by:
contains
in interfaceCollection<K extends Comparable<? super K>>
-
isEmpty
default boolean isEmpty()- Specified by:
isEmpty
in interfaceCollection<K extends Comparable<? super K>>
-
getSize
Gets the number of accessible rows in this table. This also provides JavaBeans-compatible size.- Throws:
SQLException
-
size
default int size()- Specified by:
size
in interfaceCollection<K extends Comparable<? super K>>
-
getIterator
Iterates the rows in sorted order. This also provides JavaBeans-compatible iterator.- Throws:
SQLException
- See Also:
-
iterator
Iterates the rows in sorted order.- Specified by:
iterator
in interfaceCollection<K extends Comparable<? super K>>
- Specified by:
iterator
in interfaceIterable<K extends Comparable<? super K>>
- See Also:
-
getMap
Gets a map view of this table. -
getSortedMap
Gets a sorted map view of this table. -
getName
Gets the table name. -
getUnsortedRows
Gets all rows in no particular order.This is an unmodifiable snapshot of the data and will not change over time. It may be iterated multiple times with the same results. The contents are not changed by the transactions of the current user or any other user.
- Throws:
SQLException
-
getRows
Gets all rows, sorted by their natural ordering.This is an unmodifiable snapshot of the data and will not change over time. It may be iterated multiple times with the same results. The contents are not changed by the transactions of the current user or any other user.
- Throws:
SQLException
-
canonicalize
Gets the canonical key used for internal indexing. In the case of case- insensitive matching, the key may have upper-case and lower-case matches, while the canonicalKey will convert to one format for matching. Any matches are performed on the canonical form the the query. -
get
Gets the row with the provided key.- Throws:
NoRowException
- if not foundSQLException
- if database error occurs
-
getOrderedRows
default Set<? extends R> getOrderedRows(Iterable<? extends K> keys) throws NoRowException, SQLException Gets an unmodifiable set of each object corresponding to the set of keys. The elements will be in the set in the same order as the keys iterator. If a key is found twice, the element we be in the position of the first key.This is an unmodifiable snapshot of the data and will not change over time. It may be iterated multiple times with the same results. The contents are not changed by the transactions of the current user or any other user.
- Throws:
NoRowException
- if any key is not foundSQLException
- if database error occurs
-
getRows
default SortedSet<? extends R> getRows(Iterable<? extends K> keys) throws NoRowException, SQLException Gets an unmodifiable sorted set of each object corresponding to the set of keys, sorted by their natural ordering.This is an unmodifiable snapshot of the data and will not change over time. It may be iterated multiple times with the same results. The contents are not changed by the transactions of the current user or any other user.
- Throws:
NoRowException
- if any key is not foundSQLException
- if database error occurs
-