Saros
Distributed Collaborative Editing and Distributed Party Programming
de.fu_berlin.inf.dpp.activities.SPath Class Reference

List of all members.

Public Member Functions

 SPath (IProject project, IPath path)
 SPath (IResource resource)
IPath getProjectRelativePath ()
int hashCode ()
boolean equals (Object obj)
String toString ()
IFile getFile ()
IResource getResource ()
IFolder getFolder ()
IProject getProject ()
IPath getFullPath ()

Protected Attributes

IPath projectRelativePath
IProject project

Detailed Description

Objects of this class point to a document in the *workspace*, possibly with information about a specific open editor for that document.

An SPath consists of an IProject reference, IPath reference and editorType identifier.

SPaths are value objects and thus immutable.


Constructor & Destructor Documentation

de.fu_berlin.inf.dpp.activities.SPath.SPath ( IProject  project,
IPath  path 
)

Default constructor, initializing this SPath as a reference to the resource or editor identified by the given path in the given project.

Parameters:
pathMay be null to represent "no editor".
FIXME path == null causes a NPE
Exceptions:
IllegalArgumentExceptionif the path is not relative
de.fu_berlin.inf.dpp.activities.SPath.SPath ( IResource  resource)

Convenience constructor, which retrieves path and project from the given resource


Member Function Documentation

boolean de.fu_berlin.inf.dpp.activities.SPath.equals ( Object  obj)
IFile de.fu_berlin.inf.dpp.activities.SPath.getFile ( )

Returns the IFile represented by this SPath.

Returns:
the IFile contained in the associated IProject for the given project relative path

This method is using a straight forward implementation

IFolder de.fu_berlin.inf.dpp.activities.SPath.getFolder ( )

Returns the IFolder represented by this SPath.

IPath de.fu_berlin.inf.dpp.activities.SPath.getFullPath ( )

Convenience method for getting the full (workspace-relative) path of the file/editor identified by this SPath.

IProject de.fu_berlin.inf.dpp.activities.SPath.getProject ( )

Returns the project in which the referenced resource or editor is located.

IPath de.fu_berlin.inf.dpp.activities.SPath.getProjectRelativePath ( )

Returns the project relative path of the resource or editor represented by this SPath.

Returns:
May return null if this SPath is used to represent no editor.
IResource de.fu_berlin.inf.dpp.activities.SPath.getResource ( )

Returns the IResource resource} represented by this SPath.

Returns:
the resource represented by this SPath or null if the resource does not exist locally
int de.fu_berlin.inf.dpp.activities.SPath.hashCode ( )
String de.fu_berlin.inf.dpp.activities.SPath.toString ( )

Member Data Documentation

The local IProject in which the document is contained which this SPath represents

4, Some Basics:

Individual Eclipse projects use IPaths to identify their resources. However, because Saros needs to keep track of resources across multiple projects, it encapsulates IPaths in an SPath that includes additional identifying information. The project relative path of the resource or editor this SPath represents.

 All Classes Namespaces Files Functions Variables Enumerations