/** * Get the data value at the given field as a <code>String</code>. * @param field the data field to retrieve * @see #canGetString(String) */ public final String getString(String field) { return m_table.getString(m_cur, field); }
/** * @see prefuse.data.Tuple#getString(java.lang.String) */ public final String getString(String field) { validityCheck(); return m_table.getString(m_row, field); }
/** * @see prefuse.data.Tuple#getString(int) */ public final String getString(int col) { validityCheck(); return m_table.getString(m_row, col); }
public void groupByStartTime() { int counter, rownum; String curr_state = null; IntIterator rownumiter; rownumiter = this.plot_tab.rowsSortedBy(START_FIELD_NAME, true); counter = 1; while (rownumiter.hasNext()) { rownum = ((Integer)rownumiter.next()).intValue(); curr_state = this.plot_tab.getString(rownum, "state_name"); if (this.collate_reduces && curr_state.equals("reduce_shufflewait")) { this.plot_tab.setFloat(rownum,"ycoord",(float)counter); ArrayList<Tuple> alt = this.reducepart_hash.get(this.plot_tab.getString(rownum,"friendly_id")); Object [] tarr = alt.toArray(); for (int i = 0; i < tarr.length; i++) ((Tuple)tarr[i]).setFloat("ycoord",(float)counter); counter++; } else if (!curr_state.equals("reduce_sort") && !curr_state.equals("reduce_reducer")) { this.plot_tab.setFloat(rownum,"ycoord",(float)counter); counter++; } } }
public void groupByEndTime() { int counter, rownum; String curr_state = null; IntIterator rownumiter; rownumiter = this.plot_tab.rowsSortedBy(END_FIELD_NAME, true); counter = 1; while (rownumiter.hasNext()) { rownum = ((Integer)rownumiter.next()).intValue(); curr_state = this.plot_tab.getString(rownum, "state_name"); if (this.collate_reduces && curr_state.equals("reduce_reducer")) { this.plot_tab.setFloat(rownum,"ycoord",(float)counter); ArrayList<Tuple> alt = this.reducepart_hash.get(this.plot_tab.getString(rownum,"friendly_id")); Object [] tarr = alt.toArray(); for (int i = 0; i < tarr.length; i++) ((Tuple)tarr[i]).setFloat("ycoord",(float)counter); counter++; } else if (!curr_state.equals("reduce_sort") && !curr_state.equals("reduce_shufflewait")) { this.plot_tab.setFloat(rownum,"ycoord",(float)counter); counter++; } } }
public void endDocument() throws SAXException { // time to actually set up the edges IntIterator rows = m_edges.rows(); while (rows.hasNext()) { int r = rows.nextInt(); String src = m_edges.getString(r, SRCID); if (!m_nodeMap.containsKey(src)) { throw new SAXException( "Tried to create edge with source node id=" + src + " which does not exist."); } int s = ((Integer) m_nodeMap.get(src)).intValue(); m_edges.setInt(r, SRC, s); String trg = m_edges.getString(r, TRGID); if (!m_nodeMap.containsKey(trg)) { throw new SAXException( "Tried to create edge with target node id=" + trg + " which does not exist."); } int t = ((Integer) m_nodeMap.get(trg)).intValue(); m_edges.setInt(r, TRG, t); } m_edges.removeColumn(SRCID); m_edges.removeColumn(TRGID); // now create the graph m_graph = new Graph(m_nodes, m_edges, m_directed); if (m_graphid != null) m_graph.putClientProperty(ID, m_graphid); }
for ( int i=0; i<table.getColumnCount(); ++i ) { if ( i>0 ) out.print(m_delim); out.print(table.getString(row, table.getColumnName(i)));
states.add(this.plot_tab.getString(i,"state_name")); this.plot_tab.setFloat(rownum,"ycoord",(float)counter); ArrayList<Tuple> alt = this.reducepart_hash.get(this.plot_tab.getString(rownum,"friendly_id")); Object [] tarr = alt.toArray(); for (int i = 0; i < tarr.length; i++) ((Tuple)tarr[i]).setFloat("ycoord",(float)counter);
for ( int i=0; i<table.getColumnCount(); ++i ) { if ( i>0 ) out.print(','); String str = table.getString(row, table.getColumnName(i)); out.print(makeCSVSafe(str));
public void populateTable_OneLinePerState(Table orig_tab) { IntIterator rownumiter; int newrownum, origrownum; rownumiter = orig_tab.rows(); // iterate over everything while (rownumiter.hasNext()) { origrownum = ((Integer)rownumiter.next()).intValue(); newrownum = this.plot_tab.addRow(); this.plot_tab.set(newrownum, "state_name", orig_tab.getString(origrownum, "state_name")); this.plot_tab.set(newrownum, "ycoord", orig_tab.getInt(origrownum, "seqno")); this.plot_tab.set(newrownum,"hostname",orig_tab.getString(origrownum,"hostname")); this.plot_tab.set(newrownum,"friendly_id",orig_tab.getString(origrownum,"friendly_id")); this.plot_tab.set(newrownum,START_FIELD_NAME, orig_tab.getDouble(origrownum,START_FIELD_NAME)); this.plot_tab.set(newrownum,END_FIELD_NAME, orig_tab.getDouble(origrownum,END_FIELD_NAME)); } }
public void populateTable_MapsReducesOnly(Table orig_tab) { IntIterator rownumiter; int newrownum, origrownum; rownumiter = orig_tab.rows( (Predicate) ExpressionParser.parse("[state_name] == 'map' OR [state_name] == 'reduce'") ); while (rownumiter.hasNext()) { origrownum = ((Integer)rownumiter.next()).intValue(); newrownum = this.plot_tab.addRow(); this.plot_tab.set(newrownum, "state_name", orig_tab.getString(origrownum, "state_name")); this.plot_tab.set(newrownum, "ycoord", orig_tab.getInt(origrownum, "seqno")); this.plot_tab.set(newrownum,"hostname",orig_tab.getString(origrownum,"hostname")); this.plot_tab.set(newrownum,"friendly_id",orig_tab.getString(origrownum,"friendly_id")); this.plot_tab.set(newrownum,START_FIELD_NAME, orig_tab.getDouble(origrownum,START_FIELD_NAME)); this.plot_tab.set(newrownum,START_FIELD_NAME, orig_tab.getDouble(origrownum,END_FIELD_NAME)); } }
String curr_state = rs_tab.getString(i, "state_name"); Integer cnt = state_counts.get(curr_state); if (cnt == null) {
origrownum = ((Integer)rownumiter.next()).intValue(); newrownum = this.plot_tab.addRow(); this.plot_tab.set(newrownum, "state_name", orig_tab.getString(origrownum, "state_name")); this.plot_tab.set(newrownum, "ycoord", orig_tab.getInt(origrownum, "seqno")); this.plot_tab.set(newrownum,"hostname",orig_tab.getString(origrownum,"hostname")); this.plot_tab.set(newrownum,"friendly_id",orig_tab.getString(origrownum,"friendly_id")); this.plot_tab.set(newrownum,START_FIELD_NAME, orig_tab.getDouble(origrownum,START_FIELD_NAME)); this.plot_tab.set(newrownum,END_FIELD_NAME, orig_tab.getDouble(origrownum,END_FIELD_NAME)); while (rownumiter3.hasNext()) { origrownum = ((Integer)rownumiter3.next()).intValue(); if (orig_tab.getString(origrownum,"state_name").equals("reduce")) { continue; // do NOT add reduces String curr_reduce = orig_tab.getString(origrownum, "friendly_id"); newrownum = this.plot_tab.addRow(); this.plot_tab.set(newrownum, "state_name", orig_tab.getString(origrownum, "state_name")); this.plot_tab.set(newrownum, "ycoord", orig_tab.getInt(origrownum, "seqno")); this.plot_tab.set(newrownum,"hostname",orig_tab.getString(origrownum,"hostname")); this.plot_tab.set(newrownum,"friendly_id",orig_tab.getString(origrownum,"friendly_id")); this.plot_tab.set(newrownum,START_FIELD_NAME, orig_tab.getDouble(origrownum,START_FIELD_NAME)); this.plot_tab.set(newrownum,END_FIELD_NAME, orig_tab.getDouble(origrownum,END_FIELD_NAME));
int row = rows.nextInt(); for ( int i=0; i<table.getColumnCount(); ++i ) { out.print(pack(table.getString(row, i), m_schema.getColumnLength(i), pre[i], pad[i]));