public class Scope extends Object
| Modifier and Type | Field and Description |
|---|---|
static boolean |
DEFAULT_IGNORE_TEXT
By default we don't ignore text outer codes.
|
static int |
DEFAULT_MAX_VALUE |
static int |
DEFAULT_MIN_VALUE |
static boolean |
DEFAULT_STRONG
By default simple text is permitted.
|
static String |
ROOT
Default name for root scope.
|
| Constructor and Description |
|---|
Scope()
Create a scope with random name.
|
Scope(String name)
Create a scope with a name.
|
Scope(String name,
boolean ignoreText)
Create a scope.
|
Scope(String name,
Scope parent,
boolean ignoreText)
Create a scope.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addCode(Code code)
Add a code to scope.
|
boolean |
equals(Object o) |
Set<Code> |
getCodes()
Get codes of scope.
|
int |
getMax()
Get the maximum count of codes which can be parsed in this scope.
|
int |
getMin()
Get the minimum count of parsed codes.
|
String |
getName()
Get scope name.
|
Scope |
getParent()
Get parent scope.
|
int |
hashCode() |
boolean |
isIgnoreText()
How to use text outer codes.
|
boolean |
isStrong()
If the scope is strong then only the codes from the scope can be parsed by it.
|
void |
setCodes(Set<Code> codes)
Set codes.
|
void |
setIgnoreText(boolean ignoreText)
How to use text outer codes.
|
void |
setMax(int max)
Set the maximum count of codes which can be parsed in this scope.
|
void |
setMin(int min)
Set the minimum count of parsed codes.
|
void |
setName(String name)
Set scope name
|
void |
setParent(Scope parent)
Set parent scope.
|
void |
setStrong(boolean strong)
If the scope is strong then only the codes from the scope can be parsed by it.
|
public static final String ROOT
public static final boolean DEFAULT_IGNORE_TEXT
public static final boolean DEFAULT_STRONG
public static final int DEFAULT_MAX_VALUE
public static final int DEFAULT_MIN_VALUE
public Scope()
public Scope(String name)
name - name of scopepublic Scope(String name, boolean ignoreText)
name - scope nameignoreText - define ignore or not text outer the codes.public String getName()
public void setName(String name)
name - new scope namepublic Scope getParent()
public void setParent(Scope parent)
parent - scopepublic boolean isStrong()
public void setStrong(boolean strong)
strong - true if the scope is strong, false otherwisepublic boolean isIgnoreText()
public void setIgnoreText(boolean ignoreText)
ignoreText - true - ignore text, false - copy. By default is false.public Set<Code> getCodes()
public void addCode(Code code)
code - codepublic int getMin()
public void setMin(int min)
min - minimumpublic int getMax()
public void setMax(int max)
max - maximumCopyright © 2016. All rights reserved.