public int compareTo(Object o) { Path that = (Path) o; return this.uri.compareTo(that.uri); }
@Override public int compareTo(Object o) { Path that = (Path)o; return this.uri.compareTo(that.uri); }
private int compareUri(URI a, URI b) { return a == null ? b == null ? 0 : 1 : b == null ? -1 : a.compareTo(b); }
public static URI getSourcePartUriFromRelationshipPartUri( URI relationshipPartUri) { if (relationshipPartUri == null) throw new IllegalArgumentException( "The relationshipPart Uri was null !"); if (!isRelationshipPartURI(relationshipPartUri)) throw new IllegalArgumentException( "L'URI ne doit pas �tre celle d'une partie de type relation."); if (relationshipPartUri.compareTo(PACKAGE_RELATIONSHIPS_ROOT_URI) == 0) return PACKAGE_ROOT_URI; String filename = relationshipPartUri.getPath(); String filenameWithoutExtension = getFilenameWithoutExtension(relationshipPartUri); filename = filename .substring(0, ((filename.length() - filenameWithoutExtension .length()) - RELATIONSHIP_PART_EXTENSION_NAME.length())); filename = filename.substring(0, filename.length() - RELATIONSHIP_PART_SEGMENT_NAME.length() - 1); filename = combine(filename, filenameWithoutExtension); return getURIFromPath(filename); }
/** * Get the source part URI from a specified relationships part. * * @param relationshipPartUri * The relationship part use to retrieve the source part. * @return The source part URI from the specified relationships part. */ public static URI getSourcePartUriFromRelationshipPartUri( URI relationshipPartUri) { if (relationshipPartUri == null) throw new IllegalArgumentException( "Must not be null"); if (!isRelationshipPartURI(relationshipPartUri)) throw new IllegalArgumentException( "Must be a relationship part"); if (relationshipPartUri.compareTo(PACKAGE_RELATIONSHIPS_ROOT_URI) == 0) return PACKAGE_ROOT_URI; String filename = relationshipPartUri.getPath(); String filenameWithoutExtension = getFilenameWithoutExtension(relationshipPartUri); filename = filename .substring(0, ((filename.length() - filenameWithoutExtension .length()) - RELATIONSHIP_PART_EXTENSION_NAME.length())); filename = filename.substring(0, filename.length() - RELATIONSHIP_PART_SEGMENT_NAME.length() - 1); filename = combine(filename, filenameWithoutExtension); return getURIFromPath(filename); }
@Override public int compare(Spec o1, Spec o2) { return o1.getUri().compareTo(o2.getUri()); } });
@Override public int compare(Spec o1, Spec o2) { return o1.getUri().compareTo(o2.getUri()); } });
@Override public int compareTo(ResourceRef o) { try { return this.resource.getURI().compareTo(o.resource.getURI()); } catch (IOException e) { throw new Error(e); } }
boolean isAlsoEdits = false; for (URI editsDirName : fsEditsDirs) { if (editsDirName.compareTo(dirName) == 0) { isAlsoEdits = true; fsEditsDirs.remove(editsDirName);
arg0.getNamespace() == null ? arg1.getNamespace() == null ? 0 : 1 : arg0.getNamespace().compareTo(arg1.getNamespace()); if (i != 0) return i;
arg0.getNamespace() == null ? arg1.getNamespace() == null ? 0 : 1 : arg0.getNamespace().compareTo(arg1.getNamespace()); if (i != 0) return i; i =
@Override public int compareTo(Endpoint that) { if (that == null) return 1; if (this == that) return 0; return this.publicURL.compareTo(that.publicURL); }
private int compareAttribute(Attribute arg0, Attribute arg1) { if (arg0 == arg1) return 0; if (arg0 == null) return 1; if (arg1 == null) return -1; int i = arg0.getName() == null ? arg1.getName() == null ? 0 : 1 : arg0.getName().compareTo(arg1.getName()); if (i != 0) return i; i = arg0.getNamespace() == null ? arg1.getNamespace() == null ? 0 : 1 : arg0.getNamespace().compareTo(arg1.getNamespace()); if (i != 0) return i; i = arg0.getUse() - arg1.getUse(); if (i != 0) return i; return compareSimpleType(arg0.getSimpleType(), arg1.getSimpleType()); }
arg0.getNamespace() == null ? arg1.getNamespace() == null ? 0 : 1 : arg0.getNamespace().compareTo(arg1.getNamespace()); if (i != 0) return i;
@Override public int compareTo(StorageLocation obj) { if (obj == this) { return 0; } else if (obj == null) { return -1; } StorageLocation otherStorage = (StorageLocation) obj; if (this.getNormalizedUri() != null && otherStorage.getNormalizedUri() != null) { return this.getNormalizedUri().compareTo( otherStorage.getNormalizedUri()); } else if (this.getNormalizedUri() == null && otherStorage.getNormalizedUri() == null) { return this.storageType.compareTo(otherStorage.getStorageType()); } else if (this.getNormalizedUri() == null) { return -1; } else { return 1; } }
if (memBlockInfo.getBlockURI().compareTo(diskFile.toURI()) != 0) { if (diskMetaFileExists) { if (memBlockInfo.metadataExists()) {
private int compareGroup(Group arg0, Group arg1) { if (arg0 == arg1) return 0; if (arg0 == null) return 1; if (arg1 == null) return -1; int i = arg0.getName() == null ? arg1.getName() == null ? 0 : 1 : arg0.getName().compareTo(arg1.getName()); if (i != 0) return i; i = arg0.getNamespace() == null ? arg1.getNamespace() == null ? 0 : 1 : arg0.getNamespace().compareTo(arg1.getNamespace()); if (i != 0) return i; i = arg0.getMaxOccurs() - arg1.getMaxOccurs(); if (i != 0) return i; i = arg0.getMinOccurs() - arg1.getMinOccurs(); if (i != 0) return i; ElementGrouping a0 = arg0.getChild(); ElementGrouping a1 = arg1.getChild(); if (a0 == a1) return 0; if (a0 == null) return 1; if (a1 == null) return -1; return compareElementGrouping(a0, a1); }
private int compareImport(Schema arg0, Schema arg1) { if (arg0 == arg1) return 0; if (arg0 == null) return 1; if (arg1 == null) return -1; int i = arg0.getTargetNamespace() == null ? arg1.getTargetNamespace() == null ? 0 : 1 : arg0.getTargetNamespace().compareTo(arg1.getTargetNamespace()); if (i != 0) return i; i = arg0.getURI() == null ? arg1.getURI() == null ? 0 : 1 : arg0.getURI().compareTo(arg1.getURI()); if (i != 0) return i; i = arg0.getElements().length - arg1.getElements().length; if (i != 0) return i; i = arg0.getComplexTypes().length - arg1.getComplexTypes().length; if (i != 0) return i; i = arg0.getSimpleTypes().length - arg1.getSimpleTypes().length; if (i != 0) return i; i = arg0.getAttributes().length - arg1.getAttributes().length; if (i != 0) return i; i = arg0.getAttributeGroups().length - arg1.getAttributeGroups().length; if (i != 0) return i; i = arg0.getGroups().length - arg1.getGroups().length; if (i != 0) return i; // Yes we are making a huge assumption here. return 0; }
private int compareElement(Element arg0, Element arg1) { if (arg0 == arg1) return 0; if (arg0 == null) return 1; if (arg1 == null) return -1; int i = arg0.getName() == null ? arg1.getName() == null ? 0 : 1 : arg0.getName().compareTo(arg1.getName()); if (i != 0) return i; i = arg0.getNamespace() == null ? arg1.getNamespace() == null ? 0 : 1 : arg0.getNamespace().compareTo(arg1.getNamespace()); if (i != 0) return i; i = arg0.getMaxOccurs() - arg1.getMaxOccurs(); if (i != 0) return i; i = arg0.getMinOccurs() - arg1.getMinOccurs(); if (i != 0) return i; i = compareElement(arg0.getSubstitutionGroup(), arg1.getSubstitutionGroup()); if (i != 0) return i; // ignore a few things here ... might need them back return compare(arg0.getType(), arg1.getType()); }
/** *{@inheritDoc} */ @Override public int compareTo(ObjectMetadata o) { return (this == o) ? 0 : getUri().compareTo(o.getUri()); }