Home | History | Annotate | Download | only in collect

Lines Matching refs:table

28  * Test cases for {@link Table} read operations.
34 protected Table<String, Integer, Character> table;
37 * Creates a table with the specified data.
39 * @param data the table data, repeating the sequence row key, column key,
45 protected abstract Table<String, Integer, Character>
49 assertEquals(expectedSize, table.size());
54 table = create();
58 table = create("foo", 1, 'a', "bar", 1, 'b', "foo", 3, 'c');
59 assertTrue(table.contains("foo", 1));
60 assertTrue(table.contains("bar", 1));
61 assertTrue(table.contains("foo", 3));
62 assertFalse(table.contains("foo", 2));
63 assertFalse(table.contains("bar", 3));
64 assertFalse(table.contains("cat", 1));
65 assertFalse(table.contains("foo", null));
66 assertFalse(table.contains(null, 1));
67 assertFalse(table.contains(null, null));
71 table = create("foo", 1, 'a', "bar", 1, 'b', "foo", 3, 'c');
72 assertTrue(table.containsRow("foo"));
73 assertTrue(table.containsRow("bar"));
74 assertFalse(table.containsRow("cat"));
75 assertFalse(table.containsRow(null));
79 table = create("foo", 1, 'a', "bar", 1, 'b', "foo", 3, 'c');
80 assertTrue(table.containsColumn(1));
81 assertTrue(table.containsColumn(3));
82 assertFalse(table.containsColumn(2));
83 assertFalse(table.containsColumn(null));
87 table = create("foo", 1, 'a', "bar", 1, 'b', "foo", 3, 'c');
88 assertTrue(table.containsValue('a'));
89 assertTrue(table.containsValue('b'));
90 assertTrue(table.containsValue('c'));
91 assertFalse(table.containsValue('x'));
92 assertFalse(table.containsValue(null));
96 table = create("foo", 1, 'a', "bar", 1, 'b', "foo", 3, 'c');
97 assertEquals((Character) 'a', table.get("foo", 1));
98 assertEquals((Character) 'b', table.get("bar", 1));
99 assertEquals((Character) 'c', table.get("foo", 3));
100 assertNull(table.get("foo", 2));
101 assertNull(table.get("bar", 3));
102 assertNull(table.get("cat", 1));
103 assertNull(table.get("foo", null));
104 assertNull(table.get(null, 1));
105 assertNull(table.get(null, null));
109 assertTrue(table.isEmpty());
110 table = create("foo", 1, 'a', "bar", 1, 'b', "foo", 3, 'c');
111 assertFalse(table.isEmpty());
116 table = create("foo", 1, 'a', "bar", 1, 'b', "foo", 3, 'c');
121 table = create("foo", 1, 'a', "bar", 1, 'b', "foo", 3, 'c');
122 Table<String, Integer, Character> hashCopy = HashBasedTable.create(table);
123 Table<String, Integer, Character> reordered
125 Table<String, Integer, Character> smaller
127 Table<String, Integer, Character> swapOuter
129 Table<String, Integer, Character> swapValues
133 .addEqualityGroup(table, hashCopy, reordered)
141 table = create("foo", 1, 'a', "bar", 1, 'b', "foo", 3, 'c');
145 assertEquals(expected, table.hashCode());
149 table = create("foo", 1, 'a');
150 assertEquals("{foo={1=a}}", table.toString());
154 table = create("foo", 1, 'a', "bar", 1, 'b', "foo", 3, 'c');
155 assertEquals(ImmutableMap.of(1, 'a', 3, 'c'), table.row("foo"));
160 table = create("foo", 1, 'a', "bar", 1, 'b', "foo", 3, 'c');
162 table.row(null);
168 table = create("foo", 1, 'a', "bar", 1, 'b', "foo", 3, 'c');
169 assertEquals(ImmutableMap.of("foo", 'a', "bar", 'b'), table.column(1));
174 table = create("foo", 1, 'a', "bar", 1, 'b', "foo", 3, 'c');
176 table.column(null);
182 table = create(
184 assertThat(table.columnKeySet()).has().exactly(1, 2, 3);