For faster navigation, this Iframe is preloading the Wikiwand page for Apache Commons Collections.

Apache Commons Collections

Apache Commons Collections
最新版
4.4 / 2019年7月9日 (5年前) (2019-07-09)
リポジトリ ウィキデータを編集
プログラミング
言語
Java
プラットフォーム Javaプラットフォーム
種別 ライブラリ
ライセンス Apache License
公式サイト commons.apache.org/proper/commons-collections/ ウィキデータを編集
テンプレートを表示

Apache Commons Collections(アパッチ コモンズ・コレクションズ)は、ApacheのトッププロジェクトであるApache Commonsにある、Javaのjava.utilパッケージのCollection関係を拡張するライブラリである。

使用例

[編集]

Java 6 にはクロージャがないが、Predicate を実装することで、条件を満たす物を探すことができる。以下、リストから、a で始まる物を見つけ出す。

ArrayList<String> list = new ArrayList<String>();
list.add("apple");
list.add("banana");
list.add("ant");
Collection<String> aList = CollectionUtils.select(list, new Predicate<String>() {
    public boolean evaluate(String str) {
        return str.startsWith("a");
    }
});

外部リンク

[編集]
{{bottomLinkPreText}} {{bottomLinkText}}
Apache Commons Collections
Listen to this article

This browser is not supported by Wikiwand :(
Wikiwand requires a browser with modern capabilities in order to provide you with the best reading experience.
Please download and use one of the following browsers:

This article was just edited, click to reload
This article has been deleted on Wikipedia (Why?)

Back to homepage

Please click Add in the dialog above
Please click Allow in the top-left corner,
then click Install Now in the dialog
Please click Open in the download dialog,
then click Install
Please click the "Downloads" icon in the Safari toolbar, open the first download in the list,
then click Install
{{::$root.activation.text}}

Install Wikiwand

Install on Chrome Install on Firefox
Don't forget to rate us

Tell your friends about Wikiwand!

Gmail Facebook Twitter Link

Enjoying Wikiwand?

Tell your friends and spread the love:
Share on Gmail Share on Facebook Share on Twitter Share on Buffer

Our magic isn't perfect

You can help our automatic cover photo selection by reporting an unsuitable photo.

This photo is visually disturbing This photo is not a good choice

Thank you for helping!


Your input will affect cover photo selection, along with input from other users.

X

Get ready for Wikiwand 2.0 🎉! the new version arrives on September 1st! Don't want to wait?