Package tech.tablesaw.columns.strings
Class NullDictionaryMap
- java.lang.Object
-
- tech.tablesaw.columns.strings.NullDictionaryMap
-
- All Implemented Interfaces:
Iterable<String>,DictionaryMap,StringFilters,StringReduceUtils,FilterSpec<Selection>,StringFilterSpec<Selection>
public class NullDictionaryMap extends Object implements DictionaryMap
A null dictionary map has no actual dictionary as the underlying data is not dictionary encoded. It works with textual data that is non-categorical, or where the number of categories approaches 1/2 of the total number of values, making dictionary encoding inefficient.
-
-
Constructor Summary
Constructors Constructor Description NullDictionaryMap(DictionaryMap dictionaryMap)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidappend(String value)voidappendMissing()byte[]asBytes(int rowNumber)Returns the contents of the cell at rowNumber as a byte[]String[]asObjectArray()Set<String>asSet()booleancanPromoteToText()voidclear()TablecountByCategory(String columnName)intcountMissing()Returns the count of missing values in this columnintcountOccurrences(String value)intcountUnique()intfirstIndexOf(String string)Stringget(int index)List<BooleanColumn>getDummies()intgetKeyAtIndex(int rowNumber)Returns the int that represents the string at rowNumberintgetKeyForIndex(int i)StringgetValueForIndex(int rowIndex)StringgetValueForKey(int key)SelectionisEqualTo(String string)SelectionisIn(String... strings)SelectionisIn(Collection<String> strings)booleanisMissing(int rowNumber)SelectionisNotIn(String... strings)SelectionisNotIn(Collection<String> strings)Iterator<String>iterator()intnextKeyWithoutIncrementing()DictionaryMappromoteYourself()SelectionselectIsIn(String... strings)SelectionselectIsIn(Collection<String> strings)voidset(int rowIndex, String stringValue)intsize()voidsortAscending()voidsortDescending()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface tech.tablesaw.columns.strings.DictionaryMap
asIntArray, isEmpty, isNotEqualTo, uniqueValuesAt
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Methods inherited from interface tech.tablesaw.columns.strings.StringFilters
containsString, endsWith, equalsIgnoreCase, equalsIgnoreCase, eval, eval, eval, eval, isAlpha, isAlphaNumeric, isEmptyString, isEqualTo, isIn, isLongerThan, isLowerCase, isMissing, isNotEqualTo, isNotIn, isNotMissing, isNumeric, isShorterThan, isUpperCase, lengthEquals, matchesRegex, startsWith, startsWith
-
Methods inherited from interface tech.tablesaw.columns.strings.StringReduceUtils
appendAll, appendAll
-
-
-
-
Constructor Detail
-
NullDictionaryMap
public NullDictionaryMap(DictionaryMap dictionaryMap)
-
-
Method Detail
-
sortDescending
public void sortDescending()
- Specified by:
sortDescendingin interfaceDictionaryMap
-
sortAscending
public void sortAscending()
- Specified by:
sortAscendingin interfaceDictionaryMap
-
getKeyAtIndex
public int getKeyAtIndex(int rowNumber)
Description copied from interface:DictionaryMapReturns the int that represents the string at rowNumber- Specified by:
getKeyAtIndexin interfaceDictionaryMap
-
getValueForKey
public String getValueForKey(int key)
- Specified by:
getValueForKeyin interfaceDictionaryMap
-
size
public int size()
- Specified by:
sizein interfaceDictionaryMap- Specified by:
sizein interfaceStringFilters- Specified by:
sizein interfaceStringReduceUtils
-
getValueForIndex
public String getValueForIndex(int rowIndex)
- Specified by:
getValueForIndexin interfaceDictionaryMap
-
countOccurrences
public int countOccurrences(String value)
- Specified by:
countOccurrencesin interfaceDictionaryMap
-
asSet
public Set<String> asSet()
- Specified by:
asSetin interfaceDictionaryMap
-
getKeyForIndex
public int getKeyForIndex(int i)
- Specified by:
getKeyForIndexin interfaceDictionaryMap
-
firstIndexOf
public int firstIndexOf(String string)
- Specified by:
firstIndexOfin interfaceDictionaryMap
-
asObjectArray
public String[] asObjectArray()
- Specified by:
asObjectArrayin interfaceDictionaryMap
-
selectIsIn
public Selection selectIsIn(String... strings)
- Specified by:
selectIsInin interfaceDictionaryMap
-
selectIsIn
public Selection selectIsIn(Collection<String> strings)
- Specified by:
selectIsInin interfaceDictionaryMap
-
append
public void append(String value) throws NoKeysAvailableException
- Specified by:
appendin interfaceDictionaryMap- Throws:
NoKeysAvailableException
-
set
public void set(int rowIndex, String stringValue) throws NoKeysAvailableException- Specified by:
setin interfaceDictionaryMap- Throws:
NoKeysAvailableException
-
clear
public void clear()
- Specified by:
clearin interfaceDictionaryMap
-
countUnique
public int countUnique()
- Specified by:
countUniquein interfaceDictionaryMap
-
countByCategory
public Table countByCategory(String columnName)
- Specified by:
countByCategoryin interfaceDictionaryMap
-
isEqualTo
public Selection isEqualTo(String string)
- Specified by:
isEqualToin interfaceDictionaryMap- Specified by:
isEqualToin interfaceStringFilters- Specified by:
isEqualToin interfaceStringFilterSpec<Selection>
-
get
public String get(int index)
- Specified by:
getin interfaceDictionaryMap- Specified by:
getin interfaceStringFilters
-
isIn
public Selection isIn(String... strings)
- Specified by:
isInin interfaceDictionaryMap- Specified by:
isInin interfaceStringFilters- Specified by:
isInin interfaceStringFilterSpec<Selection>
-
isIn
public Selection isIn(Collection<String> strings)
- Specified by:
isInin interfaceDictionaryMap- Specified by:
isInin interfaceStringFilters- Specified by:
isInin interfaceStringFilterSpec<Selection>
-
isNotIn
public Selection isNotIn(String... strings)
- Specified by:
isNotInin interfaceDictionaryMap- Specified by:
isNotInin interfaceStringFilters- Specified by:
isNotInin interfaceStringFilterSpec<Selection>
-
isNotIn
public Selection isNotIn(Collection<String> strings)
- Specified by:
isNotInin interfaceDictionaryMap- Specified by:
isNotInin interfaceStringFilters- Specified by:
isNotInin interfaceStringFilterSpec<Selection>
-
getDummies
public List<BooleanColumn> getDummies()
- Specified by:
getDummiesin interfaceDictionaryMap
-
asBytes
public byte[] asBytes(int rowNumber)
Description copied from interface:DictionaryMapReturns the contents of the cell at rowNumber as a byte[]- Specified by:
asBytesin interfaceDictionaryMap
-
countMissing
public int countMissing()
Description copied from interface:DictionaryMapReturns the count of missing values in this column- Specified by:
countMissingin interfaceDictionaryMap
-
iterator
public Iterator<String> iterator()
- Specified by:
iteratorin interfaceDictionaryMap- Specified by:
iteratorin interfaceIterable<String>
-
appendMissing
public void appendMissing()
- Specified by:
appendMissingin interfaceDictionaryMap
-
isMissing
public boolean isMissing(int rowNumber)
- Specified by:
isMissingin interfaceDictionaryMap
-
promoteYourself
public DictionaryMap promoteYourself()
- Specified by:
promoteYourselfin interfaceDictionaryMap
-
nextKeyWithoutIncrementing
public int nextKeyWithoutIncrementing()
- Specified by:
nextKeyWithoutIncrementingin interfaceDictionaryMap
-
canPromoteToText
public boolean canPromoteToText()
- Specified by:
canPromoteToTextin interfaceDictionaryMap
-
-