LexicalRelationImpl.java |
1 /* 2 * LexicalRelation.java 3 * 4 * Copyright (c) 1998-2005, 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: LexicalRelationImpl.java,v 1.5 2005/01/11 13:51:38 ian Exp $ 14 */ 15 16 package gate.wordnet; 17 18 import junit.framework.Assert; 19 20 /** Represents WordNet lexical relation. 21 * implrments LexicalRelation 22 */ 23 24 public class LexicalRelationImpl extends RelationImpl 25 implements LexicalRelation { 26 27 /** relation source */ 28 private WordSense source; 29 /** relation target */ 30 private WordSense target; 31 32 public LexicalRelationImpl(int _type, WordSense _src, WordSense _target) { 33 34 super(_type); 35 36 Assert.assertNotNull(_src); 37 Assert.assertNotNull(_target); 38 Assert.assertTrue(WNHelper.isValidLexicalPointer(_type)); 39 40 this.source = _src; 41 this.target = _target; 42 } 43 44 45 /** returns the source (WordSense) of this lexical relation */ 46 public WordSense getSource() { 47 return this.source; 48 } 49 50 51 /** returns the target (WordSense) of this lexical relation */ 52 public WordSense getTarget() { 53 return this.target; 54 } 55 56 }