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:Main.java

public static File locateFileInApp(String filePath) {
    throw new UnsupportedOperationException("Not Yet implemented");
}

From source file:Main.java

public static final String dereference(String idRef) {
    URI uri = URI.create(idRef);
    String part = uri.getSchemeSpecificPart();
    if (part != null && part.length() > 0) {
        throw new UnsupportedOperationException(
                "modlur does not support external sources (" + uri.toString() + ")");
    }//from  w  w  w  .j  ava  2s  . co  m
    return uri.getFragment();
}

From source file:Main.java

private static Set<String> getQueryParameterNames(Uri uri) {
    if (uri.isOpaque()) {
        throw new UnsupportedOperationException("This isn't a hierarchical URI.");
    }/*w  ww. java  2  s.c o m*/

    String query = uri.getEncodedQuery();
    if (query == null) {
        return Collections.emptySet();
    }

    Set<String> names = new LinkedHashSet<String>();
    int start = 0;
    do {
        int next = query.indexOf('&', start);
        int end = (next == -1) ? query.length() : next;

        int separator = query.indexOf('=', start);
        if (separator > end || separator == -1) {
            separator = end;
        }

        String name = query.substring(start, separator);
        names.add(Uri.decode(name));

        // Move start to end of name.
        start = end + 1;
    } while (start < query.length());

    return Collections.unmodifiableSet(names);
}

From source file:Main.java

@SuppressWarnings("rawtypes")
public static final HashMap readMapXml(InputStream in) throws XmlPullParserException, IOException {
    throw new UnsupportedOperationException("STUB");
}

From source file:Main.java

public static Set<String> getQueryParameterNames(Uri uri) {
    if (uri.isOpaque()) {
        throw new UnsupportedOperationException("This isn't a hierarchical URI.");
    }/*w  w  w  . j  av a 2 s.co  m*/

    String query = uri.getEncodedQuery();
    if (query == null) {
        return Collections.emptySet();
    }

    Set<String> names = new LinkedHashSet<String>();
    int start = 0;
    do {
        int next = query.indexOf('&', start);
        int end = next == -1 ? query.length() : next;

        int separator = query.indexOf('=', start);
        if (separator > end || separator == -1) {
            separator = end;
        }

        String name = query.substring(start, separator);
        names.add(Uri.decode(name));

        // Move start to end of name.
        start = end + 1;
    } while (start < query.length());

    return Collections.unmodifiableSet(names);
}

From source file:Main.java

public static ActivityManager getActivityManager(Context context) {
    ActivityManager result = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
    if (result == null)
        throw new UnsupportedOperationException("Could not retrieve ActivityManager");
    return result;
}

From source file:Main.java

public static <T> Iterator<T> readOnlyIterator(final Iterator<T> iterator) {
    return new Iterator<T>() {
        @Override/*www. j  ava  2s.c  o  m*/
        public boolean hasNext() {
            return iterator.hasNext();
        }

        @Override
        public T next() {
            return iterator.next();
        }

        @Override
        public void remove() {
            throw new UnsupportedOperationException("read only iterator");
        }
    };
}

From source file:Main.java

public static <T> Iterable<T> makeEmptyIterable() {
    return new Iterable<T>() {
        public Iterator<T> iterator() {
            return new Iterator<T>() {
                public boolean hasNext() {
                    return false;
                }/*  ww  w  . j av a2 s.  c om*/

                public T next() {
                    return null;
                }

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

From source file:Main.java

public static GraphicsDevice defaultScreenDevice() {
    GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment();
    if (env == null)
        throw new UnsupportedOperationException("Could not get Local Graphics Environment");
    GraphicsDevice dev = env.getDefaultScreenDevice();
    if (dev == null)
        throw new UnsupportedOperationException("Could not get Default Graphics Device");
    return dev;/*from  www.j  a v a2 s  . c  om*/
}

From source file:Main.java

public static <ELEMENT_TYPE> Iterator<ELEMENT_TYPE> unmodifiableEmptyIterator() {
    return new Iterator<ELEMENT_TYPE>() {

        @Override/*from  ww  w. j a v a 2 s. co m*/
        public boolean hasNext() {
            return false;
        }

        @Override
        public ELEMENT_TYPE next() {
            throw new NoSuchElementException();
        }

        @Override
        public void remove() {
            throw new UnsupportedOperationException("This collection is imutable and empty");
        }

    };
}