|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectproper.core.ProperObject
proper.database.ConnectorObject
proper.database.ExecutorObject
proper.database.Sparser
public class Sparser
This class retrieves a certain percentage of data from a table. Sometimes
it is necessary to retrieve only a small sample of a huge table. If a
a uniformly distributed sample is preferred the classfield
has
to be set, too. The Reader
class uses this.
Via the iterator
you can access the IDs that were chosen for
retrieval.
Reader.setPercentage(double)
Field Summary |
---|
Fields inherited from interface proper.core.ProperInterface |
---|
VERSION |
Constructor Summary | |
---|---|
Sparser(Connector conn)
initializes the object |
Method Summary | |
---|---|
void |
clear()
resets the sparser (percentage back to 0%, i.e. |
java.lang.String |
getClassField()
returns the currently set column used as class |
int |
getClassFieldType()
returns the sql type of the classfield |
java.lang.String |
getIndex()
returns the index the keys are taken from |
int |
getIndexType()
returns the sql type of the index |
double |
getKeyRatio()
returns the ratio between all rows and all distinct rows, important for tables that do not contain a unique key (then the ratio is >1.0) |
boolean |
getOnlyClassified()
returns whether we only want classified instances |
boolean |
getOnlyUnclassified()
returns whether we only want unclassified instances |
double |
getPercentage()
returns the currently set percentage |
java.lang.String |
getTable()
returns the currently set table |
java.util.Iterator |
iterator()
returns an iterator over the stored keys |
void |
setClassField(java.lang.String classField)
sets the column to use as class |
void |
setIndex(java.lang.String index)
sets the index to get the keys from (can be determined automatically!) |
void |
setOnlyClassified(boolean onlyClassified)
sets whether we only want to retrieve keys for classified instances, i.e. |
void |
setOnlyUnclassified(boolean onlyUnclassified)
sets whether we only want to retrieve keys for unclassified instances, i.e. |
void |
setPercentage(double percentage)
sets the percentage of rows to retrieve (0-100), where 0 and 100 mean both "all rows" |
void |
setTable(java.lang.String table)
sets the table to work on |
int |
size()
returns the number of stored keys |
java.lang.String |
toString()
returns some information about the current state |
Methods inherited from class proper.database.ExecutorObject |
---|
getExecutor, getLastException, getLastStatement |
Methods inherited from class proper.database.ConnectorObject |
---|
getConnector |
Methods inherited from class proper.core.ProperObject |
---|
addListener, addOutput, classInVerbose, debugprint, debugprint, debugprint, debugprint, debugprintln, debugprintln, debugprintln, debugprintln, debugprintln, getListeners, getRuntime, getVerbose, getVerboseLevel, getVerboseLevelForClass, getVerboseString, getVerboseStringForClass, notifyListener, notifyListeners, print, print, print, print, println, println, println, println, println, printMemory, removeListener, setOutput, setVerbose, setVerboseLevel, setVerboseString |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Sparser(Connector conn)
Method Detail |
---|
public void clear()
public void setTable(java.lang.String table)
public java.lang.String getTable()
public void setIndex(java.lang.String index)
public java.lang.String getIndex()
public int getIndexType()
Types
public void setClassField(java.lang.String classField)
public java.lang.String getClassField()
public int getClassFieldType()
Types
public void setOnlyClassified(boolean onlyClassified)
public boolean getOnlyClassified()
public void setOnlyUnclassified(boolean onlyUnclassified)
public boolean getOnlyUnclassified()
public void setPercentage(double percentage)
public double getPercentage()
public double getKeyRatio()
public java.util.Iterator iterator()
public int size()
public java.lang.String toString()
toString
in class ProperObject
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |