/** * Creates a SubsetByExpression filter with the given expression. * * @param expr the expression to use * @return the filter */ public Filter getFilter(String expr) { SubsetByExpression result = new SubsetByExpression(); result.setExpression(expr); return result; }
/** * Main method for running this filter. * * @param args arguments for the filter: use -h for help */ public static void main(String[] args) { runFilter(new SubsetByExpression(), args); } }
if (getInputFormat() == null) { throw new IllegalStateException("No input instance format defined"); resetQueue(); m_NewBatch = false; bufferInput(instance); if (isFirstBatchDone()) { Instances inst = new Instances(getInputFormat()); inst = process(inst); numReturnedFromParser = inst.numInstances(); for (int i = 0; i < inst.numInstances(); i++) { push(inst.instance(i), false); // No need to copy instance flushInput();
setExpression(tmpStr); } else { setExpression("true"); if (getInputFormat() != null) { setInputFormat(getInputFormat());
/** * Creates a default SubsetByExpression filter. * * @return the filter */ @Override public Filter getFilter() { return new SubsetByExpression(); }
/** * Gets the current settings of the filter. * * @return an array of strings suitable for passing to setOptions */ @Override public String[] getOptions() { Vector<String> result = new Vector<String>(); result.add("-E"); result.add("" + getExpression()); if (m_filterAfterFirstBatch) { result.add("-F"); } Collections.addAll(result, super.getOptions()); return result.toArray(new String[result.size()]); }
if (!isFirstBatchDone() || m_filterAfterFirstBatch) {
if (getInputFormat() == null) { throw new IllegalStateException("No input instance format defined"); resetQueue(); m_NewBatch = false; bufferInput(instance); if (isFirstBatchDone()) { Instances inst = new Instances(getInputFormat()); inst = process(inst); numReturnedFromParser = inst.numInstances(); for (int i = 0; i < inst.numInstances(); i++) { push(inst.instance(i), false); // No need to copy instance flushInput();
setExpression(tmpStr); } else { setExpression("true"); if (getInputFormat() != null) { setInputFormat(getInputFormat());
/** * Main method for running this filter. * * @param args arguments for the filter: use -h for help */ public static void main(String[] args) { runFilter(new SubsetByExpression(), args); } }
/** * Creates a default SubsetByExpression filter. * * @return the filter */ @Override public Filter getFilter() { return new SubsetByExpression(); }
/** * Gets the current settings of the filter. * * @return an array of strings suitable for passing to setOptions */ @Override public String[] getOptions() { Vector<String> result = new Vector<String>(); result.add("-E"); result.add("" + getExpression()); if (m_filterAfterFirstBatch) { result.add("-F"); } Collections.addAll(result, super.getOptions()); return result.toArray(new String[result.size()]); }
if (!isFirstBatchDone() || m_filterAfterFirstBatch) {
/** * Creates a SubsetByExpression filter with the given expression. * * @param expr the expression to use * @return the filter */ public Filter getFilter(String expr) { SubsetByExpression result = new SubsetByExpression(); result.setExpression(expr); return result; }