[MOBY-guts] biomoby commit
Paul Gordon
gordonp at dev.open-bio.org
Thu Dec 6 16:58:33 UTC 2007
gordonp
Thu Dec 6 11:58:33 EST 2007
Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data
In directory dev.open-bio.org:/tmp/cvs-serv25288/src/main/org/biomoby/shared/data
Modified Files:
MobyDataObject.java
Log Message:
Added typechecking for CRIB elements
moby-live/Java/src/main/org/biomoby/shared/data MobyDataObject.java,1.22,1.23
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataObject.java,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataObject.java 2007/12/01 00:37:01 1.22
+++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataObject.java 2007/12/06 16:58:33 1.23
@@ -40,7 +40,7 @@
public class MobyDataObject extends MobyPrimaryDataSimple implements MobyDataInstance, Cloneable, Comparable{
protected int xmlMode = MobyDataInstance.CENTRAL_XML_MODE;
private Object object = new Object();
- private Vector CRIBVector = null; // CrossReference Info Block from the MOBY-S API
+ private Vector<MobyDataObject> CRIBVector = null; // CrossReference Info Block from the MOBY-S API
private MobyProvisionInfo provisionInfo = null; // Provision Info Block from MOBY-S API
/**
@@ -458,13 +458,13 @@
// Hasn't been initialized yet?
if(CRIBVector == null){
- CRIBVector = new Vector();
+ CRIBVector = new Vector<MobyDataObject>();
}
// Already a class that's acceptable
if(mdsi instanceof MobyDataXref ||
mdsi.getClass().getName().equals("MobyDataObject")){
- CRIBVector.add(mdsi);
+ CRIBVector.add((MobyDataObject) mdsi);
}
// Needs to be reduced to a base Object
else{
@@ -482,7 +482,7 @@
public Collection getCrossReferences(){
// Hasn't been initialized yet?
if(CRIBVector == null){
- CRIBVector = new Vector();
+ CRIBVector = new Vector<MobyDataObject>();
}
return CRIBVector;
}
@@ -606,9 +606,7 @@
StringBuffer crib = new StringBuffer();
crib.append("<"+MobyTags.CROSSREFERENCE+">\n");
- java.util.Iterator iter = CRIBVector.iterator();
- while(iter != null && iter.hasNext()){
- MobyDataObject obj = (MobyDataObject) iter.next();
+ for(MobyDataObject obj : CRIBVector){
if(obj == null){
// ignore nulls
}
More information about the MOBY-guts
mailing list