Package java.util

Examples of java.util.SortedSet.last()


    // token before the current position
    try {
      // all the good positions before
      workingSet = iniPositions.headSet(startRequest);
      // the last of the stuff before
      dpStart = (DocPosition) workingSet.last();
    } catch (NoSuchElementException x) {
      // if there were no good positions before the requested
      // start,
      // we can always start at the very beginning.
      dpStart = new DocPosition(0);
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();
    }

    //TODO not clear modifications to use artifactManager work for SimpleConfigurationManager
    private Artifact searchParents(Collection<Configuration> parentConfigurations, Artifact working) {
        for (Configuration configuration : parentConfigurations) {
View Full Code Here

        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 (list.isEmpty()) {
                return null;
            }
            return (Artifact) list.last();
        }

        // more than one version of the artifact was loaded...

        // if one of parents already loaded the artifact, use that version
View Full Code Here

        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

        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
        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

        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

      SortedSet childrenNames = new TreeSet(defunctRootNode.getChildrenNames()); // will be naturally sorted.
      Integer childName = 1;

      if (!childrenNames.isEmpty())
      {
         Integer lastChild = (Integer) childrenNames.last();
         childName = lastChild + 1;
      }

      cache.getInvocationContext().getOptionOverrides().setCacheModeLocal(true);
      defunctRootNode.addChild(Fqn.fromElements(childName));
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.