org.kefirsf.bb.proc
Class PatternConstant

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

public class PatternConstant
extends Object
implements ProcPatternElement

Constant element of pattern or template

Author:
Kefir

Constructor Summary
PatternConstant(String value, boolean ignoreCase)
          Create constant element.
 
Method Summary
 boolean equals(Object o)
           
 int findIn(Source source)
          Find this constant.
 char[] getCharArray()
           
 String getValue()
           
 int hashCode()
           
 boolean isIgnoreCase()
           
 boolean isNextIn(Source source)
          Check equals next sequence in source to this constant
 boolean parse(Context context, ProcPatternElement terminator)
          Parse constant
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PatternConstant

public PatternConstant(String value,
                       boolean ignoreCase)
Create constant element.

Parameters:
value - constant value
Method Detail

parse

public boolean parse(Context context,
                     ProcPatternElement terminator)
Parse constant

Specified by:
parse in interface ProcPatternElement
Parameters:
context - current context
terminator - not used
Returns:
true - if next sequence in source equals to this constant value, false - other

isNextIn

public boolean isNextIn(Source source)
Check equals next sequence in source to this constant

Specified by:
isNextIn in interface ProcPatternElement
Parameters:
source - source text
Returns:
true if next subsequence is equals false other

findIn

public int findIn(Source source)
Find this constant.

Specified by:
findIn in interface ProcPatternElement
Parameters:
source - text source
Returns:
смещение константы

getValue

public String getValue()

isIgnoreCase

public boolean isIgnoreCase()

getCharArray

public char[] getCharArray()

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object
Returns:
string representation of this object.


Copyright © 2013. All Rights Reserved.