Package tech.tablesaw.columns.strings
Class ByteDictionaryMap
java.lang.Object
tech.tablesaw.columns.strings.ByteDictionaryMap
- All Implemented Interfaces:
DictionaryMap
A map that supports reversible key value pairs of int-String
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
byte[]
asBytes
(int rowNumber) Returns the contents of the cell at rowNumber as a byte[]String[]
asSet()
void
clear()
countByCategory
(String columnName) int
Returns the count of missing values in this columnint
countOccurrences
(String value) int
boolean
int
firstIndexOf
(String value) Returns a list of boolean columns suitable for use as dummy variables in, for example, regression analysis, select a column of categorical data must be encoded as a list of columns, such that each column represents a single category and indicates whether it is present (1) or not present (0)int
getKeyAtIndex
(int rowNumber) Returns the int that represents the string at rowNumberit.unimi.dsi.fastutil.bytes.Byte2IntMap.FastEntrySet
int
getKeyForIndex
(int rowIndex) it.unimi.dsi.fastutil.objects.ObjectSet<it.unimi.dsi.fastutil.bytes.Byte2ObjectMap.Entry<String>>
getValueForIndex
(int rowIndex) getValueForKey
(int key) int
hashCode()
boolean
isMissing
(int rowNumber) iterator()
int
selectIsIn
(String... strings) selectIsIn
(Collection<String> strings) void
int
size()
Returns the number of elements (a.k.a. rows or cells) in the columnvoid
void
it.unimi.dsi.fastutil.bytes.ByteArrayList
values()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface tech.tablesaw.columns.strings.DictionaryMap
asIntArray, isNotEqualTo, uniqueValuesAt
-
Constructor Details
-
ByteDictionaryMap
public ByteDictionaryMap()
-
-
Method Details
-
getKeyAtIndex
public int getKeyAtIndex(int rowNumber) Returns the int that represents the string at rowNumber- Specified by:
getKeyAtIndex
in interfaceDictionaryMap
-
equals
-
hashCode
public int hashCode() -
size
public int size()Returns the number of elements (a.k.a. rows or cells) in the column- Specified by:
size
in interfaceDictionaryMap
-
values
public it.unimi.dsi.fastutil.bytes.ByteArrayList values() -
getKeyValueEntries
public it.unimi.dsi.fastutil.objects.ObjectSet<it.unimi.dsi.fastutil.bytes.Byte2ObjectMap.Entry<String>> getKeyValueEntries() -
getKeyCountEntries
public it.unimi.dsi.fastutil.bytes.Byte2IntMap.FastEntrySet getKeyCountEntries() -
getValueForIndex
- Specified by:
getValueForIndex
in interfaceDictionaryMap
-
getKeyForIndex
public int getKeyForIndex(int rowIndex) - Specified by:
getKeyForIndex
in interfaceDictionaryMap
-
sortAscending
public void sortAscending()- Specified by:
sortAscending
in interfaceDictionaryMap
-
getValueForKey
- Specified by:
getValueForKey
in interfaceDictionaryMap
-
sortDescending
public void sortDescending()- Specified by:
sortDescending
in interfaceDictionaryMap
-
countOccurrences
- Specified by:
countOccurrences
in interfaceDictionaryMap
-
asSet
- Specified by:
asSet
in interfaceDictionaryMap
-
firstIndexOf
- Specified by:
firstIndexOf
in interfaceDictionaryMap
-
asObjectArray
- Specified by:
asObjectArray
in interfaceDictionaryMap
-
selectIsIn
- Specified by:
selectIsIn
in interfaceDictionaryMap
-
selectIsIn
- Specified by:
selectIsIn
in interfaceDictionaryMap
-
append
- Specified by:
append
in interfaceDictionaryMap
- Throws:
NoKeysAvailableException
-
set
- Specified by:
set
in interfaceDictionaryMap
- Throws:
NoKeysAvailableException
-
clear
public void clear()- Specified by:
clear
in interfaceDictionaryMap
-
countUnique
public int countUnique()- Specified by:
countUnique
in interfaceDictionaryMap
-
countByCategory
- Specified by:
countByCategory
in interfaceDictionaryMap
-
isEqualTo
- Specified by:
isEqualTo
in interfaceDictionaryMap
-
getDummies
Returns a list of boolean columns suitable for use as dummy variables in, for example, regression analysis, select a column of categorical data must be encoded as a list of columns, such that each column represents a single category and indicates whether it is present (1) or not present (0)- Specified by:
getDummies
in interfaceDictionaryMap
- Returns:
- a list of
BooleanColumn
-
asBytes
public byte[] asBytes(int rowNumber) Returns the contents of the cell at rowNumber as a byte[]- Specified by:
asBytes
in interfaceDictionaryMap
-
countMissing
public int countMissing()Returns the count of missing values in this column- Specified by:
countMissing
in interfaceDictionaryMap
-
iterator
- Specified by:
iterator
in interfaceDictionaryMap
-
appendMissing
public void appendMissing()- Specified by:
appendMissing
in interfaceDictionaryMap
-
isMissing
public boolean isMissing(int rowNumber) - Specified by:
isMissing
in interfaceDictionaryMap
-
promoteYourself
- Specified by:
promoteYourself
in interfaceDictionaryMap
-
nextKeyWithoutIncrementing
public int nextKeyWithoutIncrementing()- Specified by:
nextKeyWithoutIncrementing
in interfaceDictionaryMap
-