Class RsLangs
java.lang.Object
org.apache.uima.analysis_engine.impl.RsLangs
A set of languages, each represented by a canonical string object
The set is stored without any subsumed elements
Instances of this class are shareable
Duplicate-on-update strategy
Requires that all update operations to it return the
possibly new RsLangs object, and that calls are always of the form
rsLangInstance = rsLangInstance.[some-update-operation]
Requires that all copy operations set the shared bit:
copiedInstance = origInstance.setShared();
A instance marked isShared == true is immutable
Updates cause duplication.
Users store x-unspecified as null for the rsLangs instance
Because of this, users use static methods, passing in as the first argument,
the value of rsLangs, and getting an updated value of rsLangs.
This allows the passed-in value to be null.
Languages kept in canonical form:
duplicates removed
subsumed languages removed
language strings mapped to unique strings (allowing == comparisons)
Languages kept in array list, to allow for expansion
Languages not removed, only added (for a given tof)
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static RsLangsadd language unless it's subsumed by existing one remove any languages the newly added one subsumes store x-unspec as null(package private) static RsLangs(package private) static RsLangs(package private) static RsLangscreateOrNull(String[] languages) (package private) static RsLangscreateOrNull(RsLangs rsl) (package private) static RsLangsbooleanThis must return true ignoring the value of isShared, and treating the lists as a setprivate static StringgetBaseLanguage(String language) inthashCode()Must return the same hashcode regardless of the value of isShared, and treating the values as a set(package private) RsLangs(package private) static booleanprivate voidremoveSubsumedLanguages(String canonicalLang, String baseLang) Remove languages that are subsumed by the argument If all removed, keep as empty list(package private) static RsLangsreplaceAll(RsLangs rsl, String[] langs) (package private) void(package private) static booleanprivate static booleansubsumesCanonical(String containingLang, String langToTest, String langToTestBase) (package private) static booleansubsumesCanonical(RsLangs rsl, String lang) private static booleansubsumesCanonical(RsLangs rsl, String lang, String baseLang) (package private) static String[]toString()
-
Field Details
-
languages
-
-
Constructor Details
-
RsLangs
private RsLangs() -
RsLangs
-
-
Method Details
-
createSharableEmpty
-
toString
-
createOrNull
-
createOrNull
-
isEmpty
-
subsumes
-
subsumesCanonical
-
subsumesCanonical
-
subsumesCanonical
-
getBaseLanguage
-
replaceAll
-
addAll
-
addAll
-
add
-
removeSubsumedLanguages
-
intersect
-
toArray
-
hashCode
-
equals
-