Example usage for java.util SortedSet addAll

List of usage examples for java.util SortedSet addAll

Introduction

In this page you can find the example usage for java.util SortedSet addAll.

Prototype

boolean addAll(Collection<? extends E> c);

Source Link

Document

Adds all of the elements in the specified collection to this set if they're not already present (optional operation).

Usage

From source file:edu.cornell.mannlib.vitro.webapp.modelaccess.ontmodels.JoinedOntModelCache.java

@Override
public SortedSet<String> getModelNames() {
    SortedSet<String> allNames = new TreeSet<>(primary.getModelNames());
    allNames.addAll(secondary.getModelNames());
    return allNames;
}

From source file:edu.cornell.mannlib.vitro.webapp.modelaccess.ontmodels.MaskingOntModelCache.java

/** The list of names in the baseCache may have changed. */
@Override//from   w  w w .  j av  a2s.c o m
public SortedSet<String> getModelNames() {
    SortedSet<String> allNames = new TreeSet<>(baseCache.getModelNames());
    allNames.addAll(maskingNames);
    return allNames;
}

From source file:io.pravega.client.batch.impl.BatchClientImpl.java

private Iterator<SegmentInfo> listSegments(Stream stream, Date from) {
    // modify iteration above but starting with a timestamp and ending with a break
    Map<Segment, Long> segments = getAndHandleExceptions(controller.getSegmentsAtTime(
            new StreamImpl(stream.getScope(), stream.getStreamName()), from.getTime()), RuntimeException::new);
    SortedSet<Segment> result = new TreeSet<>();
    result.addAll(segments.keySet());
    result.addAll(getAndHandleExceptions(controller.getSuccessors(new StreamCut(stream, segments)),
            RuntimeException::new));
    return Iterators.transform(result.iterator(), s -> segmentToInfo(s));
}

From source file:com.dowdandassociates.gentoo.bootstrap.LatestImageProvider.java

@Override
public Optional<Image> get() {
    DescribeImagesResult result = ec2Client.describeImages(getRequest());

    Map<String, Image> imageMap = new HashMap<String, Image>();

    for (Image image : result.getImages()) {
        String imageLocation = StringUtils.substringAfterLast(image.getImageLocation(), "/");
        if (StringUtils.isBlank(imageLocation)) {
            imageLocation = image.getImageLocation();
        }//from  w  ww.jav a2s .  co  m
        log.info("imageLocation = " + imageLocation);
        imageMap.put(imageLocation, image);
    }

    if (imageMap.isEmpty()) {
        return Optional.absent();
    }

    SortedSet<String> sortedKeySet = new TreeSet<String>();
    sortedKeySet.addAll(imageMap.keySet());
    String[] keys = sortedKeySet.toArray(new String[0]);
    log.info("key = " + keys[keys.length - 1]);
    return Optional.fromNullable(imageMap.get(keys[keys.length - 1]));
}

From source file:org.apache.ctakes.ytex.kernel.dao.SortedSetUserType.java

private Set<String> stringToSortedSet(String s) {
    String[] elements = s.split("\\|");
    SortedSet<String> set = new TreeSet<String>();
    set.addAll(Arrays.asList(elements));
    return set;//  w  w w .  ja  va  2s .  c  o m
}

From source file:com.vrem.wifianalyzer.wifi.band.WiFiChannelCountryGHZ5.java

WiFiChannelCountryGHZ5() {
    SortedSet<Integer> channelsSet1 = new TreeSet<>(Arrays.asList(36, 40, 44, 48, 52, 56, 60, 64));
    SortedSet<Integer> channelsSet2 = new TreeSet<>(
            Arrays.asList(100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 144));
    SortedSet<Integer> channelsSet3 = new TreeSet<>(Arrays.asList(149, 153, 157, 161, 165));

    SortedSet<Integer> channelsToExcludeCanada = new TreeSet<>(Arrays.asList(120, 124, 128));
    SortedSet<Integer> channelsToExcludeIsrael = new TreeSet<>(channelsSet2);
    channelsToExcludeIsrael.addAll(channelsSet3);

    channelsToExclude = new HashMap<>();
    channelsToExclude.put("AU", channelsToExcludeCanada); // Australia
    channelsToExclude.put("CA", channelsToExcludeCanada); // Canada
    channelsToExclude.put("CN", channelsSet2); // China
    channelsToExclude.put("IL", channelsToExcludeIsrael); // Israel
    channelsToExclude.put("JP", channelsSet3); // Japan
    channelsToExclude.put("KR", channelsSet2); // South Korea
    channelsToExclude.put("TR", channelsSet3); // Turkey
    channelsToExclude.put("ZA", channelsSet3); // South Africa

    channels = new TreeSet<>(channelsSet1);
    channels.addAll(channelsSet2);/*from  w  ww . j  ava  2 s. co  m*/
    channels.addAll(channelsSet3);
}

From source file:com.gammalabs.wifianalyzer.wifi.band.WiFiChannelCountryGHZ5.java

WiFiChannelCountryGHZ5() {
    SortedSet<Integer> channelsSet1 = new TreeSet<>(Arrays.asList(36, 40, 44, 48, 52, 56, 60, 64));
    SortedSet<Integer> channelsSet2 = new TreeSet<>(
            Arrays.asList(100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140));
    SortedSet<Integer> channelsSet3 = new TreeSet<>(Arrays.asList(149, 153, 157, 161, 165));

    SortedSet<Integer> channelsToExcludeCanada = new TreeSet<>(Arrays.asList(120, 124, 128));
    SortedSet<Integer> channelsToExcludeIsrael = new TreeSet<>(channelsSet2);
    channelsToExcludeIsrael.addAll(channelsSet3);

    channelsToExclude = new HashMap<>();
    channelsToExclude.put("AU", channelsToExcludeCanada); // Australia
    channelsToExclude.put("CA", channelsToExcludeCanada); // Canada
    channelsToExclude.put("CN", channelsSet2); // China
    channelsToExclude.put("IL", channelsToExcludeIsrael); // Israel
    channelsToExclude.put("JP", channelsSet3); // Japan
    channelsToExclude.put("KR", channelsSet2); // South Korea
    channelsToExclude.put("TR", channelsSet3); // Turkey
    channelsToExclude.put("ZA", channelsSet3); // South Africa

    channels = new TreeSet<>(channelsSet1);
    channels.addAll(channelsSet2);// ww w. ja  v  a 2 s .  co m
    channels.addAll(channelsSet3);
}

From source file:com.liangc.hq.base.utils.BizappUtils.java

public static List sortAIResource(List resource) {
    List sortedList = new ArrayList();
    SortedSet sSet = new TreeSet(new BizappUtils().new AIResourceIdComparator());
    sSet.addAll(resource);
    CollectionUtils.addAll(sortedList, sSet.iterator());
    return sortedList;
}

From source file:org.apache.ctakes.ytex.kernel.dao.StringArrayUserType.java

private String stringArrayToString(String[] set) {
    StringBuilder b = new StringBuilder();
    SortedSet<String> s = new TreeSet<String>();
    s.addAll(Arrays.asList(set));
    Iterator<String> iter = s.iterator();
    while (iter.hasNext()) {
        b.append(iter.next());/*from w  w w .ja  va2s  .  com*/
        if (iter.hasNext()) {
            b.append("|");
        }
    }
    return b.toString();
}

From source file:org.jenkinsci.plugins.securityinspector.SecurityInspectorReport.java

public final void generateReport(Set<TRow> rows, Set<TColumnItem> columns, Set<TColumnGroup> groups) {
    this.entries = new MultiKeyMap();
    this.groups = new HashSet<TColumnGroup>(groups);
    SortedSet<TRow> sortedRow = new TreeSet<TRow>(getComparator());
    sortedRow.addAll(rows);
    this.rows = sortedRow;
    this.columns = columns;

    for (TRow row : rows) {
        for (TColumnItem column : columns) {
            entries.put(row, column, getEntryReport(row, column));
        }//from  www  .j  ava 2s  .  co  m
    }
}