Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class IntSetImpl implements IntSet {
- private List<Integer> conjunto; //lista de inteiros
- IntSetImpl ( ) {
- this.conjunto = new ArrayList <Integer>(); //crio nova lista de inteiros vazia
- }
- void insert ( int x ) {
- this.conjunto.add(x);
- }
- void insertAll ( int [ ] v ){
- int count = 0;
- while (count < v.size ) {
- insert(v[count]);
- count++;
- }
- }
- void remove ( int x ) {
- this.conjunto.remove(x);
- }
- boolean isIn ( int x ) {
- return this.conjunto.contains(x);
- }
- int size ( ) {
- return this.conjunto.size();
- }
- void forAll ( Visitor v ) {
- System.out.println("numero eh" conjunto );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement