public class IntSet
extends java.lang.Object
Set
interface
for performance reasons, though methods with the same name are equivalent.Constructor and Description |
---|
IntSet()
Creates a new instance of this set.
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(int element)
Adds the specified int to this set.
|
boolean |
contains(int element)
Tests if this set contains the specified element.
|
boolean |
equals(java.lang.Object o)
Tests if two sets are equal.
|
int |
get(int n) |
int |
hashCode() |
int |
indexOf(int element) |
void |
remove(int n)
Removes the
n -th element in this set. |
int |
size() |
public boolean add(int element)
element
- the integer to be added.true
if this set did not already contain this element,
false
otherwise.public boolean contains(int element)
element
- the element to be tested.true
if the element is contained in this set, false
otherwise.public int size()
public int get(int n)
n
-th element in this set.public void remove(int n)
n
-th element in this set.public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
s
- the set to be tested for equality with this set.true
if the sets are equal, false
otherwise.public int hashCode()
hashCode
in class java.lang.Object
public int indexOf(int element)
Copyright © 2013. All Rights Reserved.