Top Description Fields Constructors Methods
org.eclipse.jgit.util

public Class RawSubStringPattern

extends Object
Class Inheritance
Imports
org.eclipse.jgit.internal.JGitText, org.eclipse.jgit.lib.Constants

Searches text using only substring search.

Instances are thread-safe. Multiple concurrent threads may perform matches on different character sequences at the same time.

Field Summary

Modifier and TypeField and Description
private final byte[]
private final String

Constructor Summary

AccessConstructor and Description
public
RawSubStringPattern(String
text to locate. This should be a literal string, as no meta-characters are supported by this implementation. The string may not be the empty string.
patternText
)

Construct a new substring pattern.

Method Summary

Modifier and TypeMethod and Description
private static final byte
lc(byte q)

public int

Returns:

offset within rcs of the first occurrence of this pattern; -1 if this pattern does not appear at any position of rcs.
match
(RawCharSequence
the sequence to match. Must not be null but the length of the sequence is permitted to be 0.
rcs
)

Match a character sequence against this pattern.

private static final boolean
neq(byte a, byte b)

public String

Returns:

the pattern string given to our constructor.
pattern
()

Get the literal pattern string this instance searches for.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

needleback to summary
private final byte[] needle
needleStringback to summary
private final String needleString

Constructor Detail

RawSubStringPatternback to summary
public RawSubStringPattern(String patternText)

Construct a new substring pattern.

Parameters
patternText:String

text to locate. This should be a literal string, as no meta-characters are supported by this implementation. The string may not be the empty string.

Method Detail

lcback to summary
private static final byte lc(byte q)
matchback to summary
public int match(RawCharSequence rcs)

Match a character sequence against this pattern.

Parameters
rcs:RawCharSequence

the sequence to match. Must not be null but the length of the sequence is permitted to be 0.

Returns:int

offset within rcs of the first occurrence of this pattern; -1 if this pattern does not appear at any position of rcs.

neqback to summary
private static final boolean neq(byte a, byte b)
patternback to summary
public String pattern()

Get the literal pattern string this instance searches for.

Returns:String

the pattern string given to our constructor.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override