org.kefirsf.bb.proc
Class ProcVariable

java.lang.Object
  extended by org.kefirsf.bb.proc.ProcNamedElement
      extended by org.kefirsf.bb.proc.ProcVariable
All Implemented Interfaces:
ProcPatternElement

public class ProcVariable
extends ProcNamedElement
implements ProcPatternElement

Класс переменной

Author:
Kefir

Constructor Summary
ProcVariable(String name, Pattern regex)
          Create named variable
 
Method Summary
 int findIn(Source source)
          Find this element
 boolean isNextIn(Source source)
          Определяет, что дальше в разбираемой строке находится нужная последовательность
 boolean parse(Context context, ProcPatternElement terminator)
          Парсит элемент
 String toString()
           
 
Methods inherited from class org.kefirsf.bb.proc.ProcNamedElement
getName, setAttribute
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ProcVariable

public ProcVariable(String name,
                    Pattern regex)
Create named variable

Parameters:
name - variable name
regex - regular expression pattern
Method Detail

parse

public boolean parse(Context context,
                     ProcPatternElement terminator)
Парсит элемент

Specified by:
parse in interface ProcPatternElement
Parameters:
context - контекст
terminator - teminator to stop text process
Returns:
true - если удалось распарсить константу false - если не удалось

isNextIn

public boolean isNextIn(Source source)
Определяет, что дальше в разбираемой строке находится нужная последовательность

Specified by:
isNextIn in interface ProcPatternElement
Parameters:
source - source text
Returns:
true если следующие символы в строке совпадают с pattern false если не совпадают или строка кончилась

findIn

public int findIn(Source source)
Find this element

Specified by:
findIn in interface ProcPatternElement
Parameters:
source - text source
Returns:
start offset

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2013. All Rights Reserved.