public class Rule
extends java.lang.Object
implements java.io.Serializable
Constructor and Description |
---|
Rule()
Creates a new empty instance of segmentation rule
|
Rule(boolean breakRule,
java.lang.String beforebreak,
java.lang.String afterbreak)
Creates an initialized instance of segmentation rule
|
Modifier and Type | Method and Description |
---|---|
Rule |
copy() |
boolean |
equals(java.lang.Object obj)
Indicates whether some other Rule is "equal to" this one.
|
java.lang.String |
getAfterbreak()
Returns a regular expression which represents the text that appears after
a segment break.
|
java.lang.String |
getBeforebreak()
Returns a regular expression which represents the text that appears
before a segment break.
|
java.util.regex.Pattern |
getCompiledAfterbreak()
Returns a regular expression which represents the text that appears after
a segment break.
|
java.util.regex.Pattern |
getCompiledBeforebreak()
Returns a regular expression which represents the text that appears
before a segment break.
|
int |
hashCode()
Returns a hash code value for the object.
|
boolean |
isBreakRule()
Returns whether this is a rule that determines a break or an exception.
|
void |
setAfterbreak(java.lang.String afterbreak)
Sets a regular expression which represents the text that appears after a
segment break.
|
void |
setBeforebreak(java.lang.String beforebreak)
Sets a regular expression which represents the text that appears before a
segment break.
|
void |
setBreakRule(boolean breakRule)
Sets whether this is a rule that determines a break or an exception.
|
java.lang.String |
toString()
Returns a string representation of the Rule for debugging purposes.
|
public Rule()
public Rule(boolean breakRule, java.lang.String beforebreak, java.lang.String afterbreak)
public Rule copy()
public boolean isBreakRule()
public void setBreakRule(boolean breakRule)
breakRule
- New value -- true for a break rule, false for an exception.public java.lang.String getBeforebreak()
public java.util.regex.Pattern getCompiledBeforebreak()
public void setBeforebreak(java.lang.String beforebreak) throws java.util.regex.PatternSyntaxException
beforebreak
- Regular expression string of a text before break.java.util.regex.PatternSyntaxException
public java.lang.String getAfterbreak()
public java.util.regex.Pattern getCompiledAfterbreak()
public void setAfterbreak(java.lang.String afterbreak) throws java.util.regex.PatternSyntaxException
afterbreak
- Regular expression string of a text after break.java.util.regex.PatternSyntaxException
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object