Example usage for java.util LinkedHashSet LinkedHashSet

List of usage examples for java.util LinkedHashSet LinkedHashSet

Introduction

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

Prototype

public LinkedHashSet() 

Source Link

Document

Constructs a new, empty linked hash set with the default initial capacity (16) and load factor (0.75).

Usage

From source file:com.googlecode.jsfFlex.renderkit.html.util.JsfFlexResourceImpl.java

JsfFlexResourceImpl() {
    super();
    _resourceSet = new LinkedHashSet<JsfFlexResourceElement>();
}

From source file:br.com.SGIURD.utils.FileUploadWrapper.java

/**
 * Return all request parameter names, for both regular controls and file
 * upload controls.//from ww w .j  a v  a2 s.com
 */
@Override
public Enumeration<String> getParameterNames() {
    @SuppressWarnings("unchecked")
    Set<String> allNames = new LinkedHashSet();
    allNames.addAll(fRegularParams.keySet());
    allNames.addAll(fFileParams.keySet());
    return Collections.enumeration(allNames);
}

From source file:facebook4j.TargetingParameter.java

public TargetingParameter countries(Collection<String> countries) {
    if (this.countries == null) {
        this.countries = new LinkedHashSet<String>();
    }//from   w  ww.j a  va 2s.  c  o  m
    this.countries.addAll(countries);
    return this;
}

From source file:com.geewhiz.pacify.filter.PacifyVelocityFilter.java

@Override
public LinkedHashSet<Defect> filter(PFile pFile, Map<String, String> propertyValues) {
    LinkedHashSet<Defect> defects = new LinkedHashSet<Defect>();

    if (!BEGIN_TOKEN.equals(pFile.getBeginToken())) {
        defects.add(new WrongTokenDefinedDefect(pFile, "If you use the PacifyVelocityFilter class, only \""
                + BEGIN_TOKEN + "\" is allowed as start token."));
    }/*from www . j ava2s. c  o  m*/

    if (!END_TOKEN.equals(pFile.getEndToken())) {
        defects.add(new WrongTokenDefinedDefect(pFile, "If you use the PacifyVelocityFilter class, only \""
                + END_TOKEN + "\" is allowed as end token."));
    }

    if (!defects.isEmpty()) {
        return defects;
    }

    File fileToFilter = pFile.getFile();
    File tmpFile = FileUtils.createEmptyFileWithSamePermissions(fileToFilter);

    Template template = getTemplate(fileToFilter, pFile.getEncoding());
    Context context = getContext(propertyValues, fileToFilter);

    try {
        FileWriterWithEncoding fw = new FileWriterWithEncoding(tmpFile, pFile.getEncoding());
        template.merge(context, fw);
        fw.close();
        if (!fileToFilter.delete()) {
            throw new RuntimeException("Couldn't delete file [" + fileToFilter.getPath() + "]... Aborting!");
        }
        if (!tmpFile.renameTo(fileToFilter)) {
            throw new RuntimeException("Couldn't rename filtered file from [" + tmpFile.getPath() + "] to ["
                    + fileToFilter.getPath() + "]... Aborting!");
        }
    } catch (IOException e) {
        throw new RuntimeException(e);
    }

    return defects;
}

From source file:com.ignorelist.kassandra.steam.scraper.PathResolver.java

public Set<Path> findAllLibraryDirectories() throws IOException, RecognitionException {
    Path steamApps = findSteamApps();
    Set<Path> libraryDirectories = new LinkedHashSet<>();
    libraryDirectories.add(steamApps);//  w  w  w .j  a v  a2  s  .com
    Path directoryDescriptor = steamApps.resolve("libraryfolders.vdf");
    if (Files.exists(directoryDescriptor)) {
        InputStream vdfStream = Files.newInputStream(directoryDescriptor, StandardOpenOption.READ);
        VdfRoot vdfRoot = VdfParser.parse(vdfStream);
        IOUtils.closeQuietly(vdfStream);
        final VdfNode nodeLibrary = Iterables.getFirst(vdfRoot.getChildren(), null);
        if (null != nodeLibrary) {
            for (VdfAttribute va : nodeLibrary.getAttributes()) {
                //System.err.println(va);
                try {
                    Integer.parseInt(va.getName());
                    Path libraryDirectory = Paths.get(va.getValue());
                    libraryDirectories.add(resolveAppsDirectory(libraryDirectory));
                } catch (NumberFormatException nfe) {
                } catch (IllegalStateException ise) {
                    System.err.println(ise);
                }
            }
        }
    }

    return libraryDirectories;
}

From source file:zipkin.sparkstreaming.job.ZipkinSparkStreamingConfiguration.java

/**
 * This assumes everything is in the uber-jar except perhaps the adjusters (which are themselves
 * self-contained jars).//from  w  w w. j a v  a 2  s  .  co m
 */
static List<String> pathToJars(Class<?> entryPoint, List<Adjuster> adjusters) {
    Set<String> jars = new LinkedHashSet<>();
    jars.add(pathToJar(entryPoint));
    for (Adjuster adjuster : adjusters) {
        jars.add(pathToJar(adjuster.getClass()));
    }
    jars.remove(null);
    return jars.isEmpty() ? null : new ArrayList<>(jars);
}

From source file:com.espertech.esper.filter.FilterHandleSetNode.java

/**
 * Constructor./*  w  w w  .j a v  a 2  s. c om*/
 */
public FilterHandleSetNode() {
    callbackSet = new LinkedHashSet<FilterHandle>();
    indizes = new LinkedList<FilterParamIndexBase>();
    nodeRWLock = new ReentrantReadWriteLock();
}

From source file:io.wcm.tooling.netbeans.sightly.completion.classLookup.RequestAttributeResolver.java

public Set<String> resolve(String filter) {
    Set<String> ret = new LinkedHashSet<>();
    // only display results if filter contains @
    if (!StringUtils.contains(text, "@") || !StringUtils.contains(text, "data-sly-use")) {
        return ret;
    }/* w w  w  .j ava 2s .co m*/
    ElementUtilities.ElementAcceptor acceptor = new ElementUtilities.ElementAcceptor() {
        @Override
        public boolean accept(Element e, TypeMirror type) {
            // we are looking for the annotations
            for (AnnotationMirror mirror : e.getAnnotationMirrors()) {
                if (mirror.getAnnotationType() != null && mirror.getAnnotationType().asElement() != null
                        && StringUtils.equalsIgnoreCase(REQUEST_ATTRIBUTE_CLASSNAME,
                                mirror.getAnnotationType().asElement().toString())) {
                    return true;
                }
            }
            return false;
        }
    };
    String clazz = StringUtils.substringBetween(text, "'");

    Set<Element> elems = getMembersFromJavaSource(clazz, acceptor);
    for (Element elem : elems) {
        if (StringUtils.startsWithIgnoreCase(elem.getSimpleName().toString(), filter)
                && !StringUtils.contains(text, elem.getSimpleName().toString() + " ")
                && !StringUtils.contains(text, elem.getSimpleName().toString() + "=")) {
            ret.add(elem.getSimpleName().toString());
        }
    }
    if (ret.isEmpty()) {
        for (String att : getAttributesFromClassLoader(clazz)) {
            if (StringUtils.startsWithIgnoreCase(att, filter) && !StringUtils.contains(text, att + " ")
                    && !StringUtils.contains(text, att + "=")) {
                ret.add(att);
            }
        }
    }
    return ret;
}

From source file:edu.uci.ics.jung.graph.UndirectedOrderedSparseMultigraph.java

@Override
public boolean addVertex(V vertex) {
    if (vertex == null) {
        throw new IllegalArgumentException("vertex may not be null");
    }/*w  w  w .  j a  v  a2  s.c  o  m*/
    if (!containsVertex(vertex)) {
        vertices.put(vertex, new LinkedHashSet<E>());
        return true;
    } else {
        return false;
    }
}

From source file:de.vandermeer.skb.interfaces.messagesets.IsErrorSet.java

/**
 * Creates a new error set.//ww  w . j  a  v a 2s .  co m
 * @param <M> type of the messages in the set
 * @return new error set
 */
static <M> IsErrorSet<M> create() {
    return new IsErrorSet<M>() {
        final Set<M> errorSet = new LinkedHashSet<>();

        @Override
        public Set<M> getErrorMessages() {
            return this.errorSet;
        }
    };
}