com.trolltech.qt.xmlpatterns
Class QSourceLocation

java.lang.Object
  extended by com.trolltech.qt.internal.QSignalEmitterInternal
      extended by com.trolltech.qt.QSignalEmitter
          extended by com.trolltech.qt.QtJambiObject
              extended by com.trolltech.qt.xmlpatterns.QSourceLocation
All Implemented Interfaces:
QtJambiInterface, java.lang.Cloneable

public class QSourceLocation
extends QtJambiObject
implements java.lang.Cloneable

The QSourceLocation class identifies a location in a resource by URI, line, and column. QSourceLocation is a simple value based class that has three properties, uri(), line(), and column(), that, taken together, identify a certain point in a resource, e.g., a file or an in-memory document.

line() and column() refer to character counts (not byte counts), and they both start from 1, as opposed to 0.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.trolltech.qt.QSignalEmitter
QSignalEmitter.AbstractSignal, QSignalEmitter.PrivateSignal0, QSignalEmitter.PrivateSignal1, QSignalEmitter.PrivateSignal2, QSignalEmitter.PrivateSignal3, QSignalEmitter.PrivateSignal4, QSignalEmitter.PrivateSignal5, QSignalEmitter.PrivateSignal6, QSignalEmitter.PrivateSignal7, QSignalEmitter.PrivateSignal8, QSignalEmitter.PrivateSignal9, QSignalEmitter.Signal0, QSignalEmitter.Signal1, QSignalEmitter.Signal2, QSignalEmitter.Signal3, QSignalEmitter.Signal4, QSignalEmitter.Signal5, QSignalEmitter.Signal6, QSignalEmitter.Signal7, QSignalEmitter.Signal8, QSignalEmitter.Signal9
 
Nested classes/interfaces inherited from class com.trolltech.qt.internal.QSignalEmitterInternal
com.trolltech.qt.internal.QSignalEmitterInternal.AbstractSignalInternal
 
Field Summary
 
Fields inherited from class com.trolltech.qt.internal.QSignalEmitterInternal
currentSender
 
Constructor Summary
QSourceLocation()
          Construct a QSourceLocation that doesn't identify anything at all.
QSourceLocation(QSourceLocation other)
          Constructs a QSourceLocation that is a copy of other.
QSourceLocation(QUrl uri)
          Constructs a QSourceLocation with URI u, line l and column c.
QSourceLocation(QUrl uri, int line)
          Constructs a QSourceLocation with URI u, line l and column c.
QSourceLocation(QUrl uri, int line, int column)
          Constructs a QSourceLocation with URI u, line l and column c.
 
Method Summary
 QSourceLocation clone()
          This method is reimplemented for internal reasons
 long column()
          Returns the current column number.
 boolean isNull()
          Returns true if this QSourceLocation doesn't identify anything.
 long line()
          Returns the current line number.
 void setColumn(long newColumn)
          Sets the column number to newColumn.
 void setLine(long newLine)
          Sets the line number to newLine.
 void setUri(QUrl newUri)
          Sets the URI to newUri.
 java.lang.String toString()
          Returns a string representation of the this QSourceLocation.
 QUrl uri()
          Returns the resource that this QSourceLocation refers to.
 
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 com.trolltech.qt.internal.QSignalEmitterInternal
__qt_signalInitialization
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.trolltech.qt.QtJambiInterface
disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership
 

Constructor Detail

QSourceLocation

public QSourceLocation()
Construct a QSourceLocation that doesn't identify anything at all.

For a default constructed QSourceLocation(), isNull() returns true.


QSourceLocation

public QSourceLocation(QSourceLocation other)
Constructs a QSourceLocation that is a copy of other.


QSourceLocation

public QSourceLocation(QUrl uri,
                       int line)
Constructs a QSourceLocation with URI u, line l and column c.


QSourceLocation

public QSourceLocation(QUrl uri)
Constructs a QSourceLocation with URI u, line l and column c.


QSourceLocation

public QSourceLocation(QUrl uri,
                       int line,
                       int column)
Constructs a QSourceLocation with URI u, line l and column c.

Method Detail

column

public final long column()
Returns the current column number. The column number refers to the count of characters, not bytes. The first column is column 1, not 0. The default value is -1, indicating the column number is unknown.

See also:
setColumn().


isNull

public final boolean isNull()
Returns true if this QSourceLocation doesn't identify anything.

For a default constructed QSourceLocation, this function returns true. The same applies for any other QSourceLocation whose uri() is invalid.


line

public final long line()
Returns the current line number. The first line number is 1, not 0. The default value is -1, indicating the line number is unknown.

See also:
setLine().


setColumn

public final void setColumn(long newColumn)
Sets the column number to newColumn. 0 is an invalid column number. The first column number is 1.

See also:
column().


setLine

public final void setLine(long newLine)
Sets the line number to newLine. 0 is an invalid line number. The first line number is 1.

See also:
line().


setUri

public final void setUri(QUrl newUri)
Sets the URI to newUri.

See also:
uri().


uri

public final QUrl uri()
Returns the resource that this QSourceLocation refers to. For example, the resource could be a file in the local file system, if the URI scheme is file.

See also:
setUri().


toString

public java.lang.String toString()
Returns a string representation of the this QSourceLocation.

Overrides:
toString in class java.lang.Object

clone

public QSourceLocation clone()
This method is reimplemented for internal reasons

Overrides:
clone in class java.lang.Object