Package tech.tablesaw.columns.strings
Class IntDictionaryMap
- java.lang.Object
-
- tech.tablesaw.columns.strings.IntDictionaryMap
-
- All Implemented Interfaces:
Iterable<String>,DictionaryMap,StringFilters,StringReduceUtils,FilterSpec<Selection>,StringFilterSpec<Selection>
public class IntDictionaryMap extends Object implements DictionaryMap
A map that supports reversible key value pairs of int-String
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classIntDictionaryMap.IntDictionaryBuilder
-
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()booleanequals(Object o)intfirstIndexOf(String value)List<BooleanColumn>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)intgetKeyAtIndex(int rowNumber)Returns the int that represents the string at rowNumberit.unimi.dsi.fastutil.ints.Int2IntMap.FastEntrySetgetKeyCountEntries()intgetKeyForIndex(int rowIndex)it.unimi.dsi.fastutil.objects.ObjectSet<it.unimi.dsi.fastutil.ints.Int2ObjectMap.Entry<String>>getKeyValueEntries()StringgetValueForIndex(int rowIndex)StringgetValueForKey(int key)inthashCode()SelectionisEqualTo(String string)booleanisMissing(int rowNumber)Iterator<String>iterator()intnextKeyWithoutIncrementing()DictionaryMappromoteYourself()SelectionselectIsIn(String... strings)SelectionselectIsIn(Collection<String> strings)voidset(int rowIndex, String stringValue)intsize()Returns the number of elements (a.k.a.voidsortAscending()voidsortDescending()it.unimi.dsi.fastutil.ints.IntArrayListvalues()-
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, get, isEmpty, isIn, isIn, isNotEqualTo, isNotIn, isNotIn, 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
-
-
-
-
Method Detail
-
size
public int size()
Returns the number of elements (a.k.a. rows or cells) in the column- Specified by:
sizein interfaceDictionaryMap- Specified by:
sizein interfaceStringFilters- Specified by:
sizein interfaceStringReduceUtils
-
values
public it.unimi.dsi.fastutil.ints.IntArrayList values()
-
getKeyCountEntries
public it.unimi.dsi.fastutil.ints.Int2IntMap.FastEntrySet getKeyCountEntries()
-
getKeyValueEntries
public it.unimi.dsi.fastutil.objects.ObjectSet<it.unimi.dsi.fastutil.ints.Int2ObjectMap.Entry<String>> getKeyValueEntries()
-
getValueForIndex
public String getValueForIndex(int rowIndex)
- Specified by:
getValueForIndexin interfaceDictionaryMap
-
getKeyForIndex
public int getKeyForIndex(int rowIndex)
- Specified by:
getKeyForIndexin interfaceDictionaryMap
-
sortAscending
public void sortAscending()
- Specified by:
sortAscendingin interfaceDictionaryMap
-
getKeyAtIndex
public int getKeyAtIndex(int rowNumber)
Returns the int that represents the string at rowNumber- Specified by:
getKeyAtIndexin interfaceDictionaryMap
-
getValueForKey
public String getValueForKey(int key)
- Specified by:
getValueForKeyin interfaceDictionaryMap
-
sortDescending
public void sortDescending()
- Specified by:
sortDescendingin interfaceDictionaryMap
-
countOccurrences
public int countOccurrences(String value)
- Specified by:
countOccurrencesin interfaceDictionaryMap
-
asSet
public Set<String> asSet()
- Specified by:
asSetin interfaceDictionaryMap
-
firstIndexOf
public int firstIndexOf(String value)
- Specified by:
firstIndexOfin interfaceDictionaryMap
-
asObjectArray
public String[] asObjectArray()
- Specified by:
asObjectArrayin interfaceDictionaryMap
-
countUnique
public int countUnique()
- Specified by:
countUniquein 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
-
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>
-
getDummies
public List<BooleanColumn> 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:
getDummiesin 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:
asBytesin interfaceDictionaryMap
-
countMissing
public int countMissing()
Returns 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
-
-