Package java.util

Examples of java.util.TreeSet.last()


                        ". Check the used SequenceManager implementation");
            }
            set.add(key);
        }
        System.out.println(this.getClass().getName() + ": Last generated key was " +
                ((set.size() > 0) ? set.last() : " no generated keys found"));
        set.clear();
    }

    protected static synchronized void addResultList(List resultList)
    {
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

       
        //
        // create a binary tree of numbers, pick the last one (= largest)
        //
        TreeSet sortedNumbers = new TreeSet(fileNumbersByEPR.values());
        Integer largest = (Integer)sortedNumbers.last();
        return largest.intValue() + 1;
    }
   
    /**
     *
 
View Full Code Here

    System.out.println(MOVIES);

    for(Film f : l){
      ts.add(Integer.parseInt(f.getId().substring(2)));
    }
    i = (int) ts.last();
//    Incremente et recree un nouveau id
    i++;
    String s = "tt" + i;
    return s;
  }
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

    assertTrue(
        "Answered incorrect first element--did not use custom comparator ",
        myTreeSet.first().equals(new Integer(2)));
    assertTrue(
        "Answered incorrect last element--did not use custom comparator ",
        myTreeSet.last().equals(new Integer(1)));
  }

  /**
   * @tests java.util.TreeSet#TreeSet(java.util.SortedSet)
   */
 
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

    public String toString() {
        StringBuffer sb=new StringBuffer();
        sb.append(msgs.size()).append(" msgs (").append(retransmitter.size()).append(" to retransmit): ");
        TreeSet keys=new TreeSet(msgs.keySet());
        if(keys.size() > 0)
            sb.append(keys.first()).append(" - ").append(keys.last());
        else
            sb.append("[]");
        return sb.toString();
    }
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.