Orbital library

orbital.util
Class Filters

java.lang.Object
  extended by orbital.util.Filters

public class Filters
extends java.lang.Object

Collection filtering implementations.

Implementing classes are usually stateless.

Author:
André Platzer
See Also:
Predicate, Collection

Field Summary
static Function all
          Select *.
static Function first
          Filter for first element.
static Function last
          Filter for last element.
 
Constructor Summary
Filters()
           
 
Method Summary
static Function ranged(int min, int max)
          Filtering range from min to max.
static Function top(double number, boolean percent)
          Filter for the first number percent elements.
static Function top(int number)
          Filter for the first number elements.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

all

public static final Function all
Select *. Selects all data in the collection.


first

public static final Function first
Filter for first element.


last

public static final Function last
Filter for last element.

Constructor Detail

Filters

public Filters()
Method Detail

ranged

public static Function ranged(int min,
                              int max)
Filtering range from min to max. All elements with an index between min and max (including both) are filtered. The first element has index 0.


top

public static Function top(int number)
Filter for the first number elements.

See Also:
top(double, boolean)

top

public static Function top(double number,
                           boolean percent)
Filter for the first number percent elements.

Parameters:
percent - true to filter for the first number percent elements. false to filter for the first number elements top(int).
Preconditions:
number ∈ [0,100]

Orbital library
1.3.0: 11 Apr 2009

Copyright © 1996-2009 André Platzer
All Rights Reserved.