All pastes #3006 Raw Edit

Anonymous

public text v1 · immutable
#3006 ·published 2004-12-15 18:00 UTC
rendered paste body
	 * @param bottomright
	 * @return
	 */
	public LinkedList getRegion(Location topleft, Location bottomright){
		//Wir bekommen einen Streifen, xFits enthält die Punkte, bei denen die x-Koordinate stimmt
		SortedSet xFits = subSet(topleft, bottomright);
		//Jetzt filtern wir noch die in y-Richtung ungültigen Einträge heraus.
		LinkedList list = new LinkedList();
		
		Iterator xFitsIterator = xFits.iterator();
		while( xFitsIterator.hasNext()){
			Location loc = (Location) xFitsIterator.next();
			if (loc.y >= topleft.y && loc.y <= bottomright.y){
				list.add(loc);
			}
		}
		
		return list;
	}
}