From: <jen...@us...> - 2008-02-24 17:49:34
|
Revision: 636 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=636&view=rev Author: jenslehmann Date: 2008-02-24 09:49:30 -0800 (Sun, 24 Feb 2008) Log Message: ----------- minor parser modifications Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/parser/KBParser.java Added Paths: ----------- trunk/src/dl-learner/org/dllearner/core/owl/Datatype.java Added: trunk/src/dl-learner/org/dllearner/core/owl/Datatype.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/owl/Datatype.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/core/owl/Datatype.java 2008-02-24 17:49:30 UTC (rev 636) @@ -0,0 +1,61 @@ +/** + * Copyright (C) 2007-2008, Jens Lehmann + * + * This file is part of DL-Learner. + * + * DL-Learner is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * DL-Learner is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ +package org.dllearner.core.owl; + +import java.net.URI; +import java.util.Map; + +/** + * @author Jens Lehmann + * + */ +public enum Datatype implements DataRange { + + DOUBLE ("http://www.w3.org/2001/XMLSchema#double"), + INT ("http://www.w3.org/2001/XMLSchema#int"), + BOOLEAN ("http://www.w3.org/2001/XMLSchema#Boolean"); + + private URI uri; + + private Datatype(String uriString) { + uri = URI.create(uriString); + } + + public URI getURI() { + return uri; + } + + @Override + public String toString() { + return uri.toString(); + } + + public int getLength() { + return 1; + } + + public String toString(String baseURI, Map<String, String> prefixes) { + return uri.toString(); + } + + public void accept(KBElementVisitor visitor) { + visitor.visit(this); + } +} Modified: trunk/src/dl-learner/org/dllearner/parser/KBParser.java =================================================================== --- trunk/src/dl-learner/org/dllearner/parser/KBParser.java 2008-02-24 17:47:44 UTC (rev 635) +++ trunk/src/dl-learner/org/dllearner/parser/KBParser.java 2008-02-24 17:49:30 UTC (rev 636) @@ -379,15 +379,15 @@ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case 44: jj_consume_token(44); - range = new Datatype(Datatype.Type.DOUBLE); + range = Datatype.DOUBLE; break; case 45: jj_consume_token(45); - range = new Datatype(Datatype.Type.BOOLEAN); + range = Datatype.BOOLEAN; break; case 46: jj_consume_token(46); - range = new Datatype(Datatype.Type.INT); + range = Datatype.INT; break; default: jj_la1[8] = jj_gen; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |