Package org.omegat.core.segmentation
Class MapRule
- java.lang.Object
-
- org.omegat.core.segmentation.MapRule
-
- All Implemented Interfaces:
java.io.Serializable
public class MapRule extends java.lang.Object implements java.io.SerializableA class representing the language rules and their mapping to the segmentation rules for each particular language.- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MapRulecopy()booleanequals(java.lang.Object obj)Indicates whether some other MapRule is "equal to" this one.java.util.regex.PatterngetCompiledPattern()Returns Compiled Pattern for the language/country ISO code (of a form LL-CC).java.lang.StringgetLanguage()Returns Language Name (to display it in a dialog).java.lang.StringgetLanguageCode()Returns Language Code for programmatic usage.java.lang.StringgetPattern()Returns Pattern for the language/country ISO code (of a form LL-CC).java.util.List<Rule>getRules()Returns List of rules (of classRule) for the languageinthashCode()Returns a hash code value for the object.voidsetLanguage(java.lang.String language)Sets Language NamevoidsetPattern(java.lang.String pattern)Sets Pattern for the language/country ISO code (of a form LL-CC).voidsetRules(java.util.List<Rule> rules)Sets List of rules (of classRule) for the languagejava.lang.StringtoString()Returns a string representation of the MapRule for debugging purposes.
-
-
-
Constructor Detail
-
MapRule
public MapRule()
creates a new empty MapRule
-
MapRule
public MapRule(java.lang.String language, java.lang.String pattern, java.util.List<Rule> rules)creates an initialized MapRule
-
-
Method Detail
-
getLanguage
public java.lang.String getLanguage()
Returns Language Name (to display it in a dialog).
-
setLanguage
public void setLanguage(java.lang.String language)
Sets Language Name
-
getLanguageCode
public java.lang.String getLanguageCode()
Returns Language Code for programmatic usage.
-
getPattern
public java.lang.String getPattern()
Returns Pattern for the language/country ISO code (of a form LL-CC).
-
getCompiledPattern
public java.util.regex.Pattern getCompiledPattern()
Returns Compiled Pattern for the language/country ISO code (of a form LL-CC).
-
setPattern
public void setPattern(java.lang.String pattern) throws java.util.regex.PatternSyntaxExceptionSets Pattern for the language/country ISO code (of a form LL-CC).- Throws:
java.util.regex.PatternSyntaxException
-
copy
public MapRule copy()
-
getRules
public java.util.List<Rule> getRules()
Returns List of rules (of classRule) for the language
-
setRules
public void setRules(java.util.List<Rule> rules)
Sets List of rules (of classRule) for the language
-
equals
public boolean equals(java.lang.Object obj)
Indicates whether some other MapRule is "equal to" this one.- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
Returns a hash code value for the object.- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
Returns a string representation of the MapRule for debugging purposes.- Overrides:
toStringin classjava.lang.Object
-
-