edu.mit.ai.psg.utilities
Class Collecting

java.lang.Object
  |
  +--edu.mit.ai.psg.utilities.Collecting

public class Collecting
extends Object

Methods on collections


Method Summary
static Collection makeEmptyCollection(Collection collection)
          return an empty java.util.Collection of same class as collection
static Collection map(Collection collection, IUnaryFunction function)
          Map each element of collection to an object specified by function, and return them in a java.util.Collection of the same class as collection
static Collection select(Collection collection, IUnaryPredicate predicate)
          Select elements of collection on which predicate returns true, and return them in a java.util.Collection of the same class as collection
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

select

public static Collection select(Collection collection,
                                IUnaryPredicate predicate)
Select elements of collection on which predicate returns true, and return them in a java.util.Collection of the same class as collection

makeEmptyCollection

public static Collection makeEmptyCollection(Collection collection)
return an empty java.util.Collection of same class as collection

map

public static Collection map(Collection collection,
                             IUnaryFunction function)
Map each element of collection to an object specified by function, and return them in a java.util.Collection of the same class as collection

Copyright (c) 1996-1999
Massachusetts Institute of Technology

Feedback: jeva-feedback@ai.mit.edu