Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package javaapplication10;
- import java.util.HashSet;
- import java.util.Objects;
- import java.util.Set;
- class ListSet<T> implements Set<T> {
- private List<T> bs = new LinkedList<T>();
- @Override
- public int size() {
- return bs.size();
- }
- @Override
- public boolean isEmpty() {
- return bs.isEmpty();
- }
- @Override
- public boolean contains(Object o) {
- throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
- }
- @Override
- public Iterator<T> iterator() {
- throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
- }
- @Override
- public Object[] toArray() {
- throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
- }
- @Override
- public <T> T[] toArray(T[] a) {
- throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
- }
- @Override
- public boolean add(T e) {
- throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
- }
- @Override
- public boolean remove(Object o) {
- throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
- }
- @Override
- public boolean containsAll(Collection<?> c) {
- throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
- }
- @Override
- public boolean addAll(Collection<? extends T> c) {
- throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
- }
- @Override
- public boolean retainAll(Collection<?> c) {
- throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
- }
- @Override
- public boolean removeAll(Collection<?> c) {
- throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
- }
- @Override
- public void clear() {
- throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
- }
- }
- class Fraction
- {
- char num, den;
- boolean isReal;
- float _doubleValue;
- String _englishVersion;
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- final Fraction other = (Fraction) obj;
- if (this.num != other.num) {
- return false;
- }
- if (this.den != other.den) {
- return false;
- }
- return true;
- }
- @Override
- public int hashCode() {
- int hash = 3;
- hash = 19 * hash + this.num;
- hash = 19 * hash + this.den;
- hash = 19 * hash + (this.isReal ? 1 : 0);
- hash = 19 * hash + Float.floatToIntBits(this._doubleValue);
- hash = 19 * hash + Objects.hashCode(this._englishVersion);
- return hash;
- }
- }
- public class JavaApplication10 {
- public static void main(String[] args) {
- Set<String> hashSet = new HashSet<>();
- Set<String> listSet = new ListSet<>();
- String s = randomString();
- }
- private static String randomString() {
- throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
- }
- }
Add Comment
Please, Sign In to add comment