Package com.google.common.collect
Class StandardRowSortedTable<R,C,V>
- java.lang.Object
-
- com.google.common.collect.AbstractTable<R,C,V>
-
- com.google.common.collect.StandardTable<R,C,V>
-
- com.google.common.collect.StandardRowSortedTable<R,C,V>
-
- All Implemented Interfaces:
RowSortedTable<R,C,V>,Table<R,C,V>,java.io.Serializable
- Direct Known Subclasses:
TreeBasedTable
class StandardRowSortedTable<R,C,V> extends StandardTable<R,C,V> implements RowSortedTable<R,C,V>
Implementation ofTablewhose iteration ordering across row keys is sorted by their natural ordering or by a supplied comparator. Note that iterations across the columns keys for a single row key may or may not be ordered, depending on the implementation. When rows and columns are both sorted, it's easier to use theTreeBasedTablesubclass.The
rowKeySet()method returns aSortedSetand therowMap()method returns aSortedMap, instead of theSetandMapspecified by theTableinterface.Null keys and values are not supported.
See the
StandardTablesuperclass for more information about the behavior of this class.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classStandardRowSortedTable.RowSortedMap-
Nested classes/interfaces inherited from class com.google.common.collect.StandardTable
StandardTable.Row, StandardTable.RowMap
-
Nested classes/interfaces inherited from class com.google.common.collect.AbstractTable
AbstractTable.CellSet, AbstractTable.Values
-
Nested classes/interfaces inherited from interface com.google.common.collect.Table
Table.Cell<R,C,V>
-
-
Field Summary
Fields Modifier and Type Field Description private static longserialVersionUID-
Fields inherited from class com.google.common.collect.StandardTable
backingMap, factory
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) java.util.SortedMap<R,java.util.Map<C,V>>createRowMap()java.util.SortedSet<R>rowKeySet()Returns a set of row keys that have one or more values in the table.java.util.SortedMap<R,java.util.Map<C,V>>rowMap()Returns a view that associates each row key with the corresponding map from column keys to values.private java.util.SortedMap<R,java.util.Map<C,V>>sortedBackingMap()-
Methods inherited from class com.google.common.collect.StandardTable
cellIterator, cellSet, cellSpliterator, clear, column, columnKeySet, columnMap, contains, containsColumn, containsRow, containsValue, createColumnKeyIterator, get, isEmpty, put, remove, row, size, values
-
Methods inherited from class com.google.common.collect.AbstractTable
createCellSet, createValues, equals, hashCode, putAll, toString, valuesIterator, valuesSpliterator
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.google.common.collect.Table
cellSet, clear, column, columnKeySet, columnMap, contains, containsColumn, containsRow, containsValue, equals, get, hashCode, isEmpty, put, putAll, remove, row, size, values
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
-
Method Detail
-
rowKeySet
public java.util.SortedSet<R> rowKeySet()
Returns a set of row keys that have one or more values in the table. Changes to the set will update the underlying table, and vice versa.This method returns a
SortedSet, instead of theSetspecified in theTableinterface.
-
rowMap
public java.util.SortedMap<R,java.util.Map<C,V>> rowMap()
Returns a view that associates each row key with the corresponding map from column keys to values. Changes to the returned map will update this table. The returned map does not supportput()orputAll(), orsetValue()on its entries.In contrast, the maps returned by
rowMap().get()have the same behavior as those returned byTable.row(R). Those maps may supportsetValue(),put(), andputAll().This method returns a
SortedMap, instead of theMapspecified in theTableinterface.
-
createRowMap
java.util.SortedMap<R,java.util.Map<C,V>> createRowMap()
- Overrides:
createRowMapin classStandardTable<R,C,V>
-
-