[
https://issues.apache.org/jira/browse/COMMONSRDF-17?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14508176#comment-14508176
]
Stian Soiland-Reyes commented on COMMONSRDF-17:
-----------------------------------------------
Being compatible with Collection was also discussed in
https://github.com/commons-rdf/commons-rdf/issues/46
It would require renaming, e.g. addTriple(), removeTriple() and tripleCount()
(in a way I like "tripleCount" better than "size()", as it implies a possibly
non-lightweight counting process, which is what many backends would have to do.)
But I am not quite sure of the use-case - I first encountered this when I made
simple.GraphImpl - but there I eventually found moving the container to be a
child field made the class much simpler to understand.
I think the adapter class sounds like a sane approach, as it can then be used
with any Graph. Is that something you would be willing to have a go at, Reto? I
think it could somewhat fit within simple/.
> Size method
> -----------
>
> Key: COMMONSRDF-17
> URL: https://issues.apache.org/jira/browse/COMMONSRDF-17
> Project: Apache Commons RDF
> Issue Type: Improvement
> Reporter: Reto Gmür
>
> The size method is problematic for two reasons:
> - it is incompatible with the Collections-API, implementations cannot at the
> same time implement Collection<Triple> (even though a Graph is a collection
> of triples).
> - With some types of implementations calculating the exact size of a graph
> can be very expensive and often the client just requires an approximate size
> So I propose to replace the size method with the following
> [- size: int: same as in Collection.size (returns Integer.MAX_VALUE for
> bigger graphs) ]
> - exactSize: long: the exact size
> - approximateSize: long: the approximate size
> For all but exactSize the interface can provide default implementations.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)