java - Do containsAll() and retainAll() in the Collection interface address cardinality? -
In Java, all are included and the apple class in all the essence of maintaining clearly tells that cardinality is not respected So, in other words this is not how many examples of value on each side? Since all Java collections in the standard library extend the collection of Absolute, it is believed that all of them do the same thing.
However, the documentation in these collections interface does not say anything. Should anyone estimate the estimation of abstraction, or whether it is left unspecified for this purpose, to allow someone to define a collection of different ways? For example, in the Epache collection, the bag clearly states that it respects cardinality, and claims that it violates the version contract from the collection (even if it is not really).
So what is the meaning of these operations in the archive rather than abstraction?
EDIT: Although people think that's why I care, this is because in the form of part of my PhD. The work I have demonstrated is that developers do not expect a breach of conformance in Apache, but I am trying to understand why the collection interface was left so obscure.
For everyone, javadocs (in the archive) says:
Returns: The fact is that if all the elements are included in the collection specified in this archive
and to maintain all (in the archive):
The specified collection ( Alternate Operations) contained in this collection only retains elements. In other words, all the elements are removed from this compilation, which are not included in the specified collection.
I have read that all contracts mean that all (B) will return right to the call, if and only if, for each element in B, will call a blanket (BELM) That will be true I would also say that this is a blanket. All (some action) will also come true. As you tell Javadox for abstract interpretation, it clearly states:
This implementation repeats on the specified collection, to see if it is included in the collection, Rotate checks each element given by iterator. If all elements are really included then returned is returned, otherwise wrong.
I agree that the contact for the collection includes all the more clear to avoid any possibility for confusion. (And that it should not be necessary to read Jwdox of Jwdoxox to understand the collection)
After making a call I could not make any assumption regarding the number of all duplicate elements. There is no point in how the contract given in the collection (from my reading) will in any way be controlled either in duplicate in the collection. Many of the collections in the collection all based on the collection. Many possible results of a result of All (B) all are appropriate:
- In the result, there is at least one copy in which there is at least one copy, / Li>
- Each element in the result (including duplicate) Except for one of them,
- or even, the number of copies found in somewhere between 1 and 1, leaving each of these elements, B, I would not have either # 1 or # 2 , But on the basis of contract, none of these three could be legal.
For the Abstract Collection, Jawadox confirms that it uses # 2:
This implementation repeats on this archive, to see For whether it is included in the specified collection, in turn examine each element given by iterative. If it is not, then it has been removed from the collection of Iterator from this collection
However, since this original collection is not in my studies of the interface of the interface, I do not necessarily Belief is usually the behavior of the collection in such a way.
It is possible that you should consider submitting an updated update to Javadock once done by you.
As the 'collection interface was left so vague' - I seriously suspect that it was deliberately done - maybe something that was not given its priority, when that part of the API Was being written.
Comments
Post a Comment