TextColumn extends AbstractStringColumn<TextColumn> { @Override public Selection isIn(String... strings) { Set<String> stringSet = Sets.newHashSet(strings); Selection results = new BitmapBackedSelection(); for (int i = 0; i < size(); i++) { if (stringSet.contains(values.get(i))) { results.add(i); } } return results; } private  TextColumn(String name, Collection<String> strings); private  TextColumn(String name); private  TextColumn(String name, String[] strings); static boolean valueIsMissing(String string); @Override TextColumn appendMissing(); static TextColumn create(String name); static TextColumn create(String name, String... strings); static TextColumn create(String name, Collection<String> strings); static TextColumn create(String name, int size); static TextColumn create(String name, Stream<String> stream); @Override boolean isMissing(int rowNumber); @Override TextColumn emptyCopy(); @Override TextColumn emptyCopy(int rowSize); @Override void sortAscending(); @Override void sortDescending(); @Override int size(); String get(int rowIndex); @Override List<String> asList(); @Override Table summary(); @Override void clear(); @Override TextColumn lead(int n); @Override TextColumn lag(int n); @Override TextColumn set(Selection rowSelection, String newValue); @Override TextColumn set(int rowIndex, String stringValue); @Override int countUnique(); @Override boolean contains(String aString); @Override TextColumn setMissing(int i); TextColumn addAll(List<String> stringValues); @Override TextColumn appendCell(String object); @Override TextColumn appendCell(String object, AbstractColumnParser<?> parser); @Override IntComparator rowComparator(); @Override boolean isEmpty(); @Override TextColumn unique(); TextColumn where(Selection selection); @Override TextColumn copy(); @Override TextColumn append(Column<String> column); @Override int countMissing(); @Override TextColumn removeMissing(); @Override Iterator<String> iterator(); Set<String> asSet(); @Override byte[] asBytes(int rowNumber); TextColumn append(String value); @Override TextColumn appendObj(Object obj); @Override Selection isIn(String... strings); @Override Selection isIn(Collection<String> strings); @Override Selection isNotIn(String... strings); @Override Selection isNotIn(Collection<String> strings); int firstIndexOf(String value); @Override String[] asObjectArray(); @Override StringColumn asStringColumn();  }
@Test public void testIsIn() { TextColumn stringColumn = TextColumn.create("US States"); stringColumn.addAll(TestDataUtil.usStates()); TextColumn selection = stringColumn.where(stringColumn.isIn("Alabama", "Texas")); assertEquals("Alabama", selection.get(0)); assertEquals("Texas", selection.get(1)); assertEquals(2, selection.size()); }