Guava’s Table is a collection that represents a table like structure containing rows, columns and the associated cell values. The row and the column act as an ordered pair of keys.
The row and column act as an ordered pair of keys. If we have to manage this the traditional way then the structure would be a map of rows where each row contain a map of column and the cell values, for example, Map<rowKey, Map<colKey, cellValue>>.
Declaration : Following is the declaration for com.google.common.collect.Table<R, C, V> interface :
@GwtCompatible public interface Table<R, C, V>
- R : The type of the table row keys.
- C : The type of the table column keys.
- V : The type of the mapped values.
Some of methods provided by Table Interface are :
Guava provides different variety of implementations for Table interface, which are shown in below table :
Important Points :
- A table may be sparse, with only a small fraction of row key / column key pairs possessing a corresponding value.
- In some implementations, data access by column key may have fewer supported operations or worse performance than data access by row key.
- All methods that modify the table are optional, and the views returned by the table may or may not be modifiable. When modification isn’t supported, those methods will throw an UnsupportedOperationException.
Below given are some other methods provided by Table Interface :
List of ECE students : Student Roll No : 15, Student Name : Ram Student Roll No : 18, Student Name : Anmol Student Roll No : 20, Student Name : Akhil Student Roll No : 25, Student Name : Amrit Student Roll No : CSE, Student Name : Sahil
Reference : Google Guava
Attention reader! Don’t stop learning now. Get hold of all the important Java and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready.
- Range Class | Guava | Java
- Ordering Class | Guava | Java
- Preconditions | Guava | Java
- BigIntegerMath Class | Guava | Java
- Java Guava | mean() method of IntMath Class
- Multiset Interface | Guava | Java
- Guava Library in Java
- Optional Class | Guava | Java
- bimap | Guava | Java
- MultiMap in Java Guava
- IntMath Class | Guava | Java
- LongMath Class | Guava | Java
- Ints Class | Guava | Java
- Chars Class | Guava | Java
- Longs Class | Guava | Java
- Bytes Class | Guava | Java
- Shorts Class | Guava | Java
- Doubles Class | Guava | Java
- Booleans Class | Guava | Java
- Floats Class | Guava | Java
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.