Java 类org.apache.commons.collections4.list.SetUniqueList 实例源码

项目:mychart    文件:ConsultarCancoesWorker.java   
@Override
protected Collection<Cancao> doInBackground() throws Exception {
    verificarSeExemploFoiDefinido();

    logger.info("Consultando canções com base em exemplo: {}", exemplo);
    List<Cancao> cancoes = new ArrayList<>();
    List<Cancao> cancoesUniqueList = SetUniqueList.setUniqueList(cancoes);

    logger.debug("Consultando no repositório local");
    cancoesUniqueList.addAll(repositorio.consultarPor(exemplo));

    logger.debug("Consultando na web");
    cancoesUniqueList.addAll(cancaoWs.consultarPor(exemplo));

    logger.debug("Ordenando canções");
    cancoes.sort(new CancoesPorTituloComparator());

    return cancoesUniqueList;
}
项目:mychart    文件:ConsultarArtistasWorker.java   
@Override
protected Collection<Artista> doInBackground() throws Exception {
    verificarSeExemploFoiDefinido();

    logger.info("Consultando artistas com base em exemplo: {}", exemplo);
    List<Artista> artistas = new ArrayList<>();
    List<Artista> artistasUniqueList = SetUniqueList.setUniqueList(artistas);

    logger.debug("Consultando no repositório local");
    Collection<Artista> artistasLocais = repositorio.consultarPor(exemplo);
    artistasLocais.forEach(artista -> artista.setPersistente(true));
    artistasUniqueList.addAll(artistasLocais);

    logger.debug("Consultando na web");
    artistasUniqueList.addAll(artistaWs.consultarPor(exemplo));

    logger.debug("Ordenando artistas");
    artistas.sort(new ArtistasPorNomeComparator());

    return artistasUniqueList;
}
项目:ContentBlocker    文件:FilterRuleDaoImpl.java   
@Override
public List<String> selectRuleTexts(List<Integer> filterIds, boolean useCosmetics) {
    //noinspection unchecked
    List<String> rules = SetUniqueList.setUniqueList(new ArrayList<String>());

    for (int filterId : filterIds) {
        addRules(filterId, rules, useCosmetics);
    }

    return rules;
}
项目:syncope    文件:SyncopeConsoleSession.java   
public List<String> getAuthRealms() {
    List<String> sortable = new ArrayList<>();
    List<String> available = SetUniqueList.setUniqueList(sortable);
    auth.entrySet().forEach(entitlement -> {
        available.addAll(entitlement.getValue());
    });
    Collections.sort(sortable);
    return sortable;
}
项目:simple-datastore    文件:ListProperty.java   
@Override
public void add(final int index, final V element) {
    if (keepUniqueElements) {
        SetUniqueList.setUniqueList(getList()).add(index, element);
    } else {
        getList().add(index, element);
    }
}
项目:raml-validation-proxy    文件:Collector.java   
private SetUniqueList<String> getSet(final Map<String, SetUniqueList<String>> map, final String attr)
{
    if (!map.containsKey(attr))
    {
        map.put(attr, SetUniqueList.setUniqueList(new LinkedList<>()));
    }
    return map.get(attr);
}
项目:raml-validation-proxy    文件:RamlParser.java   
private void addValue(final Map map, final String attr, final String... val)
{
    if (!map.containsKey(attr))
    {
        map.put(attr, SetUniqueList.setUniqueList(new LinkedList<>()));
    }
    Arrays.stream(val).filter(Objects::nonNull).forEach(v -> ((List) map.get(attr)).add(v.trim()));
}
项目:gatk-protected    文件:ReadCountCollectionUtils.java   
/**
 * Creates a new buffer
 */
private Buffer() {
    targets = SetUniqueList.setUniqueList(new ArrayList<>());
    counts = new ArrayList<>();
}
项目:simple-datastore    文件:ListProperty.java   
@Override
public boolean add(final V v) {
    return keepUniqueElements ? SetUniqueList.setUniqueList(getList()).add(v) : getList().add(v);
}
项目:simple-datastore    文件:ListProperty.java   
@Override
public boolean addAll(final Collection<? extends V> c) {
    return keepUniqueElements ? SetUniqueList.setUniqueList(getList()).addAll(c) : getList().addAll(c);
}
项目:simple-datastore    文件:ListProperty.java   
@Override
public boolean addAll(final int index, final Collection<? extends V> c) {
    return keepUniqueElements ? SetUniqueList.setUniqueList(getList()).addAll(index, c) : getList().addAll(index, c);
}
项目:simple-datastore    文件:ListProperty.java   
@Override
public boolean retainAll(final Collection<?> c) {
    return keepUniqueElements ? SetUniqueList.setUniqueList(getList()).retainAll(c) : getList().retainAll(c);
}
项目:simple-datastore    文件:ListProperty.java   
@Override
public V set(final int index, final V element) {
    return keepUniqueElements ? SetUniqueList.setUniqueList(getList()).set(index, element) : getList().set(index, element);
}
项目:util    文件:CommonCollections.java   
/**
 * 队列内元素唯一的List, 内部集成了一个HashSet来实现.
 * 
 * @param list
 *            被包裹的底层List,可先定义ArrayList的初始长度等.
 */
public static <E> SetUniqueList<E> setUniqueList(final List<E> list) {
    return SetUniqueList.setUniqueList(list);
}
项目:gatk-protected    文件:ReadCountCollectionUtils.java   
/**
 * Returns a live modifiable unique list to the targets already in the buffer.
 *
 * @return never {@code null}.
 */
private SetUniqueList<Target> getTargets() {
    return targets;
}