View Javadoc

1   package org.molwind.model;
2   
3   /*
4    * This file is part of Molwind.
5    *
6    * Molwind is free software: you can redistribute it and/or modify
7    * it under the terms of the GNU General Public License as published by
8    * the Free Software Foundation, either version 3 of the License, or
9    * (at your option) any later version.
10   *
11   * Molwind is distributed in the hope that it will be useful,
12   * but WITHOUT ANY WARRANTY; without even the implied warranty of
13   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14   * GNU General Public License for more details.
15   *
16   * You should have received a copy of the GNU General Public License
17   * along with Molwind. If not, see <http://www.gnu.org/licenses/>.
18   */
19  
20  import org.molwind.graph.EntityGraph;
21  
22  /**
23   * RelationshipResolver interface defines a strategy to resolve relationships
24   * among entities.
25   *
26   * @author <a href="mailto:oliver.karch@molwind.org">Oliver Karch</a>
27   * @version 1.0
28   */
29  public interface RelationshipResolver {
30  
31      /**
32       * Augments the relationship between two entities.
33       *
34       * @param entity1
35       *      a world entity
36       * @param entity2
37       *      another world entity
38       * @return
39       *      true if any relationship could be established, false otherwise
40       */
41      boolean related(WorldEntity entity1, WorldEntity entity2);
42  
43      /**
44       * Resolves the relationships by creating a graph of entity vertices and
45       * relationship edges.
46       *
47       * @return
48       *      the resulting entity graph
49       */
50      EntityGraph resolve();
51      
52      
53       /**
54       * Get the ParentName value.
55       * @return the ParentName value.
56       */
57      public String getParentName();
58  
59  }