~duyi001/gephi/DSNI

« back to all changes in this revision

Viewing changes to RankingAPI/src/org/gephi/ranking/api/RankingModel.java

  • Committer: sunsnowad
  • Author(s): Yi Du
  • Date: 2011-09-08 16:36:59 UTC
  • mfrom: (1435.1.968 gephi)
  • Revision ID: sunsnowad@www-691ed046717-20110908163659-aorx14ylp8f9qwdx
1.merge with main branch
2.update twitter4j to version 2.2.4
3.fix an existing bug on "twitter user import"

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 
18
18
You should have received a copy of the GNU Affero General Public License
19
19
along with Gephi.  If not, see <http://www.gnu.org/licenses/>.
20
 
*/
 
20
 */
21
21
package org.gephi.ranking.api;
22
22
 
23
 
import javax.swing.event.ChangeListener;
24
 
import org.gephi.data.attributes.api.AttributeColumn;
 
23
import org.gephi.project.api.Workspace;
25
24
 
26
25
/**
27
 
 *
 
26
 * Model for ranking data. 
 
27
 * <p>
 
28
 * That includes the list of rankings currently available,
 
29
 * separated in categories with different element types. It can returns all rankings
 
30
 * for nodes or edges, or any element type.
 
31
 * <p>
 
32
 * Rankings are builds thanks to <code>RankingBuilder</code> implementation. Implement
 
33
 * a new <code>RankingBuider</code> service to create new rankings.
 
34
 * <p>
 
35
 * The model also hosts the currently defined interpolator.
 
36
 * 
 
37
 * @see Ranking
 
38
 * @see Transformer
28
39
 * @author Mathieu Bastian
29
40
 */
30
41
public interface RankingModel {
31
42
 
32
 
    public NodeRanking getDegreeRanking();
33
 
 
34
 
    public NodeRanking getInDegreeRanking();
35
 
 
36
 
    public NodeRanking getOutDegreeRanking();
37
 
 
38
 
    public NodeRanking getNodeAttributeRanking(AttributeColumn column);
39
 
 
40
 
    public EdgeRanking getEdgeAttributeRanking(AttributeColumn column);
41
 
 
42
 
    public NodeRanking[] getNodeRanking();
43
 
 
44
 
    public EdgeRanking[] getEdgeRanking();
45
 
 
46
 
    public void addChangeListener(ChangeListener changeListener);
47
 
 
48
 
    public void removeChangeListener(ChangeListener changeListener);
 
43
    /**
 
44
     * Get all rankings for node elements. Rankings are classified with the type
 
45
     * of element they are manipulating. Rankings specific to node elements are
 
46
     * defined by the <code>Ranking.NODE_ELEMENT</code>.
 
47
     * @return All rankings for node elements
 
48
     */
 
49
    public Ranking[] getNodeRankings();
 
50
 
 
51
    /**
 
52
     * Get all rankings for edge elements. Rankings are classified with the type
 
53
     * of element they are manipulating. Rankings specific to edge elements are
 
54
     * defined by the <code>Ranking.EDGE_ELEMENT</code>.
 
55
     * @return All rankings for edge elements
 
56
     */
 
57
    public Ranking[] getEdgeRankings();
 
58
 
 
59
    /**
 
60
     * Get all rankings for <code>elementType</code> elements. Rankings are 
 
61
     * classified with the type of element they are manipulating. If 
 
62
     * <code>elementType</code> equals <code>Ranking.NODE_ELEMENT</code> this is
 
63
     * equivalent to {@link RankingModel#getNodeRankings() } method
 
64
     * @param elementType the element type of the rankings
 
65
     * @return All rankings for <code>elementType</code>
 
66
     */
 
67
    public Ranking[] getRankings(String elementType);
 
68
 
 
69
    /**
 
70
     * Return the specific ranking for <code>elementType</code> and with
 
71
     * the given <code>name</code>. Returns <code>null</code> if not found.
 
72
     * <p>
 
73
     * Default ranking names can be found in the {@link Ranking} interface. For 
 
74
     * attribute rankings, simply use the column identifier.
 
75
     * @param elementType the element type of the ranking
 
76
     * @param name the name of the ranking
 
77
     * @return the found ranking or <code>null</code> if not found
 
78
     */
 
79
    public Ranking getRanking(String elementType, String name);
 
80
 
 
81
    /**
 
82
     * Return all transformers specific to <code>elementType</code>. A transformer
 
83
     * defines his ability to transformer different element types. 
 
84
     * @param elementType the element type of the transformers
 
85
     * @return all transformers working with <code>elementType</code>
 
86
     */
 
87
    public Transformer[] getTransformers(String elementType);
 
88
 
 
89
    /**
 
90
     * Returns the specific transformer for <code>elementType</code> and with the
 
91
     * given <code>name</code>. Returns <code>null</code> if not found.
 
92
     * <p>
 
93
     * Default transformers name can be found in the {@link Transformer} interface.
 
94
     * @param elementType   the element type of the transformer
 
95
     * @param name  the name of the transformer
 
96
     * @return the transformer defined as <code>name</code> and <code>elementType</code>
 
97
     * or <code>null</code> if not found
 
98
     */
 
99
    public Transformer getTransformer(String elementType, String name);
 
100
 
 
101
    /**
 
102
     * Returns the current interpolator. The default interpolator is a simple
 
103
     * linear interpolation.
 
104
     * @return the current interpolator
 
105
     */
 
106
    public Interpolator getInterpolator();
 
107
 
 
108
    /**
 
109
     * Return the workspace this model is associated with
 
110
     * @return the workspace of this model
 
111
     */
 
112
    public Workspace getWorkspace();
 
113
 
 
114
    /**
 
115
     * If <code>transformer</code> is an auto transformer, returns the ranking
 
116
     * associated to it. 
 
117
     * @param transformer the transformer to obtain the ranking from
 
118
     * @return the ranking associated to <code>transformer</code> or <code>null</code>
 
119
     */
 
120
    public Ranking getAutoTransformerRanking(Transformer transformer);
 
121
 
 
122
    /**
 
123
     * Add <code>listener</code> as a ranking listener of this model
 
124
     * @param listener the listener to add
 
125
     */
 
126
    public void addRankingListener(RankingListener listener);
 
127
 
 
128
    /**
 
129
     * Remove <code>listener</code> as a ranking listener of this model
 
130
     * @param listener the listener to remove
 
131
     */
 
132
    public void removeRankingListener(RankingListener listener);
49
133
}