Share Pastebin
Guest
Public paste!

Untitled

By: a guest | Mar 20th, 2010 | Syntax: Java | Size: 0.75 KB | Hits: 64 | Expires: Never
Copy text to clipboard
  1. public Dataset getLocalMaximum(String stockName) {
  2.         if (stockName == null) {
  3.              throw new NullPointerException("String nicht initialisiert");
  4.         }
  5.         if (stockName == "") {
  6.              throw new IllegalArgumentException("Leerer String");
  7.         }
  8.         if (!ShareExploration.db.getMap().containsKey(stockName)) { // enthaelt die Treemap
  9.              // die Aktie?
  10.              return null; // wenn sie die Aktie nicht enthaelt wird null
  11.              // zurueckgegeben
  12.         } else {
  13.              DatasetMaxValComparator s = new DatasetMaxValComparator();
  14.              List<Dataset> temp = db.getEntry(stockName);
  15.  
  16.              Collections.sort(temp, s);
  17.              return temp.get(0);
  18.  
  19.         }
  20.    }