Package java.util

Examples of java.util.TreeMap.firstKey()


        if (caseLabelMap.isEmpty()) {
            // Special case: SWITCH statement without CASE labels (but maybe a DEFAULT label).
            ;
        } else
        if (
            ((Integer) caseLabelMap.firstKey()).intValue() + caseLabelMap.size() >= // Beware of INT overflow!
            ((Integer) caseLabelMap.lastKey()).intValue() - caseLabelMap.size()
        ) {
            int low = ((Integer) caseLabelMap.firstKey()).intValue();
            int high = ((Integer) caseLabelMap.lastKey()).intValue();
View Full Code Here


        } else
        if (
            ((Integer) caseLabelMap.firstKey()).intValue() + caseLabelMap.size() >= // Beware of INT overflow!
            ((Integer) caseLabelMap.lastKey()).intValue() - caseLabelMap.size()
        ) {
            int low = ((Integer) caseLabelMap.firstKey()).intValue();
            int high = ((Integer) caseLabelMap.lastKey()).intValue();

            this.writeOpcode(ss, Opcode.TABLESWITCH);
            new Java.Padder(this.codeContext).set();
            this.writeOffset(switchOffset, defaultLabelOffset);
View Full Code Here

        assertTrue("TreeMap answered incorrect comparator", reversedTreeMap
                .comparator() == comp);
        reversedTreeMap.put(new Integer(1).toString(), new Integer(1));
        reversedTreeMap.put(new Integer(2).toString(), new Integer(2));
        assertTrue("TreeMap does not use comparator (firstKey was incorrect)",
                reversedTreeMap.firstKey().equals(new Integer(2).toString()));
        assertTrue("TreeMap does not use comparator (lastKey was incorrect)",
                reversedTreeMap.lastKey().equals(new Integer(1).toString()));

    }
View Full Code Here

        reversedTreeMap.put(new Integer(2).toString(), new Integer(2));
        TreeMap anotherTreeMap = new TreeMap(reversedTreeMap);
        assertTrue("New tree map does not answer correct comparator",
                anotherTreeMap.comparator() == comp);
        assertTrue("TreeMap does not use comparator (firstKey was incorrect)",
                anotherTreeMap.firstKey().equals(new Integer(2).toString()));
        assertTrue("TreeMap does not use comparator (lastKey was incorrect)",
                anotherTreeMap.lastKey().equals(new Integer(1).toString()));

    }
View Full Code Here

        assertTrue("TreeMap answered incorrect comparator", reversedTreeMap
                .comparator() == comp);
        reversedTreeMap.put(new Integer(1).toString(), new Integer(1));
        reversedTreeMap.put(new Integer(2).toString(), new Integer(2));
        assertTrue("TreeMap does not use comparator (firstKey was incorrect)",
                reversedTreeMap.firstKey().equals(new Integer(2).toString()));
        assertTrue("TreeMap does not use comparator (lastKey was incorrect)",
                reversedTreeMap.lastKey().equals(new Integer(1).toString()));
    }

    /**
 
View Full Code Here

                }
            }
        }
                       
        return matches.size() == 0
            ? null : (String) matches.get(matches.firstKey());
    }

    /**
     * Grab lists of all root-level files and all directories
     * contained in the given archive.
View Full Code Here

        variables.add(variable);
      }

      if (numValuesMap.values().size() > 0) {
        domainVariable = (String) ((List) numValuesMap.get(numValuesMap.lastKey())).get(0);
        seriesVariable = (String) ((List) numValuesMap.get(numValuesMap.firstKey())).get(0);
      }
    }

    String valueTitle = "time (ms)"; // This axis is time across all charts.
View Full Code Here

          if(existingParam != null) {
            throw new RuntimeException("Parameters with duplicate indexes!");
          }
        }

        if( ((Integer)sortedParams.firstKey()).intValue() + sortedParams.size() -1 !=
          ((Integer)sortedParams.lastKey()).intValue()) {
          throw new RuntimeException("Parameters with improper indexes!");
        }
      }
           
View Full Code Here

                }
            }
        }

        return matches.size() == 0
            ? null : (String) matches.get(matches.firstKey());
    }

    /**
     * Grab lists of all root-level files and all directories
     * contained in the given archive.
View Full Code Here

            map.put(value, key);
        }
       
        // Remove any extra entries
        while (map.size() > NUMBER_MENU_ITEMS) {
            Object key = map.firstKey();
            map.remove(key); // Remove it from our temp list used to reinstance _fileList
            // .AND. remove it from our global properties (first converting key into form
            // our persistent properties knows about!).
            getContext().getPropertiesManager().remove(makeReopenerFilelistKey(key.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.