public class IntSet extends 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(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(Object o)
public int indexOf(int element)
Copyright © 2006–2014 The Apache Software Foundation. All rights reserved.