net.sf.saxon.instruct

Class LocationMap

public class LocationMap extends Object implements LocationProvider, Serializable

A LocationMap allocates integer codes to (systemId, lineNumber) pairs. The integer codes are held inside an Expression object to track the location of the expression in the source code
Constructor Summary
LocationMap()
Create a location map
Method Summary
intallocateLocationId(String module, int lineNumber)
Allocate a location identifier to an expression
intgetColumnNumber(long locationId)
intgetLineNumber(long locationId)
Get the line number corresponding to a locationId
StringgetSystemId(long locationId)
Get the system identifier corresponding to a locationId

Constructor Detail

LocationMap

public LocationMap()
Create a location map

Method Detail

allocateLocationId

public int allocateLocationId(String module, int lineNumber)
Allocate a location identifier to an expression

Parameters: module the URI (system identifier) of the module lineNumber the line number of the expression within the module

Returns: the corresponding location identifier

getColumnNumber

public int getColumnNumber(long locationId)

getLineNumber

public int getLineNumber(long locationId)
Get the line number corresponding to a locationId

Parameters: locationId the location identifier

Returns: the corresponding line number

getSystemId

public String getSystemId(long locationId)
Get the system identifier corresponding to a locationId

Parameters: locationId the location identifier

Returns: the corresponding system identifier