/** * Sets a specific value in the instance to the given value (internal * floating-point format). Performs a deep copy of the vector of attribute * values before the value is set. * * @param attIndex the attribute's index * @param value the new attribute value (If the corresponding attribute is * nominal (or a string) then this is the new value's index as a * double). */ @Override public void setValue(int attIndex, double value) { freshAttributeVector(); m_AttValues[attIndex] = value; }
/** * Sets a specific value in the instance to the given value (internal * floating-point format). Performs a deep copy of the vector of attribute * values before the value is set. Does exactly the same thing as setValue(). * * @param indexOfIndex the index of the attribute's index * @param value the new attribute value (If the corresponding attribute is * nominal (or a string) then this is the new value's index as a * double). */ @Override public void setValueSparse(int indexOfIndex, double value) { freshAttributeVector(); m_AttValues[indexOfIndex] = value; }
/** * Sets a specific value in the instance to the given value (internal * floating-point format). Performs a deep copy of the vector of attribute * values before the value is set. * * @param attIndex the attribute's index * @param value the new attribute value (If the corresponding attribute is * nominal (or a string) then this is the new value's index as a * double). */ @Override public void setValue(int attIndex, double value) { freshAttributeVector(); m_AttValues[attIndex] = value; }
/** * Sets a specific value in the instance to the given value (internal * floating-point format). Performs a deep copy of the vector of attribute * values before the value is set. Does exactly the same thing as setValue(). * * @param indexOfIndex the index of the attribute's index * @param value the new attribute value (If the corresponding attribute is * nominal (or a string) then this is the new value's index as a * double). */ @Override public void setValueSparse(int indexOfIndex, double value) { freshAttributeVector(); m_AttValues[indexOfIndex] = value; }
/** * Replaces all missing values in the instance with the values contained in * the given array. A deep copy of the vector of attribute values is performed * before the values are replaced. * * @param array containing the means and modes * @throws IllegalArgumentException if numbers of attributes are unequal */ @Override public void replaceMissingValues(double[] array) { if ((array == null) || (array.length != m_AttValues.length)) { throw new IllegalArgumentException("Unequal number of attributes!"); } freshAttributeVector(); for (int i = 0; i < m_AttValues.length; i++) { if (isMissing(i)) { m_AttValues[i] = array[i]; } } }
/** * Replaces all missing values in the instance with the values contained in * the given array. A deep copy of the vector of attribute values is performed * before the values are replaced. * * @param array containing the means and modes * @throws IllegalArgumentException if numbers of attributes are unequal */ @Override public void replaceMissingValues(double[] array) { if ((array == null) || (array.length != m_AttValues.length)) { throw new IllegalArgumentException("Unequal number of attributes!"); } freshAttributeVector(); for (int i = 0; i < m_AttValues.length; i++) { if (isMissing(i)) { m_AttValues[i] = array[i]; } } }