/** * Initialize ranges, upper limit must be set * * @param upper upper limit */ public void initializeRanges(int upper) { m_outputTypes.setUpper(upper); }
/** * Gets ranges of instances selected. * * @return a string containing a comma-separated list of ranges */ public String getInstancesIndices() { return m_Range.getRanges(); }
/** * Set which attributes are to be deleted (or kept if invert is true) * * @param rangeList a string representing the list of attributes. Since the * string will typically come from a user, attributes are indexed * from 1. <br> * eg: first-3,5,6-last * @throws Exception if an invalid range list is supplied */ public void setAttributeIndices(String rangeList) throws Exception { m_DeltaCols.setRanges(rangeList); }
/** * test the default constructor */ public void testDefaultConstructor() throws Exception { int upper = 10; int indexInt = 0; String indexStr = "" + (indexInt + 1); Range index = new Range(); index.setRanges(indexStr); index.setUpper(upper); assertEquals(indexStr, index.getRanges()); assertEquals(1, index.getSelection().length); assertEquals(indexInt, index.getSelection()[0]); }
/** * tests whether "first" is interpreted correctly */ public void testFirst() throws Exception { int upper = 10; Range index = getRange("first", upper); assertEquals("first", index.getRanges()); assertEquals(1, index.getSelection().length); assertEquals(0, index.getSelection()[0]); }
/** * Set the range of attributes to process. * * @param value the new range. */ public void setAttributeIndices(String value) { m_AttributeIndices = new Range(value); }
/** * initializes the attribute indices. */ protected void initializeAttributeIndices() { m_AttributeIndices.setUpper(m_Data.numAttributes() - 1); m_ActiveIndices = new boolean[m_Data.numAttributes()]; for (int i = 0; i < m_ActiveIndices.length; i++) { m_ActiveIndices[i] = m_AttributeIndices.isInRange(i); } }
/** * Returns true if attribute is nominal * * @param index of the attribute * @return true if the attribute is nominal */ public boolean isNominal(int index) { return m_nominalCols.isInRange(index); }
/** * Get whether the supplied columns are to be removed or kept * * @return true if the supplied columns will be kept */ public boolean getInvertSelection() { return !m_SelectCols.getInvert(); }
/** * Sets whether the selection of the indices is inverted or not * * @param value the new invert setting */ public void setInvertSelection(boolean value) { m_Cols.setInvert(value); }
/** * tests whether "first" is interpreted correctly */ public void testFirst() throws Exception { int upper = 10; Range index = getRange("first", upper); assertEquals("first", index.getRanges()); assertEquals(1, index.getSelection().length); assertEquals(0, index.getSelection()[0]); }
/** * Constructor */ public MakeIndicator() { m_ValIndex = new Range("last"); }
/** * initializes the attribute indices. */ protected void initializeAttributeIndices() { m_AttributeIndices.setUpper(m_Data.numAttributes() - 1); m_ActiveIndices = new boolean[m_Data.numAttributes()]; for (int i = 0; i < m_ActiveIndices.length; i++) { m_ActiveIndices[i] = m_AttributeIndices.isInRange(i); } }
/** * Returns true if attribute is boolean * * @param index of the attribute * @return true if the attribute is boolean */ public boolean isBoolean(int index) { return m_booleanCols.isInRange(index); }