|
|
||||||||||
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.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.trolltech.qt.QSignalEmitter |
---|
QSignalEmitter.AbstractSignal, QSignalEmitter.Signal0, QSignalEmitter.Signal1<A>, QSignalEmitter.Signal2<A,B>, QSignalEmitter.Signal3<A,B,C>, QSignalEmitter.Signal4<A,B,C,D>, QSignalEmitter.Signal5<A,B,C,D,E>, QSignalEmitter.Signal6<A,B,C,D,E,F>, QSignalEmitter.Signal7<A,B,C,D,E,F,G>, QSignalEmitter.Signal8<A,B,C,D,E,F,G,H>, QSignalEmitter.Signal9<A,B,C,D,E,F,G,H,I> |
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)
Equivalent to QStringMatcher(pattern, Qt::CaseSensitive). |
|
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. |
static QStringMatcher |
fromNativePointer(QNativePointer nativePointer)
This function returns the QStringMatcher instance pointed to by nativePointer |
int |
indexIn(java.lang.String str)
Equivalent to indexIn(str, 0). |
int |
indexIn(java.lang.String str,
int from)
Searches the string str from character position from (default 0, i.e. from the first character), for the string pattern that was set in the constructor or in the most recent call to setPattern. |
static QNativePointer |
nativePointerArray(QStringMatcher[] array)
This function returns a QNativePointer that is pointing to the specified 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, 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 |
---|
clone, equals, 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()
Constructs an empty string matcher that won't match anything. Call setPattern to give it a pattern to match.
public QStringMatcher(java.lang.String pattern)
Equivalent to QStringMatcher(pattern, Qt::CaseSensitive).
public QStringMatcher(java.lang.String pattern, Qt.CaseSensitivity cs)
Constructs a string matcher that will search for pattern, with case sensitivity cs.
Call indexIn to perform a search.
public QStringMatcher(QStringMatcher other)
Copies the other string matcher to this string matcher.
Method Detail |
---|
public final Qt.CaseSensitivity caseSensitivity()
Returns the case sensitivity setting for this string matcher.
public final int indexIn(java.lang.String str)
Equivalent to indexIn(str, 0).
public final int indexIn(java.lang.String str, int from)
Searches the string str from character position from (default 0, i.e. from the first character), for the string 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.
public final java.lang.String pattern()
Returns the string pattern that this string matcher will search for.
public final void setCaseSensitivity(Qt.CaseSensitivity cs)
Sets the case sensitivity setting of this string matcher to cs.
public final void setPattern(java.lang.String pattern)
Sets the string that this string matcher will search for to pattern.
public static QStringMatcher fromNativePointer(QNativePointer nativePointer)
nativePointer
- the QNativePointer of which object should be returned.public static QNativePointer nativePointerArray(QStringMatcher[] array)
array
- the array that the returned pointer will point to.
|
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |