Title: Description: Copyright: Copyright (c) 2001 Company: @version 1.0
| 9 | */ |
| 10 | |
| 11 | public abstract class AbstractSet extends AbstractCollection implements Set |
| 12 | { |
| 13 | protected AbstractSet() |
| 14 | { |
| 15 | } |
| 16 | |
| 17 | public boolean equals(Object o) |
| 18 | { |
| 19 | if(this==o) |
| 20 | return true; |
| 21 | if(o==null) |
| 22 | return false; |
| 23 | if(!(o instanceof Set)) |
| 24 | return false; |
| 25 | if(((Set)o).size()!=size()) |
| 26 | return false; |
| 27 | return containsAll((Collection)o); |
| 28 | } |
| 29 | |
| 30 | public int hashCode() |
| 31 | { |
| 32 | int hashCode=0; |
| 33 | Iterator it=iterator(); |
| 34 | while(it.hasNext()) |
| 35 | { |
| 36 | Object o=it.next(); |
| 37 | if(o!=null) |
| 38 | hashCode+=o.hashCode(); |
| 39 | } |
| 40 | return hashCode; |
| 41 | } |
| 42 | } |
nothing calls this directly
no outgoing calls
no test coverage detected