public void setAttributes(Attribute[] v, int[] indexValues) { if(this.attributesInformation==null) this.attributesInformation= new AttributesInformation(); this.attributesInformation.setAttributes(v,indexValues); }
public Attribute attribute(int w) { return this.attributesInformation.attribute(w); }
/** * Attribute. * * @param indexAttribute the index Attribute * @return the attribute */ public Attribute attribute(int indexAttribute) { if (this.attributes == null) { //All attributes are numeric return defaultNumericAttribute(); } int location = locateIndex(indexAttribute); if (location == -1) { //if there is not attribute information, it is numeric return defaultNumericAttribute(); } return attributes[location]; }
/** * Instantiates a new instance information. * * @param chunk the chunk */ public InstanceInformation(InstanceInformation chunk) { this.relationName = chunk.relationName; this.attributesInformation = new AttributesInformation(chunk.attributesInformation); this.classIndex = chunk.classIndex; this.range = chunk.range; }
public void deleteAttributeAt(int position) { int index = locateIndex(position); this.numberAttributes--; if ((index >= 0) && (indexValues[index] == position)) { int[] tempIndices = new int[indexValues.length - 1]; Attribute[] tempValues = new Attribute[attributes.length - 1]; System.arraycopy(indexValues, 0, tempIndices, 0, index); System.arraycopy(attributes, 0, tempValues, 0, index); for (int i = index; i < indexValues.length - 1; i++) { tempIndices[i] = indexValues[i + 1] - 1; tempValues[i] = attributes[i + 1]; } indexValues = tempIndices; attributes = tempValues; } else { int[] tempIndices = new int[indexValues.length]; Attribute[] tempValues = new Attribute[attributes.length]; System.arraycopy(indexValues, 0, tempIndices, 0, index + 1); System.arraycopy(attributes, 0, tempValues, 0, index + 1); for (int i = index + 1; i < indexValues.length; i++) { tempIndices[i] = indexValues[i] - 1; tempValues[i] = attributes[i]; } indexValues = tempIndices; attributes = tempValues; } }
public void insertAttributeAt(Attribute attribute, int i) { this.attributesInformation.insertAttributeAt(attribute,i) ; if (this.classIndex >= i) { this.classIndex++; } }
public void deleteAttributeAt(int integer) { this.attributesInformation.deleteAttributeAt(integer); if (this.classIndex > integer) { this.classIndex--; } }
/** * Instantiates a new instance information. * * @param st the st * @param input the input */ public InstanceInformation(String st, Attribute[] input) { this.relationName = st; this.attributesInformation = new AttributesInformation(input, input.length); }
+ "of range"); int index = locateIndex(position);
public void setAttributes(Attribute[] v) { if(this.attributesInformation==null) this.attributesInformation= new AttributesInformation(); this.attributesInformation.setAttributes(v); }
public Attribute outputAttribute(int w) { return this.attributesInformation.attribute(outputAttributeIndex(w)); }
/** * Instantiates a new instance information. * * @param st the st * @param input the input */ public InstanceInformation(String st, List<Attribute> input) { this.relationName = st; this.attributesInformation = new AttributesInformation(input, input.size()); }
public Attribute inputAttribute(int w) { return this.attributesInformation.attribute(inputAttributeIndex(w)); }
public int numClasses() { return this.attributesInformation.attribute(classIndex()).numValues(); }