google-code-export / dkpro-tc

Automatically exported from code.google.com/p/dkpro-tc
Other
1 stars 0 forks source link

Duplicate methods in FeatureStore interface #197

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
FeatureStore has these two same methods:

    /**
     * @return The number of instances in the store.
     */
    public int size();

    /**
     * @return The number of instances in the store.
     */
    public int getNumberOfInstances();

and in its only implementation (SimpleFeatureStore), size() calls 
getNumberOfInstances().

I suggest to keep only getNumberOfInstances() as it is more descriptive, 
because calling to size() is typical to Collection.size() interface, which is 
not a supertype here.

Original issue reported on code.google.com by ivan.hab...@gmail.com on 15 Oct 2014 at 11:32

GoogleCodeExporter commented 9 years ago
I'd prefer size() ;) Unless there are multiple sizes that could be measured 
here... which I believe is not the case.

Original comment by richard.eckart on 15 Oct 2014 at 11:34

GoogleCodeExporter commented 9 years ago
I have no idea why I added two versions ... :/

I am fine with both, but I think that getNumberOfInstances() is semantically 
more verbose and thus preferable.
size could also refer to number of instances times number of features etc.

Original comment by torsten....@gmail.com on 15 Oct 2014 at 11:37

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r1200.

Original comment by torsten....@gmail.com on 29 Oct 2014 at 3:58