Skip to content

Commit

Permalink
Merge pull request #362 from SynBioDex/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
cjmyers committed May 19, 2016
2 parents 5f7fd97 + cd3e146 commit bf1b2e7
Show file tree
Hide file tree
Showing 198 changed files with 30,240 additions and 34,438 deletions.
6 changes: 3 additions & 3 deletions core2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
<parent>
<groupId>org.sbolstandard</groupId>
<artifactId>libSBOLj-parent</artifactId>
<version>2.0.0</version>
<version>2.1.0</version>
</parent>

<artifactId>libSBOLj</artifactId>

<properties>
<sbol-data.version>0.1.2</sbol-data.version>
<sbol-data.version>0.1.3</sbol-data.version>
</properties>


Expand Down Expand Up @@ -126,5 +126,5 @@
</plugins>
</build>

<version>2.0.1-SNAPSHOT</version>
<version>2.1.0</version>
</project>
755 changes: 0 additions & 755 deletions core2/rules.xml

This file was deleted.

3 changes: 2 additions & 1 deletion core2/src/main/java/org/sbolstandard/core2/AccessType.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
import java.net.URI;

/**
* Represents all access types for a {@link ComponentInstance} object.
*
* @author Zhen Zhang
* @author Chris Myers
* @version 2.1
*/

public enum AccessType {
/**
* The "public" access type indicates that the ComponentInstance MAY be referred to by remote references in MapsTo objects.
Expand Down
147 changes: 73 additions & 74 deletions core2/src/main/java/org/sbolstandard/core2/Annotation.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,63 +34,63 @@ public class Annotation {
private NamedProperty<QName> value;

/**
* Constructs an Annotation instance using the given qName and the string type literal.
* Constructs an annotation using the given qName and the string type literal.
*
* @param qName the QName of this Annotation instance
* @param qName the QName of this annotation
* @param literal a string type value
*/
public Annotation(QName qName, String literal) {
value = NamedProperty(qName,literal);
}

/**
* Constructs an Annotation instance using the given qName and the integer type literal.
* Constructs an annotation using the given qName and the integer type literal.
*
* @param qName the QName of this Annotation instance
* @param qName the QName of this annotation
* @param literal an integer type value
*/
public Annotation(QName qName, int literal) {
value = NamedProperty(qName,literal);
}

/**
* Constructs an Annotation instance using the given qName and the double type literal.
* Constructs an annotation using the given qName and the double type literal.
*
* @param qName the QName of this Annotation instance
* @param qName the QName of this annotation
* @param literal a double type value
*/
public Annotation(QName qName, double literal) {
value = NamedProperty(qName, literal);
}

/**
* Constructs an Annotation instance using the given qName and the boolean type literal.
* Constructs an annotation using the given qName and the boolean type literal.
*
* @param qName the QName of this Annotation instance
* @param qName the QName of this annotation
* @param literal a boolean type value
*/
public Annotation(QName qName, boolean literal) {
value = NamedProperty(qName,literal);
}

/**
* Constructs an Annotation instance using the given qName and the {@code URI} type literal.
* Constructs an annotation using the given qName and the {@code URI} type literal.
*
* @param qName the QName of this Annotation instance
* @param qName the QName of this annotation
* @param literal a URI type value
*/
public Annotation(QName qName, URI literal) {
value = NamedProperty(qName,literal);
}

/**
* Constructs a nested Annotation instance using the given qName, nested qName,
* Constructs a nested annotation using the given qName, nested qName,
* nested URI, and list of annotations.
*
* @param qName the QName of this Annotation instance
* @param nestedQName the QName of the nested Annotation
* @param nestedURI the identity URI for the nested Annotation
* @param annotations the list of annotations to construct the nested Annotation instance
* @param qName the QName of this annotation
* @param nestedQName the QName of the nested annotation
* @param nestedURI the identity URI for the nested annotation
* @param annotations the list of annotations to construct the nested annotation
*/
public Annotation(QName qName, QName nestedQName, URI nestedURI, List<Annotation> annotations) {
List<NamedProperty<QName>> list = new ArrayList<>();
Expand Down Expand Up @@ -423,65 +423,64 @@ public boolean equals(Object obj) {
if (other.value != null)
return false;
} else if (!value.equals(other.value)) {
// TODO: insert this line and comment out rest when sbol-data 0.1.3 is available
// return false;
if (!this.getQName().equals(other.getQName())) {
return false;
} else if ((this.getValue().getValue() instanceof StringLiteral<?>) &&
(other.getValue().getValue() instanceof StringLiteral<?>)) {
if (!this.getStringValue().equals(other.getStringValue())) {
return false;
}
} else if ((this.getValue().getValue() instanceof BooleanLiteral<?>) &&
(other.getValue().getValue() instanceof BooleanLiteral<?>)) {
if (!this.getBooleanValue().equals(other.getBooleanValue())) {
return false;
}
} else if ((this.getValue().getValue() instanceof DoubleLiteral<?>) &&
(other.getValue().getValue() instanceof DoubleLiteral<?>)) {
if (!this.getDoubleValue().equals(other.getDoubleValue())) {
return false;
}
} else if ((this.getValue().getValue() instanceof IntegerLiteral<?>) &&
(other.getValue().getValue() instanceof IntegerLiteral<?>)) {
if (!this.getIntegerValue().equals(other.getIntegerValue())) {
return false;
}
} else if ((this.getValue().getValue() instanceof UriLiteral<?>) &&
(other.getValue().getValue() instanceof UriLiteral<?>)) {
if (!this.getURIValue().equals(other.getURIValue())) {
return false;
}
} else if ((this.getValue().getValue() instanceof NestedDocument<?>) &&
(other.getValue().getValue() instanceof NestedDocument<?>)) {
if (!this.getNestedQName().equals(other.getNestedQName())) {
return false;
}
if (!this.getNestedIdentity().equals(other.getNestedIdentity())) {
return false;
}
if (this.getAnnotations().size()!=other.getAnnotations().size()) {
return false;
}
boolean equal = true;
for (Annotation annotation1 : this.getAnnotations()) {
boolean foundIt = false;
for (Annotation annotation2 : other.getAnnotations()) {
if (annotation1.equals(annotation2)) {
foundIt = true;
break;
}
}
if (foundIt==false) {
equal = false;
break;
}
}
return equal;
} else {
return false;
}
return true;
return false;
// if (!this.getQName().equals(other.getQName())) {
// return false;
// } else if ((this.getValue().getValue() instanceof StringLiteral<?>) &&
// (other.getValue().getValue() instanceof StringLiteral<?>)) {
// if (!this.getStringValue().equals(other.getStringValue())) {
// return false;
// }
// } else if ((this.getValue().getValue() instanceof BooleanLiteral<?>) &&
// (other.getValue().getValue() instanceof BooleanLiteral<?>)) {
// if (!this.getBooleanValue().equals(other.getBooleanValue())) {
// return false;
// }
// } else if ((this.getValue().getValue() instanceof DoubleLiteral<?>) &&
// (other.getValue().getValue() instanceof DoubleLiteral<?>)) {
// if (!this.getDoubleValue().equals(other.getDoubleValue())) {
// return false;
// }
// } else if ((this.getValue().getValue() instanceof IntegerLiteral<?>) &&
// (other.getValue().getValue() instanceof IntegerLiteral<?>)) {
// if (!this.getIntegerValue().equals(other.getIntegerValue())) {
// return false;
// }
// } else if ((this.getValue().getValue() instanceof UriLiteral<?>) &&
// (other.getValue().getValue() instanceof UriLiteral<?>)) {
// if (!this.getURIValue().equals(other.getURIValue())) {
// return false;
// }
// } else if ((this.getValue().getValue() instanceof NestedDocument<?>) &&
// (other.getValue().getValue() instanceof NestedDocument<?>)) {
// if (!this.getNestedQName().equals(other.getNestedQName())) {
// return false;
// }
// if (!this.getNestedIdentity().equals(other.getNestedIdentity())) {
// return false;
// }
// if (this.getAnnotations().size()!=other.getAnnotations().size()) {
// return false;
// }
// boolean equal = true;
// for (Annotation annotation1 : this.getAnnotations()) {
// boolean foundIt = false;
// for (Annotation annotation2 : other.getAnnotations()) {
// if (annotation1.equals(annotation2)) {
// foundIt = true;
// break;
// }
// }
// if (foundIt==false) {
// equal = false;
// break;
// }
// }
// return equal;
// } else {
// return false;
// }
// return true;
}
return true;
}
Expand Down
25 changes: 24 additions & 1 deletion core2/src/main/java/org/sbolstandard/core2/Collection.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,15 @@ public class Collection extends TopLevel{
this.members = new HashSet<>();
}

/**
* @param collection
* @throws SBOLValidationException if an SBOL validation rule violation occurred in the following
* constructor or method:
* <ul>
* <li>{@link TopLevel#TopLevel(TopLevel)}, or</li>
* <li>{@link #setMembers(Set)}.</li>
* </ul>
*/
private Collection(Collection collection) throws SBOLValidationException {
//super(collection.getIdentity());
super(collection);
Expand All @@ -42,7 +51,7 @@ private Collection(Collection collection) throws SBOLValidationException {
* @param memberURI References to a TopLevel instance
* @return {@code true} if the matching member reference has been added successfully,
* {@code false} otherwise.
* @throws SBOLValidationException if SBOL validation rule 12103 is violated.
* @throws SBOLValidationException if the following SBOL validation rule was violated: 12103.
*/
public boolean addMember(URI memberURI) throws SBOLValidationException {
if (sbolDocument != null && sbolDocument.isComplete()) {
Expand Down Expand Up @@ -156,6 +165,9 @@ public boolean equals(Object obj) {
/* (non-Javadoc)
* @see org.sbolstandard.core2.abstract_classes.TopLevel#deepCopy()
*/
/**
* @throws SBOLValidationException if an SBOL validation rule violation occurred in {@link #Collection(Collection)}.
*/
@Override
protected Collection deepCopy() throws SBOLValidationException {
return new Collection(this);
Expand All @@ -164,6 +176,17 @@ protected Collection deepCopy() throws SBOLValidationException {
/* (non-Javadoc)
* @see org.sbolstandard.core2.abstract_classes.TopLevel#copy(java.lang.String, java.lang.String, java.lang.String)
*/
/**
* @throws SBOLValidationException if an SBOL validation rule violation occurred in any of the following methods:
* <ul>
* <li>{@link #deepCopy()},</li>
* <li>{@link URIcompliance#createCompliantURI(String, String, String)},</li>
* <li>{@link #setDisplayId(String)},</li>
* <li>{@link #setVersion(String)},</li>
* <li>{@link #setWasDerivedFrom(URI)}, or</li>
* <li>{@link #setIdentity(URI)}.</li>
* </ul>
*/
@Override
Collection copy(String URIprefix, String displayId, String version) throws SBOLValidationException {
Collection cloned = this.deepCopy();
Expand Down
Loading

0 comments on commit bf1b2e7

Please sign in to comment.