View Javadoc
1   /*
2    * Created on May 24, 2008
3    *
4    * Copyright (c) 2008, The JUNG Authors 
5    *
6    * All rights reserved.
7    *
8    * This software is open-source under the BSD license; see either
9    * "license.txt" or
10   * https://github.com/jrtom/jung/blob/master/LICENSE for a description.
11   */
12  package edu.uci.ics.jung.graph;
13  
14  import java.util.Collection;
15  
16  import com.google.common.base.Predicate;
17  
18  /**
19   * An interface for graphs whose vertices are each members of one of 2 or more 
20   * disjoint sets (partitions), and whose edges connect only vertices in distinct
21   * partitions.
22   * 
23   * @author Joshua O'Madadhain
24   */
25  public interface KPartiteGraph<V,E> extends Graph<V,E>
26  {
27      /**
28       * Returns all vertices which satisfy the specified <code>partition</code> predicate.
29       * @param partition <code>Predicate</code> which defines a partition
30       * @return all vertices satisfying <code>partition</code>
31       */
32      public Collection<V> getVertices(Predicate<V> partition);
33  
34      /**
35       * Returns the set of <code>Predicate</code> instances which define this graph's partitions.
36       * @return the set of <code>Predicate</code> instances which define this graph's partitions
37       */
38      public Collection<Predicate<V>> getPartitions();
39  
40  }