Ignore:
Timestamp:
2016-09-07T01:23:17+02:00 (4 years ago)
Author:
Don-vip
Message:

remove deprecated stuff - gsoc-core

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/Utils.java

    r10931 r10972  
    88import java.awt.Color;
    99import java.awt.Font;
    10 import java.awt.datatransfer.Clipboard;
    11 import java.awt.datatransfer.Transferable;
    1210import java.awt.font.FontRenderContext;
    1311import java.awt.font.GlyphVector;
     
    5452import java.util.regex.Matcher;
    5553import java.util.regex.Pattern;
    56 import java.util.stream.Stream;
    5754import java.util.zip.GZIPInputStream;
    5855import java.util.zip.ZipEntry;
     
    6966import org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream;
    7067import org.openstreetmap.josm.Main;
    71 import org.openstreetmap.josm.gui.datatransfer.ClipboardUtils;
    7268import org.w3c.dom.Document;
    7369import org.xml.sax.InputSource;
     
    9995    private Utils() {
    10096        // Hide default constructor for utils classes
    101     }
    102 
    103     /**
    104      * Tests whether {@code predicate} applies to at least one element from {@code collection}.
    105      * <p>
    106      * @param <T> type of items
    107      * @param collection the collection
    108      * @param predicate the predicate
    109      * @return {@code true} if {@code predicate} applies to at least one element from {@code collection}
    110      * @deprecated use {@link Stream#anyMatch(Predicate)} instead.
    111      */
    112     @Deprecated
    113     public static <T> boolean exists(Iterable<? extends T> collection, Predicate<? super T> predicate) {
    114         for (T item : collection) {
    115             if (predicate.test(item)) {
    116                 return true;
    117             }
    118         }
    119         return false;
    120     }
    121 
    122     /**
    123      * Tests whether {@code predicate} applies to all elements from {@code collection}.
    124      * <p>
    125      * @param <T> type of items
    126      * @param collection the collection
    127      * @param predicate the predicate
    128      * @return {@code true} if {@code predicate} applies to all elements from {@code collection}
    129      * @deprecated use {@link Stream#allMatch(Predicate)} instead.
    130      */
    131     @Deprecated
    132     public static <T> boolean forAll(Iterable<? extends T> collection, Predicate<? super T> predicate) {
    133         return !exists(collection, predicate.negate());
    13497    }
    13598
     
    580543        }
    581544        return true;
    582     }
    583 
    584     /**
    585      * Copies the string {@code s} to system clipboard.
    586      * @param s string to be copied to clipboard.
    587      * @return true if succeeded, false otherwise.
    588      * @deprecated Use {@link ClipboardUtils#copyString(String)}. To be removed end of 2016.
    589      */
    590     @Deprecated
    591     public static boolean copyToClipboard(String s) {
    592         return ClipboardUtils.copyString(s);
    593     }
    594 
    595     /**
    596      * Extracts clipboard content as {@code Transferable} object.
    597      * @param clipboard clipboard from which contents are retrieved
    598      * @return clipboard contents if available, {@code null} otherwise.
    599      * @since 8429
    600      * @deprecated Use {@link ClipboardUtils#getClipboardContent(Clipboard)} instead. To be removed end of 2016.
    601      */
    602     @Deprecated
    603     public static Transferable getTransferableContent(Clipboard clipboard) {
    604         return ClipboardUtils.getClipboardContent(clipboard);
    605     }
    606 
    607     /**
    608      * Extracts clipboard content as string.
    609      * @return string clipboard contents if available, {@code null} otherwise.
    610      * @deprecated Use {@link ClipboardUtils#getClipboardStringContent()}. To be removed end of 2016
    611      */
    612     @Deprecated
    613     public static String getClipboardContent() {
    614         return ClipboardUtils.getClipboardStringContent();
    615545    }
    616546
Note: See TracChangeset for help on using the changeset viewer.