Class Table
java.lang.Object
fc.util.Table
Implements a simple table data structure. Like a 2D array
but uses nested hash tables to get (row, col) based on a
(name, name) pair. The table grows automatically as needed.
Differs from a 2D Object[][] in that names can be used instead of indices.
All indexes are internally strings. When adding or retrieving values, either numerical and string indices can be specified for either row or col when retrieving a (row,col) value. A numerical index is converted into a string value so if one puts a value at (3, 5), that can later be retrieved as ("3", "5") if desired.
Thread safety: This data structure is fully thread safe.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionget(int row, int col) Returns the object at row, col or null if the specified row or col do not exist.Returns the object at row, col or null if the specified row or col do not exist.Returns the object at row, col or null if the specified row or col do not exist.Returns the object at row, col or null if the specified row or col do not exist.static voidReturns the object at row, col or null if the specified row or col do not exist.toString()
-
Constructor Details
-
Table
public Table()Constructs a new table. -
Table
Constructs a new table of the specified initial size.
-
-
Method Details
-
get
-
get
-
get
-
get
-
put
-
put
-
put
-
put
-
toString
-
main
-