| SemanticRelationImpl.java |
1 /*
2 * SemanticRelation.java
3 *
4 * Copyright (c) 1998-2004, The University of Sheffield.
5 *
6 * This file is part of GATE (see http://gate.ac.uk/), and is free
7 * software, licenced under the GNU Library General Public License,
8 * Version 2, June 1991 (in the distribution as file licence.html,
9 * and also available at http://gate.ac.uk/gate/licence.html).
10 *
11 * Marin Dimitrov, 16/May/2002
12 *
13 * $Id: SemanticRelationImpl.java,v 1.4 2004/07/21 17:10:10 akshay Exp $
14 */
15
16 package gate.wordnet;
17
18 import junit.framework.Assert;
19
20 public class SemanticRelationImpl extends RelationImpl
21 implements SemanticRelation {
22
23 private Synset source;
24 private Synset target;
25
26 public SemanticRelationImpl(int _type, Synset _src, Synset _target) {
27
28 super(_type);
29
30 Assert.assertNotNull(_src);
31 Assert.assertNotNull(_target);
32 Assert.assertTrue(WNHelper.isValidSemanticPointer(_type));
33
34 this.source = _src;
35 this.target = _target;
36 }
37
38
39 /** returns the source (Synset) of this lexical relation */
40 public Synset getSource() {
41 return this.source;
42 }
43
44 /** returns the source (Synset) of this lexical relation */
45 public Synset getTarget() {
46 return this.target;
47 }
48
49 }