T
- テキストファイルのある1行の内容を表すクラスを指定します。 たとえば、CSVファイルではString[]です。public abstract class TextReader<T> extends TextIO<T> implements Freeable, Loadable
コンストラクタと説明 |
---|
TextReader(java.io.File file,
Reader<T> parser)
ファイルとリーダを指定して、読み込み用ファイルを構築します.
|
TextReader(java.lang.String filePath,
Reader<T> parser)
ファイルパスとリーダを指定して、読み込み用ファイルを構築します.
|
修飾子とタイプ | メソッドと説明 |
---|---|
TextReader<T> |
add(java.util.Collection<? extends T> obj)
要素をこのテキストファイルの末尾に追加します.
|
TextReader<T> |
add(T... obj)
要素をこのテキストファイルの末尾に追加します.
|
TextReader<T> |
add(T obj)
要素をこのテキストファイルの末尾に追加します.
|
TextReader<T> |
add(TextIO<? extends T> other)
他のTextIOのすべての要素を、このテキストファイルの末尾に追加します.
|
TextReader<T> |
clear()
全ての要素を破棄します.
|
TextReader<T> |
free()
全てのデータを破棄します.
|
Reader<T> |
getReader()
リーダを取得します.
|
boolean |
isLoaded()
このオブジェクトが、すでにロードされているかを検査します.
|
TextReader<T> |
load()
テキストファイルのデータをロードします.
|
TextReader<T> |
remove(java.util.Collection<? extends T> obj)
要素をこのテキストファイルから削除します.
|
TextReader<T> |
remove(T... obj)
要素をこのテキストファイルから削除します.
|
TextReader<T> |
remove(T obj)
要素をこのテキストファイルから削除します.
|
TextReader<T> |
remove(TextIO<? extends T> other)
他のTextIOのすべての要素を、このテキストファイルから削除します.
|
void |
setReader(Reader<T> reader)
リーダを設定します.
|
getData, getFile, getFirst, getName, isEmpty, iterator, printAll, size, toString
public TextReader(java.lang.String filePath, Reader<T> parser) throws ContentsFileNotFoundException
filePath
- ファイルパスを指定します。parser
- 文字列を解析するリーダを指定します。ContentsFileNotFoundException
- 指定されたファイルが存在しない場合に投げられます。public TextReader(java.io.File file, Reader<T> parser) throws ContentsFileNotFoundException
file
- ファイルを指定します。parser
- 文字列を解析するリーダを指定します。ContentsFileNotFoundException
- 指定されたファイルが存在しない場合に投げられます。public TextReader<T> load() throws IllegalFormatException, ContentsIOException
load
インタフェース内 Loadable
IllegalFormatException
- パーサが文字列を解析できない場合に投げられます。ContentsIOException
- ファイルをロードできない場合に投げられます。public TextReader<T> free()
public boolean isLoaded()
Loadable
public TextReader<T> add(java.util.Collection<? extends T> obj)
TextIO
public TextReader<T> add(T obj)
TextIO
public TextReader<T> add(T... obj)
TextIO
public TextReader<T> add(TextIO<? extends T> other)
TextIO
public TextReader<T> remove(java.util.Collection<? extends T> obj)
TextIO
public TextReader<T> remove(T obj)
TextIO
public TextReader<T> remove(T... obj)
TextIO
public TextReader<T> remove(TextIO<? extends T> other)
TextIO
public TextReader<T> clear()
TextIO