diff options
author | Ian Johnson <ian.johnson@appliedlanguage.com> | 2013-02-21 15:07:49 +0400 |
---|---|---|
committer | Ian Johnson <ian.johnson@appliedlanguage.com> | 2013-02-21 15:07:49 +0400 |
commit | 4631e2a8ff7413d252052c604bea8e12d8302524 (patch) | |
tree | ca64cd8230862194f44cc3e079379b3786431ba7 | |
parent | 70018a06297ffaeeb3e7b4d3de473812be2daf97 (diff) |
Version 1.1 of the reference implementation is compliant with v0.5.0-DRAFT of the OMTC standard.
-rw-r--r-- | documentation/omtc.v0.5.0-DRAFT.pdf (renamed from documentation/omtc.v0.4.3-DRAFT.pdf) | bin | 431207 -> 429648 bytes | |||
-rw-r--r-- | pom.xml | 2 | ||||
-rw-r--r-- | src/main/java/com/capitati/omtc/core/translation/Translator.java | 50 |
3 files changed, 47 insertions, 5 deletions
diff --git a/documentation/omtc.v0.4.3-DRAFT.pdf b/documentation/omtc.v0.5.0-DRAFT.pdf Binary files differindex 70b646e..a5cd503 100644 --- a/documentation/omtc.v0.4.3-DRAFT.pdf +++ b/documentation/omtc.v0.5.0-DRAFT.pdf @@ -5,7 +5,7 @@ <groupId>com.capitati.omtc</groupId> <artifactId>omtc-core</artifactId> - <version>1.0</version> + <version>1.1</version> <packaging>jar</packaging> <name>omtc</name> diff --git a/src/main/java/com/capitati/omtc/core/translation/Translator.java b/src/main/java/com/capitati/omtc/core/translation/Translator.java index f93dbd5..8f36b04 100644 --- a/src/main/java/com/capitati/omtc/core/translation/Translator.java +++ b/src/main/java/com/capitati/omtc/core/translation/Translator.java @@ -18,11 +18,16 @@ */ package com.capitati.omtc.core.translation; +import java.net.URI; +import java.util.Date; import java.util.HashSet; import java.util.Set; +import java.util.UUID; import com.capitati.omtc.core.engine.IEngine; +import com.capitati.omtc.core.resources.IDerivedResource; import com.capitati.omtc.core.resources.IPrimaryResource; +import com.capitati.omtc.core.resources.IResource; import com.capitati.omtc.core.scheduling.IPriority; import com.capitati.omtc.core.scheduling.ITicketObserver; import com.capitati.omtc.core.scheduling.TranslationTicket; @@ -37,36 +42,73 @@ import com.google.common.base.Predicate; * * @param <P> - the type of the priority's value. */ -public abstract class Translator<V, T extends IPrimaryResource, G extends IPrimaryResource> { +public abstract class Translator<V, T extends IPrimaryResource, G extends IPrimaryResource> +implements IDerivedResource { + private final UUID identifier; + private final URI location; + private final Date birthDate; private final IEngine engine; private final Set<G> glossaries = new HashSet<G>(); private final Set<T> translationMemories = new HashSet<T>(); - protected Translator(final IEngine theEngine) { + protected Translator( + final UUID theIdentifier, + final URI theLocation, + final Date theBirthDate, + final IEngine theEngine) { super(); + identifier = theIdentifier; + location = theLocation; + birthDate = theBirthDate; engine = theEngine; } protected Translator( + final UUID theIdentifier, + final URI theLocation, + final Date theBirthDate, final IEngine theEngine, final Set<G> theGlossaries, final Set<T> theTranslationMemories) { super(); + identifier = theIdentifier; + location = theLocation; + birthDate = theBirthDate; engine = theEngine; glossaries.addAll(theGlossaries); translationMemories.addAll(theTranslationMemories); } + public UUID getIdentifier() { + return identifier; + } + + public URI getURI() { + return location; + } + + public Date getBirthDate() { + return birthDate; + } + + public Set<IResource> getCreationResources() { + final Set<IResource> creationResources = new HashSet<IResource>(glossaries); + + creationResources.addAll(translationMemories); + + return creationResources; + } + public IEngine getEngine() { return engine; } public Set<G> getGlossaries() { - return glossaries; + return new HashSet<G>(glossaries); } public Set<T> getTranslationMemories() { - return translationMemories; + return new HashSet<T>(translationMemories); } /** |