/** * Get the number of possible values for the feature with the given index number. This method must only be called for * byte-valued or short-valued features. * * @param featureIndex * the index number of the feature. * @return for byte-valued and short-valued features, return the number of values. * @throws IndexOutOfBoundsException * if featureIndex < 0 or featureIndex ≥ getNumberOfByteFeatures() + getNumberOfShortFeatures(). */ public int getNumberOfValues(int featureIndex) { if (featureIndex < numByteFeatures) return byteFeatureValues[featureIndex].getNumberOfValues(); featureIndex -= numByteFeatures; if (featureIndex < numShortFeatures) return shortFeatureValues[featureIndex].getNumberOfValues(); throw new IndexOutOfBoundsException("Feature no. " + featureIndex + " is not a byte-valued or short-valued feature"); }
/** * Get the number of possible values for the feature with the given index number. This method must only be called for * byte-valued or short-valued features. * * @param featureIndex * the index number of the feature. * @return for byte-valued and short-valued features, return the number of values. * @throws IndexOutOfBoundsException * if featureIndex < 0 or featureIndex ≥ getNumberOfByteFeatures() + getNumberOfShortFeatures(). */ public int getNumberOfValues(int featureIndex) { if (featureIndex < numByteFeatures) return byteFeatureValues[featureIndex].getNumberOfValues(); featureIndex -= numByteFeatures; if (featureIndex < numShortFeatures) return shortFeatureValues[featureIndex].getNumberOfValues(); throw new IndexOutOfBoundsException("Feature no. " + featureIndex + " is not a byte-valued or short-valued feature"); }
@Test public void maxListLength() { Assert.assertEquals(tMax.getNumberOfValues(), listMax.length); }
@Test public void smallListLength() { Assert.assertEquals(t10.getNumberOfValues(), list10.length); }
/** * Get the number of possible values for the feature with the given index number. This method must only be called for * byte-valued or short-valued features. * * @param featureIndex * the index number of the feature. * @return for byte-valued and short-valued features, return the number of values. * @throws IndexOutOfBoundsException * if featureIndex < 0 or featureIndex ≥ getNumberOfByteFeatures() + getNumberOfShortFeatures(). */ public int getNumberOfValues(int featureIndex) { if (featureIndex < numByteFeatures) return byteFeatureValues[featureIndex].getNumberOfValues(); featureIndex -= numByteFeatures; if (featureIndex < numShortFeatures) return shortFeatureValues[featureIndex].getNumberOfValues(); throw new IndexOutOfBoundsException("Feature no. " + featureIndex + " is not a byte-valued or short-valued feature"); }