📄 mininginputstream.java
字号:
package org.scut.DataMining.Input;
import org.scut.DataMining.Core.MiningData;
import org.scut.DataMining.Core.MiningException;
import org.scut.DataMining.Core.MiningMetaData;
public abstract class MiningInputStream
{
/** Meta data for parsing input stream or parsed meta data from stream */
protected MiningMetaData metaData;
/** MiningData parsed which represents a record from a stream */
protected MiningData data;
/** reading curosr indicates the current reading position in the stream */
protected int cursor;
/** MiningData size */
protected int dataSize;
/** Flag indicates whether the meta data of the stream be parsed or not*/
protected boolean recognized = false;
/**
* Constructs a MiningInputStream with a given MetaData,null if not given
* @param metaData MiningMetaData object, null allowed for not specified
*/
public MiningInputStream(MiningMetaData metaData) throws MiningException
{
this.metaData = metaData;
}
/** Opens the input stream for reading*/
public abstract void open() throws MiningException;
/** Closes the input stream after reading*/
public abstract void close() throws MiningException;
/** Reads next record data to the field this.data, false returns if the end of stream reaches*/
public abstract boolean next() throws MiningException;
/** Recognizes the MetaData of the stream, if no givend meta data */
protected abstract void recognize() throws MiningException;
/**
* Gets the MiningData object current read from stream
* @return MiningData object current read from stream
*/
public MiningData getData()
{
return this.data;
}
/**
* Gets the MiningData object
* @return MiningData object recognized from the stream, or specified at construction time
*/
public MiningMetaData getMetaData()
{
return this.metaData;
}
/**
* Gets the data size of the input stream
* @return data size value
*/
public int getDataSize()
{
return this.dataSize;
}
/**
* Gets current reading cursor
* @return cursor integer value
*/
public int getCursor()
{
return this.cursor;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -