本文整理汇总了Java中org.eclipse.emf.common.util.URI.equals方法的典型用法代码示例。如果您正苦于以下问题:Java URI.equals方法的具体用法?Java URI.equals怎么用?Java URI.equals使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.emf.common.util.URI
的用法示例。
在下文中一共展示了URI.equals方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getProjects
import org.eclipse.emf.common.util.URI; //导入方法依赖的package包/类
@Override
public Iterable<IProject> getProjects(java.net.URI rootLocation) {
ensureInitialized();
final File rootFolder = new File(rootLocation);
final Map<String, IProject> projectsMapping = newTreeMap();
final URI rootUri = URI.createFileURI(rootFolder.getAbsolutePath());
for (Entry<URI, Optional<Pair<ExternalProject, ProjectDescription>>> entry : projectCache.asMap().entrySet()) {
final URI projectLocation = entry.getKey();
if (rootUri.equals(projectLocation.trimSegments(1))) {
final Pair<ExternalProject, ProjectDescription> pair = entry.getValue().orNull();
if (null != pair && null != pair.getFirst()) {
final ExternalProject project = pair.getFirst();
projectsMapping.put(project.getName(), project);
}
}
}
return unmodifiableCollection(projectsMapping.values());
}
示例2: getProjectsDescriptions
import org.eclipse.emf.common.util.URI; //导入方法依赖的package包/类
@Override
public Iterable<ProjectDescription> getProjectsDescriptions(java.net.URI rootLocation) {
ensureInitialized();
final File rootFolder = new File(rootLocation);
final Set<ProjectDescription> projectsMapping = newHashSet();
final URI rootUri = URI.createFileURI(rootFolder.getAbsolutePath());
for (Entry<URI, Optional<Pair<ExternalProject, ProjectDescription>>> entry : projectCache.asMap().entrySet()) {
final URI projectLocation = entry.getKey();
if (rootUri.equals(projectLocation.trimSegments(1))) {
final Pair<ExternalProject, ProjectDescription> pair = entry.getValue().orNull();
if (null != pair && null != pair.getFirst()) {
final ProjectDescription description = pair.getSecond();
if (description != null) {
projectsMapping.add(description);
}
}
}
}
return unmodifiableCollection(projectsMapping);
}
示例3: descriptionsChanged
import org.eclipse.emf.common.util.URI; //导入方法依赖的package包/类
@Override
public void descriptionsChanged(Event event) {
URI expectedURI = URI.createPlatformResourceURI(file.getFullPath().toString(), true);
for (IResourceDescription.Delta delta : event.getDeltas()) {
URI deltaURI = delta.getUri();
if (expectedURI.equals(deltaURI)) {
eventFired = true;
}
}
}
示例4: isSameProblem
import org.eclipse.emf.common.util.URI; //导入方法依赖的package包/类
private boolean isSameProblem(IMarker marker) {
URI myUriToProblem = issue.getUriToProblem();
String code = issueUtil.getCode(marker);
if (code != null && code.equals(org.eclipse.n4js.validation.IssueCodes.NON_EXISTING_PROJECT)) {
myUriToProblem = myUriToProblem.appendFragment(Integer.toString(marker.hashCode()));
}
return myUriToProblem != null && myUriToProblem.equals(issueUtil.getUriToProblem(marker));
}
示例5: getSessions
import org.eclipse.emf.common.util.URI; //导入方法依赖的package包/类
/**
* Gets the {@link List} of {@link Session} referencing the given semantic {@link URI}.
*
* @param uri
* the semantic {@link URI}
* @return the {@link List} of {@link Session} referencing the given semantic {@link URI}
*/
public static List<Session> getSessions(URI uri) {
final List<Session> res = new ArrayList<Session>();
final URI resourceURI = uri.trimFragment();
for (Session session : SessionManager.INSTANCE.getSessions()) {
for (Resource resource : session.getSemanticResources()) {
if (resourceURI.equals(resource.getURI())) {
res.add(session);
break;
}
}
}
return res;
}
示例6: setUri
import org.eclipse.emf.common.util.URI; //导入方法依赖的package包/类
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated NOT
*/
public void setUri(URI newUri) {
final URI oldUri = uri;
uri = newUri;
if (eNotificationRequired()) {
eNotify(new ENotificationImpl(this, Notification.SET, MappingPackage.RESOURCE_ARTEFACT__URI, oldUri, uri));
}
if (newUri != null && !newUri.equals(oldUri)) {
load();
}
}
示例7: isPrivateVisible
import org.eclipse.emf.common.util.URI; //导入方法依赖的package包/类
private boolean isPrivateVisible(Resource contextResource, URI elementLocation) {
URI resURI = getURI(contextResource);
boolean result = resURI.equals(elementLocation.trimFragment());
return result;
}