You can subscribe to this list here.
| 2008 |
Jan
|
Feb
|
Mar
|
Apr
(48) |
May
(21) |
Jun
(3) |
Jul
(10) |
Aug
(66) |
Sep
(11) |
Oct
(7) |
Nov
(73) |
Dec
(12) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2009 |
Jan
(3) |
Feb
(17) |
Mar
(19) |
Apr
(1) |
May
(4) |
Jun
|
Jul
(43) |
Aug
(18) |
Sep
(1) |
Oct
(1) |
Nov
(2) |
Dec
|
| 2010 |
Jan
(3) |
Feb
(7) |
Mar
(21) |
Apr
(2) |
May
(1) |
Jun
(1) |
Jul
(6) |
Aug
(6) |
Sep
(7) |
Oct
|
Nov
(1) |
Dec
|
| 2011 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <lh...@us...> - 2010-02-25 13:10:18
|
Revision: 367
http://tinytim.svn.sourceforge.net/tinytim/?rev=367&view=rev
Author: lheuer
Date: 2010-02-25 12:15:58 +0000 (Thu, 25 Feb 2010)
Log Message:
-----------
Updated imports, removed fragment
Modified Paths:
--------------
tinytim/trunk/build.xml
Modified: tinytim/trunk/build.xml
===================================================================
--- tinytim/trunk/build.xml 2010-02-25 00:16:55 UTC (rev 366)
+++ tinytim/trunk/build.xml 2010-02-25 12:15:58 UTC (rev 367)
@@ -210,12 +210,11 @@
<attribute name="Implementation-Title" value="tinyTiM"/>
<attribute name="Implementation-Version" value="${dist.version}"/>
<attribute name="Implementation-URL" value="http://tinytim.sourceforge.net/"/>
- <attribute name="Import-Package" value="org.osgi.framework,org.tmapi.core,org.tmapi.index"/>
+ <attribute name="Import-Package" value="org.osgi.framework,org.tmapi.core,org.tmapi.index,com.semagia.mio"/>
<attribute name="Export-Package" value="org.tinytim.core"/>
<attribute name="Bundle-Name" value="tinyTiM"/>
<attribute name="Bundle-SymbolicName" value="org.tinytim;version=${dist.version}"/>
<attribute name="Bundle-Vendor" value="tinyTiM project"/>
- <attribute name="Fragment-Host" value="org.tmapi.core"/>
<attribute name="Bundle-Version" value="${dist.version}"/>
</manifest>
</jar>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <lh...@us...> - 2010-02-25 01:09:12
|
Revision: 366
http://tinytim.svn.sourceforge.net/tinytim/?rev=366&view=rev
Author: lheuer
Date: 2010-02-25 00:16:55 +0000 (Thu, 25 Feb 2010)
Log Message:
-----------
Import OSGi TMAPI Bundle
Modified Paths:
--------------
tinytim/trunk/build.properties
tinytim/trunk/build.xml
Modified: tinytim/trunk/build.properties
===================================================================
--- tinytim/trunk/build.properties 2010-02-06 13:59:51 UTC (rev 365)
+++ tinytim/trunk/build.properties 2010-02-25 00:16:55 UTC (rev 366)
@@ -1,5 +1,6 @@
version=2.0.0
-version_suffix=a6
+# If a suffix given, it MUST start with '.'
+version_suffix=.a6
#release_type=
debug=off
optimize=on
Modified: tinytim/trunk/build.xml
===================================================================
--- tinytim/trunk/build.xml 2010-02-06 13:59:51 UTC (rev 365)
+++ tinytim/trunk/build.xml 2010-02-25 00:16:55 UTC (rev 366)
@@ -1,272 +1,285 @@
-<?xml version="1.0" encoding="utf-8"?>
-<project name="tinyTiM" default="jar" basedir=".">
- <property file="build.properties"/>
- <tstamp/>
- <property name="release_type" value="-snapshot-${DSTAMP}${TSTAMP}"/>
-
- <property name="dir.src" value="${basedir}/src/main/java"/>
- <property name="dir.test" value="${basedir}/src/test/java"/>
- <property name="dir.lib" value="${basedir}/lib"/>
- <property name="dir.res" value="${basedir}/src/main/resources"/>
- <property name="dir.coverage" value="${basedir}/coverage"/>
-
- <property name="lib.junit" value="${dir.lib}/junit-4.5.jar"/>
- <property name="lib.mio" value="${dir.lib}/semagia-mio-0.9.5.jar"/>
- <property name="lib.tmapi" value="${dir.lib}/tmapi-2.0.jar"/>
- <property name="lib.tmapi.tests" value="${dir.lib}/tmapi-2.0-tests.jar"/>
- <property name="lib.emma" value="${dir.lib}/emma.jar"/>
- <property name="lib.emma.task" value="${dir.lib}/emma_ant.jar"/>
-
- <!-- directory that contains emma.jar and emma_ant.jar: -->
- <property name="dir.emma" value="${dir.lib}" />
-
- <!-- path element used by EMMA taskdef below: -->
- <path id="emma.lib" >
- <pathelement location="${dir.emma}/emma.jar" />
- <pathelement location="${dir.emma}/emma_ant.jar" />
- </path>
-
- <!-- this loads <emma> and <emmajava> custom tasks: -->
- <taskdef resource="emma_ant.properties" classpathref="emma.lib" />
-
- <target name="help">
- <echo message="--------------------"/>
- <echo message="tinyTiM - Build file"/>
- <echo message="--------------------"/>
- <echo message=""/>
- <echo message="Available targets:"/>
- <echo message=""/>
- <echo message=" jar Creates the jar"/>
- <echo message=" testjar Creates the jar with the tests"/>
- <echo message=" doc Creates the API documentation"/>
- <echo message=" coverage Creates a coverage report"/>
- <echo message=" release Creates the jar and a distributable file"/>
- </target>
-
- <target name="init">
- <property name="dist.version" value="${version}${version_suffix}${release_type}"/>
- <property name="dist.name" value="tinytim-${dist.version}"/>
-
- <property name="tinytim.jar" value="${dist.name}.jar"/>
- <property name="tinytim-test.jar" value="${dist.name}-tests.jar"/>
- <property name="tinytim.tar" value="${dist.name}.tar"/>
- <property name="tinytim.tar.gz" value="${tinytim.tar}.gz"/>
- <property name="tinytim.zip" value="${dist.name}.zip"/>
-
- <property name="dir.build" value="${basedir}/build"/>
- <property name="dir.dist.root" value="${dir.build}/dist"/>
- <property name="dir.dist" value="${dir.dist.root}/${dist.name}"/>
- <property name="dir.build.classes" value="${dir.build}/classes"/>
- <property name="dir.build.tests" value="${dir.build}/tests"/>
- <property name="dir.javadocs" value="${dir.dist}/docs/api"/>
-
- <path id="run.classpath" >
- <pathelement location="${dir.build.classes}" />
- <pathelement location="${dir.build.tests}" />
- <pathelement location="${lib.junit}"/>
- <pathelement location="${lib.mio}"/>
- <pathelement location="${lib.tmapi}"/>
- <pathelement location="${lib.tmapi.tests}"/>
- </path>
- </target>
-
- <!-- =================================================================== -->
- <!-- Clean targets -->
- <!-- =================================================================== -->
- <target name="clean" depends="init">
- <delete dir="${dir.build}"/>
- <delete dir="${dir.javadocs}"/>
- </target>
-
- <!-- =================================================================== -->
- <!-- Prepares the build directory -->
- <!-- =================================================================== -->
- <target name="prepare" depends="init">
- <mkdir dir="${dir.build}"/>
- <mkdir dir="${dir.build.classes}"/>
- </target>
-
- <!-- =================================================================== -->
- <!-- Coverage Tests -->
- <!-- =================================================================== -->
- <target name="coverage" depends="compile">
- <mkdir dir="${dir.build.tests}"/>
- <javac destdir="${dir.build.tests}"
- debug="${debug}"
- optimize="${optimize}"
- target="1.5">
- <classpath>
- <pathelement location="${dir.build.classes}"/>
- <pathelement location="${lib.junit}"/>
- <pathelement location="${lib.mio}"/>
- <pathelement location="${lib.tmapi}"/>
- <pathelement location="${lib.tmapi.tests}"/>
- </classpath>
- <src path="${dir.test}"/>
- </javac>
- <mkdir dir="${dir.coverage}"/>
- <emmajava libclasspathref="emma.lib"
- sourcepath="${dir.src}"
- fullmetadata="yes"
- classname="org.tinytim.core.AllTests"
- classpathref="run.classpath"
- >
- <filter includes="org.tinytim.*" excludes="org.tinytim.*Test*, org.tinytim.*$*" />
- <html outfile="${dir.coverage}/index.html" />
- </emmajava>
- </target>
-
- <!-- =================================================================== -->
- <!-- Tests -->
- <!-- =================================================================== -->
- <target name="test" depends="compile">
- <mkdir dir="${dir.build.tests}"/>
- <javac destdir="${dir.build.tests}"
- debug="${debug}"
- optimize="${optimize}"
- target="1.5">
- <classpath>
- <pathelement location="${dir.build.classes}"/>
- <pathelement location="${lib.junit}"/>
- <pathelement location="${lib.mio}"/>
- <pathelement location="${lib.tmapi}"/>
- <pathelement location="${lib.tmapi.tests}"/>
- </classpath>
- <src path="${dir.test}"/>
- </javac>
- <junit printsummary="true" showoutput="false"
- errorProperty="test.failed" failureProperty="test.failed"
- fork="true">
- <classpath refid="run.classpath"/>
- <formatter type="brief" usefile="false"/>
- <test name="org.tinytim.core.AllTests"/>
- </junit>
- <fail message="Tests failed. Check test output." if="test.failed"/>
- </target>
-
- <!-- =================================================================== -->
- <!-- Compile source files -->
- <!-- =================================================================== -->
- <target name="compile" depends="clean, prepare">
- <replace file="${dir.src}/org/tinytim/Version.java" token="@RELEASE@" value="${dist.version}"/>
- <javac destdir="${dir.build.classes}"
- debug="${debug}"
- target="1.5">
- <classpath>
- <pathelement location="${lib.tmapi}"/>
- <pathelement location="${lib.mio}"/>
- </classpath>
- <src path="${dir.src}"/>
- </javac>
- <replace file="${dir.src}/org/tinytim/Version.java" token="${dist.version}" value="@RELEASE@"/>
- </target>
-
- <!-- =================================================================== -->
- <!-- Creates the Java Docs -->
- <!-- =================================================================== -->
- <target name="doc" depends="init">
- <mkdir dir="${dir.javadocs}"/>
- <javadoc destdir="${dir.javadocs}"
- packagenames="org.tinytim.*"
- author="true"
- version="true"
- use="true"
- splitindex="true"
- noindex="false"
- windowtitle="tinyTiM API v${dist.version}"
- doctitle="tinyTiM API v${dist.version}">
- <fileset dir="${dir.src}">
- <exclude name="org/tinytim/core/**"/>
- <exclude name="org/tinytim/index/**"/>
- <exclude name="org/tinytim/internal/**"/>
- <exclude name="org/tinytim/utils/Property.*"/>
- </fileset>
-<!--
- <doclet name="net.gleamynode.apiviz.APIviz"
- path="${dir.lib}/apiviz-1.2.4.GA.jar">
- </doclet>
--->
- <link href="http://www.tmapi.org/2.0/api/"/>
- </javadoc>
- </target>
-
- <!-- =================================================================== -->
- <!-- Creates the jar -->
- <!-- =================================================================== -->
- <target name="jar" depends="compile">
- <jar destfile="${dir.build}/${tinytim.jar}">
- <fileset dir="${dir.build.classes}">
- <include name="**/*.*"/>
- </fileset>
- <fileset dir="${dir.res}">
- <include name="**/*.*"/>
- </fileset>
- <manifest>
- <attribute name="Implementation-Title" value="tinyTiM"/>
- <attribute name="Implementation-Version" value="${dist.version}"/>
- <attribute name="Implementation-URL" value="http://tinytim.sourceforge.net/"/>
- </manifest>
- </jar>
- </target>
-
- <!-- =================================================================== -->
- <!-- Creates the test jar -->
- <!-- =================================================================== -->
- <target name="testjar" depends="compile, test">
- <jar destfile="${dir.build}/${tinytim-test.jar}">
- <fileset dir="${dir.build.tests}">
- <include name="**/*.*"/>
- </fileset>
- <manifest>
- <attribute name="Implementation-Title" value="tinyTiM Tests"/>
- <attribute name="Implementation-Version" value="${dist.version}"/>
- <attribute name="Implementation-URL" value="http://tinytim.sourceforge.net/"/>
- </manifest>
- </jar>
- </target>
-
- <!-- =================================================================== -->
- <!-- Prepares a distribution -->
- <!-- =================================================================== -->
- <target name="dist" depends="jar, testjar, doc">
- <mkdir dir="${dir.dist}"/>
-
- <copy todir="${dir.dist}" file="${dir.build}/${tinytim.jar}"/>
- <copy todir="${dir.dist}" file="${dir.build}/${tinytim-test.jar}"/>
-
- <copy todir="${dir.dist}/src">
- <fileset dir="${dir.src}"/>
- </copy>
- <replace file="${dir.dist}/src/org/tinytim/Version.java" token="@RELEASE@" value="${dist.version}"/>
- <copy todir="${dir.dist}/test">
- <fileset dir="${dir.test}"/>
- </copy>
- <copy todir="${dir.dist}/lib">
- <fileset dir="${dir.lib}">
- <include name="tmapi*"/>
- <include name="junit*"/>
- <include name="trove*"/>
- <include name="LICENSE.tmapi*"/>
- <include name="LICENSE.junit*"/>
- </fileset>
- </copy>
-
- <copy todir="${dir.dist}" file="CHANGES.txt"/>
- <copy todir="${dir.dist}" file="LICENSE.txt"/>
- <copy todir="${dir.dist}" file="README.txt"/>
- </target>
-
- <!-- =================================================================== -->
- <!-- Creates the distribution files (.zip and .tar.gz) -->
- <!-- -->
- <!-- Won't create the distribution files if a test fails -->
- <!-- =================================================================== -->
- <target name="release" depends="jar, test, dist">
- <tar destfile="${dir.dist.root}/${tinytim.tar}"
- basedir="${dir.dist.root}"/>
- <gzip src="${dir.dist.root}/${tinytim.tar}"
- destfile="${dir.build}/${tinytim.tar.gz}" />
- <delete file="${dir.dist.root}/${tinytim.tar}" />
- <zip destfile="${dir.build}/${tinytim.zip}" basedir="${dir.dist.root}"/>
- </target>
-</project>
+<?xml version="1.0" encoding="utf-8"?>
+<project name="tinyTiM" default="jar" basedir=".">
+ <property file="build.properties"/>
+ <tstamp/>
+ <property name="release_type" value="-snapshot-${DSTAMP}${TSTAMP}"/>
+
+ <property name="dir.src" value="${basedir}/src/main/java"/>
+ <property name="dir.test" value="${basedir}/src/test/java"/>
+ <property name="dir.lib" value="${basedir}/lib"/>
+ <property name="dir.res" value="${basedir}/src/main/resources"/>
+ <property name="dir.coverage" value="${basedir}/coverage"/>
+
+ <property name="lib.junit" value="${dir.lib}/junit-4.5.jar"/>
+ <property name="lib.trove" value="${dir.lib}/trove-2.1.0.jar"/>
+ <property name="lib.mio" value="${dir.lib}/semagia-mio-0.9.5.jar"/>
+ <property name="lib.tmapi" value="${dir.lib}/tmapi-2.0.jar"/>
+ <property name="lib.tmapi.tests" value="${dir.lib}/tmapi-2.0b1-tests.jar"/>
+ <property name="lib.emma" value="${dir.lib}/emma.jar"/>
+ <property name="lib.emma.task" value="${dir.lib}/emma_ant.jar"/>
+
+ <!-- directory that contains emma.jar and emma_ant.jar: -->
+ <property name="dir.emma" value="${dir.lib}" />
+
+ <!-- path element used by EMMA taskdef below: -->
+ <path id="emma.lib" >
+ <pathelement location="${dir.emma}/emma.jar" />
+ <pathelement location="${dir.emma}/emma_ant.jar" />
+ </path>
+
+ <!-- this loads <emma> and <emmajava> custom tasks: -->
+ <taskdef resource="emma_ant.properties" classpathref="emma.lib" />
+
+ <target name="help">
+ <echo message="--------------------"/>
+ <echo message="tinyTiM - Build file"/>
+ <echo message="--------------------"/>
+ <echo message=""/>
+ <echo message="Available targets:"/>
+ <echo message=""/>
+ <echo message=" jar Creates the jar"/>
+ <echo message=" testjar Creates the jar with the tests"/>
+ <echo message=" doc Creates the API documentation"/>
+ <echo message=" coverage Creates a coverage report"/>
+ <echo message=" release Creates the jar and a distributable file"/>
+ </target>
+
+ <target name="init">
+ <property name="dist.version" value="${version}${version_suffix}${release_type}"/>
+ <property name="dist.name" value="tinytim-${dist.version}"/>
+
+ <property name="tinytim.jar" value="${dist.name}.jar"/>
+ <property name="tinytim-test.jar" value="${dist.name}-tests.jar"/>
+ <property name="tinytim.tar" value="${dist.name}.tar"/>
+ <property name="tinytim.tar.gz" value="${tinytim.tar}.gz"/>
+ <property name="tinytim.zip" value="${dist.name}.zip"/>
+
+ <property name="dir.build" value="${basedir}/build"/>
+ <property name="dir.dist.root" value="${dir.build}/dist"/>
+ <property name="dir.dist" value="${dir.dist.root}/${dist.name}"/>
+ <property name="dir.build.classes" value="${dir.build}/classes"/>
+ <property name="dir.build.tests" value="${dir.build}/tests"/>
+ <property name="dir.javadocs" value="${dir.dist}/docs/api"/>
+
+ <path id="run.classpath" >
+ <pathelement location="${dir.build.classes}" />
+ <pathelement location="${dir.build.tests}" />
+ <pathelement location="${lib.junit}"/>
+ <pathelement location="${lib.mio}"/>
+ <pathelement location="${lib.tmapi}"/>
+ <pathelement location="${lib.tmapi.tests}"/>
+ <pathelement location="${lib.trove}"/>
+ </path>
+ </target>
+
+ <!-- =================================================================== -->
+ <!-- Clean targets -->
+ <!-- =================================================================== -->
+ <target name="clean" depends="init">
+ <delete dir="${dir.build}"/>
+ <delete dir="${dir.javadocs}"/>
+ </target>
+
+ <!-- =================================================================== -->
+ <!-- Prepares the build directory -->
+ <!-- =================================================================== -->
+ <target name="prepare" depends="init">
+ <mkdir dir="${dir.build}"/>
+ <mkdir dir="${dir.build.classes}"/>
+ </target>
+
+ <!-- =================================================================== -->
+ <!-- Coverage Tests -->
+ <!-- =================================================================== -->
+ <target name="coverage" depends="compile">
+ <mkdir dir="${dir.build.tests}"/>
+ <javac destdir="${dir.build.tests}"
+ debug="${debug}"
+ optimize="${optimize}"
+ target="1.5">
+ <classpath>
+ <pathelement location="${dir.build.classes}"/>
+ <pathelement location="${lib.junit}"/>
+ <pathelement location="${lib.mio}"/>
+ <pathelement location="${lib.tmapi}"/>
+ <pathelement location="${lib.tmapi.tests}"/>
+ <pathelement location="${lib.trove}"/>
+ </classpath>
+ <src path="${dir.test}"/>
+ </javac>
+ <mkdir dir="${dir.coverage}"/>
+ <emmajava libclasspathref="emma.lib"
+ sourcepath="${dir.src}"
+ fullmetadata="yes"
+ classname="org.tinytim.core.AllTests"
+ classpathref="run.classpath"
+ >
+ <filter includes="org.tinytim.*" excludes="org.tinytim.*Test*, org.tinytim.*$*" />
+ <html outfile="${dir.coverage}/index.html" />
+ </emmajava>
+ </target>
+
+ <!-- =================================================================== -->
+ <!-- Tests -->
+ <!-- =================================================================== -->
+ <target name="test" depends="compile">
+ <mkdir dir="${dir.build.tests}"/>
+ <javac destdir="${dir.build.tests}"
+ debug="${debug}"
+ optimize="${optimize}"
+ target="1.5">
+ <classpath>
+ <pathelement location="${dir.build.classes}"/>
+ <pathelement location="${lib.junit}"/>
+ <pathelement location="${lib.mio}"/>
+ <pathelement location="${lib.tmapi}"/>
+ <pathelement location="${lib.tmapi.tests}"/>
+ <pathelement location="${lib.trove}"/>
+ </classpath>
+ <src path="${dir.test}"/>
+ </javac>
+ <junit printsummary="true" showoutput="false"
+ errorProperty="test.failed" failureProperty="test.failed"
+ fork="true">
+ <classpath refid="run.classpath"/>
+ <formatter type="brief" usefile="false"/>
+ <test name="org.tinytim.core.AllTests"/>
+ </junit>
+ <fail message="Tests failed. Check test output." if="test.failed"/>
+ </target>
+
+ <!-- =================================================================== -->
+ <!-- Compile source files -->
+ <!-- =================================================================== -->
+ <target name="compile" depends="clean, prepare">
+ <replace file="${dir.src}/org/tinytim/Version.java" token="@RELEASE@" value="${dist.version}"/>
+ <javac destdir="${dir.build.classes}"
+ debug="${debug}"
+ target="1.5">
+ <classpath>
+ <pathelement location="${lib.tmapi}"/>
+ <pathelement location="${lib.trove}"/>
+ <pathelement location="${lib.mio}"/>
+ </classpath>
+ <src path="${dir.src}"/>
+ </javac>
+ <replace file="${dir.src}/org/tinytim/Version.java" token="${dist.version}" value="@RELEASE@"/>
+ </target>
+
+ <!-- =================================================================== -->
+ <!-- Creates the Java Docs -->
+ <!-- =================================================================== -->
+ <target name="doc" depends="init">
+ <mkdir dir="${dir.javadocs}"/>
+ <javadoc destdir="${dir.javadocs}"
+ packagenames="org.tinytim.*"
+ author="true"
+ version="true"
+ use="true"
+ splitindex="true"
+ noindex="false"
+ windowtitle="tinyTiM API v${dist.version}"
+ doctitle="tinyTiM API v${dist.version}">
+ <fileset dir="${dir.src}">
+ <exclude name="org/tinytim/core/**"/>
+ <exclude name="org/tinytim/index/**"/>
+ <exclude name="org/tinytim/internal/**"/>
+ <exclude name="org/tinytim/utils/Property.*"/>
+ </fileset>
+<!--
+ <doclet name="net.gleamynode.apiviz.APIviz"
+ path="${dir.lib}/apiviz-1.2.4.GA.jar">
+ </doclet>
+-->
+ <link href="http://www.tmapi.org/2.0/api/"/>
+ </javadoc>
+ </target>
+
+ <!-- =================================================================== -->
+ <!-- Creates the jar -->
+ <!-- =================================================================== -->
+ <target name="jar" depends="compile">
+ <jar destfile="${dir.build}/${tinytim.jar}">
+ <fileset dir="${dir.build.classes}">
+ <include name="**/*.*"/>
+ </fileset>
+ <fileset dir="${dir.res}">
+ <include name="**/*.*"/>
+ </fileset>
+ <manifest>
+ <attribute name="Implementation-Title" value="tinyTiM"/>
+ <attribute name="Implementation-Version" value="${dist.version}"/>
+ <attribute name="Implementation-URL" value="http://tinytim.sourceforge.net/"/>
+ <attribute name="Import-Package" value="org.osgi.framework,org.tmapi.core,org.tmapi.index"/>
+ <attribute name="Export-Package" value="org.tinytim.core"/>
+ <attribute name="Bundle-Name" value="tinyTiM"/>
+ <attribute name="Bundle-SymbolicName" value="org.tinytim;version=${dist.version}"/>
+ <attribute name="Bundle-Vendor" value="tinyTiM project"/>
+ <attribute name="Fragment-Host" value="org.tmapi.core"/>
+ <attribute name="Bundle-Version" value="${dist.version}"/>
+ </manifest>
+ </jar>
+ </target>
+
+ <!-- =================================================================== -->
+ <!-- Creates the test jar -->
+ <!-- =================================================================== -->
+ <target name="testjar" depends="compile, test">
+ <jar destfile="${dir.build}/${tinytim-test.jar}">
+ <fileset dir="${dir.build.tests}">
+ <include name="**/*.*"/>
+ </fileset>
+ <manifest>
+ <attribute name="Implementation-Title" value="tinyTiM Tests"/>
+ <attribute name="Implementation-Version" value="${dist.version}"/>
+ <attribute name="Implementation-URL" value="http://tinytim.sourceforge.net/"/>
+ </manifest>
+ </jar>
+ </target>
+
+ <!-- =================================================================== -->
+ <!-- Prepares a distribution -->
+ <!-- =================================================================== -->
+ <target name="dist" depends="jar, testjar, doc">
+ <mkdir dir="${dir.dist}"/>
+
+ <copy todir="${dir.dist}" file="${dir.build}/${tinytim.jar}"/>
+ <copy todir="${dir.dist}" file="${dir.build}/${tinytim-test.jar}"/>
+
+ <copy todir="${dir.dist}/src">
+ <fileset dir="${dir.src}"/>
+ </copy>
+ <replace file="${dir.dist}/src/org/tinytim/Version.java" token="@RELEASE@" value="${dist.version}"/>
+ <copy todir="${dir.dist}/test">
+ <fileset dir="${dir.test}"/>
+ </copy>
+ <copy todir="${dir.dist}/lib">
+ <fileset dir="${dir.lib}">
+ <include name="tmapi*"/>
+ <include name="junit*"/>
+ <include name="trove*"/>
+ <include name="LICENSE.tmapi*"/>
+ <include name="LICENSE.junit*"/>
+ <include name="LICENSE.trove*"/>
+ </fileset>
+ </copy>
+
+ <copy todir="${dir.dist}" file="CHANGES.txt"/>
+ <copy todir="${dir.dist}" file="LICENSE.txt"/>
+ <copy todir="${dir.dist}" file="README.txt"/>
+ </target>
+
+ <!-- =================================================================== -->
+ <!-- Creates the distribution files (.zip and .tar.gz) -->
+ <!-- -->
+ <!-- Won't create the distribution files if a test fails -->
+ <!-- =================================================================== -->
+ <target name="release" depends="jar, test, dist">
+ <tar destfile="${dir.dist.root}/${tinytim.tar}"
+ basedir="${dir.dist.root}"/>
+ <gzip src="${dir.dist.root}/${tinytim.tar}"
+ destfile="${dir.build}/${tinytim.tar.gz}" />
+ <delete file="${dir.dist.root}/${tinytim.tar}" />
+ <zip destfile="${dir.build}/${tinytim.zip}" basedir="${dir.dist.root}"/>
+ </target>
+</project>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <lh...@us...> - 2010-02-06 14:00:07
|
Revision: 365
http://tinytim.svn.sourceforge.net/tinytim/?rev=365&view=rev
Author: lheuer
Date: 2010-02-06 13:59:51 +0000 (Sat, 06 Feb 2010)
Log Message:
-----------
Updated TMAPI
Modified Paths:
--------------
tinytim/trunk/build.xml
Added Paths:
-----------
tinytim/trunk/lib/tmapi-2.0-tests.jar
tinytim/trunk/lib/tmapi-2.0.jar
Removed Paths:
-------------
tinytim/trunk/lib/tmapi-2.0RC2-tests.jar
tinytim/trunk/lib/tmapi-2.0RC2.jar
Modified: tinytim/trunk/build.xml
===================================================================
--- tinytim/trunk/build.xml 2010-01-15 18:23:39 UTC (rev 364)
+++ tinytim/trunk/build.xml 2010-02-06 13:59:51 UTC (rev 365)
@@ -12,8 +12,8 @@
<property name="lib.junit" value="${dir.lib}/junit-4.5.jar"/>
<property name="lib.mio" value="${dir.lib}/semagia-mio-0.9.5.jar"/>
- <property name="lib.tmapi" value="${dir.lib}/tmapi-2.0RC2.jar"/>
- <property name="lib.tmapi.tests" value="${dir.lib}/tmapi-2.0RC2-tests.jar"/>
+ <property name="lib.tmapi" value="${dir.lib}/tmapi-2.0.jar"/>
+ <property name="lib.tmapi.tests" value="${dir.lib}/tmapi-2.0-tests.jar"/>
<property name="lib.emma" value="${dir.lib}/emma.jar"/>
<property name="lib.emma.task" value="${dir.lib}/emma_ant.jar"/>
Added: tinytim/trunk/lib/tmapi-2.0-tests.jar
===================================================================
(Binary files differ)
Property changes on: tinytim/trunk/lib/tmapi-2.0-tests.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: tinytim/trunk/lib/tmapi-2.0.jar
===================================================================
(Binary files differ)
Property changes on: tinytim/trunk/lib/tmapi-2.0.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Deleted: tinytim/trunk/lib/tmapi-2.0RC2-tests.jar
===================================================================
(Binary files differ)
Deleted: tinytim/trunk/lib/tmapi-2.0RC2.jar
===================================================================
(Binary files differ)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <lh...@us...> - 2010-01-15 18:23:52
|
Revision: 364
http://tinytim.svn.sourceforge.net/tinytim/?rev=364&view=rev
Author: lheuer
Date: 2010-01-15 18:23:39 +0000 (Fri, 15 Jan 2010)
Log Message:
-----------
Update to new TMAPI release
Modified Paths:
--------------
tinytim/trunk/build.xml
Added Paths:
-----------
tinytim/trunk/lib/tmapi-2.0RC2-tests.jar
tinytim/trunk/lib/tmapi-2.0RC2.jar
Removed Paths:
-------------
tinytim/trunk/lib/tmapi-2.0RC1-tests.jar
tinytim/trunk/lib/tmapi-2.0RC1.jar
Modified: tinytim/trunk/build.xml
===================================================================
--- tinytim/trunk/build.xml 2010-01-13 14:57:37 UTC (rev 363)
+++ tinytim/trunk/build.xml 2010-01-15 18:23:39 UTC (rev 364)
@@ -12,8 +12,8 @@
<property name="lib.junit" value="${dir.lib}/junit-4.5.jar"/>
<property name="lib.mio" value="${dir.lib}/semagia-mio-0.9.5.jar"/>
- <property name="lib.tmapi" value="${dir.lib}/tmapi-2.0RC1.jar"/>
- <property name="lib.tmapi.tests" value="${dir.lib}/tmapi-2.0RC1-tests.jar"/>
+ <property name="lib.tmapi" value="${dir.lib}/tmapi-2.0RC2.jar"/>
+ <property name="lib.tmapi.tests" value="${dir.lib}/tmapi-2.0RC2-tests.jar"/>
<property name="lib.emma" value="${dir.lib}/emma.jar"/>
<property name="lib.emma.task" value="${dir.lib}/emma_ant.jar"/>
Deleted: tinytim/trunk/lib/tmapi-2.0RC1-tests.jar
===================================================================
(Binary files differ)
Deleted: tinytim/trunk/lib/tmapi-2.0RC1.jar
===================================================================
(Binary files differ)
Added: tinytim/trunk/lib/tmapi-2.0RC2-tests.jar
===================================================================
(Binary files differ)
Property changes on: tinytim/trunk/lib/tmapi-2.0RC2-tests.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: tinytim/trunk/lib/tmapi-2.0RC2.jar
===================================================================
(Binary files differ)
Property changes on: tinytim/trunk/lib/tmapi-2.0RC2.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <lh...@us...> - 2010-01-13 14:57:44
|
Revision: 363
http://tinytim.svn.sourceforge.net/tinytim/?rev=363&view=rev
Author: lheuer
Date: 2010-01-13 14:57:37 +0000 (Wed, 13 Jan 2010)
Log Message:
-----------
Fixes issue #2931353.
Modified Paths:
--------------
tinytim/trunk/CHANGES.txt
tinytim/trunk/src/main/java/org/tinytim/internal/utils/CompactHashSet.java
Modified: tinytim/trunk/CHANGES.txt
===================================================================
--- tinytim/trunk/CHANGES.txt 2010-01-11 12:42:35 UTC (rev 362)
+++ tinytim/trunk/CHANGES.txt 2010-01-13 14:57:37 UTC (rev 363)
@@ -7,6 +7,9 @@
* Added support to convert XTM 1.0 class-instance relationships
to TMDM type-instance relationships
* Added support to convert XTM 1.0 PSIs to TMDM PSIs
+* Moved to Ontopia's Compact(Hash|Identity)Set instead relying
+ on Java's default implementations
+* Removed support for trove's collections
Bugfixes:
---------
Modified: tinytim/trunk/src/main/java/org/tinytim/internal/utils/CompactHashSet.java
===================================================================
--- tinytim/trunk/src/main/java/org/tinytim/internal/utils/CompactHashSet.java 2010-01-11 12:42:35 UTC (rev 362)
+++ tinytim/trunk/src/main/java/org/tinytim/internal/utils/CompactHashSet.java 2010-01-13 14:57:37 UTC (rev 363)
@@ -329,13 +329,14 @@
public Object next() {
if (modCount != expectedModCount)
throw new ConcurrentModificationException();
- if (index >= objects.length) {
+ int length = objects.length;
+ if (index >= length) {
lastReturned = -2;
throw new NoSuchElementException();
}
lastReturned = index;
- for (index += 1; index < objects.length &&
+ for (index += 1; index < length &&
(objects[index] == null ||
objects[index] == deletedObject); index++)
;
@@ -354,6 +355,8 @@
if (objects[lastReturned] != null && objects[lastReturned] != deletedObject) {
objects[lastReturned] = deletedObject;
elements--;
+ modCount++;
+ expectedModCount = modCount; // this is expected; we made the change
}
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <lh...@us...> - 2010-01-11 14:49:26
|
Revision: 362
http://tinytim.svn.sourceforge.net/tinytim/?rev=362&view=rev
Author: lheuer
Date: 2010-01-11 12:42:35 +0000 (Mon, 11 Jan 2010)
Log Message:
-----------
Fixes issue #2926983
Modified Paths:
--------------
tinytim/trunk/CHANGES.txt
tinytim/trunk/src/main/java/org/tinytim/internal/utils/CopyUtils.java
Modified: tinytim/trunk/CHANGES.txt
===================================================================
--- tinytim/trunk/CHANGES.txt 2009-11-04 18:29:23 UTC (rev 361)
+++ tinytim/trunk/CHANGES.txt 2010-01-11 12:42:35 UTC (rev 362)
@@ -2,12 +2,16 @@
Changes Log
===========
-2.0.0 a6 (xx.yy.2009)
+2.0.0 a6 (2010-01-xx)
---------------------
* Added support to convert XTM 1.0 class-instance relationships
to TMDM type-instance relationships
* Added support to convert XTM 1.0 PSIs to TMDM PSIs
+Bugfixes:
+---------
+* Bug #2926983 -- Merging of associations fails
+ reported by Sven Krosse
2.0.0 a5 (23.07.2009)
Modified: tinytim/trunk/src/main/java/org/tinytim/internal/utils/CopyUtils.java
===================================================================
--- tinytim/trunk/src/main/java/org/tinytim/internal/utils/CopyUtils.java 2009-11-04 18:29:23 UTC (rev 361)
+++ tinytim/trunk/src/main/java/org/tinytim/internal/utils/CopyUtils.java 2010-01-11 12:42:35 UTC (rev 362)
@@ -1,5 +1,5 @@
/*
- * Copyright 2008 Lars Heuer (heuer[at]semagia.com)
+ * Copyright 2008 - 2010 Lars Heuer (heuer[at]semagia.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -336,12 +336,20 @@
Association existing = null;
ITopic type = null;
IScope scope = null;
+ ITopic roleType = null;
+ ITopic player = null;
+ Topic sourcePlayer = null;
for (Association assoc: source.getAssociations()) {
type = _copyType(assoc, target, mergeMap);
scope = _copyScope(assoc, target, mergeMap);
Association targetAssoc = target.createAssociation(type, scope);
for (Role role: assoc.getRoles()) {
- Role targetRole = targetAssoc.createRole(role.getType(), role.getPlayer());
+ roleType = _copyType(role, target, mergeMap);
+ sourcePlayer = role.getPlayer();
+ player = mergeMap.containsKey(sourcePlayer)
+ ? (ITopic) mergeMap.get(sourcePlayer)
+ : _copyTopic(sourcePlayer, target, mergeMap);
+ Role targetRole = targetAssoc.createRole(roleType, player);
_copyItemIdentifiers(role, targetRole);
_copyReifier(role, targetRole, mergeMap);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <lh...@us...> - 2009-11-04 18:29:32
|
Revision: 361
http://tinytim.svn.sourceforge.net/tinytim/?rev=361&view=rev
Author: lheuer
Date: 2009-11-04 18:29:23 +0000 (Wed, 04 Nov 2009)
Log Message:
-----------
Updated tinyTiM, removed CXTMWriter (part of tinyTiM now)
Added Paths:
-----------
tinytim-mio/trunk/lib/tinytim-2.0.0a6-snapshot-200911041800.jar
tinytim-mio/trunk/lib/tmapi-2.0RC1.jar
Removed Paths:
-------------
tinytim-mio/trunk/lib/tinytim-2.0.0a6-snapshot-200908271522.jar
tinytim-mio/trunk/lib/tmapi-2.0a2.jar
tinytim-mio/trunk/src/main/java/org/tinytim/mio/CXTMTopicMapWriter.java
tinytim-mio/trunk/src/main/java/org/tinytim/mio/XMLC14NWriter.java
Deleted: tinytim-mio/trunk/lib/tinytim-2.0.0a6-snapshot-200908271522.jar
===================================================================
(Binary files differ)
Added: tinytim-mio/trunk/lib/tinytim-2.0.0a6-snapshot-200911041800.jar
===================================================================
(Binary files differ)
Property changes on: tinytim-mio/trunk/lib/tinytim-2.0.0a6-snapshot-200911041800.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: tinytim-mio/trunk/lib/tmapi-2.0RC1.jar
===================================================================
(Binary files differ)
Property changes on: tinytim-mio/trunk/lib/tmapi-2.0RC1.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Deleted: tinytim-mio/trunk/lib/tmapi-2.0a2.jar
===================================================================
(Binary files differ)
Deleted: tinytim-mio/trunk/src/main/java/org/tinytim/mio/CXTMTopicMapWriter.java
===================================================================
--- tinytim-mio/trunk/src/main/java/org/tinytim/mio/CXTMTopicMapWriter.java 2009-11-04 16:58:30 UTC (rev 360)
+++ tinytim-mio/trunk/src/main/java/org/tinytim/mio/CXTMTopicMapWriter.java 2009-11-04 18:29:23 UTC (rev 361)
@@ -1,1226 +0,0 @@
-/*
- * Copyright 2008 Lars Heuer (heuer[at]semagia.com)
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.tinytim.mio;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.util.AbstractSet;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.NoSuchElementException;
-import java.util.Set;
-import java.util.logging.Logger;
-
-import org.tinytim.internal.api.IIndexManagerAware;
-import org.tinytim.internal.utils.CollectionFactory;
-import org.tinytim.utils.DuplicateRemovalUtils;
-import org.tinytim.voc.TMDM;
-import org.tinytim.voc.XSD;
-import org.tmapi.core.Association;
-import org.tmapi.core.Construct;
-import org.tmapi.core.DatatypeAware;
-import org.tmapi.core.Locator;
-import org.tmapi.core.Name;
-import org.tmapi.core.Occurrence;
-import org.tmapi.core.Reifiable;
-import org.tmapi.core.Role;
-import org.tmapi.core.Scoped;
-import org.tmapi.core.Topic;
-import org.tmapi.core.TopicInUseException;
-import org.tmapi.core.TopicMap;
-import org.tmapi.core.Typed;
-import org.tmapi.core.Variant;
-import org.tmapi.index.TypeInstanceIndex;
-
-import org.xml.sax.Attributes;
-import org.xml.sax.helpers.AttributesImpl;
-
-/**
- * Provides serialization of topic maps into Canonical XTM (CXTM).
- * <p>
- * CXTM is a format that guarantees that two equivalent Topic Maps Data Model
- * instances [ISO/IEC 13250-2] will always produce byte-by-byte identical
- * serializations, and that non-equivalent instances will always produce
- * different serializations.
- * </p>
- * <p>
- * See <a href="http://www.isotopicmaps.org/cxtm/">http://www.isotopicmaps.org/cxtm/</a>
- * for details.
- * </p>
- *
- * @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a>
- * @version $Rev$ - $Date$
- */
-public final class CXTMTopicMapWriter implements TopicMapWriter {
-
- private static final Logger LOG = Logger.getLogger(CXTMTopicMapWriter.class.getName());
-
- private static final Role[] _EMPTY_ROLES = new Role[0];
-
- private final AttributesImpl _attrs;
-
- private Topic _type;
- private Topic _instance;
- private Topic _typeInstance;
-
- private final XMLC14NWriter _out;
- private final String _normBase;
- private final Map<Construct, Integer> _construct2Id;
- private final Map<Topic, List<Role>> _topic2Roles;
- private final Map<Locator, String> _locator2Norm;
- private final Map<Association, Role[]> _assoc2Roles;
-
- private final Comparator<Topic> _topicComparator;
- private final Comparator<Association> _assocComparator;
- private final Comparator<Role> _roleComparator;
- private final Comparator<Occurrence> _occComparator;
- private final Comparator<Name> _nameComparator;
- private final Comparator<Variant> _variantComparator;
- private final Comparator<Set<Locator>> _locSetComparator;
- private final Comparator<Locator> _locComparator;
- private final Comparator<Set<Topic>> _scopeComparator;
-
- /**
- * Creates a canonicalizer.
- *
- * @param out The stream the CXTM is written onto.
- * @param baseLocator The base locator which is used to resolve IRIs against.
- * @throws IOException If an error occurs.
- */
- public CXTMTopicMapWriter(OutputStream out, String baseLocator) throws IOException {
- if (baseLocator == null) {
- throw new IllegalArgumentException("The base locator must not be null");
- }
- _out = new XMLC14NWriter(out);
- _attrs = new AttributesImpl();
- _normBase = _normalizeBaseLocator(baseLocator);
- _construct2Id = CollectionFactory.createIdentityMap();
- _locator2Norm = CollectionFactory.createIdentityMap();
- _assoc2Roles = CollectionFactory.createIdentityMap();
- _topic2Roles = CollectionFactory.createIdentityMap();
- _topicComparator = new TopicComparator();
- _assocComparator = new AssociationComparator();
- _roleComparator = new RoleComparator();
- _occComparator = new OccurrenceComparator();
- _nameComparator = new NameComparator();
- _variantComparator = new VariantComparator();
- _locSetComparator = new LocatorSetComparator();
- _locComparator = new LocatorComparator();
- _scopeComparator = new ScopeComparator();
- }
-
- /**
- * Serializes the specified <tt>topicMap</tt> into the CXTM format.
- * <p>
- * <em>CAUTION</em>: This method MAY modify the topic map since duplicate
- * Topic Maps constructs (if any) are removed in advance.
- * </p>
- *
- * @param topicMap The topic map to serialize.
- * @throws IOException If an error occurs.
- */
- public void write(TopicMap topicMap) throws IOException {
- DuplicateRemovalUtils.removeDuplicates(topicMap);
- TypeInstanceIndex typeInstanceIndex = ((IIndexManagerAware)topicMap).getIndexManager().getTypeInstanceIndex();
- if (!typeInstanceIndex.isAutoUpdated()) {
- typeInstanceIndex.reindex();
- }
- Topic[] topics = _fetchTopics(topicMap, typeInstanceIndex);
- Association[] assocs = _fetchAssociations(topicMap, typeInstanceIndex);
- typeInstanceIndex.close();
- _createIndex(topics, assocs);
- _out.startDocument();
- _attrs.clear();
- _addReifier(_attrs, topicMap);
- _out.startElement("topicMap", _attrs);
- _out.newline();
- _writeItemIdentifiers(topicMap);
- for (Topic topic: topics) {
- _writeTopic(topic);
- }
- for (Association assoc: assocs) {
- _writeAssociation(assoc);
- }
- _out.endElement("topicMap");
- _out.newline();
- _out.endDocument();
- _attrs.clear();
- _construct2Id.clear();
- _topic2Roles.clear();
- _locator2Norm.clear();
- _assoc2Roles.clear();
- }
-
- /**
- * Returns an unsorted array of topics which should be included into
- * the output.
- * <p>
- * This method may return more topics than {@link TopicMap#getTopics()}
- * since this method creates virtual topics to model type-instance
- * relationships properly.
- * </p>
- *
- * @param topicMap The topic map from which the topic should be serialized.
- * @param idx A (upto date) type instance index.
- * @return All topics which must be included into the output.
- */
- private Topic[] _fetchTopics(final TopicMap topicMap, final TypeInstanceIndex idx) {
- Collection<Topic> types = idx.getTopicTypes();
- if (types.isEmpty()) {
- Set<Topic> topics = topicMap.getTopics();
- return topics.toArray(new Topic[topics.size()]);
- }
- else {
- List<Topic> topics = CollectionFactory.createList(topicMap.getTopics());
- _typeInstance = _getTopicBySubjectIdentifier(topicMap, topics, TMDM.TYPE_INSTANCE);
- _type = _getTopicBySubjectIdentifier(topicMap, topics, TMDM.TYPE);
- _instance = _getTopicBySubjectIdentifier(topicMap, topics, TMDM.INSTANCE);
- return topics.toArray(new Topic[topics.size()]);
- }
- }
-
- /**
- * Returns a topic by its subject identifier. If the topic is null, a
- * {@link TypeInstanceTopic} is created, added to the <tt>topics</tt>
- * and returned.
- *
- * @param tm The topic map to fetch the topic from.
- * @param topics A modifiable collection of topics.
- * @param sid The subject identifier.
- * @return A topic with the specified subject identifier.
- */
- private Topic _getTopicBySubjectIdentifier(TopicMap tm, Collection<Topic> topics, Locator sid) {
- Topic topic = tm.getTopicBySubjectIdentifier(sid);
- if (topic == null) {
- topic = new TypeInstanceTopic(sid);
- topics.add(topic);
- }
- return topic;
- }
-
- /**
- * Returns an unsorted array of associations which should be serialized.
- *
- * This method may return more association than {@link TopicMap#getAssociations()}
- * since this method may create virtual associations which are used to
- * model type-instance relationships properly.
- *
- * @param tm The topic map from which the associations should be serialized.
- * @param idx A (upto date) type instance index.
- * @return An unsorted array of associations which must be included into the output.
- */
- private Association[] _fetchAssociations(final TopicMap tm, final TypeInstanceIndex idx) {
- Collection<Topic> types = idx.getTopicTypes();
- if (types.isEmpty()) {
- Set<Association> assocs = tm.getAssociations();
- return assocs.toArray(new Association[assocs.size()]);
- }
- else {
- List<Association> assocs = CollectionFactory.createList(tm.getAssociations());
- for (Topic type: types) {
- for (Topic instance: idx.getTopics(type)) {
- assocs.add(new TypeInstanceAssociation(type, instance));
- }
- }
- return assocs.toArray(new Association[assocs.size()]);
- }
- }
-
- /**
- * Creates the index on which the canonicalizer operates.
- *
- * As sideeffect, the provided topic and association arrays get sorted.
- *
- * @param topics An array of topics.
- * @param assocs An array of associations.
- */
- private void _createIndex(Topic[] topics, Association[] assocs) {
- Arrays.sort(topics, _topicComparator);
- Topic topic = null;
- for (int i=0; i < topics.length; i++) {
- topic = topics[i];
- _construct2Id.put(topic, Integer.valueOf(i+1));
- }
- Arrays.sort(assocs, _assocComparator);
- Association assoc = null;
- for (int i=0; i < assocs.length; i++) {
- assoc = assocs[i];
- _construct2Id.put(assoc, Integer.valueOf(i+1));
- Set<Role> roles_ = assoc.getRoles();
- Role[] roles = roles_.toArray(new Role[roles_.size()]);
- Arrays.sort(roles, _roleComparator);
- _assoc2Roles.put(assoc, roles);
- for (int j=0; j < roles.length; j++) {
- _construct2Id.put(roles[j], Integer.valueOf(j+1));
- }
- }
- }
-
- /**
- * Returns a sorted array of roles of the provided association.
- *
- * @param assoc The association to retrieve the roles from.
- * @return A (maybe empty) sorted array of roles.
- */
- private Role[] _getRoles(final Association assoc) {
- Role[] roles = _assoc2Roles.get(assoc);
- return roles != null ? roles : _EMPTY_ROLES;
- }
-
- /**
- * Returns a sorted array of names of the provided topic.
- *
- * @param topic The topic to retrieve the names from.
- * @return A (maybe empty) sorted array of names.
- */
- private Name[] _getNames(final Topic topic) {
- Set<Name> names_ = topic.getNames();
- Name[] names = names_.toArray(new Name[names_.size()]);
- Arrays.sort(names, _nameComparator);
- return names;
- }
-
- /**
- * Returs a sorted array of variants of the provided name.
- *
- * @param name The name to retrieve the variants from.
- * @return A (maybe empty) sorted array of variants.
- */
- private Variant[] _getVariants(final Name name) {
- Set<Variant> variants_ = name.getVariants();
- Variant[] variants = variants_.toArray(new Variant[variants_.size()]);
- Arrays.sort(variants, _variantComparator);
- return variants;
- }
-
- /**
- * Returns a sorted array of occurrences of the provided topic.
- *
- * @param topic The topic to retrieve the occurrences from.
- * @return A (maybe emtpy) sorted array of occurrences.
- */
- private Occurrence[] _getOccurrences(final Topic topic) {
- Set<Occurrence> occs_ = topic.getOccurrences();
- Occurrence[] occs = occs_.toArray(new Occurrence[occs_.size()]);
- Arrays.sort(occs, _occComparator);
- return occs;
- }
-
- /**
- * Returns the index of the provided Topic Maps construct.
- *
- * The "index" is <cite>"[...] the string encoding of the position of this
- * information item in the canonically ordered list of the values from
- * that set".</cite> (CXTM 3.20 Constructing the number attribute).
- *
- * @param tmo The Topic Maps construct to return the index of.
- * @return The index of the Topic Maps construct.
- */
- private int _indexOf(final Construct tmo) {
- return _construct2Id.get(tmo).intValue();
- }
-
- /**
- * Serializes the <tt>topic</tt>.
- *
- * @param topic The topic to serialize.
- * @throws IOException If an error occurs.
- */
- private void _writeTopic(final Topic topic) throws IOException {
- _attrs.clear();
- _attrs.addAttribute("", "number", "", "CDATA", Integer.toString(_indexOf(topic)));
- _out.startElement("topic", _attrs);
- _out.newline();
- _writeLocatorSet("subjectIdentifiers", topic.getSubjectIdentifiers());
- _writeLocatorSet("subjectLocators", topic.getSubjectLocators());
- _writeItemIdentifiers(topic);
- Name[] names = _getNames(topic);
- for (int i=0; i < names.length; i++) {
- _writeName(names[i], i+1);
- }
- Occurrence[] occs = _getOccurrences(topic);
- for (int i=0; i < occs.length; i++) {
- _writeOccurrence(occs[i], i+1);
- }
- List<Role> roles_ = CollectionFactory.createList(topic.getRolesPlayed());
- List<Role> alienRoles = _topic2Roles.get(topic);
- if (alienRoles != null) {
- roles_.addAll(alienRoles);
- }
- Role[] roles = roles_.toArray(new Role[roles_.size()]);
- Arrays.sort(roles, _roleComparator);
- StringBuilder sb = new StringBuilder(20);
- for (int i=0; i < roles.length; i++) {
- sb.append("association.")
- .append(_indexOf(roles[i].getParent()))
- .append(".role.")
- .append(_indexOf(roles[i]));
- _attrs.clear();
- _attrs.addAttribute("", "ref", "", "CDATA", sb.toString());
- _out.startElement("rolePlayed", _attrs);
- _out.endElement("rolePlayed");
- _out.newline();
- sb.setLength(0);
- }
- _out.endElement("topic");
- _out.newline();
- }
-
- /**
- * Serializes an association.
- *
- * @param assoc The association to serialize.
- * @throws IOException If an error occurs.
- */
- private void _writeAssociation(final Association assoc) throws IOException {
- _out.startElement("association", _attributes(assoc, _indexOf(assoc)));
- _out.newline();
- _writeType(assoc);
- for (Role role: _getRoles(assoc)) {
- _out.startElement("role", _attributes(role, _indexOf(role)));
- _out.newline();
- _out.startElement("player", _topicRef(role.getPlayer()));
- _out.endElement("player");
- _out.newline();
- _writeType(role);
- _writeItemIdentifiers(role);
- _out.endElement("role");
- _out.newline();
- }
- _writeScope(assoc);
- _writeItemIdentifiers(assoc);
- _out.endElement("association");
- _out.newline();
- }
-
- /**
- * Serializes an occurrence.
- *
- * @param occ The occurrence to serialize.
- * @param pos The position of the occurrence within the parent container.
- * @throws IOException If an error occurs.
- */
- private void _writeOccurrence(final Occurrence occ, int pos) throws IOException {
- _out.startElement("occurrence", _attributes(occ, pos));
- _out.newline();
- _writeDatatyped(occ);
- _writeType(occ);
- _writeScope(occ);
- _writeItemIdentifiers(occ);
- _out.endElement("occurrence");
- _out.newline();
- }
-
- /**
- * Writes the value/datatype pair of an occurrence or variant.
- *
- * @param obj The construct to serialize.
- * @throws IOException If an error occurs.
- */
- private void _writeDatatyped(final DatatypeAware obj) throws IOException {
- final String value = XSD.ANY_URI.equals(obj.getDatatype())
- ? _normalizeLocator(obj.locatorValue())
- : obj.getValue();
- _out.startElement("value");
- _out.characters(value);
- _out.endElement("value");
- _out.newline();
- _out.startElement("datatype");
- _out.characters(obj.getDatatype().getReference());
- _out.endElement("datatype");
- _out.newline();
- }
-
- /**
- * Serializes a topic name.
- *
- * @param name The name to serialize.
- * @param pos The position of the name within the parent container.
- * @throws IOException If an error occurs.
- */
- private void _writeName(final Name name, int pos) throws IOException {
- _out.startElement("name", _attributes(name, pos));
- _out.newline();
- _out.startElement("value");
- _out.characters(name.getValue());
- _out.endElement("value");
- _out.newline();
- _writeType(name);
- _writeScope(name);
- Variant[] variants = _getVariants(name);
- Variant variant = null;
- for (int i=0; i<variants.length; i++) {
- variant = variants[i];
- _out.startElement("variant", _attributes(variant, i+1));
- _out.newline();
- _writeDatatyped(variant);
- _writeScope(variant);
- _writeItemIdentifiers(variant);
- _out.endElement("variant");
- _out.newline();
- }
- _writeItemIdentifiers(name);
- _out.endElement("name");
- _out.newline();
- }
-
- /**
- * Serializes the type of a typed Topic Maps construct.
- *
- * @param typed The typed Topic Maps construct from which the type should be
- * serialized.
- * @throws IOException If an error occurs.
- */
- private void _writeType(final Typed typed) throws IOException {
- _out.startElement("type", _topicRef(typed.getType()));
- _out.endElement("type");
- _out.newline();
- }
-
- /**
- * Serializes the scope of a scoped Topic Maps construct.
- *
- * If the scope is unconstrained, this method does nothing.
- *
- * @param scoped The scoped Topic Maps construct.
- * @throws IOException If an error occurs.
- */
- private void _writeScope(final Scoped scoped) throws IOException {
- Set<Topic> scope = scoped.getScope();
- if (scope.isEmpty()) {
- return;
- }
- _out.startElement("scope");
- _out.newline();
- Topic[] themes = scope.toArray(new Topic[scope.size()]);
- Arrays.sort(themes, _topicComparator);
- for (int i=0; i < themes.length; i++) {
- _out.startElement("scopingTopic", _topicRef(themes[i]));
- _out.endElement("scopingTopic");
- _out.newline();
- }
- _out.endElement("scope");
- _out.newline();
- }
-
- /**
- * Serializes a locator.
- *
- * A normalized locator value is created which is serialized.
- *
- * @param loc The locator to serialize.
- * @throws IOException If an error occurs.
- */
- private void _writeLocator(final Locator loc) throws IOException {
- _out.startElement("locator");
- _out.characters(_normalizeLocator(loc));
- _out.endElement("locator");
- _out.newline();
- }
-
- /**
- * Serializes the item identifiers of the specified Topic Maps construct.
- *
- * @param tmo The Topic Maps construct to take the item identifiers from.
- * @throws IOException If an error occurs.
- */
- private void _writeItemIdentifiers(final Construct tmo) throws IOException {
- _writeLocatorSet("itemIdentifiers", tmo.getItemIdentifiers());
- }
-
- /**
- * Serializes the <tt>locators</tt> using the <tt>localName</tt> as
- * element name.
- * <p>
- * If the set of <tt>locators</tt> is empty, this method does nothing.
- * </p>
- *
- * @param localName The element's name.
- * @param locators The locators to serialize.
- * @throws IOException If an error occurs.
- */
- private void _writeLocatorSet(final String localName, final Set<Locator> locators) throws IOException {
- if (locators.isEmpty()) {
- return;
- }
- Locator[] locs = locators.toArray(new Locator[locators.size()]);
- Arrays.sort(locs, _locComparator);
- _out.startElement(localName);
- _out.newline();
- for (int i=0; i < locs.length; i++) {
- _writeLocator(locs[i]);
- }
- _out.endElement(localName);
- _out.newline();
- }
-
- /**
- * Returns attributes which contains a reference to the provided topic.
- *
- * @param topic The topic to which the reference should point to.
- * @return Attributes with a topic reference.
- */
- private Attributes _topicRef(final Topic topic) {
- if (topic == null) {
- _reportInvalid("The topic reference is null");
- return XMLC14NWriter.EMPTY_ATTRS;
- }
- _attrs.clear();
- _attrs.addAttribute("", "topicref", "", "CDATA", Integer.toString(_indexOf(topic)));
- return _attrs;
- }
-
- /**
- * Returns attributes which contain the reifier (if any) and the number
- * of the provided Topic Maps construct (not a topic).
- *
- * @param reifiable The Topic Maps construct.
- * @param pos The position of the reifiable within the parent container.
- * @return Attributes which contain a reference to the reifier (if any) and
- * the number of the provided Topic Maps construct.
- */
- private Attributes _attributes(final Reifiable reifiable, int pos) {
- _attrs.clear();
- _addReifier(_attrs, reifiable);
- _attrs.addAttribute("", "number", "", "CDATA", Integer.toString(pos));
- return _attrs;
- }
-
- /**
- * Adds a reference to the reifier of the Topic Maps construct to the
- * provided attributes. If the Topic Maps construct has no reifier, the
- * provided attributes are not modified.
- *
- * @param attrs The attributes.
- * @param reifiable The reifiable Topic Maps construct.
- */
- private void _addReifier(final AttributesImpl attrs, final Reifiable reifiable) {
- Topic reifier = reifiable.getReifier();
- if (reifier != null) {
- attrs.addAttribute("", "reifier", "", "CDATA", Integer.toString(_indexOf(reifier)));
- }
- }
-
- /**
- * Normalizes the locator according to CXTM 3.19.
- *
- * @param locator The locator to normalize.
- * @return A normalized representation of the locator.
- */
- private String _normalizeLocator(final Locator locator) {
- String normLoc = _locator2Norm.get(locator);
- if (normLoc != null) {
- return normLoc;
- }
- normLoc = locator.getReference();
- if (normLoc.startsWith(_normBase)) {
- normLoc = normLoc.substring(_normBase.length());
- }
- else {
- int i = 0;
- int slashPos = -1;
- final int max = Math.min(_normBase.length(), normLoc.length());
- while(i < max && _normBase.charAt(i) == normLoc.charAt(i)) {
- if (_normBase.charAt(i) == '/') {
- slashPos = i;
- }
- i++;
- }
- if (slashPos > -1) {
- normLoc = normLoc.substring(slashPos);
- }
- }
- if (normLoc.charAt(0) == '/') {
- normLoc = normLoc.substring(1);
- }
- _locator2Norm.put(locator, normLoc);
- return normLoc;
- }
-
- /**
- * Normalizes the base locator according to the following procedure
- * (CXTM 3.19 - 1.):
- * <cite>[...] the base locator with any fragment identifier and query
- * removed and any trailing "/" character removed.[...]</cite>
- *
- * @param baseLocator
- * @return
- */
- private static String _normalizeBaseLocator(final String baseLocator) {
- String loc = baseLocator;
- int i = loc.indexOf('#');
- if (i > 0) {
- loc = loc.substring(0, i);
- }
- i = loc.indexOf('?');
- if (i > 0) {
- loc = loc.substring(0, i);
- }
- if (loc.endsWith("/")) {
- loc = loc.substring(0, loc.length()-1);
- }
- return loc;
- }
-
- /**
- * Writes a warning msg to the log.
- *
- * This method is used to inform the user that the serialized topic map
- * is not valid acc. to CXTM.
- *
- * @param msg The warning message.
- */
- private static void _reportInvalid(final String msg) {
- LOG.warning("Invalid CXTM: '" + msg + "'");
- }
-
-
- /*
- * Comparators.
- */
-
- private final class TopicComparator implements Comparator<Topic> {
-
- public int compare(Topic o1, Topic o2) {
- if (o1 == o2) {
- return 0;
- }
- if (o1 != null && o2 == null) {
- _reportInvalid("Comparing topics where one topic is null");
- return +1;
- }
- else if (o1 == null && o2 != null) {
- _reportInvalid("Comparing topics where one topic is null");
- return -1;
- }
- int res = _locSetComparator.compare(o1.getSubjectIdentifiers(), o2.getSubjectIdentifiers());
- if (res == 0) {
- res = _locSetComparator.compare(o1.getSubjectLocators(), o2.getSubjectLocators());
- if (res == 0) {
- res = _locSetComparator.compare(o1.getItemIdentifiers(), o2.getItemIdentifiers());
- }
- }
- return res;
- }
- }
-
- /**
- * Abstract comparator that provides some utility methods which handle common
- * comparisons.
- */
- private abstract class AbstractComparator<T> implements Comparator<T> {
- int compareString(String o1, String o2) {
- if (o1 == null && o2 != null) {
- _reportInvalid("The first string value is null");
- return -1;
- }
- if (o1 != null && o2 == null) {
- _reportInvalid("The second string value is null");
- return +1;
- }
- return o1.compareTo(o2);
- }
- /**
- * Extracts the type of the typed Topic Maps constructs and compares
- * the topics.
- *
- * @param o1 The first typed Topic Maps construct.
- * @param o2 The second typed Topic Maps construct.
- * @return A negative integer, zero, or a positive integer as the
- * first argument is less than, equal to, or greater than the
- * second.
- */
- int compareType(Typed o1, Typed o2) {
- return _topicComparator.compare(o1.getType(), o2.getType());
- }
- /**
- * Extracts the scope of the scoped Topic Maps constructs and compares
- * them.
- *
- * @param o1 The first scoped Topic Maps construct.
- * @param o2 The second scoped Topic Maps construct.
- * @return A negative integer, zero, or a positive integer as the
- * first argument is less than, equal to, or greater than the
- * second.
- */
- int compareScope(Scoped o1, Scoped o2) {
- return _scopeComparator.compare(o1.getScope(), o2.getScope());
- }
- }
-
- /**
- * Enhances the {@link AbstractComparator} with a method to compare the
- * value and datatype of an occurrence or variant.
- */
- private abstract class AbstractDatatypeAwareComparator<T> extends AbstractComparator<T> {
- /**
- * Compares the value and datatype of the occurrences / variants.
- *
- * @param o1 The first occurrence / variant.
- * @param o2 The second occurrence / variant.
- * @return A negative integer, zero, or a positive integer as the
- * first argument is less than, equal to, or greater than the
- * second.
- */
- int _compareValueDatatype(DatatypeAware o1, DatatypeAware o2) {
- int res = compareString(o1.getValue(), o2.getValue());
- if (res == 0) {
- res = compareString(o1.getDatatype().getReference(), o2.getDatatype().getReference());
- }
- return res;
- }
- }
-
- /**
- * Canonical sort order:
- * 1. [type]
- * 2. [roles]
- * 3. [scope]
- * 4. [parent]
- */
- private final class AssociationComparator extends AbstractComparator<Association> {
-
- private Comparator<Set<Role>> _roleSetComparator;
-
- AssociationComparator() {
- _roleSetComparator = new RoleSetComparator();
- }
-
- public int compare(Association o1, Association o2) {
- if (o1 == o2) {
- return 0;
- }
- int res = compareType(o1, o2);
- if (res == 0) {
- res = _roleSetComparator.compare(o1.getRoles(), o2.getRoles());
- if (res == 0) {
- res = compareScope(o1, o2);
- }
- }
- return res;
- }
- }
-
- /**
- * Role comparator which ignores the parent association. This comparator
- * is meant to be used for roles where the parent is known to be equal or
- * unequal.
- */
- private class RoleIgnoreParentComparator extends AbstractComparator<Role> {
-
- public int compare(Role o1, Role o2) {
- if (o1 == o2) {
- return 0;
- }
- int res = _topicComparator.compare(o1.getPlayer(), o2.getPlayer());
- if (res == 0) {
- res = compareType(o1, o2);
- }
- return res;
- }
- }
-
- /**
- * Canonical sort order:
- * 1. [player]
- * 2. [type]
- * 3. [parent]
- */
- private final class RoleComparator extends RoleIgnoreParentComparator {
-
- public int compare(Role o1, Role o2) {
- if (o1 == o2) {
- return 0;
- }
- int res = super.compare(o1, o2);
- if (res == 0) {
- res = _assocComparator.compare(o1.getParent(), o2.getParent());
- }
- return res;
- }
- }
-
- /**
- * Canonical sort order:
- * 1. [value]
- * 2. [datatype]
- * 3. [type]
- * 4. [scope]
- * 5. [parent]
- */
- private final class OccurrenceComparator extends AbstractDatatypeAwareComparator<Occurrence> {
-
- public int compare(Occurrence o1, Occurrence o2) {
- if (o1 == o2) {
- return 0;
- }
- int res = _compareValueDatatype(o1, o2);
- if (res == 0) {
- res = compareType(o1, o2);
- if (res == 0) {
- res = compareScope(o1, o2);
- }
- }
- return res;
- }
-
- }
-
- /**
- * Canonical sort order:
- * 1. [value]
- * 2. [type]
- * 3. [scope]
- * 4. [parent]
- */
- private final class NameComparator extends AbstractComparator<Name> {
-
- public int compare(Name o1, Name o2) {
- if (o1 == o2) {
- return 0;
- }
- int res = compareString(o1.getValue(), o2.getValue());
- if (res == 0) {
- res = compareType(o1, o2);
- if (res == 0) {
- res = compareScope(o1, o2);
- }
- }
- return res;
- }
- }
-
- /**
- * Canonical sort order:
- * 1. [value]
- * 2. [datatype]
- * 3. [scope]
- * 4. [parent]
- */
- private final class VariantComparator extends AbstractDatatypeAwareComparator<Variant> {
-
- public int compare(Variant o1, Variant o2) {
- if (o1 == o2) {
- return 0;
- }
- int res = _compareValueDatatype(o1, o2);
- if (res == 0) {
- res = compareScope(o1, o2);
- }
- return res;
- }
- }
-
- /**
- * Comparator which compares the size of the provided set.
- *
- * Iff the size of the sets are equal, another comparison method is used
- * to compare the content of the sets.
- */
- private abstract class AbstractSetComparator<T> implements Comparator<Set<T>> {
-
- public int compare(Set<T> o1, Set<T> o2) {
- int s1 = o1.size();
- int s2 = o2.size();
- int res = s1 - s2;
- if (res == 0) {
- res = compareContent(o1, o2, s1);
- }
- return res;
- }
-
- /**
- * Called iff the size of the sets is equal.
- *
- * This method is used to compare the content of the sets.
- *
- * @param o1 The first set.
- * @param o2 The second set.
- * @param size The size of the set(s).
- * @return A negative integer, zero, or a positive integer as the
- * first argument is less than, equal to, or greater than the
- * second.
- */
- abstract int compareContent(Set<T> o1, Set<T> o2, int size);
- }
-
- /**
- * Compares role sets. The parent of the roles is ignored!
- */
- private final class RoleSetComparator extends AbstractSetComparator<Role> {
-
- private RoleIgnoreParentComparator _roleCmp;
-
- RoleSetComparator() {
- _roleCmp = new RoleIgnoreParentComparator();
- }
-
- @Override
- int compareContent(Set<Role> o1, Set<Role> o2,
- int size) {
- int res = 0;
- Role[] roles1 = o1.toArray(new Role[size]);
- Role[] roles2 = o2.toArray(new Role[size]);
- Arrays.sort(roles1, _roleCmp);
- Arrays.sort(roles2, _roleCmp);
- for (int i=0; i < size && res == 0; i++) {
- res = _roleCmp.compare(roles1[i], roles2[i]);
- }
- return res;
- }
-
- }
-
- /**
- * Compares the scope of two scoped Topic Maps constructs.
- */
- private final class ScopeComparator extends AbstractSetComparator<Topic> {
-
- @Override
- int compareContent(Set<Topic> o1, Set<Topic> o2, int size) {
- int res = 0 ;
- Topic[] topics1 = o1.toArray(new Topic[size]);
- Topic[] topics2 = o2.toArray(new Topic[size]);
- Arrays.sort(topics1, _topicComparator);
- Arrays.sort(topics2, _topicComparator);
- for (int i=0; i < size && res == 0; i++) {
- res = _topicComparator.compare(topics1[i], topics2[i]);
- }
- return res;
- }
-
- }
-
- /**
- * Comparator for sets of {@link org.tmapi.core.Locator}s.
- */
- private final class LocatorSetComparator extends AbstractSetComparator<Locator> {
-
- @Override
- int compareContent(Set<Locator> o1, Set<Locator> o2, int size) {
- int res = 0;
- Locator[] locs1 = o1.toArray(new Locator[size]);
- Locator[] locs2 = o2.toArray(new Locator[size]);
- Arrays.sort(locs1, _locComparator);
- Arrays.sort(locs2, _locComparator);
- for (int i=0; i < size && res == 0; i++) {
- res = _locComparator.compare(locs1[i], locs2[i]);
- }
- return res;
- }
- }
-
- /**
- * Compares {@link org.tmapi.core.Locator}s.
- */
- private final class LocatorComparator implements Comparator<Locator> {
-
- public int compare(Locator o1, Locator o2) {
- if (o1 == o2) {
- return 0;
- }
- return _normalizeLocator(o1).compareTo(_normalizeLocator(o2));
- }
-
- }
-
-
- /*
- * Helper classes to treat type-instance relationships, modelled as property
- * of a topic, as associations.
- */
-
- private final class TypeInstanceTopic implements Topic {
-
- private final Set<Locator> _sids;
-
- TypeInstanceTopic(Locator sid) {
- _sids = Collections.singleton(sid);
- }
-
- public Set<Locator> getSubjectIdentifiers() {
- return _sids;
- }
-
- public void addItemIdentifier(Locator arg0) { }
- public void addSubjectIdentifier(Locator arg0) {}
- public void addSubjectLocator(Locator arg0) {}
- public void addType(Topic arg0) {}
- public Set<Occurrence> getOccurrences() { return Collections.emptySet(); }
- public Reifiable getReified() { return null; }
- public Set<Role> getRolesPlayed() { return Collections.emptySet(); }
- public Set<Locator> getSubjectLocators() { return Collections.emptySet(); }
- public Set<Name> getNames() { return Collections.emptySet(); }
- public Set<Topic> getTypes() { return null; }
- public void mergeIn(Topic arg0) { }
- public void remove() throws TopicInUseException { }
- public void removeSubjectIdentifier(Locator arg0) { }
- public void removeSubjectLocator(Locator arg0) { }
- public void removeType(Topic arg0) { }
- public String getId() { return null; }
- public Set<Locator> getItemIdentifiers() { return Collections.emptySet(); }
- public TopicMap getTopicMap() { return null; }
- public void removeItemIdentifier(Locator arg0) { }
- public Name createName(String value, Collection<Topic> scope) { return null; }
- public Name createName(String value, Topic... scope) {return null;}
- public Name createName(Topic type, String value, Collection<Topic> scope) { return null; }
- public Name createName(Topic type, String value, Topic... scope) { return null; }
- public Occurrence createOccurrence(Topic type, Locator value, Collection<Topic> scope) { return null;}
- public Occurrence createOccurrence(Topic type, Locator value, Topic... scope) {return null;}
- public Occurrence createOccurrence(Topic type, String value, Collection<Topic> scope) { return null; }
- public Occurrence createOccurrence(Topic type, String value, Locator datatype, Collection<Topic> scope) { return null; }
- public Occurrence createOccurrence(Topic type, String value, Locator datatype, Topic... scope) { return null; }
- public Occurrence createOccurrence(Topic type, String value, Topic... scope) { return null; }
- public Set<Name> getNames(Topic type) { return null; }
- public Set<Occurrence> getOccurrences(Topic type) { return null;}
- public TopicMap getParent() { return null; }
- public Set<Role> getRolesPlayed(Topic type, Topic assocType) { return null; }
- public Set<Role> getRolesPlayed(Topic type) { return null; }
-
- }
-
- /**
- * Used to represent type-instance relationships which are modelled as
- * [type] property of topics.
- */
- private final class TypeInstanceAssociation implements Association {
-
- final Set<Role> _roles;
-
- TypeInstanceAssociation(Topic type, Topic instance) {
- Role typeRole = new TypeInstanceRole(this, _type, type);
- Role instanceRole = new TypeInstanceRole(this, _instance, instance);
- _roles = new TypeInstanceRoleSet(typeRole, instanceRole);
- }
-
- public Set<Role> getRoles() {
- return _roles;
- }
-
- public Topic getType() {
- return _typeInstance;
- }
-
- public Set<Topic> getRoleTypes() { return null; }
- public Set<Role> getRoles(Topic type) { return null; }
- public void setReifier(Topic reifier) { }
- public void addItemIdentifier(Locator itemIdentifier) { }
- public Set<Locator> getItemIdentifiers() { return Collections.emptySet(); }
- public TopicMap getParent() { return null; }
- public void removeItemIdentifier(Locator itemIdentifier) { }
- public Role createRole(Topic arg0, Topic arg1) { return null; }
- public Topic getReifier() { return null; }
- public void remove() {}
- public void setType(Topic arg0) {}
- public void addTheme(Topic arg0) {}
- public Set<Topic> getScope() { return Collections.emptySet(); }
- public void removeTheme(Topic arg0) {}
- public String getId() { return null; }
- public TopicMap getTopicMap() { return null; }
- }
-
- /**
- * Immutable association role.
- */
- private class TypeInstanceRole implements Role {
- private final Topic _type;
- private final Topic _player;
- private final Association _parent;
-
- TypeInstanceRole(Association parent, Topic type, Topic player) {
- _type = type;
- _player = player;
- _parent = parent;
- List<Role> roles = _topic2Roles.get(player);
- if (roles == null) {
- roles = CollectionFactory.createList();
- _topic2Roles.put(player, roles);
- }
- roles.add(this);
- }
-
- public Topic getType() {
- return _type;
- }
-
- public Topic getPlayer() {
- return _player;
- }
-
- public void setReifier(Topic reifier) { }
- public void addItemIdentifier(Locator itemIdentifier) { }
- public Set<Locator> getItemIdentifiers() { return Collections.emptySet(); }
- public Association getParent() { return _parent; }
- public void removeItemIdentifier(Locator itemIdentifier) { }
- public Association getAssociation() { return _parent; }
- public Topic getReifier() { return null; }
- public void remove() {}
- public void setPlayer(Topic arg0) {}
- public void setType(Topic arg0) {}
- public String getId() { return null; }
- public TopicMap getTopicMap() { return null; }
- }
-
- /**
- * Immutable 'set' of two roles.
- */
- private static class TypeInstanceRoleSet extends AbstractSet<Role> {
-
- private final Role _role1;
- private final Role _role2;
-
- TypeInstanceRoleSet(Role role1, Role role2) {
- _role1 = role1;
- _role2 = role2;
- }
-
- @Override
- public Iterator<Role> iterator() {
- return new TypeInstanceRoleSetIterator();
- }
-
- @Override
- public int size() {
- return 2;
- }
-
- private class TypeInstanceRoleSetIterator implements Iterator<Role> {
-
- private int _idx;
-
- public boolean hasNext() {
- return _idx < 2;
- }
-
- public Role next() {
- if (_idx > 1) {
- throw new NoSuchElementException();
- }
- return 0 == _idx++ ? _role1 : _role2;
- }
-
- public void remove() {
- new UnsupportedOperationException();
- }
- }
- }
-
-}
Deleted: tinytim-mio/trunk/src/main/java/org/tinytim/mio/XMLC14NWriter.java
===================================================================
--- tinytim-mio/trunk/src/main/java/org/tinytim/mio/XMLC14NWriter.java 2009-11-04 16:58:30 UTC (rev 360)
+++ tinytim-mio/trunk/src/main/java/org/tinytim/mio/XMLC14NWriter.java 2009-11-04 18:29:23 UTC (rev 361)
@@ -1,202 +0,0 @@
-/*
- * Copyright 2008 Lars Heuer (heuer[at]semagia.com)
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.tinytim.mio;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.util.Arrays;
-
-import org.xml.sax.Attributes;
-import org.xml.sax.helpers.AttributesImpl;
-
-/**
- * Simple SAX-alike XML writer that respects canonical XML to some extend.
- * <p>
- * This class is not meant to be a generic XML-C14N writer, but it is good
- * enough to support CXTM.
- * </p>
- *
- * @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a>
- * @version $Rev$ - $Date$
- */
-final class XMLC14NWriter {
-
- public static final Attributes EMPTY_ATTRS = new AttributesImpl();
-
- private static final char _NL = '\n';
-
- private final OutputStreamWriter _out;
-
- public XMLC14NWriter(OutputStream out) throws IOException {
- _out = new OutputStreamWriter(out, "UTF-8");
- }
-
- /**
- * Indicates the start of the serialization process.
- *
- * @throws IOException If an error occurs.
- */
- public void startDocument() throws IOException {
- // noop
- }
-
- /**
- * Indicates the end of the serialization process.
- *
- * @throws IOException If an error occurs.
- */
- public void endDocument() throws IOException {
- _out.flush();
- }
-
- /**
- * Indicates the start of an element with the specified local name.
- *
- * @see #startElement(String, Attributes).
- *
- * @param localName The element's name.
- * @throws IOException If an error occurs.
- */
- public void startElement(String localName) throws IOException {
- startElement(localName, EMPTY_ATTRS);
- }
-
- /**
- * Indicates the start of an element with the provided local name.
- *
- * The attributes written in canonical XML.
- *
- * @param localName The name of the element.
- * @param attrs The element's attributes.
- * @throws IOException If an error occurs.
- */
- public void startElement(String localName, Attributes attrs) throws IOException {
- String[] names = new String[attrs.getLength()];
- for (int i=0; i < names.length; i++) {
- names[i] = attrs.getLocalName(i);
- }
- Arrays.sort(names);
- _out.write('<');
- _out.write(localName);
- for (int i=0; i < names.length; i++) {
- _out.write(' ');
- _out.write(names[i]);
- _out.write("=\"");
- _writeEscapedAttributeValue(attrs.getValue("", names[i]));
- _out.write('"');
- }
- _out.write('>');
- }
-
- /**
- * Indicates the end of an elemnt.
- *
- * @param localName The element's name.
- * @throws IOException If an error occurs.
- */
- public void endElement(String localName) throws IOException {
- _out.write("</");
- _out.write(localName);
- _out.write('>');
- }
-
- /**
- * Writes a <tt>#x0A</tt> to the output.
- *
- * @throws IOException If an error occurs.
- */
- public void newline() throws IOException {
- _out.write(_NL);
- }
-
- /**
- * Writes the specified characters to the output.
- * <p>
- * The data is written according to the rules of canonicalized XML.
- * </p>
- *
- * @param data The data to write.
- * @throws IOException If an error occurs.
- */
- public void characters(String data) throws IOException {
- _writeEscapedTextContent(data);
- }
-
- /**
- * Escapes the data according to the canonical XML rules.
- *
- * @param value The value.
- * @return The escaped value.
- * @throws IOException
- */
- private void _writeEscapedTextContent(String value) throws IOException {
- char[] ch = value.toCharArray();
- for (int i=0; i < ch.length; i++) {
- switch(ch[i]) {
- case '\r':
- _out.write("
");
- break;
- case '&':
- _out.write("&");
- break;
- case '<':
- _out.write("<");
- break;
- case '>':
- _out.write(">");
- break;
- default:
- _out.write(ch[i]);
- }
- }
- }
-
- /**
- * Escapes the attribute's value according to canonical XML.
- *
- * @param value The value to escape.
- * @return The escaped value.
- * @throws IOException
- */
- private void _writeEscapedAttributeValue(String value) throws IOException {
- char[] ch = value.toCharArray();
- for (int i=0; i<ch.length; i++) {
- switch(ch[i]) {
- case '\t':
- _out.write("	");
- break;
- case '\n':
- _out.write("
");
- break;
- case '\r':
- _out.write("
");
- break;
- case '\"':
- _out.write(""");
- break;
- case '&':
- _out.write("&");
- break;
- case '<':
- _out.write("<");
- break;
- default:
- _out.write(ch[i]);
- }
- }
- }
-}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <lh...@us...> - 2009-11-04 16:58:52
|
Revision: 360
http://tinytim.svn.sourceforge.net/tinytim/?rev=360&view=rev
Author: lheuer
Date: 2009-11-04 16:58:30 +0000 (Wed, 04 Nov 2009)
Log Message:
-----------
Switch to Ontopia's Compact*Set, removed trove
Modified Paths:
--------------
tinytim/trunk/README.txt
tinytim/trunk/build.xml
tinytim/trunk/src/main/java/org/tinytim/internal/utils/CollectionFactory.java
tinytim/trunk/src/main/java/org/tinytim/internal/utils/CopyUtils.java
tinytim/trunk/src/test/java/org/tinytim/core/AllTests.java
Added Paths:
-----------
tinytim/trunk/lib/tmapi-2.0RC1-tests.jar
tinytim/trunk/lib/tmapi-2.0RC1.jar
tinytim/trunk/src/main/java/org/tinytim/internal/utils/CompactHashSet.java
tinytim/trunk/src/main/java/org/tinytim/internal/utils/CompactIdentityHashSet.java
tinytim/trunk/src/main/java/org/tinytim/internal/utils/OntopiaCollectionFactory.java
tinytim/trunk/src/main/java/org/tinytim/mio/CXTMTopicMapWriter.java
tinytim/trunk/src/main/java/org/tinytim/mio/XMLC14NWriter.java
Removed Paths:
-------------
tinytim/trunk/lib/LICENSE.trove.txt
tinytim/trunk/lib/tmapi-2.0b1-tests.jar
tinytim/trunk/lib/tmapi-2.0b1.jar
tinytim/trunk/lib/trove-2.1.0.jar
tinytim/trunk/src/main/java/org/tinytim/internal/utils/JavaCollectionFactory.java
tinytim/trunk/src/main/java/org/tinytim/internal/utils/TroveCollectionFactory.java
Modified: tinytim/trunk/README.txt
===================================================================
--- tinytim/trunk/README.txt 2009-10-09 11:54:46 UTC (rev 359)
+++ tinytim/trunk/README.txt 2009-11-04 16:58:30 UTC (rev 360)
@@ -12,10 +12,9 @@
Installation
------------
No real installation needed, simply put the ``tinytim-2.0.0a6.jar`` and
-``tmapi-2.0a2.jar`` into your classpath. That's all. :)
-Optionally, you can put the ``trove-<VERSION>.jar`` into your classpath which
-makes tinyTiM slightly more memory efficient and faster.
+``tmapi-2*.jar`` into your classpath. That's all. :)
+
Mailing List
------------
If you have questions or suggestions, use our mailinglist
Modified: tinytim/trunk/build.xml
===================================================================
--- tinytim/trunk/build.xml 2009-10-09 11:54:46 UTC (rev 359)
+++ tinytim/trunk/build.xml 2009-11-04 16:58:30 UTC (rev 360)
@@ -11,10 +11,9 @@
<property name="dir.coverage" value="${basedir}/coverage"/>
<property name="lib.junit" value="${dir.lib}/junit-4.5.jar"/>
- <property name="lib.trove" value="${dir.lib}/trove-2.1.0.jar"/>
<property name="lib.mio" value="${dir.lib}/semagia-mio-0.9.5.jar"/>
- <property name="lib.tmapi" value="${dir.lib}/tmapi-2.0b1.jar"/>
- <property name="lib.tmapi.tests" value="${dir.lib}/tmapi-2.0b1-tests.jar"/>
+ <property name="lib.tmapi" value="${dir.lib}/tmapi-2.0RC1.jar"/>
+ <property name="lib.tmapi.tests" value="${dir.lib}/tmapi-2.0RC1-tests.jar"/>
<property name="lib.emma" value="${dir.lib}/emma.jar"/>
<property name="lib.emma.task" value="${dir.lib}/emma_ant.jar"/>
@@ -68,7 +67,6 @@
<pathelement location="${lib.mio}"/>
<pathelement location="${lib.tmapi}"/>
<pathelement location="${lib.tmapi.tests}"/>
- <pathelement location="${lib.trove}"/>
</path>
</target>
@@ -103,7 +101,6 @@
<pathelement location="${lib.mio}"/>
<pathelement location="${lib.tmapi}"/>
<pathelement location="${lib.tmapi.tests}"/>
- <pathelement location="${lib.trove}"/>
</classpath>
<src path="${dir.test}"/>
</javac>
@@ -134,7 +131,6 @@
<pathelement location="${lib.mio}"/>
<pathelement location="${lib.tmapi}"/>
<pathelement location="${lib.tmapi.tests}"/>
- <pathelement location="${lib.trove}"/>
</classpath>
<src path="${dir.test}"/>
</javac>
@@ -158,7 +154,6 @@
target="1.5">
<classpath>
<pathelement location="${lib.tmapi}"/>
- <pathelement location="${lib.trove}"/>
<pathelement location="${lib.mio}"/>
</classpath>
<src path="${dir.src}"/>
@@ -253,7 +248,6 @@
<include name="trove*"/>
<include name="LICENSE.tmapi*"/>
<include name="LICENSE.junit*"/>
- <include name="LICENSE.trove*"/>
</fileset>
</copy>
Deleted: tinytim/trunk/lib/LICENSE.trove.txt
===================================================================
--- tinytim/trunk/lib/LICENSE.trove.txt 2009-10-09 11:54:46 UTC (rev 359)
+++ tinytim/trunk/lib/LICENSE.trove.txt 2009-11-04 16:58:30 UTC (rev 360)
@@ -1,528 +0,0 @@
-The Trove library is licensed under the Lesser GNU Public License,
-which is included with the distribution in a file called LICENSE.txt.
-
-Other license arrangements are possible, for a fee: contact
-er...@us... for terms/pricing.
-
-The PrimeFinder and HashFunctions classes in Trove are subject to the
-following license restrictions:
-
-Copyright (c) 1999 CERN - European Organization for Nuclear Research.
-
-Permission to use, copy, modify, distribute and sell this software and
-its documentation for any purpose is hereby granted without fee,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation. CERN makes no representations about the
-suitability of this software for any purpose. It is provided "as is"
-without expressed or implied warranty.
-
-
-
-Content of Trove's LICENSE.txt:
-
-
- GNU LESSER GENERAL PUBLIC LICENSE
- Version 2.1, February 1999
-
- Copyright (C) 1991, 1999 Free Software Foundation, Inc.
- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-[This is the first released version of the Lesser GPL. It also counts
- as the successor of the GNU Library Public License, version 2, hence
- the version number 2.1.]
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-Licenses are intended to guarantee your freedom to share and change
-free software--to make sure the software is free for all its users.
-
- This license, the Lesser General Public License, applies to some
-specially designated software packages--typically libraries--of the
-Free Software Foundation and other authors who decide to use it. You
-can use it too, but we suggest you first think carefully about whether
-this license or the ordinary General Public License is the better
-strategy to use in any particular case, based on the explanations below.
-
- When we speak of free software, we are referring to freedom of use,
-not price. Our General Public Licenses are designed to make sure that
-you have the freedom to distribute copies of free software (and charge
-for this service if you wish); that you receive source code or can get
-it if you want it; that you can change the software and use pieces of
-it in new free programs; and that you are informed that you can do
-these things.
-
- To protect your rights, we need to make restrictions that forbid
-distributors to deny you these rights or to ask you to surrender these
-rights. These restrictions translate to certain responsibilities for
-you if you distribute copies of the library or if you modify it.
-
- For example, if you distribute copies of the library, whether gratis
-or for a fee, you must give the recipients all the rights that we gave
-you. You must make sure that they, too, receive or can get the source
-code. If you link other code with the library, you must provide
-complete object files to the recipients, so that they can relink them
-with the library after making changes to the library and recompiling
-it. And you must show them these terms so they know their rights.
-
- We protect your rights with a two-step method: (1) we copyright the
-library, and (2) we offer you this license, which gives you legal
-permission to copy, distribute and/or modify the library.
-
- To protect each distributor, we want to make it very clear that
-there is no warranty for the free library. Also, if the library is
-modified by someone else and passed on, the recipients should know
-that what they have is not the original version, so that the original
-author's reputation will not be affected by problems that might be
-introduced by others.
-
- Finally, software patents pose a constant threat to the existence of
-any free program. We wish to make sure that a company cannot
-effectively restrict the users of a free program by obtaining a
-restrictive license from a patent holder. Therefore, we insist that
-any patent license obtained for a version of the library must be
-consistent with the full freedom of use specified in this license.
-
- Most GNU software, including some libraries, is covered by the
-ordinary GNU General Public License. This license, the GNU Lesser
-General Public License, applies to certain designated libraries, and
-is quite different from the ordinary General Public License. We use
-this license for certain libraries in order to permit linking those
-libraries into non-free programs.
-
- When a program is linked with a library, whether statically or using
-a shared library, the combination of the two is legally speaking a
-combined work, a derivative of the original library. The ordinary
-General Public License therefore permits such linking only if the
-entire combination fits its criteria of freedom. The Lesser General
-Public License permits more lax criteria for linking other code with
-the library.
-
- We call this license the "Lesser" General Public License because it
-does Less to protect the user's freedom than the ordinary General
-Public License. It also provides other free software developers Less
-of an advantage over competing non-free programs. These disadvantages
-are the reason we use the ordinary General Public License for many
-libraries. However, the Lesser license provides advantages in certain
-special circumstances.
-
- For example, on rare occasions, there may be a special need to
-encourage the widest possible use of a certain library, so that it becomes
-a de-facto standard. To achieve this, non-free programs must be
-allowed to use the library. A more frequent case is that a free
-library does the same job as widely used non-free libraries. In this
-case, there is little to gain by limiting the free library to free
-software only, so we use the Lesser General Public License.
-
- In other cases, permission to use a particular library in non-free
-programs enables a greater number of people to use a large body of
-free software. For example, permission to use the GNU C Library in
-non-free programs enables many more people to use the whole GNU
-operating system, as well as its variant, the GNU/Linux operating
-system.
-
- Although the Lesser General Public License is Less protective of the
-users' freedom, it does ensure that the user of a program that is
-linked with the Library has the freedom and the wherewithal to run
-that program using a modified version of the Library.
-
- The precise terms and conditions for copying, distribution and
-modification follow. Pay close attention to the difference between a
-"work based on the library" and a "work that uses the library". The
-former contains code derived from the library, whereas the latter must
-be combined with the library in order to run.
-
- GNU LESSER GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License Agreement applies to any software library or other
-program which contains a notice placed by the copyright holder or
-other authorized party saying it may be distributed under the terms of
-this Lesser General Public License (also called "this License").
-Each licensee is addressed as "you".
-
- A "library" means a collection of software functions and/or data
-prepared so as to be conveniently linked with application programs
-(which use some of those functions and data) to form executables.
-
- The "Library", below, refers to any such software library or work
-which has been distributed under these terms. A "work based on the
-Library" means either the Library or any derivative work under
-copyright law: that is to say, a work containing the Library or a
-portion of it, either verbatim or with modifications and/or translated
-straightforwardly into another language. (Hereinafter, translation is
-included without limitation in the term "modification".)
-
- "Source code" for a work means the preferred form of the work for
-making modifications to it. For a library, complete source code means
-all the source code for all modules it contains, plus any associated
-interface definition files, plus the scripts used to control compilation
-and installation of the library.
-
- Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running a program using the Library is not restricted, and output from
-such a program is covered only if its contents constitute a work based
-on the Library (independent of the use of the Library in a tool for
-writing it). Whether that is true depends on what the Library does
-and what the program that uses the Library does.
-
- 1. You may copy and distribute verbatim copies of the Library's
-complete source code as you receive it, in any medium, provided that
-you conspicuously and appropriately publish on each copy an
-appropriate copyright notice and disclaimer of warranty; keep intact
-all the notices that refer to this License and to the absence of any
-warranty; and distribute a copy of this License along with the
-Library.
-
- You may charge a fee for the physical act of transferring a copy,
-and you may at your option offer warranty protection in exchange for a
-fee.
-
- 2. You may modify your copy or copies of the Library or any portion
-of it, thus forming a work based on the Library, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) The modified work must itself be a software library.
-
- b) You must cause the files modified to carry prominent notices
- stating that you changed the files and the date of any change.
-
- c) You must cause the whole of the work to be licensed at no
- charge to all third parties under the terms of this License.
-
- d) If a facility in the modified Library refers to a function or a
- table of data to be supplied by an application program that uses
- the facility, other than as an argument passed when the facility
- is invoked, then you must make a good faith effort to ensure that,
- in the event an application does not supply such function or
- table, the facility still operates, and performs whatever part of
- its purpose remains meaningful.
-
- (For example, a function in a library to compute square roots has
- a purpose that is entirely well-defined independent of the
- application. Therefore, Subsection 2d requires that any
- application-supplied function or table used by this function must
- be optional: if the application does not supply it, the square
- root function must still compute square roots.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Library,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Library, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote
-it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Library.
-
-In addition, mere aggregation of another work not based on the Library
-with the Library (or with a work based on the Library) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may opt to apply the terms of the ordinary GNU General Public
-License instead of this License to a given copy of the Library. To do
-this, you must alter all the notices that refer to this License, so
-that they refer to the ordinary GNU General Public License, version 2,
-instead of to this License. (If a newer version than version 2 of the
-ordinary GNU General Public License has appeared, then you can specify
-that version instead if you wish.) Do not make any other change in
-these notices.
-
- Once this change is made in a given copy, it is irreversible for
-that copy, so the ordinary GNU General Public License applies to all
-subsequent copies and derivative works made from that copy.
-
- This option is useful when you wish to copy part of the code of
-the Library into a program that is not a library.
-
- 4. You may copy and distribute the Library (or a portion or
-derivative of it, under Section 2) in object code or executable form
-under the terms of Sections 1 and 2 above provided that you accompany
-it with the complete corresponding machine-readable source code, which
-must be distributed under the terms of Sections 1 and 2 above on a
-medium customarily used for software interchange.
-
- If distribution of object code is made by offering access to copy
-from a designated place, then offering equivalent access to copy the
-source code from the same place satisfies the requirement to
-distribute the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 5. A program that contains no derivative of any portion of the
-Library, but is designed to work with the Library by being compiled or
-linked with it, is called a "work that uses the Library". Such a
-work, in isolation, is not a derivative work of the Library, and
-therefore falls outside the scope of this License.
-
- However, linking a "work that uses the Library" with the Library
-creates an executable that is a derivative of the Library (because it
-contains portions of the Library), rather than a "work that uses the
-library". The executable is therefore covered by this License.
-Section 6 states terms for distribution of such executables.
-
- When a "work that uses the Library" uses material from a header file
-that is part of the Library, the object code for the work may be a
-derivative work of the Library even though the source code is not.
-Whether this is true is especially significant if the work can be
-linked without the Library, or if the work is itself a library. The
-threshold for this to be true is not precisely defined by law.
-
- If such an object file uses only numerical parameters, data
-structure layouts and accessors, and small macros and small inline
-functions (ten lines or less in length), then the use of the object
-file is unrestricted, regardless of whether it is legally a derivative
-work. (Executables containing this object code plus portions of the
-Library will still fall under Section 6.)
-
- Otherwise, if the work is a derivative of the Library, you may
-distribute the object code for the work under the terms of Section 6.
-Any executables containing that work also fall under Section 6,
-whether or not they are linked directly with the Library itself.
-
- 6. As an exception to the Sections above, you may also combine or
-link a "work that uses the Library" with the Library to produce a
-work containing portions of the Library, and distribute that work
-under terms of your choice, provided that the terms permit
-modification of the work for the customer's own use and reverse
-engineering for debugging such modifications.
-
- You must give prominent notice with each copy of the work that the
-Library is used in it and that the Library and its use are covered by
-this License. You must supply a copy of this License. If the work
-during execution displays copyright notices, you must include the
-copyright notice for the Library among them, as well as a reference
-directing the user to the copy of this License. Also, you must do one
-of these things:
-
- a) Accompany the work with the complete corresponding
- machine-readable source code for the Library including whatever
- changes were used in the work (which must be distributed under
- Sections 1 and 2 above); and, if the work is an executable linked
- with the Library, with the complete machine-readable "work that
- uses the Library", as object code and/or source code, so that the
- user can modify the Library and then relink to produce a modified
- executable containing the modified Library. (It is understood
- that the user who changes the contents of definitions files in the
- Library will not necessarily be able to recompile the application
- to use the modified definitions.)
-
- b) Use a suitable shared library mechanism for linking with the
- Library. A suitable mechanism is one that (1) uses at run time a
- copy of the library already present on the user's computer system,
- rather than copying library functions into the executable, and (2)
- will operate properly with a modified version of the library, if
- the user installs one, as long as the modified version is
- interface-compatible with the version that the work was made with.
-
- c) Accompany the work with a written offer, valid for at
- least three years, to give the same user the materials
- specified in Subsection 6a, above, for a charge no more
- than the cost of performing this distribution.
-
- d) If distribution of the work is made by offering access to copy
- from a designated place, offer equivalent access to copy the above
- specified materials from the same place.
-
- e) Verify that the user has already received a copy of these
- materials or that you have already sent this user a copy.
-
- For an executable, the required form of the "work that uses the
-Library" must include any data and utility programs needed for
-reproducing the executable from it. However, as a special exception,
-the materials to be distributed need not include anything that is
-normally distributed (in either source or binary form) with the major
-components (compiler, kernel, and so on) of the operating system on
-which the executable runs, unless that component itself accompanies
-the executable.
-
- It may happen that this requirement contradicts the license
-restrictions of other proprietary libraries that do not normally
-accompany the operating system. Such a contradiction means you cannot
-use both them and the Library together in an executable that you
-distribute.
-
- 7. You may place library facilities that are a work based on the
-Library side-by-side in a single library together with other library
-facilities not covered by this License, and distribute such a combined
-library, provided that the separate distribution of the work based on
-the Library and of the other library facilities is otherwise
-permitted, and provided that you do these two things:
-
- a) Accompany the combined library with a copy of the same work
- based on the Library, uncombined with any other library
- facilities. This must be distributed under the terms of the
- Sections above.
-
- b) Give prominent notice with the combined library of the fact
- that part of it is a work based on the Library, and explaining
- where to find the accompanying uncombined form of the same work.
-
- 8. You may not copy, modify, sublicense, link with, or distribute
-the Library except as expressly provided under this License. Any
-attempt otherwise to copy, modify, sublicense, link with, or
-distribute the Library is void, and will automatically terminate your
-rights under this License. However, parties who have received copies,
-or rights, from you under this License will not have their licenses
-terminated so long as such parties remain in full compliance.
-
- 9. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Library or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Library (or any work based on the
-Library), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Library or works based on it.
-
- 10. Each time you redistribute the Library (or any work based on the
-Library), the recipient automatically receives a license from the
-original licensor to copy, distribute, link with or modify the Library
-subject to these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties with
-this License.
-
- 11. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Library at all. For example, if a patent
-license would not permit royalty-free redistribution of the Library by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Library.
-
-If any portion of this section is held invalid or unenforceable under any
-particular circumstance, the balance of the section is intended to apply,
-and the section as a whole is intended to apply in other circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 12. If the distribution and/or use of the Library is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Library under this License may add
-an explicit geographical distribution limitation excluding those countries,
-so that distribution is permitted only in or among countries not thus
-excluded. In such case, this License incorporates the limitation as if
-written in the body of this License.
-
- 13. The Free Software Foundation may publish revised and/or new
-versions of the Lesser General Public License from time to time.
-Such new versions will be similar in spirit to the present version,
-but may differ in detail to address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Library
-specifies a version number of this License which applies to it and
-"any later version", you have the option of following the terms and
-conditions either of that version or of any later version published by
-the Free Software Foundation. If the Library does not specify a
-license version number, you may choose any version ever published by
-the Free Software Foundation.
-
- 14. If you wish to incorporate parts of the Library into other free
-programs whose distribution conditions are incompatible with these,
-write to the author to ask for permission. For software which is
-copyrighted by the Free Software Foundation, write to the Free
-Software Foundation; we sometimes make exceptions for this. Our
-decision will be guided by the two goals of preserving the free status
-of all derivatives of our free software and of promoting the sharing
-and reuse of software generally.
-
- NO WARRANTY
-
- 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
-WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
-EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
-OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
-KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
-LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
-THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
- 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
-WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
-AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
-FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
-CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
-LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
-RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
-FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
-SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Libraries
-
- If you develop a new library, and you want it to be of the greatest
-possible use to the public, we recommend making it free software that
-everyone can redistribute and change. You can do so by permitting
-redistribution under these terms (or, alternatively, under the terms of the
-ordinary General Public License).
-
- To apply these terms, attach the following notices to the library. It is
-safest to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least the
-"copyright" line and a pointer to where the full notice is found.
-
- <one line to give the library's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library 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
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-Also add information on how to contact you by electronic and paper mail.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the library, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the
- library `Frob' (a library for tweaking knobs) written by James Random Hacker.
-
- <signature of Ty Coon>, 1 April 1990
- Ty Coon, President of Vice
-
-That's all there is to it!
-
-
Added: tinytim/trunk/lib/tmapi-2.0RC1-tests.jar
===================================================================
(Binary files differ)
Property changes on: tinytim/trunk/lib/tmapi-2.0RC1-tests.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: tinytim/trunk/lib/tmapi-2.0RC1.jar
===================================================================
(Binary files differ)
Property changes on: tinytim/trunk/lib/tmapi-2.0RC1.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Deleted: tinytim/trunk/lib/tmapi-2.0b1-tests.jar
===================================================================
(Binary files differ)
Deleted: tinytim/trunk/lib/tmapi-2.0b1.jar
===================================================================
(Binary files differ)
Deleted: tinytim/trunk/lib/trove-2.1.0.jar
===================================================================
(Binary files differ)
Modified: tinytim/trunk/src/main/java/org/tinytim/internal/utils/CollectionFactory.java
===================================================================
--- tinytim/trunk/src/main/java/org/tinytim/internal/utils/CollectionFactory.java 2009-10-09 11:54:46 UTC (rev 359)
+++ tinytim/trunk/src/main/java/org/tinytim/internal/utils/CollectionFactory.java 2009-11-04 16:58:30 UTC (rev 360)
@@ -31,22 +31,8 @@
*/
public final class CollectionFactory {
- private static final String _COLL_FACTORY_TROVE = "org.tinytim.internal.utils.TroveCollectionFactory";
+ private static final ICollectionFactory _COLL_FACTORY = new OntopiaCollectionFactory();
- private static final ICollectionFactory _COLL_FACTORY;
-
- static {
- ICollectionFactory collFactory;
- try {
- Class.forName("gnu.trove.THashSet");
- collFactory = (ICollectionFactory) Class.forName(_COLL_FACTORY_TROVE).newInstance();
- }
- catch (Exception ex) {
- collFactory = new JavaCollectionFactory();
- }
- _COLL_FACTORY = collFactory;
- }
-
private CollectionFactory() {
// noop.
}
Added: tinytim/trunk/src/main/java/org/tinytim/internal/utils/CompactHashSet.java
===================================================================
--- tinytim/trunk/src/main/java/org/tinytim/internal/utils/CompactHashSet.java (rev 0)
+++ tinytim/trunk/src/main/java/org/tinytim/internal/utils/CompactHashSet.java 2009-11-04 16:58:30 UTC (rev 360)
@@ -0,0 +1,361 @@
+
+// $Id$
+
+package org.tinytim.internal.utils;
+
+// WARNING: If you do any changes to this class, make sure that you
+// update CompactIdentityHashSet.java, UniqueSet.java and
+// SoftHashMapIndex.java accordingly.
+
+import java.util.Collection;
+import java.util.ConcurrentModificationException;
+import java.util.Iterator;
+import java.util.NoSuchElementException;
+
+/**
+ * INTERNAL: Implements the Set interface more compactly than
+ * java.util.HashSet by using a closed hashtable.
+ */
+class CompactHashSet<E> extends java.util.AbstractSet<E> {
+
+ protected final static int INITIAL_SIZE = 3;
+ protected final static double LOAD_FACTOR = 0.75;
+
+ /**
+ * This object is used to represent null, should clients add that to the set.
+ */
+ protected final static Object nullObject = new Object();
+ /**
+ * When an object is deleted this object is put into the hashtable
+ * in its place, so that other objects with the same key
+ * (collisions) further down the hashtable are not lost after we
+ * delete an object in the collision chain.
+ */
+ protected final static Object deletedObject = new Object();
+ protected int elements;
+ protected int freecells;
+ protected Object[] objects;
+ protected int modCount;
+
+ /**
+ * Constructs a new, empty set.
+ */
+ public CompactHashSet() {
+ objects = new Object[INITIAL_SIZE];
+ elements = 0;
+ freecells = objects.length;
+ modCount = 0;
+ }
+
+ /**
+ * Constructs a new, empty set.
+ */
+ public CompactHashSet(int size) {
+ // NOTE: If array size is 0, we get a
+ // "java.lang.ArithmeticException: / by zero" in add(Object).
+ objects = new Object[(size==0 ? 1 : size)];
+ elements = 0;
+ freecells = objects.length;
+ modCount = 0;
+ }
+
+ /**
+ * Constructs a new set containing the elements in the specified
+ * collection.
+ *
+ * @param c the collection whose elements are to be placed into this set.
+ */
+ public CompactHashSet(Collection c) {
+ this(c.size());
+ addAll(c);
+ }
+
+ // ===== SET IMPLEMENTATION =============================================
+
+ /**
+ * Returns an iterator over the elements in this set. The elements
+ * are returned in no particular order.
+ *
+ * @return an Iterator over the elements in this set.
+ * @see ConcurrentModificationException
+ */
+ public Iterator iterator() {
+ return new CompactHashIterator();
+ }
+
+ /**
+ * Returns the number of elements in this set (its cardinality).
+ */
+ public int size() {
+ return elements;
+ }
+
+ /**
+ * Returns <tt>true</tt> if this set contains no elements.
+ */
+ public boolean isEmpty() {
+ return elements == 0;
+ }
+
+ /**
+ * Returns <tt>true</tt> if this set contains the specified element.
+ *
+ * @param o element whose presence in this set is to be tested.
+ * @return <tt>true</tt> if this set contains the specified element.
+ */
+ public boolean contains(Object o) {
+ if (o == null) o = nullObject;
+
+ int hash = o.hashCode();
+ int index = (hash & 0x7FFFFFFF) % objects.length;
+ int offset = 1;
+
+ // search for the object (continue while !null and !this object)
+ while(objects[index] != null &&
+ !(objects[index].hashCode() == hash &&
+ objects[index].equals(o))) {
+ index = ((index + offset) & 0x7FFFFFFF) % objects.length;
+ offset = offset*2 + 1;
+
+ if (offset == -1)
+ offset = 2;
+ }
+
+ return objects[index] != null;
+ }
+
+ /**
+ * Adds the specified element to this set if it is not already
+ * present.
+ *
+ * @param o element to be added to this set.
+ * @return <tt>true</tt> if the set did not already contain the specified
+ * element.
+ */
+ public boolean add(Object o) {
+ if (o == null) o = nullObject;
+
+ int hash = o.hashCode();
+ int index = (hash & 0x7FFFFFFF) % objects.length;
+ int offset = 1;
+ int deletedix = -1;
+
+ // search for the object (continue while !null and !this object)
+ while(objects[index] != null &&
+ !(objects[index].hashCode() == hash &&
+ objects[index].equals(o))) {
+
+ // if there's a deleted object here we can put this object here,
+ // provided it's not in here somewhere else already
+ if (objects[index] == deletedObject)
+ deletedix = index;
+
+ index = ((index + offset) & 0x7FFFFFFF) % objects.length;
+ offset = offset*2 + 1;
+
+ if (offset == -1)
+ offset = 2;
+ }
+
+ if (objects[index] == null) { // wasn't present already
+ if (deletedix != -1) // reusing a deleted cell
+ index = deletedix;
+ else
+ freecells--;
+
+ modCount++;
+ elements++;
+ objects[index] = o;
+
+ // rehash with same capacity
+ if (1 - (freecells / (double) objects.length) > LOAD_FACTOR) {
+ rehash(objects.length);
+ // rehash with increased capacity
+ if (1 - (freecells / (double) objects.length) > LOAD_FACTOR) {
+ rehash(objects.length*2 + 1);
+ }
+ }
+ return true;
+ } else // was there already
+ return false;
+ }
+
+ /**
+ * Removes the specified element from the set.
+ */
+ public boolean remove(Object o) {
+ if (o == null) o = nullObject;
+
+ int hash = o.hashCode();
+ int index = (hash & 0x7FFFFFFF) % objects.length;
+ int offset = 1;
+
+ // search for the object (continue while !null and !this object)
+ while(objects[index] != null &&
+ !(objects[index].hashCode() == hash &&
+ objects[index].equals(o))) {
+ index = ((index + offset) & 0x7FFFFFFF) % objects.length;
+ offset = offset*2 + 1;
+
+ if (offset == -1)
+ offset = 2;
+ }
+
+ // we found the right position, now do the removal
+ if (objects[index] != null) {
+ // we found the object
+ objects[index] = deletedObject;
+ modCount++;
+ elements--;
+ return true;
+ } else
+ // we did not find the object
+ return false;
+ }
+
+ /**
+ * Removes all of the elements from this set.
+ */
+ public void clear() {
+ elements = 0;
+ for (int ix = 0; ix < objects.length; ix++)
+ objects[ix] = null;
+ freecells = objects.length;
+ modCount++;
+ }
+
+ public Object[] toArray() {
+ Object[] result = new Object[elements];
+ Object[] objects = this.objects;
+ int pos = 0;
+ for (int i = 0; i < objects.length; i++)
+ if (objects[i] != null && objects[i] != deletedObject) {
+ if (objects[i] == nullObject)
+ result[pos++] = null;
+ else
+ result[pos++] = objects[i];
+ }
+ return result;
+ }
+
+ public Object[] toArray(Object a[]) {
+ int size = elements;
+ if (a.length < size)
+ a = (Object[])java.lang.reflect.Array.newInstance(
+ a.getClass().getComponentType(), size);
+ Object[] objects = this.objects;
+ int pos = 0;
+ for (int i = 0; i < objects.length; i++)
+ if (objects[i] != null && objects[i] != deletedObject) {
+ if (objects[i] == nullObject)
+ a[pos++] = null;
+ else
+ a[pos++] = objects[i];
+ }
+ return a;
+ }
+
+ // ===== INTERNAL METHODS ===============================================
+
+ /**
+ * INTERNAL: Used for debugging only.
+ */
+ public void dump() {
+ System.out.println("Size: " + objects.length);
+ System.out.println("Elements: " + elements);
+ System.out.println("Free cells: " + freecells);
+ System.out.println();
+ for (int ix = 0; ix < objects.length; ix++)
+ System.out.println("[" + ix + "]: " + objects[ix]);
+ }
+
+ /**
+ * INTERNAL: Rehashes the hashset to a bigger size.
+ */
+ protected void rehash(int newCapacity) {
+ int oldCapacity = objects.length;
+ Object[] newObjects = new Object[newCapacity];
+
+ for (int ix = 0; ix < oldCapacity; ix++) {
+ Object o = objects[ix];
+ if (o == null || o == deletedObject)
+ continue;
+
+ int hash = o.hashCode();
+ int index = (hash & 0x7FFFFFFF) % newCapacity;
+ int offset = 1;
+
+ // search for the object
+ while(newObjects[index] != null) { // no need to test for duplicates
+ index = ((index + offset) & 0x7FFFFFFF) % newCapacity;
+ offset = offset*2 + 1;
+
+ if (offset == -1)
+ offset = 2;
+ }
+
+ newObjects[index] = o;
+ }
+
+ objects = newObjects;
+ freecells = objects.length - elements;
+ }
+
+ // ===== ITERATOR IMPLEMENTATON =========================================
+
+ private class CompactHashIterator implements Iterator {
+ private int index;
+ private int lastReturned = -1;
+
+ /**
+ * The modCount value that the iterator believes that the backing
+ * CompactHashSet should have. If this expectation is violated,
+ * the iterator has detected concurrent modification.
+ */
+ private int expectedModCount;
+
+ public CompactHashIterator() {
+ for (index = 0; index < objects.length &&
+ (objects[index] == null ||
+ objects[index] == deletedObject); index++)
+ ;
+ expectedModCount = modCount;
+ }
+
+ public boolean hasNext() {
+ return index < objects.length;
+ }
+
+ public Object next() {
+ if (modCount != expectedModCount)
+ throw new ConcurrentModificationException();
+ if (index >= objects.length) {
+ lastReturned = -2;
+ throw new NoSuchElementException();
+ }
+
+ lastReturned = index;
+ for (index += 1; index < objects.length &&
+ (objects[index] == null ||
+ objects[index] == deletedObject); index++)
+ ;
+ if (objects[lastReturned] == nullObject)
+ return null;
+ else
+ return objects[lastReturned];
+ }
+
+ public void remove() {
+ if (modCount != expectedModCount)
+ throw new ConcurrentModificationException();
+ if (lastReturned == -1 || lastReturned == -2)
+ throw new IllegalStateException();
+ // delete object
+ if (objects[lastReturned] != null && objects[lastReturned] != deletedObject) {
+ objects[lastReturned] = deletedObject;
+ elements--;
+ }
+ }
+ }
+
+}
Property changes on: tinytim/trunk/src/main/java/org/tinytim/internal/utils/CompactHashSet.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date Id
Added: svn:eol-style
+ native
Added: tinytim/trunk/src/main/java/org/tinytim/internal/utils/CompactIdentityHashSet.java
===================================================================
--- tinytim/trunk/src/main/java/org/tinytim/internal/utils/CompactIdentityHashSet.java (rev 0)
+++ tinytim/trunk/src/main/java/org/tinytim/internal/utils/CompactIdentityHashSet.java 2009-11-04 16:58:30 UTC (rev 360)
@@ -0,0 +1,172 @@
+
+// $Id$
+
+package org.tinytim.internal.utils;
+
+// WARNING: This class is a direct copy of the CompactHashSet.java
+// class, but with two changes. The while(...) calls has been changes
+// to the new semantics and the use of hashCode() minimized. These
+// changes should be repeated every time the CompactHashSet.java
+// changes.
+
+import java.util.Collection;
+
+/**
+ * INTERNAL: This class is a specialization of the CompactHashSet
+ * class, and uses the == operator to compare objects.
+ */
+class CompactIdentityHashSet<E> extends CompactHashSet<E> {
+
+ public CompactIdentityHashSet() {
+ }
+
+ public CompactIdentityHashSet(int size) {
+ super(size);
+ }
+
+ public CompactIdentityHashSet(Collection coll) {
+ super(coll);
+ }
+
+ // ===== SET IMPLEMENTATION ================================================
+
+ /**
+ * Returns <tt>true</tt> if this set contains the specified element.
+ *
+ * @param o element whose presence in this set is to be tested.
+ * @return <tt>true</tt> if this set contains the specified element.
+ */
+ public boolean contains(Object o) {
+ if (o == null) o = nullObject;
+
+ int index = (System.identityHashCode(o) & 0x7FFFFFFF) % objects.length;
+ int offset = 1;
+
+ // search for the object (continue while !null and !this object)
+ while(objects[index] != null && objects[index] != o) {
+ index = ((index + offset) & 0x7FFFFFFF) % objects.length;
+ offset = offset*2 + 1;
+
+ if (offset == -1)
+ offset = 2;
+ }
+
+ return objects[index] != null;
+ }
+
+ /**
+ * Adds the specified element to this set if it is not already
+ * present.
+ *
+ * @param o element to be added to this set.
+ * @return <tt>true</tt> if the set did not already contain the specified
+ * element.
+ */
+ public boolean add(Object o) {
+ if (o == null) o = nullObject;
+
+ int index = (System.identityHashCode(o) & 0x7FFFFFFF) % objects.length;
+ int offset = 1;
+ int deletedix = -1;
+
+ // search for the object (continue while !null and !this object)
+ while(objects[index] != null && objects[index] != o) {
+
+ // if there's a deleted object here we can put this object here,
+ // provided it's not in here somewhere else already
+ if (objects[index] == deletedObject)
+ deletedix = index;
+
+ index = ((index + offset) & 0x7FFFFFFF) % objects.length;
+ offset = offset*2 + 1;
+
+ if (offset == -1)
+ offset = 2;
+ }
+
+ if (objects[index] == null) { // wasn't present already
+ if (deletedix != -1) // reusing a deleted cell
+ index = deletedix;
+ else
+ freecells--;
+
+ modCount++;
+ elements++;
+ objects[index] = o;
+
+ // rehash with same capacity
+ if (1 - (freecells / (double) objects.length) > LOAD_FACTOR) {
+ rehash(objects.length);
+ // rehash with increased capacity
+ if (1 - (freecells / (double) objects.length) > LOAD_FACTOR) {
+ rehash(objects.length*2 + 1);
+ }
+ }
+ return true;
+ } else // was there already
+ return false;
+ }
+
+ /**
+ * Removes the specified element from the set.
+ */
+ public boolean remove(Object o) {
+ if (o == null) o = nullObject;
+
+ int index = (System.identityHashCode(o) & 0x7FFFFFFF) % objects.length;
+ int offset = 1;
+
+ // search for the object (continue while !null and !this object)
+ while(objects[index] != null && objects[index] != o) {
+ index = ((index + offset) & 0x7FFFFFFF) % objects.length;
+ offset = offset*2 + 1;
+
+ if (offset == -1)
+ offset = 2;
+ }
+
+ // we found the right position, now do the removal
+ if (objects[index] != null) {
+ // we found the object
+ objects[index] = deletedObject;
+ modCount++;
+ elements--;
+ return true;
+ } else
+ // we did not find the object
+ return false;
+ }
+
+ // ===== INTERNAL METHODS ==================================================
+
+ /**
+ * INTERNAL: Rehashes the hashset to a bigger size.
+ */
+ protected void rehash(int newCapacity) {
+ int oldCapacity = objects.length;
+ Object[] newObjects = new Object[newCapacity];
+
+ for (int ix = 0; ix < oldCapacity; ix++) {
+ Object o = objects[ix];
+ if (o == null || o == deletedObject)
+ continue;
+
+ int index = (System.identityHashCode(o) & 0x7FFFFFFF) % newCapacity;
+ int offset = 1;
+
+ // search for the object
+ while(newObjects[index] != null) { // no need to test for duplicates
+ index = ((index + offset) & 0x7FFFFFFF) % newCapacity;
+ offset = offset*2 + 1;
+
+ if (offset == -1)
+ offset = 2;
+ }
+
+ newObjects[index] = o;
+ }
+
+ objects = newObjects;
+ freecells = objects.length - elements;
+ }
+}
Property changes on: tinytim/trunk/src/main/java/org/tinytim/internal/utils/CompactIdentityHashSet.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date Id
Added: svn:eol-style
+ native
Modified: tinytim/trunk/src/main/java/org/tinytim/internal/utils/CopyUtils.java
===================================================================
--- tinytim/trunk/src/main/java/org/tinytim/internal/utils/CopyUtils.java 2009-10-09 11:54:46 UTC (rev 359)
+++ tinytim/trunk/src/main/java/org/tinytim/internal/utils/CopyUtils.java 2009-11-04 16:58:30 UTC (rev 360)
@@ -57,14 +57,14 @@
* @param source The topic map to take the topics and associations from.
* @param target The topic map which should receive the topics and associations.
*/
- public static void copy(TopicMap source, TopicMap target) {
+ public static void copy(final TopicMap source, final TopicMap target) {
_copy(source, (ITopicMap) target);
}
/**
* @see #copy(TopicMap, TopicMap)
*/
- private static void _copy(TopicMap source, ITopicMap target) {
+ private static void _copy(final TopicMap source, final ITopicMap target) {
if (source == null || target == null) {
throw new IllegalArgumentException("Neither the source topic map nor the target topic map must be null");
}
@@ -127,8 +127,8 @@
* @param mergeMap The map which holds the merge mappings.
* @return The newly created topic in the target topic map.
*/
- private static ITopic _copyTopic(Topic topic, ITopicMap target,
- Map<Topic, Topic> mergeMap) {
+ private static ITopic _copyTopic(final Topic topic, final ITopicMap target,
+ final Map<Topic, Topic> mergeMap) {
ITopic targetTopic = target.createEmptyTopic();
_copyIdentities(topic, targetTopic);
_copyTypes(topic, targetTopic, mergeMap);
@@ -143,7 +143,7 @@
* @param topic The topic to take the identities from.
* @param targetTopic The topic which gets the identities.
*/
- private static void _copyIdentities(Topic topic, Topic targetTopic) {
+ private static void _copyIdentities(final Topic topic, final Topic targetTopic) {
for(Locator sid: topic.getSubjectIdentifiers()) {
targetTopic.addSubjectIdentifier(sid);
}
@@ -160,8 +160,8 @@
* @param targetTopic The topic which receives the types.
* @param mergeMap The map which holds the merge mappings.
*/
- private static void _copyTypes(Topic topic, Topic targetTopic,
- Map<Topic, Topic> mergeMap) {
+ private static void _copyTypes(final Topic topic, final Topic targetTopic,
+ final Map<Topic, Topic> mergeMap) {
for (Topic type: topic.getTypes()) {
Topic targetType = mergeMap.get(type);
if (targetType == null) {
@@ -179,8 +179,9 @@
* @param targetTopic The target topic which gets the charateristics.
* @param mergeMap The map which holds the merge mappings.
*/
- private static void _copyCharacteristics(Topic topic, ITopic targetTopic,
- Map<Topic, Topic> mergeMap) {
+ private static void _copyCharacteristics(final Topic topic,
+ final ITopic targetTopic,
+ final Map<Topic, Topic> mergeMap) {
IIntObjectMap<Reifiable> sigs = CollectionFactory.createIntObjectMap();
for (Occurrence occ: targetTopic.getOccurrences()) {
sigs.put(SignatureGenerator.generateSignature(occ), occ);
@@ -229,9 +230,9 @@
* @param target The target name which receives the variants.
* @param mergeMap The map which holds the merge mappings.
*/
- private static void _copyVariants(Name source, IName target,
- Map<Topic, Topic> mergeMap) {
- IIntObjectMap<Variant> sigs = CollectionFactory.createIntObjectMap();
+ private static void _copyVariants(final Name source, final IName target,
+ final Map<Topic, Topic> mergeMap) {
+ final IIntObjectMap<Variant> sigs = CollectionFactory.createIntObjectMap();
for (Variant variant: target.getVariants()) {
sigs.put(SignatureGenerator.generateSignature(variant), variant);
}
@@ -258,13 +259,14 @@
* @param target The target Topic Maps construct.
* @param mergeMap The map which holds the merge mappings.
*/
- private static void _copyReifier(Reifiable source, Reifiable target,
- Map<Topic, Topic> mergeMap) {
- Topic sourceReifier = source.getReifier();
+ private static void _copyReifier(final Reifiable source,
+ final Reifiable target,
+ final Map<Topic, Topic> mergeMap) {
+ final Topic sourceReifier = source.getReifier();
if (sourceReifier == null) {
return;
}
- Topic reifier = mergeMap.containsKey(sourceReifier) ? mergeMap.get(sourceReifier)
+ final Topic reifier = mergeMap.containsKey(sourceReifier) ? mergeMap.get(sourceReifier)
: _copyTopic(sourceReifier, (ITopicMap) target.getTopicMap(), mergeMap);
target.setReifier(reifier);
}
@@ -276,10 +278,10 @@
* @param target The Topic Maps construct which receives the type.
* @param mergeMap The map which holds the merge mappings.
*/
- private static ITopic _copyType(Typed source, TopicMap tm,
- Map<Topic, Topic> mergeMap) {
- Topic sourceType = source.getType();
- return mergeMap.containsKey(sourceType) ? (ITopic) mergeMap.get(sourceType)
+ private static ITopic _copyType(final Typed source, final TopicMap tm,
+ final Map<Topic, Topic> mergeMap) {
+ final Topic sourceType = source.getType();
+ return mergeMap.containsKey(sourceType) ? (ITopic) mergeMap.get(sourceType)
: _copyTopic(sourceType, (ITopicMap) tm, mergeMap);
}
@@ -291,9 +293,9 @@
* @param target The target which receives the scope.
* @param mergeMap The map which holds the merge mappings.
*/
- private static IScope _copyScope(Scoped source, ITopicMap tm,
- Map<Topic, Topic> mergeMap) {
- Set<Topic> themes = CollectionFactory.createIdentitySet(source.getScope().size());
+ private static IScope _copyScope(final Scoped source, final ITopicMap tm,
+ final Map<Topic, Topic> mergeMap) {
+ final Set<Topic> themes = CollectionFactory.createIdentitySet(source.getScope().size());
Topic theme = null;
for (Topic sourceTheme: source.getScope()) {
theme = mergeMap.containsKey(sourceTheme) ? mergeMap.get(sourceTheme)
@@ -309,7 +311,8 @@
* @param source The source Topic Maps construct.
* @param target The target Topic Maps construct.
*/
- private static void _copyItemIdentifiers(Construct source, Construct target) {
+ private static void _copyItemIdentifiers(final Construct source,
+ final Construct target) {
for(Locator iid: source.getItemIdentifiers()) {
target.addItemIdentifier(iid);
}
@@ -323,10 +326,10 @@
* @param target The topic map which receives the associations.
* @param mergeMap The map which holds the merge mappings.
*/
- private static void _copyAssociations(TopicMap source,
- ITopicMap target, Map<Topic, Topic> mergeMap) {
- Set<Association> assocs = target.getAssociations();
- IIntObjectMap<Association> sigs = CollectionFactory.createIntObjectMap(assocs.size());
+ private static void _copyAssociations(final TopicMap source,
+ final ITopicMap target, final Map<Topic, Topic> mergeMap) {
+ final Set<Association> assocs = target.getAssociations();
+ final IIntObjectMap<Association> sigs = CollectionFactory.createIntObjectMap(assocs.size());
for (Association assoc: assocs) {
sigs.put(SignatureGenerator.generateSignature(assoc), assoc);
}
@@ -364,8 +367,9 @@
* @param target The target topic.
* @param mergeMap The map which holds the merge mappings.
*/
- private static void _addMerge(Topic source, Topic target, Map<Topic, Topic> mergeMap) {
- Topic prevTarget = mergeMap.get(source);
+ private static void _addMerge(final Topic source, final Topic target,
+ final Map<Topic, Topic> mergeMap) {
+ final Topic prevTarget = mergeMap.get(source);
if (prevTarget != null) {
if (!prevTarget.equals(target)) {
MergeUtils.merge(target, prevTarget);
Deleted: tinytim/trunk/src/main/java/org/tinytim/internal/utils/JavaCollectionFactory.java
===================================================================
--- tinytim/trunk/src/main/java/org/tinytim/internal/utils/JavaCollectionFactory.java 2009-10-09 11:54:46 UTC (rev 359)
+++ tinytim/trunk/src/main/java/org/tinytim/internal/utils/JavaCollectionFactory.java 2009-11-04 16:58:30 UTC (rev 360)
@@ -1,216 +0,0 @@
-/*
- * Copyright 2008 Lars Heuer (heuer[at]semagia.com)
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distrib...
[truncated message content] |
|
From: <lh...@us...> - 2009-10-09 11:54:55
|
Revision: 359
http://tinytim.svn.sourceforge.net/tinytim/?rev=359&view=rev
Author: lheuer
Date: 2009-10-09 11:54:46 +0000 (Fri, 09 Oct 2009)
Log Message:
-----------
Update to TMAPI 2.0b1 (unofficial build), update to trove 2.1.0
Modified Paths:
--------------
tinytim/trunk/build.xml
tinytim/trunk/src/main/java/org/tinytim/core/TopicMapSystemFactoryImpl.java
tinytim/trunk/src/main/java/org/tinytim/utils/Feature.java
Added Paths:
-----------
tinytim/trunk/lib/tmapi-2.0b1-tests.jar
tinytim/trunk/lib/tmapi-2.0b1.jar
tinytim/trunk/lib/trove-2.1.0.jar
Removed Paths:
-------------
tinytim/trunk/lib/tmapi-2.0a2-tests.jar
tinytim/trunk/lib/tmapi-2.0a2.jar
tinytim/trunk/lib/trove-2.0.4.jar
Modified: tinytim/trunk/build.xml
===================================================================
--- tinytim/trunk/build.xml 2009-09-28 14:15:42 UTC (rev 358)
+++ tinytim/trunk/build.xml 2009-10-09 11:54:46 UTC (rev 359)
@@ -11,10 +11,10 @@
<property name="dir.coverage" value="${basedir}/coverage"/>
<property name="lib.junit" value="${dir.lib}/junit-4.5.jar"/>
- <property name="lib.trove" value="${dir.lib}/trove-2.0.4.jar"/>
+ <property name="lib.trove" value="${dir.lib}/trove-2.1.0.jar"/>
<property name="lib.mio" value="${dir.lib}/semagia-mio-0.9.5.jar"/>
- <property name="lib.tmapi" value="${dir.lib}/tmapi-2.0a2.jar"/>
- <property name="lib.tmapi.tests" value="${dir.lib}/tmapi-2.0a2-tests.jar"/>
+ <property name="lib.tmapi" value="${dir.lib}/tmapi-2.0b1.jar"/>
+ <property name="lib.tmapi.tests" value="${dir.lib}/tmapi-2.0b1-tests.jar"/>
<property name="lib.emma" value="${dir.lib}/emma.jar"/>
<property name="lib.emma.task" value="${dir.lib}/emma_ant.jar"/>
Deleted: tinytim/trunk/lib/tmapi-2.0a2-tests.jar
===================================================================
(Binary files differ)
Deleted: tinytim/trunk/lib/tmapi-2.0a2.jar
===================================================================
(Binary files differ)
Added: tinytim/trunk/lib/tmapi-2.0b1-tests.jar
===================================================================
(Binary files differ)
Property changes on: tinytim/trunk/lib/tmapi-2.0b1-tests.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: tinytim/trunk/lib/tmapi-2.0b1.jar
===================================================================
(Binary files differ)
Property changes on: tinytim/trunk/lib/tmapi-2.0b1.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Deleted: tinytim/trunk/lib/trove-2.0.4.jar
===================================================================
(Binary files differ)
Added: tinytim/trunk/lib/trove-2.1.0.jar
===================================================================
(Binary files differ)
Property changes on: tinytim/trunk/lib/trove-2.1.0.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified: tinytim/trunk/src/main/java/org/tinytim/core/TopicMapSystemFactoryImpl.java
===================================================================
--- tinytim/trunk/src/main/java/org/tinytim/core/TopicMapSystemFactoryImpl.java 2009-09-28 14:15:42 UTC (rev 358)
+++ tinytim/trunk/src/main/java/org/tinytim/core/TopicMapSystemFactoryImpl.java 2009-10-09 11:54:46 UTC (rev 359)
@@ -41,7 +41,8 @@
private static final FeatureInfo[] _FEATURES = new FeatureInfo[] {
// Feature IRI, default value, fixed?
new FeatureInfo(Feature.AUTOMERGE, false, true),
- new FeatureInfo(Feature.READ_ONLY, false, true)
+ new FeatureInfo(Feature.READ_ONLY, false, true),
+ new FeatureInfo(Feature.TYPE_INSTANCE_ASSOCS, false, true)
};
private static final TMSystemInfo[] _SYSTEMS = new TMSystemInfo[] {
Modified: tinytim/trunk/src/main/java/org/tinytim/utils/Feature.java
===================================================================
--- tinytim/trunk/src/main/java/org/tinytim/utils/Feature.java 2009-09-28 14:15:42 UTC (rev 358)
+++ tinytim/trunk/src/main/java/org/tinytim/utils/Feature.java 2009-10-09 11:54:46 UTC (rev 359)
@@ -34,6 +34,12 @@
private static final String _FEATURE_BASE = "http://tmapi.org/features/";
/**
+ * An implementation which supports this feature uses associations
+ * to model tmdm:type-instance relationships.
+ */
+ public static final String TYPE_INSTANCE_ASSOCS= _FEATURE_BASE + "type-instance-associations";
+
+ /**
* An implementation which supports this feature can process locator
* addresses in URI notation as defined by RFC 2396.
*
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <bo...@us...> - 2009-09-28 14:15:52
|
Revision: 358
http://tinytim.svn.sourceforge.net/tinytim/?rev=358&view=rev
Author: bosso
Date: 2009-09-28 14:15:42 +0000 (Mon, 28 Sep 2009)
Log Message:
-----------
fixed template name (may-reify)
Modified Paths:
--------------
tinytim-mio/trunk/src/main/java/org/tinytim/mio/internal/ctm/impl/DefaultTMCLPreprocessor.java
Modified: tinytim-mio/trunk/src/main/java/org/tinytim/mio/internal/ctm/impl/DefaultTMCLPreprocessor.java
===================================================================
--- tinytim-mio/trunk/src/main/java/org/tinytim/mio/internal/ctm/impl/DefaultTMCLPreprocessor.java 2009-08-27 15:47:32 UTC (rev 357)
+++ tinytim-mio/trunk/src/main/java/org/tinytim/mio/internal/ctm/impl/DefaultTMCLPreprocessor.java 2009-09-28 14:15:42 UTC (rev 358)
@@ -408,7 +408,7 @@
}
}
else {
- tpl = new DefaultTemplate("may");
+ tpl = new DefaultTemplate("may-reify");
tpl.addParameter(reifiableType);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <lh...@us...> - 2009-08-27 15:47:41
|
Revision: 357
http://tinytim.svn.sourceforge.net/tinytim/?rev=357&view=rev
Author: lheuer
Date: 2009-08-27 15:47:32 +0000 (Thu, 27 Aug 2009)
Log Message:
-----------
tinyTiM / mio update
Modified Paths:
--------------
tinytim-mio/trunk/build.xml
Added Paths:
-----------
tinytim-mio/trunk/lib/semagia-mio-0.9.5.jar
tinytim-mio/trunk/lib/tinytim-2.0.0a6-snapshot-200908271522.jar
Removed Paths:
-------------
tinytim-mio/trunk/lib/semagia-mio-0.9.4.jar
tinytim-mio/trunk/lib/tinytim-2.0.0a6-snapshot-200908171257.jar
Modified: tinytim-mio/trunk/build.xml
===================================================================
--- tinytim-mio/trunk/build.xml 2009-08-27 13:08:17 UTC (rev 356)
+++ tinytim-mio/trunk/build.xml 2009-08-27 15:47:32 UTC (rev 357)
@@ -17,7 +17,7 @@
<!-- Libs -->
<property name="lib.jing" value="${dir.lib}/jing.jar"/>
<property name="lib.junit" value="${dir.lib}/junit-4.5.jar"/>
- <property name="lib.mio" value="${dir.lib}/semagia-mio-0.9.4.jar"/>
+ <property name="lib.mio" value="${dir.lib}/semagia-mio-0.9.5.jar"/>
<property name="lib.jtm" value="${dir.lib}/semagia-mio-jtm-0.9.3.jar"/>
<property name="lib.ltm" value="${dir.lib}/semagia-mio-ltm-0.9.5.jar"/>
<property name="lib.rdf" value="${dir.lib}/semagia-mio-rdf-0.9.3.jar"/>
Deleted: tinytim-mio/trunk/lib/semagia-mio-0.9.4.jar
===================================================================
(Binary files differ)
Added: tinytim-mio/trunk/lib/semagia-mio-0.9.5.jar
===================================================================
(Binary files differ)
Property changes on: tinytim-mio/trunk/lib/semagia-mio-0.9.5.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Deleted: tinytim-mio/trunk/lib/tinytim-2.0.0a6-snapshot-200908171257.jar
===================================================================
(Binary files differ)
Added: tinytim-mio/trunk/lib/tinytim-2.0.0a6-snapshot-200908271522.jar
===================================================================
(Binary files differ)
Property changes on: tinytim-mio/trunk/lib/tinytim-2.0.0a6-snapshot-200908271522.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <lh...@us...> - 2009-08-27 13:08:42
|
Revision: 356
http://tinytim.svn.sourceforge.net/tinytim/?rev=356&view=rev
Author: lheuer
Date: 2009-08-27 13:08:17 +0000 (Thu, 27 Aug 2009)
Log Message:
-----------
- New TinyTimMapInputHandler based upon the mio.HamsterHandler
- Removed ConstructFactory
- Added @Override annotation (requires Java 6)
Modified Paths:
--------------
tinytim/trunk/build.xml
tinytim/trunk/src/main/java/org/tinytim/core/AssociationImpl.java
tinytim/trunk/src/main/java/org/tinytim/core/ConstructImpl.java
tinytim/trunk/src/main/java/org/tinytim/core/DatatypeAwareConstruct.java
tinytim/trunk/src/main/java/org/tinytim/core/IdGenerator.java
tinytim/trunk/src/main/java/org/tinytim/core/MemoryTopicMap.java
tinytim/trunk/src/main/java/org/tinytim/core/MemoryTopicMapSystem.java
tinytim/trunk/src/main/java/org/tinytim/core/NameImpl.java
tinytim/trunk/src/main/java/org/tinytim/core/OccurrenceImpl.java
tinytim/trunk/src/main/java/org/tinytim/core/RoleImpl.java
tinytim/trunk/src/main/java/org/tinytim/core/Scope.java
tinytim/trunk/src/main/java/org/tinytim/core/ScopedImpl.java
tinytim/trunk/src/main/java/org/tinytim/core/TopicImpl.java
tinytim/trunk/src/main/java/org/tinytim/core/TypedImpl.java
tinytim/trunk/src/main/java/org/tinytim/core/VariantImpl.java
tinytim/trunk/src/main/java/org/tinytim/internal/api/IAssociation.java
tinytim/trunk/src/main/java/org/tinytim/internal/api/IName.java
tinytim/trunk/src/main/java/org/tinytim/internal/api/ITopic.java
tinytim/trunk/src/main/java/org/tinytim/internal/api/ITopicMap.java
tinytim/trunk/src/main/java/org/tinytim/internal/api/IVariant.java
tinytim/trunk/src/main/java/org/tinytim/internal/utils/Check.java
tinytim/trunk/src/main/java/org/tinytim/internal/utils/CopyUtils.java
tinytim/trunk/src/main/java/org/tinytim/internal/utils/MergeUtils.java
tinytim/trunk/src/main/java/org/tinytim/mio/TinyTimMapInputHandler.java
tinytim/trunk/src/test/java/org/tinytim/core/AllTests.java
Added Paths:
-----------
tinytim/trunk/lib/semagia-mio-0.9.5.jar
tinytim/trunk/src/main/java/org/tinytim/internal/api/IRole.java
Removed Paths:
-------------
tinytim/trunk/lib/semagia-mio-0.9.4.jar
tinytim/trunk/src/main/java/org/tinytim/core/MemoryConstructFactory.java
tinytim/trunk/src/main/java/org/tinytim/internal/api/IConstructFactory.java
tinytim/trunk/src/test/java/org/tinytim/core/TestIConstructFactory.java
tinytim/trunk/src/test/java/org/tinytim/mio/TestTinyTimMapInputHandler.java
Modified: tinytim/trunk/build.xml
===================================================================
--- tinytim/trunk/build.xml 2009-08-18 12:54:43 UTC (rev 355)
+++ tinytim/trunk/build.xml 2009-08-27 13:08:17 UTC (rev 356)
@@ -12,7 +12,7 @@
<property name="lib.junit" value="${dir.lib}/junit-4.5.jar"/>
<property name="lib.trove" value="${dir.lib}/trove-2.0.4.jar"/>
- <property name="lib.mio" value="${dir.lib}/semagia-mio-0.9.4.jar"/>
+ <property name="lib.mio" value="${dir.lib}/semagia-mio-0.9.5.jar"/>
<property name="lib.tmapi" value="${dir.lib}/tmapi-2.0a2.jar"/>
<property name="lib.tmapi.tests" value="${dir.lib}/tmapi-2.0a2-tests.jar"/>
<property name="lib.emma" value="${dir.lib}/emma.jar"/>
Deleted: tinytim/trunk/lib/semagia-mio-0.9.4.jar
===================================================================
(Binary files differ)
Added: tinytim/trunk/lib/semagia-mio-0.9.5.jar
===================================================================
(Binary files differ)
Property changes on: tinytim/trunk/lib/semagia-mio-0.9.5.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified: tinytim/trunk/src/main/java/org/tinytim/core/AssociationImpl.java
===================================================================
--- tinytim/trunk/src/main/java/org/tinytim/core/AssociationImpl.java 2009-08-18 12:54:43 UTC (rev 355)
+++ tinytim/trunk/src/main/java/org/tinytim/core/AssociationImpl.java 2009-08-27 13:08:17 UTC (rev 356)
@@ -40,11 +40,6 @@
private Set<Role> _roles;
- AssociationImpl(ITopicMap tm) {
- super(tm);
- _roles = CollectionFactory.createIdentitySet(IConstant.ASSOC_ROLE_SIZE);
- }
-
AssociationImpl(ITopicMap topicMap, Topic type, IScope scope) {
super(topicMap, type, scope);
_roles = CollectionFactory.createIdentitySet(IConstant.ASSOC_ROLE_SIZE);
@@ -58,6 +53,16 @@
return _tm;
}
+ void attachRole(RoleImpl role) {
+ role._parent = this;
+ _roles.add(role);
+ }
+
+ void detachRole(RoleImpl role) {
+ role._parent = null;
+ _roles.remove(role);
+ }
+
/**
* Adds a role to this association.
*
Modified: tinytim/trunk/src/main/java/org/tinytim/core/ConstructImpl.java
===================================================================
--- tinytim/trunk/src/main/java/org/tinytim/core/ConstructImpl.java 2009-08-18 12:54:43 UTC (rev 355)
+++ tinytim/trunk/src/main/java/org/tinytim/core/ConstructImpl.java 2009-08-27 13:08:17 UTC (rev 356)
@@ -208,4 +208,5 @@
sb.append("]");
return sb.toString();
}
+
}
Modified: tinytim/trunk/src/main/java/org/tinytim/core/DatatypeAwareConstruct.java
===================================================================
--- tinytim/trunk/src/main/java/org/tinytim/core/DatatypeAwareConstruct.java 2009-08-18 12:54:43 UTC (rev 355)
+++ tinytim/trunk/src/main/java/org/tinytim/core/DatatypeAwareConstruct.java 2009-08-27 13:08:17 UTC (rev 356)
@@ -42,10 +42,6 @@
private ILiteral _literal;
- protected DatatypeAwareConstruct(ITopicMap tm) {
- super(tm);
- }
-
protected DatatypeAwareConstruct(ITopicMap topicMap, Topic type, ILiteral literal, IScope scope) {
super(topicMap, type, scope);
_literal = literal;
Modified: tinytim/trunk/src/main/java/org/tinytim/core/IdGenerator.java
===================================================================
--- tinytim/trunk/src/main/java/org/tinytim/core/IdGenerator.java 2009-08-18 12:54:43 UTC (rev 355)
+++ tinytim/trunk/src/main/java/org/tinytim/core/IdGenerator.java 2009-08-27 13:08:17 UTC (rev 356)
@@ -38,4 +38,5 @@
public static long nextId() {
return _COUNTER.getAndIncrement();
}
+
}
Deleted: tinytim/trunk/src/main/java/org/tinytim/core/MemoryConstructFactory.java
===================================================================
--- tinytim/trunk/src/main/java/org/tinytim/core/MemoryConstructFactory.java 2009-08-18 12:54:43 UTC (rev 355)
+++ tinytim/trunk/src/main/java/org/tinytim/core/MemoryConstructFactory.java 2009-08-27 13:08:17 UTC (rev 356)
@@ -1,99 +0,0 @@
-/*
- * Copyright 2008 Lars Heuer (heuer[at]semagia.com)
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.tinytim.core;
-
-import org.tinytim.internal.api.IConstructFactory;
-import org.tinytim.internal.api.IName;
-import org.tinytim.internal.api.IOccurrence;
-import org.tinytim.internal.api.ITopic;
-import org.tinytim.internal.api.IVariant;
-
-import org.tmapi.core.Association;
-import org.tmapi.core.Role;
-import org.tmapi.core.Topic;
-
-/**
- *
- *
- * @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a>
- * @version $Rev$ - $Date$
- */
-final class MemoryConstructFactory implements IConstructFactory {
-
- private final MemoryTopicMap _tm;
-
- public MemoryConstructFactory(MemoryTopicMap tm) {
- _tm = tm;
- }
-
- /* (non-Javadoc)
- * @see org.tinytim.internal.api.IConstructFactory#createTopic()
- */
- public ITopic createTopic() {
- TopicImpl topic = new TopicImpl(_tm);
- _tm.addTopic(topic);
- return topic;
- }
-
- /* (non-Javadoc)
- * @see org.tinytim.internal.api.IConstructFactory#createAssociation()
- */
- public Association createAssociation() {
- AssociationImpl assoc = new AssociationImpl(_tm);
- _tm.addAssociation(assoc);
- return assoc;
- }
-
- /* (non-Javadoc)
- * @see org.tinytim.internal.api.IConstructFactory#createName(org.tinytim.internal.api.ITopic)
- */
- public IName createName(ITopic parent) {
- NameImpl name = new NameImpl(_tm);
- ((TopicImpl) parent).addName(name);
- return name;
- }
-
- /* (non-Javadoc)
- * @see org.tinytim.internal.api.IConstructFactory#createOccurrence(org.tinytim.internal.api.ITopic)
- */
- public IOccurrence createOccurrence(ITopic parent) {
- OccurrenceImpl occ = new OccurrenceImpl(_tm);
- ((TopicImpl) parent).addOccurrence(occ);
- return occ;
- }
-
- /* (non-Javadoc)
- * @see org.tinytim.internal.api.IConstructFactory#createRole(org.tmapi.core.Association)
- */
- public Role createRole(Association parent) {
- RoleImpl role = new RoleImpl(_tm);
- ((AssociationImpl) parent).addRole(role);
- return role;
- }
-
- /* (non-Javadoc)
- * @see org.tinytim.internal.api.IConstructFactory#createVariant(org.tinytim.internal.api.IName)
- */
- public IVariant createVariant(IName parent) {
- VariantImpl variant = new VariantImpl(_tm);
- for (Topic theme: parent.getScope()) {
- variant._addNameTheme(theme);
- }
- ((NameImpl) parent).addVariant(variant);
- return variant;
- }
-
-}
Modified: tinytim/trunk/src/main/java/org/tinytim/core/MemoryTopicMap.java
===================================================================
--- tinytim/trunk/src/main/java/org/tinytim/core/MemoryTopicMap.java 2009-08-18 12:54:43 UTC (rev 355)
+++ tinytim/trunk/src/main/java/org/tinytim/core/MemoryTopicMap.java 2009-08-27 13:08:17 UTC (rev 356)
@@ -24,11 +24,13 @@
import org.tinytim.core.value.Literal;
import org.tinytim.index.IndexManager;
import org.tinytim.internal.api.Event;
+import org.tinytim.internal.api.IAssociation;
import org.tinytim.internal.api.IConstant;
import org.tinytim.internal.api.IConstruct;
-import org.tinytim.internal.api.IConstructFactory;
import org.tinytim.internal.api.IEventHandler;
import org.tinytim.internal.api.IIndexManager;
+import org.tinytim.internal.api.IScope;
+import org.tinytim.internal.api.ITopic;
import org.tinytim.internal.api.ITopicMap;
import org.tinytim.internal.utils.Check;
import org.tinytim.internal.utils.CollectionFactory;
@@ -54,7 +56,6 @@
*/
final class MemoryTopicMap extends AbstractTopicMap implements ITopicMap {
- private final IConstructFactory _factory;
private final IdentityManager _identityManager;
private final IIndexManager _indexManager;
private final Locator _locator;
@@ -68,7 +69,6 @@
MemoryTopicMap(AbstractTopicMapSystem sys, Locator locator) {
super();
super._tm = this;
- _factory = new MemoryConstructFactory(this);
_sys = sys;
_locator = locator;
_topics = CollectionFactory.createIdentitySet(IConstant.TM_TOPIC_SIZE);
@@ -92,16 +92,17 @@
return this;
}
- /* (non-Javadoc)
- * @see org.tinytim.api.internal.ITopicMap#getConstructFactory()
- */
- public IConstructFactory getConstructFactory() {
- return _factory;
+ @Override
+ public ITopic createEmptyTopic() {
+ TopicImpl topic = new TopicImpl(this);
+ addTopic(topic);
+ return topic;
}
/* (non-Javadoc)
* @see org.tmapi.core.TopicMap#createLocator(java.lang.String)
*/
+ @Override
public Locator createLocator(String reference) {
return Literal.createIRI(reference);
}
@@ -109,6 +110,7 @@
/* (non-Javadoc)
* @see org.tmapi.core.TopicMap#getTopics()
*/
+ @Override
public Set<Topic> getTopics() {
return Collections.unmodifiableSet(_topics);
}
@@ -116,8 +118,9 @@
/* (non-Javadoc)
* @see org.tmapi.core.TopicMap#createTopic()
*/
+ @Override
public Topic createTopic() {
- Topic topic = _factory.createTopic();
+ Topic topic = createEmptyTopic();
topic.addItemIdentifier(Literal.createIRI("urn:x-tinytim:" + IdGenerator.nextId()));
return topic;
}
@@ -125,6 +128,7 @@
/* (non-Javadoc)
* @see org.tmapi.core.TopicMap#createTopicByItemIdentifier(org.tmapi.core.Locator)
*/
+ @Override
public Topic createTopicByItemIdentifier(Locator iid) {
Check.itemIdentifierNotNull(this, iid);
Construct construct = getConstructByItemIdentifier(iid);
@@ -141,7 +145,7 @@
return topic;
}
}
- Topic topic = _factory.createTopic();
+ Topic topic = createEmptyTopic();
topic.addItemIdentifier(iid);
return topic;
}
@@ -149,6 +153,7 @@
/* (non-Javadoc)
* @see org.tmapi.core.TopicMap#createTopicBySubjectIdentifier(org.tmapi.core.Locator)
*/
+ @Override
public Topic createTopicBySubjectIdentifier(Locator sid) {
Check.subjectIdentifierNotNull(this, sid);
Topic topic = getTopicBySubjectIdentifier(sid);
@@ -163,7 +168,7 @@
return topic;
}
}
- topic = _factory.createTopic();
+ topic = createEmptyTopic();
topic.addSubjectIdentifier(sid);
return topic;
}
@@ -171,13 +176,14 @@
/* (non-Javadoc)
* @see org.tmapi.core.TopicMap#createTopicBySubjectLocator(org.tmapi.core.Locator)
*/
+ @Override
public Topic createTopicBySubjectLocator(Locator slo) {
Check.subjectLocatorNotNull(this, slo);
Topic topic = getTopicBySubjectLocator(slo);
if (topic != null) {
return topic;
}
- topic = _factory.createTopic();
+ topic = createEmptyTopic();
topic.addSubjectLocator(slo);
return topic;
}
@@ -210,21 +216,34 @@
/* (non-Javadoc)
* @see org.tmapi.core.TopicMap#getAssociations()
*/
+ @Override
public Set<Association> getAssociations() {
return Collections.unmodifiableSet(_assocs);
}
+ @Override
public Association createAssociation(Topic type, Topic... scope) {
Check.scopeNotNull(this, scope);
return createAssociation(type, Arrays.asList(scope));
}
- public Association createAssociation(Topic type, Collection<Topic> scope) {
+ /* (non-Javadoc)
+ * @see org.tmapi.core.TopicMap#createAssociation(org.tmapi.core.Topic, java.util.Collection)
+ */
+ @Override
+ public IAssociation createAssociation(Topic type, Collection<Topic> scope) {
+ return createAssociation(type, createScope(scope));
+ }
+
+
+ /* (non-Javadoc)
+ * @see org.tinytim.internal.api.ITopicMap#createAssociation(org.tinytim.internal.api.ITopic, org.tinytim.internal.api.IScope)
+ */
+ @Override
+ public IAssociation createAssociation(Topic type, IScope scope) {
Check.typeNotNull(this, type);
- Check.scopeNotNull(this, scope);
Check.sameTopicMap(this, type);
- Check.sameTopicMap(this, scope);
- AssociationImpl assoc = new AssociationImpl(this, type, Scope.create(scope));
+ AssociationImpl assoc = new AssociationImpl(this, type, scope);
addAssociation(assoc);
return assoc;
}
@@ -258,6 +277,7 @@
/* (non-Javadoc)
* @see org.tmapi.core.TopicMap#getConstructById(java.lang.String)
*/
+ @Override
public Construct getConstructById(String id) {
return _identityManager.getConstructById(id);
}
@@ -265,6 +285,7 @@
/* (non-Javadoc)
* @see org.tmapi.core.TopicMap#getTopicBySubjectIdentifier(org.tmapi.core.Locator)
*/
+ @Override
public Topic getTopicBySubjectIdentifier(Locator sid) {
Check.subjectIdentifierNotNull(sid);
return _identityManager.getTopicBySubjectIdentifier(sid);
@@ -273,6 +294,7 @@
/* (non-Javadoc)
* @see org.tmapi.core.TopicMap#getTopicBySubjectLocator(org.tmapi.core.Locator)
*/
+ @Override
public Topic getTopicBySubjectLocator(Locator slo) {
Check.subjectLocatorNotNull(slo);
return _identityManager.getTopicBySubjectLocator(slo);
@@ -281,6 +303,7 @@
/* (non-Javadoc)
* @see org.tmapi.core.TopicMap#getConstructByItemIdentifier(org.tmapi.core.Locator)
*/
+ @Override
public Construct getConstructByItemIdentifier(Locator iid) {
Check.itemIdentifierNotNull(iid);
return _identityManager.getConstructByItemIdentifier(iid);
@@ -289,6 +312,7 @@
/* (non-Javadoc)
* @see org.tmapi.core.TopicMap#getReifier()
*/
+ @Override
public Topic getReifier() {
return _reifier;
}
@@ -296,6 +320,7 @@
/* (non-Javadoc)
* @see org.tmapi.core.Reifiable#setReifier(org.tmapi.core.Topic)
*/
+ @Override
public void setReifier(Topic reifier) {
Check.sameTopicMap(this, reifier);
if (_reifier == reifier) {
@@ -328,9 +353,17 @@
throw new UnsupportedOperationException("Index '" + indexInterface.getName() + "' is unknown");
}
+ @Override
+ public IScope createScope(Collection<Topic> themes) {
+ Check.scopeNotNull(this, themes);
+ Check.sameTopicMap(this, themes);
+ return Scope.create(themes);
+ }
+
/* (non-Javadoc)
* @see org.tmapi.core.TopicMap#mergeIn(org.tmapi.core.TopicMap)
*/
+ @Override
public void mergeIn(TopicMap other) {
MergeUtils.merge(other, this);
}
@@ -338,6 +371,7 @@
/* (non-Javadoc)
* @see org.tmapi.core.TopicMap#close()
*/
+ @Override
public void close() {
remove();
}
@@ -353,6 +387,7 @@
/* (non-Javadoc)
* @see org.tmapi.core.TopicMap#remove()
*/
+ @Override
public void remove() {
_sys.removeTopicMap(this);
_sys = null;
@@ -375,6 +410,7 @@
/* (non-Javadoc)
* @see org.tinytim.internal.api.IEventHandler#handleEvent(org.tinytim.internal.api.Event, org.tinytim.internal.api.IConstruct, java.lang.Object, java.lang.Object)
*/
+ @Override
public void handleEvent(Event evt, IConstruct sender, Object oldValue, Object newValue) {
if (!_evtHandlers.containsKey(evt)) {
_eventMultiplier.handleEvent(evt, sender, oldValue, newValue);
@@ -390,6 +426,7 @@
/* (non-Javadoc)
* @see org.tinytim.IEventPublisher#subscribe(org.tinytim.Event, org.tinytim.IEventHandler)
*/
+ @Override
public void subscribe(Event event, IEventHandler handler) {
Collection<IEventHandler> handlers = _evtHandlers.get(event);
if (handlers == null) {
@@ -402,6 +439,7 @@
/* (non-Javadoc)
* @see org.tinytim.internal.api.IEventPublisher#unsubscribe(org.tinytim.internal.api.Event, org.tinytim.internal.api.IEventHandler)
*/
+ @Override
public void unsubscribe(Event event, IEventHandler handler) {
Collection<IEventHandler> handlers = _evtHandlers.get(event);
if (handlers != null) {
@@ -412,6 +450,7 @@
/* (non-Javadoc)
* @see org.tinytim.internal.api.IIndexManagerAware#getIndexManager()
*/
+ @Override
public IIndexManager getIndexManager() {
return _indexManager;
}
Modified: tinytim/trunk/src/main/java/org/tinytim/core/MemoryTopicMapSystem.java
===================================================================
--- tinytim/trunk/src/main/java/org/tinytim/core/MemoryTopicMapSystem.java 2009-08-18 12:54:43 UTC (rev 355)
+++ tinytim/trunk/src/main/java/org/tinytim/core/MemoryTopicMapSystem.java 2009-08-27 13:08:17 UTC (rev 356)
@@ -54,6 +54,7 @@
/* (non-Javadoc)
* @see org.tmapi.core.TopicMapSystem#createTopicMap(org.tmapi.core.Locator)
*/
+ @Override
public TopicMap createTopicMap(Locator locator) throws TopicMapExistsException {
if (_topicMaps.containsKey(locator)) {
throw new TopicMapExistsException("A topic map with the IRI + '" + locator.getReference() + "' exists in the system");
@@ -66,6 +67,7 @@
/* (non-Javadoc)
* @see org.tmapi.core.TopicMapSystem#getLocators()
*/
+ @Override
public Set<Locator> getLocators() {
return Collections.unmodifiableSet(_topicMaps.keySet());
}
@@ -73,6 +75,7 @@
/* (non-Javadoc)
* @see org.tmapi.core.TopicMapSystem#getTopicMap(org.tmapi.core.Locator)
*/
+ @Override
public TopicMap getTopicMap(Locator iri) {
return _topicMaps.get(iri);
}
@@ -80,6 +83,7 @@
/* (non-Javadoc)
* @see org.tmapi.core.TopicMapSystem#close()
*/
+ @Override
public void close() {
super.close();
_topicMaps.clear();
Modified: tinytim/trunk/src/main/java/org/tinytim/core/NameImpl.java
===================================================================
--- tinytim/trunk/src/main/java/org/tinytim/core/NameImpl.java 2009-08-18 12:54:43 UTC (rev 355)
+++ tinytim/trunk/src/main/java/org/tinytim/core/NameImpl.java 2009-08-27 13:08:17 UTC (rev 356)
@@ -47,11 +47,6 @@
private ILiteral _literal;
private Set<Variant> _variants;
-
- NameImpl(ITopicMap tm) {
- super(tm);
- }
-
NameImpl(ITopicMap topicMap, Topic type, ILiteral literal, IScope scope) {
super(topicMap, type, scope);
_literal = literal;
@@ -60,6 +55,7 @@
/* (non-Javadoc)
* @see org.tinytim.core.ConstructImpl#getParent()
*/
+ @Override
public Topic getParent() {
return (Topic) _parent;
}
@@ -67,6 +63,7 @@
/* (non-Javadoc)
* @see org.tinytim.internal.api.ILiteralAware#getLiteral()
*/
+ @Override
public ILiteral getLiteral() {
return _literal;
}
@@ -74,6 +71,7 @@
/* (non-Javadoc)
* @see org.tinytim.internal.api.ILiteralAware#setLiteral(org.tinytim.internal.api.ILiteral)
*/
+ @Override
public void setLiteral(ILiteral literal) {
assert literal != null;
_fireEvent(Event.SET_LITERAL, _literal, literal);
@@ -83,6 +81,7 @@
/* (non-Javadoc)
* @see org.tmapi.core.Name#getValue()
*/
+ @Override
public String getValue() {
return _literal.getValue();
}
@@ -90,6 +89,7 @@
/* (non-Javadoc)
* @see org.tmapi.core.Name#setValue(java.lang.String)
*/
+ @Override
public void setValue(String value) {
Check.valueNotNull(this, value);
setLiteral(Literal.create(value));
@@ -116,7 +116,7 @@
public void removeTheme(Topic theme) {
IScope scope = _scope;
super.removeTheme(theme);
- if (_variants != null && scope != _scope) {
+ if (_variants != null && _scope != scope) {
for (Variant variant: _variants) {
((VariantImpl) variant)._removeNameTheme(theme);
}
@@ -126,6 +126,7 @@
/* (non-Javadoc)
* @see org.tmapi.core.Name#getVariants()
*/
+ @Override
public Set<Variant> getVariants() {
return _variants == null ? Collections.<Variant>emptySet()
: Collections.unmodifiableSet(_variants);
@@ -134,22 +135,25 @@
/* (non-Javadoc)
* @see org.tmapi.core.Name#createVariant(org.tmapi.core.Locator, java.util.Collection)
*/
+ @Override
public Variant createVariant(Locator value, Collection<Topic> scope) {
Check.valueNotNull(this, value);
- return createVariant(Literal.create(value), scope);
+ return createVariant(Literal.create(value), _tm.createScope(scope));
}
/* (non-Javadoc)
- * @see org.tmapi.core.Name#createVariant(java.lang.String, java.util.Collection)
+ * @see org.tmapi.core.Name#createVariant(org.tmapi.core.Locator, java.util.Collection)
*/
+ @Override
public Variant createVariant(String value, Collection<Topic> scope) {
Check.valueNotNull(this, value);
- return createVariant(Literal.create(value), scope);
+ return createVariant(Literal.create(value), _tm.createScope(scope));
}
/* (non-Javadoc)
* @see org.tmapi.core.Name#createVariant(org.tmapi.core.Locator, org.tmapi.core.Topic[])
*/
+ @Override
public Variant createVariant(Locator value, Topic... scope) {
Check.scopeNotNull(this, scope);
return createVariant(value, Arrays.asList(scope));
@@ -158,15 +162,17 @@
/* (non-Javadoc)
* @see org.tmapi.core.Name#createVariant(java.lang.String, org.tmapi.core.Locator, java.util.Collection)
*/
+ @Override
public Variant createVariant(String value, Locator datatype,
Collection<Topic> scope) {
Check.valueNotNull(this, value, datatype);
- return _createVariant(value, datatype, scope);
+ return createVariant(Literal.create(value, datatype), _tm.createScope(scope));
}
/* (non-Javadoc)
* @see org.tmapi.core.Name#createVariant(java.lang.String, org.tmapi.core.Locator, org.tmapi.core.Topic[])
*/
+ @Override
public Variant createVariant(String value, Locator datatype, Topic... scope) {
Check.scopeNotNull(this, scope);
return createVariant(value, datatype, Arrays.asList(scope));
@@ -175,25 +181,22 @@
/* (non-Javadoc)
* @see org.tmapi.core.Name#createVariant(java.lang.String, org.tmapi.core.Topic[])
*/
+ @Override
public Variant createVariant(String value, Topic... scope) {
Check.scopeNotNull(this, scope);
return createVariant(value, Arrays.asList(scope));
}
- private Variant _createVariant(String value, Locator datatype, Collection<Topic> scope) {
- Check.valueNotNull(this, value, datatype);
- return createVariant(Literal.create(value, datatype), scope);
- }
-
- public IVariant createVariant(ILiteral literal, Collection<Topic> scope) {
- Check.sameTopicMap(this, scope);
- if (scope.isEmpty()) {
+ @Override
+ public IVariant createVariant(ILiteral literal, IScope scope) {
+ Check.valueNotNull(this, literal);
+ if (scope.isUnconstrained()) {
throw new ModelConstraintException(this, "The scope of the variant must not be unconstrained");
}
- if (_scope.containsAll(scope)) {
+ if (_scope.containsAll(scope.asSet())) {
throw new ModelConstraintException(this, "The variant's scope is not a true superset of the parent's scope");
}
- VariantImpl variant = new VariantImpl(_tm, literal, Scope.create(scope));
+ VariantImpl variant = new VariantImpl(_tm, literal, scope);
addVariant(variant);
for (Topic theme: _scope) {
variant._addNameTheme(theme);
@@ -236,6 +239,7 @@
/* (non-Javadoc)
* @see org.tinytim.internal.api.IMovable#moveTo(org.tmapi.core.Construct)
*/
+ @Override
public void moveTo(Topic newParent) {
((TopicImpl) _parent).detachName(this, true);
((TopicImpl) newParent).attachName(this, true);
@@ -253,6 +257,7 @@
/* (non-Javadoc)
* @see org.tmapi.core.Construct#remove()
*/
+ @Override
public void remove() {
((TopicImpl) _parent).removeName(this);
super.dispose();
Modified: tinytim/trunk/src/main/java/org/tinytim/core/OccurrenceImpl.java
===================================================================
--- tinytim/trunk/src/main/java/org/tinytim/core/OccurrenceImpl.java 2009-08-18 12:54:43 UTC (rev 355)
+++ tinytim/trunk/src/main/java/org/tinytim/core/OccurrenceImpl.java 2009-08-27 13:08:17 UTC (rev 356)
@@ -31,10 +31,6 @@
*/
final class OccurrenceImpl extends DatatypeAwareConstruct implements IOccurrence {
- OccurrenceImpl(ITopicMap tm) {
- super(tm);
- }
-
OccurrenceImpl(ITopicMap topicMap, Topic type, ILiteral literal, IScope scope) {
super(topicMap, type, literal, scope);
}
@@ -42,6 +38,7 @@
/* (non-Javadoc)
* @see org.tmapi.core.Occurrence#getParent()
*/
+ @Override
public Topic getParent() {
return (Topic) _parent;
}
@@ -49,6 +46,7 @@
/* (non-Javadoc)
* @see org.tinytim.internal.api.IMovable#moveTo(org.tmapi.core.Construct)
*/
+ @Override
public void moveTo(Topic newParent) {
((TopicImpl) _parent).detachOccurrence(this, true);
((TopicImpl) newParent).attachOccurrence(this, true);
@@ -66,6 +64,7 @@
/* (non-Javadoc)
* @see org.tmapi.core.Construct#remove()
*/
+ @Override
public void remove() {
((TopicImpl) _parent).removeOccurrence(this);
super.dispose();
Modified: tinytim/trunk/src/main/java/org/tinytim/core/RoleImpl.java
===================================================================
--- tinytim/trunk/src/main/java/org/tinytim/core/RoleImpl.java 2009-08-18 12:54:43 UTC (rev 355)
+++ tinytim/trunk/src/main/java/org/tinytim/core/RoleImpl.java 2009-08-27 13:08:17 UTC (rev 356)
@@ -16,11 +16,12 @@
package org.tinytim.core;
import org.tinytim.internal.api.Event;
+import org.tinytim.internal.api.IAssociation;
+import org.tinytim.internal.api.IRole;
import org.tinytim.internal.api.ITopicMap;
import org.tinytim.internal.utils.Check;
import org.tmapi.core.Association;
-import org.tmapi.core.Role;
import org.tmapi.core.Topic;
/**
@@ -29,14 +30,10 @@
* @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a>
* @version $Rev$ - $Date$
*/
-final class RoleImpl extends TypedImpl implements Role {
+final class RoleImpl extends TypedImpl implements IRole {
private Topic _player;
- RoleImpl(ITopicMap tm) {
- super(tm);
- }
-
RoleImpl(ITopicMap tm, Topic type, Topic player) {
super(tm, type);
_player = player;
@@ -45,6 +42,7 @@
/* (non-Javadoc)
* @see org.tinytim.core.ConstructImpl#getParent()
*/
+ @Override
public Association getParent() {
return (Association) _parent;
}
@@ -52,6 +50,7 @@
/* (non-Javadoc)
* @see org.tmapi.core.Role#getPlayer()
*/
+ @Override
public Topic getPlayer() {
return _player;
}
@@ -59,6 +58,7 @@
/* (non-Javadoc)
* @see org.tmapi.core.Role#setPlayer(org.tmapi.core.Topic)
*/
+ @Override
public void setPlayer(Topic player) {
Check.playerNotNull(this, player);
Check.sameTopicMap(this, player);
@@ -75,6 +75,12 @@
}
}
+ @Override
+ public void moveTo(IAssociation newParent) {
+ ((AssociationImpl) _parent).detachRole(this);
+ ((AssociationImpl) newParent).attachRole(this);
+ }
+
/* (non-Javadoc)
* @see org.tinytim.core.ConstructImpl#isRole()
*/
@@ -86,6 +92,7 @@
/* (non-Javadoc)
* @see org.tmapi.core.Construct#remove()
*/
+ @Override
public void remove() {
((AssociationImpl) _parent).removeRole(this);
super.dispose();
Modified: tinytim/trunk/src/main/java/org/tinytim/core/Scope.java
===================================================================
--- tinytim/trunk/src/main/java/org/tinytim/core/Scope.java 2009-08-18 12:54:43 UTC (rev 355)
+++ tinytim/trunk/src/main/java/org/tinytim/core/Scope.java 2009-08-27 13:08:17 UTC (rev 356)
@@ -24,7 +24,6 @@
import org.tinytim.internal.api.IScope;
import org.tinytim.internal.utils.CollectionFactory;
import org.tinytim.internal.utils.WeakObjectRegistry;
-
import org.tmapi.core.Topic;
/**
@@ -86,6 +85,7 @@
/* (non-Javadoc)
* @see org.tinytim.internal.api.IScope#asSet()
*/
+ @Override
public Set<Topic> asSet() {
// _set is immutable
return _set;
@@ -94,6 +94,7 @@
/* (non-Javadoc)
* @see org.tinytim.internal.api.IScope#contains(org.tmapi.core.Topic)
*/
+ @Override
public boolean contains(Topic theme) {
return _set.contains(theme);
}
@@ -101,6 +102,7 @@
/* (non-Javadoc)
* @see org.tinytim.internal.api.IScope#containsAll(java.util.Collection)
*/
+ @Override
public boolean containsAll(Collection<Topic> scope) {
return _set.containsAll(scope);
}
@@ -108,6 +110,7 @@
/* (non-Javadoc)
* @see org.tinytim.internal.api.IScope#add(org.tmapi.core.Topic)
*/
+ @Override
public IScope add(Topic theme) {
if (_set.contains(theme)) {
return this;
@@ -120,6 +123,7 @@
/* (non-Javadoc)
* @see org.tinytim.internal.api.IScope#remove(org.tmapi.core.Topic)
*/
+ @Override
public IScope remove(Topic theme) {
if (!_set.contains(theme)) {
return this;
@@ -132,6 +136,7 @@
/* (non-Javadoc)
* @see java.lang.Iterable#iterator()
*/
+ @Override
public Iterator<Topic> iterator(){
return _set.iterator();
}
@@ -139,6 +144,7 @@
/* (non-Javadoc)
* @see org.tinytim.internal.api.IScope#isUnconstrained()
*/
+ @Override
public boolean isUnconstrained() {
return this == UCS;
}
@@ -146,6 +152,7 @@
/* (non-Javadoc)
* @see org.tinytim.internal.api.IScope#size()
*/
+ @Override
public int size() {
return _set.size();
}
Modified: tinytim/trunk/src/main/java/org/tinytim/core/ScopedImpl.java
===================================================================
--- tinytim/trunk/src/main/java/org/tinytim/core/ScopedImpl.java 2009-08-18 12:54:43 UTC (rev 355)
+++ tinytim/trunk/src/main/java/org/tinytim/core/ScopedImpl.java 2009-08-27 13:08:17 UTC (rev 356)
@@ -20,6 +20,7 @@
import org.tinytim.internal.api.Event;
import org.tinytim.internal.api.IScope;
import org.tinytim.internal.api.IScoped;
+import org.tinytim.internal.api.ITopic;
import org.tinytim.internal.api.ITopicMap;
import org.tinytim.internal.utils.Check;
@@ -34,15 +35,8 @@
*/
abstract class ScopedImpl extends TypedImpl implements IScoped {
- //NOTE: This class does NOT implement IScoped by intention!
-
protected IScope _scope;
- protected ScopedImpl(ITopicMap tm) {
- super(tm);
- _scope = Scope.UCS;
- }
-
protected ScopedImpl(ITopicMap topicMap, Topic type, IScope scope) {
super(topicMap, type);
_scope = scope;
@@ -51,6 +45,7 @@
/* (non-Javadoc)
* @see org.tinytim.internal.api.IScoped#getScopeObject()
*/
+ @Override
public IScope getScopeObject() {
return _scope;
}
@@ -58,6 +53,7 @@
/* (non-Javadoc)
* @see org.tinytim.internal.api.IScoped#setScopeObject(org.tinytim.internal.api.IScope)
*/
+ @Override
public void setScopeObject(IScope scope) {
if (_scope == scope) {
return;
@@ -69,6 +65,7 @@
/* (non-Javadoc)
* @see org.tmapi.core.Scoped#getScope()
*/
+ @Override
public Set<Topic> getScope() {
return _scope.asSet();
}
@@ -76,6 +73,7 @@
/* (non-Javadoc)
* @see org.tmapi.core.Scoped#addTheme(org.tmapi.core.Topic)
*/
+ @Override
public void addTheme(Topic theme) {
Check.themeNotNull(this, theme);
Check.sameTopicMap(this, theme);
@@ -85,11 +83,12 @@
/* (non-Javadoc)
* @see org.tmapi.core.Scoped#removeTheme(org.tmapi.core.Topic)
*/
+ @Override
public void removeTheme(Topic theme) {
if (theme == null) {
return;
}
- setScopeObject(_scope.remove(theme));
+ setScopeObject(_scope.remove((ITopic) theme));
}
/* (non-Javadoc)
Modified: tinytim/trunk/src/main/java/org/tinytim/core/TopicImpl.java
===================================================================
--- tinytim/trunk/src/main/java/org/tinytim/core/TopicImpl.java 2009-08-18 12:54:43 UTC (rev 355)
+++ tinytim/trunk/src/main/java/org/tinytim/core/TopicImpl.java 2009-08-27 13:08:17 UTC (rev 356)
@@ -26,6 +26,7 @@
import org.tinytim.internal.api.ILiteral;
import org.tinytim.internal.api.IName;
import org.tinytim.internal.api.IOccurrence;
+import org.tinytim.internal.api.IScope;
import org.tinytim.internal.api.ITopic;
import org.tinytim.internal.api.ITopicMap;
import org.tinytim.internal.utils.Check;
@@ -84,6 +85,7 @@
/* (non-Javadoc)
* @see org.tmapi.core.Topic#addSubjectIdentifier(org.tmapi.core.Locator)
*/
+ @Override
public void addSubjectIdentifier(Locator sid) {
Check.subjectIdentifierNotNull(this, sid);
if (_sids.contains(sid)) {
@@ -96,6 +98,7 @@
/* (non-Javadoc)
* @see org.tmapi.core.Topic#removeSubjectIdentifier(org.tmapi.core.Locator)
*/
+ @Override
public void removeSubjectIdentifier(Locator sid) {
if (!_sids.contains(sid)) {
return;
@@ -107,6 +110,7 @@
/* (non-Javadoc)
* @see org.tmapi.core.Topic#getSubjectLocators()
*/
+ @Override
public Set<Locator> getSubjectLocators() {
return _slos == null ? Collections.<Locator>emptySet()
: Collections.unmodifiableSet(_slos);
@@ -115,6 +119,7 @@
/* (non-Javadoc)
* @see org.tmapi.core.Topic#addSubjectLocator(org.tmapi.core.Locator)
*/
+ @Override
public void addSubjectLocator(Locator slo) {
Check.subjectLocatorNotNull(this, slo);
if (_slos != null && _sids.contains(slo)) {
@@ -130,6 +135,7 @@
/* (non-Javadoc)
* @see org.tmapi.core.Topic#removeSubjectLocator(org.tmapi.core.Locator)
*/
+ @Override
public void removeSubjectLocator(Locator slo) {
if (_slos == null || !_slos.contains(slo)) {
return;
@@ -141,6 +147,7 @@
/* (non-Javadoc)
* @see org.tmapi.core.Topic#getOccurrences()
*/
+ @Override
public Set<Occurrence> getOccurrences() {
return Collections.unmodifiableSet(_occs);
}
@@ -148,30 +155,34 @@
/* (non-Javadoc)
* @see org.tmapi.core.Topic#createOccurrence(org.tmapi.core.Topic, java.lang.String, java.util.Collection)
*/
+ @Override
public Occurrence createOccurrence(Topic type, String value, Collection<Topic> scope) {
Check.valueNotNull(this, value);
- return createOccurrence(type, Literal.create(value), scope);
+ return createOccurrence(type, Literal.create(value), _tm.createScope(scope));
}
/* (non-Javadoc)
* @see org.tmapi.core.Topic#createOccurrence(org.tmapi.core.Locator, org.tmapi.core.Topic, java.util.Collection)
*/
+ @Override
public Occurrence createOccurrence(Topic type, Locator value, Collection<Topic> scope) {
Check.valueNotNull(this, value);
- return createOccurrence(type, Literal.create(value), scope);
+ return createOccurrence(type, Literal.create(value), _tm.createScope(scope));
}
/* (non-Javadoc)
* @see org.tmapi.core.Topic#createOccurrence(org.tmapi.core.Topic, java.lang.String, org.tmapi.core.Locator, java.util.Collection)
*/
+ @Override
public Occurrence createOccurrence(Topic type, String value, Locator datatype, Collection<Topic> scope) {
Check.valueNotNull(this, value, datatype);
- return createOccurrence(type, Literal.create(value, datatype), scope);
+ return createOccurrence(type, Literal.create(value, datatype), _tm.createScope(scope));
}
/* (non-Javadoc)
* @see org.tmapi.core.Topic#createOccurrence(org.tmapi.core.Topic, java.lang.String, org.tmapi.core.Locator, org.tmapi.core.Topic[])
*/
+ @Override
public Occurrence createOccurrence(Topic type, String value, Locator datatype, Topic... scope) {
Check.scopeNotNull(this, scope);
return createOccurrence(type, value, datatype, Arrays.asList(scope));
@@ -180,6 +191,7 @@
/* (non-Javadoc)
* @see org.tmapi.core.Topic#createOccurrence(org.tmapi.core.Topic, org.tmapi.core.Locator, org.tmapi.core.Topic[])
*/
+ @Override
public Occurrence createOccurrence(Topic type, Locator value, Topic... scope) {
Check.scopeNotNull(this, scope);
return createOccurrence(type, value, Arrays.asList(scope));
@@ -188,17 +200,19 @@
/* (non-Javadoc)
* @see org.tmapi.core.Topic#createOccurrence(org.tmapi.core.Topic, java.lang.String, org.tmapi.core.Topic[])
*/
+ @Override
public Occurrence createOccurrence(Topic type, String value, Topic... scope) {
Check.scopeNotNull(this, scope);
return createOccurrence(type, value, Arrays.asList(scope));
}
- public IOccurrence createOccurrence(Topic type, ILiteral literal, Collection<Topic> scope) {
+ @Override
+ public IOccurrence createOccurrence(Topic type, ILiteral literal, IScope scope) {
Check.typeNotNull(this, type);
- Check.scopeNotNull(this, scope);
+ Check.valueNotNull(this, literal);
+ Check.scopeNotNull(this, scope.asSet());
Check.sameTopicMap(this, type);
- Check.sameTopicMap(this, scope);
- IOccurrence occ = new OccurrenceImpl(_tm, type, literal, Scope.create(scope));
+ IOccurrence occ = new OccurrenceImpl(_tm, type, literal, scope);
addOccurrence(occ);
return occ;
}
@@ -250,6 +264,7 @@
/* (non-Javadoc)
* @see org.tmapi.core.Topic#getNames()
*/
+ @Override
public Set<Name> getNames() {
return Collections.unmodifiableSet(_names);
}
@@ -257,6 +272,7 @@
/* (non-Javadoc)
* @see org.tmapi.core.Topic#getNames(org.tmapi.core.Topic)
*/
+ @Override
public Set<Name> getNames(Topic type) {
Check.typeNotNull(type);
Set<Name> names = CollectionFactory.createIdentitySet();
@@ -271,6 +287,7 @@
/* (non-Javadoc)
* @see org.tmapi.core.Topic#createName(java.lang.String, org.tmapi.core.Topic[])
*/
+ @Override
public Name createName(String value, Topic... scope) {
Check.scopeNotNull(this, scope);
return createName(value, Arrays.asList(scope));
@@ -279,6 +296,7 @@
/* (non-Javadoc)
* @see org.tmapi.core.Topic#createName(org.tmapi.core.Topic, java.lang.String, org.tmapi.core.Topic[])
*/
+ @Override
public Name createName(Topic type, String value, Topic... scope) {
Check.scopeNotNull(this, scope);
return createName(type, value, Arrays.asList(scope));
@@ -287,6 +305,7 @@
/* (non-Javadoc)
* @see org.tmapi.core.Topic#getOccurrences(org.tmapi.core.Topic)
*/
+ @Override
public Set<Occurrence> getOccurrences(Topic type) {
Check.typeNotNull(type);
Set<Occurrence> occs = CollectionFactory.createIdentitySet();
@@ -301,6 +320,7 @@
/* (non-Javadoc)
* @see org.tmapi.core.Topic#createName(java.lang.String, java.util.Collection)
*/
+ @Override
public Name createName(String value, Collection<Topic> scope) {
return createName(_tm.createTopicBySubjectIdentifier(TMDM.TOPIC_NAME), value, scope);
}
@@ -308,18 +328,20 @@
/* (non-Javadoc)
* @see org.tmapi.core.Topic#createName(org.tmapi.core.Topic, java.lang.String, java.util.Collection)
*/
+ @Override
public Name createName(Topic type, String value, Collection<Topic> scope) {
Check.valueNotNull(this, value);
- return createName(type, Literal.create(value), scope);
+ return createName(type, Literal.create(value), _tm.createScope(scope));
}
- public IName createName(Topic type, ILiteral literal, Collection<Topic> scope) {
+ @Override
+ public IName createName(Topic type, ILiteral literal, IScope scope) {
Check.typeNotNull(this, type);
Check.scopeNotNull(this, scope);
Check.sameTopicMap(this, type);
- Check.sameTopicMap(this, scope);
- NameImpl name = new NameImpl(_tm, type, literal, Scope.create(scope));
- addName(name);
+ Check.valueNotNull(this, literal);
+ IName name = new NameImpl(_tm, type, literal, scope);
+ this.addName(name);
return name;
}
@@ -361,6 +383,7 @@
/* (non-Javadoc)
* @see org.tmapi.core.Topic#getReified()
*/
+ @Override
public Reifiable getReified() {
return _reified;
}
@@ -368,6 +391,7 @@
/* (non-Javadoc)
* @see org.tmapi.core.Topic#getRolesPlayed()
*/
+ @Override
public Set<Role> getRolesPlayed() {
return _rolesPlayed == null ? Collections.<Role>emptySet()
: Collections.unmodifiableSet(_rolesPlayed);
@@ -376,6 +400,7 @@
/* (non-Javadoc)
* @see org.tmapi.core.Topic#getRolesPlayed(org.tmapi.core.Topic)
*/
+ @Override
public Set<Role> getRolesPlayed(Topic type) {
Check.typeNotNull(type);
if (_rolesPlayed == null) {
@@ -393,6 +418,7 @@
/* (non-Javadoc)
* @see org.tmapi.core.Topic#getRolesPlayed(org.tmapi.core.Topic, org.tmapi.core.Topic)
*/
+ @Override
public Set<Role> getRolesPlayed(Topic type, Topic assoc) {
Check.typeNotNull(type);
if (assoc == null) {
@@ -427,6 +453,7 @@
/* (non-Javadoc)
* @see org.tmapi.core.Topic#getTypes()
*/
+ @Override
public Set<Topic> getTypes() {
return _types == null ? Collections.<Topic>emptySet()
: Collections.unmodifiableSet(_types);
@@ -435,6 +462,7 @@
/* (non-Javadoc)
* @see org.tmapi.core.Topic#addType(org.tmapi.core.Topic)
*/
+ @Override
public void addType(Topic type) {
Check.typeNotNull(this, type);
Check.sameTopicMap(this, type);
@@ -451,6 +479,7 @@
/* (non-Javadoc)
* @see org.tmapi.core.Topic#removeType(org.tmapi.core.Topic)
*/
+ @Override
public void removeType(Topic type) {
if (_types == null || !_types.contains(type)) {
return;
@@ -462,6 +491,7 @@
/* (non-Javadoc)
* @see org.tmapi.core.Topic#mergeIn(org.tmapi.core.Topic)
*/
+ @Override
public void mergeIn(Topic source) {
MergeUtils.merge(source, this);
}
@@ -477,6 +507,7 @@
/* (non-Javadoc)
* @see org.tmapi.core.Construct#remove()
*/
+ @Override
public void remove() throws TopicInUseException {
if (!TopicUtils.isRemovable(this, true)) {
throw new TopicInUseException(this, "The topic is used as type, player, reifier, or theme");
Modified: tinytim/trunk/src/main/java/org/tinytim/core/TypedImpl.java
===================================================================
--- tinytim/trunk/src/main/java/org/tinytim/core/TypedImpl.java 2009-08-18 12:54:43 UTC (rev 355)
+++ tinytim/trunk/src/main/java/org/tinytim/core/TypedImpl.java 2009-08-27 13:08:17 UTC (rev 356)
@@ -38,10 +38,6 @@
private Topic _type;
private Topic _reifier;
- protected TypedImpl(ITopicMap tm) {
- super(tm);
- }
-
protected TypedImpl(ITopicMap topicMap, Topic type) {
super(topicMap);
_type = type;
@@ -70,6 +66,7 @@
/* (non-Javadoc)
* @see org.tmapi.core.Reifiable#getReifier()
*/
+ @Override
public Topic getReifier() {
return _reifier;
}
@@ -77,6 +74,7 @@
/* (non-Javadoc)
* @see org.tmapi.core.Reifiable#setReifier(org.tmapi.core.Topic)
*/
+ @Override
public void setReifier(Topic reifier) {
Check.sameTopicMap(this, reifier);
if (_reifier == reifier) {
Modified: tinytim/trunk/src/main/java/org/tinytim/core/VariantImpl.java
===================================================================
--- tinytim/trunk/src/main/java/org/tinytim/core/VariantImpl.java 2009-08-18 12:54:43 UTC (rev 355)
+++ tinytim/trunk/src/main/java/org/tinytim/core/VariantImpl.java 2009-08-27 13:08:17 UTC (rev 356)
@@ -19,6 +19,7 @@
import org.tinytim.internal.api.Event;
import org.tinytim.internal.api.ILiteral;
+import org.tinytim.internal.api.IName;
import org.tinytim.internal.api.IScope;
import org.tinytim.internal.api.ITopicMap;
import org.tinytim.internal.api.IVariant;
@@ -36,10 +37,6 @@
final class VariantImpl extends DatatypeAwareConstruct implements
IVariant {
- VariantImpl(ITopicMap tm) {
- super(tm);
- }
-
VariantImpl(ITopicMap topicMap, ILiteral literal, IScope scope) {
super(topicMap, null, literal, scope);
}
@@ -47,13 +44,14 @@
/* (non-Javadoc)
* @see org.tinytim.core.ConstructImpl#getParent()
*/
- public Name getParent() {
- return (Name) _parent;
+ public IName getParent() {
+ return (IName) _parent;
}
/* (non-Javadoc)
* @see org.tinytim.internal.api.IMovable#moveTo(org.tmapi.core.Construct)
*/
+ @Override
public void moveTo(Name newParent) {
((NameImpl) _parent).detachVariant(this);
((NameImpl) newParent).attachVariant(this);
Modified: tinytim/trunk/src/main/java/org/tinytim/internal/api/IAssociation.java
===================================================================
--- tinytim/trunk/src/main/java/org/tinytim/internal/api/IAssociation.java 2009-08-18 12:54:43 UTC (rev 355)
+++ tinytim/trunk/src/main/java/org/tinytim/internal/api/IAssociation.java 2009-08-27 13:08:17 UTC (rev 356)
@@ -21,7 +21,7 @@
*
*
* @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a>
- * @version $Rev:$ - $Date:$
+ * @version $Rev$ - $Date$
*/
public interface IAssociation extends Association, IScoped {
Deleted: tinytim/trunk/src/main/java/org/tinytim/internal/api/IConstructFactory.java
===================================================================
--- tinytim/trunk/src/main/java/org/tinytim/internal/api/IConstructFactory.java 2009-08-18 12:54:43 UTC (rev 355)
+++ tinytim/trunk/src/main/java/org/tinytim/internal/api/IConstructFactory.java 2009-08-27 13:08:17 UTC (rev 356)
@@ -1,80 +0,0 @@
-/*
- * Copyright 2008 Lars Heuer (heuer[at]semagia.com)
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.tinytim.internal.api;
-
-import org.tmapi.core.Association;
-import org.tmapi.core.Role;
-
-/**
- * Factory for {@link IConstruct}s.
- * <p>
- * This interface is not meant to be used outside of the tinyTiM package.
- * </p>
- *
- * @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a>
- * @version $Rev$ - $Date$
- */
-public interface IConstructFactory {
-
- /**
- * Creates a topic attached to the topic map this factory belongs to.
- *
- * @return A topic with no identity.
- */
- public ITopic createTopic();
-
- /**
- * Creates an association attached to the topic map this
- * factory belongs to.
- *
- * @return An association with no type, scope, and roles.
- */
- public Association createAssociation();
-
- /**
- * Creates a role attached to the specified <tt>parent</tt>.
- *
- * @param parent The parent of the role.
- * @return A role with no type and player.
- */
- public Role createRole(Association parent);
-
- /**
- * Creates an occurrence attached to the specified <tt>parent</tt>.
- *
- * @param parent The parent of the occurrence.
- * @return An occurrence with no type, literal, and scope.
- */
- public IOccurrence createOccurrence(ITopic parent);
-
- /**
- * Creates a name attached to the specified <tt>parent</tt>.
- *
- * @param parent The parent of the name.
- * @return A name with no type, literal, and scope.
- */
- public IName createName(ITopic parent);
-
- /**
- * Creates a variant attached to the specified <tt>parent</tt>.
- *
- * @param parent The parent of the variant.
- * @return A variant with the parent's scope, but no own scope and
- * no literal.
- */
- public IVariant createVariant(IName parent);
-
-}
Modified: tinytim/trunk/src/main/java/org/tinytim/internal/api/IName.java
===================================================================
--- tinytim/trunk/src/main/java/org/tinytim/internal/api/IName.java 2009-08-18 12:54:43 UTC (rev 355)
+++ tinytim/trunk/src/main/java/org/tinytim/internal/api/IName.java 2009-08-27 13:08:17 UTC (rev 356)
@@ -15,8 +15,6 @@
*/
package org.tinytim.internal.api;
-import java.util.Collection;
-
import org.tmapi.core.Name;
import org.tmapi.core.Topic;
@@ -28,6 +26,6 @@
*/
public interface IName extends Name, IScoped, ILiteralAware, IMovable<Topic>{
- public IVariant createVariant(ILiteral literal, Collection<Topic> scope);
+ public IVariant createVariant(ILiteral literal, IScope scope);
}
Added: tinytim/trunk/src/main/java/org/tinytim/internal/api/IRole.java
===================================================================
--- tinytim/trunk/src/main/java/org/tinytim/internal/api/IRole.java (rev 0)
+++ tinytim/trunk/src/main/java/org/tinytim/internal/api/IRole.java 2009-08-27 13:08:17 UTC (rev 356)
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2009 Lars Heuer (heuer[at]semagia.com). All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.tinytim.internal.api;
+
+import org.tmapi.core.Role;
+
+/**
+ *
+ *
+ * @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a>
+ * @version $Rev:$ - $Date:$
+ */
+public interface IRole extends Role, IMovable<IAssociation> {
+
+}
Property changes on: tinytim/trunk/src/main/java/org/tinytim/internal/api/IRole.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date Id
Added: svn:eol-style
+ native
Modified: tinytim/trunk/src/main/java/org/tinytim/internal/api/ITopic.java
===================================================================
--- tinytim/trunk/src/main/java/org/tinytim/internal/api/ITopic.java 2009-08-18 12:54:43 UTC (rev 355)
+++ tinytim/trunk/src/main/java/org/tinytim/internal/api/ITopic.java 2009-08-27 13:08:17 UTC (rev 356)
@@ -15,8 +15,6 @@
*/
package org.tinytim.internal.api;
-import java.util.Collection;
-
import org.tmapi.core.Topic;
/**
@@ -27,8 +25,8 @@
*/
public interface ITopic extends Topic, IConstruct {
- public IOccurrence createOccurrence(Topic type, ILiteral literal, Collection<Topic> scope);
+ public IOccurrence createOccurrence(Topic type, ILiteral literal, IScope scope);
- public IName createName(Topic type, ILiteral literal, Collection<Topic> scope);
+ public IName createName(Topic type, ILiteral literal, IScope scope);
}
Modified: tinytim/trunk/src/main/java/org/tinytim/internal/api/ITopicMap.java
===================================================================
--- tinytim/trunk/src/main/java/org/tinytim/internal/api/ITopicMap.java 2009-08-18 12:54:43 UTC (rev 355)
+++ tinytim/trunk/src/main/java/org/tinytim/internal/api/ITopicMap.java 2009-08-27 13:08:17 UTC (rev 356)
@@ -15,6 +15,9 @@
*/
package org.tinytim.internal.api;
+import java.util.Collection;
+
+import org.tmapi.core.Topic;
import org.tmapi.core.TopicMap;
/**
@@ -27,9 +30,13 @@
* @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a>
* @version $Rev$ - $Date$
*/
-public interface ITopicMap extends TopicMap, IConstruct, IIndexManagerAware,
+public interface ITopicMap extends TopicMap, IIndexManagerAware,
IEventHandler, IEventPublisher {
- public IConstructFactory getConstructFactory();
+ public ITopic createEmptyTopic();
+ public IAssociation createAssociation(Topic type, IScope scope);
+
+ public IScope createScope(Collection<Topic> themes);
+
}
Modified: tinytim/trunk/src/main/java/org/tinytim/internal/api/IVariant.java
===================================================================
--- tinytim/trunk/src/main/java/org/tinytim/internal/api/IVariant.java 2009-08-18 12:54:43 UTC (rev 355)
+++ tinytim/trunk/src/main/java/org/tinytim/internal/api/IVariant.java 2009-08-27 13:08:17 UTC (rev 356)
@@ -26,4 +26,6 @@
*/
public interface IVariant extends Variant, IScoped, ILiteralAware, IMovable<Name> {
+ public IName getParent();
+
}
Modified: tinytim/trunk/src/main/java/org/tinytim/internal/utils/Check.java
===================================================================
--- tinytim/trunk/src/main/java/org/tinytim/internal/utils/Check.java 2009-08-18 12:54:43 UTC (rev 355)
+++ tinytim/trunk/src/main/java/org/tinytim/internal/utils/Check.java 2009-08-27 13:08:17 UTC (rev 356)
@@ -47,9 +47,9 @@
}
/**
- *
+ * Throws an {@link IllegalArgumentException}.
*
- * @param msg
+ * @param msg The error message.
*/
private static void _reportIllegalArgument(String msg) {
throw new IllegalArgumentException(msg);
@@ -75,7 +75,7 @@
* @param sender The sender.
* @param scope The scope.
*/
- public static void scopeNotNull(Construct sender, Collection<Topic> scope) {
+ public static void scopeNotNull(Construct sender, Iterable<Topic> scope) {
if (scope == null) {
_reportModelConstraintViolation(sender, "The scope must not be null");
}
@@ -200,6 +200,13 @@
_sameTopicMap(sender, sender.getTopicMap(), construct);
}
+ /**
+ * Throws a {@link ModelConstraintException} iff the specified <tt>constructs</tt>
+ * do not belong to the same topic map as the <tt>sender</tt>.
+ *
+ * @param sender The sender.
+ * @param constructs The constructs.
+ */
public static void sameTopicMap(Construct sender, Construct...constructs) {
if (constructs == null || constructs.length == 0) {
return;
@@ -210,6 +217,13 @@
}
}
+ /**
+ * Throws a {@link ModelConstraintException} iff the specified <tt>constructs</tt>
+ * do not belong to the same topic map as the <tt>sender</tt>.
+ *
+ * @param sender The sender.
+ * @param constructs The constructs.
+ */
public static void sameTopicMap(Construct sender, Collection<? extends Construct> constructs) {
if (constructs == null) {
return;
Modified: tinytim/trunk/src/main/java/org/tinytim/internal/utils/CopyUtils.java
===================================================================
--- tinytim/trunk/src/main/java/org/tinytim/internal/utils/CopyUtils.java 2009-08-18 12:54:43 UTC (rev 355)
+++ tinytim/trunk/src/main/java/org/tinytim/internal/utils/CopyUtils.java 2009-08-27 13:08:17 UTC (rev 356)
@@ -20,6 +20,7 @@
import org.tinytim.internal.api.ILiteralAware;
import org.tinytim.internal.api.IName;
+import org.tinytim.internal.api.IScope;
import org.tinytim.internal.api.ITopic;
import org.tinytim.internal.api.ITopicMap;
@@ -126,9 +127,9 @@
* @param mergeMap The map which holds the merge mappings.
* @return The newly created topic in the target topic map.
*/
- private static Topic _copyTopic(Topic topic, ITopicMap target,
+ private static ITopic _copyTopic(Topic topic, ITopicMap target,
Map<Topic, Topic> mergeMap) {
- Topic targetTopic = target.getConstructFactory().createTopic();
+ ITopic targetTopic = target.createEmptyTopic();
_copyIdentities(topic, ...
[truncated message content] |
|
From: Lukas G. <in...@Fh...> - 2009-08-23 13:20:03
|
Hi, I am implementing an RDF importer and exporter for the TM engine Isidorus. I also want to get a brief introduction into the RDf-mapping in tinyTiM, to be able to exchange mapped data between tinyTiT and Isidorus (when the mapping concepts are not absolutely different). So I started to import data with tinyTiM - but importing RDF/XML reqieres a mapping-schema. Are any example schemata existing? Is it possible to import "normal" RDF/XML files without predifend schemata? What's about exporting Topic Maps as RDF/XML - I didn't find a Class/Interface which is able to export TM as RDF/XML? Thanks & Regards Lukas |
|
From: <bo...@us...> - 2009-08-18 12:54:58
|
Revision: 355
http://tinytim.svn.sourceforge.net/tinytim/?rev=355&view=rev
Author: bosso
Date: 2009-08-18 12:54:43 +0000 (Tue, 18 Aug 2009)
Log Message:
-----------
* bugfix in TemplateProcessor
* removed TMDM.Subject removal
Modified Paths:
--------------
tinytim-mio/trunk/src/main/java/org/tinytim/mio/CTMTopicMapWriter.java
tinytim-mio/trunk/src/main/java/org/tinytim/mio/internal/ctm/impl/DefaultTMCLPreprocessor.java
Modified: tinytim-mio/trunk/src/main/java/org/tinytim/mio/CTMTopicMapWriter.java
===================================================================
--- tinytim-mio/trunk/src/main/java/org/tinytim/mio/CTMTopicMapWriter.java 2009-08-18 11:37:46 UTC (rev 354)
+++ tinytim-mio/trunk/src/main/java/org/tinytim/mio/CTMTopicMapWriter.java 2009-08-18 12:54:43 UTC (rev 355)
@@ -469,12 +469,6 @@
_newline();
_writeSection("INSTANCES");
_writeSection("Topics");
- // remove tmdm:subject, because filter below doesn't work. tmdm:subject plays a role, so
- // _omitTopic returns false - we definitly don't want "tmdm:subject ." in our ctm file, do we?
- Topic topic = topicMap.getTopicBySubjectIdentifier(TMDM.SUBJECT);
- if (topic != null) {
- topics.remove(topic);
- }
_writeTopics(topics);
if (!assocs.isEmpty()) {
Association[] assocArray = assocs.toArray(new Association[assocs.size()]);
Modified: tinytim-mio/trunk/src/main/java/org/tinytim/mio/internal/ctm/impl/DefaultTMCLPreprocessor.java
===================================================================
--- tinytim-mio/trunk/src/main/java/org/tinytim/mio/internal/ctm/impl/DefaultTMCLPreprocessor.java 2009-08-18 11:37:46 UTC (rev 354)
+++ tinytim-mio/trunk/src/main/java/org/tinytim/mio/internal/ctm/impl/DefaultTMCLPreprocessor.java 2009-08-18 12:54:43 UTC (rev 355)
@@ -602,9 +602,10 @@
}
DefaultTemplate tpl = new DefaultTemplate(templateName);
+ occCounter = _assignCardinality(constraint, tpl, occCounter);
tpl.addParameter(regEx);
- occCounter = _assignCardinality(constraint, tpl, occCounter);
+
Topic player = _getConstrainedTopicTypePlayer(constraint, assocs);
_registerTemplate(player, tpl);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <lh...@us...> - 2009-08-18 11:38:07
|
Revision: 354
http://tinytim.svn.sourceforge.net/tinytim/?rev=354&view=rev
Author: lheuer
Date: 2009-08-18 11:37:46 +0000 (Tue, 18 Aug 2009)
Log Message:
-----------
Avoid creation of tmdm:subject
Modified Paths:
--------------
tinytim-mio/trunk/src/main/java/org/tinytim/mio/CTMTopicMapWriter.java
Modified: tinytim-mio/trunk/src/main/java/org/tinytim/mio/CTMTopicMapWriter.java
===================================================================
--- tinytim-mio/trunk/src/main/java/org/tinytim/mio/CTMTopicMapWriter.java 2009-08-18 08:55:32 UTC (rev 353)
+++ tinytim-mio/trunk/src/main/java/org/tinytim/mio/CTMTopicMapWriter.java 2009-08-18 11:37:46 UTC (rev 354)
@@ -471,11 +471,10 @@
_writeSection("Topics");
// remove tmdm:subject, because filter below doesn't work. tmdm:subject plays a role, so
// _omitTopic returns false - we definitly don't want "tmdm:subject ." in our ctm file, do we?
- Topic topic = topicMap.createTopicBySubjectIdentifier(TMDM.SUBJECT);
- if ( (topic!=null) && (topics.contains(topic)) ) {
+ Topic topic = topicMap.getTopicBySubjectIdentifier(TMDM.SUBJECT);
+ if (topic != null) {
topics.remove(topic);
}
-
_writeTopics(topics);
if (!assocs.isEmpty()) {
Association[] assocArray = assocs.toArray(new Association[assocs.size()]);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <bo...@us...> - 2009-08-18 08:55:45
|
Revision: 353
http://tinytim.svn.sourceforge.net/tinytim/?rev=353&view=rev
Author: bosso
Date: 2009-08-18 08:55:32 +0000 (Tue, 18 Aug 2009)
Log Message:
-----------
ctm export fixes
Modified Paths:
--------------
tinytim-mio/trunk/build.properties
tinytim-mio/trunk/src/main/java/org/tinytim/mio/CTMTopicMapWriter.java
tinytim-mio/trunk/src/main/java/org/tinytim/mio/internal/ctm/impl/DefaultTMCLPreprocessor.java
Added Paths:
-----------
tinytim-mio/trunk/lib/tinytim-2.0.0a6-snapshot-200908171257.jar
Removed Paths:
-------------
tinytim-mio/trunk/lib/tinytim-2.0.0a6-snapshot-200908141400.jar
Modified: tinytim-mio/trunk/build.properties
===================================================================
--- tinytim-mio/trunk/build.properties 2009-08-17 20:08:59 UTC (rev 352)
+++ tinytim-mio/trunk/build.properties 2009-08-18 08:55:32 UTC (rev 353)
@@ -1,5 +1,5 @@
version=2.0.0
version_suffix=a6
#release_type=
-debug=off
+debug=on
optimize=on
Deleted: tinytim-mio/trunk/lib/tinytim-2.0.0a6-snapshot-200908141400.jar
===================================================================
(Binary files differ)
Added: tinytim-mio/trunk/lib/tinytim-2.0.0a6-snapshot-200908171257.jar
===================================================================
(Binary files differ)
Property changes on: tinytim-mio/trunk/lib/tinytim-2.0.0a6-snapshot-200908171257.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified: tinytim-mio/trunk/src/main/java/org/tinytim/mio/CTMTopicMapWriter.java
===================================================================
--- tinytim-mio/trunk/src/main/java/org/tinytim/mio/CTMTopicMapWriter.java 2009-08-17 20:08:59 UTC (rev 352)
+++ tinytim-mio/trunk/src/main/java/org/tinytim/mio/CTMTopicMapWriter.java 2009-08-18 08:55:32 UTC (rev 353)
@@ -140,7 +140,8 @@
ASSOCIATION,
ROLE,
OCCURRENCE,
- NAME
+ NAME,
+ SUBJECT
}
/**
@@ -468,6 +469,13 @@
_newline();
_writeSection("INSTANCES");
_writeSection("Topics");
+ // remove tmdm:subject, because filter below doesn't work. tmdm:subject plays a role, so
+ // _omitTopic returns false - we definitly don't want "tmdm:subject ." in our ctm file, do we?
+ Topic topic = topicMap.createTopicBySubjectIdentifier(TMDM.SUBJECT);
+ if ( (topic!=null) && (topics.contains(topic)) ) {
+ topics.remove(topic);
+ }
+
_writeTopics(topics);
if (!assocs.isEmpty()) {
Association[] assocArray = assocs.toArray(new Association[assocs.size()]);
@@ -536,6 +544,7 @@
_topic2Templates.putAll(tmclProcessor.getTopicToTemplatesMapping());
}
+ @SuppressWarnings("deprecation")
private Locator[] _getSubjectIdentifiersToFilter(TypeFilter mode) {
Locator[] toFilter = new Locator[0];
switch (mode) {
@@ -616,7 +625,8 @@
TMCL.CARD_MAX,
TMCL.DATATYPE,
TMCL.REGEXP,
- TMCL.VALIDATION_EXPRESSION
+ TMCL.VALIDATION_EXPRESSION,
+ TMDM.SUBJECT // the occurrence
};
}
break;
@@ -660,7 +670,6 @@
&& topic.getTypes().isEmpty()
&& topic.getNames().isEmpty()
&& topic.getOccurrences().isEmpty()
- && topic.getRolesPlayed().isEmpty()
&& topic.getReified() == null;
}
Modified: tinytim-mio/trunk/src/main/java/org/tinytim/mio/internal/ctm/impl/DefaultTMCLPreprocessor.java
===================================================================
--- tinytim-mio/trunk/src/main/java/org/tinytim/mio/internal/ctm/impl/DefaultTMCLPreprocessor.java 2009-08-17 20:08:59 UTC (rev 352)
+++ tinytim-mio/trunk/src/main/java/org/tinytim/mio/internal/ctm/impl/DefaultTMCLPreprocessor.java 2009-08-18 08:55:32 UTC (rev 353)
@@ -30,6 +30,7 @@
import org.tinytim.mio.internal.ctm.ITMCLPreprocessor;
import org.tinytim.mio.internal.ctm.ITemplate;
import org.tinytim.voc.TMCL;
+import org.tinytim.voc.TMDM;
import org.tmapi.core.Association;
import org.tmapi.core.Locator;
import org.tmapi.core.Occurrence;
@@ -278,7 +279,7 @@
TypeInstanceIndex tiIdx, Collection<Topic> topics,
Collection<Association> assocs) {
for (Topic constraint : _getConstraintInstances(topicMap, tiIdx,
- TMCL.ABSTRACT_TOPIC_TYPE_CONSTRAINT)) {
+ TMCL.ABSTRACT_CONSTRAINT)) {
_processAbstractTopicConstraint(constraint, topics, assocs);
}
}
@@ -614,7 +615,7 @@
TypeInstanceIndex tiIdx, Collection<Topic> topics,
Collection<Association> assocs) {
final Topic type = topicMap
- .getTopicBySubjectIdentifier(TMCL.SCOPE_TYPE);
+ .getTopicBySubjectIdentifier(TMCL.TOPIC_TYPE);
if (type == null) {
return;
}
@@ -641,10 +642,12 @@
private void _processOccurrenceConstraints(TopicMap topicMap,
TypeInstanceIndex tiIdx, Collection<Topic> topics,
Collection<Association> assocs) {
- final Topic type = topicMap
- .getTopicBySubjectIdentifier(TMCL.OCCURRENCE_TYPE);
+ Topic type = topicMap.getTopicBySubjectIdentifier(TMCL.OCCURRENCE_TYPE);
if (type == null) {
- return;
+ // try tmdm:subject
+ type = topicMap.getTopicBySubjectIdentifier(TMDM.SUBJECT);
+ if (type==null)
+ return;
}
for (Topic constraint : _getConstraintInstances(topicMap, tiIdx,
TMCL.TOPIC_OCCURRENCE_CONSTRAINT)) {
@@ -656,9 +659,12 @@
private void _processNameConstraints(TopicMap topicMap,
TypeInstanceIndex tiIdx, Collection<Topic> topics,
Collection<Association> assocs) {
- final Topic type = topicMap.getTopicBySubjectIdentifier(TMCL.NAME_TYPE);
+ Topic type = topicMap.getTopicBySubjectIdentifier(TMCL.NAME_TYPE);
if (type == null) {
- return;
+ // try default name-type
+ type = topicMap.getTopicBySubjectIdentifier(TMDM.TOPIC_NAME);
+ if (type==null)
+ return;
}
for (Topic constraint : _getConstraintInstances(topicMap, tiIdx,
TMCL.TOPIC_NAME_CONSTRAINT)) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <lh...@us...> - 2009-08-17 20:09:07
|
Revision: 352
http://tinytim.svn.sourceforge.net/tinytim/?rev=352&view=rev
Author: lheuer
Date: 2009-08-17 20:08:59 +0000 (Mon, 17 Aug 2009)
Log Message:
-----------
Fixed typo
Modified Paths:
--------------
tinytim-mio/trunk/src/main/java/org/tinytim/mio/LTMTopicMapReader.java
Modified: tinytim-mio/trunk/src/main/java/org/tinytim/mio/LTMTopicMapReader.java
===================================================================
--- tinytim-mio/trunk/src/main/java/org/tinytim/mio/LTMTopicMapReader.java 2009-08-17 15:35:20 UTC (rev 351)
+++ tinytim-mio/trunk/src/main/java/org/tinytim/mio/LTMTopicMapReader.java 2009-08-17 20:08:59 UTC (rev 352)
@@ -110,7 +110,7 @@
* form <tt>uri-of-file#--reified--id</tt> and the reifying topic should
* receive a subject identifier of the same form.
* <p>
- * By default this "feature" is disabled; the parser sets [reifier] property
+ * By default this "feature" is disabled; the parser sets the [reifier] property
* of the reified construct and does not add any additional IRIs. To be
* conform to the LTM specification, this feature has to be enabled even if
* it adds no value.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <lh...@us...> - 2009-08-17 15:35:30
|
Revision: 351
http://tinytim.svn.sourceforge.net/tinytim/?rev=351&view=rev
Author: lheuer
Date: 2009-08-17 15:35:20 +0000 (Mon, 17 Aug 2009)
Log Message:
-----------
Renamed jiiiiiiiiiing into jing :)
Added Paths:
-----------
tinytim-mio/trunk/lib/LICENSE.jing.txt
Removed Paths:
-------------
tinytim-mio/trunk/lib/LICENSE.jiing.txt
Deleted: tinytim-mio/trunk/lib/LICENSE.jiing.txt
===================================================================
--- tinytim-mio/trunk/lib/LICENSE.jiing.txt 2009-08-17 10:56:16 UTC (rev 350)
+++ tinytim-mio/trunk/lib/LICENSE.jiing.txt 2009-08-17 15:35:20 UTC (rev 351)
@@ -1,26 +0,0 @@
-Jing Copying Conditions
-
-Copyright (c) 2001-2003, 2008 Thai Open Source Software Center Ltd
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without modification,
-are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
- * Neither the name of the Thai Open Source Software Center Ltd nor the names
- of its contributors may be used to endorse or promote products derived from
- this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Added: tinytim-mio/trunk/lib/LICENSE.jing.txt
===================================================================
--- tinytim-mio/trunk/lib/LICENSE.jing.txt (rev 0)
+++ tinytim-mio/trunk/lib/LICENSE.jing.txt 2009-08-17 15:35:20 UTC (rev 351)
@@ -0,0 +1,26 @@
+Jing Copying Conditions
+
+Copyright (c) 2001-2003, 2008 Thai Open Source Software Center Ltd
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+ * Neither the name of the Thai Open Source Software Center Ltd nor the names
+ of its contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <bo...@us...> - 2009-08-17 10:56:25
|
Revision: 350
http://tinytim.svn.sourceforge.net/tinytim/?rev=350&view=rev
Author: bosso
Date: 2009-08-17 10:56:16 +0000 (Mon, 17 Aug 2009)
Log Message:
-----------
minor bugfix
Modified Paths:
--------------
tinytim-mio/trunk/src/main/java/org/tinytim/mio/CTMTopicMapWriter.java
tinytim-mio/trunk/src/main/java/org/tinytim/mio/internal/ctm/impl/DefaultTMCLPreprocessor.java
Modified: tinytim-mio/trunk/src/main/java/org/tinytim/mio/CTMTopicMapWriter.java
===================================================================
--- tinytim-mio/trunk/src/main/java/org/tinytim/mio/CTMTopicMapWriter.java 2009-08-17 10:43:24 UTC (rev 349)
+++ tinytim-mio/trunk/src/main/java/org/tinytim/mio/CTMTopicMapWriter.java 2009-08-17 10:56:16 UTC (rev 350)
@@ -561,7 +561,8 @@
TMCL.SUBJECT_LOCATOR_CONSTRAINT,
TMCL.TOPIC_NAME_CONSTRAINT,
TMCL.TOPIC_OCCURRENCE_CONSTRAINT,
- TMCL.ROLE_PLAYER_CONSTRAINT, TMCL.SCOPE_CONSTRAINT,
+ TMCL.TOPIC_ROLE_CONSTRAINT,
+ TMCL.SCOPE_CONSTRAINT,
TMCL.REIFIER_CONSTRAINT,
TMCL.ASSOCIATION_ROLE_CONSTRAINT,
TMCL.ROLE_COMBINATION_CONSTRAINT,
Modified: tinytim-mio/trunk/src/main/java/org/tinytim/mio/internal/ctm/impl/DefaultTMCLPreprocessor.java
===================================================================
--- tinytim-mio/trunk/src/main/java/org/tinytim/mio/internal/ctm/impl/DefaultTMCLPreprocessor.java 2009-08-17 10:43:24 UTC (rev 349)
+++ tinytim-mio/trunk/src/main/java/org/tinytim/mio/internal/ctm/impl/DefaultTMCLPreprocessor.java 2009-08-17 10:56:16 UTC (rev 350)
@@ -150,6 +150,7 @@
_processNameConstraints(topicMap, tiIdx, topics, assocs);
_processScopeConstraints(topicMap, tiIdx, topics, assocs);
_processReifierConstraints(topicMap, tiIdx, topics, assocs);
+ _processTopicReifiesConstraints(topicMap, tiIdx, topics, assocs);
_processBelongsToSchema(topicMap, tiIdx, topics, assocs);
}
@@ -345,17 +346,17 @@
TypeInstanceIndex tiIdx, Collection<Topic> topics,
Collection<Association> assocs) {
for (Topic constraint : _getConstraintInstances(topicMap, tiIdx,
- TMCL.BELONGS_TO_SCHEMA)) {
+ TMCL.REIFIER_CONSTRAINT)) {
_processReifierConstraint(constraint, topics, assocs);
}
}
-
+
private void _processReifierConstraint(Topic constraint,
Collection<Topic> topics, Collection<Association> assocs) {
- Topic reifierType = _getConstrainedStatementPlayer(constraint, assocs);
- Topic reifiableType = _getAllowedReifierPlayer(constraint, assocs);
-
+ Topic reifiableType = _getConstrainedStatementPlayer(constraint, assocs);
+ Topic reifierType = _getAllowedReifierPlayer(constraint, assocs);
+
ILiteral cardMin = _getCardMin(constraint);
ILiteral cardMax = _getCardMax(constraint);
DefaultTemplate tpl = null;
@@ -371,10 +372,47 @@
else {
tpl = new DefaultTemplate("may-have-reifier");
tpl.addParameter(reifierType);
+
+ }
+
+ _registerTemplate(reifiableType, tpl);
+ removeConstraint(constraint, topics, 2);
+ }
+ private void _processTopicReifiesConstraints(TopicMap topicMap,
+ TypeInstanceIndex tiIdx, Collection<Topic> topics,
+ Collection<Association> assocs) {
+ for (Topic constraint : _getConstraintInstances(topicMap, tiIdx,
+ TMCL.TOPIC_REIFIES_CONSTRAINT)) {
+ _processTopicReifiesConstraint(constraint, topics, assocs);
}
- _registerTemplate(reifiableType, tpl);
+ }
+
+ private void _processTopicReifiesConstraint(Topic constraint,
+ Collection<Topic> topics, Collection<Association> assocs) {
+ Topic reifiableType = _getConstrainedStatementPlayer(constraint, assocs);
+ Topic reifierType = _getConstrainedTopicTypePlayer(constraint, assocs);
+
+ ILiteral cardMin = _getCardMin(constraint);
+ ILiteral cardMax = _getCardMax(constraint);
+ DefaultTemplate tpl = null;
+ if (cardMin.getValue().equals(cardMax.getValue())) {
+ if (cardMin.getValue().equals("0")) {
+ tpl = new DefaultTemplate("cannot-reify");
+ }
+ else {
+ tpl = new DefaultTemplate("must-reify");
+ tpl.addParameter(reifiableType);
+ }
+ }
+ else {
+ tpl = new DefaultTemplate("may");
+ tpl.addParameter(reifiableType);
+
+ }
+
+ _registerTemplate(reifierType, tpl);
removeConstraint(constraint, topics, 2);
}
@@ -382,7 +420,7 @@
TypeInstanceIndex tiIdx, Collection<Topic> topics,
Collection<Association> assocs) {
for (Topic constraint : _getConstraintInstances(topicMap, tiIdx,
- TMCL.ROLE_PLAYER_CONSTRAINT)) {
+ TMCL.TOPIC_ROLE_CONSTRAINT)) {
_processRolePlayerConstraint(constraint, topics, assocs);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <bo...@us...> - 2009-08-17 10:43:37
|
Revision: 349
http://tinytim.svn.sourceforge.net/tinytim/?rev=349&view=rev
Author: bosso
Date: 2009-08-17 10:43:24 +0000 (Mon, 17 Aug 2009)
Log Message:
-----------
added line for comment for tmdm:subject
Modified Paths:
--------------
tinytim/trunk/src/main/java/org/tinytim/voc/TMDM.java
Modified: tinytim/trunk/src/main/java/org/tinytim/voc/TMDM.java
===================================================================
--- tinytim/trunk/src/main/java/org/tinytim/voc/TMDM.java 2009-08-14 11:59:23 UTC (rev 348)
+++ tinytim/trunk/src/main/java/org/tinytim/voc/TMDM.java 2009-08-17 10:43:24 UTC (rev 349)
@@ -32,7 +32,8 @@
private static final String _BASE = Namespace.TMDM_MODEL;
/**
- * Core concept of a subject.
+ * Core concept of a subject. Although it this identifier is in the TMDM namespace,
+ * it really is specified by TMCL.
*/
public static final Locator SUBJECT = _createLocator(_BASE + "subject");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: Markus U. <mar...@gm...> - 2009-08-14 12:12:08
|
lh...@us... schrieb: > Revision: 348 > http://tinytim.svn.sourceforge.net/tinytim/?rev=348&view=rev > Author: lheuer > Date: 2009-08-14 11:59:23 +0000 (Fri, 14 Aug 2009) > > Log Message: > ----------- > Removed unused Logger, committed forgotten code changes > Yay, it works again! ;) Ad astra, Markus |
|
From: <lh...@us...> - 2009-08-14 11:59:34
|
Revision: 348
http://tinytim.svn.sourceforge.net/tinytim/?rev=348&view=rev
Author: lheuer
Date: 2009-08-14 11:59:23 +0000 (Fri, 14 Aug 2009)
Log Message:
-----------
Removed unused Logger, committed forgotten code changes
Modified Paths:
--------------
tinytim-mio/trunk/src/main/java/org/tinytim/mio/AbstractXTMTopicMapReader.java
tinytim-mio/trunk/src/main/java/org/tinytim/mio/internal/ctm/impl/DefaultTMCLPreprocessor.java
Added Paths:
-----------
tinytim-mio/trunk/lib/tinytim-2.0.0a6-snapshot-200908141400.jar
Removed Paths:
-------------
tinytim-mio/trunk/lib/tinytim-2.0.0a6-snapshot-200908121355.jar
Deleted: tinytim-mio/trunk/lib/tinytim-2.0.0a6-snapshot-200908121355.jar
===================================================================
(Binary files differ)
Added: tinytim-mio/trunk/lib/tinytim-2.0.0a6-snapshot-200908141400.jar
===================================================================
(Binary files differ)
Property changes on: tinytim-mio/trunk/lib/tinytim-2.0.0a6-snapshot-200908141400.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified: tinytim-mio/trunk/src/main/java/org/tinytim/mio/AbstractXTMTopicMapReader.java
===================================================================
--- tinytim-mio/trunk/src/main/java/org/tinytim/mio/AbstractXTMTopicMapReader.java 2009-08-14 11:43:24 UTC (rev 347)
+++ tinytim-mio/trunk/src/main/java/org/tinytim/mio/AbstractXTMTopicMapReader.java 2009-08-14 11:59:23 UTC (rev 348)
@@ -35,29 +35,46 @@
*/
abstract class AbstractXTMTopicMapReader extends AbstractTopicMapReader {
+ /**
+ * The underlying topic map.
+ *
+ * This can be <tt>null</tt> if
+ * {@link #AbstractXTMTopicMapReader(IMapHandler, Syntax, Source)}
+ * was used to create an instance of this class and the provided handler
+ * is not an instance of {@link TinyTimMapInputHandler}.
+ */
+ protected TopicMap _tm;
+
protected AbstractXTMTopicMapReader(TopicMap topicMap, Syntax syntax,
File source) throws IOException {
super(topicMap, syntax, source);
+ _tm = topicMap;
}
protected AbstractXTMTopicMapReader(TopicMap topicMap, Syntax syntax,
File source, String docIRI) throws IOException {
super(topicMap, syntax, source, docIRI);
+ _tm = topicMap;
}
protected AbstractXTMTopicMapReader(TopicMap topicMap, Syntax syntax,
InputStream source, String docIRI) {
super(topicMap, syntax, source, docIRI);
+ _tm = topicMap;
}
protected AbstractXTMTopicMapReader(TopicMap topicMap, Syntax syntax,
Source source) {
super(topicMap, syntax, source);
+ _tm = topicMap;
}
protected AbstractXTMTopicMapReader(IMapHandler handler, Syntax syntax,
Source source) {
super(handler, syntax, source);
+ if (handler instanceof TinyTimMapInputHandler) {
+ _tm = ((TinyTimMapInputHandler) handler).getTopicMap();
+ }
}
/**
Modified: tinytim-mio/trunk/src/main/java/org/tinytim/mio/internal/ctm/impl/DefaultTMCLPreprocessor.java
===================================================================
--- tinytim-mio/trunk/src/main/java/org/tinytim/mio/internal/ctm/impl/DefaultTMCLPreprocessor.java 2009-08-14 11:43:24 UTC (rev 347)
+++ tinytim-mio/trunk/src/main/java/org/tinytim/mio/internal/ctm/impl/DefaultTMCLPreprocessor.java 2009-08-14 11:59:23 UTC (rev 348)
@@ -22,7 +22,6 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
-import java.util.logging.Logger;
import org.tinytim.core.value.Literal;
import org.tinytim.internal.api.IIndexManagerAware;
@@ -48,11 +47,6 @@
*/
public class DefaultTMCLPreprocessor implements ITMCLPreprocessor {
- @SuppressWarnings("unused")
- // TODO can we remove it, if we don't use it?
- private static final Logger LOG = Logger
- .getLogger(DefaultTMCLPreprocessor.class.getName());
-
private final Map<Topic, Collection<ITemplate>> _topic2Templates;
private Topic _constrains;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <lh...@us...> - 2009-08-14 11:43:37
|
Revision: 347
http://tinytim.svn.sourceforge.net/tinytim/?rev=347&view=rev
Author: lheuer
Date: 2009-08-14 11:43:24 +0000 (Fri, 14 Aug 2009)
Log Message:
-----------
- Added package visible getter to tinytim/mio/TinyTimMapInputHandler to retrieve the topic map
- Added tmdm:subject
- Added docs to TMCL and deprecated some constants
Modified Paths:
--------------
tinytim/trunk/src/main/java/org/tinytim/mio/TinyTimMapInputHandler.java
tinytim/trunk/src/main/java/org/tinytim/voc/TMCL.java
tinytim/trunk/src/main/java/org/tinytim/voc/TMDM.java
Modified: tinytim/trunk/src/main/java/org/tinytim/mio/TinyTimMapInputHandler.java
===================================================================
--- tinytim/trunk/src/main/java/org/tinytim/mio/TinyTimMapInputHandler.java 2009-08-13 12:40:55 UTC (rev 346)
+++ tinytim/trunk/src/main/java/org/tinytim/mio/TinyTimMapInputHandler.java 2009-08-14 11:43:24 UTC (rev 347)
@@ -100,6 +100,15 @@
_delayedItemIdentifiers = CollectionFactory.createIdentityMap(_DELAYED_ITEM_IDENTIFIER_SIZE);
}
+ /**
+ * Returns the underlying topic map.
+ *
+ * @return The topic map this handler operates upon.
+ */
+ TopicMap getTopicMap() {
+ return _tm;
+ }
+
/* (non-Javadoc)
* @see com.semagia.mio.IMapHandler#startTopicMap()
*/
Modified: tinytim/trunk/src/main/java/org/tinytim/voc/TMCL.java
===================================================================
--- tinytim/trunk/src/main/java/org/tinytim/voc/TMCL.java 2009-08-13 12:40:55 UTC (rev 346)
+++ tinytim/trunk/src/main/java/org/tinytim/voc/TMCL.java 2009-08-14 11:43:24 UTC (rev 347)
@@ -20,7 +20,7 @@
/**
* Constants for TMCL PSIs.
* <p>
- * These PSIs are not stable yet.
+ * CAUTION: These PSIs are not stable yet.
* </p>
*
* @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a>
@@ -35,107 +35,417 @@
private static final String _BASE = Namespace.TMCL;
- // Topic types
+ /**
+ * Core concept of a constraint.
+ *
+ * Used as constraint (topic) type.
+ */
+ public static final Locator CONSTRAINT = _createLocator(_BASE + "constraint");
+
+ /*
+ * Topic types
+ *
+ * c.f. 6. TMCL Declarations
+ */
+ /**
+ * Indicates that a topic may be used as a topic type.
+ *
+ * Used as topic type.
+ */
public static final Locator TOPIC_TYPE = _createLocator(_BASE + "topic-type");
+ /**
+ * Indicates that a topic may be used as association type.
+ *
+ * Used as topic type.
+ */
public static final Locator ASSOCIATION_TYPE = _createLocator(_BASE + "association-type");
+ /**
+ * Indicates that a topic may be used as role type.
+ *
+ * Used as topic type.
+ */
public static final Locator ROLE_TYPE = _createLocator(_BASE + "role-type");
+ /**
+ * Indicates that a topic may be used as occurrence type.
+ *
+ * Used as topic type.
+ */
public static final Locator OCCURRENCE_TYPE = _createLocator(_BASE + "occurrence-type");
+ /**
+ * Indicates that a topic may be used as name type.
+ *
+ * Used as topic type.
+ */
public static final Locator NAME_TYPE = _createLocator(_BASE + "name-type");
+ /**
+ * The tmcl:overlap-declaration is used to declare that the sets of
+ * instances of two or more topic types are non-disjoint (that is, that
+ * they may overlap).
+ * The default is that the instance sets of different topic types are
+ * disjoint.
+ *
+ * Used as topic type.
+ */
+ public static final Locator OVERLAP_DECLARATION = _createLocator(_BASE + "overlap-declaration");
+
+ @Deprecated
+ //FIXME: What's the replacement for this PSI?
public static final Locator SCOPE_TYPE = _createLocator(_BASE + "scope-type");
+
+ /*
+ * Constraint types
+ * c.f. 7 TMCL Constraint Types
+ */
+
+ /**
+ * The tmcl:abstract-constraint provides a way to express that a given topic
+ * type must not have any direct instances
+ *
+ * Used as constraint (topic) type.
+ *
+ * See 7.2 Abstract Topic Type Constraint
+ */
+ public static final Locator ABSTRACT_CONSTRAINT = _createLocator(_BASE + "abstract-constraint");
+
+ /**
+ * Use {@link #ABSTRACT_CONSTRAINT}
+ */
+ @Deprecated
+ public static final Locator ABSTRACT_TOPIC_TYPE_CONSTRAINT = ABSTRACT_CONSTRAINT;
+
+ /**
+ *
+ *
+ * Used as association type.
+ *
+ * See 7.2 Abstract Topic Type Constraint
+ */
+ public static final Locator CONSTRAINED_TOPIC_TYPE = _createLocator(_BASE + "constrained-topic-type");
+
+ /**
+ * A subject identifier constraint provides a way to constrain the subject
+ * identifiers of instances of a given topic type.
+ *
+ * Used as constraint (topic) type.
+ *
+ * See 7.3 Subject Identifier Constraint
+ */
+ public static final Locator SUBJECT_IDENTIFIER_CONSTRAINT = _createLocator(_BASE + "subject-identifier-constraint");
+
+ /**
+ * A subject locator constraint provides a way to constrain the subject
+ * locators of instances of a given topic type.
+ *
+ * Used as constraint (topic) type.
+ *
+ * See 7.4 Subject Locator Constraint
+ */
+ public static final Locator SUBJECT_LOCATOR_CONSTRAINT = _createLocator(_BASE + "subject-locator-constraint");
+
+
+ /**
+ * A topic name constraint provides a way to constrain the type and
+ * cardinality of topic names for instances of a given topic type.
+ *
+ * Used as constraint (topic) type.
+ *
+ * See 7.5 Topic Name Constraint
+ */
+ public static final Locator TOPIC_NAME_CONSTRAINT = _createLocator(_BASE + "topic-name-constraint");
+
+ /**
+ * A topic occurrence constraint defines a way to constrain the type and
+ * cardinality of occurrences connected to a topic of a given type.
+ *
+ * Used as constraint (topic) type.
+ *
+ * See 7.6 Topic Occurrence Constraint
+ */
+ public static final Locator TOPIC_OCCURRENCE_CONSTRAINT = _createLocator(_BASE + "topic-occurrence-constraint");
+
+ /**
+ * A topic role constraint constrains the types of roles topics of a given
+ * type can play in associations of a given type.
+ * It can also be seen as constraining the types of topics which may play
+ * roles of a given type in associations of a given type.
+ *
+ * Used as constraint (topic) type.
+ *
+ * See 7.7 Topic Role Constraint
+ */
+ public static final Locator TOPIC_ROLE_CONSTRAINT = _createLocator(_BASE + "topic-role-constraint");
+
+ /**
+ * Use {@link #TOPIC_ROLE_CONSTRAINT}.
+ */
+ @Deprecated
+ public static final Locator ROLE_PLAYER_CONSTRAINT = TOPIC_ROLE_CONSTRAINT;
+
+ /**
+ * Constrains the types of topics which may appear in the scope of a name,
+ * occurrence, or association of a particular type.
+ *
+ * Used as constraint (topic) type.
+ *
+ * See 7.8 Scope Constraint.
+ */
+ public static final Locator SCOPE_CONSTRAINT = _createLocator(_BASE + "scope-constraint");
+
+ /**
+ * Constrains whether or not names, occurrence, and associations of a given
+ * type may be reified, and if so, what the type of the reifying topic must
+ * be.
+ *
+ * Used as constraint (topic) type.
+ *
+ * See 7.9 Reifier Constraint
+ */
+ public static final Locator REIFIER_CONSTRAINT = _createLocator(_BASE + "reifier-constraint");
+
+ /**
+ * Constrains what types of statements topics of a given type may reify.
+ *
+ * Used as constraint (topic) type.
+ *
+ * See 7.10 Topic Reifies Constraint
+ */
+ public static final Locator TOPIC_REIFIES_CONSTRAINT = _createLocator(_BASE + "topic-reifies-constraint");
+
+ /**
+ * Constrains the number of roles of a particular type that may appear in
+ * associations of a given type.
+ *
+ * Used as constraint (topic) type.
+ *
+ * See 7.11 Association Role Constraint
+ */
+ public static final Locator ASSOCIATION_ROLE_CONSTRAINT = _createLocator(_BASE + "association-role-constraint");
+
+ /**
+ * Provides a way to restrict which combinations of topic types are allowed
+ * to appear in associations of a certain type together.
+ *
+ * Used as constraint (topic) type.
+ *
+ * See 7.12 Role Combination Constraint
+ */
+ public static final Locator ROLE_COMBINATION_CONSTRAINT = _createLocator(_BASE + "role-combination-constraint");
+
+ /**
+ * Provides a way to constrain the allowed datatype of an occurrence of a
+ * given type.
+ *
+ * Used as constraint (topic) type.
+ *
+ * See 7.13 Occurrence Data Type Constraint.
+ */
+ public static final Locator OCCURRENCE_DATATYPE_CONSTRAINT = _createLocator(_BASE + "occurrence-datatype-constraint");
+
+ /**
+ * Provides a way to require all names or occurrences of a given type to
+ * have different values.
+ *
+ * Used as constraint (topic) type.
+ *
+ * See 7.14 Unique Value Constraint
+ */
+ public static final Locator UNIQUE_VALUE_CONSTRAINT = _createLocator(_BASE + "unique-value-constraint");
+
+ /**
+ * Provides a mechanism for requiring that all values of a given name or
+ * occurrence type must match a given regular expression.
+ *
+ * Used as constraint (topic) type.
+ *
+ * See 7.15 Regular Expression Constraint
+ */
+ public static final Locator REGULAR_EXPRESSION_CONSTRAINT = _createLocator(_BASE + "regular-expression-constraint");
+
+
// Role types
+ /**
+ *
+ * Used as role type.
+ */
public static final Locator ALLOWS = _createLocator(_BASE + "allows");
+ /**
+ *
+ * Used as role type.
+ */
public static final Locator ALLOWED = _createLocator(_BASE + "allowed");
+ /**
+ *
+ * Used as role type.
+ */
public static final Locator CONSTRAINS = _createLocator(_BASE + "constrains");
+ /**
+ *
+ * Used as role type.
+ */
public static final Locator CONSTRAINED = _createLocator(_BASE + "constrained");
+ /**
+ *
+ * Used as role type.
+ */
public static final Locator CONTAINER = _createLocator(_BASE + "container");
+ /**
+ *
+ * Used as role type.
+ */
public static final Locator CONTAINEE = _createLocator(_BASE + "containee");
- // Association types - applies-to is no more
- public static final Locator CONSTRAINED_TOPIC_TYPE = _createLocator(_BASE + "constrained-topic-type");
-
+ /*
+ * Association types
+ */
+
+ /**
+ *
+ * Used as association type.
+ */
public static final Locator CONSTRAINED_STATEMENT = _createLocator(_BASE + "constrained-statement");
+ /**
+ *
+ * Used as association type.
+ */
public static final Locator CONSTRAINED_ROLE = _createLocator(_BASE + "constrained-role");
+ /**
+ *
+ * Used as association type.
+ */
public static final Locator OVERLAPS = _createLocator(_BASE + "overlaps");
+ /**
+ *
+ * Used as association type.
+ */
public static final Locator ALLOWED_SCOPE = _createLocator(_BASE + "allowed-scope");
+ /**
+ *
+ * Used as association type.
+ */
public static final Locator ALLOWED_REIFIER = _createLocator(_BASE + "allowed-reifier");
+ /**
+ *
+ * Used as association type.
+ */
public static final Locator OTHER_CONSTRAINED_TOPIC_TYPE = _createLocator(_BASE + "other-constrained-topic-type");
+ /**
+ *
+ * Used as association type.
+ */
public static final Locator OTHER_CONSTRAINED_ROLE = _createLocator(_BASE + "other-constrained-role");
+ /**
+ *
+ * Used as association type.
+ */
public static final Locator BELONGS_TO_SCHEMA = _createLocator(_BASE + "belongs-to-schema");
// Model topics
- public static final Locator SCHEMA = _createLocator(_BASE + "schema");
-
- public static final Locator CONSTRAINT = _createLocator(_BASE + "constraint");
-
public static final Locator VALIDATION_EXPRESSION = _createLocator(_BASE + "validation-expression");
+ /**
+ * Indicates a minimum cardinality.
+ *
+ * Used as occurrence type.
+ */
public static final Locator CARD_MIN = _createLocator(_BASE + "card-min");
+ /**
+ * Indicates a maximum cardinality.
+ *
+ * Used as occurrence type.
+ */
public static final Locator CARD_MAX = _createLocator(_BASE + "card-max");
+ /**
+ * Used to define a regular expression.
+ *
+ * Used as occurrence type.
+ */
public static final Locator REGEXP = _createLocator(_BASE + "regexp");
+ /**
+ * Used to define the datatype (an IRI) of an occurrence or variant.
+ *
+ * Used as occurrence type.
+ */
public static final Locator DATATYPE = _createLocator(_BASE + "datatype");
-
- public static final Locator VERSION = _createLocator(_BASE + "version");
- public static final Locator DESCRIPTION = _createLocator(_BASE + "description");
+ /*
+ * 10 Schema Documentation.
+ */
- public static final Locator COMMENT = _createLocator(_BASE + "comment");
+ /**
+ *
+ * Used as topic type.
+ *
+ * See 10.2 The Schema Topic
+ */
+ public static final Locator SCHEMA = _createLocator(_BASE + "schema");
- public static final Locator SEE_ALSO = _createLocator(_BASE + "see-also");
-
- // Constraint types
+ /**
+ * Used to attach some identifier of the schema's version to the schema
+ * topic.
+ *
+ * Used as occurrence type.
+ * See 10.2 The Schema Topic
+ */
+ public static final Locator VERSION = _createLocator(_BASE + "version");
- public static final Locator ABSTRACT_TOPIC_TYPE_CONSTRAINT = _createLocator(_BASE + "abstract-constraint");
- public static final Locator OVERLAP_DECLARATION = _createLocator(_BASE + "overlap-declaration");
+ /*
+ * 10.3 Documentation Occurrences
+ */
- public static final Locator SUBJECT_IDENTIFIER_CONSTRAINT = _createLocator(_BASE + "subject-identifier-constraint");
-
- public static final Locator SUBJECT_LOCATOR_CONSTRAINT = _createLocator(_BASE + "subject-locator-constraint");
+ /**
+ * Used to attach a textual description of a TMCL construct to it inside
+ * the topic map.
+ *
+ * Used as occurrence type.
+ *
+ * See 10.3 Documentation Occurrences
+ */
+ public static final Locator DESCRIPTION = _createLocator(_BASE + "description");
- public static final Locator TOPIC_NAME_CONSTRAINT = _createLocator(_BASE + "topic-name-constraint");
+ /**
+ * Used to attach any textual information to a TMCL construct inside the
+ * topic map.
+ *
+ * Used as occurrence type.
+ *
+ * See 10.3 Documentation Occurrences
+ */
+ public static final Locator COMMENT = _createLocator(_BASE + "comment");
- public static final Locator TOPIC_OCCURRENCE_CONSTRAINT = _createLocator(_BASE + "topic-occurrence-constraint");
-
- public static final Locator ROLE_PLAYER_CONSTRAINT = _createLocator(_BASE + "role-player-constraint");
-
- public static final Locator SCOPE_CONSTRAINT = _createLocator(_BASE + "scope-constraint");
-
- public static final Locator REIFIER_CONSTRAINT = _createLocator(_BASE + "reifier-constraint");
+ /**
+ * Used to attach a to a TMCL construct a reference to any kind of external
+ * information about that construct.
+ *
+ * Used as occurrence type.
+ *
+ * See 10.3 Documentation Occurrences
+ */
+ public static final Locator SEE_ALSO = _createLocator(_BASE + "see-also");
- public static final Locator TOPIC_REIFIES_CONSTRAINT = _createLocator(_BASE + "topic-reifies-constraint");
-
- public static final Locator ASSOCIATION_ROLE_CONSTRAINT = _createLocator(_BASE + "association-role-constraint");
-
- public static final Locator ROLE_COMBINATION_CONSTRAINT = _createLocator(_BASE + "role-combination-constraint");
-
- public static final Locator OCCURRENCE_DATATYPE_CONSTRAINT = _createLocator(_BASE + "occurrence-datatype-constraint");
-
- public static final Locator UNIQUE_VALUE_CONSTRAINT = _createLocator(_BASE + "unique-value-constraint");
-
- public static final Locator REGULAR_EXPRESSION_CONSTRAINT = _createLocator(_BASE + "regular-expression-constraint");
}
Modified: tinytim/trunk/src/main/java/org/tinytim/voc/TMDM.java
===================================================================
--- tinytim/trunk/src/main/java/org/tinytim/voc/TMDM.java 2009-08-13 12:40:55 UTC (rev 346)
+++ tinytim/trunk/src/main/java/org/tinytim/voc/TMDM.java 2009-08-14 11:43:24 UTC (rev 347)
@@ -1,5 +1,5 @@
/*
- * Copyright 2008 Lars Heuer (heuer[at]semagia.com)
+ * Copyright 2008 - 2009 Lars Heuer (heuer[at]semagia.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,8 +20,6 @@
/**
* Constants for TMDM 1.0 (model) PSIs.
*
- * Copied with permission from the Semagia MIO project.
- *
* @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a>
* @version $Rev$ - $Date$
*/
@@ -34,6 +32,11 @@
private static final String _BASE = Namespace.TMDM_MODEL;
/**
+ * Core concept of a subject.
+ */
+ public static final Locator SUBJECT = _createLocator(_BASE + "subject");
+
+ /**
* Core concept of type-instance relationships.
* Used as association type.
*/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <lh...@us...> - 2009-08-13 12:41:14
|
Revision: 346
http://tinytim.svn.sourceforge.net/tinytim/?rev=346&view=rev
Author: lheuer
Date: 2009-08-13 12:40:55 +0000 (Thu, 13 Aug 2009)
Log Message:
-----------
${dist.name} was referenced before assignment
Modified Paths:
--------------
tinytim-mio/trunk/build.xml
Modified: tinytim-mio/trunk/build.xml
===================================================================
--- tinytim-mio/trunk/build.xml 2009-08-13 11:30:15 UTC (rev 345)
+++ tinytim-mio/trunk/build.xml 2009-08-13 12:40:55 UTC (rev 346)
@@ -11,10 +11,8 @@
<property name="dir.lib" value="${basedir}/lib"/>
<property name="dir.build" value="${basedir}/build"/>
<property name="dir.dist.root" value="${dir.build}/dist"/>
- <property name="dir.dist" value="${dir.dist.root}/${dist.name}"/>
<property name="dir.build.classes" value="${dir.build}/classes"/>
<property name="dir.build.tests" value="${dir.build}/tests"/>
- <property name="dir.javadocs" value="${dir.dist}/docs/api"/>
<!-- Libs -->
<property name="lib.jing" value="${dir.lib}/jing.jar"/>
@@ -81,6 +79,9 @@
<property name="dist.version" value="${version}${version_suffix}${release_type}"/>
<property name="dist.name" value="tinytim-mio-${dist.version}"/>
+ <property name="dir.dist" value="${dir.dist.root}/${dist.name}"/>
+ <property name="dir.javadocs" value="${dir.dist}/docs/api"/>
+
<property name="tinytim-mio.jar" value="${dist.name}.jar"/>
<property name="tinytim-mio.tar" value="${dist.name}.tar"/>
<property name="tinytim-mio.tar.gz" value="${tinytim-mio.tar}.gz"/>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <lh...@us...> - 2009-08-13 11:30:29
|
Revision: 345
http://tinytim.svn.sourceforge.net/tinytim/?rev=345&view=rev
Author: lheuer
Date: 2009-08-13 11:30:15 +0000 (Thu, 13 Aug 2009)
Log Message:
-----------
Added pre-defined pathes and wildcards to match any tinyTiM snapshot
Modified Paths:
--------------
tinytim-mio/trunk/build.xml
Modified: tinytim-mio/trunk/build.xml
===================================================================
--- tinytim-mio/trunk/build.xml 2009-08-12 11:54:51 UTC (rev 344)
+++ tinytim-mio/trunk/build.xml 2009-08-13 11:30:15 UTC (rev 345)
@@ -4,18 +4,21 @@
<tstamp/>
<property name="release_type" value="-snapshot-${DSTAMP}${TSTAMP}"/>
+ <!-- Directories -->
<property name="dir.src" value="${basedir}/src/main/java"/>
<property name="dir.test" value="${basedir}/src/test/java"/>
<property name="dir.cxtm" value="${basedir}/src/test/cxtm/"/>
<property name="dir.lib" value="${basedir}/lib"/>
+ <property name="dir.build" value="${basedir}/build"/>
+ <property name="dir.dist.root" value="${dir.build}/dist"/>
+ <property name="dir.dist" value="${dir.dist.root}/${dist.name}"/>
+ <property name="dir.build.classes" value="${dir.build}/classes"/>
+ <property name="dir.build.tests" value="${dir.build}/tests"/>
+ <property name="dir.javadocs" value="${dir.dist}/docs/api"/>
+ <!-- Libs -->
+ <property name="lib.jing" value="${dir.lib}/jing.jar"/>
<property name="lib.junit" value="${dir.lib}/junit-4.5.jar"/>
- <property name="lib.tmapi" value="${dir.lib}/tmapi-2.0a2.jar"/>
- <property name="lib.tinytim" value="${dir.lib}/tinytim-2.0.0a6-snapshot-200908121355.jar"/>
- <property name="lib.tinytim.tests" value="${dir.lib}/tinytim-2.0.0a5-tests.jar"/>
- <property name="lib.logging" value="${dir.lib}/slf4j-api-1.5.8.jar"/>
- <property name="lib.logger" value="${dir.lib}/slf4j-jdk14-1.5.8.jar"/>
- <property name="lib.jing" value="${dir.lib}/jing.jar"/>
<property name="lib.mio" value="${dir.lib}/semagia-mio-0.9.4.jar"/>
<property name="lib.jtm" value="${dir.lib}/semagia-mio-jtm-0.9.3.jar"/>
<property name="lib.ltm" value="${dir.lib}/semagia-mio-ltm-0.9.5.jar"/>
@@ -24,6 +27,44 @@
<property name="lib.tmxml" value="${dir.lib}/semagia-mio-tmxml-0.9.3.jar"/>
<property name="lib.xtm" value="${dir.lib}/semagia-mio-xtm-0.9.5.jar"/>
+ <!-- tinyTiM and TMAPI libs -->
+ <path id="libs.tinytim">
+ <fileset dir="${dir.lib}">
+ <include name="tmapi-2.*.jar"/>
+ <include name="tinytim-*.jar"/>
+ </fileset>
+ </path>
+
+ <!-- The mio libs incl. dependencies -->
+ <path id="libs.mio">
+ <!-- Logging -->
+ <fileset dir="${dir.lib}">
+ <include name="slf4j-*"/>
+ </fileset>
+ <!-- Validation -->
+ <pathelement location="${lib.jing}"/>
+ <!-- The mio libs -->
+ <pathelement location="${lib.mio}"/>
+ <pathelement location="${lib.jtm}"/>
+ <pathelement location="${lib.ltm}"/>
+ <pathelement location="${lib.rdf}"/>
+ <pathelement location="${lib.snello}"/>
+ <pathelement location="${lib.tmxml}"/>
+ <pathelement location="${lib.xtm}"/>
+ </path>
+
+ <path id="path.compile">
+ <path refid="libs.tinytim"/>
+ <path refid="libs.mio"/>
+ </path>
+
+ <path id="path.test">
+ <path refid="path.compile"/>
+ <pathelement location="${lib.junit}"/>
+ <pathelement location="${dir.build.classes}"/>
+ <pathelement location="${dir.build.tests}"/>
+ </path>
+
<target name="help">
<echo message="------------------------"/>
<echo message="tinyTiM MIO - Build file"/>
@@ -44,13 +85,6 @@
<property name="tinytim-mio.tar" value="${dist.name}.tar"/>
<property name="tinytim-mio.tar.gz" value="${tinytim-mio.tar}.gz"/>
<property name="tinytim-mio.zip" value="${dist.name}.zip"/>
-
- <property name="dir.build" value="${basedir}/build"/>
- <property name="dir.dist.root" value="${dir.build}/dist"/>
- <property name="dir.dist" value="${dir.dist.root}/${dist.name}"/>
- <property name="dir.build.classes" value="${dir.build}/classes"/>
- <property name="dir.build.tests" value="${dir.build}/tests"/>
- <property name="dir.javadocs" value="${dir.dist}/docs/api"/>
</target>
<!-- =================================================================== -->
@@ -105,37 +139,13 @@
optimize="${optimize}"
target="1.5"
>
- <classpath>
- <pathelement location="${dir.build.classes}"/>
- <pathelement location="${lib.junit}"/>
- <pathelement location="${lib.tmapi}"/>
- <pathelement location="${lib.tinytim}"/>
- <pathelement location="${lib.tinytim.tests}"/>
- <pathelement location="${lib.mio}"/>
- </classpath>
+ <classpath refid="path.test"/>
<src path="${dir.test}"/>
</javac>
<junit printsummary="true" showoutput="false"
errorProperty="test.failed" failureProperty="test.failed">
<sysproperty key="org.tinytim.cxtm-test-dir" value="${dir.cxtm}"/>
- <classpath>
- <pathelement location="${dir.build.classes}"/>
- <pathelement location="${dir.build.tests}"/>
- <pathelement location="${lib.junit}"/>
- <pathelement location="${lib.tmapi}"/>
- <pathelement location="${lib.tinytim}"/>
- <pathelement location="${lib.tinytim.tests}"/>
- <pathelement location="${lib.logging}"/>
- <pathelement location="${lib.logger}"/>
- <pathelement location="${lib.jing}"/>
- <pathelement location="${lib.mio}"/>
- <pathelement location="${lib.jtm}"/>
- <pathelement location="${lib.ltm}"/>
- <pathelement location="${lib.rdf}"/>
- <pathelement location="${lib.snello}"/>
- <pathelement location="${lib.tmxml}"/>
- <pathelement location="${lib.xtm}"/>
- </classpath>
+ <classpath refid="path.test"/>
<formatter type="brief" usefile="false"/>
<test name="org.tinytim.mio.AllTests"/>
</junit>
@@ -150,13 +160,7 @@
debug="${debug}"
target="1.5"
>
- <classpath>
- <pathelement location="${lib.tmapi}"/>
- <pathelement location="${lib.tinytim}"/>
- <pathelement location="${lib.tinytim.tests}"/>
- <pathelement location="${lib.mio}"/>
- <pathelement location="${lib.logging}"/>
- </classpath>
+ <classpath refid="path.compile"/>
<src path="${dir.src}"/>
</javac>
</target>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|