@Override public ColumnMetadata getMetadata(String arg0) { return super.getMetadata(arg0); }
/** * Get map mapping from column values (as Object instances) to their * ordinal index in a sorted array. * @param tuples a TupleSet * @param field the column / data field name * @param cmp a comparator for sorting the column contents * @return a map mapping column values to their position in a sorted * order of values */ public static Map ordinalMap(TupleSet tuples, String field, Comparator cmp) { if ( tuples instanceof Table ) { ColumnMetadata md = ((Table)tuples).getMetadata(field); return md.getOrdinalMap(); } else { return ordinalMap(tuples.tuples(), field, cmp); } }
/** * Get a sorted array containing all column values for a given table and * field. * @param tuples a TupleSet * @param field the column / data field name * @param cmp a comparator for sorting the column contents * @return an array containing the column values sorted */ public static Object[] ordinalArray(TupleSet tuples, String field, Comparator cmp) { if ( tuples instanceof Table ) { ColumnMetadata md = ((Table)tuples).getMetadata(field); return md.getOrdinalArray(); } else { return ordinalArray(tuples.tuples(), field, cmp); } }
/** * Get the Tuple with the median data field value. * @param tuples a TupleSet * @param field the column / data field name * @return the Tuple with the median data field value */ public static Tuple median(TupleSet tuples, String field, Comparator cmp) { if ( tuples instanceof Table ) { Table table = (Table)tuples; ColumnMetadata md = table.getMetadata(field); return table.getTuple(md.getMedianRow()); } else { return median(tuples.tuples(), field, cmp); } }
/** * Get the Tuple with the maximum data field value. * @param tuples a TupleSet * @param field the column / data field name * @return the Tuple with the maximum data field value */ public static Tuple max(TupleSet tuples, String field, Comparator cmp) { if ( tuples instanceof Table ) { Table table = (Table)tuples; ColumnMetadata md = table.getMetadata(field); return table.getTuple(md.getMaximumRow()); } else { return max(tuples.tuples(), field, cmp); } }
/** * Get the Tuple with the minimum data field value. * @param tuples a TupleSet * @param field the column / data field name * @return the Tuple with the minimum data field value */ public static Tuple min(TupleSet tuples, String field, Comparator cmp) { if ( tuples instanceof Table ) { Table table = (Table)tuples; ColumnMetadata md = table.getMetadata(field); return table.getTuple(md.getMinimumRow()); } else { return min(tuples.tuples(), field, cmp); } }
protected Table setupDataTable() { Table res_tab = this.getData(); if (res_tab == null) { return res_tab; } res_tab.addColumn("seqno","ROW()"); res_tab = addTimeOffsetCol(res_tab, "start_time", "start_time_millis", START_FIELD_NAME, 0); ColumnMetadata dstcol = res_tab.getMetadata(START_FIELD_NAME); long mintime = ((Timestamp)res_tab.get(dstcol.getMinimumRow(), "start_time")).getTime(); res_tab = addTimeOffsetCol(res_tab, "finish_time", "finish_time_millis", END_FIELD_NAME, mintime); res_tab.addColumn(PolygonRenderer.POLYGON,float[].class); log.debug("After adding seqno: #cols: " + res_tab.getColumnCount() + "; #rows: " + res_tab.getRowCount()); return res_tab; }
srcMillisecondFieldName, dstFieldName + "_fulltime"); ColumnMetadata dstcol = newtable.getMetadata(dstFieldName + "_fulltime"); long mintime = newtable.getLong(dstcol.getMinimumRow(), dstFieldName + "_fulltime");
private void initModel() { if ( m_model != null ) m_model.removeListSelectionListener(m_listener); // set up data / selection model Object[] o; if ( m_tuples instanceof Table ) { ColumnMetadata md = ((Table)m_tuples).getMetadata(m_field); o = md.getOrdinalArray(); } else { o = DataLib.ordinalArray(m_tuples.tuples(), m_field); } m_model = new ListModel(o); m_model.addListSelectionListener(m_listener); if ( m_includeAll ) { m_model.insertElementAt(ALL, 0); m_model.setSelectedItem(ALL); } }