Package java.util

Examples of java.util.SortedSet.last()


        Set set = get(destination);
        if (set == null || set.isEmpty()) {
            return null;
        }
        SortedSet sortedSet = new TreeSet(set);
        return sortedSet.last();
    }

    /**
     * Returns the root node for the given destination type
     */
 
View Full Code Here


        if (artifact != null) {
            return artifact;
        }

        // it wasn't declared by the parent so just use the highest verstion already loaded
        return (Artifact) existingArtifacts.last();
    }

    private Artifact searchParents(Collection<Configuration> parentConfigurations, Artifact working) {
        for (Configuration configuration : parentConfigurations) {
View Full Code Here

                // if we have exactly one artifact found
                if (artifactSet.size() == 1) {
                    file = repository.getLocation((Artifact) artifactSet.first());
                    return file.getAbsoluteFile();
                } else if (artifactSet.size() > 1) {// if we have more than 1 artifacts found use the latest one.
                    file = repository.getLocation((Artifact) artifactSet.last());
                    return file.getAbsoluteFile();
                }
            }
        }
       
View Full Code Here

            // if we have exactly one artifact found
            if (artifactSet.size() == 1) {
                file = repository.getLocation((Artifact) artifactSet.first());
                return file.getAbsoluteFile().toURL();
            } else if (artifactSet.size() > 1) {// if we have more than 1 artifacts found use the latest one.
                file = repository.getLocation((Artifact) artifactSet.last());
                return file.getAbsoluteFile().toURL();
            }
        }
        if (file == null) {
            throw new DeploymentException("Missing artifact in repositories: " + artifactQuery.toString());
View Full Code Here

    sortedSet.add(reaperElement);
    sortedSet.add(reaperElement3);
    sortedSet.add(reaperElement2);

    assertEquals(sortedSet.first(), reaperElement3);
    assertEquals(sortedSet.last(), reaperElement);

    // test insertion of timeout=0 is a nullop
    assertTrue(reaper.insert(reapable, 0));
    assertEquals(0, reaper.numberOfTransactions());
                assertEquals(0, reaper.numberOfTimeouts());
View Full Code Here

  
   
//--------------------------------------------------------------------           
    protected Long getNextAsLong() {
        SortedSet set = (SortedSet) makeFullSet();
        int nextValue = ((Integer)set.last()).intValue() + 1;
        return new Long(nextValue);
    }
   
    protected Integer getNextAsInt() {
        SortedSet set = (SortedSet) makeFullSet();
View Full Code Here

        return new Long(nextValue);
    }
   
    protected Integer getNextAsInt() {
        SortedSet set = (SortedSet) makeFullSet();
        int nextValue = ((Integer)set.last()).intValue() + 1;
        return new Integer(nextValue);
    }
          
    public void testIllegalAdd() {
        Set set = makeFullSet();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.