Package org.aoju.bus.office.csv
Class CsvRow
java.lang.Object
org.aoju.bus.office.csv.CsvRow
CSV中一行的表示
- Since:
- Java 17+
- Author:
- Kimi Liu
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleanbooleanaddAll(int index, Collection<? extends String> c) booleanaddAll(Collection<? extends String> c) voidclear()booleanbooleancontainsAll(Collection<?> c) get(int index) 获取标题对应的字段内容int获取字段格式获取标题与字段值对应的Maplong获取原始行号,多行情况下为首行行号获取本行所有字段值列表intbooleanisEmpty()iterator()intlistIterator(int index) remove(int index) booleanbooleanremoveAll(Collection<?> c) booleanretainAll(Collection<?> c) intsize()subList(int fromIndex, int toIndex) Object[]toArray()<T> T[]toArray(T[] a) <T> T数据转换为Bean对象toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.List
equals, hashCode, replaceAll, sort, spliterator
-
Constructor Details
-
CsvRow
构造- Parameters:
originalLineNumber- 对应文件中的第几行headerMap- 标题Mapfields- 数据列表
-
-
Method Details
-
getOriginalLineNumber
public long getOriginalLineNumber()获取原始行号,多行情况下为首行行号- Returns:
- the original line number 行号
-
getByName
获取标题对应的字段内容- Parameters:
name- 标题名- Returns:
- 字段值, null表示无此字段值
- Throws:
IllegalStateException- CSV文件无标题行抛出此异常
-
getRawList
获取本行所有字段值列表- Returns:
- 字段值列表
-
getFieldMap
获取标题与字段值对应的Map- Returns:
- an unmodifiable map of header names and field values of this row
- Throws:
IllegalStateException- CSV文件无标题行抛出此异常
-
getFieldCount
public int getFieldCount()获取字段格式- Returns:
- 字段格式
-
toBean
数据转换为Bean对象- Type Parameters:
T- Bean类型- Parameters:
clazz- bean类- Returns:
- Bean
-
size
public int size() -
isEmpty
public boolean isEmpty() -
contains
-
iterator
-
toArray
-
toArray
public <T> T[] toArray(T[] a) -
add
-
remove
-
containsAll
- Specified by:
containsAllin interfaceCollection<String>- Specified by:
containsAllin interfaceList<String>
-
addAll
-
addAll
-
removeAll
-
retainAll
-
clear
public void clear() -
get
-
set
-
add
-
remove
-
indexOf
-
lastIndexOf
- Specified by:
lastIndexOfin interfaceList<String>
-
listIterator
- Specified by:
listIteratorin interfaceList<String>
-
listIterator
- Specified by:
listIteratorin interfaceList<String>
-
subList
-
toString
-