UNPKG

node-red-contrib-tak-registration

Version:

A Node-RED node to register to TAK and to help wrap files as datapackages to send to TAK

28 lines (24 loc) 725 B
import ArrayList from '../../../../java/util/ArrayList' export default class CollectionUtil { static transform(coll, func) { const result = new ArrayList() for (let i = coll.iterator(); i.hasNext(); ) result.add(func.execute(i.next())) return result } static select(collection, func) { const result = new ArrayList() for (let i = collection.iterator(); i.hasNext(); ) { const item = i.next() if (Boolean.TRUE.equals(func.execute(item))) result.add(item) } return result } static apply(coll, func) { for (let i = coll.iterator(); i.hasNext(); ) func.execute(i.next()) } } function Function() {} CollectionUtil.Function = Function