@Override public double value(int indexAttribute) { int location = locateIndex(indexAttribute); //return location == -1 ? 0 : this.attributeValues[location]; // int index = locateIndex(attIndex); if ((location >= 0) && (indexValues[location] == indexAttribute)) { return attributeValues[location]; } else { return 0.0; } }
/** * Value. * * @param indexAttribute the index attribute * @return the double */ @Override public double value(int indexAttribute) { int location = locateIndex(indexAttribute); //return location == -1 ? 0 : this.attributeValues[location]; // int index = locateIndex(attIndex); if ((location >= 0) && (indexValues[location] == indexAttribute)) { return attributeValues[location]; } else { return 0.0; } }
@Override public void setValue(int attributeIndex, double d) { int index = locateIndex(attributeIndex); if (index(index) == attributeIndex) { this.attributeValues[index] = d; } else { // We need to add the value } }
/** * Sets the value. * * @param attributeIndex the attribute index * @param d the d */ @Override public void setValue(int attributeIndex, double d) { int index = locateIndex(attributeIndex); if (index(index) == attributeIndex) { this.attributeValues[index] = d; } else { // We need to add the value } }
public void deleteAttributeAt(int position) { int index = locateIndex(position);
+ "of range"); int index = locateIndex(position);