|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.trolltech.qt.QSignalEmitter
com.trolltech.qt.QtJambiObject
com.trolltech.qt.core.QStringMatcher
public class QStringMatcher
The QStringMatcher
class holds a sequence of characters that can be quickly matched in a Unicode string. This class is useful when you have a sequence of QChars that you want to repeatedly match against some strings (perhaps in a loop), or when you want to search for the same sequence of characters multiple times in the same string. Using a matcher object and indexIn()
is faster than matching a plain QString with QString::indexOf() if repeated matching takes place. This class offers no benefit if you are doing one-off string matches.
Create the QStringMatcher
with the QString you want to search for. Then call indexIn()
on the QString that you want to search.
QByteArrayMatcher
, and QRegExp
.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.trolltech.qt.QSignalEmitter |
---|
QSignalEmitter.Signal0, QSignalEmitter.Signal1, QSignalEmitter.Signal2, QSignalEmitter.Signal3, QSignalEmitter.Signal4, QSignalEmitter.Signal5, QSignalEmitter.Signal6, QSignalEmitter.Signal7, QSignalEmitter.Signal8, QSignalEmitter.Signal9 |
Constructor Summary | |
---|---|
QStringMatcher()
Constructs an empty string matcher that won't match anything. |
|
QStringMatcher(QStringMatcher other)
Copies the other string matcher to this string matcher. |
|
QStringMatcher(java.lang.String pattern)
Constructs a string matcher that will search for pattern, with case sensitivity cs. |
|
QStringMatcher(java.lang.String pattern,
Qt.CaseSensitivity cs)
Constructs a string matcher that will search for pattern, with case sensitivity cs. |
Method Summary | |
---|---|
Qt.CaseSensitivity |
caseSensitivity()
Returns the case sensitivity setting for this string matcher. |
QStringMatcher |
clone()
This method is reimplemented for internal reasons |
static QStringMatcher |
fromNativePointer(QNativePointer nativePointer)
|
int |
indexIn(java.lang.String str)
Searches the string str from character position from (default 0, i.e. |
int |
indexIn(java.lang.String str,
int from)
Searches the string str from character position from (default 0, i.e. |
static QNativePointer |
nativePointerArray(QStringMatcher[] array)
|
java.lang.String |
pattern()
Returns the string pattern that this string matcher will search for. |
void |
setCaseSensitivity(Qt.CaseSensitivity cs)
Sets the case sensitivity setting of this string matcher to cs. |
void |
setPattern(java.lang.String pattern)
Sets the string that this string matcher will search for to pattern. |
Methods inherited from class com.trolltech.qt.QtJambiObject |
---|
dispose, disposed, equals, finalize, reassignNativeResources, tr, tr, tr |
Methods inherited from class com.trolltech.qt.QSignalEmitter |
---|
blockSignals, disconnect, disconnect, signalsBlocked, signalSender, thread |
Methods inherited from class java.lang.Object |
---|
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.trolltech.qt.QtJambiInterface |
---|
disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership |
Constructor Detail |
---|
public QStringMatcher()
setPattern()
to give it a pattern to match.
public QStringMatcher(java.lang.String pattern)
Call indexIn()
to perform a search.
public QStringMatcher(java.lang.String pattern, Qt.CaseSensitivity cs)
Call indexIn()
to perform a search.
public QStringMatcher(QStringMatcher other)
Method Detail |
---|
public final Qt.CaseSensitivity caseSensitivity()
setCaseSensitivity()
.
public final int indexIn(java.lang.String str)
pattern()
that was set in the constructor or in the most recent call to setPattern()
. Returns the position where the pattern()
matched in str, or -1 if no match was found. setPattern()
, and setCaseSensitivity()
.
public final int indexIn(java.lang.String str, int from)
pattern()
that was set in the constructor or in the most recent call to setPattern()
. Returns the position where the pattern()
matched in str, or -1 if no match was found. setPattern()
, and setCaseSensitivity()
.
public final java.lang.String pattern()
setPattern()
.
public final void setCaseSensitivity(Qt.CaseSensitivity cs)
caseSensitivity()
, setPattern()
, and indexIn()
.
public final void setPattern(java.lang.String pattern)
pattern()
, setCaseSensitivity()
, and indexIn()
.
public static QStringMatcher fromNativePointer(QNativePointer nativePointer)
public static QNativePointer nativePointerArray(QStringMatcher[] array)
public QStringMatcher clone()
clone
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |