|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK 11g Release 2 (11.1.2.3.0) E17493-04 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.jdeveloper.audit.model.Location
public abstract class Location
A location in a model in a project. This class encapsulates a model and a range of characters within the text buffer for the model; and using the model, allows clients to go back and forth between Location
s and constructs in the source model for the model. A location adjusts the offset and length it exposes to clients to account for edits in the containing model that happen after its creation.
The model is defined by a ModelAdapter
, which encapsulates a workspace, project, and file and serves as a factory and service provider for locations.
Analyzer
implementations typically work directly with constructs rather than with Locations
. However, the Audit framework relies on locations to avoid holding references to constructs and thereby locking entire source models into memory; and to allow it to use source models which are completely recreated whenever the underlying model changes.
Location implements Comparable in such a way that a location which includes another always sorts first.
Notes
When a whole model location is created, the length should be the length of the model. To avoid opening files that don't otherwise need to be opened, the length is set internally to Integer.MAX_VALUE. When used, lengths of Integer.MAX_VALUE are always replaced by model.getStartLength(), which will also be Integer.MAX_VALUE until the model is actually opened. Because getEnd propagates the length to the offset, the same replacement is also done for the internal offset value.
ModelAdapter
Constructor Summary | |
---|---|
Location(ModelAdapter model) Creates a location within a model. |
Method Summary | |
---|---|
int |
compareTo(Location that) A Location which encloses another will always sort first. |
boolean |
contains(Location that) Gets whether this location contains a location. |
boolean |
equals(java.lang.Object object) |
Location |
getBeginning() Gets a zero length location at the beginning of this location. |
Location |
getEnd() Gets a zero length location at the end of this location. |
int |
getEndOffset() Gets the number of characters in the model text buffer before the first character following this location, adjusted for edits to the containing model. |
int |
getLength() Gets the number of characters in the model text buffer contained by this location, adjusted for edits to the containing model. |
Location |
getLocation() Gets this location in fulfillment of the Located interface. |
ModelAdapter |
getModel() Gets the model containing this location. |
int |
getOffset() Gets the number of characters in the model text buffer before this location, adjusted for edits to the containing model. |
Project |
getProject() Gets the project containing this location. |
Workspace |
getWorkspace() Gets the workspace containing this location. |
int |
hashCode() |
boolean |
isRoot() Gets whether this location corresponds to the root construct in the object model for its model. |
java.lang.String |
toString() |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Location(ModelAdapter model)
model
- The ModelAdapter
containing this location.Method Detail |
---|
public final Location getLocation()
Located
interface.getLocation
in interface Located
public boolean isRoot()
public Workspace getWorkspace()
public Project getProject()
public ModelAdapter getModel()
public int getOffset()
public int getLength()
public int getEndOffset()
public Location getBeginning()
public Location getEnd()
public boolean contains(Location that)
that
- The location to test.public int compareTo(Location that)
compareTo
in interface java.lang.Comparable<Location>
public boolean equals(java.lang.Object object)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK 11g Release 2 (11.1.2.3.0) E17493-04 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |