Example usage for java.lang UnsupportedOperationException UnsupportedOperationException

List of usage examples for java.lang UnsupportedOperationException UnsupportedOperationException

Introduction

In this page you can find the example usage for java.lang UnsupportedOperationException UnsupportedOperationException.

Prototype

public UnsupportedOperationException(Throwable cause) 

Source Link

Document

Constructs a new exception with the specified cause and a detail message of (cause==null ?

Usage

From source file:ListOfLists.java

public ListOfLists(Collection c) {
    Iterator it = c.iterator();/*from  w w w  . j  av a  2 s. com*/
    Object o;
    while (it.hasNext()) {
        o = it.next();
        if (o instanceof List)
            lists.add(o);
        else if (o != null)
            throw new UnsupportedOperationException(this.getClass().getName()
                    + " class supports only instances " + "of java.util.List interface");
    }
}

From source file:com.opengamma.analytics.math.function.special.JacobiPolynomialFunction.java

@Override
public Pair<DoubleFunction1D, DoubleFunction1D>[] getPolynomialsAndFirstDerivative(final int n) {
    throw new UnsupportedOperationException(
            "Need values for alpha and beta for Jacobi polynomial function generation");
}

From source file:IteratorUtils.java

public static Iterator oneElementUnmodifiableIterator(final Object elem) {
    return new Iterator() {
        boolean shot = false;

        public boolean hasNext() {
            return (!shot);
        }//from   w  ww  .  jav  a 2  s . c  om

        public Object next() {
            if (shot)
                throw new NoSuchElementException();
            else {
                shot = true;
                return elem;
            }
        }

        public void remove() {
            throw new UnsupportedOperationException("remove() not supported.");
        }
    };
}

From source file:com.karki.spring.dao.impl.EnrollmentDaoImpl.java

@Override
public int update(Enrollment enrollment) throws ClassNotFoundException, SQLException {
    throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}

From source file:hr.diskobolos.service.impl.NomenclatureOfSportServiceImpl.java

@Override
public void persist(NomenclatureOfSport entity) {
    throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}

From source file:Main.java

/**
 * Returns a decorated list with a limited amount of elements.
 * @param decorated the decorated list to be limited
 * @param maxSize the maximum size of the list
 * @param silent if true, when an element is added, and the maximum size has been reached, 
 * it silently ignores the operation, otherwise it throws an exception
 * @return the newly decorated list// w  ww .j a va2  s.  com
 * @throws IllegalArgumentException if the decorated list has already more elements than maxSize
 */
public static <T> List<T> maxSizeLimit(final List<T> decorated, final int maxSize, final boolean silent) {
    if (decorated.size() > maxSize) {
        throw new IllegalArgumentException("The list contains already more elements than " + maxSize);
    }
    return new ForwardingList<T>() {
        @Override
        public boolean addAll(Collection<? extends T> collection) {
            return standardAddAll(collection);
        }

        @Override
        public boolean addAll(int index, Collection<? extends T> elements) {
            return standardAddAll(index, elements);
        }

        public boolean add(T e) {
            if (!checkMaxSize())
                return false;
            return delegate().add(e);
        }

        @Override
        public void add(final int index, final T e) {
            if (!checkMaxSize())
                return;
            delegate().add(index, e);
        }

        private boolean checkMaxSize() {
            if (size() >= maxSize) {
                if (silent) {
                    return false;
                }
                throw new UnsupportedOperationException("Maximum Size " + maxSize + " reached");
            }
            return true;
        }

        @Override
        protected List<T> delegate() {
            return decorated;
        }
    };
}

From source file:ch.iceage.icedms.persistence.jdbc.query.impl.DefaultUserQueries.java

@Override
public String getAll(User criteria) {
    throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}

From source file:io.bluecell.dao.DocumentDAOImpl.java

@Override
public void save(gate.Document p) {
    throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.        
    //        Session session = this.sessionFactory.openSession();
    //        Transaction tx = session.beginTransaction();
    //        session.persist(p);
    //        tx.commit();
    //        session.close();
}

From source file:com.mir00r.spring_mvc.service.ProductServiceImplementation.java

@Override
@Transactional//from ww w .  j  a v a  2s. com
public void UpdateProduct(Product product) {
    throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}

From source file:com.sharmila.hibernatespringsecurity.dao.impl.RoleDaoImpl.java

@Override
public void insert(Role role) {
    throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}