Class DataFrameRow
java.lang.Object
org.snpsift.annotate.mem.dataFrame.DataFrameRow
- All Implemented Interfaces:
Serializable,Iterable<String>
The DataFrameRow class represents a row in a DataFrame. It implements the Serializable and Iterable interfaces.
Each DataFrameRow object holds a reference to its parent DataFrame, its position, reference allele, alternative allele,
and an index within the DataFrame. It also maintains a map of values for each column in the DataFrame.
The class provides methods to:
- Retrieve all data for the row from the DataFrame.
- Get and set values for specific columns.
- Populate the DataFrame with values from the row.
- Iterate over the column names of the DataFrame.
Non-obvious limitations:
- The values map is lazily initialized when getDataFrameValues() is called for the first time.
- The get() method assumes that the values map has been populated, either by calling getDataFrameValues() or by setting values explicitly.
- The setDataFrame() methods update the DataFrame with values from the row, but do not automatically synchronize changes made directly to the DataFrame.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDataFrameRow(DataFrame dataFrame, int pos, String ref, String alt) DataFrameRow(DataFrame dataFrame, int pos, String ref, String alt, int idx) -
Method Summary
Modifier and TypeMethodDescriptiongetAlt()getDataFrameValue(String columnName) Get data single column value from the data frameReturn all data for this row from the data frameintgetIdx()intgetPos()getRef()iterator()voidvoidPopulate row in DataFrame with the values in this rowvoidsetDataFrame(String columnName) Set the data frame with a value from this rowvoidsetDataFrame(String columnName, Object value) Set the data frame with a specific valueprotected voidsetIdx(int idx) toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
DataFrameRow
-
DataFrameRow
-
-
Method Details
-
getDataFrameValues
Return all data for this row from the data frame -
get
-
getDataFrameValue
Get data single column value from the data frame -
getAlt
-
getIdx
public int getIdx() -
getPos
public int getPos() -
getRef
-
getValues
-
iterator
-
set
-
setDataFrame
Set the data frame with a value from this row -
setDataFrame
Set the data frame with a specific value -
setDataFrame
public void setDataFrame()Populate row in DataFrame with the values in this row -
setIdx
protected void setIdx(int idx) -
toString
-