14.9.5.4 コレクション・フィルタの定義

次のコードに示すように、頂点コレクション・フィルタを定義できます。

JShellを使用した頂点コレクション・フィルタの定義
// Obtain a vertex collection from an algorithm, query execution or any other way
opg4j> VertexCollection<?> vertexCollection = ...
// Define a filter from the collection
opg4j> var vertexFilter = VertexFilter.fromCollection(vertexCollection)
Javaを使用した頂点コレクション・フィルタの定義
// Obtain a vertex collection from an algorithm, query execution or any other way
VertexCollection<?> vertexCollection = ...
// Define a filter from the collection
VertexFilter vertexFilter = VertexFilter.fromCollection(vertexCollection);

次のコードに示すように、エッジ・コレクション・フィルタを定義できます。

JShellを使用したエッジ・コレクション・フィルタの定義
// Obtain an edge collection from an algorithm, query execution or any other way
opg4j> EdgeCollection edgeCollection = ...
// Define a filter from the collection
opg4j> var edgeFilter = EdgeFilter.fromCollection(edgeCollection)
Javaを使用したエッジ・コレクション・フィルタの定義
// Obtain an edge collection from an algorithm, query execution or any other way
EdgeCollection edgeCollection = ...
// Define a filter from the collection
EdgeFilter edgeFilter = EdgeFilter.fromCollection(edgeCollection);