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.Serializable
A 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 MapRule
copy()
boolean
equals(java.lang.Object obj)
Indicates whether some other MapRule is "equal to" this one.java.util.regex.Pattern
getCompiledPattern()
Returns Compiled Pattern for the language/country ISO code (of a form LL-CC).java.lang.String
getLanguage()
Returns Language Name (to display it in a dialog).java.lang.String
getLanguageCode()
Returns Language Code for programmatic usage.java.lang.String
getPattern()
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 languageint
hashCode()
Returns a hash code value for the object.void
setLanguage(java.lang.String language)
Sets Language Namevoid
setPattern(java.lang.String pattern)
Sets Pattern for the language/country ISO code (of a form LL-CC).void
setRules(java.util.List<Rule> rules)
Sets List of rules (of classRule
) for the languagejava.lang.String
toString()
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.PatternSyntaxException
Sets 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:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
Returns a hash code value for the object.- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
Returns a string representation of the MapRule for debugging purposes.- Overrides:
toString
in classjava.lang.Object
-
-