readStructure(st);
st.ordinaryChar(',');
st.ordinaryChar('\t');
m_cumulativeStructure = new FastVector(m_structure.numAttributes());
for (int i = 0; i < m_structure.numAttributes(); i++) {
m_cumulativeStructure.addElement(new Hashtable());
}
// Instances result = new Instances(m_structure);
m_cumulativeInstances = new FastVector();
FastVector current;
while ((current = getInstance(st)) != null) {
m_cumulativeInstances.addElement(current);
}
br.close();
// now determine the true structure of the data set
FastVector atts = new FastVector(m_structure.numAttributes());
for (int i = 0; i < m_structure.numAttributes(); i++) {
String attname = m_structure.attribute(i).name();
Hashtable tempHash = ((Hashtable) m_cumulativeStructure.elementAt(i));
if (tempHash.size() == 0) {
atts.addElement(new Attribute(attname));
} else {
FastVector values = new FastVector(tempHash.size());
// add dummy objects in order to make the FastVector's size == capacity
for (int z = 0; z < tempHash.size(); z++) {
values.addElement("dummy");
}
Enumeration e = tempHash.keys();
while (e.hasMoreElements()) {
Object ob = e.nextElement();
// if (ob instanceof Double) {
int index = ((Integer) tempHash.get(ob)).intValue();
values.setElementAt(new String(ob.toString()), index);
// }
}
atts.addElement(new Attribute(attname, values));
}
}