Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- public class Hand extends TreeSet<E> {
- TreeSet<E> hand = new TreeSet<E>();
- public Hand() {
- }
- public boolean add(E c) {
- return hand.add(c);
- }
- public boolean remove(E c) {
- return hand.remove(c);
- }
- public String toString() {
- //hand.comparator();
- return hand.toString();
- }
- public boolean equals(Object o) {
- if(this == o) return true;
- if(this == null) return false;
- if(o.getClass() != getClass()) return false;
- TreeSet currentSet = (TreeSet<Card>) o;
- if( !hand.equals(currentSet)) return false;
- return true;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement