.version.sessionnumber.raw (string given in
+ * vamsasdocument.xml applicationData entry)
+ *
+ * Lockfile - filename given in the vamsasdocument.xml. Should be checked for
+ * validity by any client and rewritten if necessary. The lockfile can point to
+ * the jar itself. Mode of operation. Initially - documentHandler either: -
+ * creates a zip for a new session for the client - connect to an existing
+ * session zip 1. reads session urn file 2. waits for lock 3. examines session -
+ * decide whether to create new application data slice or connect to one stored
+ * in session. 4. writes info into session file 5. releases lock and generates
+ * local client events. 6. Creates Watcher thread to generate events.
+ *
+ * During the session - Update watcher checks for file change -
+ *
+ * Procedures for file based session message exchange - session document
+ * modification flag
+ *
+ */
+
+public class VamsasSession {
+ /**
+ * indicator file for informing other processes that they should finalise
+ * their vamsas datasets for storing into a vamsas archive.
+ */
+ public static final String CLOSEANDSAVE_FILE = "stored.log";
+
+ /**
+ * session file storing the last_stored_stat data
+ */
+ public static final String MODIFIEDDOC_FILE = "modified";
+
+ private SimpleSessionManager sessionManager = null;
+
+ /**
+ * Count of cycles before considering the current client as the last one of
+ * the session (if no other client registered as active )
+ */
+ private final int watchCycleCountBeforeLastClient = 1220;
+
+ /**
+ * time between checking
+ */
+ public int WATCH_SLEEP = 30;
+
+ protected String clientFileDirectory = "clients";
+
+ /**
+ * called to clear update flag after a successful offline storage event
+ */
+ protected void clearUnsavedFlag() {
+ SessionFlagFile laststored = new SessionFlagFile(new File(sessionDir,
+ MODIFIEDDOC_FILE));
+ if (!laststored.clearFlag())
+ log.warn("Unsaved flag was not cleared for " + sessionDir);
+ }
+
+ /**
+ * called to indicate session document has been modified.
+ *
+ */
+ protected void setUnsavedFlag() {
+ SessionFlagFile laststored = new SessionFlagFile(new File(sessionDir,
+ MODIFIEDDOC_FILE));
+ if (!laststored.setFlag())
+ log.warn("Couldn't set the Unsaved flag for " + sessionDir);
+ }
+
+ /**
+ *
+ * @return true if session document has been modified since last offline
+ * storage event
+ */
+ protected boolean getUnsavedFlag() {
+ SessionFlagFile laststored = new SessionFlagFile(new File(sessionDir,
+ MODIFIEDDOC_FILE));
+ return laststored.checkFlag();
+ }
+
+ /**
+ * log file location
+ */
+ public static final String SESSION_LOG = "Log.txt";
+
+ private static Log log = LogFactory.getLog(VamsasSession.class);
+
+ protected Logger slog = Logger.getLogger("uk.ac.vamsas.client.SessionLog");
+
+ /**
+ * the appender that writes to the log file inside the session's directory.
+ */
+ private FileAppender slogAppender = null;
+
+ /**
+ * setup the sessionLog using Log4j.
+ *
+ * @throws IOException
+ */
+ private void initLog() throws IOException {
+ // TODO: fix session event logging
+ // LATER: make dedicated appender format for session log.
+ /*
+ * Appender app = slog.getAppender("log4j.appender.SESSIONLOG"); //
+ * slog.addAppender(new FileAppender(app.getLayout(), new File(sessionDir,
+ * SESSION_LOG).getAbsolutePath())); // slog.addAppender(new
+ * FileAppender(app.getLayout(), new File(sessionDir,
+ * SESSION_LOG).getAbsolutePath())); for (Enumeration e =
+ * slog.getAllAppenders() ; e.hasMoreElements() ;) {
+ * System.out.println(e.nextElement()); }
+ */
+
+ if (slog != null) {
+ File sessionLogFile = new File(this.sessionDir, SESSION_LOG);
+ slog.addAppender(slogAppender = new FileAppender(new PatternLayout(
+ "%-4r [%t] %-5p %c %x - %m%n"), sessionLogFile.getAbsolutePath(),
+ true));
+ } else {
+ log.info("No appender for SessionLog");
+ }
+ }
+
+ private void closeSessionLog() {
+ if (slog != null) {
+ if (slogAppender != null) {
+ slog.removeAppender(slogAppender);
+ slogAppender.close();
+ slogAppender = null;
+ }
+ }
+ }
+
+ /**
+ * the sessionDir is given as the session location for new clients.
+ */
+ protected File sessionDir;
+
+ /**
+ * holds the list of attached clients
+ */
+ ClientsFile clist;
+
+ public static final String CLIENT_LIST = "Clients.obj";
+
+ /**
+ * holds the data
+ */
+ VamsasFile vamArchive;
+
+ public static final String VAMSAS_OBJ = "VamDoc.jar";
+
+ /**
+ * sets up the vamsas session files and watchers in sessionDir1
+ *
+ * @param sessionDir1
+ */
+ protected VamsasSession(File sessionDir1) throws IOException {
+ this(sessionDir1, null);
+ }
+
+ /**
+ * sets up the vamsas session files and watchers in sessionDir1
+ *
+ * @param sessionDir1
+ * @param extVamDoc
+ * null or an existing archive to initialise the session with
+ * @throws any
+ * IOExceptions from creating session directory and files.
+ * @throws error
+ * if both extVamDoc and sessionDir1 already exist (cannot import
+ * new data into session in this way)
+ */
+ protected VamsasSession(File sessionDir1, File extVamDoc) throws IOException {
+ if (sessionDir1 == null)
+ throw new Error("Null directory for VamsasSession.");
+ if (!sessionDir1.exists() && !sessionDir1.mkdir()) {
+ throw new IOException("Failed to make VamsasSession directory in "
+ + sessionDir1);
+ }
+ if (!sessionDir1.isDirectory() || !sessionDir1.canWrite()
+ || !sessionDir1.canRead()) {
+ throw new IOException("Cannot access '" + sessionDir1
+ + "' as a read/writable Directory.");
+ }
+ boolean existingSession = checkSessionFiles(sessionDir1);
+ if (existingSession) {
+ if (extVamDoc != null) {
+ throw new Error(
+ "Client Initialisation Error: Cannot join an existing session directory with an existing vamsas document to import.");
+ } else {
+ log.debug("Joining an existing session.");
+ }
+ }
+ this.sessionDir = sessionDir1;
+ initSessionObjects();
+ if (existingSession) {
+ slog.debug("Initialising additional VamsasSession instance");
+ } else {
+ slog.debug("Founding client has joined VamsasSession instance");
+ }
+
+ log.debug("Attached to VamsasSession in " + sessionDir1);
+ if (extVamDoc != null) {
+ setVamsasDocument(extVamDoc);
+ }
+ slog.debug("Session directory created.");
+ log.debug("Initialised VamsasSession in " + sessionDir1);
+ }
+
+ /**
+ * tests presence of existing sessionfiles files in dir
+ *
+ * @param dir
+ * @return
+ */
+ private boolean checkSessionFiles(File dir) throws IOException {
+ File c_file = new File(dir, CLIENT_LIST);
+ File v_doc = new File(dir, VAMSAS_OBJ);
+ if (c_file.exists() && v_doc.exists())
+ return true;
+ return false;
+ }
+
+ /**
+ * create new empty files in dir
+ *
+ */
+ private void createSessionFiles() throws IOException {
+ if (sessionDir == null)
+ throw new IOException(
+ "Invalid call to createSessionFiles() with null sessionDir");
+ File c_file = new File(sessionDir, CLIENT_LIST);
+ File v_doc = new File(sessionDir, VAMSAS_OBJ);
+ if (!c_file.exists() && c_file.createNewFile())
+ log.debug("Created new ClientFile " + c_file); // don't care if this
+ // works or not
+ if (!v_doc.exists()) {
+ if (v_doc.createNewFile()) {
+ log.debug("Created new Vamsas Session Document File " + v_doc);
+ } else {
+ log.warn("Didn't create Vamsas Session Document file in " + v_doc);
+ }
+ }
+ }
+
+ /**
+ * construct SessionFile objects and watchers for each
+ */
+ private void initSessionObjects() throws IOException {
+ createSessionFiles();
+ if (clist != null || vamArchive != null)
+ throw new IOException(
+ "initSessionObjects called for initialised VamsasSession object.");
+ clist = new ClientsFile(new File(sessionDir, CLIENT_LIST));
+ vamArchive = new VamsasFile(new File(sessionDir, VAMSAS_OBJ));
+ storedocfile = new ClientsFile(new File(sessionDir, CLOSEANDSAVE_FILE));
+ initLog();
+ }
+
+ /**
+ * make a new watcher object for the clientFile
+ *
+ * @return new ClientFile watcher instance
+ */
+ public FileWatcher getClientWatcher() {
+ return new FileWatcher(clist.sessionFile);
+ }
+
+ /**
+ * make a new watcher object for the vamsas Document
+ *
+ * @return new ClientFile watcher instance
+ */
+ public FileWatcher getDocWatcher() {
+ return new FileWatcher(vamArchive.sessionFile);
+ }
+
+ FileWatcher store_doc_file = null;
+
+ public ClientsFile storedocfile = null;
+
+ /**
+ * make a new watcher object for the messages file
+ *
+ * @return new watcher instance
+ */
+ public FileWatcher getStoreWatcher() {
+ return new FileWatcher(new File(sessionDir, CLOSEANDSAVE_FILE));
+
+ }
+
+ /**
+ * write to the StoreWatcher file to indicate that a storeDocumentRequest has
+ * been made. The local client's storeWatcher FileWatcher object is updated so
+ * the initial change is not registered.
+ *
+ * @param client
+ * @param user
+ * @return
+ */
+ public void addStoreDocumentRequest(ClientHandle client, UserHandle user)
+ throws IOException {
+ // TODO: replace this with clientsFile mechanism
+ SessionFile sfw = new SessionFile(new File(sessionDir, CLOSEANDSAVE_FILE));
+ while (!sfw.lockFile())
+ log.debug("Trying to get lock for " + CLOSEANDSAVE_FILE);
+ RandomAccessFile sfwfile = sfw.fileLock.getRaFile();
+ sfwfile.setLength(0); // wipe out any old info.
+ // TODO: rationalise what gets written to this file (ie do we want other
+ // clients to read the id of the requestor?)
+ sfwfile.writeUTF(client.getClientUrn() + ":" + user.getFullName() + "@"
+ + user.getOrganization());
+ sfw.unlockFile();
+ if (store_doc_file != null)
+ store_doc_file.setState();
+ slog.info("FinalizeAppData request from " + user.getFullName() + " using "
+ + client.getClientUrn() + "");
+ }
+
+ /**
+ * create a new session with an existing vamsas Document - by copying it into
+ * the session.
+ *
+ * @param archive
+ */
+ public void setVamsasDocument(File archive) throws IOException {
+ log.debug("Transferring vamsas data from " + archive + " to session:"
+ + vamArchive.sessionFile);
+ SessionFile xtantdoc = new SessionFile(archive);
+ while (!vamArchive.lockFile())
+ log.info("Trying to get lock for " + vamArchive.sessionFile);
+ vamArchive.updateFrom(null, xtantdoc);
+ xtantdoc.unlockFile();
+ unlockVamsasDocument();
+ // TODO: session archive provenance should be updated to reflect import from
+ // external source
+ log.debug("Transfer complete.");
+ }
+
+ /**
+ * write session as a new vamsas Document (this will overwrite any existing
+ * file without warning) TODO: test TODO: verify that lock should be released
+ * for vamsas document.
+ *
+ * @param destarchive
+ */
+ protected void writeVamsasDocument(File destarchive, Lock extlock)
+ throws IOException {
+ log.debug("Transferring vamsas data from " + vamArchive.sessionFile
+ + " to session:" + destarchive);
+ SessionFile newdoc = new SessionFile(destarchive);
+ if (extlock == null && !vamArchive.lockFile())
+ while (!vamArchive.lockFile())
+ log.info("Trying to get lock for " + vamArchive.sessionFile);
+ // TODO: LATER: decide if a provenance entry should be written in the
+ // exported document recording the export from the session
+ newdoc.updateFrom(null, vamArchive);
+ // LATER: LATER: fix use of updateFrom for file systems where locks cannot
+ // be made (because they don't have a lockManager, ie NFS/Unix, etc).
+ vamArchive.unLock();
+ newdoc.unlockFile();
+ log.debug("Transfer complete.");
+ }
+
+ /**
+ * extant archive IO handler
+ */
+ VamsasArchive _va = null;
+
+ /**
+ * Creates a VamsasArchive Vobject for accessing and updating document Note:
+ * this will lock the Vamsas Document for exclusive access to the client.
+ *
+ * @return session vamsas document
+ * @throws IOException
+ * if locks fail or vamsas document read fails.
+ */
+ protected VamsasArchive getVamsasDocument() throws IOException {
+ // check we haven't already done this once - probably should be done by
+ // caller
+ if (_va != null)
+ return _va;
+ // patiently wait for a lock on the document. (from
+ // ArchiveClient.getUpdateable())
+ long tries = 5000;
+ while (vamArchive.getLock() == null && --tries > 0) {
+ // Thread.sleep(1);
+ log.debug("Trying to get a document lock for the " + tries + "'th time.");
+ }
+ if (tries == 0)
+ throw new IOException("Failed to get lock for vamsas archive.");
+
+ VamsasArchive va = new VamsasArchive(vamArchive.sessionFile, false, true,
+ vamArchive);
+
+ return va;
+ }
+
+ /**
+ * Unlocks the vamsas archive session document after it has been closed.
+ *
+ * @throws IOException
+ */
+ protected void unlockVamsasDocument() throws IOException {
+ if (_va != null)
+ _va.closeArchive();
+ _va = null;
+ if (vamArchive != null)
+ vamArchive.unLock();
+
+ }
+
+ /**
+ * create a uniquely named
+ * uk.ac.vamsas.client.simpleclient.ClientsFile.addClient(ClientHandle)ile in
+ * the session Directory
+ *
+ * @see java.io.File.createTempFile
+ * @param pref
+ * Prefix for name
+ * @param suff
+ * Suffix for name
+ * @return SessionFile object configured for the new file (of length zero)
+ * @throws IOException
+ */
+ protected SessionFile getTempSessionFile(String pref, String suff)
+ throws IOException {
+ File tfile = File.createTempFile(pref, suff, sessionDir);
+ SessionFile tempFile = new SessionFile(tfile);
+ return tempFile;
+ }
+
+ /**
+ * add a IClient to the session
+ *
+ * add the client to the client list file
+ *
+ * @param client
+ * client to add to the session
+ */
+ protected void addClient(SimpleClient client) {
+ if (client == null)
+ slog.error("Try to add a null client to the session ");
+ else {
+ log.debug("Adding client " + client.getClientHandle().getClientUrn());
+ getClientWatcherElement().haltWatch();
+ clist.addClient(client.getClientHandle());
+
+ log.debug("Added.");
+ log.debug("Register Client as Active.");
+ try {
+ client.createActiveClientFile();
+ } catch (IOException e) {
+ log.debug("Error during active client file creation.");
+ }
+ // tracks modification to the client list and readds client to the list
+ getClientWatcherElement().setHandler(new AddClientWatchCallBack(client));
+ getClientWatcherElement().enableWatch();
+
+ }
+ }
+
+ /**
+ * Handler for the client watcher.
+ *
+ * If (the current client is not in the client list, it is added again;)
+ */
+ private class AddClientWatchCallBack implements WatcherCallBack {
+
+ private SimpleClient client;
+
+ /**
+ * Inits the handler with the client to check in the list
+ *
+ * @param client
+ * client to monitor in the client list
+ */
+ protected AddClientWatchCallBack(SimpleClient client) {
+ this.client = client;
+ }
+
+ /**
+ * If the client list is modified, checks if the current is still in the
+ * list. otherwise, readds ti.
+ *
+ * @return true to enable watcher, or false to disable it in future
+ * WatcherThread cycles.
+ */
+ public boolean handleWatchEvent(WatcherElement watcher, Lock lock) {
+ boolean isWatchEnable = watcher.isWatchEnabled();
+ if (lock == null)// no update on the list
+ return isWatchEnable;
+ log.debug("change on the client list ");
+ if (client != null) {
+
+ // checks if the client is not already in the lists
+ ClientHandle[] cl = clist.retrieveClientList(lock);// clist.retrieveClientList();
+ boolean found = false;
+ if (cl != null) {
+ for (int chi = cl.length - 1; !found && chi > -1; chi--) {
+ found = cl[chi].equals(this.client.getClientHandle());
+ }
+
+ }
+ if (!found) {
+ log.debug("client not in the list ");
+ if (log.isDebugEnabled())
+ log
+ .debug("the client has not been found in the list. Adding it again :"
+ + cl);
+ addClient(client);
+ } else
+ log.debug("client is in the list");
+
+ }
+ log.debug("isWatchEnable " + isWatchEnable);
+ return isWatchEnable;
+ }
+ }
+
+ /**
+ *
+ * removes a client from the current session removes the client from the
+ * session client list if the client is the last one from the session
+ * (ClientList), the current session is removed from active session list.
+ *
+ * The active should add them self to the client list. To insure to close the
+ * session,when the current client is the lact active client, clears the list
+ * of clients and when two cycles to insure there is no more active client,
+ * that otherwise would have readd themself to the list
+ *
+ * @param client
+ * client to remove
+ */
+ protected void removeClient(SimpleClient client)// IClient client)
+ {
+ if (client == null) {
+ log.error("Null client passed to removeClient");
+ return;
+ }
+ // ClientSessionFileWatcherElement cwe=getClientWatcherElement();
+ // if (cwe!=null && cwe.isWatchEnabled()) {
+ // cwe.haltWatch();
+ // };
+ // set handler to check is the the last active client of the session
+ // Wait for several watchers cycle to see if the current client was the last
+ // client active in the session.
+ // if yes, close the session
+
+ // getClientWatcherElement().setHandler(new RemoveClientWatchCallBack
+ // (client));
+ // getClientWatcherElement().setTimeoutBeforeLastCycle(this.watchCycleCountBeforeLastClient);
+ log.info("remove client from list");
+ if (clistWatchElement != null) {
+ clistWatchElement.haltWatch();
+ clistWatchElement.watched.unlockFile();
+ }
+ // clist.clearList();
+ // clist.unlockFile();
+ log.info("list cleared");
+ // if (cwe!=null) {
+ // cwe.enableWatch();
+
+ log.debug("Stopping EventGenerator..");
+ client.evgen.stopWatching();
+ // cwe.setHandler(null);
+ // ask to the client to copy application data into the document
+ client.evgen._raise(Events.DOCUMENT_FINALIZEAPPDATA, null, client, null);
+ boolean closeSession = isLastActiveClient(client);
+ if (closeSession) {
+ if (client.get_session().getUnsavedFlag()) {
+ log.debug("Raising request-to-save event");
+ client.evgen._raise(Events.DOCUMENT_REQUESTTOCLOSE, null, client, null);
+ }
+ log.debug("Raising session shutdown event");
+ client.evgen._raise(Events.SESSION_SHUTDOWN, null, client
+ .getSessionHandle(), null);
+ log.debug("All events raised for finalising session "
+ + client.getSessionHandle().toString());
+ }
+ // cwe.haltWatch();
+ client.evgen.stopWatching();
+ try {
+ log.debug("Attempting to release active client locks");
+ client.releaseActiveClientFile();
+ } catch (IOException e) {
+ log.error("error during active file client release");
+ }
+ tidyUp();
+ if (closeSession) {
+ log.debug("Last active client: closing session");
+ log.info("Closing session");
+ getSessionManager().removeSession(client.getSessionHandle());
+ }
+ }
+
+ /**
+ * close every file and stop.
+ */
+ private void tidyUp() {
+ if (clist != null)
+ clist.unlockFile();
+ clist = null;
+ storedocfile.unlockFile();
+ storedocfile = null;
+ closeSessionLog();
+ }
+
+ private boolean isLastActiveClient(SimpleClient client) {
+ log.debug("Testing if current client is the last one.");
+ log
+ .debug("current client lockfile is '" + client.getClientlockFile()
+ + "'");
+ boolean noOtherActiveClient = true;
+ // create, if need, subdirectory to contain client files
+ File clientlockFileDir = new File(this.sessionDir, clientFileDirectory);
+ if (!clientlockFileDir.exists()) {
+ log
+ .error("Something wrong the active client file does not exits... should not happen");
+ return false;
+ }
+
+ try {
+
+ // no check every file in the directory and try to get lock on it.
+ File[] clientFiles = clientlockFileDir.listFiles();
+ if (clientFiles == null || clientFiles.length == 0) {// there is not file
+ // on the directory.
+ // the current
+ // client should be
+ // the last one.
+ return true;
+ }
+
+ for (int i = clientFiles.length - 1; i > -1 && noOtherActiveClient; i--) {
+ File clientFile = clientFiles[i];
+ log.debug("testing file for lock: " + clientFile.getAbsolutePath());
+ if (client.getClientLock().isTargetLockFile(clientFile)) {
+ log.debug("current client file found");
+ continue;
+ }
+ if (clientFile != null && clientFile.exists()) {
+ try {
+ log.debug("Try to acquire a lock on the file");
+ // Get a file channel for the file
+ FileChannel channel = new RandomAccessFile(clientFile, "rw")
+ .getChannel();
+
+ // Use the file channel to create a lock on the file.
+ // This method blocks until it can retrieve the lock.
+ // java.nio.channels.FileLock activeClientFilelock = channel.lock();
+
+ // Try acquiring the lock without blocking. This method returns
+ // null or throws an exception if the file is already locked.
+ try {
+ java.nio.channels.FileLock activeClientFilelock = channel
+ .tryLock();
+
+ // the lock has been acquired.
+ // the file was not lock and so the corresponding application
+ // seems to have die
+ if (activeClientFilelock != null) {
+ log
+ .debug("lock obtained : file must be from a crashed application");
+
+ activeClientFilelock.release();
+ log.debug("lock released");
+
+ channel.close();
+ log.debug("channel closed");
+
+ // delete file
+ clientFile.delete();
+ log.debug("crashed application file deleted");
+
+ } else {
+ noOtherActiveClient = false;
+ log.debug("lock not obtained : another application is active");
+ }
+ } catch (OverlappingFileLockException e) {
+ // File is already locked in this thread or virtual machine
+ // that the expected behaviour
+ log.debug("lock not accessible ", e);
+ }
+ } catch (Exception e) {
+ log.debug("error during lock testing ", e);
+ }
+ }
+ }
+
+ } catch (Exception e) {
+ log.error("error during counting active clients");
+ }
+ return noOtherActiveClient;
+ }
+
+ /**
+ * Handler for the client watcher. after a client have been removed
+ *
+ * Checks if the client is not the last active one.
+ *
+ * If (the current client is not in the client list readd it;)
+ */
+ private class RemoveClientWatchCallBack implements WatcherCallBack {
+
+ private SimpleClient client;
+
+ private boolean manualCheckOfClientCount = false;
+
+ /**
+ * Inits the handler with the client to check in the list
+ *
+ * @param client
+ * client to monitor in the client list
+ */
+ protected RemoveClientWatchCallBack(SimpleClient client) {
+ this.client = client;
+ }
+
+ /**
+ * If the client list is modified, checks if the current is still in the
+ * list. otherwise, readds ti.
+ *
+ * @return true to enable watcher, or false to disable it in future
+ * WatcherThread cycles.
+ */
+ public boolean handleWatchEvent(WatcherElement watcher, Lock lock) {
+ // if lock is null, no client has been added since last, clear.
+ // the client is then the last client
+ if (client != null) {
+
+ if (lock == null) {
+
+ // checks if the client is not already in the lists
+ // ClientHandle[] cl =
+ // clist.retrieveClientList();//lock);//clist.retrieveClientList();
+
+ boolean islastClient = true;
+ if (manualCheckOfClientCount) {
+ log.debug("manual checking of count of client");
+ // checks if the client is not already in the lists
+ ClientHandle[] cl = clist.retrieveClientList();// lock);//clist.retrieveClientList();
+ if (cl == null || cl.length < 1)
+ // {//no client has registered as active
+ {
+ islastClient = true;
+ log.debug("list is empty");
+ } else
+ islastClient = false;
+ log.debug("list is not empty");
+ }
+ // if(cl == null || cl.length<1 )
+ // {//no client has registered as active
+ if (islastClient) {
+ // the client is the last one, so close current session
+ log
+ .info("FROMCLIENTLIST WATCHER: last client removed: closing session");
+ closeSession(client);
+ }
+ } else {
+ log.debug("not the last client found ");
+ // ask to the client to cpoy application data into the document
+ // client.evgen._raise(Events.DOCUMENT_FINALIZEAPPDATA, null,
+ // client,null);
+
+ // / }
+
+ }
+ log.debug("Stopping EventGenerator..");
+ // TODO: ensure ClientsFile lock is really released!!
+ // clist.unlockFile();
+ client.evgen.stopWatching();
+ }
+ watcher.setHandler(null);// Do not check if the client is the last
+ // client. watcher will shutdown anyway
+ // watcher.haltWatch();
+ // watcher.
+ return false;
+ }
+ }
+
+ /**
+ * closes the current session, and send an event to the last client to close
+ * the document
+ *
+ * @param client
+ * the last client of the client
+ */
+ private void closeSession(SimpleClient client) {
+ // close document
+ client.evgen._raise(Events.DOCUMENT_REQUESTTOCLOSE, null, client, null);
+ log.debug("close document request done");
+ closeSession(client.getSessionHandle());
+ }
+
+ /**
+ * CLoses the current session
+ *
+ * @param sessionHandle
+ * sessionHandle of the session to remove
+ */
+ private void closeSession(SessionHandle sessionHandle) {
+ getSessionManager().removeSession(sessionHandle);
+ log.debug("Session removed");
+ }
+
+ /**
+ * @return the sessionManager
+ */
+ protected SimpleSessionManager getSessionManager() {
+ return sessionManager;
+ }
+
+ /**
+ * @param sessionManager
+ * the sessionManager to set
+ */
+ protected void setSessionManager(SimpleSessionManager sessionManager) {
+ this.sessionManager = sessionManager;
+ }
+
+ public ClientsFile getStoreDocFile() {
+ if (storedocfile == null) {
+
+ }
+ return storedocfile;
+ }
+
+ ClientSessionFileWatcherElement clistWatchElement = null;
+
+ /**
+ * get or create a watcher on clist.
+ *
+ * @return the contents of clistWatchElement or initialise it
+ */
+ public ClientSessionFileWatcherElement getClientWatcherElement() {
+ if (clistWatchElement == null) {
+ clistWatchElement = new ClientSessionFileWatcherElement(clist, null);
+ }
+ return clistWatchElement;
+ }
+}
diff --git a/src/uk/ac/vamsas/client/simpleclient/WatcherCallBack.java b/src/uk/ac/vamsas/client/simpleclient/WatcherCallBack.java
index 28ff915..7c7e5b1 100644
--- a/src/uk/ac/vamsas/client/simpleclient/WatcherCallBack.java
+++ b/src/uk/ac/vamsas/client/simpleclient/WatcherCallBack.java
@@ -1,12 +1,35 @@
+/*
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
+ */
package uk.ac.vamsas.client.simpleclient;
/**
- * Interface for VamsasFileWatcherElement call back events generated by the VamsasFileWatcherThread.
+ * Interface for VamsasFileWatcherElement call back events generated by the
+ * VamsasFileWatcherThread.
*/
public interface WatcherCallBack {
/**
*
- * @return true to enable watcher, or false to disable it in future WatcherThread cycles.
+ * @return true to enable watcher, or false to disable it in future
+ * WatcherThread cycles.
*/
public boolean handleWatchEvent(WatcherElement watcher, Lock lock);
}
diff --git a/src/uk/ac/vamsas/client/simpleclient/WatcherElement.java b/src/uk/ac/vamsas/client/simpleclient/WatcherElement.java
index b3235d5..80f9606 100644
--- a/src/uk/ac/vamsas/client/simpleclient/WatcherElement.java
+++ b/src/uk/ac/vamsas/client/simpleclient/WatcherElement.java
@@ -1,16 +1,40 @@
+/*
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
+ */
package uk.ac.vamsas.client.simpleclient;
-
-
public abstract class WatcherElement {
- private static org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory.getLog(VamsasFileWatcherElement.class);
+ private static org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory
+ .getLog(VamsasFileWatcherElement.class);
+
protected FileWatcher watcher = null;
+
protected WatcherCallBack handler = null;
+
/**
* set this to false to stop the thread
*/
protected boolean watchForChange = true;
+
/**
* true when the handler is being called for this watcher
*/
@@ -19,77 +43,78 @@ public abstract class WatcherElement {
public WatcherElement(WatcherCallBack handler) {
this.handler = handler;
}
+
/**
- * will instruct watcher to stop and wait around for one WATCH_SLEEP
- * before returning. If no thread is running then it returns immediately.
+ * will instruct watcher to stop and wait around for one WATCH_SLEEP before
+ * returning. If no thread is running then it returns immediately.
*/
public void haltWatch() {
// set the flag to skip this watch element.
- watchForChange=false;
+ watchForChange = false;
if (log.isDebugEnabled())
- log.debug("haltWatch on "+watcher.getSubject());
+ log.debug("haltWatch on " + watcher.getSubject());
endWatch();
if (log.isDebugEnabled())
- log.debug("haltWatch completed on "+watcher.getSubject());
+ log.debug("haltWatch completed on " + watcher.getSubject());
}
+
/**
- * called by haltWatch before
- * clearing the FileWatcher reference.
- *
+ * called by haltWatch before clearing the FileWatcher reference.
+ *
*/
protected abstract void endWatch();
+
/**
- * called to generate the watcher object
- * by enableWatch and in doWatch
- *
+ * called to generate the watcher object by enableWatch and in doWatch
+ *
*/
protected abstract void initWatch();
+
/**
* implemented for debug information purposes.
+ *
* @return Informative string about what the watcher is watching
*/
protected abstract String getSubject();
+
/**
- * must be called by implementations of
- * enablewatch
+ * must be called by implementations of enablewatch
*/
protected void enableWatch() {
if (log.isDebugEnabled())
- log.debug("enableWatch on "+getSubject());
- watchForChange=true;
+ log.debug("enableWatch on " + getSubject());
+ watchForChange = true;
initWatch();
if (log.isDebugEnabled())
- log.debug("enableWatch returning on "+getSubject());
+ log.debug("enableWatch returning on " + getSubject());
}
/**
* Originally from the uk.ac.vamsas.test.simpleclient.ArchiveClient method
+ *
* @return true if the handler was called for a changeEvent
*/
public boolean doWatch() {
- if (!watchForChange || handler==null)
+ if (!watchForChange || handler == null)
return false;
- if (watcher==null)
+ if (watcher == null)
initWatch(); // somehow not done the first time
- handlerCalled=false;
- Lock doclock=null;
+ handlerCalled = false;
+ Lock doclock = null;
try {
- doclock=watcher.getChangedState();
+ doclock = watcher.getChangedState();
} catch (Exception e) {
- log.error("Whilst watching "+watcher.getSubject(), e);
+ log.error("Whilst watching " + watcher.getSubject(), e);
}
- if (doclock==null)
+ if (doclock == null)
return false;
- /* handlerCalled=true;
- if (log.isDebugEnabled())
- log.debug("Triggering watchEvent for change on "+watcher.getSubject());
- boolean finish=!handler.handleWatchEvent(this, doclock);
- doclock=null; // TODO: check that lock should really be released rather than dereferenced
- if (finish)
- haltWatch();
- else
- enableWatch();
- handlerCalled=false;*/
+ /*
+ * handlerCalled=true; if (log.isDebugEnabled())
+ * log.debug("Triggering watchEvent for change on "+watcher.getSubject());
+ * boolean finish=!handler.handleWatchEvent(this, doclock); doclock=null; //
+ * TODO: check that lock should really be released rather than dereferenced
+ * if (finish) haltWatch(); else enableWatch(); handlerCalled=false;
+ */
this.callHandler(doclock);
return true;
}
@@ -97,33 +122,36 @@ public abstract class WatcherElement {
/**
* Calls the current eventhandler
*
- * @param doclock the lock on the watch file
+ * @param doclock
+ * the lock on the watch file
*/
- protected void callHandler(Lock doclock)
- {
- if (log.isDebugEnabled())
- log.debug("Triggering watchEvent for change on "+watcher.getSubject());
- boolean finish=!handler.handleWatchEvent(this, doclock);
- doclock=null; // TODO: check that lock should really be released rather than dereferenced
- if (finish)
- haltWatch();
- else
- enableWatch();
- handlerCalled=false;
+ protected void callHandler(Lock doclock) {
+ if (log.isDebugEnabled())
+ log.debug("Triggering watchEvent for change on " + watcher.getSubject());
+ boolean finish = !handler.handleWatchEvent(this, doclock);
+ doclock = null; // TODO: check that lock should really be released rather
+ // than dereferenced
+ if (finish)
+ haltWatch();
+ else
+ enableWatch();
+ handlerCalled = false;
}
-
+
/**
* @return the handler
*/
public WatcherCallBack getHandler() {
return handler;
}
+
/**
* @return the handlerCalled
*/
public boolean isHandlerCalled() {
return handlerCalled;
}
+
/**
*
* @return true if watcher is enabled
@@ -131,12 +159,15 @@ public abstract class WatcherElement {
public boolean isWatchEnabled() {
return watchForChange;
}
+
/**
- * @param handler the handler to set
+ * @param handler
+ * the handler to set
*/
public void setHandler(WatcherCallBack handler) {
this.handler = handler;
}
+
/**
* @return the watcher
*/
diff --git a/src/uk/ac/vamsas/objects/DocumentUpdaterEngine.java b/src/uk/ac/vamsas/objects/DocumentUpdaterEngine.java
index cb2d2c3..715d7e4 100644
--- a/src/uk/ac/vamsas/objects/DocumentUpdaterEngine.java
+++ b/src/uk/ac/vamsas/objects/DocumentUpdaterEngine.java
@@ -1,38 +1,67 @@
+/*
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
+ */
package uk.ac.vamsas.objects;
import uk.ac.vamsas.client.IClientDocument;
import uk.ac.vamsas.objects.core.*;
+
/**
- * Implements a depth first traversal over the document tree calling update handlers based on the Vobject.isUpdated() and Vobject.isNewInDocument() state at each backtrack.
+ * Implements a depth first traversal over the document tree calling update
+ * handlers based on the Vobject.isUpdated() and Vobject.isNewInDocument() state
+ * at each backtrack.
+ *
* @author JimP
- *
+ *
*/
public class DocumentUpdaterEngine {
- private static org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory.getLog(DocumentUpdaterEngine.class);
+ private static org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory
+ .getLog(DocumentUpdaterEngine.class);
+
private IDocumentUpdater handler;
+
/**
- * initialise the engine with an implementation
- * of the interface.
+ * initialise the engine with an implementation of the interface.
+ *
* @param hander
*/
public DocumentUpdaterEngine(IDocumentUpdater handler) {
super();
this.handler = handler;
}
+
/**
- * call the necessary update handlers at
- * each point on the VamsasDocument OM
- * TODO: later: Make this more elegant (use reflection and factor to single update(Object) method) ?
- * - we take the plodding, explicit approach rather than a funky generalised one here
+ * call the necessary update handlers at each point on the VamsasDocument OM
+ * TODO: later: Make this more elegant (use reflection and factor to single
+ * update(Object) method) ? - we take the plodding, explicit approach rather
+ * than a funky generalised one here
*/
public void callHandlers(IClientDocument cdoc) {
- if (cdoc==null) {
+ if (cdoc == null) {
log.debug("Null IClientDocument instance.");
return;
}
VAMSAS[] roots = cdoc.getVamsasRoots();
- if (roots!=null) {
- for (int r=0; r.
+ */
package uk.ac.vamsas.objects;
import uk.ac.vamsas.objects.core.*;
-public class EmptyDocumentUpdater implements IDocumentUpdater
-{
- public void update(Alignment vobj) {}
-
- public void update(AlignmentAnnotation vobj) {}
-
- public void update(AlignmentSequence vobj) {}
-
- public void update(AlignmentSequenceAnnotation vobj) {}
-
- public void update(AnnotationElement vobj) {}
-
- public void update(AppData vobj) {}
-
- public void update(ApplicationData vobj) {}
-
- public void update(Common vobj) {}
-
- public void update(DataSet vobj) {}
-
- public void update(DataSetAnnotations vobj) {}
-
- public void update(DbRef vobj) {}
-
- public void update(Entry vobj) {}
-
- public void update(Glyph vobj) {}
-
- public void update(Input vobj) {}
-
- public void update(Instance vobj) {}
-
- public void update(Link vobj) {}
-
- public void update(LockFile vobj) {}
-
- public void update(Map vobj) {}
-
- // TODO: replace with mapRangeType handler public void update(MapList vobj) {}
-
- public void update(SequenceMapping vobj) {}
-
- public void update(Newick vobj) {}
-
- public void update(Param vobj) {}
-
- public void update(Pos vobj) {}
-
- public void update(Property vobj) {}
-
- public void update(Provenance vobj) {}
-
- public void update(RangeAnnotation vobj) {}
-
- public void update(RangeType vobj) {}
-
- public void update(Score vobj) {}
-
- public void update(Seg vobj) {}
-
- public void update(Sequence vobj) {}
-
- public void update(SequenceType vobj) {}
-
- public void update(Tree vobj) {}
-
- public void update(User vobj) {}
-
- public void update(VAMSAS vobj) {}
-
- public void update(VamsasDocument vobj) {}
-}
\ No newline at end of file
+public class EmptyDocumentUpdater implements IDocumentUpdater {
+ public void update(Alignment vobj) {
+ }
+
+ public void update(AlignmentAnnotation vobj) {
+ }
+
+ public void update(AlignmentSequence vobj) {
+ }
+
+ public void update(AlignmentSequenceAnnotation vobj) {
+ }
+
+ public void update(AnnotationElement vobj) {
+ }
+
+ public void update(AppData vobj) {
+ }
+
+ public void update(ApplicationData vobj) {
+ }
+
+ public void update(Common vobj) {
+ }
+
+ public void update(DataSet vobj) {
+ }
+
+ public void update(DataSetAnnotations vobj) {
+ }
+
+ public void update(DbRef vobj) {
+ }
+
+ public void update(Entry vobj) {
+ }
+
+ public void update(Glyph vobj) {
+ }
+
+ public void update(Input vobj) {
+ }
+
+ public void update(Instance vobj) {
+ }
+
+ public void update(Link vobj) {
+ }
+
+ public void update(LockFile vobj) {
+ }
+
+ public void update(Map vobj) {
+ }
+
+ // TODO: replace with mapRangeType handler public void update(MapList vobj) {}
+
+ public void update(SequenceMapping vobj) {
+ }
+
+ public void update(Newick vobj) {
+ }
+
+ public void update(Param vobj) {
+ }
+
+ public void update(Pos vobj) {
+ }
+
+ public void update(Property vobj) {
+ }
+
+ public void update(Provenance vobj) {
+ }
+
+ public void update(RangeAnnotation vobj) {
+ }
+
+ public void update(RangeType vobj) {
+ }
+
+ public void update(Score vobj) {
+ }
+
+ public void update(Seg vobj) {
+ }
+
+ public void update(Sequence vobj) {
+ }
+
+ public void update(SequenceType vobj) {
+ }
+
+ public void update(Tree vobj) {
+ }
+
+ public void update(User vobj) {
+ }
+
+ public void update(VAMSAS vobj) {
+ }
+
+ public void update(VamsasDocument vobj) {
+ }
+}
diff --git a/src/uk/ac/vamsas/objects/IDocumentUpdater.java b/src/uk/ac/vamsas/objects/IDocumentUpdater.java
index bb8e2ae..c8ffc09 100644
--- a/src/uk/ac/vamsas/objects/IDocumentUpdater.java
+++ b/src/uk/ac/vamsas/objects/IDocumentUpdater.java
@@ -1,76 +1,96 @@
+/*
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
+ */
package uk.ac.vamsas.objects;
import uk.ac.vamsas.objects.core.*;
-public interface IDocumentUpdater
-{
- public void update(Alignment vobj);
-
- public void update(AlignmentAnnotation vobj);
-
- public void update(AlignmentSequence vobj);
-
- public void update(AlignmentSequenceAnnotation vobj);
-
- public void update(AnnotationElement vobj);
-
- public void update(AppData vobj);
-
- public void update(ApplicationData vobj);
-
- public void update(Common vobj);
-
- public void update(DataSet vobj);
-
- public void update(DataSetAnnotations vobj);
-
- public void update(DbRef vobj);
-
- public void update(Entry vobj);
-
- public void update(Glyph vobj);
-
- public void update(Input vobj);
-
- public void update(Instance vobj);
-
- public void update(Link vobj);
-
- public void update(LockFile vobj);
-
- public void update(Map vobj);
-
+public interface IDocumentUpdater {
+ public void update(Alignment vobj);
+
+ public void update(AlignmentAnnotation vobj);
+
+ public void update(AlignmentSequence vobj);
+
+ public void update(AlignmentSequenceAnnotation vobj);
+
+ public void update(AnnotationElement vobj);
+
+ public void update(AppData vobj);
+
+ public void update(ApplicationData vobj);
+
+ public void update(Common vobj);
+
+ public void update(DataSet vobj);
+
+ public void update(DataSetAnnotations vobj);
+
+ public void update(DbRef vobj);
+
+ public void update(Entry vobj);
+
+ public void update(Glyph vobj);
+
+ public void update(Input vobj);
+
+ public void update(Instance vobj);
+
+ public void update(Link vobj);
+
+ public void update(LockFile vobj);
+
+ public void update(Map vobj);
+
// TODO: replace with mapRangeType handler public void update(MapList vobj) {}
-
- public void update(SequenceMapping vobj);
-
- public void update(Newick vobj);
-
- public void update(Param vobj);
-
- public void update(Pos vobj);
-
- public void update(Property vobj);
-
- public void update(Provenance vobj);
-
- public void update(RangeAnnotation vobj);
-
- public void update(RangeType vobj);
-
- public void update(Score vobj);
-
- public void update(Seg vobj);
-
- public void update(Sequence vobj);
-
- public void update(SequenceType vobj);
-
- public void update(Tree vobj);
-
- public void update(User vobj);
-
- public void update(VAMSAS vobj);
-
- public void update(VamsasDocument vobj);
-}
\ No newline at end of file
+
+ public void update(SequenceMapping vobj);
+
+ public void update(Newick vobj);
+
+ public void update(Param vobj);
+
+ public void update(Pos vobj);
+
+ public void update(Property vobj);
+
+ public void update(Provenance vobj);
+
+ public void update(RangeAnnotation vobj);
+
+ public void update(RangeType vobj);
+
+ public void update(Score vobj);
+
+ public void update(Seg vobj);
+
+ public void update(Sequence vobj);
+
+ public void update(SequenceType vobj);
+
+ public void update(Tree vobj);
+
+ public void update(User vobj);
+
+ public void update(VAMSAS vobj);
+
+ public void update(VamsasDocument vobj);
+}
diff --git a/src/uk/ac/vamsas/objects/IVorbaBinding.java b/src/uk/ac/vamsas/objects/IVorbaBinding.java
index f70a3dd..bc7198f 100644
--- a/src/uk/ac/vamsas/objects/IVorbaBinding.java
+++ b/src/uk/ac/vamsas/objects/IVorbaBinding.java
@@ -1,5 +1,23 @@
-/**
+/*
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
*
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
package uk.ac.vamsas.objects;
@@ -7,39 +25,48 @@ import uk.ac.vamsas.client.Vobject;
import uk.ac.vamsas.client.VorbaId;
/**
- * Provides methods to map between VorbaIds and arbitrary object references
- * for use by a vamsas Application when moving between its own datamodel and the
- * Vamsas session objects.
- * The implementing class needs a valid client-document instance if it is expected
- * to be able to register newly created vObjects. Normally this will be the case if
- * the implementing class has been generated by an IClient implementation which will
- * also have passed it a reference to the current valid IClientDocument instance for
- * that application's document access thread.
- * TODO: add remove/clear binding functions - currently you can just pass a null
- * to either argument for bindAppsObjectToVamsasObject to remove the binding from memory.
+ * Provides methods to map between VorbaIds and arbitrary object references for
+ * use by a vamsas Application when moving between its own datamodel and the
+ * Vamsas session objects. The implementing class needs a valid client-document
+ * instance if it is expected to be able to register newly created vObjects.
+ * Normally this will be the case if the implementing class has been generated
+ * by an IClient implementation which will also have passed it a reference to
+ * the current valid IClientDocument instance for that application's document
+ * access thread. TODO: add remove/clear binding functions - currently you can
+ * just pass a null to either argument for bindAppsObjectToVamsasObject to
+ * remove the binding from memory.
+ *
* @author JimP
*
*/
public interface IVorbaBinding {
-/**
- * get the Vamsas session object bound to an internal object.
- * @param appObject
- * @return valid session object or Null.
- */
+ /**
+ * get the Vamsas session object bound to an internal object.
+ *
+ * @param appObject
+ * @return valid session object or Null.
+ */
Vobject getVamsasObjectFor(Object appObject);
+
/**
* Get the Application's own object bound to an existing Vamsas session object
- * @param vObject - object in vamsas document
+ *
+ * @param vObject
+ * - object in vamsas document
* @return apps object bound to the vamsas document object
*/
Object getAppsObjectFor(uk.ac.vamsas.client.Vobject vObject);
/**
- * Record a mapping between a vamsas document object and an application's internal object.
- * If either appObject or vObject parameters are null then any existing
- * binding to the non-null object will be deleted
+ * Record a mapping between a vamsas document object and an application's
+ * internal object. If either appObject or vObject parameters are null then
+ * any existing binding to the non-null object will be deleted
+ *
* @param appObject
- * @param vObject - if newly created then it will be registered using the uk.ac.vamsas.client.IClientDocument.registerObject method.
+ * @param vObject
+ * - if newly created then it will be registered using the
+ * uk.ac.vamsas.client.IClientDocument.registerObject method.
*/
- void bindAppsObjectToVamsasObject(Object appObject, uk.ac.vamsas.client.Vobject vObject);
+ void bindAppsObjectToVamsasObject(Object appObject,
+ uk.ac.vamsas.client.Vobject vObject);
}
diff --git a/src/uk/ac/vamsas/objects/core/Alignment.java b/src/uk/ac/vamsas/objects/core/Alignment.java
index ffafc47..bc95178 100644
--- a/src/uk/ac/vamsas/objects/core/Alignment.java
+++ b/src/uk/ac/vamsas/objects/core/Alignment.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import org.exolab.castor.xml.Marshaller;
@@ -17,1314 +31,1370 @@ import org.exolab.castor.xml.Unmarshaller;
/**
* Class Alignment.
*
- * @version $Revision$ $Date$
+ * @version $Revision$ $Date: 2007-06-28 14:51:44 +0100 (Thu, 28 Jun 2007)
+ * $
*/
-public class Alignment extends uk.ac.vamsas.client.Vobject
-implements java.io.Serializable
-{
-
-
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
- * Field _gapChar.
- */
- private java.lang.String _gapChar;
-
- /**
- * Field _aligned.
- */
- private boolean _aligned;
-
- /**
- * keeps track of state for field: _aligned
- */
- private boolean _has_aligned;
-
- /**
- * Primary Key for vamsas object referencing
- *
- */
- private java.lang.String _id;
-
- /**
- * Field _modifiable.
- */
- private java.lang.String _modifiable;
-
- /**
- * This is annotation over the coordinate frame
- * defined by all the columns in the alignment.
- *
- */
- private java.util.Vector _alignmentAnnotationList;
-
- /**
- * Field _treeList.
- */
- private java.util.Vector _treeList;
-
- /**
- * Field _alignmentSequenceList.
- */
- private java.util.Vector _alignmentSequenceList;
-
- /**
- * typical properties may be additional
- * alignment score objects
- */
- private java.util.Vector _propertyList;
-
- /**
- * Field _provenance.
- */
- private uk.ac.vamsas.objects.core.Provenance _provenance;
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public Alignment() {
- super();
- this._alignmentAnnotationList = new java.util.Vector();
- this._treeList = new java.util.Vector();
- this._alignmentSequenceList = new java.util.Vector();
- this._propertyList = new java.util.Vector();
- }
-
-
- //-----------/
- //- Methods -/
- //-----------/
-
- /**
- *
- *
- * @param vAlignmentAnnotation
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addAlignmentAnnotation(
- final uk.ac.vamsas.objects.core.AlignmentAnnotation vAlignmentAnnotation)
- throws java.lang.IndexOutOfBoundsException {
- this._alignmentAnnotationList.addElement(vAlignmentAnnotation);
- }
-
- /**
- *
- *
- * @param index
- * @param vAlignmentAnnotation
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addAlignmentAnnotation(
- final int index,
- final uk.ac.vamsas.objects.core.AlignmentAnnotation vAlignmentAnnotation)
- throws java.lang.IndexOutOfBoundsException {
- this._alignmentAnnotationList.add(index, vAlignmentAnnotation);
- }
-
- /**
- *
- *
- * @param vAlignmentSequence
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addAlignmentSequence(
- final uk.ac.vamsas.objects.core.AlignmentSequence vAlignmentSequence)
- throws java.lang.IndexOutOfBoundsException {
- this._alignmentSequenceList.addElement(vAlignmentSequence);
- }
-
- /**
- *
- *
- * @param index
- * @param vAlignmentSequence
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addAlignmentSequence(
- final int index,
- final uk.ac.vamsas.objects.core.AlignmentSequence vAlignmentSequence)
- throws java.lang.IndexOutOfBoundsException {
- this._alignmentSequenceList.add(index, vAlignmentSequence);
- }
-
- /**
- *
- *
- * @param vProperty
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addProperty(
- final uk.ac.vamsas.objects.core.Property vProperty)
- throws java.lang.IndexOutOfBoundsException {
- this._propertyList.addElement(vProperty);
- }
-
- /**
- *
- *
- * @param index
- * @param vProperty
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addProperty(
- final int index,
- final uk.ac.vamsas.objects.core.Property vProperty)
- throws java.lang.IndexOutOfBoundsException {
- this._propertyList.add(index, vProperty);
- }
-
- /**
- *
- *
- * @param vTree
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addTree(
- final uk.ac.vamsas.objects.core.Tree vTree)
- throws java.lang.IndexOutOfBoundsException {
- this._treeList.addElement(vTree);
- }
-
- /**
- *
- *
- * @param index
- * @param vTree
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addTree(
- final int index,
- final uk.ac.vamsas.objects.core.Tree vTree)
- throws java.lang.IndexOutOfBoundsException {
- this._treeList.add(index, vTree);
- }
-
- /**
- */
- public void deleteAligned(
- ) {
- this._has_aligned= false;
- }
-
- /**
- * Method enumerateAlignmentAnnotation.
- *
- * @return an Enumeration over all
- * uk.ac.vamsas.objects.core.AlignmentAnnotation elements
- */
- public java.util.Enumeration enumerateAlignmentAnnotation(
- ) {
- return this._alignmentAnnotationList.elements();
- }
-
- /**
- * Method enumerateAlignmentSequence.
- *
- * @return an Enumeration over all
- * uk.ac.vamsas.objects.core.AlignmentSequence elements
- */
- public java.util.Enumeration enumerateAlignmentSequence(
- ) {
- return this._alignmentSequenceList.elements();
- }
-
- /**
- * Method enumerateProperty.
- *
- * @return an Enumeration over all
- * uk.ac.vamsas.objects.core.Property elements
- */
- public java.util.Enumeration enumerateProperty(
- ) {
- return this._propertyList.elements();
- }
-
- /**
- * Method enumerateTree.
- *
- * @return an Enumeration over all
- * uk.ac.vamsas.objects.core.Tree elements
- */
- public java.util.Enumeration enumerateTree(
- ) {
- return this._treeList.elements();
- }
-
- /**
- * Overrides the java.lang.Object.equals method.
- *
- * @param obj
- * @return true if the objects are equal.
- */
- public boolean equals(
- final java.lang.Object obj) {
- if ( this == obj )
- return true;
-
- if (super.equals(obj)==false)
+public class Alignment extends uk.ac.vamsas.client.Vobject implements
+ java.io.Serializable {
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * Field _gapChar.
+ */
+ private java.lang.String _gapChar;
+
+ /**
+ * Field _aligned.
+ */
+ private boolean _aligned;
+
+ /**
+ * keeps track of state for field: _aligned
+ */
+ private boolean _has_aligned;
+
+ /**
+ * Primary Key for vamsas object referencing
+ *
+ */
+ private java.lang.String _id;
+
+ /**
+ * Field _modifiable.
+ */
+ private java.lang.String _modifiable;
+
+ /**
+ * This is annotation over the coordinate frame defined by all the columns in
+ * the alignment.
+ *
+ */
+ private java.util.Vector _alignmentAnnotationList;
+
+ /**
+ * Field _treeList.
+ */
+ private java.util.Vector _treeList;
+
+ /**
+ * Field _alignmentSequenceList.
+ */
+ private java.util.Vector _alignmentSequenceList;
+
+ /**
+ * typical properties may be additional alignment score objects
+ */
+ private java.util.Vector _propertyList;
+
+ /**
+ * Field _provenance.
+ */
+ private uk.ac.vamsas.objects.core.Provenance _provenance;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public Alignment() {
+ super();
+ this._alignmentAnnotationList = new java.util.Vector();
+ this._treeList = new java.util.Vector();
+ this._alignmentSequenceList = new java.util.Vector();
+ this._propertyList = new java.util.Vector();
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ *
+ *
+ * @param vAlignmentAnnotation
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addAlignmentAnnotation(
+ final uk.ac.vamsas.objects.core.AlignmentAnnotation vAlignmentAnnotation)
+ throws java.lang.IndexOutOfBoundsException {
+ this._alignmentAnnotationList.addElement(vAlignmentAnnotation);
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vAlignmentAnnotation
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addAlignmentAnnotation(final int index,
+ final uk.ac.vamsas.objects.core.AlignmentAnnotation vAlignmentAnnotation)
+ throws java.lang.IndexOutOfBoundsException {
+ this._alignmentAnnotationList.add(index, vAlignmentAnnotation);
+ }
+
+ /**
+ *
+ *
+ * @param vAlignmentSequence
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addAlignmentSequence(
+ final uk.ac.vamsas.objects.core.AlignmentSequence vAlignmentSequence)
+ throws java.lang.IndexOutOfBoundsException {
+ this._alignmentSequenceList.addElement(vAlignmentSequence);
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vAlignmentSequence
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addAlignmentSequence(final int index,
+ final uk.ac.vamsas.objects.core.AlignmentSequence vAlignmentSequence)
+ throws java.lang.IndexOutOfBoundsException {
+ this._alignmentSequenceList.add(index, vAlignmentSequence);
+ }
+
+ /**
+ *
+ *
+ * @param vProperty
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addProperty(final uk.ac.vamsas.objects.core.Property vProperty)
+ throws java.lang.IndexOutOfBoundsException {
+ this._propertyList.addElement(vProperty);
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vProperty
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addProperty(final int index,
+ final uk.ac.vamsas.objects.core.Property vProperty)
+ throws java.lang.IndexOutOfBoundsException {
+ this._propertyList.add(index, vProperty);
+ }
+
+ /**
+ *
+ *
+ * @param vTree
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addTree(final uk.ac.vamsas.objects.core.Tree vTree)
+ throws java.lang.IndexOutOfBoundsException {
+ this._treeList.addElement(vTree);
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vTree
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addTree(final int index,
+ final uk.ac.vamsas.objects.core.Tree vTree)
+ throws java.lang.IndexOutOfBoundsException {
+ this._treeList.add(index, vTree);
+ }
+
+ /**
+ */
+ public void deleteAligned() {
+ this._has_aligned = false;
+ }
+
+ /**
+ * Method enumerateAlignmentAnnotation.
+ *
+ * @return an Enumeration over all
+ * uk.ac.vamsas.objects.core.AlignmentAnnotation elements
+ */
+ public java.util.Enumeration enumerateAlignmentAnnotation() {
+ return this._alignmentAnnotationList.elements();
+ }
+
+ /**
+ * Method enumerateAlignmentSequence.
+ *
+ * @return an Enumeration over all uk.ac.vamsas.objects.core.AlignmentSequence
+ * elements
+ */
+ public java.util.Enumeration enumerateAlignmentSequence() {
+ return this._alignmentSequenceList.elements();
+ }
+
+ /**
+ * Method enumerateProperty.
+ *
+ * @return an Enumeration over all uk.ac.vamsas.objects.core.Property elements
+ */
+ public java.util.Enumeration enumerateProperty() {
+ return this._propertyList.elements();
+ }
+
+ /**
+ * Method enumerateTree.
+ *
+ * @return an Enumeration over all uk.ac.vamsas.objects.core.Tree elements
+ */
+ public java.util.Enumeration enumerateTree() {
+ return this._treeList.elements();
+ }
+
+ /**
+ * Overrides the java.lang.Object.equals method.
+ *
+ * @param obj
+ * @return true if the objects are equal.
+ */
+ public boolean equals(final java.lang.Object obj) {
+ if (this == obj)
+ return true;
+
+ if (super.equals(obj) == false)
+ return false;
+
+ if (obj instanceof Alignment) {
+
+ Alignment temp = (Alignment) obj;
+ boolean thcycle;
+ boolean tmcycle;
+ if (this._gapChar != null) {
+ if (temp._gapChar == null)
+ return false;
+ if (this._gapChar != temp._gapChar) {
+ thcycle = org.castor.util.CycleBreaker.startingToCycle(this._gapChar);
+ tmcycle = org.castor.util.CycleBreaker.startingToCycle(temp._gapChar);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._gapChar);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._gapChar);
+ }
+ ;
return false;
-
- if (obj instanceof Alignment) {
-
- Alignment temp = (Alignment)obj;
- boolean thcycle;
- boolean tmcycle;
- if (this._gapChar != null) {
- if (temp._gapChar == null) return false;
- if (this._gapChar != temp._gapChar) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._gapChar);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._gapChar);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._gapChar); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._gapChar); };
- return false;
- }
- if (!thcycle) {
- if (!this._gapChar.equals(temp._gapChar)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._gapChar);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._gapChar);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._gapChar);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._gapChar);
- }
- }
- } else if (temp._gapChar != null)
- return false;
- if (this._aligned != temp._aligned)
- return false;
- if (this._has_aligned != temp._has_aligned)
- return false;
- if (this._id != null) {
- if (temp._id == null) return false;
- if (this._id != temp._id) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._id);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._id);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._id); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._id); };
- return false;
- }
- if (!thcycle) {
- if (!this._id.equals(temp._id)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
- }
- }
- } else if (temp._id != null)
- return false;
- if (this._modifiable != null) {
- if (temp._modifiable == null) return false;
- if (this._modifiable != temp._modifiable) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._modifiable);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._modifiable);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._modifiable); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._modifiable); };
- return false;
- }
- if (!thcycle) {
- if (!this._modifiable.equals(temp._modifiable)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._modifiable);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._modifiable);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._modifiable);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._modifiable);
- }
- }
- } else if (temp._modifiable != null)
- return false;
- if (this._alignmentAnnotationList != null) {
- if (temp._alignmentAnnotationList == null) return false;
- if (this._alignmentAnnotationList != temp._alignmentAnnotationList) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._alignmentAnnotationList);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._alignmentAnnotationList);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._alignmentAnnotationList); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._alignmentAnnotationList); };
- return false;
- }
- if (!thcycle) {
- if (!this._alignmentAnnotationList.equals(temp._alignmentAnnotationList)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._alignmentAnnotationList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._alignmentAnnotationList);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._alignmentAnnotationList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._alignmentAnnotationList);
- }
- }
- } else if (temp._alignmentAnnotationList != null)
- return false;
- if (this._treeList != null) {
- if (temp._treeList == null) return false;
- if (this._treeList != temp._treeList) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._treeList);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._treeList);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._treeList); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._treeList); };
- return false;
- }
- if (!thcycle) {
- if (!this._treeList.equals(temp._treeList)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._treeList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._treeList);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._treeList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._treeList);
- }
- }
- } else if (temp._treeList != null)
- return false;
- if (this._alignmentSequenceList != null) {
- if (temp._alignmentSequenceList == null) return false;
- if (this._alignmentSequenceList != temp._alignmentSequenceList) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._alignmentSequenceList);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._alignmentSequenceList);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._alignmentSequenceList); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._alignmentSequenceList); };
- return false;
- }
- if (!thcycle) {
- if (!this._alignmentSequenceList.equals(temp._alignmentSequenceList)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._alignmentSequenceList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._alignmentSequenceList);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._alignmentSequenceList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._alignmentSequenceList);
- }
- }
- } else if (temp._alignmentSequenceList != null)
- return false;
- if (this._propertyList != null) {
- if (temp._propertyList == null) return false;
- if (this._propertyList != temp._propertyList) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._propertyList);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._propertyList);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._propertyList); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._propertyList); };
- return false;
- }
- if (!thcycle) {
- if (!this._propertyList.equals(temp._propertyList)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._propertyList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._propertyList);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._propertyList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._propertyList);
- }
- }
- } else if (temp._propertyList != null)
- return false;
- if (this._provenance != null) {
- if (temp._provenance == null) return false;
- if (this._provenance != temp._provenance) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._provenance);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._provenance);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance); };
- return false;
- }
- if (!thcycle) {
- if (!this._provenance.equals(temp._provenance)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance);
- }
- }
- } else if (temp._provenance != null)
- return false;
- return true;
+ }
+ if (!thcycle) {
+ if (!this._gapChar.equals(temp._gapChar)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._gapChar);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._gapChar);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._gapChar);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._gapChar);
+ }
}
+ } else if (temp._gapChar != null)
return false;
- }
-
- /**
- * Returns the value of field 'aligned'.
- *
- * @return the value of field 'Aligned'.
- */
- public boolean getAligned(
- ) {
- return this._aligned;
- }
-
- /**
- * Method getAlignmentAnnotation.
- *
- * @param index
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- * @return the value of the
- * uk.ac.vamsas.objects.core.AlignmentAnnotation at the given
- * index
- */
- public uk.ac.vamsas.objects.core.AlignmentAnnotation getAlignmentAnnotation(
- final int index)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._alignmentAnnotationList.size()) {
- throw new IndexOutOfBoundsException("getAlignmentAnnotation: Index value '" + index + "' not in range [0.." + (this._alignmentAnnotationList.size() - 1) + "]");
- }
-
- return (uk.ac.vamsas.objects.core.AlignmentAnnotation) _alignmentAnnotationList.get(index);
- }
-
- /**
- * Method getAlignmentAnnotation.Returns the contents of the
- * collection in an Array. Note: Just in case the
- * collection contents are changing in another thread, we pass
- * a 0-length Array of the correct type into the API call.
- * This way we know that the Array returned is of
- * exactly the correct length.
- *
- * @return this collection as an Array
- */
- public uk.ac.vamsas.objects.core.AlignmentAnnotation[] getAlignmentAnnotation(
- ) {
- uk.ac.vamsas.objects.core.AlignmentAnnotation[] array = new uk.ac.vamsas.objects.core.AlignmentAnnotation[0];
- return (uk.ac.vamsas.objects.core.AlignmentAnnotation[]) this._alignmentAnnotationList.toArray(array);
- }
-
- /**
- * Method getAlignmentAnnotationAsReference.Returns a reference
- * to '_alignmentAnnotationList'. No type checking is performed
- * on any modifications to the Vector.
- *
- * @return a reference to the Vector backing this class
- */
- public java.util.Vector getAlignmentAnnotationAsReference(
- ) {
- return this._alignmentAnnotationList;
- }
-
- /**
- * Method getAlignmentAnnotationCount.
- *
- * @return the size of this collection
- */
- public int getAlignmentAnnotationCount(
- ) {
- return this._alignmentAnnotationList.size();
- }
-
- /**
- * Method getAlignmentSequence.
- *
- * @param index
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- * @return the value of the
- * uk.ac.vamsas.objects.core.AlignmentSequence at the given inde
- */
- public uk.ac.vamsas.objects.core.AlignmentSequence getAlignmentSequence(
- final int index)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._alignmentSequenceList.size()) {
- throw new IndexOutOfBoundsException("getAlignmentSequence: Index value '" + index + "' not in range [0.." + (this._alignmentSequenceList.size() - 1) + "]");
- }
-
- return (uk.ac.vamsas.objects.core.AlignmentSequence) _alignmentSequenceList.get(index);
- }
-
- /**
- * Method getAlignmentSequence.Returns the contents of the
- * collection in an Array.
Note: Just in case the
- * collection contents are changing in another thread, we pass
- * a 0-length Array of the correct type into the API call.
- * This way we know that the Array returned is of
- * exactly the correct length.
- *
- * @return this collection as an Array
- */
- public uk.ac.vamsas.objects.core.AlignmentSequence[] getAlignmentSequence(
- ) {
- uk.ac.vamsas.objects.core.AlignmentSequence[] array = new uk.ac.vamsas.objects.core.AlignmentSequence[0];
- return (uk.ac.vamsas.objects.core.AlignmentSequence[]) this._alignmentSequenceList.toArray(array);
- }
-
- /**
- * Method getAlignmentSequenceAsReference.Returns a reference
- * to '_alignmentSequenceList'. No type checking is performed
- * on any modifications to the Vector.
- *
- * @return a reference to the Vector backing this class
- */
- public java.util.Vector getAlignmentSequenceAsReference(
- ) {
- return this._alignmentSequenceList;
- }
-
- /**
- * Method getAlignmentSequenceCount.
- *
- * @return the size of this collection
- */
- public int getAlignmentSequenceCount(
- ) {
- return this._alignmentSequenceList.size();
- }
-
- /**
- * Returns the value of field 'gapChar'.
- *
- * @return the value of field 'GapChar'.
- */
- public java.lang.String getGapChar(
- ) {
- return this._gapChar;
- }
-
- /**
- * Returns the value of field 'id'. The field 'id' has the
- * following description: Primary Key for vamsas object
- * referencing
- *
- *
- * @return the value of field 'Id'.
- */
- public java.lang.String getId(
- ) {
- return this._id;
- }
-
- /**
- * Returns the value of field 'modifiable'.
- *
- * @return the value of field 'Modifiable'.
- */
- public java.lang.String getModifiable(
- ) {
- return this._modifiable;
- }
-
- /**
- * Method getProperty.
- *
- * @param index
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- * @return the value of the uk.ac.vamsas.objects.core.Property
- * at the given index
- */
- public uk.ac.vamsas.objects.core.Property getProperty(
- final int index)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._propertyList.size()) {
- throw new IndexOutOfBoundsException("getProperty: Index value '" + index + "' not in range [0.." + (this._propertyList.size() - 1) + "]");
- }
-
- return (uk.ac.vamsas.objects.core.Property) _propertyList.get(index);
- }
-
- /**
- * Method getProperty.Returns the contents of the collection in
- * an Array.
Note: Just in case the collection contents
- * are changing in another thread, we pass a 0-length Array of
- * the correct type into the API call. This way we know
- * that the Array returned is of exactly the correct length.
- *
- * @return this collection as an Array
- */
- public uk.ac.vamsas.objects.core.Property[] getProperty(
- ) {
- uk.ac.vamsas.objects.core.Property[] array = new uk.ac.vamsas.objects.core.Property[0];
- return (uk.ac.vamsas.objects.core.Property[]) this._propertyList.toArray(array);
- }
-
- /**
- * Method getPropertyAsReference.Returns a reference to
- * '_propertyList'. No type checking is performed on any
- * modifications to the Vector.
- *
- * @return a reference to the Vector backing this class
- */
- public java.util.Vector getPropertyAsReference(
- ) {
- return this._propertyList;
- }
-
- /**
- * Method getPropertyCount.
- *
- * @return the size of this collection
- */
- public int getPropertyCount(
- ) {
- return this._propertyList.size();
- }
-
- /**
- * Returns the value of field 'provenance'.
- *
- * @return the value of field 'Provenance'.
- */
- public uk.ac.vamsas.objects.core.Provenance getProvenance(
- ) {
- return this._provenance;
- }
-
- /**
- * Method getTree.
- *
- * @param index
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- * @return the value of the uk.ac.vamsas.objects.core.Tree at
- * the given index
- */
- public uk.ac.vamsas.objects.core.Tree getTree(
- final int index)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._treeList.size()) {
- throw new IndexOutOfBoundsException("getTree: Index value '" + index + "' not in range [0.." + (this._treeList.size() - 1) + "]");
- }
-
- return (uk.ac.vamsas.objects.core.Tree) _treeList.get(index);
- }
-
- /**
- * Method getTree.Returns the contents of the collection in an
- * Array.
Note: Just in case the collection contents are
- * changing in another thread, we pass a 0-length Array of the
- * correct type into the API call. This way we know
- * that the Array returned is of exactly the correct length.
- *
- * @return this collection as an Array
- */
- public uk.ac.vamsas.objects.core.Tree[] getTree(
- ) {
- uk.ac.vamsas.objects.core.Tree[] array = new uk.ac.vamsas.objects.core.Tree[0];
- return (uk.ac.vamsas.objects.core.Tree[]) this._treeList.toArray(array);
- }
-
- /**
- * Method getTreeAsReference.Returns a reference to
- * '_treeList'. No type checking is performed on any
- * modifications to the Vector.
- *
- * @return a reference to the Vector backing this class
- */
- public java.util.Vector getTreeAsReference(
- ) {
- return this._treeList;
- }
-
- /**
- * Method getTreeCount.
- *
- * @return the size of this collection
- */
- public int getTreeCount(
- ) {
- return this._treeList.size();
- }
-
- /**
- * Method hasAligned.
- *
- * @return true if at least one Aligned has been added
- */
- public boolean hasAligned(
- ) {
- return this._has_aligned;
- }
-
- /**
- * Overrides the java.lang.Object.hashCode method.
- *
- * The following steps came from Effective Java Programming
- * Language Guide by Joshua Bloch, Chapter 3
- *
- * @return a hash code value for the object.
- */
- public int hashCode(
- ) {
- int result = super.hashCode();
-
- long tmp;
- if (_gapChar != null
- && !org.castor.util.CycleBreaker.startingToCycle(_gapChar)) {
- result = 37 * result + _gapChar.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_gapChar);
- }
- result = 37 * result + (_aligned?0:1);
- if (_id != null
- && !org.castor.util.CycleBreaker.startingToCycle(_id)) {
- result = 37 * result + _id.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_id);
- }
- if (_modifiable != null
- && !org.castor.util.CycleBreaker.startingToCycle(_modifiable)) {
- result = 37 * result + _modifiable.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_modifiable);
- }
- if (_alignmentAnnotationList != null
- && !org.castor.util.CycleBreaker.startingToCycle(_alignmentAnnotationList)) {
- result = 37 * result + _alignmentAnnotationList.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_alignmentAnnotationList);
- }
- if (_treeList != null
- && !org.castor.util.CycleBreaker.startingToCycle(_treeList)) {
- result = 37 * result + _treeList.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_treeList);
- }
- if (_alignmentSequenceList != null
- && !org.castor.util.CycleBreaker.startingToCycle(_alignmentSequenceList)) {
- result = 37 * result + _alignmentSequenceList.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_alignmentSequenceList);
- }
- if (_propertyList != null
- && !org.castor.util.CycleBreaker.startingToCycle(_propertyList)) {
- result = 37 * result + _propertyList.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_propertyList);
- }
- if (_provenance != null
- && !org.castor.util.CycleBreaker.startingToCycle(_provenance)) {
- result = 37 * result + _provenance.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_provenance);
- }
-
- return result;
- }
-
- /**
- * Returns the value of field 'aligned'.
- *
- * @return the value of field 'Aligned'.
- */
- public boolean isAligned(
- ) {
- return this._aligned;
- }
-
- /**
- * Method isValid.
- *
- * @return true if this object is valid according to the schema
- */
- public boolean isValid(
- ) {
- try {
- validate();
- } catch (org.exolab.castor.xml.ValidationException vex) {
+ if (this._aligned != temp._aligned)
+ return false;
+ if (this._has_aligned != temp._has_aligned)
+ return false;
+ if (this._id != null) {
+ if (temp._id == null)
+ return false;
+ if (this._id != temp._id) {
+ thcycle = org.castor.util.CycleBreaker.startingToCycle(this._id);
+ tmcycle = org.castor.util.CycleBreaker.startingToCycle(temp._id);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
+ }
+ ;
return false;
+ }
+ if (!thcycle) {
+ if (!this._id.equals(temp._id)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
+ }
}
- return true;
- }
-
- /**
- *
- *
- * @param out
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void marshal(
- final java.io.Writer out)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, out);
- }
-
- /**
- *
- *
- * @param handler
- * @throws java.io.IOException if an IOException occurs during
- * marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- */
- public void marshal(
- final org.xml.sax.ContentHandler handler)
- throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, handler);
- }
-
- /**
- * Method removeAlignmentAnnotation.
- *
- * @param vAlignmentAnnotation
- * @return true if the object was removed from the collection.
- */
- public boolean removeAlignmentAnnotation(
- final uk.ac.vamsas.objects.core.AlignmentAnnotation vAlignmentAnnotation) {
- boolean removed = _alignmentAnnotationList.remove(vAlignmentAnnotation);
- return removed;
- }
-
- /**
- * Method removeAlignmentAnnotationAt.
- *
- * @param index
- * @return the element removed from the collection
- */
- public uk.ac.vamsas.objects.core.AlignmentAnnotation removeAlignmentAnnotationAt(
- final int index) {
- java.lang.Object obj = this._alignmentAnnotationList.remove(index);
- return (uk.ac.vamsas.objects.core.AlignmentAnnotation) obj;
- }
-
- /**
- * Method removeAlignmentSequence.
- *
- * @param vAlignmentSequence
- * @return true if the object was removed from the collection.
- */
- public boolean removeAlignmentSequence(
- final uk.ac.vamsas.objects.core.AlignmentSequence vAlignmentSequence) {
- boolean removed = _alignmentSequenceList.remove(vAlignmentSequence);
- return removed;
- }
-
- /**
- * Method removeAlignmentSequenceAt.
- *
- * @param index
- * @return the element removed from the collection
- */
- public uk.ac.vamsas.objects.core.AlignmentSequence removeAlignmentSequenceAt(
- final int index) {
- java.lang.Object obj = this._alignmentSequenceList.remove(index);
- return (uk.ac.vamsas.objects.core.AlignmentSequence) obj;
- }
-
- /**
- */
- public void removeAllAlignmentAnnotation(
- ) {
- this._alignmentAnnotationList.clear();
- }
-
- /**
- */
- public void removeAllAlignmentSequence(
- ) {
- this._alignmentSequenceList.clear();
- }
-
- /**
- */
- public void removeAllProperty(
- ) {
- this._propertyList.clear();
- }
-
- /**
- */
- public void removeAllTree(
- ) {
- this._treeList.clear();
- }
-
- /**
- * Method removeProperty.
- *
- * @param vProperty
- * @return true if the object was removed from the collection.
- */
- public boolean removeProperty(
- final uk.ac.vamsas.objects.core.Property vProperty) {
- boolean removed = _propertyList.remove(vProperty);
- return removed;
- }
-
- /**
- * Method removePropertyAt.
- *
- * @param index
- * @return the element removed from the collection
- */
- public uk.ac.vamsas.objects.core.Property removePropertyAt(
- final int index) {
- java.lang.Object obj = this._propertyList.remove(index);
- return (uk.ac.vamsas.objects.core.Property) obj;
- }
-
- /**
- * Method removeTree.
- *
- * @param vTree
- * @return true if the object was removed from the collection.
- */
- public boolean removeTree(
- final uk.ac.vamsas.objects.core.Tree vTree) {
- boolean removed = _treeList.remove(vTree);
- return removed;
- }
-
- /**
- * Method removeTreeAt.
- *
- * @param index
- * @return the element removed from the collection
- */
- public uk.ac.vamsas.objects.core.Tree removeTreeAt(
- final int index) {
- java.lang.Object obj = this._treeList.remove(index);
- return (uk.ac.vamsas.objects.core.Tree) obj;
- }
-
- /**
- * Sets the value of field 'aligned'.
- *
- * @param aligned the value of field 'aligned'.
- */
- public void setAligned(
- final boolean aligned) {
- this._aligned = aligned;
- this._has_aligned = true;
- }
-
- /**
- *
- *
- * @param index
- * @param vAlignmentAnnotation
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void setAlignmentAnnotation(
- final int index,
- final uk.ac.vamsas.objects.core.AlignmentAnnotation vAlignmentAnnotation)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._alignmentAnnotationList.size()) {
- throw new IndexOutOfBoundsException("setAlignmentAnnotation: Index value '" + index + "' not in range [0.." + (this._alignmentAnnotationList.size() - 1) + "]");
- }
-
- this._alignmentAnnotationList.set(index, vAlignmentAnnotation);
- }
-
- /**
- *
- *
- * @param vAlignmentAnnotationArray
- */
- public void setAlignmentAnnotation(
- final uk.ac.vamsas.objects.core.AlignmentAnnotation[] vAlignmentAnnotationArray) {
- //-- copy array
- _alignmentAnnotationList.clear();
-
- for (int i = 0; i < vAlignmentAnnotationArray.length; i++) {
- this._alignmentAnnotationList.add(vAlignmentAnnotationArray[i]);
- }
- }
-
- /**
- * Sets the value of '_alignmentAnnotationList' by copying the
- * given Vector. All elements will be checked for type safety.
- *
- * @param vAlignmentAnnotationList the Vector to copy.
- */
- public void setAlignmentAnnotation(
- final java.util.Vector vAlignmentAnnotationList) {
- // copy vector
- this._alignmentAnnotationList.clear();
-
- this._alignmentAnnotationList.addAll(vAlignmentAnnotationList);
- }
-
- /**
- * Sets the value of '_alignmentAnnotationList' by setting it
- * to the given Vector. No type checking is performed.
- * @deprecated
- *
- * @param alignmentAnnotationVector the Vector to set.
- */
- public void setAlignmentAnnotationAsReference(
- final java.util.Vector alignmentAnnotationVector) {
- this._alignmentAnnotationList = alignmentAnnotationVector;
- }
-
- /**
- *
- *
- * @param index
- * @param vAlignmentSequence
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void setAlignmentSequence(
- final int index,
- final uk.ac.vamsas.objects.core.AlignmentSequence vAlignmentSequence)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._alignmentSequenceList.size()) {
- throw new IndexOutOfBoundsException("setAlignmentSequence: Index value '" + index + "' not in range [0.." + (this._alignmentSequenceList.size() - 1) + "]");
+ } else if (temp._id != null)
+ return false;
+ if (this._modifiable != null) {
+ if (temp._modifiable == null)
+ return false;
+ if (this._modifiable != temp._modifiable) {
+ thcycle = org.castor.util.CycleBreaker
+ .startingToCycle(this._modifiable);
+ tmcycle = org.castor.util.CycleBreaker
+ .startingToCycle(temp._modifiable);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._modifiable);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._modifiable);
+ }
+ ;
+ return false;
+ }
+ if (!thcycle) {
+ if (!this._modifiable.equals(temp._modifiable)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._modifiable);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._modifiable);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._modifiable);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._modifiable);
+ }
}
-
- this._alignmentSequenceList.set(index, vAlignmentSequence);
- }
-
- /**
- *
- *
- * @param vAlignmentSequenceArray
- */
- public void setAlignmentSequence(
- final uk.ac.vamsas.objects.core.AlignmentSequence[] vAlignmentSequenceArray) {
- //-- copy array
- _alignmentSequenceList.clear();
-
- for (int i = 0; i < vAlignmentSequenceArray.length; i++) {
- this._alignmentSequenceList.add(vAlignmentSequenceArray[i]);
+ } else if (temp._modifiable != null)
+ return false;
+ if (this._alignmentAnnotationList != null) {
+ if (temp._alignmentAnnotationList == null)
+ return false;
+ if (this._alignmentAnnotationList != temp._alignmentAnnotationList) {
+ thcycle = org.castor.util.CycleBreaker
+ .startingToCycle(this._alignmentAnnotationList);
+ tmcycle = org.castor.util.CycleBreaker
+ .startingToCycle(temp._alignmentAnnotationList);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(this._alignmentAnnotationList);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(temp._alignmentAnnotationList);
+ }
+ ;
+ return false;
+ }
+ if (!thcycle) {
+ if (!this._alignmentAnnotationList
+ .equals(temp._alignmentAnnotationList)) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(this._alignmentAnnotationList);
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(temp._alignmentAnnotationList);
+ return false;
+ }
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(this._alignmentAnnotationList);
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(temp._alignmentAnnotationList);
+ }
}
- }
-
- /**
- * Sets the value of '_alignmentSequenceList' by copying the
- * given Vector. All elements will be checked for type safety.
- *
- * @param vAlignmentSequenceList the Vector to copy.
- */
- public void setAlignmentSequence(
- final java.util.Vector vAlignmentSequenceList) {
- // copy vector
- this._alignmentSequenceList.clear();
-
- this._alignmentSequenceList.addAll(vAlignmentSequenceList);
- }
-
- /**
- * Sets the value of '_alignmentSequenceList' by setting it to
- * the given Vector. No type checking is performed.
- * @deprecated
- *
- * @param alignmentSequenceVector the Vector to set.
- */
- public void setAlignmentSequenceAsReference(
- final java.util.Vector alignmentSequenceVector) {
- this._alignmentSequenceList = alignmentSequenceVector;
- }
-
- /**
- * Sets the value of field 'gapChar'.
- *
- * @param gapChar the value of field 'gapChar'.
- */
- public void setGapChar(
- final java.lang.String gapChar) {
- this._gapChar = gapChar;
- }
-
- /**
- * Sets the value of field 'id'. The field 'id' has the
- * following description: Primary Key for vamsas object
- * referencing
- *
- *
- * @param id the value of field 'id'.
- */
- public void setId(
- final java.lang.String id) {
- this._id = id;
- }
-
- /**
- * Sets the value of field 'modifiable'.
- *
- * @param modifiable the value of field 'modifiable'.
- */
- public void setModifiable(
- final java.lang.String modifiable) {
- this._modifiable = modifiable;
- }
-
- /**
- *
- *
- * @param index
- * @param vProperty
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void setProperty(
- final int index,
- final uk.ac.vamsas.objects.core.Property vProperty)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._propertyList.size()) {
- throw new IndexOutOfBoundsException("setProperty: Index value '" + index + "' not in range [0.." + (this._propertyList.size() - 1) + "]");
+ } else if (temp._alignmentAnnotationList != null)
+ return false;
+ if (this._treeList != null) {
+ if (temp._treeList == null)
+ return false;
+ if (this._treeList != temp._treeList) {
+ thcycle = org.castor.util.CycleBreaker
+ .startingToCycle(this._treeList);
+ tmcycle = org.castor.util.CycleBreaker
+ .startingToCycle(temp._treeList);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._treeList);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._treeList);
+ }
+ ;
+ return false;
+ }
+ if (!thcycle) {
+ if (!this._treeList.equals(temp._treeList)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._treeList);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._treeList);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._treeList);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._treeList);
+ }
}
-
- this._propertyList.set(index, vProperty);
- }
-
- /**
- *
- *
- * @param vPropertyArray
- */
- public void setProperty(
- final uk.ac.vamsas.objects.core.Property[] vPropertyArray) {
- //-- copy array
- _propertyList.clear();
-
- for (int i = 0; i < vPropertyArray.length; i++) {
- this._propertyList.add(vPropertyArray[i]);
+ } else if (temp._treeList != null)
+ return false;
+ if (this._alignmentSequenceList != null) {
+ if (temp._alignmentSequenceList == null)
+ return false;
+ if (this._alignmentSequenceList != temp._alignmentSequenceList) {
+ thcycle = org.castor.util.CycleBreaker
+ .startingToCycle(this._alignmentSequenceList);
+ tmcycle = org.castor.util.CycleBreaker
+ .startingToCycle(temp._alignmentSequenceList);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(this._alignmentSequenceList);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(temp._alignmentSequenceList);
+ }
+ ;
+ return false;
+ }
+ if (!thcycle) {
+ if (!this._alignmentSequenceList
+ .equals(temp._alignmentSequenceList)) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(this._alignmentSequenceList);
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(temp._alignmentSequenceList);
+ return false;
+ }
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(this._alignmentSequenceList);
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(temp._alignmentSequenceList);
+ }
}
- }
-
- /**
- * Sets the value of '_propertyList' by copying the given
- * Vector. All elements will be checked for type safety.
- *
- * @param vPropertyList the Vector to copy.
- */
- public void setProperty(
- final java.util.Vector vPropertyList) {
- // copy vector
- this._propertyList.clear();
-
- this._propertyList.addAll(vPropertyList);
- }
-
- /**
- * Sets the value of '_propertyList' by setting it to the given
- * Vector. No type checking is performed.
- * @deprecated
- *
- * @param propertyVector the Vector to set.
- */
- public void setPropertyAsReference(
- final java.util.Vector propertyVector) {
- this._propertyList = propertyVector;
- }
-
- /**
- * Sets the value of field 'provenance'.
- *
- * @param provenance the value of field 'provenance'.
- */
- public void setProvenance(
- final uk.ac.vamsas.objects.core.Provenance provenance) {
- this._provenance = provenance;
- }
-
- /**
- *
- *
- * @param index
- * @param vTree
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void setTree(
- final int index,
- final uk.ac.vamsas.objects.core.Tree vTree)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._treeList.size()) {
- throw new IndexOutOfBoundsException("setTree: Index value '" + index + "' not in range [0.." + (this._treeList.size() - 1) + "]");
+ } else if (temp._alignmentSequenceList != null)
+ return false;
+ if (this._propertyList != null) {
+ if (temp._propertyList == null)
+ return false;
+ if (this._propertyList != temp._propertyList) {
+ thcycle = org.castor.util.CycleBreaker
+ .startingToCycle(this._propertyList);
+ tmcycle = org.castor.util.CycleBreaker
+ .startingToCycle(temp._propertyList);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(this._propertyList);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(temp._propertyList);
+ }
+ ;
+ return false;
+ }
+ if (!thcycle) {
+ if (!this._propertyList.equals(temp._propertyList)) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(this._propertyList);
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(temp._propertyList);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._propertyList);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._propertyList);
+ }
}
-
- this._treeList.set(index, vTree);
- }
-
- /**
- *
- *
- * @param vTreeArray
- */
- public void setTree(
- final uk.ac.vamsas.objects.core.Tree[] vTreeArray) {
- //-- copy array
- _treeList.clear();
-
- for (int i = 0; i < vTreeArray.length; i++) {
- this._treeList.add(vTreeArray[i]);
+ } else if (temp._propertyList != null)
+ return false;
+ if (this._provenance != null) {
+ if (temp._provenance == null)
+ return false;
+ if (this._provenance != temp._provenance) {
+ thcycle = org.castor.util.CycleBreaker
+ .startingToCycle(this._provenance);
+ tmcycle = org.castor.util.CycleBreaker
+ .startingToCycle(temp._provenance);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance);
+ }
+ ;
+ return false;
+ }
+ if (!thcycle) {
+ if (!this._provenance.equals(temp._provenance)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance);
+ }
}
- }
-
- /**
- * Sets the value of '_treeList' by copying the given Vector.
- * All elements will be checked for type safety.
- *
- * @param vTreeList the Vector to copy.
- */
- public void setTree(
- final java.util.Vector vTreeList) {
- // copy vector
- this._treeList.clear();
-
- this._treeList.addAll(vTreeList);
- }
-
- /**
- * Sets the value of '_treeList' by setting it to the given
- * Vector. No type checking is performed.
- * @deprecated
- *
- * @param treeVector the Vector to set.
- */
- public void setTreeAsReference(
- final java.util.Vector treeVector) {
- this._treeList = treeVector;
- }
-
- /**
- * Method unmarshal.
- *
- * @param reader
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @return the unmarshaled uk.ac.vamsas.objects.core.Alignment
- */
- public static uk.ac.vamsas.objects.core.Alignment unmarshal(
- final java.io.Reader reader)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- return (uk.ac.vamsas.objects.core.Alignment) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Alignment.class, reader);
- }
-
- /**
- *
- *
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void validate(
- )
- throws org.exolab.castor.xml.ValidationException {
- org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
- validator.validate(this);
- }
+ } else if (temp._provenance != null)
+ return false;
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Returns the value of field 'aligned'.
+ *
+ * @return the value of field 'Aligned'.
+ */
+ public boolean getAligned() {
+ return this._aligned;
+ }
+
+ /**
+ * Method getAlignmentAnnotation.
+ *
+ * @param index
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ * @return the value of the uk.ac.vamsas.objects.core.AlignmentAnnotation at
+ * the given index
+ */
+ public uk.ac.vamsas.objects.core.AlignmentAnnotation getAlignmentAnnotation(
+ final int index) throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._alignmentAnnotationList.size()) {
+ throw new IndexOutOfBoundsException(
+ "getAlignmentAnnotation: Index value '" + index
+ + "' not in range [0.."
+ + (this._alignmentAnnotationList.size() - 1) + "]");
+ }
+
+ return (uk.ac.vamsas.objects.core.AlignmentAnnotation) _alignmentAnnotationList
+ .get(index);
+ }
+
+ /**
+ * Method getAlignmentAnnotation.Returns the contents of the collection in an
+ * Array.
+ *
+ * Note: Just in case the collection contents are changing in another thread,
+ * we pass a 0-length Array of the correct type into the API call. This way we
+ * know that the Array returned is of exactly the correct length.
+ *
+ * @return this collection as an Array
+ */
+ public uk.ac.vamsas.objects.core.AlignmentAnnotation[] getAlignmentAnnotation() {
+ uk.ac.vamsas.objects.core.AlignmentAnnotation[] array = new uk.ac.vamsas.objects.core.AlignmentAnnotation[0];
+ return (uk.ac.vamsas.objects.core.AlignmentAnnotation[]) this._alignmentAnnotationList
+ .toArray(array);
+ }
+
+ /**
+ * Method getAlignmentAnnotationAsReference.Returns a reference to
+ * '_alignmentAnnotationList'. No type checking is performed on any
+ * modifications to the Vector.
+ *
+ * @return a reference to the Vector backing this class
+ */
+ public java.util.Vector getAlignmentAnnotationAsReference() {
+ return this._alignmentAnnotationList;
+ }
+
+ /**
+ * Method getAlignmentAnnotationCount.
+ *
+ * @return the size of this collection
+ */
+ public int getAlignmentAnnotationCount() {
+ return this._alignmentAnnotationList.size();
+ }
+
+ /**
+ * Method getAlignmentSequence.
+ *
+ * @param index
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ * @return the value of the uk.ac.vamsas.objects.core.AlignmentSequence at the
+ * given inde
+ */
+ public uk.ac.vamsas.objects.core.AlignmentSequence getAlignmentSequence(
+ final int index) throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._alignmentSequenceList.size()) {
+ throw new IndexOutOfBoundsException("getAlignmentSequence: Index value '"
+ + index + "' not in range [0.."
+ + (this._alignmentSequenceList.size() - 1) + "]");
+ }
+
+ return (uk.ac.vamsas.objects.core.AlignmentSequence) _alignmentSequenceList
+ .get(index);
+ }
+
+ /**
+ * Method getAlignmentSequence.Returns the contents of the collection in an
+ * Array.
+ *
+ * Note: Just in case the collection contents are changing in another thread,
+ * we pass a 0-length Array of the correct type into the API call. This way we
+ * know that the Array returned is of exactly the correct length.
+ *
+ * @return this collection as an Array
+ */
+ public uk.ac.vamsas.objects.core.AlignmentSequence[] getAlignmentSequence() {
+ uk.ac.vamsas.objects.core.AlignmentSequence[] array = new uk.ac.vamsas.objects.core.AlignmentSequence[0];
+ return (uk.ac.vamsas.objects.core.AlignmentSequence[]) this._alignmentSequenceList
+ .toArray(array);
+ }
+
+ /**
+ * Method getAlignmentSequenceAsReference.Returns a reference to
+ * '_alignmentSequenceList'. No type checking is performed on any
+ * modifications to the Vector.
+ *
+ * @return a reference to the Vector backing this class
+ */
+ public java.util.Vector getAlignmentSequenceAsReference() {
+ return this._alignmentSequenceList;
+ }
+
+ /**
+ * Method getAlignmentSequenceCount.
+ *
+ * @return the size of this collection
+ */
+ public int getAlignmentSequenceCount() {
+ return this._alignmentSequenceList.size();
+ }
+
+ /**
+ * Returns the value of field 'gapChar'.
+ *
+ * @return the value of field 'GapChar'.
+ */
+ public java.lang.String getGapChar() {
+ return this._gapChar;
+ }
+
+ /**
+ * Returns the value of field 'id'. The field 'id' has the following
+ * description: Primary Key for vamsas object referencing
+ *
+ *
+ * @return the value of field 'Id'.
+ */
+ public java.lang.String getId() {
+ return this._id;
+ }
+
+ /**
+ * Returns the value of field 'modifiable'.
+ *
+ * @return the value of field 'Modifiable'.
+ */
+ public java.lang.String getModifiable() {
+ return this._modifiable;
+ }
+
+ /**
+ * Method getProperty.
+ *
+ * @param index
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ * @return the value of the uk.ac.vamsas.objects.core.Property at the given
+ * index
+ */
+ public uk.ac.vamsas.objects.core.Property getProperty(final int index)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._propertyList.size()) {
+ throw new IndexOutOfBoundsException("getProperty: Index value '" + index
+ + "' not in range [0.." + (this._propertyList.size() - 1) + "]");
+ }
+
+ return (uk.ac.vamsas.objects.core.Property) _propertyList.get(index);
+ }
+
+ /**
+ * Method getProperty.Returns the contents of the collection in an Array.
+ *
+ * Note: Just in case the collection contents are changing in another thread,
+ * we pass a 0-length Array of the correct type into the API call. This way we
+ * know that the Array returned is of exactly the correct length.
+ *
+ * @return this collection as an Array
+ */
+ public uk.ac.vamsas.objects.core.Property[] getProperty() {
+ uk.ac.vamsas.objects.core.Property[] array = new uk.ac.vamsas.objects.core.Property[0];
+ return (uk.ac.vamsas.objects.core.Property[]) this._propertyList
+ .toArray(array);
+ }
+
+ /**
+ * Method getPropertyAsReference.Returns a reference to '_propertyList'. No
+ * type checking is performed on any modifications to the Vector.
+ *
+ * @return a reference to the Vector backing this class
+ */
+ public java.util.Vector getPropertyAsReference() {
+ return this._propertyList;
+ }
+
+ /**
+ * Method getPropertyCount.
+ *
+ * @return the size of this collection
+ */
+ public int getPropertyCount() {
+ return this._propertyList.size();
+ }
+
+ /**
+ * Returns the value of field 'provenance'.
+ *
+ * @return the value of field 'Provenance'.
+ */
+ public uk.ac.vamsas.objects.core.Provenance getProvenance() {
+ return this._provenance;
+ }
+
+ /**
+ * Method getTree.
+ *
+ * @param index
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ * @return the value of the uk.ac.vamsas.objects.core.Tree at the given index
+ */
+ public uk.ac.vamsas.objects.core.Tree getTree(final int index)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._treeList.size()) {
+ throw new IndexOutOfBoundsException("getTree: Index value '" + index
+ + "' not in range [0.." + (this._treeList.size() - 1) + "]");
+ }
+
+ return (uk.ac.vamsas.objects.core.Tree) _treeList.get(index);
+ }
+
+ /**
+ * Method getTree.Returns the contents of the collection in an Array.
+ *
+ * Note: Just in case the collection contents are changing in another thread,
+ * we pass a 0-length Array of the correct type into the API call. This way we
+ * know that the Array returned is of exactly the correct length.
+ *
+ * @return this collection as an Array
+ */
+ public uk.ac.vamsas.objects.core.Tree[] getTree() {
+ uk.ac.vamsas.objects.core.Tree[] array = new uk.ac.vamsas.objects.core.Tree[0];
+ return (uk.ac.vamsas.objects.core.Tree[]) this._treeList.toArray(array);
+ }
+
+ /**
+ * Method getTreeAsReference.Returns a reference to '_treeList'. No type
+ * checking is performed on any modifications to the Vector.
+ *
+ * @return a reference to the Vector backing this class
+ */
+ public java.util.Vector getTreeAsReference() {
+ return this._treeList;
+ }
+
+ /**
+ * Method getTreeCount.
+ *
+ * @return the size of this collection
+ */
+ public int getTreeCount() {
+ return this._treeList.size();
+ }
+
+ /**
+ * Method hasAligned.
+ *
+ * @return true if at least one Aligned has been added
+ */
+ public boolean hasAligned() {
+ return this._has_aligned;
+ }
+
+ /**
+ * Overrides the java.lang.Object.hashCode method.
+ *
+ * The following steps came from Effective Java Programming Language
+ * Guide by Joshua Bloch, Chapter 3
+ *
+ * @return a hash code value for the object.
+ */
+ public int hashCode() {
+ int result = super.hashCode();
+
+ long tmp;
+ if (_gapChar != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_gapChar)) {
+ result = 37 * result + _gapChar.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_gapChar);
+ }
+ result = 37 * result + (_aligned ? 0 : 1);
+ if (_id != null && !org.castor.util.CycleBreaker.startingToCycle(_id)) {
+ result = 37 * result + _id.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_id);
+ }
+ if (_modifiable != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_modifiable)) {
+ result = 37 * result + _modifiable.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_modifiable);
+ }
+ if (_alignmentAnnotationList != null
+ && !org.castor.util.CycleBreaker
+ .startingToCycle(_alignmentAnnotationList)) {
+ result = 37 * result + _alignmentAnnotationList.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_alignmentAnnotationList);
+ }
+ if (_treeList != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_treeList)) {
+ result = 37 * result + _treeList.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_treeList);
+ }
+ if (_alignmentSequenceList != null
+ && !org.castor.util.CycleBreaker
+ .startingToCycle(_alignmentSequenceList)) {
+ result = 37 * result + _alignmentSequenceList.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_alignmentSequenceList);
+ }
+ if (_propertyList != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_propertyList)) {
+ result = 37 * result + _propertyList.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_propertyList);
+ }
+ if (_provenance != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_provenance)) {
+ result = 37 * result + _provenance.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_provenance);
+ }
+
+ return result;
+ }
+
+ /**
+ * Returns the value of field 'aligned'.
+ *
+ * @return the value of field 'Aligned'.
+ */
+ public boolean isAligned() {
+ return this._aligned;
+ }
+
+ /**
+ * Method isValid.
+ *
+ * @return true if this object is valid according to the schema
+ */
+ public boolean isValid() {
+ try {
+ validate();
+ } catch (org.exolab.castor.xml.ValidationException vex) {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ *
+ *
+ * @param out
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void marshal(final java.io.Writer out)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, out);
+ }
+
+ /**
+ *
+ *
+ * @param handler
+ * @throws java.io.IOException
+ * if an IOException occurs during marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ */
+ public void marshal(final org.xml.sax.ContentHandler handler)
+ throws java.io.IOException, org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, handler);
+ }
+
+ /**
+ * Method removeAlignmentAnnotation.
+ *
+ * @param vAlignmentAnnotation
+ * @return true if the object was removed from the collection.
+ */
+ public boolean removeAlignmentAnnotation(
+ final uk.ac.vamsas.objects.core.AlignmentAnnotation vAlignmentAnnotation) {
+ boolean removed = _alignmentAnnotationList.remove(vAlignmentAnnotation);
+ return removed;
+ }
+
+ /**
+ * Method removeAlignmentAnnotationAt.
+ *
+ * @param index
+ * @return the element removed from the collection
+ */
+ public uk.ac.vamsas.objects.core.AlignmentAnnotation removeAlignmentAnnotationAt(
+ final int index) {
+ java.lang.Object obj = this._alignmentAnnotationList.remove(index);
+ return (uk.ac.vamsas.objects.core.AlignmentAnnotation) obj;
+ }
+
+ /**
+ * Method removeAlignmentSequence.
+ *
+ * @param vAlignmentSequence
+ * @return true if the object was removed from the collection.
+ */
+ public boolean removeAlignmentSequence(
+ final uk.ac.vamsas.objects.core.AlignmentSequence vAlignmentSequence) {
+ boolean removed = _alignmentSequenceList.remove(vAlignmentSequence);
+ return removed;
+ }
+
+ /**
+ * Method removeAlignmentSequenceAt.
+ *
+ * @param index
+ * @return the element removed from the collection
+ */
+ public uk.ac.vamsas.objects.core.AlignmentSequence removeAlignmentSequenceAt(
+ final int index) {
+ java.lang.Object obj = this._alignmentSequenceList.remove(index);
+ return (uk.ac.vamsas.objects.core.AlignmentSequence) obj;
+ }
+
+ /**
+ */
+ public void removeAllAlignmentAnnotation() {
+ this._alignmentAnnotationList.clear();
+ }
+
+ /**
+ */
+ public void removeAllAlignmentSequence() {
+ this._alignmentSequenceList.clear();
+ }
+
+ /**
+ */
+ public void removeAllProperty() {
+ this._propertyList.clear();
+ }
+
+ /**
+ */
+ public void removeAllTree() {
+ this._treeList.clear();
+ }
+
+ /**
+ * Method removeProperty.
+ *
+ * @param vProperty
+ * @return true if the object was removed from the collection.
+ */
+ public boolean removeProperty(
+ final uk.ac.vamsas.objects.core.Property vProperty) {
+ boolean removed = _propertyList.remove(vProperty);
+ return removed;
+ }
+
+ /**
+ * Method removePropertyAt.
+ *
+ * @param index
+ * @return the element removed from the collection
+ */
+ public uk.ac.vamsas.objects.core.Property removePropertyAt(final int index) {
+ java.lang.Object obj = this._propertyList.remove(index);
+ return (uk.ac.vamsas.objects.core.Property) obj;
+ }
+
+ /**
+ * Method removeTree.
+ *
+ * @param vTree
+ * @return true if the object was removed from the collection.
+ */
+ public boolean removeTree(final uk.ac.vamsas.objects.core.Tree vTree) {
+ boolean removed = _treeList.remove(vTree);
+ return removed;
+ }
+
+ /**
+ * Method removeTreeAt.
+ *
+ * @param index
+ * @return the element removed from the collection
+ */
+ public uk.ac.vamsas.objects.core.Tree removeTreeAt(final int index) {
+ java.lang.Object obj = this._treeList.remove(index);
+ return (uk.ac.vamsas.objects.core.Tree) obj;
+ }
+
+ /**
+ * Sets the value of field 'aligned'.
+ *
+ * @param aligned
+ * the value of field 'aligned'.
+ */
+ public void setAligned(final boolean aligned) {
+ this._aligned = aligned;
+ this._has_aligned = true;
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vAlignmentAnnotation
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void setAlignmentAnnotation(final int index,
+ final uk.ac.vamsas.objects.core.AlignmentAnnotation vAlignmentAnnotation)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._alignmentAnnotationList.size()) {
+ throw new IndexOutOfBoundsException(
+ "setAlignmentAnnotation: Index value '" + index
+ + "' not in range [0.."
+ + (this._alignmentAnnotationList.size() - 1) + "]");
+ }
+
+ this._alignmentAnnotationList.set(index, vAlignmentAnnotation);
+ }
+
+ /**
+ *
+ *
+ * @param vAlignmentAnnotationArray
+ */
+ public void setAlignmentAnnotation(
+ final uk.ac.vamsas.objects.core.AlignmentAnnotation[] vAlignmentAnnotationArray) {
+ // -- copy array
+ _alignmentAnnotationList.clear();
+
+ for (int i = 0; i < vAlignmentAnnotationArray.length; i++) {
+ this._alignmentAnnotationList.add(vAlignmentAnnotationArray[i]);
+ }
+ }
+
+ /**
+ * Sets the value of '_alignmentAnnotationList' by copying the given Vector.
+ * All elements will be checked for type safety.
+ *
+ * @param vAlignmentAnnotationList
+ * the Vector to copy.
+ */
+ public void setAlignmentAnnotation(
+ final java.util.Vector vAlignmentAnnotationList) {
+ // copy vector
+ this._alignmentAnnotationList.clear();
+
+ this._alignmentAnnotationList.addAll(vAlignmentAnnotationList);
+ }
+
+ /**
+ * Sets the value of '_alignmentAnnotationList' by setting it to the given
+ * Vector. No type checking is performed.
+ *
+ * @deprecated
+ *
+ * @param alignmentAnnotationVector
+ * the Vector to set.
+ */
+ public void setAlignmentAnnotationAsReference(
+ final java.util.Vector alignmentAnnotationVector) {
+ this._alignmentAnnotationList = alignmentAnnotationVector;
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vAlignmentSequence
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void setAlignmentSequence(final int index,
+ final uk.ac.vamsas.objects.core.AlignmentSequence vAlignmentSequence)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._alignmentSequenceList.size()) {
+ throw new IndexOutOfBoundsException("setAlignmentSequence: Index value '"
+ + index + "' not in range [0.."
+ + (this._alignmentSequenceList.size() - 1) + "]");
+ }
+
+ this._alignmentSequenceList.set(index, vAlignmentSequence);
+ }
+
+ /**
+ *
+ *
+ * @param vAlignmentSequenceArray
+ */
+ public void setAlignmentSequence(
+ final uk.ac.vamsas.objects.core.AlignmentSequence[] vAlignmentSequenceArray) {
+ // -- copy array
+ _alignmentSequenceList.clear();
+
+ for (int i = 0; i < vAlignmentSequenceArray.length; i++) {
+ this._alignmentSequenceList.add(vAlignmentSequenceArray[i]);
+ }
+ }
+
+ /**
+ * Sets the value of '_alignmentSequenceList' by copying the given Vector. All
+ * elements will be checked for type safety.
+ *
+ * @param vAlignmentSequenceList
+ * the Vector to copy.
+ */
+ public void setAlignmentSequence(final java.util.Vector vAlignmentSequenceList) {
+ // copy vector
+ this._alignmentSequenceList.clear();
+
+ this._alignmentSequenceList.addAll(vAlignmentSequenceList);
+ }
+
+ /**
+ * Sets the value of '_alignmentSequenceList' by setting it to the given
+ * Vector. No type checking is performed.
+ *
+ * @deprecated
+ *
+ * @param alignmentSequenceVector
+ * the Vector to set.
+ */
+ public void setAlignmentSequenceAsReference(
+ final java.util.Vector alignmentSequenceVector) {
+ this._alignmentSequenceList = alignmentSequenceVector;
+ }
+
+ /**
+ * Sets the value of field 'gapChar'.
+ *
+ * @param gapChar
+ * the value of field 'gapChar'.
+ */
+ public void setGapChar(final java.lang.String gapChar) {
+ this._gapChar = gapChar;
+ }
+
+ /**
+ * Sets the value of field 'id'. The field 'id' has the following description:
+ * Primary Key for vamsas object referencing
+ *
+ *
+ * @param id
+ * the value of field 'id'.
+ */
+ public void setId(final java.lang.String id) {
+ this._id = id;
+ }
+
+ /**
+ * Sets the value of field 'modifiable'.
+ *
+ * @param modifiable
+ * the value of field 'modifiable'.
+ */
+ public void setModifiable(final java.lang.String modifiable) {
+ this._modifiable = modifiable;
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vProperty
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void setProperty(final int index,
+ final uk.ac.vamsas.objects.core.Property vProperty)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._propertyList.size()) {
+ throw new IndexOutOfBoundsException("setProperty: Index value '" + index
+ + "' not in range [0.." + (this._propertyList.size() - 1) + "]");
+ }
+
+ this._propertyList.set(index, vProperty);
+ }
+
+ /**
+ *
+ *
+ * @param vPropertyArray
+ */
+ public void setProperty(
+ final uk.ac.vamsas.objects.core.Property[] vPropertyArray) {
+ // -- copy array
+ _propertyList.clear();
+
+ for (int i = 0; i < vPropertyArray.length; i++) {
+ this._propertyList.add(vPropertyArray[i]);
+ }
+ }
+
+ /**
+ * Sets the value of '_propertyList' by copying the given Vector. All elements
+ * will be checked for type safety.
+ *
+ * @param vPropertyList
+ * the Vector to copy.
+ */
+ public void setProperty(final java.util.Vector vPropertyList) {
+ // copy vector
+ this._propertyList.clear();
+
+ this._propertyList.addAll(vPropertyList);
+ }
+
+ /**
+ * Sets the value of '_propertyList' by setting it to the given Vector. No
+ * type checking is performed.
+ *
+ * @deprecated
+ *
+ * @param propertyVector
+ * the Vector to set.
+ */
+ public void setPropertyAsReference(final java.util.Vector propertyVector) {
+ this._propertyList = propertyVector;
+ }
+
+ /**
+ * Sets the value of field 'provenance'.
+ *
+ * @param provenance
+ * the value of field 'provenance'.
+ */
+ public void setProvenance(
+ final uk.ac.vamsas.objects.core.Provenance provenance) {
+ this._provenance = provenance;
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vTree
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void setTree(final int index,
+ final uk.ac.vamsas.objects.core.Tree vTree)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._treeList.size()) {
+ throw new IndexOutOfBoundsException("setTree: Index value '" + index
+ + "' not in range [0.." + (this._treeList.size() - 1) + "]");
+ }
+
+ this._treeList.set(index, vTree);
+ }
+
+ /**
+ *
+ *
+ * @param vTreeArray
+ */
+ public void setTree(final uk.ac.vamsas.objects.core.Tree[] vTreeArray) {
+ // -- copy array
+ _treeList.clear();
+
+ for (int i = 0; i < vTreeArray.length; i++) {
+ this._treeList.add(vTreeArray[i]);
+ }
+ }
+
+ /**
+ * Sets the value of '_treeList' by copying the given Vector. All elements
+ * will be checked for type safety.
+ *
+ * @param vTreeList
+ * the Vector to copy.
+ */
+ public void setTree(final java.util.Vector vTreeList) {
+ // copy vector
+ this._treeList.clear();
+
+ this._treeList.addAll(vTreeList);
+ }
+
+ /**
+ * Sets the value of '_treeList' by setting it to the given Vector. No type
+ * checking is performed.
+ *
+ * @deprecated
+ *
+ * @param treeVector
+ * the Vector to set.
+ */
+ public void setTreeAsReference(final java.util.Vector treeVector) {
+ this._treeList = treeVector;
+ }
+
+ /**
+ * Method unmarshal.
+ *
+ * @param reader
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @return the unmarshaled uk.ac.vamsas.objects.core.Alignment
+ */
+ public static uk.ac.vamsas.objects.core.Alignment unmarshal(
+ final java.io.Reader reader)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ return (uk.ac.vamsas.objects.core.Alignment) Unmarshaller.unmarshal(
+ uk.ac.vamsas.objects.core.Alignment.class, reader);
+ }
+
+ /**
+ *
+ *
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void validate() throws org.exolab.castor.xml.ValidationException {
+ org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+ validator.validate(this);
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/AlignmentAnnotation.java b/src/uk/ac/vamsas/objects/core/AlignmentAnnotation.java
index b6c544c..4e5c695 100644
--- a/src/uk/ac/vamsas/objects/core/AlignmentAnnotation.java
+++ b/src/uk/ac/vamsas/objects/core/AlignmentAnnotation.java
@@ -1,515 +1,516 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import org.exolab.castor.xml.Marshaller;
import org.exolab.castor.xml.Unmarshaller;
/**
- * This is annotation over the coordinate frame
- * defined by all the columns in the alignment.
- *
+ * This is annotation over the coordinate frame defined by all the columns in
+ * the alignment.
+ *
*
* @version $Revision$ $Date$
*/
-public class AlignmentAnnotation extends uk.ac.vamsas.objects.core.RangeAnnotation
-implements java.io.Serializable
-{
-
-
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
- * TODO: decide if this flag is
- * redundant - when true it would suggest that
- * the annotationElement values together form a
- * graph
- */
- private boolean _graph;
-
- /**
- * keeps track of state for field: _graph
- */
- private boolean _has_graph;
-
- /**
- * annotation is associated with
- * a range on a particular group of alignment
- * sequences
- */
- private java.util.Vector _seqrefs;
-
- /**
- * Field _provenance.
- */
- private uk.ac.vamsas.objects.core.Provenance _provenance;
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public AlignmentAnnotation() {
- super();
- this._seqrefs = new java.util.Vector();
- }
-
-
- //-----------/
- //- Methods -/
- //-----------/
-
- /**
- *
- *
- * @param vSeqrefs
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addSeqrefs(
- final java.lang.Object vSeqrefs)
- throws java.lang.IndexOutOfBoundsException {
- this._seqrefs.addElement(vSeqrefs);
- }
-
- /**
- *
- *
- * @param index
- * @param vSeqrefs
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addSeqrefs(
- final int index,
- final java.lang.Object vSeqrefs)
- throws java.lang.IndexOutOfBoundsException {
- this._seqrefs.add(index, vSeqrefs);
- }
-
- /**
- */
- public void deleteGraph(
- ) {
- this._has_graph= false;
- }
-
- /**
- * Method enumerateSeqrefs.
- *
- * @return an Enumeration over all java.lang.Object elements
- */
- public java.util.Enumeration enumerateSeqrefs(
- ) {
- return this._seqrefs.elements();
- }
-
- /**
- * Overrides the java.lang.Object.equals method.
- *
- * @param obj
- * @return true if the objects are equal.
- */
- public boolean equals(
- final java.lang.Object obj) {
- if ( this == obj )
- return true;
-
- if (super.equals(obj)==false)
+public class AlignmentAnnotation extends
+ uk.ac.vamsas.objects.core.RangeAnnotation implements java.io.Serializable {
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * TODO: decide if this flag is redundant - when true it would suggest that
+ * the annotationElement values together form a graph
+ */
+ private boolean _graph;
+
+ /**
+ * keeps track of state for field: _graph
+ */
+ private boolean _has_graph;
+
+ /**
+ * annotation is associated with a range on a particular group of alignment
+ * sequences
+ */
+ private java.util.Vector _seqrefs;
+
+ /**
+ * Field _provenance.
+ */
+ private uk.ac.vamsas.objects.core.Provenance _provenance;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public AlignmentAnnotation() {
+ super();
+ this._seqrefs = new java.util.Vector();
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ *
+ *
+ * @param vSeqrefs
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addSeqrefs(final java.lang.Object vSeqrefs)
+ throws java.lang.IndexOutOfBoundsException {
+ this._seqrefs.addElement(vSeqrefs);
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vSeqrefs
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addSeqrefs(final int index, final java.lang.Object vSeqrefs)
+ throws java.lang.IndexOutOfBoundsException {
+ this._seqrefs.add(index, vSeqrefs);
+ }
+
+ /**
+ */
+ public void deleteGraph() {
+ this._has_graph = false;
+ }
+
+ /**
+ * Method enumerateSeqrefs.
+ *
+ * @return an Enumeration over all java.lang.Object elements
+ */
+ public java.util.Enumeration enumerateSeqrefs() {
+ return this._seqrefs.elements();
+ }
+
+ /**
+ * Overrides the java.lang.Object.equals method.
+ *
+ * @param obj
+ * @return true if the objects are equal.
+ */
+ public boolean equals(final java.lang.Object obj) {
+ if (this == obj)
+ return true;
+
+ if (super.equals(obj) == false)
+ return false;
+
+ if (obj instanceof AlignmentAnnotation) {
+
+ AlignmentAnnotation temp = (AlignmentAnnotation) obj;
+ boolean thcycle;
+ boolean tmcycle;
+ if (this._graph != temp._graph)
+ return false;
+ if (this._has_graph != temp._has_graph)
+ return false;
+ if (this._seqrefs != null) {
+ if (temp._seqrefs == null)
+ return false;
+ if (this._seqrefs != temp._seqrefs) {
+ thcycle = org.castor.util.CycleBreaker.startingToCycle(this._seqrefs);
+ tmcycle = org.castor.util.CycleBreaker.startingToCycle(temp._seqrefs);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._seqrefs);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._seqrefs);
+ }
+ ;
return false;
-
- if (obj instanceof AlignmentAnnotation) {
-
- AlignmentAnnotation temp = (AlignmentAnnotation)obj;
- boolean thcycle;
- boolean tmcycle;
- if (this._graph != temp._graph)
- return false;
- if (this._has_graph != temp._has_graph)
- return false;
- if (this._seqrefs != null) {
- if (temp._seqrefs == null) return false;
- if (this._seqrefs != temp._seqrefs) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._seqrefs);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._seqrefs);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._seqrefs); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._seqrefs); };
- return false;
- }
- if (!thcycle) {
- if (!this._seqrefs.equals(temp._seqrefs)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._seqrefs);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._seqrefs);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._seqrefs);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._seqrefs);
- }
- }
- } else if (temp._seqrefs != null)
- return false;
- if (this._provenance != null) {
- if (temp._provenance == null) return false;
- if (this._provenance != temp._provenance) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._provenance);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._provenance);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance); };
- return false;
- }
- if (!thcycle) {
- if (!this._provenance.equals(temp._provenance)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance);
- }
- }
- } else if (temp._provenance != null)
- return false;
- return true;
+ }
+ if (!thcycle) {
+ if (!this._seqrefs.equals(temp._seqrefs)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._seqrefs);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._seqrefs);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._seqrefs);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._seqrefs);
+ }
}
+ } else if (temp._seqrefs != null)
return false;
- }
-
- /**
- * Returns the value of field 'graph'. The field 'graph' has
- * the following description: TODO: decide if this flag is
- * redundant - when true it would suggest that
- * the annotationElement values together form a
- * graph
- *
- * @return the value of field 'Graph'.
- */
- public boolean getGraph(
- ) {
- return this._graph;
- }
-
- /**
- * Returns the value of field 'provenance'.
- *
- * @return the value of field 'Provenance'.
- */
- public uk.ac.vamsas.objects.core.Provenance getProvenance(
- ) {
- return this._provenance;
- }
-
- /**
- * Method getSeqrefs.
- *
- * @param index
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- * @return the value of the java.lang.Object at the given index
- */
- public java.lang.Object getSeqrefs(
- final int index)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._seqrefs.size()) {
- throw new IndexOutOfBoundsException("getSeqrefs: Index value '" + index + "' not in range [0.." + (this._seqrefs.size() - 1) + "]");
- }
-
- return _seqrefs.get(index);
- }
-
- /**
- * Method getSeqrefs.Returns the contents of the collection in
- * an Array.
Note: Just in case the collection contents
- * are changing in another thread, we pass a 0-length Array of
- * the correct type into the API call. This way we know
- * that the Array returned is of exactly the correct length.
- *
- * @return this collection as an Array
- */
- public java.lang.Object[] getSeqrefs(
- ) {
- java.lang.Object[] array = new java.lang.Object[0];
- return (java.lang.Object[]) this._seqrefs.toArray(array);
- }
-
- /**
- * Method getSeqrefsAsReference.Returns a reference to
- * '_seqrefs'. No type checking is performed on any
- * modifications to the Vector.
- *
- * @return a reference to the Vector backing this class
- */
- public java.util.Vector getSeqrefsAsReference(
- ) {
- return this._seqrefs;
- }
-
- /**
- * Method getSeqrefsCount.
- *
- * @return the size of this collection
- */
- public int getSeqrefsCount(
- ) {
- return this._seqrefs.size();
- }
-
- /**
- * Method hasGraph.
- *
- * @return true if at least one Graph has been added
- */
- public boolean hasGraph(
- ) {
- return this._has_graph;
- }
-
- /**
- * Overrides the java.lang.Object.hashCode method.
- *
- * The following steps came from Effective Java Programming
- * Language Guide by Joshua Bloch, Chapter 3
- *
- * @return a hash code value for the object.
- */
- public int hashCode(
- ) {
- int result = super.hashCode();
-
- long tmp;
- result = 37 * result + (_graph?0:1);
- if (_seqrefs != null
- && !org.castor.util.CycleBreaker.startingToCycle(_seqrefs)) {
- result = 37 * result + _seqrefs.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_seqrefs);
- }
- if (_provenance != null
- && !org.castor.util.CycleBreaker.startingToCycle(_provenance)) {
- result = 37 * result + _provenance.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_provenance);
- }
-
- return result;
- }
-
- /**
- * Returns the value of field 'graph'. The field 'graph' has
- * the following description: TODO: decide if this flag is
- * redundant - when true it would suggest that
- * the annotationElement values together form a
- * graph
- *
- * @return the value of field 'Graph'.
- */
- public boolean isGraph(
- ) {
- return this._graph;
- }
-
- /**
- * Method isValid.
- *
- * @return true if this object is valid according to the schema
- */
- public boolean isValid(
- ) {
- try {
- validate();
- } catch (org.exolab.castor.xml.ValidationException vex) {
+ if (this._provenance != null) {
+ if (temp._provenance == null)
+ return false;
+ if (this._provenance != temp._provenance) {
+ thcycle = org.castor.util.CycleBreaker
+ .startingToCycle(this._provenance);
+ tmcycle = org.castor.util.CycleBreaker
+ .startingToCycle(temp._provenance);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance);
+ }
+ ;
return false;
+ }
+ if (!thcycle) {
+ if (!this._provenance.equals(temp._provenance)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance);
+ }
}
- return true;
- }
-
- /**
- *
- *
- * @param out
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void marshal(
- final java.io.Writer out)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, out);
- }
-
- /**
- *
- *
- * @param handler
- * @throws java.io.IOException if an IOException occurs during
- * marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- */
- public void marshal(
- final org.xml.sax.ContentHandler handler)
- throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, handler);
- }
-
- /**
- */
- public void removeAllSeqrefs(
- ) {
- this._seqrefs.clear();
- }
-
- /**
- * Method removeSeqrefs.
- *
- * @param vSeqrefs
- * @return true if the object was removed from the collection.
- */
- public boolean removeSeqrefs(
- final java.lang.Object vSeqrefs) {
- boolean removed = _seqrefs.remove(vSeqrefs);
- return removed;
- }
-
- /**
- * Method removeSeqrefsAt.
- *
- * @param index
- * @return the element removed from the collection
- */
- public java.lang.Object removeSeqrefsAt(
- final int index) {
- java.lang.Object obj = this._seqrefs.remove(index);
- return obj;
+ } else if (temp._provenance != null)
+ return false;
+ return true;
}
-
- /**
- * Sets the value of field 'graph'. The field 'graph' has the
- * following description: TODO: decide if this flag is
- * redundant - when true it would suggest that
- * the annotationElement values together form a
- * graph
- *
- * @param graph the value of field 'graph'.
- */
- public void setGraph(
- final boolean graph) {
- this._graph = graph;
- this._has_graph = true;
+ return false;
+ }
+
+ /**
+ * Returns the value of field 'graph'. The field 'graph' has the following
+ * description: TODO: decide if this flag is redundant - when true it would
+ * suggest that the annotationElement values together form a graph
+ *
+ * @return the value of field 'Graph'.
+ */
+ public boolean getGraph() {
+ return this._graph;
+ }
+
+ /**
+ * Returns the value of field 'provenance'.
+ *
+ * @return the value of field 'Provenance'.
+ */
+ public uk.ac.vamsas.objects.core.Provenance getProvenance() {
+ return this._provenance;
+ }
+
+ /**
+ * Method getSeqrefs.
+ *
+ * @param index
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ * @return the value of the java.lang.Object at the given index
+ */
+ public java.lang.Object getSeqrefs(final int index)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._seqrefs.size()) {
+ throw new IndexOutOfBoundsException("getSeqrefs: Index value '" + index
+ + "' not in range [0.." + (this._seqrefs.size() - 1) + "]");
}
- /**
- * Sets the value of field 'provenance'.
- *
- * @param provenance the value of field 'provenance'.
- */
- public void setProvenance(
- final uk.ac.vamsas.objects.core.Provenance provenance) {
- this._provenance = provenance;
+ return _seqrefs.get(index);
+ }
+
+ /**
+ * Method getSeqrefs.Returns the contents of the collection in an Array.
+ *
+ * Note: Just in case the collection contents are changing in another thread,
+ * we pass a 0-length Array of the correct type into the API call. This way we
+ * know that the Array returned is of exactly the correct length.
+ *
+ * @return this collection as an Array
+ */
+ public java.lang.Object[] getSeqrefs() {
+ java.lang.Object[] array = new java.lang.Object[0];
+ return (java.lang.Object[]) this._seqrefs.toArray(array);
+ }
+
+ /**
+ * Method getSeqrefsAsReference.Returns a reference to '_seqrefs'. No type
+ * checking is performed on any modifications to the Vector.
+ *
+ * @return a reference to the Vector backing this class
+ */
+ public java.util.Vector getSeqrefsAsReference() {
+ return this._seqrefs;
+ }
+
+ /**
+ * Method getSeqrefsCount.
+ *
+ * @return the size of this collection
+ */
+ public int getSeqrefsCount() {
+ return this._seqrefs.size();
+ }
+
+ /**
+ * Method hasGraph.
+ *
+ * @return true if at least one Graph has been added
+ */
+ public boolean hasGraph() {
+ return this._has_graph;
+ }
+
+ /**
+ * Overrides the java.lang.Object.hashCode method.
+ *
+ * The following steps came from Effective Java Programming Language
+ * Guide by Joshua Bloch, Chapter 3
+ *
+ * @return a hash code value for the object.
+ */
+ public int hashCode() {
+ int result = super.hashCode();
+
+ long tmp;
+ result = 37 * result + (_graph ? 0 : 1);
+ if (_seqrefs != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_seqrefs)) {
+ result = 37 * result + _seqrefs.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_seqrefs);
}
-
- /**
- *
- *
- * @param index
- * @param vSeqrefs
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void setSeqrefs(
- final int index,
- final java.lang.Object vSeqrefs)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._seqrefs.size()) {
- throw new IndexOutOfBoundsException("setSeqrefs: Index value '" + index + "' not in range [0.." + (this._seqrefs.size() - 1) + "]");
- }
-
- this._seqrefs.set(index, vSeqrefs);
+ if (_provenance != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_provenance)) {
+ result = 37 * result + _provenance.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_provenance);
}
- /**
- *
- *
- * @param vSeqrefsArray
- */
- public void setSeqrefs(
- final java.lang.Object[] vSeqrefsArray) {
- //-- copy array
- _seqrefs.clear();
-
- for (int i = 0; i < vSeqrefsArray.length; i++) {
- this._seqrefs.add(vSeqrefsArray[i]);
- }
+ return result;
+ }
+
+ /**
+ * Returns the value of field 'graph'. The field 'graph' has the following
+ * description: TODO: decide if this flag is redundant - when true it would
+ * suggest that the annotationElement values together form a graph
+ *
+ * @return the value of field 'Graph'.
+ */
+ public boolean isGraph() {
+ return this._graph;
+ }
+
+ /**
+ * Method isValid.
+ *
+ * @return true if this object is valid according to the schema
+ */
+ public boolean isValid() {
+ try {
+ validate();
+ } catch (org.exolab.castor.xml.ValidationException vex) {
+ return false;
}
-
- /**
- * Sets the value of '_seqrefs' by copying the given Vector.
- * All elements will be checked for type safety.
- *
- * @param vSeqrefsList the Vector to copy.
- */
- public void setSeqrefs(
- final java.util.Vector vSeqrefsList) {
- // copy vector
- this._seqrefs.clear();
-
- this._seqrefs.addAll(vSeqrefsList);
+ return true;
+ }
+
+ /**
+ *
+ *
+ * @param out
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void marshal(final java.io.Writer out)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, out);
+ }
+
+ /**
+ *
+ *
+ * @param handler
+ * @throws java.io.IOException
+ * if an IOException occurs during marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ */
+ public void marshal(final org.xml.sax.ContentHandler handler)
+ throws java.io.IOException, org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, handler);
+ }
+
+ /**
+ */
+ public void removeAllSeqrefs() {
+ this._seqrefs.clear();
+ }
+
+ /**
+ * Method removeSeqrefs.
+ *
+ * @param vSeqrefs
+ * @return true if the object was removed from the collection.
+ */
+ public boolean removeSeqrefs(final java.lang.Object vSeqrefs) {
+ boolean removed = _seqrefs.remove(vSeqrefs);
+ return removed;
+ }
+
+ /**
+ * Method removeSeqrefsAt.
+ *
+ * @param index
+ * @return the element removed from the collection
+ */
+ public java.lang.Object removeSeqrefsAt(final int index) {
+ java.lang.Object obj = this._seqrefs.remove(index);
+ return obj;
+ }
+
+ /**
+ * Sets the value of field 'graph'. The field 'graph' has the following
+ * description: TODO: decide if this flag is redundant - when true it would
+ * suggest that the annotationElement values together form a graph
+ *
+ * @param graph
+ * the value of field 'graph'.
+ */
+ public void setGraph(final boolean graph) {
+ this._graph = graph;
+ this._has_graph = true;
+ }
+
+ /**
+ * Sets the value of field 'provenance'.
+ *
+ * @param provenance
+ * the value of field 'provenance'.
+ */
+ public void setProvenance(
+ final uk.ac.vamsas.objects.core.Provenance provenance) {
+ this._provenance = provenance;
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vSeqrefs
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void setSeqrefs(final int index, final java.lang.Object vSeqrefs)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._seqrefs.size()) {
+ throw new IndexOutOfBoundsException("setSeqrefs: Index value '" + index
+ + "' not in range [0.." + (this._seqrefs.size() - 1) + "]");
}
- /**
- * Sets the value of '_seqrefs' by setting it to the given
- * Vector. No type checking is performed.
- * @deprecated
- *
- * @param seqrefsVector the Vector to set.
- */
- public void setSeqrefsAsReference(
- final java.util.Vector seqrefsVector) {
- this._seqrefs = seqrefsVector;
- }
+ this._seqrefs.set(index, vSeqrefs);
+ }
- /**
- * Method unmarshal.
- *
- * @param reader
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @return the unmarshaled uk.ac.vamsas.objects.core.RangeType
- */
- public static uk.ac.vamsas.objects.core.RangeType unmarshal(
- final java.io.Reader reader)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- return (uk.ac.vamsas.objects.core.RangeType) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.AlignmentAnnotation.class, reader);
- }
+ /**
+ *
+ *
+ * @param vSeqrefsArray
+ */
+ public void setSeqrefs(final java.lang.Object[] vSeqrefsArray) {
+ // -- copy array
+ _seqrefs.clear();
- /**
- *
- *
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void validate(
- )
- throws org.exolab.castor.xml.ValidationException {
- org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
- validator.validate(this);
+ for (int i = 0; i < vSeqrefsArray.length; i++) {
+ this._seqrefs.add(vSeqrefsArray[i]);
}
+ }
+
+ /**
+ * Sets the value of '_seqrefs' by copying the given Vector. All elements will
+ * be checked for type safety.
+ *
+ * @param vSeqrefsList
+ * the Vector to copy.
+ */
+ public void setSeqrefs(final java.util.Vector vSeqrefsList) {
+ // copy vector
+ this._seqrefs.clear();
+
+ this._seqrefs.addAll(vSeqrefsList);
+ }
+
+ /**
+ * Sets the value of '_seqrefs' by setting it to the given Vector. No type
+ * checking is performed.
+ *
+ * @deprecated
+ *
+ * @param seqrefsVector
+ * the Vector to set.
+ */
+ public void setSeqrefsAsReference(final java.util.Vector seqrefsVector) {
+ this._seqrefs = seqrefsVector;
+ }
+
+ /**
+ * Method unmarshal.
+ *
+ * @param reader
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @return the unmarshaled uk.ac.vamsas.objects.core.RangeType
+ */
+ public static uk.ac.vamsas.objects.core.RangeType unmarshal(
+ final java.io.Reader reader)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ return (uk.ac.vamsas.objects.core.RangeType) Unmarshaller.unmarshal(
+ uk.ac.vamsas.objects.core.AlignmentAnnotation.class, reader);
+ }
+
+ /**
+ *
+ *
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void validate() throws org.exolab.castor.xml.ValidationException {
+ org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+ validator.validate(this);
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/AlignmentSequence.java b/src/uk/ac/vamsas/objects/core/AlignmentSequence.java
index 8192795..58c866f 100644
--- a/src/uk/ac/vamsas/objects/core/AlignmentSequence.java
+++ b/src/uk/ac/vamsas/objects/core/AlignmentSequence.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import org.exolab.castor.xml.Marshaller;
@@ -17,488 +31,518 @@ import org.exolab.castor.xml.Unmarshaller;
/**
* Class AlignmentSequence.
*
- * @version $Revision$ $Date$
+ * @version $Revision$ $Date: 2007-06-28 14:51:44 +0100 (Thu, 28 Jun 2007)
+ * $
*/
-public class AlignmentSequence extends uk.ac.vamsas.objects.core.SequenceType
-implements java.io.Serializable
-{
-
-
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
- * Primary Key for vamsas object
- * referencing
- */
- private java.lang.String _id;
-
- /**
- * Dataset Sequence from which
- * this alignment sequence is taken from
- *
- */
- private java.lang.Object _refid;
-
- /**
- * Field _alignmentSequenceAnnotationList.
- */
- private java.util.Vector _alignmentSequenceAnnotationList;
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public AlignmentSequence() {
- super();
- this._alignmentSequenceAnnotationList = new java.util.Vector();
- }
-
-
- //-----------/
- //- Methods -/
- //-----------/
-
- /**
- *
- *
- * @param vAlignmentSequenceAnnotation
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addAlignmentSequenceAnnotation(
- final uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation vAlignmentSequenceAnnotation)
- throws java.lang.IndexOutOfBoundsException {
- this._alignmentSequenceAnnotationList.addElement(vAlignmentSequenceAnnotation);
- }
-
- /**
- *
- *
- * @param index
- * @param vAlignmentSequenceAnnotation
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addAlignmentSequenceAnnotation(
- final int index,
- final uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation vAlignmentSequenceAnnotation)
- throws java.lang.IndexOutOfBoundsException {
- this._alignmentSequenceAnnotationList.add(index, vAlignmentSequenceAnnotation);
- }
-
- /**
- * Method enumerateAlignmentSequenceAnnotation.
- *
- * @return an Enumeration over all
- * uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation element
- */
- public java.util.Enumeration enumerateAlignmentSequenceAnnotation(
- ) {
- return this._alignmentSequenceAnnotationList.elements();
- }
-
- /**
- * Overrides the java.lang.Object.equals method.
- *
- * @param obj
- * @return true if the objects are equal.
- */
- public boolean equals(
- final java.lang.Object obj) {
- if ( this == obj )
- return true;
-
- if (super.equals(obj)==false)
+public class AlignmentSequence extends uk.ac.vamsas.objects.core.SequenceType
+ implements java.io.Serializable {
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * Primary Key for vamsas object referencing
+ */
+ private java.lang.String _id;
+
+ /**
+ * Dataset Sequence from which this alignment sequence is taken from
+ *
+ */
+ private java.lang.Object _refid;
+
+ /**
+ * Field _alignmentSequenceAnnotationList.
+ */
+ private java.util.Vector _alignmentSequenceAnnotationList;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public AlignmentSequence() {
+ super();
+ this._alignmentSequenceAnnotationList = new java.util.Vector();
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ *
+ *
+ * @param vAlignmentSequenceAnnotation
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addAlignmentSequenceAnnotation(
+ final uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation vAlignmentSequenceAnnotation)
+ throws java.lang.IndexOutOfBoundsException {
+ this._alignmentSequenceAnnotationList
+ .addElement(vAlignmentSequenceAnnotation);
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vAlignmentSequenceAnnotation
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addAlignmentSequenceAnnotation(
+ final int index,
+ final uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation vAlignmentSequenceAnnotation)
+ throws java.lang.IndexOutOfBoundsException {
+ this._alignmentSequenceAnnotationList.add(index,
+ vAlignmentSequenceAnnotation);
+ }
+
+ /**
+ * Method enumerateAlignmentSequenceAnnotation.
+ *
+ * @return an Enumeration over all
+ * uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation element
+ */
+ public java.util.Enumeration enumerateAlignmentSequenceAnnotation() {
+ return this._alignmentSequenceAnnotationList.elements();
+ }
+
+ /**
+ * Overrides the java.lang.Object.equals method.
+ *
+ * @param obj
+ * @return true if the objects are equal.
+ */
+ public boolean equals(final java.lang.Object obj) {
+ if (this == obj)
+ return true;
+
+ if (super.equals(obj) == false)
+ return false;
+
+ if (obj instanceof AlignmentSequence) {
+
+ AlignmentSequence temp = (AlignmentSequence) obj;
+ boolean thcycle;
+ boolean tmcycle;
+ if (this._id != null) {
+ if (temp._id == null)
+ return false;
+ if (this._id != temp._id) {
+ thcycle = org.castor.util.CycleBreaker.startingToCycle(this._id);
+ tmcycle = org.castor.util.CycleBreaker.startingToCycle(temp._id);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
+ }
+ ;
return false;
-
- if (obj instanceof AlignmentSequence) {
-
- AlignmentSequence temp = (AlignmentSequence)obj;
- boolean thcycle;
- boolean tmcycle;
- if (this._id != null) {
- if (temp._id == null) return false;
- if (this._id != temp._id) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._id);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._id);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._id); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._id); };
- return false;
- }
- if (!thcycle) {
- if (!this._id.equals(temp._id)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
- }
- }
- } else if (temp._id != null)
- return false;
- if (this._refid != null) {
- if (temp._refid == null) return false;
- if (this._refid != temp._refid) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._refid);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._refid);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._refid); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._refid); };
- return false;
- }
- if (!thcycle) {
- if (!this._refid.equals(temp._refid)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._refid);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._refid);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._refid);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._refid);
- }
- }
- } else if (temp._refid != null)
- return false;
- if (this._alignmentSequenceAnnotationList != null) {
- if (temp._alignmentSequenceAnnotationList == null) return false;
- if (this._alignmentSequenceAnnotationList != temp._alignmentSequenceAnnotationList) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._alignmentSequenceAnnotationList);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._alignmentSequenceAnnotationList);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._alignmentSequenceAnnotationList); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._alignmentSequenceAnnotationList); };
- return false;
- }
- if (!thcycle) {
- if (!this._alignmentSequenceAnnotationList.equals(temp._alignmentSequenceAnnotationList)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._alignmentSequenceAnnotationList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._alignmentSequenceAnnotationList);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._alignmentSequenceAnnotationList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._alignmentSequenceAnnotationList);
- }
- }
- } else if (temp._alignmentSequenceAnnotationList != null)
- return false;
- return true;
+ }
+ if (!thcycle) {
+ if (!this._id.equals(temp._id)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
+ }
}
+ } else if (temp._id != null)
return false;
- }
-
- /**
- * Method getAlignmentSequenceAnnotation.
- *
- * @param index
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- * @return the value of the
- * uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation at the
- * given index
- */
- public uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation getAlignmentSequenceAnnotation(
- final int index)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._alignmentSequenceAnnotationList.size()) {
- throw new IndexOutOfBoundsException("getAlignmentSequenceAnnotation: Index value '" + index + "' not in range [0.." + (this._alignmentSequenceAnnotationList.size() - 1) + "]");
- }
-
- return (uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation) _alignmentSequenceAnnotationList.get(index);
- }
-
- /**
- * Method getAlignmentSequenceAnnotation.Returns the contents
- * of the collection in an Array.
Note: Just in case the
- * collection contents are changing in another thread, we pass
- * a 0-length Array of the correct type into the API call.
- * This way we know that the Array returned is of
- * exactly the correct length.
- *
- * @return this collection as an Array
- */
- public uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation[] getAlignmentSequenceAnnotation(
- ) {
- uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation[] array = new uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation[0];
- return (uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation[]) this._alignmentSequenceAnnotationList.toArray(array);
- }
-
- /**
- * Method getAlignmentSequenceAnnotationAsReference.Returns a
- * reference to '_alignmentSequenceAnnotationList'. No type
- * checking is performed on any modifications to the Vector.
- *
- * @return a reference to the Vector backing this class
- */
- public java.util.Vector getAlignmentSequenceAnnotationAsReference(
- ) {
- return this._alignmentSequenceAnnotationList;
- }
-
- /**
- * Method getAlignmentSequenceAnnotationCount.
- *
- * @return the size of this collection
- */
- public int getAlignmentSequenceAnnotationCount(
- ) {
- return this._alignmentSequenceAnnotationList.size();
- }
-
- /**
- * Returns the value of field 'id'. The field 'id' has the
- * following description: Primary Key for vamsas object
- * referencing
- *
- * @return the value of field 'Id'.
- */
- public java.lang.String getId(
- ) {
- return this._id;
- }
-
- /**
- * Returns the value of field 'refid'. The field 'refid' has
- * the following description: Dataset Sequence from which
- * this alignment sequence is taken from
- *
- *
- * @return the value of field 'Refid'.
- */
- public java.lang.Object getRefid(
- ) {
- return this._refid;
- }
-
- /**
- * Overrides the java.lang.Object.hashCode method.
- *
- * The following steps came from Effective Java Programming
- * Language Guide by Joshua Bloch, Chapter 3
- *
- * @return a hash code value for the object.
- */
- public int hashCode(
- ) {
- int result = super.hashCode();
-
- long tmp;
- if (_id != null
- && !org.castor.util.CycleBreaker.startingToCycle(_id)) {
- result = 37 * result + _id.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_id);
- }
- if (_refid != null
- && !org.castor.util.CycleBreaker.startingToCycle(_refid)) {
- result = 37 * result + _refid.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_refid);
- }
- if (_alignmentSequenceAnnotationList != null
- && !org.castor.util.CycleBreaker.startingToCycle(_alignmentSequenceAnnotationList)) {
- result = 37 * result + _alignmentSequenceAnnotationList.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_alignmentSequenceAnnotationList);
- }
-
- return result;
- }
-
- /**
- * Method isValid.
- *
- * @return true if this object is valid according to the schema
- */
- public boolean isValid(
- ) {
- try {
- validate();
- } catch (org.exolab.castor.xml.ValidationException vex) {
+ if (this._refid != null) {
+ if (temp._refid == null)
+ return false;
+ if (this._refid != temp._refid) {
+ thcycle = org.castor.util.CycleBreaker.startingToCycle(this._refid);
+ tmcycle = org.castor.util.CycleBreaker.startingToCycle(temp._refid);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._refid);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._refid);
+ }
+ ;
return false;
+ }
+ if (!thcycle) {
+ if (!this._refid.equals(temp._refid)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._refid);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._refid);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._refid);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._refid);
+ }
}
- return true;
- }
-
- /**
- *
- *
- * @param out
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void marshal(
- final java.io.Writer out)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, out);
- }
-
- /**
- *
- *
- * @param handler
- * @throws java.io.IOException if an IOException occurs during
- * marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- */
- public void marshal(
- final org.xml.sax.ContentHandler handler)
- throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, handler);
- }
-
- /**
- * Method removeAlignmentSequenceAnnotation.
- *
- * @param vAlignmentSequenceAnnotation
- * @return true if the object was removed from the collection.
- */
- public boolean removeAlignmentSequenceAnnotation(
- final uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation vAlignmentSequenceAnnotation) {
- boolean removed = _alignmentSequenceAnnotationList.remove(vAlignmentSequenceAnnotation);
- return removed;
- }
-
- /**
- * Method removeAlignmentSequenceAnnotationAt.
- *
- * @param index
- * @return the element removed from the collection
- */
- public uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation removeAlignmentSequenceAnnotationAt(
- final int index) {
- java.lang.Object obj = this._alignmentSequenceAnnotationList.remove(index);
- return (uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation) obj;
- }
-
- /**
- */
- public void removeAllAlignmentSequenceAnnotation(
- ) {
- this._alignmentSequenceAnnotationList.clear();
- }
-
- /**
- *
- *
- * @param index
- * @param vAlignmentSequenceAnnotation
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void setAlignmentSequenceAnnotation(
- final int index,
- final uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation vAlignmentSequenceAnnotation)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._alignmentSequenceAnnotationList.size()) {
- throw new IndexOutOfBoundsException("setAlignmentSequenceAnnotation: Index value '" + index + "' not in range [0.." + (this._alignmentSequenceAnnotationList.size() - 1) + "]");
+ } else if (temp._refid != null)
+ return false;
+ if (this._alignmentSequenceAnnotationList != null) {
+ if (temp._alignmentSequenceAnnotationList == null)
+ return false;
+ if (this._alignmentSequenceAnnotationList != temp._alignmentSequenceAnnotationList) {
+ thcycle = org.castor.util.CycleBreaker
+ .startingToCycle(this._alignmentSequenceAnnotationList);
+ tmcycle = org.castor.util.CycleBreaker
+ .startingToCycle(temp._alignmentSequenceAnnotationList);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(this._alignmentSequenceAnnotationList);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(temp._alignmentSequenceAnnotationList);
+ }
+ ;
+ return false;
+ }
+ if (!thcycle) {
+ if (!this._alignmentSequenceAnnotationList
+ .equals(temp._alignmentSequenceAnnotationList)) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(this._alignmentSequenceAnnotationList);
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(temp._alignmentSequenceAnnotationList);
+ return false;
+ }
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(this._alignmentSequenceAnnotationList);
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(temp._alignmentSequenceAnnotationList);
+ }
}
-
- this._alignmentSequenceAnnotationList.set(index, vAlignmentSequenceAnnotation);
+ } else if (temp._alignmentSequenceAnnotationList != null)
+ return false;
+ return true;
}
-
- /**
- *
- *
- * @param vAlignmentSequenceAnnotationArray
- */
- public void setAlignmentSequenceAnnotation(
- final uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation[] vAlignmentSequenceAnnotationArray) {
- //-- copy array
- _alignmentSequenceAnnotationList.clear();
-
- for (int i = 0; i < vAlignmentSequenceAnnotationArray.length; i++) {
- this._alignmentSequenceAnnotationList.add(vAlignmentSequenceAnnotationArray[i]);
- }
+ return false;
+ }
+
+ /**
+ * Method getAlignmentSequenceAnnotation.
+ *
+ * @param index
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ * @return the value of the
+ * uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation at the given
+ * index
+ */
+ public uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation getAlignmentSequenceAnnotation(
+ final int index) throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._alignmentSequenceAnnotationList.size()) {
+ throw new IndexOutOfBoundsException(
+ "getAlignmentSequenceAnnotation: Index value '" + index
+ + "' not in range [0.."
+ + (this._alignmentSequenceAnnotationList.size() - 1) + "]");
}
- /**
- * Sets the value of '_alignmentSequenceAnnotationList' by
- * copying the given Vector. All elements will be checked for
- * type safety.
- *
- * @param vAlignmentSequenceAnnotationList the Vector to copy.
- */
- public void setAlignmentSequenceAnnotation(
- final java.util.Vector vAlignmentSequenceAnnotationList) {
- // copy vector
- this._alignmentSequenceAnnotationList.clear();
-
- this._alignmentSequenceAnnotationList.addAll(vAlignmentSequenceAnnotationList);
+ return (uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation) _alignmentSequenceAnnotationList
+ .get(index);
+ }
+
+ /**
+ * Method getAlignmentSequenceAnnotation.Returns the contents of the
+ * collection in an Array.
+ *
+ * Note: Just in case the collection contents are changing in another thread,
+ * we pass a 0-length Array of the correct type into the API call. This way we
+ * know that the Array returned is of exactly the correct length.
+ *
+ * @return this collection as an Array
+ */
+ public uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation[] getAlignmentSequenceAnnotation() {
+ uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation[] array = new uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation[0];
+ return (uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation[]) this._alignmentSequenceAnnotationList
+ .toArray(array);
+ }
+
+ /**
+ * Method getAlignmentSequenceAnnotationAsReference.Returns a reference to
+ * '_alignmentSequenceAnnotationList'. No type checking is performed on any
+ * modifications to the Vector.
+ *
+ * @return a reference to the Vector backing this class
+ */
+ public java.util.Vector getAlignmentSequenceAnnotationAsReference() {
+ return this._alignmentSequenceAnnotationList;
+ }
+
+ /**
+ * Method getAlignmentSequenceAnnotationCount.
+ *
+ * @return the size of this collection
+ */
+ public int getAlignmentSequenceAnnotationCount() {
+ return this._alignmentSequenceAnnotationList.size();
+ }
+
+ /**
+ * Returns the value of field 'id'. The field 'id' has the following
+ * description: Primary Key for vamsas object referencing
+ *
+ * @return the value of field 'Id'.
+ */
+ public java.lang.String getId() {
+ return this._id;
+ }
+
+ /**
+ * Returns the value of field 'refid'. The field 'refid' has the following
+ * description: Dataset Sequence from which this alignment sequence is taken
+ * from
+ *
+ *
+ * @return the value of field 'Refid'.
+ */
+ public java.lang.Object getRefid() {
+ return this._refid;
+ }
+
+ /**
+ * Overrides the java.lang.Object.hashCode method.
+ *
+ * The following steps came from Effective Java Programming Language
+ * Guide by Joshua Bloch, Chapter 3
+ *
+ * @return a hash code value for the object.
+ */
+ public int hashCode() {
+ int result = super.hashCode();
+
+ long tmp;
+ if (_id != null && !org.castor.util.CycleBreaker.startingToCycle(_id)) {
+ result = 37 * result + _id.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_id);
}
-
- /**
- * Sets the value of '_alignmentSequenceAnnotationList' by
- * setting it to the given Vector. No type checking is
- * performed.
- * @deprecated
- *
- * @param alignmentSequenceAnnotationVector the Vector to set.
- */
- public void setAlignmentSequenceAnnotationAsReference(
- final java.util.Vector alignmentSequenceAnnotationVector) {
- this._alignmentSequenceAnnotationList = alignmentSequenceAnnotationVector;
+ if (_refid != null && !org.castor.util.CycleBreaker.startingToCycle(_refid)) {
+ result = 37 * result + _refid.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_refid);
}
-
- /**
- * Sets the value of field 'id'. The field 'id' has the
- * following description: Primary Key for vamsas object
- * referencing
- *
- * @param id the value of field 'id'.
- */
- public void setId(
- final java.lang.String id) {
- this._id = id;
+ if (_alignmentSequenceAnnotationList != null
+ && !org.castor.util.CycleBreaker
+ .startingToCycle(_alignmentSequenceAnnotationList)) {
+ result = 37 * result + _alignmentSequenceAnnotationList.hashCode();
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(_alignmentSequenceAnnotationList);
}
- /**
- * Sets the value of field 'refid'. The field 'refid' has the
- * following description: Dataset Sequence from which
- * this alignment sequence is taken from
- *
- *
- * @param refid the value of field 'refid'.
- */
- public void setRefid(
- final java.lang.Object refid) {
- this._refid = refid;
+ return result;
+ }
+
+ /**
+ * Method isValid.
+ *
+ * @return true if this object is valid according to the schema
+ */
+ public boolean isValid() {
+ try {
+ validate();
+ } catch (org.exolab.castor.xml.ValidationException vex) {
+ return false;
}
-
- /**
- * Method unmarshal.
- *
- * @param reader
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @return the unmarshaled uk.ac.vamsas.objects.core.SequenceTyp
+ return true;
+ }
+
+ /**
+ *
+ *
+ * @param out
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void marshal(final java.io.Writer out)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, out);
+ }
+
+ /**
+ *
+ *
+ * @param handler
+ * @throws java.io.IOException
+ * if an IOException occurs during marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ */
+ public void marshal(final org.xml.sax.ContentHandler handler)
+ throws java.io.IOException, org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, handler);
+ }
+
+ /**
+ * Method removeAlignmentSequenceAnnotation.
+ *
+ * @param vAlignmentSequenceAnnotation
+ * @return true if the object was removed from the collection.
+ */
+ public boolean removeAlignmentSequenceAnnotation(
+ final uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation vAlignmentSequenceAnnotation) {
+ boolean removed = _alignmentSequenceAnnotationList
+ .remove(vAlignmentSequenceAnnotation);
+ return removed;
+ }
+
+ /**
+ * Method removeAlignmentSequenceAnnotationAt.
+ *
+ * @param index
+ * @return the element removed from the collection
+ */
+ public uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation removeAlignmentSequenceAnnotationAt(
+ final int index) {
+ java.lang.Object obj = this._alignmentSequenceAnnotationList.remove(index);
+ return (uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation) obj;
+ }
+
+ /**
*/
- public static uk.ac.vamsas.objects.core.SequenceType unmarshal(
- final java.io.Reader reader)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- return (uk.ac.vamsas.objects.core.SequenceType) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.AlignmentSequence.class, reader);
+ public void removeAllAlignmentSequenceAnnotation() {
+ this._alignmentSequenceAnnotationList.clear();
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vAlignmentSequenceAnnotation
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void setAlignmentSequenceAnnotation(
+ final int index,
+ final uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation vAlignmentSequenceAnnotation)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._alignmentSequenceAnnotationList.size()) {
+ throw new IndexOutOfBoundsException(
+ "setAlignmentSequenceAnnotation: Index value '" + index
+ + "' not in range [0.."
+ + (this._alignmentSequenceAnnotationList.size() - 1) + "]");
}
- /**
- *
- *
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void validate(
- )
- throws org.exolab.castor.xml.ValidationException {
- org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
- validator.validate(this);
+ this._alignmentSequenceAnnotationList.set(index,
+ vAlignmentSequenceAnnotation);
+ }
+
+ /**
+ *
+ *
+ * @param vAlignmentSequenceAnnotationArray
+ */
+ public void setAlignmentSequenceAnnotation(
+ final uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation[] vAlignmentSequenceAnnotationArray) {
+ // -- copy array
+ _alignmentSequenceAnnotationList.clear();
+
+ for (int i = 0; i < vAlignmentSequenceAnnotationArray.length; i++) {
+ this._alignmentSequenceAnnotationList
+ .add(vAlignmentSequenceAnnotationArray[i]);
}
+ }
+
+ /**
+ * Sets the value of '_alignmentSequenceAnnotationList' by copying the given
+ * Vector. All elements will be checked for type safety.
+ *
+ * @param vAlignmentSequenceAnnotationList
+ * the Vector to copy.
+ */
+ public void setAlignmentSequenceAnnotation(
+ final java.util.Vector vAlignmentSequenceAnnotationList) {
+ // copy vector
+ this._alignmentSequenceAnnotationList.clear();
+
+ this._alignmentSequenceAnnotationList
+ .addAll(vAlignmentSequenceAnnotationList);
+ }
+
+ /**
+ * Sets the value of '_alignmentSequenceAnnotationList' by setting it to the
+ * given Vector. No type checking is performed.
+ *
+ * @deprecated
+ *
+ * @param alignmentSequenceAnnotationVector
+ * the Vector to set.
+ */
+ public void setAlignmentSequenceAnnotationAsReference(
+ final java.util.Vector alignmentSequenceAnnotationVector) {
+ this._alignmentSequenceAnnotationList = alignmentSequenceAnnotationVector;
+ }
+
+ /**
+ * Sets the value of field 'id'. The field 'id' has the following description:
+ * Primary Key for vamsas object referencing
+ *
+ * @param id
+ * the value of field 'id'.
+ */
+ public void setId(final java.lang.String id) {
+ this._id = id;
+ }
+
+ /**
+ * Sets the value of field 'refid'. The field 'refid' has the following
+ * description: Dataset Sequence from which this alignment sequence is taken
+ * from
+ *
+ *
+ * @param refid
+ * the value of field 'refid'.
+ */
+ public void setRefid(final java.lang.Object refid) {
+ this._refid = refid;
+ }
+
+ /**
+ * Method unmarshal.
+ *
+ * @param reader
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @return the unmarshaled uk.ac.vamsas.objects.core.SequenceTyp
+ */
+ public static uk.ac.vamsas.objects.core.SequenceType unmarshal(
+ final java.io.Reader reader)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ return (uk.ac.vamsas.objects.core.SequenceType) Unmarshaller.unmarshal(
+ uk.ac.vamsas.objects.core.AlignmentSequence.class, reader);
+ }
+
+ /**
+ *
+ *
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void validate() throws org.exolab.castor.xml.ValidationException {
+ org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+ validator.validate(this);
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/AlignmentSequenceAnnotation.java b/src/uk/ac/vamsas/objects/core/AlignmentSequenceAnnotation.java
index 7494819..ae36079 100644
--- a/src/uk/ac/vamsas/objects/core/AlignmentSequenceAnnotation.java
+++ b/src/uk/ac/vamsas/objects/core/AlignmentSequenceAnnotation.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import org.exolab.castor.xml.Marshaller;
@@ -19,286 +33,271 @@ import org.exolab.castor.xml.Unmarshaller;
*
* @version $Revision$ $Date$
*/
-public class AlignmentSequenceAnnotation extends uk.ac.vamsas.objects.core.RangeAnnotation
-implements java.io.Serializable
-{
+public class AlignmentSequenceAnnotation extends
+ uk.ac.vamsas.objects.core.RangeAnnotation implements java.io.Serializable {
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
+ /**
+ * TODO: decide if this flag is redundant - when true it would suggest that
+ * the annotationElement values together form a graph
+ *
+ */
+ private boolean _graph;
- /**
- * TODO:
- * decide if this flag is
- * redundant - when true it
- * would suggest that the
- * annotationElement values
- * together form a graph
- *
- */
- private boolean _graph;
+ /**
+ * keeps track of state for field: _graph
+ */
+ private boolean _has_graph;
- /**
- * keeps track of state for field: _graph
- */
- private boolean _has_graph;
+ /**
+ * Field _provenance.
+ */
+ private uk.ac.vamsas.objects.core.Provenance _provenance;
- /**
- * Field _provenance.
- */
- private uk.ac.vamsas.objects.core.Provenance _provenance;
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+ public AlignmentSequenceAnnotation() {
+ super();
+ }
- //----------------/
- //- Constructors -/
- //----------------/
+ // -----------/
+ // - Methods -/
+ // -----------/
- public AlignmentSequenceAnnotation() {
- super();
- }
+ /**
+ */
+ public void deleteGraph() {
+ this._has_graph = false;
+ }
+ /**
+ * Overrides the java.lang.Object.equals method.
+ *
+ * @param obj
+ * @return true if the objects are equal.
+ */
+ public boolean equals(final java.lang.Object obj) {
+ if (this == obj)
+ return true;
- //-----------/
- //- Methods -/
- //-----------/
+ if (super.equals(obj) == false)
+ return false;
- /**
- */
- public void deleteGraph(
- ) {
- this._has_graph= false;
- }
+ if (obj instanceof AlignmentSequenceAnnotation) {
- /**
- * Overrides the java.lang.Object.equals method.
- *
- * @param obj
- * @return true if the objects are equal.
- */
- public boolean equals(
- final java.lang.Object obj) {
- if ( this == obj )
- return true;
-
- if (super.equals(obj)==false)
+ AlignmentSequenceAnnotation temp = (AlignmentSequenceAnnotation) obj;
+ boolean thcycle;
+ boolean tmcycle;
+ if (this._graph != temp._graph)
+ return false;
+ if (this._has_graph != temp._has_graph)
+ return false;
+ if (this._provenance != null) {
+ if (temp._provenance == null)
+ return false;
+ if (this._provenance != temp._provenance) {
+ thcycle = org.castor.util.CycleBreaker
+ .startingToCycle(this._provenance);
+ tmcycle = org.castor.util.CycleBreaker
+ .startingToCycle(temp._provenance);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance);
+ }
+ ;
return false;
-
- if (obj instanceof AlignmentSequenceAnnotation) {
-
- AlignmentSequenceAnnotation temp = (AlignmentSequenceAnnotation)obj;
- boolean thcycle;
- boolean tmcycle;
- if (this._graph != temp._graph)
- return false;
- if (this._has_graph != temp._has_graph)
- return false;
- if (this._provenance != null) {
- if (temp._provenance == null) return false;
- if (this._provenance != temp._provenance) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._provenance);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._provenance);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance); };
- return false;
- }
- if (!thcycle) {
- if (!this._provenance.equals(temp._provenance)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance);
- }
- }
- } else if (temp._provenance != null)
- return false;
- return true;
+ }
+ if (!thcycle) {
+ if (!this._provenance.equals(temp._provenance)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance);
+ }
}
+ } else if (temp._provenance != null)
return false;
+ return true;
}
+ return false;
+ }
- /**
- * Returns the value of field 'graph'. The field 'graph' has
- * the following description: TODO:
- * decide if this flag is
- * redundant - when true it
- * would suggest that the
- * annotationElement values
- * together form a graph
- *
- *
- * @return the value of field 'Graph'.
- */
- public boolean getGraph(
- ) {
- return this._graph;
- }
+ /**
+ * Returns the value of field 'graph'. The field 'graph' has the following
+ * description: TODO: decide if this flag is redundant - when true it would
+ * suggest that the annotationElement values together form a graph
+ *
+ *
+ * @return the value of field 'Graph'.
+ */
+ public boolean getGraph() {
+ return this._graph;
+ }
- /**
- * Returns the value of field 'provenance'.
- *
- * @return the value of field 'Provenance'.
- */
- public uk.ac.vamsas.objects.core.Provenance getProvenance(
- ) {
- return this._provenance;
- }
+ /**
+ * Returns the value of field 'provenance'.
+ *
+ * @return the value of field 'Provenance'.
+ */
+ public uk.ac.vamsas.objects.core.Provenance getProvenance() {
+ return this._provenance;
+ }
- /**
- * Method hasGraph.
- *
- * @return true if at least one Graph has been added
- */
- public boolean hasGraph(
- ) {
- return this._has_graph;
- }
+ /**
+ * Method hasGraph.
+ *
+ * @return true if at least one Graph has been added
+ */
+ public boolean hasGraph() {
+ return this._has_graph;
+ }
- /**
- * Overrides the java.lang.Object.hashCode method.
- *
- * The following steps came from Effective Java Programming
- * Language Guide by Joshua Bloch, Chapter 3
- *
- * @return a hash code value for the object.
- */
- public int hashCode(
- ) {
- int result = super.hashCode();
-
- long tmp;
- result = 37 * result + (_graph?0:1);
- if (_provenance != null
- && !org.castor.util.CycleBreaker.startingToCycle(_provenance)) {
- result = 37 * result + _provenance.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_provenance);
- }
-
- return result;
- }
+ /**
+ * Overrides the java.lang.Object.hashCode method.
+ *
+ * The following steps came from Effective Java Programming Language
+ * Guide by Joshua Bloch, Chapter 3
+ *
+ * @return a hash code value for the object.
+ */
+ public int hashCode() {
+ int result = super.hashCode();
- /**
- * Returns the value of field 'graph'. The field 'graph' has
- * the following description: TODO:
- * decide if this flag is
- * redundant - when true it
- * would suggest that the
- * annotationElement values
- * together form a graph
- *
- *
- * @return the value of field 'Graph'.
- */
- public boolean isGraph(
- ) {
- return this._graph;
+ long tmp;
+ result = 37 * result + (_graph ? 0 : 1);
+ if (_provenance != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_provenance)) {
+ result = 37 * result + _provenance.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_provenance);
}
- /**
- * Method isValid.
- *
- * @return true if this object is valid according to the schema
- */
- public boolean isValid(
- ) {
- try {
- validate();
- } catch (org.exolab.castor.xml.ValidationException vex) {
- return false;
- }
- return true;
- }
+ return result;
+ }
- /**
- *
- *
- * @param out
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void marshal(
- final java.io.Writer out)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, out);
- }
+ /**
+ * Returns the value of field 'graph'. The field 'graph' has the following
+ * description: TODO: decide if this flag is redundant - when true it would
+ * suggest that the annotationElement values together form a graph
+ *
+ *
+ * @return the value of field 'Graph'.
+ */
+ public boolean isGraph() {
+ return this._graph;
+ }
- /**
- *
- *
- * @param handler
- * @throws java.io.IOException if an IOException occurs during
- * marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- */
- public void marshal(
- final org.xml.sax.ContentHandler handler)
- throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, handler);
+ /**
+ * Method isValid.
+ *
+ * @return true if this object is valid according to the schema
+ */
+ public boolean isValid() {
+ try {
+ validate();
+ } catch (org.exolab.castor.xml.ValidationException vex) {
+ return false;
}
+ return true;
+ }
- /**
- * Sets the value of field 'graph'. The field 'graph' has the
- * following description: TODO:
- * decide if this flag is
- * redundant - when true it
- * would suggest that the
- * annotationElement values
- * together form a graph
- *
- *
- * @param graph the value of field 'graph'.
- */
- public void setGraph(
- final boolean graph) {
- this._graph = graph;
- this._has_graph = true;
- }
+ /**
+ *
+ *
+ * @param out
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void marshal(final java.io.Writer out)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, out);
+ }
- /**
- * Sets the value of field 'provenance'.
- *
- * @param provenance the value of field 'provenance'.
- */
- public void setProvenance(
- final uk.ac.vamsas.objects.core.Provenance provenance) {
- this._provenance = provenance;
- }
+ /**
+ *
+ *
+ * @param handler
+ * @throws java.io.IOException
+ * if an IOException occurs during marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ */
+ public void marshal(final org.xml.sax.ContentHandler handler)
+ throws java.io.IOException, org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, handler);
+ }
- /**
- * Method unmarshal.
- *
- * @param reader
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @return the unmarshaled uk.ac.vamsas.objects.core.RangeType
- */
- public static uk.ac.vamsas.objects.core.RangeType unmarshal(
- final java.io.Reader reader)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- return (uk.ac.vamsas.objects.core.RangeType) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation.class, reader);
- }
+ /**
+ * Sets the value of field 'graph'. The field 'graph' has the following
+ * description: TODO: decide if this flag is redundant - when true it would
+ * suggest that the annotationElement values together form a graph
+ *
+ *
+ * @param graph
+ * the value of field 'graph'.
+ */
+ public void setGraph(final boolean graph) {
+ this._graph = graph;
+ this._has_graph = true;
+ }
- /**
- *
- *
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void validate(
- )
- throws org.exolab.castor.xml.ValidationException {
- org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
- validator.validate(this);
- }
+ /**
+ * Sets the value of field 'provenance'.
+ *
+ * @param provenance
+ * the value of field 'provenance'.
+ */
+ public void setProvenance(
+ final uk.ac.vamsas.objects.core.Provenance provenance) {
+ this._provenance = provenance;
+ }
+
+ /**
+ * Method unmarshal.
+ *
+ * @param reader
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @return the unmarshaled uk.ac.vamsas.objects.core.RangeType
+ */
+ public static uk.ac.vamsas.objects.core.RangeType unmarshal(
+ final java.io.Reader reader)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ return (uk.ac.vamsas.objects.core.RangeType) Unmarshaller.unmarshal(
+ uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation.class, reader);
+ }
+
+ /**
+ *
+ *
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void validate() throws org.exolab.castor.xml.ValidationException {
+ org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+ validator.validate(this);
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/AnnotationElement.java b/src/uk/ac/vamsas/objects/core/AnnotationElement.java
index 05aec77..45cb5c7 100644
--- a/src/uk/ac/vamsas/objects/core/AnnotationElement.java
+++ b/src/uk/ac/vamsas/objects/core/AnnotationElement.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import org.exolab.castor.xml.Marshaller;
@@ -17,841 +31,829 @@ import org.exolab.castor.xml.Unmarshaller;
/**
* Class AnnotationElement.
*
- * @version $Revision$ $Date$
+ * @version $Revision$ $Date: 2007-06-28 14:51:44 +0100 (Thu, 28 Jun 2007)
+ * $
*/
-public class AnnotationElement extends uk.ac.vamsas.client.Vobject
-implements java.io.Serializable
-{
-
-
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
- * position with respect to the coordinate frame defined by a
- * rangeType specification
- */
- private long _position;
-
- /**
- * keeps track of state for field: _position
- */
- private boolean _has_position;
-
- /**
- * true means the annotation element appears between the
- * specified position and the next
- */
- private boolean _after = false;
-
- /**
- * keeps track of state for field: _after
- */
- private boolean _has_after;
-
- /**
- * Primary Key for vamsas object referencing
- */
- private java.lang.String _id;
-
- /**
- * Free text at this position
- */
- private java.lang.String _description;
-
- /**
- * Discrete symbol - possibly graphically represented
- *
- */
- private java.util.Vector _glyphList;
-
- /**
- * Ordered set of float values - an application may treat
- * the values together as a vector with common support for a
- * set of
- * annotation elements - but this is, again, not validated so
- * applications
- * should deal gracefully with varying numbers of dimensions
- *
- */
- private java.util.Vector _valueList;
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public AnnotationElement() {
- super();
- this._glyphList = new java.util.Vector();
- this._valueList = new java.util.Vector();
- }
-
-
- //-----------/
- //- Methods -/
- //-----------/
-
- /**
- *
- *
- * @param vGlyph
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addGlyph(
- final uk.ac.vamsas.objects.core.Glyph vGlyph)
- throws java.lang.IndexOutOfBoundsException {
- this._glyphList.addElement(vGlyph);
- }
-
- /**
- *
- *
- * @param index
- * @param vGlyph
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addGlyph(
- final int index,
- final uk.ac.vamsas.objects.core.Glyph vGlyph)
- throws java.lang.IndexOutOfBoundsException {
- this._glyphList.add(index, vGlyph);
- }
-
- /**
- *
- *
- * @param vValue
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addValue(
- final float vValue)
- throws java.lang.IndexOutOfBoundsException {
- this._valueList.addElement(new java.lang.Float(vValue));
- }
-
- /**
- *
- *
- * @param index
- * @param vValue
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addValue(
- final int index,
- final float vValue)
- throws java.lang.IndexOutOfBoundsException {
- this._valueList.add(index, new java.lang.Float(vValue));
- }
-
- /**
- */
- public void deleteAfter(
- ) {
- this._has_after= false;
- }
-
- /**
- */
- public void deletePosition(
- ) {
- this._has_position= false;
- }
-
- /**
- * Method enumerateGlyph.
- *
- * @return an Enumeration over all
- * uk.ac.vamsas.objects.core.Glyph elements
- */
- public java.util.Enumeration enumerateGlyph(
- ) {
- return this._glyphList.elements();
- }
-
- /**
- * Method enumerateValue.
- *
- * @return an Enumeration over all float elements
- */
- public java.util.Enumeration enumerateValue(
- ) {
- return this._valueList.elements();
- }
-
- /**
- * Overrides the java.lang.Object.equals method.
- *
- * @param obj
- * @return true if the objects are equal.
- */
- public boolean equals(
- final java.lang.Object obj) {
- if ( this == obj )
- return true;
-
- if (super.equals(obj)==false)
+public class AnnotationElement extends uk.ac.vamsas.client.Vobject implements
+ java.io.Serializable {
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * position with respect to the coordinate frame defined by a rangeType
+ * specification
+ */
+ private long _position;
+
+ /**
+ * keeps track of state for field: _position
+ */
+ private boolean _has_position;
+
+ /**
+ * true means the annotation element appears between the specified position
+ * and the next
+ */
+ private boolean _after = false;
+
+ /**
+ * keeps track of state for field: _after
+ */
+ private boolean _has_after;
+
+ /**
+ * Primary Key for vamsas object referencing
+ */
+ private java.lang.String _id;
+
+ /**
+ * Free text at this position
+ */
+ private java.lang.String _description;
+
+ /**
+ * Discrete symbol - possibly graphically represented
+ *
+ */
+ private java.util.Vector _glyphList;
+
+ /**
+ * Ordered set of float values - an application may treat the values together
+ * as a vector with common support for a set of annotation elements - but this
+ * is, again, not validated so applications should deal gracefully with
+ * varying numbers of dimensions
+ *
+ */
+ private java.util.Vector _valueList;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public AnnotationElement() {
+ super();
+ this._glyphList = new java.util.Vector();
+ this._valueList = new java.util.Vector();
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ *
+ *
+ * @param vGlyph
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addGlyph(final uk.ac.vamsas.objects.core.Glyph vGlyph)
+ throws java.lang.IndexOutOfBoundsException {
+ this._glyphList.addElement(vGlyph);
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vGlyph
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addGlyph(final int index,
+ final uk.ac.vamsas.objects.core.Glyph vGlyph)
+ throws java.lang.IndexOutOfBoundsException {
+ this._glyphList.add(index, vGlyph);
+ }
+
+ /**
+ *
+ *
+ * @param vValue
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addValue(final float vValue)
+ throws java.lang.IndexOutOfBoundsException {
+ this._valueList.addElement(new java.lang.Float(vValue));
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vValue
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addValue(final int index, final float vValue)
+ throws java.lang.IndexOutOfBoundsException {
+ this._valueList.add(index, new java.lang.Float(vValue));
+ }
+
+ /**
+ */
+ public void deleteAfter() {
+ this._has_after = false;
+ }
+
+ /**
+ */
+ public void deletePosition() {
+ this._has_position = false;
+ }
+
+ /**
+ * Method enumerateGlyph.
+ *
+ * @return an Enumeration over all uk.ac.vamsas.objects.core.Glyph elements
+ */
+ public java.util.Enumeration enumerateGlyph() {
+ return this._glyphList.elements();
+ }
+
+ /**
+ * Method enumerateValue.
+ *
+ * @return an Enumeration over all float elements
+ */
+ public java.util.Enumeration enumerateValue() {
+ return this._valueList.elements();
+ }
+
+ /**
+ * Overrides the java.lang.Object.equals method.
+ *
+ * @param obj
+ * @return true if the objects are equal.
+ */
+ public boolean equals(final java.lang.Object obj) {
+ if (this == obj)
+ return true;
+
+ if (super.equals(obj) == false)
+ return false;
+
+ if (obj instanceof AnnotationElement) {
+
+ AnnotationElement temp = (AnnotationElement) obj;
+ boolean thcycle;
+ boolean tmcycle;
+ if (this._position != temp._position)
+ return false;
+ if (this._has_position != temp._has_position)
+ return false;
+ if (this._after != temp._after)
+ return false;
+ if (this._has_after != temp._has_after)
+ return false;
+ if (this._id != null) {
+ if (temp._id == null)
+ return false;
+ if (this._id != temp._id) {
+ thcycle = org.castor.util.CycleBreaker.startingToCycle(this._id);
+ tmcycle = org.castor.util.CycleBreaker.startingToCycle(temp._id);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
+ }
+ ;
return false;
-
- if (obj instanceof AnnotationElement) {
-
- AnnotationElement temp = (AnnotationElement)obj;
- boolean thcycle;
- boolean tmcycle;
- if (this._position != temp._position)
- return false;
- if (this._has_position != temp._has_position)
- return false;
- if (this._after != temp._after)
- return false;
- if (this._has_after != temp._has_after)
- return false;
- if (this._id != null) {
- if (temp._id == null) return false;
- if (this._id != temp._id) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._id);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._id);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._id); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._id); };
- return false;
- }
- if (!thcycle) {
- if (!this._id.equals(temp._id)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
- }
- }
- } else if (temp._id != null)
- return false;
- if (this._description != null) {
- if (temp._description == null) return false;
- if (this._description != temp._description) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._description);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._description);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._description); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._description); };
- return false;
- }
- if (!thcycle) {
- if (!this._description.equals(temp._description)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._description);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._description);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._description);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._description);
- }
- }
- } else if (temp._description != null)
- return false;
- if (this._glyphList != null) {
- if (temp._glyphList == null) return false;
- if (this._glyphList != temp._glyphList) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._glyphList);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._glyphList);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._glyphList); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._glyphList); };
- return false;
- }
- if (!thcycle) {
- if (!this._glyphList.equals(temp._glyphList)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._glyphList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._glyphList);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._glyphList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._glyphList);
- }
- }
- } else if (temp._glyphList != null)
- return false;
- if (this._valueList != null) {
- if (temp._valueList == null) return false;
- if (this._valueList != temp._valueList) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._valueList);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._valueList);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._valueList); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._valueList); };
- return false;
- }
- if (!thcycle) {
- if (!this._valueList.equals(temp._valueList)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._valueList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._valueList);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._valueList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._valueList);
- }
- }
- } else if (temp._valueList != null)
- return false;
- return true;
+ }
+ if (!thcycle) {
+ if (!this._id.equals(temp._id)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
+ }
}
+ } else if (temp._id != null)
return false;
- }
-
- /**
- * Returns the value of field 'after'. The field 'after' has
- * the following description: true means the annotation element
- * appears between the
- * specified position and the next
- *
- * @return the value of field 'After'.
- */
- public boolean getAfter(
- ) {
- return this._after;
- }
-
- /**
- * Returns the value of field 'description'. The field
- * 'description' has the following description: Free text at
- * this position
- *
- * @return the value of field 'Description'.
- */
- public java.lang.String getDescription(
- ) {
- return this._description;
- }
-
- /**
- * Method getGlyph.
- *
- * @param index
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- * @return the value of the uk.ac.vamsas.objects.core.Glyph at
- * the given index
- */
- public uk.ac.vamsas.objects.core.Glyph getGlyph(
- final int index)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._glyphList.size()) {
- throw new IndexOutOfBoundsException("getGlyph: Index value '" + index + "' not in range [0.." + (this._glyphList.size() - 1) + "]");
- }
-
- return (uk.ac.vamsas.objects.core.Glyph) _glyphList.get(index);
- }
-
- /**
- * Method getGlyph.Returns the contents of the collection in an
- * Array.
Note: Just in case the collection contents are
- * changing in another thread, we pass a 0-length Array of the
- * correct type into the API call. This way we know
- * that the Array returned is of exactly the correct length.
- *
- * @return this collection as an Array
- */
- public uk.ac.vamsas.objects.core.Glyph[] getGlyph(
- ) {
- uk.ac.vamsas.objects.core.Glyph[] array = new uk.ac.vamsas.objects.core.Glyph[0];
- return (uk.ac.vamsas.objects.core.Glyph[]) this._glyphList.toArray(array);
- }
-
- /**
- * Method getGlyphAsReference.Returns a reference to
- * '_glyphList'. No type checking is performed on any
- * modifications to the Vector.
- *
- * @return a reference to the Vector backing this class
- */
- public java.util.Vector getGlyphAsReference(
- ) {
- return this._glyphList;
- }
-
- /**
- * Method getGlyphCount.
- *
- * @return the size of this collection
- */
- public int getGlyphCount(
- ) {
- return this._glyphList.size();
- }
-
- /**
- * Returns the value of field 'id'. The field 'id' has the
- * following description: Primary Key for vamsas object
- * referencing
- *
- * @return the value of field 'Id'.
- */
- public java.lang.String getId(
- ) {
- return this._id;
- }
-
- /**
- * Returns the value of field 'position'. The field 'position'
- * has the following description: position with respect to the
- * coordinate frame defined by a
- * rangeType specification
- *
- * @return the value of field 'Position'.
- */
- public long getPosition(
- ) {
- return this._position;
- }
-
- /**
- * Method getValue.
- *
- * @param index
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- * @return the value of the float at the given index
- */
- public float getValue(
- final int index)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._valueList.size()) {
- throw new IndexOutOfBoundsException("getValue: Index value '" + index + "' not in range [0.." + (this._valueList.size() - 1) + "]");
- }
-
- return ((java.lang.Float) _valueList.get(index)).floatValue();
- }
-
- /**
- * Method getValue.Returns the contents of the collection in an
- * Array.
- *
- * @return this collection as an Array
- */
- public float[] getValue(
- ) {
- int size = this._valueList.size();
- float[] array = new float[size];
- java.util.Iterator iter = _valueList.iterator();
- for (int index = 0; index < size; index++) {
- array[index] = ((java.lang.Float) iter.next()).floatValue();
- }
- return array;
- }
-
- /**
- * Method getValueAsReference.Returns a reference to
- * '_valueList'. No type checking is performed on any
- * modifications to the Vector.
- *
- * @return a reference to the Vector backing this class
- */
- public java.util.Vector getValueAsReference(
- ) {
- return this._valueList;
- }
-
- /**
- * Method getValueCount.
- *
- * @return the size of this collection
- */
- public int getValueCount(
- ) {
- return this._valueList.size();
- }
-
- /**
- * Method hasAfter.
- *
- * @return true if at least one After has been added
- */
- public boolean hasAfter(
- ) {
- return this._has_after;
- }
-
- /**
- * Method hasPosition.
- *
- * @return true if at least one Position has been added
- */
- public boolean hasPosition(
- ) {
- return this._has_position;
- }
-
- /**
- * Overrides the java.lang.Object.hashCode method.
- *
- * The following steps came from Effective Java Programming
- * Language Guide by Joshua Bloch, Chapter 3
- *
- * @return a hash code value for the object.
- */
- public int hashCode(
- ) {
- int result = super.hashCode();
-
- long tmp;
- result = 37 * result + (int)(_position^(_position>>>32));
- result = 37 * result + (_after?0:1);
- if (_id != null
- && !org.castor.util.CycleBreaker.startingToCycle(_id)) {
- result = 37 * result + _id.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_id);
- }
- if (_description != null
- && !org.castor.util.CycleBreaker.startingToCycle(_description)) {
- result = 37 * result + _description.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_description);
- }
- if (_glyphList != null
- && !org.castor.util.CycleBreaker.startingToCycle(_glyphList)) {
- result = 37 * result + _glyphList.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_glyphList);
- }
- if (_valueList != null
- && !org.castor.util.CycleBreaker.startingToCycle(_valueList)) {
- result = 37 * result + _valueList.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_valueList);
- }
-
- return result;
- }
-
- /**
- * Returns the value of field 'after'. The field 'after' has
- * the following description: true means the annotation element
- * appears between the
- * specified position and the next
- *
- * @return the value of field 'After'.
- */
- public boolean isAfter(
- ) {
- return this._after;
- }
-
- /**
- * Method isValid.
- *
- * @return true if this object is valid according to the schema
- */
- public boolean isValid(
- ) {
- try {
- validate();
- } catch (org.exolab.castor.xml.ValidationException vex) {
+ if (this._description != null) {
+ if (temp._description == null)
+ return false;
+ if (this._description != temp._description) {
+ thcycle = org.castor.util.CycleBreaker
+ .startingToCycle(this._description);
+ tmcycle = org.castor.util.CycleBreaker
+ .startingToCycle(temp._description);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(this._description);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(temp._description);
+ }
+ ;
return false;
+ }
+ if (!thcycle) {
+ if (!this._description.equals(temp._description)) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(this._description);
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(temp._description);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._description);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._description);
+ }
}
- return true;
- }
-
- /**
- *
- *
- * @param out
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void marshal(
- final java.io.Writer out)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, out);
- }
-
- /**
- *
- *
- * @param handler
- * @throws java.io.IOException if an IOException occurs during
- * marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- */
- public void marshal(
- final org.xml.sax.ContentHandler handler)
- throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, handler);
- }
-
- /**
- */
- public void removeAllGlyph(
- ) {
- this._glyphList.clear();
- }
-
- /**
- */
- public void removeAllValue(
- ) {
- this._valueList.clear();
- }
-
- /**
- * Method removeGlyph.
- *
- * @param vGlyph
- * @return true if the object was removed from the collection.
- */
- public boolean removeGlyph(
- final uk.ac.vamsas.objects.core.Glyph vGlyph) {
- boolean removed = _glyphList.remove(vGlyph);
- return removed;
- }
-
- /**
- * Method removeGlyphAt.
- *
- * @param index
- * @return the element removed from the collection
- */
- public uk.ac.vamsas.objects.core.Glyph removeGlyphAt(
- final int index) {
- java.lang.Object obj = this._glyphList.remove(index);
- return (uk.ac.vamsas.objects.core.Glyph) obj;
- }
-
- /**
- * Method removeValue.
- *
- * @param vValue
- * @return true if the object was removed from the collection.
- */
- public boolean removeValue(
- final float vValue) {
- boolean removed = _valueList.remove(new java.lang.Float(vValue));
- return removed;
- }
-
- /**
- * Method removeValueAt.
- *
- * @param index
- * @return the element removed from the collection
- */
- public float removeValueAt(
- final int index) {
- java.lang.Object obj = this._valueList.remove(index);
- return ((java.lang.Float) obj).floatValue();
- }
-
- /**
- * Sets the value of field 'after'. The field 'after' has the
- * following description: true means the annotation element
- * appears between the
- * specified position and the next
- *
- * @param after the value of field 'after'.
- */
- public void setAfter(
- final boolean after) {
- this._after = after;
- this._has_after = true;
- }
-
- /**
- * Sets the value of field 'description'. The field
- * 'description' has the following description: Free text at
- * this position
- *
- * @param description the value of field 'description'.
- */
- public void setDescription(
- final java.lang.String description) {
- this._description = description;
- }
-
- /**
- *
- *
- * @param index
- * @param vGlyph
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void setGlyph(
- final int index,
- final uk.ac.vamsas.objects.core.Glyph vGlyph)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._glyphList.size()) {
- throw new IndexOutOfBoundsException("setGlyph: Index value '" + index + "' not in range [0.." + (this._glyphList.size() - 1) + "]");
- }
-
- this._glyphList.set(index, vGlyph);
- }
-
- /**
- *
- *
- * @param vGlyphArray
- */
- public void setGlyph(
- final uk.ac.vamsas.objects.core.Glyph[] vGlyphArray) {
- //-- copy array
- _glyphList.clear();
-
- for (int i = 0; i < vGlyphArray.length; i++) {
- this._glyphList.add(vGlyphArray[i]);
- }
- }
-
- /**
- * Sets the value of '_glyphList' by copying the given Vector.
- * All elements will be checked for type safety.
- *
- * @param vGlyphList the Vector to copy.
- */
- public void setGlyph(
- final java.util.Vector vGlyphList) {
- // copy vector
- this._glyphList.clear();
-
- this._glyphList.addAll(vGlyphList);
- }
-
- /**
- * Sets the value of '_glyphList' by setting it to the given
- * Vector. No type checking is performed.
- * @deprecated
- *
- * @param glyphVector the Vector to set.
- */
- public void setGlyphAsReference(
- final java.util.Vector glyphVector) {
- this._glyphList = glyphVector;
- }
-
- /**
- * Sets the value of field 'id'. The field 'id' has the
- * following description: Primary Key for vamsas object
- * referencing
- *
- * @param id the value of field 'id'.
- */
- public void setId(
- final java.lang.String id) {
- this._id = id;
- }
-
- /**
- * Sets the value of field 'position'. The field 'position' has
- * the following description: position with respect to the
- * coordinate frame defined by a
- * rangeType specification
- *
- * @param position the value of field 'position'.
- */
- public void setPosition(
- final long position) {
- this._position = position;
- this._has_position = true;
- }
-
- /**
- *
- *
- * @param index
- * @param vValue
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void setValue(
- final int index,
- final float vValue)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._valueList.size()) {
- throw new IndexOutOfBoundsException("setValue: Index value '" + index + "' not in range [0.." + (this._valueList.size() - 1) + "]");
+ } else if (temp._description != null)
+ return false;
+ if (this._glyphList != null) {
+ if (temp._glyphList == null)
+ return false;
+ if (this._glyphList != temp._glyphList) {
+ thcycle = org.castor.util.CycleBreaker
+ .startingToCycle(this._glyphList);
+ tmcycle = org.castor.util.CycleBreaker
+ .startingToCycle(temp._glyphList);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._glyphList);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._glyphList);
+ }
+ ;
+ return false;
+ }
+ if (!thcycle) {
+ if (!this._glyphList.equals(temp._glyphList)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._glyphList);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._glyphList);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._glyphList);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._glyphList);
+ }
}
-
- this._valueList.set(index, new java.lang.Float(vValue));
- }
-
- /**
- *
- *
- * @param vValueArray
- */
- public void setValue(
- final float[] vValueArray) {
- //-- copy array
- _valueList.clear();
-
- for (int i = 0; i < vValueArray.length; i++) {
- this._valueList.add(new java.lang.Float(vValueArray[i]));
+ } else if (temp._glyphList != null)
+ return false;
+ if (this._valueList != null) {
+ if (temp._valueList == null)
+ return false;
+ if (this._valueList != temp._valueList) {
+ thcycle = org.castor.util.CycleBreaker
+ .startingToCycle(this._valueList);
+ tmcycle = org.castor.util.CycleBreaker
+ .startingToCycle(temp._valueList);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._valueList);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._valueList);
+ }
+ ;
+ return false;
+ }
+ if (!thcycle) {
+ if (!this._valueList.equals(temp._valueList)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._valueList);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._valueList);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._valueList);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._valueList);
+ }
}
- }
-
- /**
- * Sets the value of '_valueList' by copying the given Vector.
- * All elements will be checked for type safety.
- *
- * @param vValueList the Vector to copy.
- */
- public void setValue(
- final java.util.Vector vValueList) {
- // copy vector
- this._valueList.clear();
-
- this._valueList.addAll(vValueList);
- }
-
- /**
- * Sets the value of '_valueList' by setting it to the given
- * Vector. No type checking is performed.
- * @deprecated
- *
- * @param valueVector the Vector to set.
- */
- public void setValueAsReference(
- final java.util.Vector valueVector) {
- this._valueList = valueVector;
- }
-
- /**
- * Method unmarshal.
- *
- * @param reader
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @return the unmarshaled
- * uk.ac.vamsas.objects.core.AnnotationElement
- */
- public static uk.ac.vamsas.objects.core.AnnotationElement unmarshal(
- final java.io.Reader reader)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- return (uk.ac.vamsas.objects.core.AnnotationElement) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.AnnotationElement.class, reader);
- }
-
- /**
- *
- *
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void validate(
- )
- throws org.exolab.castor.xml.ValidationException {
- org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
- validator.validate(this);
- }
+ } else if (temp._valueList != null)
+ return false;
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Returns the value of field 'after'. The field 'after' has the following
+ * description: true means the annotation element appears between the
+ * specified position and the next
+ *
+ * @return the value of field 'After'.
+ */
+ public boolean getAfter() {
+ return this._after;
+ }
+
+ /**
+ * Returns the value of field 'description'. The field 'description' has the
+ * following description: Free text at this position
+ *
+ * @return the value of field 'Description'.
+ */
+ public java.lang.String getDescription() {
+ return this._description;
+ }
+
+ /**
+ * Method getGlyph.
+ *
+ * @param index
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ * @return the value of the uk.ac.vamsas.objects.core.Glyph at the given index
+ */
+ public uk.ac.vamsas.objects.core.Glyph getGlyph(final int index)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._glyphList.size()) {
+ throw new IndexOutOfBoundsException("getGlyph: Index value '" + index
+ + "' not in range [0.." + (this._glyphList.size() - 1) + "]");
+ }
+
+ return (uk.ac.vamsas.objects.core.Glyph) _glyphList.get(index);
+ }
+
+ /**
+ * Method getGlyph.Returns the contents of the collection in an Array.
+ *
+ * Note: Just in case the collection contents are changing in another thread,
+ * we pass a 0-length Array of the correct type into the API call. This way we
+ * know that the Array returned is of exactly the correct length.
+ *
+ * @return this collection as an Array
+ */
+ public uk.ac.vamsas.objects.core.Glyph[] getGlyph() {
+ uk.ac.vamsas.objects.core.Glyph[] array = new uk.ac.vamsas.objects.core.Glyph[0];
+ return (uk.ac.vamsas.objects.core.Glyph[]) this._glyphList.toArray(array);
+ }
+
+ /**
+ * Method getGlyphAsReference.Returns a reference to '_glyphList'. No type
+ * checking is performed on any modifications to the Vector.
+ *
+ * @return a reference to the Vector backing this class
+ */
+ public java.util.Vector getGlyphAsReference() {
+ return this._glyphList;
+ }
+
+ /**
+ * Method getGlyphCount.
+ *
+ * @return the size of this collection
+ */
+ public int getGlyphCount() {
+ return this._glyphList.size();
+ }
+
+ /**
+ * Returns the value of field 'id'. The field 'id' has the following
+ * description: Primary Key for vamsas object referencing
+ *
+ * @return the value of field 'Id'.
+ */
+ public java.lang.String getId() {
+ return this._id;
+ }
+
+ /**
+ * Returns the value of field 'position'. The field 'position' has the
+ * following description: position with respect to the coordinate frame
+ * defined by a rangeType specification
+ *
+ * @return the value of field 'Position'.
+ */
+ public long getPosition() {
+ return this._position;
+ }
+
+ /**
+ * Method getValue.
+ *
+ * @param index
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ * @return the value of the float at the given index
+ */
+ public float getValue(final int index)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._valueList.size()) {
+ throw new IndexOutOfBoundsException("getValue: Index value '" + index
+ + "' not in range [0.." + (this._valueList.size() - 1) + "]");
+ }
+
+ return ((java.lang.Float) _valueList.get(index)).floatValue();
+ }
+
+ /**
+ * Method getValue.Returns the contents of the collection in an Array.
+ *
+ * @return this collection as an Array
+ */
+ public float[] getValue() {
+ int size = this._valueList.size();
+ float[] array = new float[size];
+ java.util.Iterator iter = _valueList.iterator();
+ for (int index = 0; index < size; index++) {
+ array[index] = ((java.lang.Float) iter.next()).floatValue();
+ }
+ return array;
+ }
+
+ /**
+ * Method getValueAsReference.Returns a reference to '_valueList'. No type
+ * checking is performed on any modifications to the Vector.
+ *
+ * @return a reference to the Vector backing this class
+ */
+ public java.util.Vector getValueAsReference() {
+ return this._valueList;
+ }
+
+ /**
+ * Method getValueCount.
+ *
+ * @return the size of this collection
+ */
+ public int getValueCount() {
+ return this._valueList.size();
+ }
+
+ /**
+ * Method hasAfter.
+ *
+ * @return true if at least one After has been added
+ */
+ public boolean hasAfter() {
+ return this._has_after;
+ }
+
+ /**
+ * Method hasPosition.
+ *
+ * @return true if at least one Position has been added
+ */
+ public boolean hasPosition() {
+ return this._has_position;
+ }
+
+ /**
+ * Overrides the java.lang.Object.hashCode method.
+ *
+ * The following steps came from Effective Java Programming Language
+ * Guide by Joshua Bloch, Chapter 3
+ *
+ * @return a hash code value for the object.
+ */
+ public int hashCode() {
+ int result = super.hashCode();
+
+ long tmp;
+ result = 37 * result + (int) (_position ^ (_position >>> 32));
+ result = 37 * result + (_after ? 0 : 1);
+ if (_id != null && !org.castor.util.CycleBreaker.startingToCycle(_id)) {
+ result = 37 * result + _id.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_id);
+ }
+ if (_description != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_description)) {
+ result = 37 * result + _description.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_description);
+ }
+ if (_glyphList != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_glyphList)) {
+ result = 37 * result + _glyphList.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_glyphList);
+ }
+ if (_valueList != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_valueList)) {
+ result = 37 * result + _valueList.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_valueList);
+ }
+
+ return result;
+ }
+
+ /**
+ * Returns the value of field 'after'. The field 'after' has the following
+ * description: true means the annotation element appears between the
+ * specified position and the next
+ *
+ * @return the value of field 'After'.
+ */
+ public boolean isAfter() {
+ return this._after;
+ }
+
+ /**
+ * Method isValid.
+ *
+ * @return true if this object is valid according to the schema
+ */
+ public boolean isValid() {
+ try {
+ validate();
+ } catch (org.exolab.castor.xml.ValidationException vex) {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ *
+ *
+ * @param out
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void marshal(final java.io.Writer out)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, out);
+ }
+
+ /**
+ *
+ *
+ * @param handler
+ * @throws java.io.IOException
+ * if an IOException occurs during marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ */
+ public void marshal(final org.xml.sax.ContentHandler handler)
+ throws java.io.IOException, org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, handler);
+ }
+
+ /**
+ */
+ public void removeAllGlyph() {
+ this._glyphList.clear();
+ }
+
+ /**
+ */
+ public void removeAllValue() {
+ this._valueList.clear();
+ }
+
+ /**
+ * Method removeGlyph.
+ *
+ * @param vGlyph
+ * @return true if the object was removed from the collection.
+ */
+ public boolean removeGlyph(final uk.ac.vamsas.objects.core.Glyph vGlyph) {
+ boolean removed = _glyphList.remove(vGlyph);
+ return removed;
+ }
+
+ /**
+ * Method removeGlyphAt.
+ *
+ * @param index
+ * @return the element removed from the collection
+ */
+ public uk.ac.vamsas.objects.core.Glyph removeGlyphAt(final int index) {
+ java.lang.Object obj = this._glyphList.remove(index);
+ return (uk.ac.vamsas.objects.core.Glyph) obj;
+ }
+
+ /**
+ * Method removeValue.
+ *
+ * @param vValue
+ * @return true if the object was removed from the collection.
+ */
+ public boolean removeValue(final float vValue) {
+ boolean removed = _valueList.remove(new java.lang.Float(vValue));
+ return removed;
+ }
+
+ /**
+ * Method removeValueAt.
+ *
+ * @param index
+ * @return the element removed from the collection
+ */
+ public float removeValueAt(final int index) {
+ java.lang.Object obj = this._valueList.remove(index);
+ return ((java.lang.Float) obj).floatValue();
+ }
+
+ /**
+ * Sets the value of field 'after'. The field 'after' has the following
+ * description: true means the annotation element appears between the
+ * specified position and the next
+ *
+ * @param after
+ * the value of field 'after'.
+ */
+ public void setAfter(final boolean after) {
+ this._after = after;
+ this._has_after = true;
+ }
+
+ /**
+ * Sets the value of field 'description'. The field 'description' has the
+ * following description: Free text at this position
+ *
+ * @param description
+ * the value of field 'description'.
+ */
+ public void setDescription(final java.lang.String description) {
+ this._description = description;
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vGlyph
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void setGlyph(final int index,
+ final uk.ac.vamsas.objects.core.Glyph vGlyph)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._glyphList.size()) {
+ throw new IndexOutOfBoundsException("setGlyph: Index value '" + index
+ + "' not in range [0.." + (this._glyphList.size() - 1) + "]");
+ }
+
+ this._glyphList.set(index, vGlyph);
+ }
+
+ /**
+ *
+ *
+ * @param vGlyphArray
+ */
+ public void setGlyph(final uk.ac.vamsas.objects.core.Glyph[] vGlyphArray) {
+ // -- copy array
+ _glyphList.clear();
+
+ for (int i = 0; i < vGlyphArray.length; i++) {
+ this._glyphList.add(vGlyphArray[i]);
+ }
+ }
+
+ /**
+ * Sets the value of '_glyphList' by copying the given Vector. All elements
+ * will be checked for type safety.
+ *
+ * @param vGlyphList
+ * the Vector to copy.
+ */
+ public void setGlyph(final java.util.Vector vGlyphList) {
+ // copy vector
+ this._glyphList.clear();
+
+ this._glyphList.addAll(vGlyphList);
+ }
+
+ /**
+ * Sets the value of '_glyphList' by setting it to the given Vector. No type
+ * checking is performed.
+ *
+ * @deprecated
+ *
+ * @param glyphVector
+ * the Vector to set.
+ */
+ public void setGlyphAsReference(final java.util.Vector glyphVector) {
+ this._glyphList = glyphVector;
+ }
+
+ /**
+ * Sets the value of field 'id'. The field 'id' has the following description:
+ * Primary Key for vamsas object referencing
+ *
+ * @param id
+ * the value of field 'id'.
+ */
+ public void setId(final java.lang.String id) {
+ this._id = id;
+ }
+
+ /**
+ * Sets the value of field 'position'. The field 'position' has the following
+ * description: position with respect to the coordinate frame defined by a
+ * rangeType specification
+ *
+ * @param position
+ * the value of field 'position'.
+ */
+ public void setPosition(final long position) {
+ this._position = position;
+ this._has_position = true;
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vValue
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void setValue(final int index, final float vValue)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._valueList.size()) {
+ throw new IndexOutOfBoundsException("setValue: Index value '" + index
+ + "' not in range [0.." + (this._valueList.size() - 1) + "]");
+ }
+
+ this._valueList.set(index, new java.lang.Float(vValue));
+ }
+
+ /**
+ *
+ *
+ * @param vValueArray
+ */
+ public void setValue(final float[] vValueArray) {
+ // -- copy array
+ _valueList.clear();
+
+ for (int i = 0; i < vValueArray.length; i++) {
+ this._valueList.add(new java.lang.Float(vValueArray[i]));
+ }
+ }
+
+ /**
+ * Sets the value of '_valueList' by copying the given Vector. All elements
+ * will be checked for type safety.
+ *
+ * @param vValueList
+ * the Vector to copy.
+ */
+ public void setValue(final java.util.Vector vValueList) {
+ // copy vector
+ this._valueList.clear();
+
+ this._valueList.addAll(vValueList);
+ }
+
+ /**
+ * Sets the value of '_valueList' by setting it to the given Vector. No type
+ * checking is performed.
+ *
+ * @deprecated
+ *
+ * @param valueVector
+ * the Vector to set.
+ */
+ public void setValueAsReference(final java.util.Vector valueVector) {
+ this._valueList = valueVector;
+ }
+
+ /**
+ * Method unmarshal.
+ *
+ * @param reader
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @return the unmarshaled uk.ac.vamsas.objects.core.AnnotationElement
+ */
+ public static uk.ac.vamsas.objects.core.AnnotationElement unmarshal(
+ final java.io.Reader reader)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ return (uk.ac.vamsas.objects.core.AnnotationElement) Unmarshaller
+ .unmarshal(uk.ac.vamsas.objects.core.AnnotationElement.class, reader);
+ }
+
+ /**
+ *
+ *
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void validate() throws org.exolab.castor.xml.ValidationException {
+ org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+ validator.validate(this);
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/AppData.java b/src/uk/ac/vamsas/objects/core/AppData.java
index d54bca7..221aadd 100644
--- a/src/uk/ac/vamsas/objects/core/AppData.java
+++ b/src/uk/ac/vamsas/objects/core/AppData.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import org.exolab.castor.xml.Marshaller;
@@ -19,294 +33,320 @@ import org.exolab.castor.xml.Unmarshaller;
*
* @version $Revision$ $Date$
*/
-public class AppData extends uk.ac.vamsas.client.Vobject
-implements java.io.Serializable
-{
+public class AppData extends uk.ac.vamsas.client.Vobject implements
+ java.io.Serializable {
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
+ /**
+ * Internal choice value storage
+ */
+ private java.lang.Object _choiceValue;
- /**
- * Internal choice value storage
- */
- private java.lang.Object _choiceValue;
+ /**
+ * Field _data.
+ */
+ private byte[] _data;
- /**
- * Field _data.
- */
- private byte[] _data;
+ /**
+ * Field _dataReference.
+ */
+ private java.lang.String _dataReference;
- /**
- * Field _dataReference.
- */
- private java.lang.String _dataReference;
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+ public AppData() {
+ super();
+ }
- //----------------/
- //- Constructors -/
- //----------------/
+ // -----------/
+ // - Methods -/
+ // -----------/
- public AppData() {
- super();
- }
+ /**
+ * Overrides the java.lang.Object.equals method.
+ *
+ * @param obj
+ * @return true if the objects are equal.
+ */
+ public boolean equals(final java.lang.Object obj) {
+ if (this == obj)
+ return true;
+ if (super.equals(obj) == false)
+ return false;
- //-----------/
- //- Methods -/
- //-----------/
+ if (obj instanceof AppData) {
- /**
- * Overrides the java.lang.Object.equals method.
- *
- * @param obj
- * @return true if the objects are equal.
- */
- public boolean equals(
- final java.lang.Object obj) {
- if ( this == obj )
- return true;
-
- if (super.equals(obj)==false)
+ AppData temp = (AppData) obj;
+ boolean thcycle;
+ boolean tmcycle;
+ if (this._choiceValue != null) {
+ if (temp._choiceValue == null)
+ return false;
+ if (this._choiceValue != temp._choiceValue) {
+ thcycle = org.castor.util.CycleBreaker
+ .startingToCycle(this._choiceValue);
+ tmcycle = org.castor.util.CycleBreaker
+ .startingToCycle(temp._choiceValue);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(this._choiceValue);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(temp._choiceValue);
+ }
+ ;
return false;
-
- if (obj instanceof AppData) {
-
- AppData temp = (AppData)obj;
- boolean thcycle;
- boolean tmcycle;
- if (this._choiceValue != null) {
- if (temp._choiceValue == null) return false;
- if (this._choiceValue != temp._choiceValue) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._choiceValue);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._choiceValue);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._choiceValue); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._choiceValue); };
- return false;
- }
- if (!thcycle) {
- if (!this._choiceValue.equals(temp._choiceValue)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._choiceValue);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._choiceValue);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._choiceValue);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._choiceValue);
- }
- }
- } else if (temp._choiceValue != null)
- return false;
- if (this._data != null) {
- if (temp._data == null) return false;
- if (this._data != temp._data) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._data);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._data);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._data); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._data); };
- return false;
- }
- if (!thcycle) {
- if (!java.util.Arrays.equals(this._data, temp._data)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._data);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._data);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._data);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._data);
- }
- }
- } else if (temp._data != null)
- return false;
- if (this._dataReference != null) {
- if (temp._dataReference == null) return false;
- if (this._dataReference != temp._dataReference) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._dataReference);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._dataReference);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._dataReference); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._dataReference); };
- return false;
- }
- if (!thcycle) {
- if (!this._dataReference.equals(temp._dataReference)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._dataReference);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._dataReference);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._dataReference);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._dataReference);
- }
- }
- } else if (temp._dataReference != null)
- return false;
- return true;
+ }
+ if (!thcycle) {
+ if (!this._choiceValue.equals(temp._choiceValue)) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(this._choiceValue);
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(temp._choiceValue);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._choiceValue);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._choiceValue);
+ }
}
+ } else if (temp._choiceValue != null)
return false;
+ if (this._data != null) {
+ if (temp._data == null)
+ return false;
+ if (this._data != temp._data) {
+ thcycle = org.castor.util.CycleBreaker.startingToCycle(this._data);
+ tmcycle = org.castor.util.CycleBreaker.startingToCycle(temp._data);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._data);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._data);
+ }
+ ;
+ return false;
+ }
+ if (!thcycle) {
+ if (!java.util.Arrays.equals(this._data, temp._data)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._data);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._data);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._data);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._data);
+ }
+ }
+ } else if (temp._data != null)
+ return false;
+ if (this._dataReference != null) {
+ if (temp._dataReference == null)
+ return false;
+ if (this._dataReference != temp._dataReference) {
+ thcycle = org.castor.util.CycleBreaker
+ .startingToCycle(this._dataReference);
+ tmcycle = org.castor.util.CycleBreaker
+ .startingToCycle(temp._dataReference);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(this._dataReference);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(temp._dataReference);
+ }
+ ;
+ return false;
+ }
+ if (!thcycle) {
+ if (!this._dataReference.equals(temp._dataReference)) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(this._dataReference);
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(temp._dataReference);
+ return false;
+ }
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(this._dataReference);
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(temp._dataReference);
+ }
+ }
+ } else if (temp._dataReference != null)
+ return false;
+ return true;
}
+ return false;
+ }
- /**
- * Returns the value of field 'choiceValue'. The field
- * 'choiceValue' has the following description: Internal choice
- * value storage
- *
- * @return the value of field 'ChoiceValue'.
- */
- public java.lang.Object getChoiceValue(
- ) {
- return this._choiceValue;
- }
+ /**
+ * Returns the value of field 'choiceValue'. The field 'choiceValue' has the
+ * following description: Internal choice value storage
+ *
+ * @return the value of field 'ChoiceValue'.
+ */
+ public java.lang.Object getChoiceValue() {
+ return this._choiceValue;
+ }
- /**
- * Returns the value of field 'data'.
- *
- * @return the value of field 'Data'.
- */
- public byte[] getData(
- ) {
- return this._data;
- }
+ /**
+ * Returns the value of field 'data'.
+ *
+ * @return the value of field 'Data'.
+ */
+ public byte[] getData() {
+ return this._data;
+ }
- /**
- * Returns the value of field 'dataReference'.
- *
- * @return the value of field 'DataReference'.
- */
- public java.lang.String getDataReference(
- ) {
- return this._dataReference;
- }
+ /**
+ * Returns the value of field 'dataReference'.
+ *
+ * @return the value of field 'DataReference'.
+ */
+ public java.lang.String getDataReference() {
+ return this._dataReference;
+ }
- /**
- * Overrides the java.lang.Object.hashCode method.
- *
- * The following steps came from Effective Java Programming
- * Language Guide by Joshua Bloch, Chapter 3
- *
- * @return a hash code value for the object.
- */
- public int hashCode(
- ) {
- int result = super.hashCode();
-
- long tmp;
- if (_choiceValue != null
- && !org.castor.util.CycleBreaker.startingToCycle(_choiceValue)) {
- result = 37 * result + _choiceValue.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_choiceValue);
- }
- if (_data != null
- && !org.castor.util.CycleBreaker.startingToCycle(_data)) {
- result = 37 * result + _data.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_data);
- }
- if (_dataReference != null
- && !org.castor.util.CycleBreaker.startingToCycle(_dataReference)) {
- result = 37 * result + _dataReference.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_dataReference);
- }
-
- return result;
- }
+ /**
+ * Overrides the java.lang.Object.hashCode method.
+ *
+ * The following steps came from Effective Java Programming Language
+ * Guide by Joshua Bloch, Chapter 3
+ *
+ * @return a hash code value for the object.
+ */
+ public int hashCode() {
+ int result = super.hashCode();
- /**
- * Method isValid.
- *
- * @return true if this object is valid according to the schema
- */
- public boolean isValid(
- ) {
- try {
- validate();
- } catch (org.exolab.castor.xml.ValidationException vex) {
- return false;
- }
- return true;
+ long tmp;
+ if (_choiceValue != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_choiceValue)) {
+ result = 37 * result + _choiceValue.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_choiceValue);
}
-
- /**
- *
- *
- * @param out
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void marshal(
- final java.io.Writer out)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, out);
+ if (_data != null && !org.castor.util.CycleBreaker.startingToCycle(_data)) {
+ result = 37 * result + _data.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_data);
}
-
- /**
- *
- *
- * @param handler
- * @throws java.io.IOException if an IOException occurs during
- * marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- */
- public void marshal(
- final org.xml.sax.ContentHandler handler)
- throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, handler);
+ if (_dataReference != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_dataReference)) {
+ result = 37 * result + _dataReference.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_dataReference);
}
- /**
- * Sets the value of field 'data'.
- *
- * @param data the value of field 'data'.
- */
- public void setData(
- final byte[] data) {
- this._data = data;
- this._choiceValue = data;
- }
+ return result;
+ }
- /**
- * Sets the value of field 'dataReference'.
- *
- * @param dataReference the value of field 'dataReference'.
- */
- public void setDataReference(
- final java.lang.String dataReference) {
- this._dataReference = dataReference;
- this._choiceValue = dataReference;
+ /**
+ * Method isValid.
+ *
+ * @return true if this object is valid according to the schema
+ */
+ public boolean isValid() {
+ try {
+ validate();
+ } catch (org.exolab.castor.xml.ValidationException vex) {
+ return false;
}
+ return true;
+ }
- /**
- * Method unmarshal.
- *
- * @param reader
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @return the unmarshaled uk.ac.vamsas.objects.core.AppData
- */
- public static uk.ac.vamsas.objects.core.AppData unmarshal(
- final java.io.Reader reader)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- return (uk.ac.vamsas.objects.core.AppData) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.AppData.class, reader);
- }
+ /**
+ *
+ *
+ * @param out
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void marshal(final java.io.Writer out)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, out);
+ }
- /**
- *
- *
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void validate(
- )
- throws org.exolab.castor.xml.ValidationException {
- org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
- validator.validate(this);
- }
+ /**
+ *
+ *
+ * @param handler
+ * @throws java.io.IOException
+ * if an IOException occurs during marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ */
+ public void marshal(final org.xml.sax.ContentHandler handler)
+ throws java.io.IOException, org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, handler);
+ }
+
+ /**
+ * Sets the value of field 'data'.
+ *
+ * @param data
+ * the value of field 'data'.
+ */
+ public void setData(final byte[] data) {
+ this._data = data;
+ this._choiceValue = data;
+ }
+
+ /**
+ * Sets the value of field 'dataReference'.
+ *
+ * @param dataReference
+ * the value of field 'dataReference'.
+ */
+ public void setDataReference(final java.lang.String dataReference) {
+ this._dataReference = dataReference;
+ this._choiceValue = dataReference;
+ }
+
+ /**
+ * Method unmarshal.
+ *
+ * @param reader
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @return the unmarshaled uk.ac.vamsas.objects.core.AppData
+ */
+ public static uk.ac.vamsas.objects.core.AppData unmarshal(
+ final java.io.Reader reader)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ return (uk.ac.vamsas.objects.core.AppData) Unmarshaller.unmarshal(
+ uk.ac.vamsas.objects.core.AppData.class, reader);
+ }
+
+ /**
+ *
+ *
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void validate() throws org.exolab.castor.xml.ValidationException {
+ org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+ validator.validate(this);
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/ApplicationData.java b/src/uk/ac/vamsas/objects/core/ApplicationData.java
index ea61bca..b980483 100644
--- a/src/uk/ac/vamsas/objects/core/ApplicationData.java
+++ b/src/uk/ac/vamsas/objects/core/ApplicationData.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import org.exolab.castor.xml.Marshaller;
@@ -17,753 +31,767 @@ import org.exolab.castor.xml.Unmarshaller;
/**
* Class ApplicationData.
*
- * @version $Revision$ $Date$
+ * @version $Revision$ $Date: 2007-06-28 14:51:44 +0100 (Thu, 28 Jun 2007)
+ * $
*/
-public class ApplicationData extends uk.ac.vamsas.objects.core.AppData
-implements java.io.Serializable
-{
-
-
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
- * Version string describing the application specific
- * data storage version used
- */
- private java.lang.String _version;
-
- /**
- * Canonical name of application
- */
- private java.lang.String _name;
-
- /**
- * Field _userList.
- */
- private java.util.Vector _userList;
-
- /**
- * Field _common.
- */
- private uk.ac.vamsas.objects.core.Common _common;
-
- /**
- * Field _instanceList.
- */
- private java.util.Vector _instanceList;
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public ApplicationData() {
- super();
- this._userList = new java.util.Vector();
- this._instanceList = new java.util.Vector();
- }
-
-
- //-----------/
- //- Methods -/
- //-----------/
-
- /**
- *
- *
- * @param vInstance
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addInstance(
- final uk.ac.vamsas.objects.core.Instance vInstance)
- throws java.lang.IndexOutOfBoundsException {
- this._instanceList.addElement(vInstance);
- }
-
- /**
- *
- *
- * @param index
- * @param vInstance
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addInstance(
- final int index,
- final uk.ac.vamsas.objects.core.Instance vInstance)
- throws java.lang.IndexOutOfBoundsException {
- this._instanceList.add(index, vInstance);
- }
-
- /**
- *
- *
- * @param vUser
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addUser(
- final uk.ac.vamsas.objects.core.User vUser)
- throws java.lang.IndexOutOfBoundsException {
- this._userList.addElement(vUser);
- }
-
- /**
- *
- *
- * @param index
- * @param vUser
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addUser(
- final int index,
- final uk.ac.vamsas.objects.core.User vUser)
- throws java.lang.IndexOutOfBoundsException {
- this._userList.add(index, vUser);
- }
-
- /**
- * Method enumerateInstance.
- *
- * @return an Enumeration over all
- * uk.ac.vamsas.objects.core.Instance elements
- */
- public java.util.Enumeration enumerateInstance(
- ) {
- return this._instanceList.elements();
- }
-
- /**
- * Method enumerateUser.
- *
- * @return an Enumeration over all
- * uk.ac.vamsas.objects.core.User elements
- */
- public java.util.Enumeration enumerateUser(
- ) {
- return this._userList.elements();
- }
-
- /**
- * Overrides the java.lang.Object.equals method.
- *
- * @param obj
- * @return true if the objects are equal.
- */
- public boolean equals(
- final java.lang.Object obj) {
- if ( this == obj )
- return true;
-
- if (super.equals(obj)==false)
+public class ApplicationData extends uk.ac.vamsas.objects.core.AppData
+ implements java.io.Serializable {
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * Version string describing the application specific data storage version
+ * used
+ */
+ private java.lang.String _version;
+
+ /**
+ * Canonical name of application
+ */
+ private java.lang.String _name;
+
+ /**
+ * Field _userList.
+ */
+ private java.util.Vector _userList;
+
+ /**
+ * Field _common.
+ */
+ private uk.ac.vamsas.objects.core.Common _common;
+
+ /**
+ * Field _instanceList.
+ */
+ private java.util.Vector _instanceList;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public ApplicationData() {
+ super();
+ this._userList = new java.util.Vector();
+ this._instanceList = new java.util.Vector();
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ *
+ *
+ * @param vInstance
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addInstance(final uk.ac.vamsas.objects.core.Instance vInstance)
+ throws java.lang.IndexOutOfBoundsException {
+ this._instanceList.addElement(vInstance);
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vInstance
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addInstance(final int index,
+ final uk.ac.vamsas.objects.core.Instance vInstance)
+ throws java.lang.IndexOutOfBoundsException {
+ this._instanceList.add(index, vInstance);
+ }
+
+ /**
+ *
+ *
+ * @param vUser
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addUser(final uk.ac.vamsas.objects.core.User vUser)
+ throws java.lang.IndexOutOfBoundsException {
+ this._userList.addElement(vUser);
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vUser
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addUser(final int index,
+ final uk.ac.vamsas.objects.core.User vUser)
+ throws java.lang.IndexOutOfBoundsException {
+ this._userList.add(index, vUser);
+ }
+
+ /**
+ * Method enumerateInstance.
+ *
+ * @return an Enumeration over all uk.ac.vamsas.objects.core.Instance elements
+ */
+ public java.util.Enumeration enumerateInstance() {
+ return this._instanceList.elements();
+ }
+
+ /**
+ * Method enumerateUser.
+ *
+ * @return an Enumeration over all uk.ac.vamsas.objects.core.User elements
+ */
+ public java.util.Enumeration enumerateUser() {
+ return this._userList.elements();
+ }
+
+ /**
+ * Overrides the java.lang.Object.equals method.
+ *
+ * @param obj
+ * @return true if the objects are equal.
+ */
+ public boolean equals(final java.lang.Object obj) {
+ if (this == obj)
+ return true;
+
+ if (super.equals(obj) == false)
+ return false;
+
+ if (obj instanceof ApplicationData) {
+
+ ApplicationData temp = (ApplicationData) obj;
+ boolean thcycle;
+ boolean tmcycle;
+ if (this._version != null) {
+ if (temp._version == null)
+ return false;
+ if (this._version != temp._version) {
+ thcycle = org.castor.util.CycleBreaker.startingToCycle(this._version);
+ tmcycle = org.castor.util.CycleBreaker.startingToCycle(temp._version);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._version);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._version);
+ }
+ ;
return false;
-
- if (obj instanceof ApplicationData) {
-
- ApplicationData temp = (ApplicationData)obj;
- boolean thcycle;
- boolean tmcycle;
- if (this._version != null) {
- if (temp._version == null) return false;
- if (this._version != temp._version) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._version);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._version);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._version); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._version); };
- return false;
- }
- if (!thcycle) {
- if (!this._version.equals(temp._version)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._version);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._version);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._version);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._version);
- }
- }
- } else if (temp._version != null)
- return false;
- if (this._name != null) {
- if (temp._name == null) return false;
- if (this._name != temp._name) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._name);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._name);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._name); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._name); };
- return false;
- }
- if (!thcycle) {
- if (!this._name.equals(temp._name)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._name);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._name);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._name);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._name);
- }
- }
- } else if (temp._name != null)
- return false;
- if (this._userList != null) {
- if (temp._userList == null) return false;
- if (this._userList != temp._userList) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._userList);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._userList);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._userList); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._userList); };
- return false;
- }
- if (!thcycle) {
- if (!this._userList.equals(temp._userList)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._userList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._userList);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._userList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._userList);
- }
- }
- } else if (temp._userList != null)
- return false;
- if (this._common != null) {
- if (temp._common == null) return false;
- if (this._common != temp._common) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._common);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._common);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._common); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._common); };
- return false;
- }
- if (!thcycle) {
- if (!this._common.equals(temp._common)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._common);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._common);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._common);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._common);
- }
- }
- } else if (temp._common != null)
- return false;
- if (this._instanceList != null) {
- if (temp._instanceList == null) return false;
- if (this._instanceList != temp._instanceList) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._instanceList);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._instanceList);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._instanceList); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._instanceList); };
- return false;
- }
- if (!thcycle) {
- if (!this._instanceList.equals(temp._instanceList)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._instanceList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._instanceList);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._instanceList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._instanceList);
- }
- }
- } else if (temp._instanceList != null)
- return false;
- return true;
+ }
+ if (!thcycle) {
+ if (!this._version.equals(temp._version)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._version);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._version);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._version);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._version);
+ }
}
+ } else if (temp._version != null)
return false;
- }
-
- /**
- * Returns the value of field 'common'.
- *
- * @return the value of field 'Common'.
- */
- public uk.ac.vamsas.objects.core.Common getCommon(
- ) {
- return this._common;
- }
-
- /**
- * Method getInstance.
- *
- * @param index
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- * @return the value of the uk.ac.vamsas.objects.core.Instance
- * at the given index
- */
- public uk.ac.vamsas.objects.core.Instance getInstance(
- final int index)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._instanceList.size()) {
- throw new IndexOutOfBoundsException("getInstance: Index value '" + index + "' not in range [0.." + (this._instanceList.size() - 1) + "]");
- }
-
- return (uk.ac.vamsas.objects.core.Instance) _instanceList.get(index);
- }
-
- /**
- * Method getInstance.Returns the contents of the collection in
- * an Array.
Note: Just in case the collection contents
- * are changing in another thread, we pass a 0-length Array of
- * the correct type into the API call. This way we know
- * that the Array returned is of exactly the correct length.
- *
- * @return this collection as an Array
- */
- public uk.ac.vamsas.objects.core.Instance[] getInstance(
- ) {
- uk.ac.vamsas.objects.core.Instance[] array = new uk.ac.vamsas.objects.core.Instance[0];
- return (uk.ac.vamsas.objects.core.Instance[]) this._instanceList.toArray(array);
- }
-
- /**
- * Method getInstanceAsReference.Returns a reference to
- * '_instanceList'. No type checking is performed on any
- * modifications to the Vector.
- *
- * @return a reference to the Vector backing this class
- */
- public java.util.Vector getInstanceAsReference(
- ) {
- return this._instanceList;
- }
-
- /**
- * Method getInstanceCount.
- *
- * @return the size of this collection
- */
- public int getInstanceCount(
- ) {
- return this._instanceList.size();
- }
-
- /**
- * Returns the value of field 'name'. The field 'name' has the
- * following description: Canonical name of application
- *
- * @return the value of field 'Name'.
- */
- public java.lang.String getName(
- ) {
- return this._name;
- }
-
- /**
- * Method getUser.
- *
- * @param index
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- * @return the value of the uk.ac.vamsas.objects.core.User at
- * the given index
- */
- public uk.ac.vamsas.objects.core.User getUser(
- final int index)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._userList.size()) {
- throw new IndexOutOfBoundsException("getUser: Index value '" + index + "' not in range [0.." + (this._userList.size() - 1) + "]");
- }
-
- return (uk.ac.vamsas.objects.core.User) _userList.get(index);
- }
-
- /**
- * Method getUser.Returns the contents of the collection in an
- * Array.
Note: Just in case the collection contents are
- * changing in another thread, we pass a 0-length Array of the
- * correct type into the API call. This way we know
- * that the Array returned is of exactly the correct length.
- *
- * @return this collection as an Array
- */
- public uk.ac.vamsas.objects.core.User[] getUser(
- ) {
- uk.ac.vamsas.objects.core.User[] array = new uk.ac.vamsas.objects.core.User[0];
- return (uk.ac.vamsas.objects.core.User[]) this._userList.toArray(array);
- }
-
- /**
- * Method getUserAsReference.Returns a reference to
- * '_userList'. No type checking is performed on any
- * modifications to the Vector.
- *
- * @return a reference to the Vector backing this class
- */
- public java.util.Vector getUserAsReference(
- ) {
- return this._userList;
- }
-
- /**
- * Method getUserCount.
- *
- * @return the size of this collection
- */
- public int getUserCount(
- ) {
- return this._userList.size();
- }
-
- /**
- * Returns the value of field 'version'. The field 'version'
- * has the following description: Version string describing the
- * application specific
- * data storage version used
- *
- * @return the value of field 'Version'.
- */
- public java.lang.String getVersion(
- ) {
- return this._version;
- }
-
- /**
- * Overrides the java.lang.Object.hashCode method.
- *
- * The following steps came from Effective Java Programming
- * Language Guide by Joshua Bloch, Chapter 3
- *
- * @return a hash code value for the object.
- */
- public int hashCode(
- ) {
- int result = super.hashCode();
-
- long tmp;
- if (_version != null
- && !org.castor.util.CycleBreaker.startingToCycle(_version)) {
- result = 37 * result + _version.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_version);
- }
- if (_name != null
- && !org.castor.util.CycleBreaker.startingToCycle(_name)) {
- result = 37 * result + _name.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_name);
- }
- if (_userList != null
- && !org.castor.util.CycleBreaker.startingToCycle(_userList)) {
- result = 37 * result + _userList.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_userList);
- }
- if (_common != null
- && !org.castor.util.CycleBreaker.startingToCycle(_common)) {
- result = 37 * result + _common.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_common);
- }
- if (_instanceList != null
- && !org.castor.util.CycleBreaker.startingToCycle(_instanceList)) {
- result = 37 * result + _instanceList.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_instanceList);
- }
-
- return result;
- }
-
- /**
- * Method isValid.
- *
- * @return true if this object is valid according to the schema
- */
- public boolean isValid(
- ) {
- try {
- validate();
- } catch (org.exolab.castor.xml.ValidationException vex) {
+ if (this._name != null) {
+ if (temp._name == null)
+ return false;
+ if (this._name != temp._name) {
+ thcycle = org.castor.util.CycleBreaker.startingToCycle(this._name);
+ tmcycle = org.castor.util.CycleBreaker.startingToCycle(temp._name);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._name);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._name);
+ }
+ ;
return false;
+ }
+ if (!thcycle) {
+ if (!this._name.equals(temp._name)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._name);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._name);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._name);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._name);
+ }
}
- return true;
- }
-
- /**
- *
- *
- * @param out
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void marshal(
- final java.io.Writer out)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, out);
- }
-
- /**
- *
- *
- * @param handler
- * @throws java.io.IOException if an IOException occurs during
- * marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- */
- public void marshal(
- final org.xml.sax.ContentHandler handler)
- throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, handler);
- }
-
- /**
- */
- public void removeAllInstance(
- ) {
- this._instanceList.clear();
- }
-
- /**
- */
- public void removeAllUser(
- ) {
- this._userList.clear();
- }
-
- /**
- * Method removeInstance.
- *
- * @param vInstance
- * @return true if the object was removed from the collection.
- */
- public boolean removeInstance(
- final uk.ac.vamsas.objects.core.Instance vInstance) {
- boolean removed = _instanceList.remove(vInstance);
- return removed;
- }
-
- /**
- * Method removeInstanceAt.
- *
- * @param index
- * @return the element removed from the collection
- */
- public uk.ac.vamsas.objects.core.Instance removeInstanceAt(
- final int index) {
- java.lang.Object obj = this._instanceList.remove(index);
- return (uk.ac.vamsas.objects.core.Instance) obj;
- }
-
- /**
- * Method removeUser.
- *
- * @param vUser
- * @return true if the object was removed from the collection.
- */
- public boolean removeUser(
- final uk.ac.vamsas.objects.core.User vUser) {
- boolean removed = _userList.remove(vUser);
- return removed;
- }
-
- /**
- * Method removeUserAt.
- *
- * @param index
- * @return the element removed from the collection
- */
- public uk.ac.vamsas.objects.core.User removeUserAt(
- final int index) {
- java.lang.Object obj = this._userList.remove(index);
- return (uk.ac.vamsas.objects.core.User) obj;
- }
-
- /**
- * Sets the value of field 'common'.
- *
- * @param common the value of field 'common'.
- */
- public void setCommon(
- final uk.ac.vamsas.objects.core.Common common) {
- this._common = common;
- }
-
- /**
- *
- *
- * @param index
- * @param vInstance
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void setInstance(
- final int index,
- final uk.ac.vamsas.objects.core.Instance vInstance)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._instanceList.size()) {
- throw new IndexOutOfBoundsException("setInstance: Index value '" + index + "' not in range [0.." + (this._instanceList.size() - 1) + "]");
- }
-
- this._instanceList.set(index, vInstance);
- }
-
- /**
- *
- *
- * @param vInstanceArray
- */
- public void setInstance(
- final uk.ac.vamsas.objects.core.Instance[] vInstanceArray) {
- //-- copy array
- _instanceList.clear();
-
- for (int i = 0; i < vInstanceArray.length; i++) {
- this._instanceList.add(vInstanceArray[i]);
+ } else if (temp._name != null)
+ return false;
+ if (this._userList != null) {
+ if (temp._userList == null)
+ return false;
+ if (this._userList != temp._userList) {
+ thcycle = org.castor.util.CycleBreaker
+ .startingToCycle(this._userList);
+ tmcycle = org.castor.util.CycleBreaker
+ .startingToCycle(temp._userList);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._userList);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._userList);
+ }
+ ;
+ return false;
+ }
+ if (!thcycle) {
+ if (!this._userList.equals(temp._userList)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._userList);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._userList);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._userList);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._userList);
+ }
}
- }
-
- /**
- * Sets the value of '_instanceList' by copying the given
- * Vector. All elements will be checked for type safety.
- *
- * @param vInstanceList the Vector to copy.
- */
- public void setInstance(
- final java.util.Vector vInstanceList) {
- // copy vector
- this._instanceList.clear();
-
- this._instanceList.addAll(vInstanceList);
- }
-
- /**
- * Sets the value of '_instanceList' by setting it to the given
- * Vector. No type checking is performed.
- * @deprecated
- *
- * @param instanceVector the Vector to set.
- */
- public void setInstanceAsReference(
- final java.util.Vector instanceVector) {
- this._instanceList = instanceVector;
- }
-
- /**
- * Sets the value of field 'name'. The field 'name' has the
- * following description: Canonical name of application
- *
- * @param name the value of field 'name'.
- */
- public void setName(
- final java.lang.String name) {
- this._name = name;
- }
-
- /**
- *
- *
- * @param index
- * @param vUser
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void setUser(
- final int index,
- final uk.ac.vamsas.objects.core.User vUser)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._userList.size()) {
- throw new IndexOutOfBoundsException("setUser: Index value '" + index + "' not in range [0.." + (this._userList.size() - 1) + "]");
+ } else if (temp._userList != null)
+ return false;
+ if (this._common != null) {
+ if (temp._common == null)
+ return false;
+ if (this._common != temp._common) {
+ thcycle = org.castor.util.CycleBreaker.startingToCycle(this._common);
+ tmcycle = org.castor.util.CycleBreaker.startingToCycle(temp._common);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._common);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._common);
+ }
+ ;
+ return false;
+ }
+ if (!thcycle) {
+ if (!this._common.equals(temp._common)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._common);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._common);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._common);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._common);
+ }
}
-
- this._userList.set(index, vUser);
- }
-
- /**
- *
- *
- * @param vUserArray
- */
- public void setUser(
- final uk.ac.vamsas.objects.core.User[] vUserArray) {
- //-- copy array
- _userList.clear();
-
- for (int i = 0; i < vUserArray.length; i++) {
- this._userList.add(vUserArray[i]);
+ } else if (temp._common != null)
+ return false;
+ if (this._instanceList != null) {
+ if (temp._instanceList == null)
+ return false;
+ if (this._instanceList != temp._instanceList) {
+ thcycle = org.castor.util.CycleBreaker
+ .startingToCycle(this._instanceList);
+ tmcycle = org.castor.util.CycleBreaker
+ .startingToCycle(temp._instanceList);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(this._instanceList);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(temp._instanceList);
+ }
+ ;
+ return false;
+ }
+ if (!thcycle) {
+ if (!this._instanceList.equals(temp._instanceList)) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(this._instanceList);
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(temp._instanceList);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._instanceList);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._instanceList);
+ }
}
- }
-
- /**
- * Sets the value of '_userList' by copying the given Vector.
- * All elements will be checked for type safety.
- *
- * @param vUserList the Vector to copy.
- */
- public void setUser(
- final java.util.Vector vUserList) {
- // copy vector
- this._userList.clear();
-
- this._userList.addAll(vUserList);
- }
-
- /**
- * Sets the value of '_userList' by setting it to the given
- * Vector. No type checking is performed.
- * @deprecated
- *
- * @param userVector the Vector to set.
- */
- public void setUserAsReference(
- final java.util.Vector userVector) {
- this._userList = userVector;
- }
-
- /**
- * Sets the value of field 'version'. The field 'version' has
- * the following description: Version string describing the
- * application specific
- * data storage version used
- *
- * @param version the value of field 'version'.
- */
- public void setVersion(
- final java.lang.String version) {
- this._version = version;
- }
-
- /**
- * Method unmarshal.
- *
- * @param reader
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @return the unmarshaled uk.ac.vamsas.objects.core.AppData
- */
- public static uk.ac.vamsas.objects.core.AppData unmarshal(
- final java.io.Reader reader)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- return (uk.ac.vamsas.objects.core.AppData) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.ApplicationData.class, reader);
- }
-
- /**
- *
- *
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void validate(
- )
- throws org.exolab.castor.xml.ValidationException {
- org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
- validator.validate(this);
- }
+ } else if (temp._instanceList != null)
+ return false;
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Returns the value of field 'common'.
+ *
+ * @return the value of field 'Common'.
+ */
+ public uk.ac.vamsas.objects.core.Common getCommon() {
+ return this._common;
+ }
+
+ /**
+ * Method getInstance.
+ *
+ * @param index
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ * @return the value of the uk.ac.vamsas.objects.core.Instance at the given
+ * index
+ */
+ public uk.ac.vamsas.objects.core.Instance getInstance(final int index)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._instanceList.size()) {
+ throw new IndexOutOfBoundsException("getInstance: Index value '" + index
+ + "' not in range [0.." + (this._instanceList.size() - 1) + "]");
+ }
+
+ return (uk.ac.vamsas.objects.core.Instance) _instanceList.get(index);
+ }
+
+ /**
+ * Method getInstance.Returns the contents of the collection in an Array.
+ *
+ * Note: Just in case the collection contents are changing in another thread,
+ * we pass a 0-length Array of the correct type into the API call. This way we
+ * know that the Array returned is of exactly the correct length.
+ *
+ * @return this collection as an Array
+ */
+ public uk.ac.vamsas.objects.core.Instance[] getInstance() {
+ uk.ac.vamsas.objects.core.Instance[] array = new uk.ac.vamsas.objects.core.Instance[0];
+ return (uk.ac.vamsas.objects.core.Instance[]) this._instanceList
+ .toArray(array);
+ }
+
+ /**
+ * Method getInstanceAsReference.Returns a reference to '_instanceList'. No
+ * type checking is performed on any modifications to the Vector.
+ *
+ * @return a reference to the Vector backing this class
+ */
+ public java.util.Vector getInstanceAsReference() {
+ return this._instanceList;
+ }
+
+ /**
+ * Method getInstanceCount.
+ *
+ * @return the size of this collection
+ */
+ public int getInstanceCount() {
+ return this._instanceList.size();
+ }
+
+ /**
+ * Returns the value of field 'name'. The field 'name' has the following
+ * description: Canonical name of application
+ *
+ * @return the value of field 'Name'.
+ */
+ public java.lang.String getName() {
+ return this._name;
+ }
+
+ /**
+ * Method getUser.
+ *
+ * @param index
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ * @return the value of the uk.ac.vamsas.objects.core.User at the given index
+ */
+ public uk.ac.vamsas.objects.core.User getUser(final int index)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._userList.size()) {
+ throw new IndexOutOfBoundsException("getUser: Index value '" + index
+ + "' not in range [0.." + (this._userList.size() - 1) + "]");
+ }
+
+ return (uk.ac.vamsas.objects.core.User) _userList.get(index);
+ }
+
+ /**
+ * Method getUser.Returns the contents of the collection in an Array.
+ *
+ * Note: Just in case the collection contents are changing in another thread,
+ * we pass a 0-length Array of the correct type into the API call. This way we
+ * know that the Array returned is of exactly the correct length.
+ *
+ * @return this collection as an Array
+ */
+ public uk.ac.vamsas.objects.core.User[] getUser() {
+ uk.ac.vamsas.objects.core.User[] array = new uk.ac.vamsas.objects.core.User[0];
+ return (uk.ac.vamsas.objects.core.User[]) this._userList.toArray(array);
+ }
+
+ /**
+ * Method getUserAsReference.Returns a reference to '_userList'. No type
+ * checking is performed on any modifications to the Vector.
+ *
+ * @return a reference to the Vector backing this class
+ */
+ public java.util.Vector getUserAsReference() {
+ return this._userList;
+ }
+
+ /**
+ * Method getUserCount.
+ *
+ * @return the size of this collection
+ */
+ public int getUserCount() {
+ return this._userList.size();
+ }
+
+ /**
+ * Returns the value of field 'version'. The field 'version' has the following
+ * description: Version string describing the application specific data
+ * storage version used
+ *
+ * @return the value of field 'Version'.
+ */
+ public java.lang.String getVersion() {
+ return this._version;
+ }
+
+ /**
+ * Overrides the java.lang.Object.hashCode method.
+ *
+ * The following steps came from Effective Java Programming Language
+ * Guide by Joshua Bloch, Chapter 3
+ *
+ * @return a hash code value for the object.
+ */
+ public int hashCode() {
+ int result = super.hashCode();
+
+ long tmp;
+ if (_version != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_version)) {
+ result = 37 * result + _version.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_version);
+ }
+ if (_name != null && !org.castor.util.CycleBreaker.startingToCycle(_name)) {
+ result = 37 * result + _name.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_name);
+ }
+ if (_userList != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_userList)) {
+ result = 37 * result + _userList.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_userList);
+ }
+ if (_common != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_common)) {
+ result = 37 * result + _common.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_common);
+ }
+ if (_instanceList != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_instanceList)) {
+ result = 37 * result + _instanceList.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_instanceList);
+ }
+
+ return result;
+ }
+
+ /**
+ * Method isValid.
+ *
+ * @return true if this object is valid according to the schema
+ */
+ public boolean isValid() {
+ try {
+ validate();
+ } catch (org.exolab.castor.xml.ValidationException vex) {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ *
+ *
+ * @param out
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void marshal(final java.io.Writer out)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, out);
+ }
+
+ /**
+ *
+ *
+ * @param handler
+ * @throws java.io.IOException
+ * if an IOException occurs during marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ */
+ public void marshal(final org.xml.sax.ContentHandler handler)
+ throws java.io.IOException, org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, handler);
+ }
+
+ /**
+ */
+ public void removeAllInstance() {
+ this._instanceList.clear();
+ }
+
+ /**
+ */
+ public void removeAllUser() {
+ this._userList.clear();
+ }
+
+ /**
+ * Method removeInstance.
+ *
+ * @param vInstance
+ * @return true if the object was removed from the collection.
+ */
+ public boolean removeInstance(
+ final uk.ac.vamsas.objects.core.Instance vInstance) {
+ boolean removed = _instanceList.remove(vInstance);
+ return removed;
+ }
+
+ /**
+ * Method removeInstanceAt.
+ *
+ * @param index
+ * @return the element removed from the collection
+ */
+ public uk.ac.vamsas.objects.core.Instance removeInstanceAt(final int index) {
+ java.lang.Object obj = this._instanceList.remove(index);
+ return (uk.ac.vamsas.objects.core.Instance) obj;
+ }
+
+ /**
+ * Method removeUser.
+ *
+ * @param vUser
+ * @return true if the object was removed from the collection.
+ */
+ public boolean removeUser(final uk.ac.vamsas.objects.core.User vUser) {
+ boolean removed = _userList.remove(vUser);
+ return removed;
+ }
+
+ /**
+ * Method removeUserAt.
+ *
+ * @param index
+ * @return the element removed from the collection
+ */
+ public uk.ac.vamsas.objects.core.User removeUserAt(final int index) {
+ java.lang.Object obj = this._userList.remove(index);
+ return (uk.ac.vamsas.objects.core.User) obj;
+ }
+
+ /**
+ * Sets the value of field 'common'.
+ *
+ * @param common
+ * the value of field 'common'.
+ */
+ public void setCommon(final uk.ac.vamsas.objects.core.Common common) {
+ this._common = common;
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vInstance
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void setInstance(final int index,
+ final uk.ac.vamsas.objects.core.Instance vInstance)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._instanceList.size()) {
+ throw new IndexOutOfBoundsException("setInstance: Index value '" + index
+ + "' not in range [0.." + (this._instanceList.size() - 1) + "]");
+ }
+
+ this._instanceList.set(index, vInstance);
+ }
+
+ /**
+ *
+ *
+ * @param vInstanceArray
+ */
+ public void setInstance(
+ final uk.ac.vamsas.objects.core.Instance[] vInstanceArray) {
+ // -- copy array
+ _instanceList.clear();
+
+ for (int i = 0; i < vInstanceArray.length; i++) {
+ this._instanceList.add(vInstanceArray[i]);
+ }
+ }
+
+ /**
+ * Sets the value of '_instanceList' by copying the given Vector. All elements
+ * will be checked for type safety.
+ *
+ * @param vInstanceList
+ * the Vector to copy.
+ */
+ public void setInstance(final java.util.Vector vInstanceList) {
+ // copy vector
+ this._instanceList.clear();
+
+ this._instanceList.addAll(vInstanceList);
+ }
+
+ /**
+ * Sets the value of '_instanceList' by setting it to the given Vector. No
+ * type checking is performed.
+ *
+ * @deprecated
+ *
+ * @param instanceVector
+ * the Vector to set.
+ */
+ public void setInstanceAsReference(final java.util.Vector instanceVector) {
+ this._instanceList = instanceVector;
+ }
+
+ /**
+ * Sets the value of field 'name'. The field 'name' has the following
+ * description: Canonical name of application
+ *
+ * @param name
+ * the value of field 'name'.
+ */
+ public void setName(final java.lang.String name) {
+ this._name = name;
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vUser
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void setUser(final int index,
+ final uk.ac.vamsas.objects.core.User vUser)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._userList.size()) {
+ throw new IndexOutOfBoundsException("setUser: Index value '" + index
+ + "' not in range [0.." + (this._userList.size() - 1) + "]");
+ }
+
+ this._userList.set(index, vUser);
+ }
+
+ /**
+ *
+ *
+ * @param vUserArray
+ */
+ public void setUser(final uk.ac.vamsas.objects.core.User[] vUserArray) {
+ // -- copy array
+ _userList.clear();
+
+ for (int i = 0; i < vUserArray.length; i++) {
+ this._userList.add(vUserArray[i]);
+ }
+ }
+
+ /**
+ * Sets the value of '_userList' by copying the given Vector. All elements
+ * will be checked for type safety.
+ *
+ * @param vUserList
+ * the Vector to copy.
+ */
+ public void setUser(final java.util.Vector vUserList) {
+ // copy vector
+ this._userList.clear();
+
+ this._userList.addAll(vUserList);
+ }
+
+ /**
+ * Sets the value of '_userList' by setting it to the given Vector. No type
+ * checking is performed.
+ *
+ * @deprecated
+ *
+ * @param userVector
+ * the Vector to set.
+ */
+ public void setUserAsReference(final java.util.Vector userVector) {
+ this._userList = userVector;
+ }
+
+ /**
+ * Sets the value of field 'version'. The field 'version' has the following
+ * description: Version string describing the application specific data
+ * storage version used
+ *
+ * @param version
+ * the value of field 'version'.
+ */
+ public void setVersion(final java.lang.String version) {
+ this._version = version;
+ }
+
+ /**
+ * Method unmarshal.
+ *
+ * @param reader
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @return the unmarshaled uk.ac.vamsas.objects.core.AppData
+ */
+ public static uk.ac.vamsas.objects.core.AppData unmarshal(
+ final java.io.Reader reader)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ return (uk.ac.vamsas.objects.core.AppData) Unmarshaller.unmarshal(
+ uk.ac.vamsas.objects.core.ApplicationData.class, reader);
+ }
+
+ /**
+ *
+ *
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void validate() throws org.exolab.castor.xml.ValidationException {
+ org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+ validator.validate(this);
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/Attachment.java b/src/uk/ac/vamsas/objects/core/Attachment.java
index b7c741f..10b36ec 100644
--- a/src/uk/ac/vamsas/objects/core/Attachment.java
+++ b/src/uk/ac/vamsas/objects/core/Attachment.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import org.exolab.castor.xml.Marshaller;
@@ -19,394 +33,394 @@ import org.exolab.castor.xml.Unmarshaller;
*
* @version $Revision$ $Date$
*/
-public class Attachment extends uk.ac.vamsas.objects.core.AppData
-implements java.io.Serializable
-{
-
-
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
- * true implies data will be decompresses with Zip
- * before presenting to application
- */
- private boolean _compressed = false;
-
- /**
- * keeps track of state for field: _compressed
+public class Attachment extends uk.ac.vamsas.objects.core.AppData implements
+ java.io.Serializable {
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * true implies data will be decompresses with Zip before presenting to
+ * application
+ */
+ private boolean _compressed = false;
+
+ /**
+ * keeps track of state for field: _compressed
+ */
+ private boolean _has_compressed;
+
+ /**
+ * Type of arbitrary data - TODO: decide format - use (extended) MIME types ?
+ */
+ private java.lang.String _type;
+
+ /**
+ * Object the arbitrary data is associated with
+ *
+ */
+ private java.lang.Object _objectref;
+
+ /**
+ * Primary Key for vamsas object referencing
+ *
+ */
+ private java.lang.String _id;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public Attachment() {
+ super();
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
*/
- private boolean _has_compressed;
-
- /**
- * Type of arbitrary data - TODO: decide format - use
- * (extended) MIME types ?
- */
- private java.lang.String _type;
-
- /**
- * Object the arbitrary data is associated with
- *
- */
- private java.lang.Object _objectref;
-
- /**
- * Primary Key for vamsas object referencing
- *
- */
- private java.lang.String _id;
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public Attachment() {
- super();
- }
-
-
- //-----------/
- //- Methods -/
- //-----------/
-
- /**
- */
- public void deleteCompressed(
- ) {
- this._has_compressed= false;
- }
-
- /**
- * Overrides the java.lang.Object.equals method.
- *
- * @param obj
- * @return true if the objects are equal.
- */
- public boolean equals(
- final java.lang.Object obj) {
- if ( this == obj )
- return true;
-
- if (super.equals(obj)==false)
+ public void deleteCompressed() {
+ this._has_compressed = false;
+ }
+
+ /**
+ * Overrides the java.lang.Object.equals method.
+ *
+ * @param obj
+ * @return true if the objects are equal.
+ */
+ public boolean equals(final java.lang.Object obj) {
+ if (this == obj)
+ return true;
+
+ if (super.equals(obj) == false)
+ return false;
+
+ if (obj instanceof Attachment) {
+
+ Attachment temp = (Attachment) obj;
+ boolean thcycle;
+ boolean tmcycle;
+ if (this._compressed != temp._compressed)
+ return false;
+ if (this._has_compressed != temp._has_compressed)
+ return false;
+ if (this._type != null) {
+ if (temp._type == null)
+ return false;
+ if (this._type != temp._type) {
+ thcycle = org.castor.util.CycleBreaker.startingToCycle(this._type);
+ tmcycle = org.castor.util.CycleBreaker.startingToCycle(temp._type);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._type);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._type);
+ }
+ ;
return false;
-
- if (obj instanceof Attachment) {
-
- Attachment temp = (Attachment)obj;
- boolean thcycle;
- boolean tmcycle;
- if (this._compressed != temp._compressed)
- return false;
- if (this._has_compressed != temp._has_compressed)
- return false;
- if (this._type != null) {
- if (temp._type == null) return false;
- if (this._type != temp._type) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._type);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._type);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._type); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._type); };
- return false;
- }
- if (!thcycle) {
- if (!this._type.equals(temp._type)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._type);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._type);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._type);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._type);
- }
- }
- } else if (temp._type != null)
- return false;
- if (this._objectref != null) {
- if (temp._objectref == null) return false;
- if (this._objectref != temp._objectref) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._objectref);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._objectref);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._objectref); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._objectref); };
- return false;
- }
- if (!thcycle) {
- if (!this._objectref.equals(temp._objectref)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._objectref);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._objectref);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._objectref);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._objectref);
- }
- }
- } else if (temp._objectref != null)
- return false;
- if (this._id != null) {
- if (temp._id == null) return false;
- if (this._id != temp._id) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._id);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._id);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._id); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._id); };
- return false;
- }
- if (!thcycle) {
- if (!this._id.equals(temp._id)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
- }
- }
- } else if (temp._id != null)
- return false;
- return true;
+ }
+ if (!thcycle) {
+ if (!this._type.equals(temp._type)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._type);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._type);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._type);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._type);
+ }
}
+ } else if (temp._type != null)
return false;
- }
-
- /**
- * Returns the value of field 'compressed'. The field
- * 'compressed' has the following description: true implies
- * data will be decompresses with Zip
- * before presenting to application
- *
- * @return the value of field 'Compressed'.
- */
- public boolean getCompressed(
- ) {
- return this._compressed;
- }
-
- /**
- * Returns the value of field 'id'. The field 'id' has the
- * following description: Primary Key for vamsas object
- * referencing
- *
- *
- * @return the value of field 'Id'.
- */
- public java.lang.String getId(
- ) {
- return this._id;
- }
-
- /**
- * Returns the value of field 'objectref'. The field
- * 'objectref' has the following description: Object the
- * arbitrary data is associated with
- *
- *
- * @return the value of field 'Objectref'.
- */
- public java.lang.Object getObjectref(
- ) {
- return this._objectref;
- }
-
- /**
- * Returns the value of field 'type'. The field 'type' has the
- * following description: Type of arbitrary data - TODO: decide
- * format - use
- * (extended) MIME types ?
- *
- * @return the value of field 'Type'.
- */
- public java.lang.String getType(
- ) {
- return this._type;
- }
-
- /**
- * Method hasCompressed.
- *
- * @return true if at least one Compressed has been added
- */
- public boolean hasCompressed(
- ) {
- return this._has_compressed;
- }
-
- /**
- * Overrides the java.lang.Object.hashCode method.
- *
- * The following steps came from Effective Java Programming
- * Language Guide by Joshua Bloch, Chapter 3
- *
- * @return a hash code value for the object.
- */
- public int hashCode(
- ) {
- int result = super.hashCode();
-
- long tmp;
- result = 37 * result + (_compressed?0:1);
- if (_type != null
- && !org.castor.util.CycleBreaker.startingToCycle(_type)) {
- result = 37 * result + _type.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_type);
- }
- if (_objectref != null
- && !org.castor.util.CycleBreaker.startingToCycle(_objectref)) {
- result = 37 * result + _objectref.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_objectref);
- }
- if (_id != null
- && !org.castor.util.CycleBreaker.startingToCycle(_id)) {
- result = 37 * result + _id.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_id);
+ if (this._objectref != null) {
+ if (temp._objectref == null)
+ return false;
+ if (this._objectref != temp._objectref) {
+ thcycle = org.castor.util.CycleBreaker
+ .startingToCycle(this._objectref);
+ tmcycle = org.castor.util.CycleBreaker
+ .startingToCycle(temp._objectref);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._objectref);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._objectref);
+ }
+ ;
+ return false;
+ }
+ if (!thcycle) {
+ if (!this._objectref.equals(temp._objectref)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._objectref);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._objectref);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._objectref);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._objectref);
+ }
}
-
- return result;
- }
-
- /**
- * Returns the value of field 'compressed'. The field
- * 'compressed' has the following description: true implies
- * data will be decompresses with Zip
- * before presenting to application
- *
- * @return the value of field 'Compressed'.
- */
- public boolean isCompressed(
- ) {
- return this._compressed;
- }
-
- /**
- * Method isValid.
- *
- * @return true if this object is valid according to the schema
- */
- public boolean isValid(
- ) {
- try {
- validate();
- } catch (org.exolab.castor.xml.ValidationException vex) {
+ } else if (temp._objectref != null)
+ return false;
+ if (this._id != null) {
+ if (temp._id == null)
+ return false;
+ if (this._id != temp._id) {
+ thcycle = org.castor.util.CycleBreaker.startingToCycle(this._id);
+ tmcycle = org.castor.util.CycleBreaker.startingToCycle(temp._id);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
+ }
+ ;
return false;
+ }
+ if (!thcycle) {
+ if (!this._id.equals(temp._id)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
+ }
}
- return true;
- }
-
- /**
- *
- *
- * @param out
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void marshal(
- final java.io.Writer out)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, out);
- }
-
- /**
- *
- *
- * @param handler
- * @throws java.io.IOException if an IOException occurs during
- * marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- */
- public void marshal(
- final org.xml.sax.ContentHandler handler)
- throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, handler);
- }
-
- /**
- * Sets the value of field 'compressed'. The field 'compressed'
- * has the following description: true implies data will be
- * decompresses with Zip
- * before presenting to application
- *
- * @param compressed the value of field 'compressed'.
- */
- public void setCompressed(
- final boolean compressed) {
- this._compressed = compressed;
- this._has_compressed = true;
- }
-
- /**
- * Sets the value of field 'id'. The field 'id' has the
- * following description: Primary Key for vamsas object
- * referencing
- *
- *
- * @param id the value of field 'id'.
- */
- public void setId(
- final java.lang.String id) {
- this._id = id;
+ } else if (temp._id != null)
+ return false;
+ return true;
}
-
- /**
- * Sets the value of field 'objectref'. The field 'objectref'
- * has the following description: Object the arbitrary data is
- * associated with
- *
- *
- * @param objectref the value of field 'objectref'.
- */
- public void setObjectref(
- final java.lang.Object objectref) {
- this._objectref = objectref;
+ return false;
+ }
+
+ /**
+ * Returns the value of field 'compressed'. The field 'compressed' has the
+ * following description: true implies data will be decompresses with Zip
+ * before presenting to application
+ *
+ * @return the value of field 'Compressed'.
+ */
+ public boolean getCompressed() {
+ return this._compressed;
+ }
+
+ /**
+ * Returns the value of field 'id'. The field 'id' has the following
+ * description: Primary Key for vamsas object referencing
+ *
+ *
+ * @return the value of field 'Id'.
+ */
+ public java.lang.String getId() {
+ return this._id;
+ }
+
+ /**
+ * Returns the value of field 'objectref'. The field 'objectref' has the
+ * following description: Object the arbitrary data is associated with
+ *
+ *
+ * @return the value of field 'Objectref'.
+ */
+ public java.lang.Object getObjectref() {
+ return this._objectref;
+ }
+
+ /**
+ * Returns the value of field 'type'. The field 'type' has the following
+ * description: Type of arbitrary data - TODO: decide format - use (extended)
+ * MIME types ?
+ *
+ * @return the value of field 'Type'.
+ */
+ public java.lang.String getType() {
+ return this._type;
+ }
+
+ /**
+ * Method hasCompressed.
+ *
+ * @return true if at least one Compressed has been added
+ */
+ public boolean hasCompressed() {
+ return this._has_compressed;
+ }
+
+ /**
+ * Overrides the java.lang.Object.hashCode method.
+ *
+ * The following steps came from Effective Java Programming Language
+ * Guide by Joshua Bloch, Chapter 3
+ *
+ * @return a hash code value for the object.
+ */
+ public int hashCode() {
+ int result = super.hashCode();
+
+ long tmp;
+ result = 37 * result + (_compressed ? 0 : 1);
+ if (_type != null && !org.castor.util.CycleBreaker.startingToCycle(_type)) {
+ result = 37 * result + _type.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_type);
}
-
- /**
- * Sets the value of field 'type'. The field 'type' has the
- * following description: Type of arbitrary data - TODO: decide
- * format - use
- * (extended) MIME types ?
- *
- * @param type the value of field 'type'.
- */
- public void setType(
- final java.lang.String type) {
- this._type = type;
+ if (_objectref != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_objectref)) {
+ result = 37 * result + _objectref.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_objectref);
}
-
- /**
- * Method unmarshal.
- *
- * @param reader
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @return the unmarshaled uk.ac.vamsas.objects.core.AppData
- */
- public static uk.ac.vamsas.objects.core.AppData unmarshal(
- final java.io.Reader reader)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- return (uk.ac.vamsas.objects.core.AppData) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Attachment.class, reader);
+ if (_id != null && !org.castor.util.CycleBreaker.startingToCycle(_id)) {
+ result = 37 * result + _id.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_id);
}
- /**
- *
- *
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void validate(
- )
- throws org.exolab.castor.xml.ValidationException {
- org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
- validator.validate(this);
+ return result;
+ }
+
+ /**
+ * Returns the value of field 'compressed'. The field 'compressed' has the
+ * following description: true implies data will be decompresses with Zip
+ * before presenting to application
+ *
+ * @return the value of field 'Compressed'.
+ */
+ public boolean isCompressed() {
+ return this._compressed;
+ }
+
+ /**
+ * Method isValid.
+ *
+ * @return true if this object is valid according to the schema
+ */
+ public boolean isValid() {
+ try {
+ validate();
+ } catch (org.exolab.castor.xml.ValidationException vex) {
+ return false;
}
+ return true;
+ }
+
+ /**
+ *
+ *
+ * @param out
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void marshal(final java.io.Writer out)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, out);
+ }
+
+ /**
+ *
+ *
+ * @param handler
+ * @throws java.io.IOException
+ * if an IOException occurs during marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ */
+ public void marshal(final org.xml.sax.ContentHandler handler)
+ throws java.io.IOException, org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, handler);
+ }
+
+ /**
+ * Sets the value of field 'compressed'. The field 'compressed' has the
+ * following description: true implies data will be decompresses with Zip
+ * before presenting to application
+ *
+ * @param compressed
+ * the value of field 'compressed'.
+ */
+ public void setCompressed(final boolean compressed) {
+ this._compressed = compressed;
+ this._has_compressed = true;
+ }
+
+ /**
+ * Sets the value of field 'id'. The field 'id' has the following description:
+ * Primary Key for vamsas object referencing
+ *
+ *
+ * @param id
+ * the value of field 'id'.
+ */
+ public void setId(final java.lang.String id) {
+ this._id = id;
+ }
+
+ /**
+ * Sets the value of field 'objectref'. The field 'objectref' has the
+ * following description: Object the arbitrary data is associated with
+ *
+ *
+ * @param objectref
+ * the value of field 'objectref'.
+ */
+ public void setObjectref(final java.lang.Object objectref) {
+ this._objectref = objectref;
+ }
+
+ /**
+ * Sets the value of field 'type'. The field 'type' has the following
+ * description: Type of arbitrary data - TODO: decide format - use (extended)
+ * MIME types ?
+ *
+ * @param type
+ * the value of field 'type'.
+ */
+ public void setType(final java.lang.String type) {
+ this._type = type;
+ }
+
+ /**
+ * Method unmarshal.
+ *
+ * @param reader
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @return the unmarshaled uk.ac.vamsas.objects.core.AppData
+ */
+ public static uk.ac.vamsas.objects.core.AppData unmarshal(
+ final java.io.Reader reader)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ return (uk.ac.vamsas.objects.core.AppData) Unmarshaller.unmarshal(
+ uk.ac.vamsas.objects.core.Attachment.class, reader);
+ }
+
+ /**
+ *
+ *
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void validate() throws org.exolab.castor.xml.ValidationException {
+ org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+ validator.validate(this);
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/Common.java b/src/uk/ac/vamsas/objects/core/Common.java
index cda263d..03e74ba 100644
--- a/src/uk/ac/vamsas/objects/core/Common.java
+++ b/src/uk/ac/vamsas/objects/core/Common.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import org.exolab.castor.xml.Marshaller;
@@ -19,136 +33,133 @@ import org.exolab.castor.xml.Unmarshaller;
*
* @version $Revision$ $Date$
*/
-public class Common extends uk.ac.vamsas.objects.core.AppData
-implements java.io.Serializable
-{
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public Common() {
- super();
- }
+public class Common extends uk.ac.vamsas.objects.core.AppData implements
+ java.io.Serializable {
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
- //-----------/
- //- Methods -/
- //-----------/
-
- /**
- * Overrides the java.lang.Object.equals method.
- *
- * @param obj
- * @return true if the objects are equal.
- */
- public boolean equals(
- final java.lang.Object obj) {
- if ( this == obj )
- return true;
-
- if (super.equals(obj)==false)
- return false;
-
- if (obj instanceof Common) {
-
- return true;
- }
- return false;
- }
+ public Common() {
+ super();
+ }
- /**
- * Overrides the java.lang.Object.hashCode method.
- *
- * The following steps came from Effective Java Programming
- * Language Guide by Joshua Bloch, Chapter 3
- *
- * @return a hash code value for the object.
- */
- public int hashCode(
- ) {
- int result = super.hashCode();
-
- long tmp;
-
- return result;
- }
+ // -----------/
+ // - Methods -/
+ // -----------/
- /**
- * Method isValid.
- *
- * @return true if this object is valid according to the schema
- */
- public boolean isValid(
- ) {
- try {
- validate();
- } catch (org.exolab.castor.xml.ValidationException vex) {
- return false;
- }
- return true;
- }
+ /**
+ * Overrides the java.lang.Object.equals method.
+ *
+ * @param obj
+ * @return true if the objects are equal.
+ */
+ public boolean equals(final java.lang.Object obj) {
+ if (this == obj)
+ return true;
- /**
- *
- *
- * @param out
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void marshal(
- final java.io.Writer out)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, out);
- }
+ if (super.equals(obj) == false)
+ return false;
- /**
- *
- *
- * @param handler
- * @throws java.io.IOException if an IOException occurs during
- * marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- */
- public void marshal(
- final org.xml.sax.ContentHandler handler)
- throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, handler);
- }
+ if (obj instanceof Common) {
- /**
- * Method unmarshal.
- *
- * @param reader
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @return the unmarshaled uk.ac.vamsas.objects.core.AppData
- */
- public static uk.ac.vamsas.objects.core.AppData unmarshal(
- final java.io.Reader reader)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- return (uk.ac.vamsas.objects.core.AppData) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Common.class, reader);
+ return true;
}
-
- /**
- *
- *
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void validate(
- )
- throws org.exolab.castor.xml.ValidationException {
- org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
- validator.validate(this);
+ return false;
+ }
+
+ /**
+ * Overrides the java.lang.Object.hashCode method.
+ *
+ * The following steps came from Effective Java Programming Language
+ * Guide by Joshua Bloch, Chapter 3
+ *
+ * @return a hash code value for the object.
+ */
+ public int hashCode() {
+ int result = super.hashCode();
+
+ long tmp;
+
+ return result;
+ }
+
+ /**
+ * Method isValid.
+ *
+ * @return true if this object is valid according to the schema
+ */
+ public boolean isValid() {
+ try {
+ validate();
+ } catch (org.exolab.castor.xml.ValidationException vex) {
+ return false;
}
+ return true;
+ }
+
+ /**
+ *
+ *
+ * @param out
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void marshal(final java.io.Writer out)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, out);
+ }
+
+ /**
+ *
+ *
+ * @param handler
+ * @throws java.io.IOException
+ * if an IOException occurs during marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ */
+ public void marshal(final org.xml.sax.ContentHandler handler)
+ throws java.io.IOException, org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, handler);
+ }
+
+ /**
+ * Method unmarshal.
+ *
+ * @param reader
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @return the unmarshaled uk.ac.vamsas.objects.core.AppData
+ */
+ public static uk.ac.vamsas.objects.core.AppData unmarshal(
+ final java.io.Reader reader)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ return (uk.ac.vamsas.objects.core.AppData) Unmarshaller.unmarshal(
+ uk.ac.vamsas.objects.core.Common.class, reader);
+ }
+
+ /**
+ *
+ *
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void validate() throws org.exolab.castor.xml.ValidationException {
+ org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+ validator.validate(this);
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/DataSet.java b/src/uk/ac/vamsas/objects/core/DataSet.java
index ae4506b..150771c 100644
--- a/src/uk/ac/vamsas/objects/core/DataSet.java
+++ b/src/uk/ac/vamsas/objects/core/DataSet.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import org.exolab.castor.xml.Marshaller;
@@ -17,1362 +31,1415 @@ import org.exolab.castor.xml.Unmarshaller;
/**
* Class DataSet.
*
- * @version $Revision$ $Date$
+ * @version $Revision$ $Date: 2007-06-28 14:51:44 +0100 (Thu, 28 Jun 2007)
+ * $
*/
-public class DataSet extends uk.ac.vamsas.client.Vobject
-implements java.io.Serializable
-{
-
-
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
- * Primary Key for vamsas object referencing
- */
- private java.lang.String _id;
-
- /**
- * Field _sequenceList.
- */
- private java.util.Vector _sequenceList;
-
- /**
- * Field _sequenceMappingList.
- */
- private java.util.Vector _sequenceMappingList;
-
- /**
- * Field _dataSetAnnotationsList.
- */
- private java.util.Vector _dataSetAnnotationsList;
-
- /**
- * Field _alignmentList.
- */
- private java.util.Vector _alignmentList;
-
- /**
- * Field _treeList.
- */
- private java.util.Vector _treeList;
-
- /**
- * Field _provenance.
- */
- private uk.ac.vamsas.objects.core.Provenance _provenance;
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public DataSet() {
- super();
- this._sequenceList = new java.util.Vector();
- this._sequenceMappingList = new java.util.Vector();
- this._dataSetAnnotationsList = new java.util.Vector();
- this._alignmentList = new java.util.Vector();
- this._treeList = new java.util.Vector();
- }
-
-
- //-----------/
- //- Methods -/
- //-----------/
-
- /**
- *
- *
- * @param vAlignment
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addAlignment(
- final uk.ac.vamsas.objects.core.Alignment vAlignment)
- throws java.lang.IndexOutOfBoundsException {
- this._alignmentList.addElement(vAlignment);
- }
-
- /**
- *
- *
- * @param index
- * @param vAlignment
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addAlignment(
- final int index,
- final uk.ac.vamsas.objects.core.Alignment vAlignment)
- throws java.lang.IndexOutOfBoundsException {
- this._alignmentList.add(index, vAlignment);
- }
-
- /**
- *
- *
- * @param vDataSetAnnotations
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addDataSetAnnotations(
- final uk.ac.vamsas.objects.core.DataSetAnnotations vDataSetAnnotations)
- throws java.lang.IndexOutOfBoundsException {
- this._dataSetAnnotationsList.addElement(vDataSetAnnotations);
- }
-
- /**
- *
- *
- * @param index
- * @param vDataSetAnnotations
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addDataSetAnnotations(
- final int index,
- final uk.ac.vamsas.objects.core.DataSetAnnotations vDataSetAnnotations)
- throws java.lang.IndexOutOfBoundsException {
- this._dataSetAnnotationsList.add(index, vDataSetAnnotations);
- }
-
- /**
- *
- *
- * @param vSequence
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addSequence(
- final uk.ac.vamsas.objects.core.Sequence vSequence)
- throws java.lang.IndexOutOfBoundsException {
- this._sequenceList.addElement(vSequence);
- }
-
- /**
- *
- *
- * @param index
- * @param vSequence
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addSequence(
- final int index,
- final uk.ac.vamsas.objects.core.Sequence vSequence)
- throws java.lang.IndexOutOfBoundsException {
- this._sequenceList.add(index, vSequence);
- }
-
- /**
- *
- *
- * @param vSequenceMapping
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addSequenceMapping(
- final uk.ac.vamsas.objects.core.SequenceMapping vSequenceMapping)
- throws java.lang.IndexOutOfBoundsException {
- this._sequenceMappingList.addElement(vSequenceMapping);
- }
-
- /**
- *
- *
- * @param index
- * @param vSequenceMapping
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addSequenceMapping(
- final int index,
- final uk.ac.vamsas.objects.core.SequenceMapping vSequenceMapping)
- throws java.lang.IndexOutOfBoundsException {
- this._sequenceMappingList.add(index, vSequenceMapping);
- }
-
- /**
- *
- *
- * @param vTree
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addTree(
- final uk.ac.vamsas.objects.core.Tree vTree)
- throws java.lang.IndexOutOfBoundsException {
- this._treeList.addElement(vTree);
- }
-
- /**
- *
- *
- * @param index
- * @param vTree
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addTree(
- final int index,
- final uk.ac.vamsas.objects.core.Tree vTree)
- throws java.lang.IndexOutOfBoundsException {
- this._treeList.add(index, vTree);
- }
-
- /**
- * Method enumerateAlignment.
- *
- * @return an Enumeration over all
- * uk.ac.vamsas.objects.core.Alignment elements
- */
- public java.util.Enumeration enumerateAlignment(
- ) {
- return this._alignmentList.elements();
- }
-
- /**
- * Method enumerateDataSetAnnotations.
- *
- * @return an Enumeration over all
- * uk.ac.vamsas.objects.core.DataSetAnnotations elements
- */
- public java.util.Enumeration enumerateDataSetAnnotations(
- ) {
- return this._dataSetAnnotationsList.elements();
- }
-
- /**
- * Method enumerateSequence.
- *
- * @return an Enumeration over all
- * uk.ac.vamsas.objects.core.Sequence elements
- */
- public java.util.Enumeration enumerateSequence(
- ) {
- return this._sequenceList.elements();
- }
-
- /**
- * Method enumerateSequenceMapping.
- *
- * @return an Enumeration over all
- * uk.ac.vamsas.objects.core.SequenceMapping elements
- */
- public java.util.Enumeration enumerateSequenceMapping(
- ) {
- return this._sequenceMappingList.elements();
- }
-
- /**
- * Method enumerateTree.
- *
- * @return an Enumeration over all
- * uk.ac.vamsas.objects.core.Tree elements
- */
- public java.util.Enumeration enumerateTree(
- ) {
- return this._treeList.elements();
- }
-
- /**
- * Overrides the java.lang.Object.equals method.
- *
- * @param obj
- * @return true if the objects are equal.
- */
- public boolean equals(
- final java.lang.Object obj) {
- if ( this == obj )
- return true;
-
- if (super.equals(obj)==false)
+public class DataSet extends uk.ac.vamsas.client.Vobject implements
+ java.io.Serializable {
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * Primary Key for vamsas object referencing
+ */
+ private java.lang.String _id;
+
+ /**
+ * Field _sequenceList.
+ */
+ private java.util.Vector _sequenceList;
+
+ /**
+ * Field _sequenceMappingList.
+ */
+ private java.util.Vector _sequenceMappingList;
+
+ /**
+ * Field _dataSetAnnotationsList.
+ */
+ private java.util.Vector _dataSetAnnotationsList;
+
+ /**
+ * Field _alignmentList.
+ */
+ private java.util.Vector _alignmentList;
+
+ /**
+ * Field _treeList.
+ */
+ private java.util.Vector _treeList;
+
+ /**
+ * Field _provenance.
+ */
+ private uk.ac.vamsas.objects.core.Provenance _provenance;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public DataSet() {
+ super();
+ this._sequenceList = new java.util.Vector();
+ this._sequenceMappingList = new java.util.Vector();
+ this._dataSetAnnotationsList = new java.util.Vector();
+ this._alignmentList = new java.util.Vector();
+ this._treeList = new java.util.Vector();
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ *
+ *
+ * @param vAlignment
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addAlignment(final uk.ac.vamsas.objects.core.Alignment vAlignment)
+ throws java.lang.IndexOutOfBoundsException {
+ this._alignmentList.addElement(vAlignment);
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vAlignment
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addAlignment(final int index,
+ final uk.ac.vamsas.objects.core.Alignment vAlignment)
+ throws java.lang.IndexOutOfBoundsException {
+ this._alignmentList.add(index, vAlignment);
+ }
+
+ /**
+ *
+ *
+ * @param vDataSetAnnotations
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addDataSetAnnotations(
+ final uk.ac.vamsas.objects.core.DataSetAnnotations vDataSetAnnotations)
+ throws java.lang.IndexOutOfBoundsException {
+ this._dataSetAnnotationsList.addElement(vDataSetAnnotations);
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vDataSetAnnotations
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addDataSetAnnotations(final int index,
+ final uk.ac.vamsas.objects.core.DataSetAnnotations vDataSetAnnotations)
+ throws java.lang.IndexOutOfBoundsException {
+ this._dataSetAnnotationsList.add(index, vDataSetAnnotations);
+ }
+
+ /**
+ *
+ *
+ * @param vSequence
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addSequence(final uk.ac.vamsas.objects.core.Sequence vSequence)
+ throws java.lang.IndexOutOfBoundsException {
+ this._sequenceList.addElement(vSequence);
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vSequence
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addSequence(final int index,
+ final uk.ac.vamsas.objects.core.Sequence vSequence)
+ throws java.lang.IndexOutOfBoundsException {
+ this._sequenceList.add(index, vSequence);
+ }
+
+ /**
+ *
+ *
+ * @param vSequenceMapping
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addSequenceMapping(
+ final uk.ac.vamsas.objects.core.SequenceMapping vSequenceMapping)
+ throws java.lang.IndexOutOfBoundsException {
+ this._sequenceMappingList.addElement(vSequenceMapping);
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vSequenceMapping
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addSequenceMapping(final int index,
+ final uk.ac.vamsas.objects.core.SequenceMapping vSequenceMapping)
+ throws java.lang.IndexOutOfBoundsException {
+ this._sequenceMappingList.add(index, vSequenceMapping);
+ }
+
+ /**
+ *
+ *
+ * @param vTree
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addTree(final uk.ac.vamsas.objects.core.Tree vTree)
+ throws java.lang.IndexOutOfBoundsException {
+ this._treeList.addElement(vTree);
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vTree
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addTree(final int index,
+ final uk.ac.vamsas.objects.core.Tree vTree)
+ throws java.lang.IndexOutOfBoundsException {
+ this._treeList.add(index, vTree);
+ }
+
+ /**
+ * Method enumerateAlignment.
+ *
+ * @return an Enumeration over all uk.ac.vamsas.objects.core.Alignment
+ * elements
+ */
+ public java.util.Enumeration enumerateAlignment() {
+ return this._alignmentList.elements();
+ }
+
+ /**
+ * Method enumerateDataSetAnnotations.
+ *
+ * @return an Enumeration over all
+ * uk.ac.vamsas.objects.core.DataSetAnnotations elements
+ */
+ public java.util.Enumeration enumerateDataSetAnnotations() {
+ return this._dataSetAnnotationsList.elements();
+ }
+
+ /**
+ * Method enumerateSequence.
+ *
+ * @return an Enumeration over all uk.ac.vamsas.objects.core.Sequence elements
+ */
+ public java.util.Enumeration enumerateSequence() {
+ return this._sequenceList.elements();
+ }
+
+ /**
+ * Method enumerateSequenceMapping.
+ *
+ * @return an Enumeration over all uk.ac.vamsas.objects.core.SequenceMapping
+ * elements
+ */
+ public java.util.Enumeration enumerateSequenceMapping() {
+ return this._sequenceMappingList.elements();
+ }
+
+ /**
+ * Method enumerateTree.
+ *
+ * @return an Enumeration over all uk.ac.vamsas.objects.core.Tree elements
+ */
+ public java.util.Enumeration enumerateTree() {
+ return this._treeList.elements();
+ }
+
+ /**
+ * Overrides the java.lang.Object.equals method.
+ *
+ * @param obj
+ * @return true if the objects are equal.
+ */
+ public boolean equals(final java.lang.Object obj) {
+ if (this == obj)
+ return true;
+
+ if (super.equals(obj) == false)
+ return false;
+
+ if (obj instanceof DataSet) {
+
+ DataSet temp = (DataSet) obj;
+ boolean thcycle;
+ boolean tmcycle;
+ if (this._id != null) {
+ if (temp._id == null)
+ return false;
+ if (this._id != temp._id) {
+ thcycle = org.castor.util.CycleBreaker.startingToCycle(this._id);
+ tmcycle = org.castor.util.CycleBreaker.startingToCycle(temp._id);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
+ }
+ ;
return false;
-
- if (obj instanceof DataSet) {
-
- DataSet temp = (DataSet)obj;
- boolean thcycle;
- boolean tmcycle;
- if (this._id != null) {
- if (temp._id == null) return false;
- if (this._id != temp._id) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._id);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._id);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._id); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._id); };
- return false;
- }
- if (!thcycle) {
- if (!this._id.equals(temp._id)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
- }
- }
- } else if (temp._id != null)
- return false;
- if (this._sequenceList != null) {
- if (temp._sequenceList == null) return false;
- if (this._sequenceList != temp._sequenceList) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._sequenceList);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._sequenceList);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._sequenceList); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._sequenceList); };
- return false;
- }
- if (!thcycle) {
- if (!this._sequenceList.equals(temp._sequenceList)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._sequenceList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._sequenceList);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._sequenceList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._sequenceList);
- }
- }
- } else if (temp._sequenceList != null)
- return false;
- if (this._sequenceMappingList != null) {
- if (temp._sequenceMappingList == null) return false;
- if (this._sequenceMappingList != temp._sequenceMappingList) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._sequenceMappingList);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._sequenceMappingList);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._sequenceMappingList); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._sequenceMappingList); };
- return false;
- }
- if (!thcycle) {
- if (!this._sequenceMappingList.equals(temp._sequenceMappingList)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._sequenceMappingList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._sequenceMappingList);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._sequenceMappingList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._sequenceMappingList);
- }
- }
- } else if (temp._sequenceMappingList != null)
- return false;
- if (this._dataSetAnnotationsList != null) {
- if (temp._dataSetAnnotationsList == null) return false;
- if (this._dataSetAnnotationsList != temp._dataSetAnnotationsList) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._dataSetAnnotationsList);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._dataSetAnnotationsList);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._dataSetAnnotationsList); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._dataSetAnnotationsList); };
- return false;
- }
- if (!thcycle) {
- if (!this._dataSetAnnotationsList.equals(temp._dataSetAnnotationsList)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._dataSetAnnotationsList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._dataSetAnnotationsList);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._dataSetAnnotationsList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._dataSetAnnotationsList);
- }
- }
- } else if (temp._dataSetAnnotationsList != null)
- return false;
- if (this._alignmentList != null) {
- if (temp._alignmentList == null) return false;
- if (this._alignmentList != temp._alignmentList) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._alignmentList);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._alignmentList);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._alignmentList); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._alignmentList); };
- return false;
- }
- if (!thcycle) {
- if (!this._alignmentList.equals(temp._alignmentList)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._alignmentList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._alignmentList);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._alignmentList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._alignmentList);
- }
- }
- } else if (temp._alignmentList != null)
- return false;
- if (this._treeList != null) {
- if (temp._treeList == null) return false;
- if (this._treeList != temp._treeList) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._treeList);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._treeList);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._treeList); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._treeList); };
- return false;
- }
- if (!thcycle) {
- if (!this._treeList.equals(temp._treeList)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._treeList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._treeList);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._treeList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._treeList);
- }
- }
- } else if (temp._treeList != null)
- return false;
- if (this._provenance != null) {
- if (temp._provenance == null) return false;
- if (this._provenance != temp._provenance) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._provenance);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._provenance);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance); };
- return false;
- }
- if (!thcycle) {
- if (!this._provenance.equals(temp._provenance)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance);
- }
- }
- } else if (temp._provenance != null)
- return false;
- return true;
+ }
+ if (!thcycle) {
+ if (!this._id.equals(temp._id)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
+ }
}
+ } else if (temp._id != null)
return false;
- }
-
- /**
- * Method getAlignment.
- *
- * @param index
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- * @return the value of the uk.ac.vamsas.objects.core.Alignment
- * at the given index
- */
- public uk.ac.vamsas.objects.core.Alignment getAlignment(
- final int index)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._alignmentList.size()) {
- throw new IndexOutOfBoundsException("getAlignment: Index value '" + index + "' not in range [0.." + (this._alignmentList.size() - 1) + "]");
- }
-
- return (uk.ac.vamsas.objects.core.Alignment) _alignmentList.get(index);
- }
-
- /**
- * Method getAlignment.Returns the contents of the collection
- * in an Array.
Note: Just in case the collection contents
- * are changing in another thread, we pass a 0-length Array of
- * the correct type into the API call. This way we know
- * that the Array returned is of exactly the correct length.
- *
- * @return this collection as an Array
- */
- public uk.ac.vamsas.objects.core.Alignment[] getAlignment(
- ) {
- uk.ac.vamsas.objects.core.Alignment[] array = new uk.ac.vamsas.objects.core.Alignment[0];
- return (uk.ac.vamsas.objects.core.Alignment[]) this._alignmentList.toArray(array);
- }
-
- /**
- * Method getAlignmentAsReference.Returns a reference to
- * '_alignmentList'. No type checking is performed on any
- * modifications to the Vector.
- *
- * @return a reference to the Vector backing this class
- */
- public java.util.Vector getAlignmentAsReference(
- ) {
- return this._alignmentList;
- }
-
- /**
- * Method getAlignmentCount.
- *
- * @return the size of this collection
- */
- public int getAlignmentCount(
- ) {
- return this._alignmentList.size();
- }
-
- /**
- * Method getDataSetAnnotations.
- *
- * @param index
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- * @return the value of the
- * uk.ac.vamsas.objects.core.DataSetAnnotations at the given
- * index
- */
- public uk.ac.vamsas.objects.core.DataSetAnnotations getDataSetAnnotations(
- final int index)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._dataSetAnnotationsList.size()) {
- throw new IndexOutOfBoundsException("getDataSetAnnotations: Index value '" + index + "' not in range [0.." + (this._dataSetAnnotationsList.size() - 1) + "]");
- }
-
- return (uk.ac.vamsas.objects.core.DataSetAnnotations) _dataSetAnnotationsList.get(index);
- }
-
- /**
- * Method getDataSetAnnotations.Returns the contents of the
- * collection in an Array.
Note: Just in case the
- * collection contents are changing in another thread, we pass
- * a 0-length Array of the correct type into the API call.
- * This way we know that the Array returned is of
- * exactly the correct length.
- *
- * @return this collection as an Array
- */
- public uk.ac.vamsas.objects.core.DataSetAnnotations[] getDataSetAnnotations(
- ) {
- uk.ac.vamsas.objects.core.DataSetAnnotations[] array = new uk.ac.vamsas.objects.core.DataSetAnnotations[0];
- return (uk.ac.vamsas.objects.core.DataSetAnnotations[]) this._dataSetAnnotationsList.toArray(array);
- }
-
- /**
- * Method getDataSetAnnotationsAsReference.Returns a reference
- * to '_dataSetAnnotationsList'. No type checking is performed
- * on any modifications to the Vector.
- *
- * @return a reference to the Vector backing this class
- */
- public java.util.Vector getDataSetAnnotationsAsReference(
- ) {
- return this._dataSetAnnotationsList;
- }
-
- /**
- * Method getDataSetAnnotationsCount.
- *
- * @return the size of this collection
- */
- public int getDataSetAnnotationsCount(
- ) {
- return this._dataSetAnnotationsList.size();
- }
-
- /**
- * Returns the value of field 'id'. The field 'id' has the
- * following description: Primary Key for vamsas object
- * referencing
- *
- * @return the value of field 'Id'.
- */
- public java.lang.String getId(
- ) {
- return this._id;
- }
-
- /**
- * Returns the value of field 'provenance'.
- *
- * @return the value of field 'Provenance'.
- */
- public uk.ac.vamsas.objects.core.Provenance getProvenance(
- ) {
- return this._provenance;
- }
-
- /**
- * Method getSequence.
- *
- * @param index
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- * @return the value of the uk.ac.vamsas.objects.core.Sequence
- * at the given index
- */
- public uk.ac.vamsas.objects.core.Sequence getSequence(
- final int index)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._sequenceList.size()) {
- throw new IndexOutOfBoundsException("getSequence: Index value '" + index + "' not in range [0.." + (this._sequenceList.size() - 1) + "]");
- }
-
- return (uk.ac.vamsas.objects.core.Sequence) _sequenceList.get(index);
- }
-
- /**
- * Method getSequence.Returns the contents of the collection in
- * an Array.
Note: Just in case the collection contents
- * are changing in another thread, we pass a 0-length Array of
- * the correct type into the API call. This way we know
- * that the Array returned is of exactly the correct length.
- *
- * @return this collection as an Array
- */
- public uk.ac.vamsas.objects.core.Sequence[] getSequence(
- ) {
- uk.ac.vamsas.objects.core.Sequence[] array = new uk.ac.vamsas.objects.core.Sequence[0];
- return (uk.ac.vamsas.objects.core.Sequence[]) this._sequenceList.toArray(array);
- }
-
- /**
- * Method getSequenceAsReference.Returns a reference to
- * '_sequenceList'. No type checking is performed on any
- * modifications to the Vector.
- *
- * @return a reference to the Vector backing this class
- */
- public java.util.Vector getSequenceAsReference(
- ) {
- return this._sequenceList;
- }
-
- /**
- * Method getSequenceCount.
- *
- * @return the size of this collection
- */
- public int getSequenceCount(
- ) {
- return this._sequenceList.size();
- }
-
- /**
- * Method getSequenceMapping.
- *
- * @param index
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- * @return the value of the
- * uk.ac.vamsas.objects.core.SequenceMapping at the given index
- */
- public uk.ac.vamsas.objects.core.SequenceMapping getSequenceMapping(
- final int index)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._sequenceMappingList.size()) {
- throw new IndexOutOfBoundsException("getSequenceMapping: Index value '" + index + "' not in range [0.." + (this._sequenceMappingList.size() - 1) + "]");
- }
-
- return (uk.ac.vamsas.objects.core.SequenceMapping) _sequenceMappingList.get(index);
- }
-
- /**
- * Method getSequenceMapping.Returns the contents of the
- * collection in an Array.
Note: Just in case the
- * collection contents are changing in another thread, we pass
- * a 0-length Array of the correct type into the API call.
- * This way we know that the Array returned is of
- * exactly the correct length.
- *
- * @return this collection as an Array
- */
- public uk.ac.vamsas.objects.core.SequenceMapping[] getSequenceMapping(
- ) {
- uk.ac.vamsas.objects.core.SequenceMapping[] array = new uk.ac.vamsas.objects.core.SequenceMapping[0];
- return (uk.ac.vamsas.objects.core.SequenceMapping[]) this._sequenceMappingList.toArray(array);
- }
-
- /**
- * Method getSequenceMappingAsReference.Returns a reference to
- * '_sequenceMappingList'. No type checking is performed on any
- * modifications to the Vector.
- *
- * @return a reference to the Vector backing this class
- */
- public java.util.Vector getSequenceMappingAsReference(
- ) {
- return this._sequenceMappingList;
- }
-
- /**
- * Method getSequenceMappingCount.
- *
- * @return the size of this collection
- */
- public int getSequenceMappingCount(
- ) {
- return this._sequenceMappingList.size();
- }
-
- /**
- * Method getTree.
- *
- * @param index
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- * @return the value of the uk.ac.vamsas.objects.core.Tree at
- * the given index
- */
- public uk.ac.vamsas.objects.core.Tree getTree(
- final int index)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._treeList.size()) {
- throw new IndexOutOfBoundsException("getTree: Index value '" + index + "' not in range [0.." + (this._treeList.size() - 1) + "]");
- }
-
- return (uk.ac.vamsas.objects.core.Tree) _treeList.get(index);
- }
-
- /**
- * Method getTree.Returns the contents of the collection in an
- * Array.
Note: Just in case the collection contents are
- * changing in another thread, we pass a 0-length Array of the
- * correct type into the API call. This way we know
- * that the Array returned is of exactly the correct length.
- *
- * @return this collection as an Array
- */
- public uk.ac.vamsas.objects.core.Tree[] getTree(
- ) {
- uk.ac.vamsas.objects.core.Tree[] array = new uk.ac.vamsas.objects.core.Tree[0];
- return (uk.ac.vamsas.objects.core.Tree[]) this._treeList.toArray(array);
- }
-
- /**
- * Method getTreeAsReference.Returns a reference to
- * '_treeList'. No type checking is performed on any
- * modifications to the Vector.
- *
- * @return a reference to the Vector backing this class
- */
- public java.util.Vector getTreeAsReference(
- ) {
- return this._treeList;
- }
-
- /**
- * Method getTreeCount.
- *
- * @return the size of this collection
- */
- public int getTreeCount(
- ) {
- return this._treeList.size();
- }
-
- /**
- * Overrides the java.lang.Object.hashCode method.
- *
- * The following steps came from Effective Java Programming
- * Language Guide by Joshua Bloch, Chapter 3
- *
- * @return a hash code value for the object.
- */
- public int hashCode(
- ) {
- int result = super.hashCode();
-
- long tmp;
- if (_id != null
- && !org.castor.util.CycleBreaker.startingToCycle(_id)) {
- result = 37 * result + _id.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_id);
- }
- if (_sequenceList != null
- && !org.castor.util.CycleBreaker.startingToCycle(_sequenceList)) {
- result = 37 * result + _sequenceList.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_sequenceList);
- }
- if (_sequenceMappingList != null
- && !org.castor.util.CycleBreaker.startingToCycle(_sequenceMappingList)) {
- result = 37 * result + _sequenceMappingList.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_sequenceMappingList);
- }
- if (_dataSetAnnotationsList != null
- && !org.castor.util.CycleBreaker.startingToCycle(_dataSetAnnotationsList)) {
- result = 37 * result + _dataSetAnnotationsList.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_dataSetAnnotationsList);
- }
- if (_alignmentList != null
- && !org.castor.util.CycleBreaker.startingToCycle(_alignmentList)) {
- result = 37 * result + _alignmentList.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_alignmentList);
- }
- if (_treeList != null
- && !org.castor.util.CycleBreaker.startingToCycle(_treeList)) {
- result = 37 * result + _treeList.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_treeList);
- }
- if (_provenance != null
- && !org.castor.util.CycleBreaker.startingToCycle(_provenance)) {
- result = 37 * result + _provenance.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_provenance);
- }
-
- return result;
- }
-
- /**
- * Method isValid.
- *
- * @return true if this object is valid according to the schema
- */
- public boolean isValid(
- ) {
- try {
- validate();
- } catch (org.exolab.castor.xml.ValidationException vex) {
+ if (this._sequenceList != null) {
+ if (temp._sequenceList == null)
+ return false;
+ if (this._sequenceList != temp._sequenceList) {
+ thcycle = org.castor.util.CycleBreaker
+ .startingToCycle(this._sequenceList);
+ tmcycle = org.castor.util.CycleBreaker
+ .startingToCycle(temp._sequenceList);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(this._sequenceList);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(temp._sequenceList);
+ }
+ ;
return false;
+ }
+ if (!thcycle) {
+ if (!this._sequenceList.equals(temp._sequenceList)) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(this._sequenceList);
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(temp._sequenceList);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._sequenceList);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._sequenceList);
+ }
}
- return true;
- }
-
- /**
- *
- *
- * @param out
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void marshal(
- final java.io.Writer out)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, out);
- }
-
- /**
- *
- *
- * @param handler
- * @throws java.io.IOException if an IOException occurs during
- * marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- */
- public void marshal(
- final org.xml.sax.ContentHandler handler)
- throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, handler);
- }
-
- /**
- * Method removeAlignment.
- *
- * @param vAlignment
- * @return true if the object was removed from the collection.
- */
- public boolean removeAlignment(
- final uk.ac.vamsas.objects.core.Alignment vAlignment) {
- boolean removed = _alignmentList.remove(vAlignment);
- return removed;
- }
-
- /**
- * Method removeAlignmentAt.
- *
- * @param index
- * @return the element removed from the collection
- */
- public uk.ac.vamsas.objects.core.Alignment removeAlignmentAt(
- final int index) {
- java.lang.Object obj = this._alignmentList.remove(index);
- return (uk.ac.vamsas.objects.core.Alignment) obj;
- }
-
- /**
- */
- public void removeAllAlignment(
- ) {
- this._alignmentList.clear();
- }
-
- /**
- */
- public void removeAllDataSetAnnotations(
- ) {
- this._dataSetAnnotationsList.clear();
- }
-
- /**
- */
- public void removeAllSequence(
- ) {
- this._sequenceList.clear();
- }
-
- /**
- */
- public void removeAllSequenceMapping(
- ) {
- this._sequenceMappingList.clear();
- }
-
- /**
- */
- public void removeAllTree(
- ) {
- this._treeList.clear();
- }
-
- /**
- * Method removeDataSetAnnotations.
- *
- * @param vDataSetAnnotations
- * @return true if the object was removed from the collection.
- */
- public boolean removeDataSetAnnotations(
- final uk.ac.vamsas.objects.core.DataSetAnnotations vDataSetAnnotations) {
- boolean removed = _dataSetAnnotationsList.remove(vDataSetAnnotations);
- return removed;
- }
-
- /**
- * Method removeDataSetAnnotationsAt.
- *
- * @param index
- * @return the element removed from the collection
- */
- public uk.ac.vamsas.objects.core.DataSetAnnotations removeDataSetAnnotationsAt(
- final int index) {
- java.lang.Object obj = this._dataSetAnnotationsList.remove(index);
- return (uk.ac.vamsas.objects.core.DataSetAnnotations) obj;
- }
-
- /**
- * Method removeSequence.
- *
- * @param vSequence
- * @return true if the object was removed from the collection.
- */
- public boolean removeSequence(
- final uk.ac.vamsas.objects.core.Sequence vSequence) {
- boolean removed = _sequenceList.remove(vSequence);
- return removed;
- }
-
- /**
- * Method removeSequenceAt.
- *
- * @param index
- * @return the element removed from the collection
- */
- public uk.ac.vamsas.objects.core.Sequence removeSequenceAt(
- final int index) {
- java.lang.Object obj = this._sequenceList.remove(index);
- return (uk.ac.vamsas.objects.core.Sequence) obj;
- }
-
- /**
- * Method removeSequenceMapping.
- *
- * @param vSequenceMapping
- * @return true if the object was removed from the collection.
- */
- public boolean removeSequenceMapping(
- final uk.ac.vamsas.objects.core.SequenceMapping vSequenceMapping) {
- boolean removed = _sequenceMappingList.remove(vSequenceMapping);
- return removed;
- }
-
- /**
- * Method removeSequenceMappingAt.
- *
- * @param index
- * @return the element removed from the collection
- */
- public uk.ac.vamsas.objects.core.SequenceMapping removeSequenceMappingAt(
- final int index) {
- java.lang.Object obj = this._sequenceMappingList.remove(index);
- return (uk.ac.vamsas.objects.core.SequenceMapping) obj;
- }
-
- /**
- * Method removeTree.
- *
- * @param vTree
- * @return true if the object was removed from the collection.
- */
- public boolean removeTree(
- final uk.ac.vamsas.objects.core.Tree vTree) {
- boolean removed = _treeList.remove(vTree);
- return removed;
- }
-
- /**
- * Method removeTreeAt.
- *
- * @param index
- * @return the element removed from the collection
- */
- public uk.ac.vamsas.objects.core.Tree removeTreeAt(
- final int index) {
- java.lang.Object obj = this._treeList.remove(index);
- return (uk.ac.vamsas.objects.core.Tree) obj;
- }
-
- /**
- *
- *
- * @param index
- * @param vAlignment
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void setAlignment(
- final int index,
- final uk.ac.vamsas.objects.core.Alignment vAlignment)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._alignmentList.size()) {
- throw new IndexOutOfBoundsException("setAlignment: Index value '" + index + "' not in range [0.." + (this._alignmentList.size() - 1) + "]");
- }
-
- this._alignmentList.set(index, vAlignment);
- }
-
- /**
- *
- *
- * @param vAlignmentArray
- */
- public void setAlignment(
- final uk.ac.vamsas.objects.core.Alignment[] vAlignmentArray) {
- //-- copy array
- _alignmentList.clear();
-
- for (int i = 0; i < vAlignmentArray.length; i++) {
- this._alignmentList.add(vAlignmentArray[i]);
- }
- }
-
- /**
- * Sets the value of '_alignmentList' by copying the given
- * Vector. All elements will be checked for type safety.
- *
- * @param vAlignmentList the Vector to copy.
- */
- public void setAlignment(
- final java.util.Vector vAlignmentList) {
- // copy vector
- this._alignmentList.clear();
-
- this._alignmentList.addAll(vAlignmentList);
- }
-
- /**
- * Sets the value of '_alignmentList' by setting it to the
- * given Vector. No type checking is performed.
- * @deprecated
- *
- * @param alignmentVector the Vector to set.
- */
- public void setAlignmentAsReference(
- final java.util.Vector alignmentVector) {
- this._alignmentList = alignmentVector;
- }
-
- /**
- *
- *
- * @param index
- * @param vDataSetAnnotations
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void setDataSetAnnotations(
- final int index,
- final uk.ac.vamsas.objects.core.DataSetAnnotations vDataSetAnnotations)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._dataSetAnnotationsList.size()) {
- throw new IndexOutOfBoundsException("setDataSetAnnotations: Index value '" + index + "' not in range [0.." + (this._dataSetAnnotationsList.size() - 1) + "]");
- }
-
- this._dataSetAnnotationsList.set(index, vDataSetAnnotations);
- }
-
- /**
- *
- *
- * @param vDataSetAnnotationsArray
- */
- public void setDataSetAnnotations(
- final uk.ac.vamsas.objects.core.DataSetAnnotations[] vDataSetAnnotationsArray) {
- //-- copy array
- _dataSetAnnotationsList.clear();
-
- for (int i = 0; i < vDataSetAnnotationsArray.length; i++) {
- this._dataSetAnnotationsList.add(vDataSetAnnotationsArray[i]);
- }
- }
-
- /**
- * Sets the value of '_dataSetAnnotationsList' by copying the
- * given Vector. All elements will be checked for type safety.
- *
- * @param vDataSetAnnotationsList the Vector to copy.
- */
- public void setDataSetAnnotations(
- final java.util.Vector vDataSetAnnotationsList) {
- // copy vector
- this._dataSetAnnotationsList.clear();
-
- this._dataSetAnnotationsList.addAll(vDataSetAnnotationsList);
- }
-
- /**
- * Sets the value of '_dataSetAnnotationsList' by setting it to
- * the given Vector. No type checking is performed.
- * @deprecated
- *
- * @param dataSetAnnotationsVector the Vector to set.
- */
- public void setDataSetAnnotationsAsReference(
- final java.util.Vector dataSetAnnotationsVector) {
- this._dataSetAnnotationsList = dataSetAnnotationsVector;
- }
-
- /**
- * Sets the value of field 'id'. The field 'id' has the
- * following description: Primary Key for vamsas object
- * referencing
- *
- * @param id the value of field 'id'.
- */
- public void setId(
- final java.lang.String id) {
- this._id = id;
- }
-
- /**
- * Sets the value of field 'provenance'.
- *
- * @param provenance the value of field 'provenance'.
- */
- public void setProvenance(
- final uk.ac.vamsas.objects.core.Provenance provenance) {
- this._provenance = provenance;
- }
-
- /**
- *
- *
- * @param index
- * @param vSequence
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void setSequence(
- final int index,
- final uk.ac.vamsas.objects.core.Sequence vSequence)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._sequenceList.size()) {
- throw new IndexOutOfBoundsException("setSequence: Index value '" + index + "' not in range [0.." + (this._sequenceList.size() - 1) + "]");
- }
-
- this._sequenceList.set(index, vSequence);
- }
-
- /**
- *
- *
- * @param vSequenceArray
- */
- public void setSequence(
- final uk.ac.vamsas.objects.core.Sequence[] vSequenceArray) {
- //-- copy array
- _sequenceList.clear();
-
- for (int i = 0; i < vSequenceArray.length; i++) {
- this._sequenceList.add(vSequenceArray[i]);
+ } else if (temp._sequenceList != null)
+ return false;
+ if (this._sequenceMappingList != null) {
+ if (temp._sequenceMappingList == null)
+ return false;
+ if (this._sequenceMappingList != temp._sequenceMappingList) {
+ thcycle = org.castor.util.CycleBreaker
+ .startingToCycle(this._sequenceMappingList);
+ tmcycle = org.castor.util.CycleBreaker
+ .startingToCycle(temp._sequenceMappingList);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(this._sequenceMappingList);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(temp._sequenceMappingList);
+ }
+ ;
+ return false;
+ }
+ if (!thcycle) {
+ if (!this._sequenceMappingList.equals(temp._sequenceMappingList)) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(this._sequenceMappingList);
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(temp._sequenceMappingList);
+ return false;
+ }
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(this._sequenceMappingList);
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(temp._sequenceMappingList);
+ }
}
- }
-
- /**
- * Sets the value of '_sequenceList' by copying the given
- * Vector. All elements will be checked for type safety.
- *
- * @param vSequenceList the Vector to copy.
- */
- public void setSequence(
- final java.util.Vector vSequenceList) {
- // copy vector
- this._sequenceList.clear();
-
- this._sequenceList.addAll(vSequenceList);
- }
-
- /**
- * Sets the value of '_sequenceList' by setting it to the given
- * Vector. No type checking is performed.
- * @deprecated
- *
- * @param sequenceVector the Vector to set.
- */
- public void setSequenceAsReference(
- final java.util.Vector sequenceVector) {
- this._sequenceList = sequenceVector;
- }
-
- /**
- *
- *
- * @param index
- * @param vSequenceMapping
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void setSequenceMapping(
- final int index,
- final uk.ac.vamsas.objects.core.SequenceMapping vSequenceMapping)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._sequenceMappingList.size()) {
- throw new IndexOutOfBoundsException("setSequenceMapping: Index value '" + index + "' not in range [0.." + (this._sequenceMappingList.size() - 1) + "]");
+ } else if (temp._sequenceMappingList != null)
+ return false;
+ if (this._dataSetAnnotationsList != null) {
+ if (temp._dataSetAnnotationsList == null)
+ return false;
+ if (this._dataSetAnnotationsList != temp._dataSetAnnotationsList) {
+ thcycle = org.castor.util.CycleBreaker
+ .startingToCycle(this._dataSetAnnotationsList);
+ tmcycle = org.castor.util.CycleBreaker
+ .startingToCycle(temp._dataSetAnnotationsList);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(this._dataSetAnnotationsList);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(temp._dataSetAnnotationsList);
+ }
+ ;
+ return false;
+ }
+ if (!thcycle) {
+ if (!this._dataSetAnnotationsList
+ .equals(temp._dataSetAnnotationsList)) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(this._dataSetAnnotationsList);
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(temp._dataSetAnnotationsList);
+ return false;
+ }
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(this._dataSetAnnotationsList);
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(temp._dataSetAnnotationsList);
+ }
}
-
- this._sequenceMappingList.set(index, vSequenceMapping);
- }
-
- /**
- *
- *
- * @param vSequenceMappingArray
- */
- public void setSequenceMapping(
- final uk.ac.vamsas.objects.core.SequenceMapping[] vSequenceMappingArray) {
- //-- copy array
- _sequenceMappingList.clear();
-
- for (int i = 0; i < vSequenceMappingArray.length; i++) {
- this._sequenceMappingList.add(vSequenceMappingArray[i]);
+ } else if (temp._dataSetAnnotationsList != null)
+ return false;
+ if (this._alignmentList != null) {
+ if (temp._alignmentList == null)
+ return false;
+ if (this._alignmentList != temp._alignmentList) {
+ thcycle = org.castor.util.CycleBreaker
+ .startingToCycle(this._alignmentList);
+ tmcycle = org.castor.util.CycleBreaker
+ .startingToCycle(temp._alignmentList);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(this._alignmentList);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(temp._alignmentList);
+ }
+ ;
+ return false;
+ }
+ if (!thcycle) {
+ if (!this._alignmentList.equals(temp._alignmentList)) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(this._alignmentList);
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(temp._alignmentList);
+ return false;
+ }
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(this._alignmentList);
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(temp._alignmentList);
+ }
}
- }
-
- /**
- * Sets the value of '_sequenceMappingList' by copying the
- * given Vector. All elements will be checked for type safety.
- *
- * @param vSequenceMappingList the Vector to copy.
- */
- public void setSequenceMapping(
- final java.util.Vector vSequenceMappingList) {
- // copy vector
- this._sequenceMappingList.clear();
-
- this._sequenceMappingList.addAll(vSequenceMappingList);
- }
-
- /**
- * Sets the value of '_sequenceMappingList' by setting it to
- * the given Vector. No type checking is performed.
- * @deprecated
- *
- * @param sequenceMappingVector the Vector to set.
- */
- public void setSequenceMappingAsReference(
- final java.util.Vector sequenceMappingVector) {
- this._sequenceMappingList = sequenceMappingVector;
- }
-
- /**
- *
- *
- * @param index
- * @param vTree
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void setTree(
- final int index,
- final uk.ac.vamsas.objects.core.Tree vTree)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._treeList.size()) {
- throw new IndexOutOfBoundsException("setTree: Index value '" + index + "' not in range [0.." + (this._treeList.size() - 1) + "]");
+ } else if (temp._alignmentList != null)
+ return false;
+ if (this._treeList != null) {
+ if (temp._treeList == null)
+ return false;
+ if (this._treeList != temp._treeList) {
+ thcycle = org.castor.util.CycleBreaker
+ .startingToCycle(this._treeList);
+ tmcycle = org.castor.util.CycleBreaker
+ .startingToCycle(temp._treeList);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._treeList);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._treeList);
+ }
+ ;
+ return false;
+ }
+ if (!thcycle) {
+ if (!this._treeList.equals(temp._treeList)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._treeList);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._treeList);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._treeList);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._treeList);
+ }
}
-
- this._treeList.set(index, vTree);
- }
-
- /**
- *
- *
- * @param vTreeArray
- */
- public void setTree(
- final uk.ac.vamsas.objects.core.Tree[] vTreeArray) {
- //-- copy array
- _treeList.clear();
-
- for (int i = 0; i < vTreeArray.length; i++) {
- this._treeList.add(vTreeArray[i]);
+ } else if (temp._treeList != null)
+ return false;
+ if (this._provenance != null) {
+ if (temp._provenance == null)
+ return false;
+ if (this._provenance != temp._provenance) {
+ thcycle = org.castor.util.CycleBreaker
+ .startingToCycle(this._provenance);
+ tmcycle = org.castor.util.CycleBreaker
+ .startingToCycle(temp._provenance);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance);
+ }
+ ;
+ return false;
+ }
+ if (!thcycle) {
+ if (!this._provenance.equals(temp._provenance)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance);
+ }
}
- }
-
- /**
- * Sets the value of '_treeList' by copying the given Vector.
- * All elements will be checked for type safety.
- *
- * @param vTreeList the Vector to copy.
- */
- public void setTree(
- final java.util.Vector vTreeList) {
- // copy vector
- this._treeList.clear();
-
- this._treeList.addAll(vTreeList);
- }
-
- /**
- * Sets the value of '_treeList' by setting it to the given
- * Vector. No type checking is performed.
- * @deprecated
- *
- * @param treeVector the Vector to set.
- */
- public void setTreeAsReference(
- final java.util.Vector treeVector) {
- this._treeList = treeVector;
- }
-
- /**
- * Method unmarshal.
- *
- * @param reader
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @return the unmarshaled uk.ac.vamsas.objects.core.DataSet
- */
- public static uk.ac.vamsas.objects.core.DataSet unmarshal(
- final java.io.Reader reader)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- return (uk.ac.vamsas.objects.core.DataSet) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.DataSet.class, reader);
- }
-
- /**
- *
- *
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void validate(
- )
- throws org.exolab.castor.xml.ValidationException {
- org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
- validator.validate(this);
- }
+ } else if (temp._provenance != null)
+ return false;
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Method getAlignment.
+ *
+ * @param index
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ * @return the value of the uk.ac.vamsas.objects.core.Alignment at the given
+ * index
+ */
+ public uk.ac.vamsas.objects.core.Alignment getAlignment(final int index)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._alignmentList.size()) {
+ throw new IndexOutOfBoundsException("getAlignment: Index value '" + index
+ + "' not in range [0.." + (this._alignmentList.size() - 1) + "]");
+ }
+
+ return (uk.ac.vamsas.objects.core.Alignment) _alignmentList.get(index);
+ }
+
+ /**
+ * Method getAlignment.Returns the contents of the collection in an Array.
+ *
+ * Note: Just in case the collection contents are changing in another thread,
+ * we pass a 0-length Array of the correct type into the API call. This way we
+ * know that the Array returned is of exactly the correct length.
+ *
+ * @return this collection as an Array
+ */
+ public uk.ac.vamsas.objects.core.Alignment[] getAlignment() {
+ uk.ac.vamsas.objects.core.Alignment[] array = new uk.ac.vamsas.objects.core.Alignment[0];
+ return (uk.ac.vamsas.objects.core.Alignment[]) this._alignmentList
+ .toArray(array);
+ }
+
+ /**
+ * Method getAlignmentAsReference.Returns a reference to '_alignmentList'. No
+ * type checking is performed on any modifications to the Vector.
+ *
+ * @return a reference to the Vector backing this class
+ */
+ public java.util.Vector getAlignmentAsReference() {
+ return this._alignmentList;
+ }
+
+ /**
+ * Method getAlignmentCount.
+ *
+ * @return the size of this collection
+ */
+ public int getAlignmentCount() {
+ return this._alignmentList.size();
+ }
+
+ /**
+ * Method getDataSetAnnotations.
+ *
+ * @param index
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ * @return the value of the uk.ac.vamsas.objects.core.DataSetAnnotations at
+ * the given index
+ */
+ public uk.ac.vamsas.objects.core.DataSetAnnotations getDataSetAnnotations(
+ final int index) throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._dataSetAnnotationsList.size()) {
+ throw new IndexOutOfBoundsException(
+ "getDataSetAnnotations: Index value '" + index
+ + "' not in range [0.."
+ + (this._dataSetAnnotationsList.size() - 1) + "]");
+ }
+
+ return (uk.ac.vamsas.objects.core.DataSetAnnotations) _dataSetAnnotationsList
+ .get(index);
+ }
+
+ /**
+ * Method getDataSetAnnotations.Returns the contents of the collection in an
+ * Array.
+ *
+ * Note: Just in case the collection contents are changing in another thread,
+ * we pass a 0-length Array of the correct type into the API call. This way we
+ * know that the Array returned is of exactly the correct length.
+ *
+ * @return this collection as an Array
+ */
+ public uk.ac.vamsas.objects.core.DataSetAnnotations[] getDataSetAnnotations() {
+ uk.ac.vamsas.objects.core.DataSetAnnotations[] array = new uk.ac.vamsas.objects.core.DataSetAnnotations[0];
+ return (uk.ac.vamsas.objects.core.DataSetAnnotations[]) this._dataSetAnnotationsList
+ .toArray(array);
+ }
+
+ /**
+ * Method getDataSetAnnotationsAsReference.Returns a reference to
+ * '_dataSetAnnotationsList'. No type checking is performed on any
+ * modifications to the Vector.
+ *
+ * @return a reference to the Vector backing this class
+ */
+ public java.util.Vector getDataSetAnnotationsAsReference() {
+ return this._dataSetAnnotationsList;
+ }
+
+ /**
+ * Method getDataSetAnnotationsCount.
+ *
+ * @return the size of this collection
+ */
+ public int getDataSetAnnotationsCount() {
+ return this._dataSetAnnotationsList.size();
+ }
+
+ /**
+ * Returns the value of field 'id'. The field 'id' has the following
+ * description: Primary Key for vamsas object referencing
+ *
+ * @return the value of field 'Id'.
+ */
+ public java.lang.String getId() {
+ return this._id;
+ }
+
+ /**
+ * Returns the value of field 'provenance'.
+ *
+ * @return the value of field 'Provenance'.
+ */
+ public uk.ac.vamsas.objects.core.Provenance getProvenance() {
+ return this._provenance;
+ }
+
+ /**
+ * Method getSequence.
+ *
+ * @param index
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ * @return the value of the uk.ac.vamsas.objects.core.Sequence at the given
+ * index
+ */
+ public uk.ac.vamsas.objects.core.Sequence getSequence(final int index)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._sequenceList.size()) {
+ throw new IndexOutOfBoundsException("getSequence: Index value '" + index
+ + "' not in range [0.." + (this._sequenceList.size() - 1) + "]");
+ }
+
+ return (uk.ac.vamsas.objects.core.Sequence) _sequenceList.get(index);
+ }
+
+ /**
+ * Method getSequence.Returns the contents of the collection in an Array.
+ *
+ * Note: Just in case the collection contents are changing in another thread,
+ * we pass a 0-length Array of the correct type into the API call. This way we
+ * know that the Array returned is of exactly the correct length.
+ *
+ * @return this collection as an Array
+ */
+ public uk.ac.vamsas.objects.core.Sequence[] getSequence() {
+ uk.ac.vamsas.objects.core.Sequence[] array = new uk.ac.vamsas.objects.core.Sequence[0];
+ return (uk.ac.vamsas.objects.core.Sequence[]) this._sequenceList
+ .toArray(array);
+ }
+
+ /**
+ * Method getSequenceAsReference.Returns a reference to '_sequenceList'. No
+ * type checking is performed on any modifications to the Vector.
+ *
+ * @return a reference to the Vector backing this class
+ */
+ public java.util.Vector getSequenceAsReference() {
+ return this._sequenceList;
+ }
+
+ /**
+ * Method getSequenceCount.
+ *
+ * @return the size of this collection
+ */
+ public int getSequenceCount() {
+ return this._sequenceList.size();
+ }
+
+ /**
+ * Method getSequenceMapping.
+ *
+ * @param index
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ * @return the value of the uk.ac.vamsas.objects.core.SequenceMapping at the
+ * given index
+ */
+ public uk.ac.vamsas.objects.core.SequenceMapping getSequenceMapping(
+ final int index) throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._sequenceMappingList.size()) {
+ throw new IndexOutOfBoundsException("getSequenceMapping: Index value '"
+ + index + "' not in range [0.."
+ + (this._sequenceMappingList.size() - 1) + "]");
+ }
+
+ return (uk.ac.vamsas.objects.core.SequenceMapping) _sequenceMappingList
+ .get(index);
+ }
+
+ /**
+ * Method getSequenceMapping.Returns the contents of the collection in an
+ * Array.
+ *
+ * Note: Just in case the collection contents are changing in another thread,
+ * we pass a 0-length Array of the correct type into the API call. This way we
+ * know that the Array returned is of exactly the correct length.
+ *
+ * @return this collection as an Array
+ */
+ public uk.ac.vamsas.objects.core.SequenceMapping[] getSequenceMapping() {
+ uk.ac.vamsas.objects.core.SequenceMapping[] array = new uk.ac.vamsas.objects.core.SequenceMapping[0];
+ return (uk.ac.vamsas.objects.core.SequenceMapping[]) this._sequenceMappingList
+ .toArray(array);
+ }
+
+ /**
+ * Method getSequenceMappingAsReference.Returns a reference to
+ * '_sequenceMappingList'. No type checking is performed on any modifications
+ * to the Vector.
+ *
+ * @return a reference to the Vector backing this class
+ */
+ public java.util.Vector getSequenceMappingAsReference() {
+ return this._sequenceMappingList;
+ }
+
+ /**
+ * Method getSequenceMappingCount.
+ *
+ * @return the size of this collection
+ */
+ public int getSequenceMappingCount() {
+ return this._sequenceMappingList.size();
+ }
+
+ /**
+ * Method getTree.
+ *
+ * @param index
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ * @return the value of the uk.ac.vamsas.objects.core.Tree at the given index
+ */
+ public uk.ac.vamsas.objects.core.Tree getTree(final int index)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._treeList.size()) {
+ throw new IndexOutOfBoundsException("getTree: Index value '" + index
+ + "' not in range [0.." + (this._treeList.size() - 1) + "]");
+ }
+
+ return (uk.ac.vamsas.objects.core.Tree) _treeList.get(index);
+ }
+
+ /**
+ * Method getTree.Returns the contents of the collection in an Array.
+ *
+ * Note: Just in case the collection contents are changing in another thread,
+ * we pass a 0-length Array of the correct type into the API call. This way we
+ * know that the Array returned is of exactly the correct length.
+ *
+ * @return this collection as an Array
+ */
+ public uk.ac.vamsas.objects.core.Tree[] getTree() {
+ uk.ac.vamsas.objects.core.Tree[] array = new uk.ac.vamsas.objects.core.Tree[0];
+ return (uk.ac.vamsas.objects.core.Tree[]) this._treeList.toArray(array);
+ }
+
+ /**
+ * Method getTreeAsReference.Returns a reference to '_treeList'. No type
+ * checking is performed on any modifications to the Vector.
+ *
+ * @return a reference to the Vector backing this class
+ */
+ public java.util.Vector getTreeAsReference() {
+ return this._treeList;
+ }
+
+ /**
+ * Method getTreeCount.
+ *
+ * @return the size of this collection
+ */
+ public int getTreeCount() {
+ return this._treeList.size();
+ }
+
+ /**
+ * Overrides the java.lang.Object.hashCode method.
+ *
+ * The following steps came from Effective Java Programming Language
+ * Guide by Joshua Bloch, Chapter 3
+ *
+ * @return a hash code value for the object.
+ */
+ public int hashCode() {
+ int result = super.hashCode();
+
+ long tmp;
+ if (_id != null && !org.castor.util.CycleBreaker.startingToCycle(_id)) {
+ result = 37 * result + _id.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_id);
+ }
+ if (_sequenceList != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_sequenceList)) {
+ result = 37 * result + _sequenceList.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_sequenceList);
+ }
+ if (_sequenceMappingList != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_sequenceMappingList)) {
+ result = 37 * result + _sequenceMappingList.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_sequenceMappingList);
+ }
+ if (_dataSetAnnotationsList != null
+ && !org.castor.util.CycleBreaker
+ .startingToCycle(_dataSetAnnotationsList)) {
+ result = 37 * result + _dataSetAnnotationsList.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_dataSetAnnotationsList);
+ }
+ if (_alignmentList != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_alignmentList)) {
+ result = 37 * result + _alignmentList.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_alignmentList);
+ }
+ if (_treeList != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_treeList)) {
+ result = 37 * result + _treeList.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_treeList);
+ }
+ if (_provenance != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_provenance)) {
+ result = 37 * result + _provenance.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_provenance);
+ }
+
+ return result;
+ }
+
+ /**
+ * Method isValid.
+ *
+ * @return true if this object is valid according to the schema
+ */
+ public boolean isValid() {
+ try {
+ validate();
+ } catch (org.exolab.castor.xml.ValidationException vex) {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ *
+ *
+ * @param out
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void marshal(final java.io.Writer out)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, out);
+ }
+
+ /**
+ *
+ *
+ * @param handler
+ * @throws java.io.IOException
+ * if an IOException occurs during marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ */
+ public void marshal(final org.xml.sax.ContentHandler handler)
+ throws java.io.IOException, org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, handler);
+ }
+
+ /**
+ * Method removeAlignment.
+ *
+ * @param vAlignment
+ * @return true if the object was removed from the collection.
+ */
+ public boolean removeAlignment(
+ final uk.ac.vamsas.objects.core.Alignment vAlignment) {
+ boolean removed = _alignmentList.remove(vAlignment);
+ return removed;
+ }
+
+ /**
+ * Method removeAlignmentAt.
+ *
+ * @param index
+ * @return the element removed from the collection
+ */
+ public uk.ac.vamsas.objects.core.Alignment removeAlignmentAt(final int index) {
+ java.lang.Object obj = this._alignmentList.remove(index);
+ return (uk.ac.vamsas.objects.core.Alignment) obj;
+ }
+
+ /**
+ */
+ public void removeAllAlignment() {
+ this._alignmentList.clear();
+ }
+
+ /**
+ */
+ public void removeAllDataSetAnnotations() {
+ this._dataSetAnnotationsList.clear();
+ }
+
+ /**
+ */
+ public void removeAllSequence() {
+ this._sequenceList.clear();
+ }
+
+ /**
+ */
+ public void removeAllSequenceMapping() {
+ this._sequenceMappingList.clear();
+ }
+
+ /**
+ */
+ public void removeAllTree() {
+ this._treeList.clear();
+ }
+
+ /**
+ * Method removeDataSetAnnotations.
+ *
+ * @param vDataSetAnnotations
+ * @return true if the object was removed from the collection.
+ */
+ public boolean removeDataSetAnnotations(
+ final uk.ac.vamsas.objects.core.DataSetAnnotations vDataSetAnnotations) {
+ boolean removed = _dataSetAnnotationsList.remove(vDataSetAnnotations);
+ return removed;
+ }
+
+ /**
+ * Method removeDataSetAnnotationsAt.
+ *
+ * @param index
+ * @return the element removed from the collection
+ */
+ public uk.ac.vamsas.objects.core.DataSetAnnotations removeDataSetAnnotationsAt(
+ final int index) {
+ java.lang.Object obj = this._dataSetAnnotationsList.remove(index);
+ return (uk.ac.vamsas.objects.core.DataSetAnnotations) obj;
+ }
+
+ /**
+ * Method removeSequence.
+ *
+ * @param vSequence
+ * @return true if the object was removed from the collection.
+ */
+ public boolean removeSequence(
+ final uk.ac.vamsas.objects.core.Sequence vSequence) {
+ boolean removed = _sequenceList.remove(vSequence);
+ return removed;
+ }
+
+ /**
+ * Method removeSequenceAt.
+ *
+ * @param index
+ * @return the element removed from the collection
+ */
+ public uk.ac.vamsas.objects.core.Sequence removeSequenceAt(final int index) {
+ java.lang.Object obj = this._sequenceList.remove(index);
+ return (uk.ac.vamsas.objects.core.Sequence) obj;
+ }
+
+ /**
+ * Method removeSequenceMapping.
+ *
+ * @param vSequenceMapping
+ * @return true if the object was removed from the collection.
+ */
+ public boolean removeSequenceMapping(
+ final uk.ac.vamsas.objects.core.SequenceMapping vSequenceMapping) {
+ boolean removed = _sequenceMappingList.remove(vSequenceMapping);
+ return removed;
+ }
+
+ /**
+ * Method removeSequenceMappingAt.
+ *
+ * @param index
+ * @return the element removed from the collection
+ */
+ public uk.ac.vamsas.objects.core.SequenceMapping removeSequenceMappingAt(
+ final int index) {
+ java.lang.Object obj = this._sequenceMappingList.remove(index);
+ return (uk.ac.vamsas.objects.core.SequenceMapping) obj;
+ }
+
+ /**
+ * Method removeTree.
+ *
+ * @param vTree
+ * @return true if the object was removed from the collection.
+ */
+ public boolean removeTree(final uk.ac.vamsas.objects.core.Tree vTree) {
+ boolean removed = _treeList.remove(vTree);
+ return removed;
+ }
+
+ /**
+ * Method removeTreeAt.
+ *
+ * @param index
+ * @return the element removed from the collection
+ */
+ public uk.ac.vamsas.objects.core.Tree removeTreeAt(final int index) {
+ java.lang.Object obj = this._treeList.remove(index);
+ return (uk.ac.vamsas.objects.core.Tree) obj;
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vAlignment
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void setAlignment(final int index,
+ final uk.ac.vamsas.objects.core.Alignment vAlignment)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._alignmentList.size()) {
+ throw new IndexOutOfBoundsException("setAlignment: Index value '" + index
+ + "' not in range [0.." + (this._alignmentList.size() - 1) + "]");
+ }
+
+ this._alignmentList.set(index, vAlignment);
+ }
+
+ /**
+ *
+ *
+ * @param vAlignmentArray
+ */
+ public void setAlignment(
+ final uk.ac.vamsas.objects.core.Alignment[] vAlignmentArray) {
+ // -- copy array
+ _alignmentList.clear();
+
+ for (int i = 0; i < vAlignmentArray.length; i++) {
+ this._alignmentList.add(vAlignmentArray[i]);
+ }
+ }
+
+ /**
+ * Sets the value of '_alignmentList' by copying the given Vector. All
+ * elements will be checked for type safety.
+ *
+ * @param vAlignmentList
+ * the Vector to copy.
+ */
+ public void setAlignment(final java.util.Vector vAlignmentList) {
+ // copy vector
+ this._alignmentList.clear();
+
+ this._alignmentList.addAll(vAlignmentList);
+ }
+
+ /**
+ * Sets the value of '_alignmentList' by setting it to the given Vector. No
+ * type checking is performed.
+ *
+ * @deprecated
+ *
+ * @param alignmentVector
+ * the Vector to set.
+ */
+ public void setAlignmentAsReference(final java.util.Vector alignmentVector) {
+ this._alignmentList = alignmentVector;
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vDataSetAnnotations
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void setDataSetAnnotations(final int index,
+ final uk.ac.vamsas.objects.core.DataSetAnnotations vDataSetAnnotations)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._dataSetAnnotationsList.size()) {
+ throw new IndexOutOfBoundsException(
+ "setDataSetAnnotations: Index value '" + index
+ + "' not in range [0.."
+ + (this._dataSetAnnotationsList.size() - 1) + "]");
+ }
+
+ this._dataSetAnnotationsList.set(index, vDataSetAnnotations);
+ }
+
+ /**
+ *
+ *
+ * @param vDataSetAnnotationsArray
+ */
+ public void setDataSetAnnotations(
+ final uk.ac.vamsas.objects.core.DataSetAnnotations[] vDataSetAnnotationsArray) {
+ // -- copy array
+ _dataSetAnnotationsList.clear();
+
+ for (int i = 0; i < vDataSetAnnotationsArray.length; i++) {
+ this._dataSetAnnotationsList.add(vDataSetAnnotationsArray[i]);
+ }
+ }
+
+ /**
+ * Sets the value of '_dataSetAnnotationsList' by copying the given Vector.
+ * All elements will be checked for type safety.
+ *
+ * @param vDataSetAnnotationsList
+ * the Vector to copy.
+ */
+ public void setDataSetAnnotations(
+ final java.util.Vector vDataSetAnnotationsList) {
+ // copy vector
+ this._dataSetAnnotationsList.clear();
+
+ this._dataSetAnnotationsList.addAll(vDataSetAnnotationsList);
+ }
+
+ /**
+ * Sets the value of '_dataSetAnnotationsList' by setting it to the given
+ * Vector. No type checking is performed.
+ *
+ * @deprecated
+ *
+ * @param dataSetAnnotationsVector
+ * the Vector to set.
+ */
+ public void setDataSetAnnotationsAsReference(
+ final java.util.Vector dataSetAnnotationsVector) {
+ this._dataSetAnnotationsList = dataSetAnnotationsVector;
+ }
+
+ /**
+ * Sets the value of field 'id'. The field 'id' has the following description:
+ * Primary Key for vamsas object referencing
+ *
+ * @param id
+ * the value of field 'id'.
+ */
+ public void setId(final java.lang.String id) {
+ this._id = id;
+ }
+
+ /**
+ * Sets the value of field 'provenance'.
+ *
+ * @param provenance
+ * the value of field 'provenance'.
+ */
+ public void setProvenance(
+ final uk.ac.vamsas.objects.core.Provenance provenance) {
+ this._provenance = provenance;
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vSequence
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void setSequence(final int index,
+ final uk.ac.vamsas.objects.core.Sequence vSequence)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._sequenceList.size()) {
+ throw new IndexOutOfBoundsException("setSequence: Index value '" + index
+ + "' not in range [0.." + (this._sequenceList.size() - 1) + "]");
+ }
+
+ this._sequenceList.set(index, vSequence);
+ }
+
+ /**
+ *
+ *
+ * @param vSequenceArray
+ */
+ public void setSequence(
+ final uk.ac.vamsas.objects.core.Sequence[] vSequenceArray) {
+ // -- copy array
+ _sequenceList.clear();
+
+ for (int i = 0; i < vSequenceArray.length; i++) {
+ this._sequenceList.add(vSequenceArray[i]);
+ }
+ }
+
+ /**
+ * Sets the value of '_sequenceList' by copying the given Vector. All elements
+ * will be checked for type safety.
+ *
+ * @param vSequenceList
+ * the Vector to copy.
+ */
+ public void setSequence(final java.util.Vector vSequenceList) {
+ // copy vector
+ this._sequenceList.clear();
+
+ this._sequenceList.addAll(vSequenceList);
+ }
+
+ /**
+ * Sets the value of '_sequenceList' by setting it to the given Vector. No
+ * type checking is performed.
+ *
+ * @deprecated
+ *
+ * @param sequenceVector
+ * the Vector to set.
+ */
+ public void setSequenceAsReference(final java.util.Vector sequenceVector) {
+ this._sequenceList = sequenceVector;
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vSequenceMapping
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void setSequenceMapping(final int index,
+ final uk.ac.vamsas.objects.core.SequenceMapping vSequenceMapping)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._sequenceMappingList.size()) {
+ throw new IndexOutOfBoundsException("setSequenceMapping: Index value '"
+ + index + "' not in range [0.."
+ + (this._sequenceMappingList.size() - 1) + "]");
+ }
+
+ this._sequenceMappingList.set(index, vSequenceMapping);
+ }
+
+ /**
+ *
+ *
+ * @param vSequenceMappingArray
+ */
+ public void setSequenceMapping(
+ final uk.ac.vamsas.objects.core.SequenceMapping[] vSequenceMappingArray) {
+ // -- copy array
+ _sequenceMappingList.clear();
+
+ for (int i = 0; i < vSequenceMappingArray.length; i++) {
+ this._sequenceMappingList.add(vSequenceMappingArray[i]);
+ }
+ }
+
+ /**
+ * Sets the value of '_sequenceMappingList' by copying the given Vector. All
+ * elements will be checked for type safety.
+ *
+ * @param vSequenceMappingList
+ * the Vector to copy.
+ */
+ public void setSequenceMapping(final java.util.Vector vSequenceMappingList) {
+ // copy vector
+ this._sequenceMappingList.clear();
+
+ this._sequenceMappingList.addAll(vSequenceMappingList);
+ }
+
+ /**
+ * Sets the value of '_sequenceMappingList' by setting it to the given Vector.
+ * No type checking is performed.
+ *
+ * @deprecated
+ *
+ * @param sequenceMappingVector
+ * the Vector to set.
+ */
+ public void setSequenceMappingAsReference(
+ final java.util.Vector sequenceMappingVector) {
+ this._sequenceMappingList = sequenceMappingVector;
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vTree
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void setTree(final int index,
+ final uk.ac.vamsas.objects.core.Tree vTree)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._treeList.size()) {
+ throw new IndexOutOfBoundsException("setTree: Index value '" + index
+ + "' not in range [0.." + (this._treeList.size() - 1) + "]");
+ }
+
+ this._treeList.set(index, vTree);
+ }
+
+ /**
+ *
+ *
+ * @param vTreeArray
+ */
+ public void setTree(final uk.ac.vamsas.objects.core.Tree[] vTreeArray) {
+ // -- copy array
+ _treeList.clear();
+
+ for (int i = 0; i < vTreeArray.length; i++) {
+ this._treeList.add(vTreeArray[i]);
+ }
+ }
+
+ /**
+ * Sets the value of '_treeList' by copying the given Vector. All elements
+ * will be checked for type safety.
+ *
+ * @param vTreeList
+ * the Vector to copy.
+ */
+ public void setTree(final java.util.Vector vTreeList) {
+ // copy vector
+ this._treeList.clear();
+
+ this._treeList.addAll(vTreeList);
+ }
+
+ /**
+ * Sets the value of '_treeList' by setting it to the given Vector. No type
+ * checking is performed.
+ *
+ * @deprecated
+ *
+ * @param treeVector
+ * the Vector to set.
+ */
+ public void setTreeAsReference(final java.util.Vector treeVector) {
+ this._treeList = treeVector;
+ }
+
+ /**
+ * Method unmarshal.
+ *
+ * @param reader
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @return the unmarshaled uk.ac.vamsas.objects.core.DataSet
+ */
+ public static uk.ac.vamsas.objects.core.DataSet unmarshal(
+ final java.io.Reader reader)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ return (uk.ac.vamsas.objects.core.DataSet) Unmarshaller.unmarshal(
+ uk.ac.vamsas.objects.core.DataSet.class, reader);
+ }
+
+ /**
+ *
+ *
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void validate() throws org.exolab.castor.xml.ValidationException {
+ org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+ validator.validate(this);
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/DataSetAnnotations.java b/src/uk/ac/vamsas/objects/core/DataSetAnnotations.java
index 861f0fe..43bc9f9 100644
--- a/src/uk/ac/vamsas/objects/core/DataSetAnnotations.java
+++ b/src/uk/ac/vamsas/objects/core/DataSetAnnotations.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import org.exolab.castor.xml.Marshaller;
@@ -17,418 +31,418 @@ import org.exolab.castor.xml.Unmarshaller;
/**
* Class DataSetAnnotations.
*
- * @version $Revision$ $Date$
+ * @version $Revision$ $Date: 2007-06-28 14:51:44 +0100 (Thu, 28 Jun 2007)
+ * $
*/
-public class DataSetAnnotations extends uk.ac.vamsas.objects.core.RangeAnnotation
-implements java.io.Serializable
-{
-
-
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
- * annotation is associated with a
- * particular dataset sequence
- */
- private java.util.Vector _seqRef;
-
- /**
- * Field _provenance.
- */
- private uk.ac.vamsas.objects.core.Provenance _provenance;
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public DataSetAnnotations() {
- super();
- this._seqRef = new java.util.Vector();
- }
-
-
- //-----------/
- //- Methods -/
- //-----------/
-
- /**
- *
- *
- * @param vSeqRef
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addSeqRef(
- final java.lang.Object vSeqRef)
- throws java.lang.IndexOutOfBoundsException {
- this._seqRef.addElement(vSeqRef);
- }
-
- /**
- *
- *
- * @param index
- * @param vSeqRef
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addSeqRef(
- final int index,
- final java.lang.Object vSeqRef)
- throws java.lang.IndexOutOfBoundsException {
- this._seqRef.add(index, vSeqRef);
- }
-
- /**
- * Method enumerateSeqRef.
- *
- * @return an Enumeration over all java.lang.Object elements
- */
- public java.util.Enumeration enumerateSeqRef(
- ) {
- return this._seqRef.elements();
- }
-
- /**
- * Overrides the java.lang.Object.equals method.
- *
- * @param obj
- * @return true if the objects are equal.
- */
- public boolean equals(
- final java.lang.Object obj) {
- if ( this == obj )
- return true;
-
- if (super.equals(obj)==false)
+public class DataSetAnnotations extends
+ uk.ac.vamsas.objects.core.RangeAnnotation implements java.io.Serializable {
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * annotation is associated with a particular dataset sequence
+ */
+ private java.util.Vector _seqRef;
+
+ /**
+ * Field _provenance.
+ */
+ private uk.ac.vamsas.objects.core.Provenance _provenance;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public DataSetAnnotations() {
+ super();
+ this._seqRef = new java.util.Vector();
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ *
+ *
+ * @param vSeqRef
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addSeqRef(final java.lang.Object vSeqRef)
+ throws java.lang.IndexOutOfBoundsException {
+ this._seqRef.addElement(vSeqRef);
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vSeqRef
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addSeqRef(final int index, final java.lang.Object vSeqRef)
+ throws java.lang.IndexOutOfBoundsException {
+ this._seqRef.add(index, vSeqRef);
+ }
+
+ /**
+ * Method enumerateSeqRef.
+ *
+ * @return an Enumeration over all java.lang.Object elements
+ */
+ public java.util.Enumeration enumerateSeqRef() {
+ return this._seqRef.elements();
+ }
+
+ /**
+ * Overrides the java.lang.Object.equals method.
+ *
+ * @param obj
+ * @return true if the objects are equal.
+ */
+ public boolean equals(final java.lang.Object obj) {
+ if (this == obj)
+ return true;
+
+ if (super.equals(obj) == false)
+ return false;
+
+ if (obj instanceof DataSetAnnotations) {
+
+ DataSetAnnotations temp = (DataSetAnnotations) obj;
+ boolean thcycle;
+ boolean tmcycle;
+ if (this._seqRef != null) {
+ if (temp._seqRef == null)
+ return false;
+ if (this._seqRef != temp._seqRef) {
+ thcycle = org.castor.util.CycleBreaker.startingToCycle(this._seqRef);
+ tmcycle = org.castor.util.CycleBreaker.startingToCycle(temp._seqRef);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._seqRef);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._seqRef);
+ }
+ ;
return false;
-
- if (obj instanceof DataSetAnnotations) {
-
- DataSetAnnotations temp = (DataSetAnnotations)obj;
- boolean thcycle;
- boolean tmcycle;
- if (this._seqRef != null) {
- if (temp._seqRef == null) return false;
- if (this._seqRef != temp._seqRef) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._seqRef);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._seqRef);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._seqRef); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._seqRef); };
- return false;
- }
- if (!thcycle) {
- if (!this._seqRef.equals(temp._seqRef)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._seqRef);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._seqRef);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._seqRef);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._seqRef);
- }
- }
- } else if (temp._seqRef != null)
- return false;
- if (this._provenance != null) {
- if (temp._provenance == null) return false;
- if (this._provenance != temp._provenance) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._provenance);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._provenance);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance); };
- return false;
- }
- if (!thcycle) {
- if (!this._provenance.equals(temp._provenance)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance);
- }
- }
- } else if (temp._provenance != null)
- return false;
- return true;
+ }
+ if (!thcycle) {
+ if (!this._seqRef.equals(temp._seqRef)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._seqRef);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._seqRef);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._seqRef);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._seqRef);
+ }
}
+ } else if (temp._seqRef != null)
return false;
- }
-
- /**
- * Returns the value of field 'provenance'.
- *
- * @return the value of field 'Provenance'.
- */
- public uk.ac.vamsas.objects.core.Provenance getProvenance(
- ) {
- return this._provenance;
- }
-
- /**
- * Method getSeqRef.
- *
- * @param index
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- * @return the value of the java.lang.Object at the given index
- */
- public java.lang.Object getSeqRef(
- final int index)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._seqRef.size()) {
- throw new IndexOutOfBoundsException("getSeqRef: Index value '" + index + "' not in range [0.." + (this._seqRef.size() - 1) + "]");
- }
-
- return _seqRef.get(index);
- }
-
- /**
- * Method getSeqRef.Returns the contents of the collection in
- * an Array.
Note: Just in case the collection contents
- * are changing in another thread, we pass a 0-length Array of
- * the correct type into the API call. This way we know
- * that the Array returned is of exactly the correct length.
- *
- * @return this collection as an Array
- */
- public java.lang.Object[] getSeqRef(
- ) {
- java.lang.Object[] array = new java.lang.Object[0];
- return (java.lang.Object[]) this._seqRef.toArray(array);
- }
-
- /**
- * Method getSeqRefAsReference.Returns a reference to
- * '_seqRef'. No type checking is performed on any
- * modifications to the Vector.
- *
- * @return a reference to the Vector backing this class
- */
- public java.util.Vector getSeqRefAsReference(
- ) {
- return this._seqRef;
- }
-
- /**
- * Method getSeqRefCount.
- *
- * @return the size of this collection
- */
- public int getSeqRefCount(
- ) {
- return this._seqRef.size();
- }
-
- /**
- * Overrides the java.lang.Object.hashCode method.
- *
- * The following steps came from Effective Java Programming
- * Language Guide by Joshua Bloch, Chapter 3
- *
- * @return a hash code value for the object.
- */
- public int hashCode(
- ) {
- int result = super.hashCode();
-
- long tmp;
- if (_seqRef != null
- && !org.castor.util.CycleBreaker.startingToCycle(_seqRef)) {
- result = 37 * result + _seqRef.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_seqRef);
- }
- if (_provenance != null
- && !org.castor.util.CycleBreaker.startingToCycle(_provenance)) {
- result = 37 * result + _provenance.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_provenance);
- }
-
- return result;
- }
-
- /**
- * Method isValid.
- *
- * @return true if this object is valid according to the schema
- */
- public boolean isValid(
- ) {
- try {
- validate();
- } catch (org.exolab.castor.xml.ValidationException vex) {
+ if (this._provenance != null) {
+ if (temp._provenance == null)
+ return false;
+ if (this._provenance != temp._provenance) {
+ thcycle = org.castor.util.CycleBreaker
+ .startingToCycle(this._provenance);
+ tmcycle = org.castor.util.CycleBreaker
+ .startingToCycle(temp._provenance);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance);
+ }
+ ;
return false;
+ }
+ if (!thcycle) {
+ if (!this._provenance.equals(temp._provenance)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance);
+ }
}
- return true;
- }
-
- /**
- *
- *
- * @param out
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void marshal(
- final java.io.Writer out)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, out);
- }
-
- /**
- *
- *
- * @param handler
- * @throws java.io.IOException if an IOException occurs during
- * marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- */
- public void marshal(
- final org.xml.sax.ContentHandler handler)
- throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, handler);
- }
-
- /**
- */
- public void removeAllSeqRef(
- ) {
- this._seqRef.clear();
+ } else if (temp._provenance != null)
+ return false;
+ return true;
}
-
- /**
- * Method removeSeqRef.
- *
- * @param vSeqRef
- * @return true if the object was removed from the collection.
- */
- public boolean removeSeqRef(
- final java.lang.Object vSeqRef) {
- boolean removed = _seqRef.remove(vSeqRef);
- return removed;
+ return false;
+ }
+
+ /**
+ * Returns the value of field 'provenance'.
+ *
+ * @return the value of field 'Provenance'.
+ */
+ public uk.ac.vamsas.objects.core.Provenance getProvenance() {
+ return this._provenance;
+ }
+
+ /**
+ * Method getSeqRef.
+ *
+ * @param index
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ * @return the value of the java.lang.Object at the given index
+ */
+ public java.lang.Object getSeqRef(final int index)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._seqRef.size()) {
+ throw new IndexOutOfBoundsException("getSeqRef: Index value '" + index
+ + "' not in range [0.." + (this._seqRef.size() - 1) + "]");
}
- /**
- * Method removeSeqRefAt.
- *
- * @param index
- * @return the element removed from the collection
- */
- public java.lang.Object removeSeqRefAt(
- final int index) {
- java.lang.Object obj = this._seqRef.remove(index);
- return obj;
+ return _seqRef.get(index);
+ }
+
+ /**
+ * Method getSeqRef.Returns the contents of the collection in an Array.
+ *
+ * Note: Just in case the collection contents are changing in another thread,
+ * we pass a 0-length Array of the correct type into the API call. This way we
+ * know that the Array returned is of exactly the correct length.
+ *
+ * @return this collection as an Array
+ */
+ public java.lang.Object[] getSeqRef() {
+ java.lang.Object[] array = new java.lang.Object[0];
+ return (java.lang.Object[]) this._seqRef.toArray(array);
+ }
+
+ /**
+ * Method getSeqRefAsReference.Returns a reference to '_seqRef'. No type
+ * checking is performed on any modifications to the Vector.
+ *
+ * @return a reference to the Vector backing this class
+ */
+ public java.util.Vector getSeqRefAsReference() {
+ return this._seqRef;
+ }
+
+ /**
+ * Method getSeqRefCount.
+ *
+ * @return the size of this collection
+ */
+ public int getSeqRefCount() {
+ return this._seqRef.size();
+ }
+
+ /**
+ * Overrides the java.lang.Object.hashCode method.
+ *
+ * The following steps came from Effective Java Programming Language
+ * Guide by Joshua Bloch, Chapter 3
+ *
+ * @return a hash code value for the object.
+ */
+ public int hashCode() {
+ int result = super.hashCode();
+
+ long tmp;
+ if (_seqRef != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_seqRef)) {
+ result = 37 * result + _seqRef.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_seqRef);
}
-
- /**
- * Sets the value of field 'provenance'.
- *
- * @param provenance the value of field 'provenance'.
- */
- public void setProvenance(
- final uk.ac.vamsas.objects.core.Provenance provenance) {
- this._provenance = provenance;
+ if (_provenance != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_provenance)) {
+ result = 37 * result + _provenance.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_provenance);
}
- /**
- *
- *
- * @param index
- * @param vSeqRef
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void setSeqRef(
- final int index,
- final java.lang.Object vSeqRef)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._seqRef.size()) {
- throw new IndexOutOfBoundsException("setSeqRef: Index value '" + index + "' not in range [0.." + (this._seqRef.size() - 1) + "]");
- }
-
- this._seqRef.set(index, vSeqRef);
+ return result;
+ }
+
+ /**
+ * Method isValid.
+ *
+ * @return true if this object is valid according to the schema
+ */
+ public boolean isValid() {
+ try {
+ validate();
+ } catch (org.exolab.castor.xml.ValidationException vex) {
+ return false;
}
-
- /**
- *
- *
- * @param vSeqRefArray
+ return true;
+ }
+
+ /**
+ *
+ *
+ * @param out
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void marshal(final java.io.Writer out)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, out);
+ }
+
+ /**
+ *
+ *
+ * @param handler
+ * @throws java.io.IOException
+ * if an IOException occurs during marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ */
+ public void marshal(final org.xml.sax.ContentHandler handler)
+ throws java.io.IOException, org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, handler);
+ }
+
+ /**
*/
- public void setSeqRef(
- final java.lang.Object[] vSeqRefArray) {
- //-- copy array
- _seqRef.clear();
-
- for (int i = 0; i < vSeqRefArray.length; i++) {
- this._seqRef.add(vSeqRefArray[i]);
- }
+ public void removeAllSeqRef() {
+ this._seqRef.clear();
+ }
+
+ /**
+ * Method removeSeqRef.
+ *
+ * @param vSeqRef
+ * @return true if the object was removed from the collection.
+ */
+ public boolean removeSeqRef(final java.lang.Object vSeqRef) {
+ boolean removed = _seqRef.remove(vSeqRef);
+ return removed;
+ }
+
+ /**
+ * Method removeSeqRefAt.
+ *
+ * @param index
+ * @return the element removed from the collection
+ */
+ public java.lang.Object removeSeqRefAt(final int index) {
+ java.lang.Object obj = this._seqRef.remove(index);
+ return obj;
+ }
+
+ /**
+ * Sets the value of field 'provenance'.
+ *
+ * @param provenance
+ * the value of field 'provenance'.
+ */
+ public void setProvenance(
+ final uk.ac.vamsas.objects.core.Provenance provenance) {
+ this._provenance = provenance;
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vSeqRef
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void setSeqRef(final int index, final java.lang.Object vSeqRef)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._seqRef.size()) {
+ throw new IndexOutOfBoundsException("setSeqRef: Index value '" + index
+ + "' not in range [0.." + (this._seqRef.size() - 1) + "]");
}
- /**
- * Sets the value of '_seqRef' by copying the given Vector. All
- * elements will be checked for type safety.
- *
- * @param vSeqRefList the Vector to copy.
- */
- public void setSeqRef(
- final java.util.Vector vSeqRefList) {
- // copy vector
- this._seqRef.clear();
-
- this._seqRef.addAll(vSeqRefList);
- }
+ this._seqRef.set(index, vSeqRef);
+ }
- /**
- * Sets the value of '_seqRef' by setting it to the given
- * Vector. No type checking is performed.
- * @deprecated
- *
- * @param seqRefVector the Vector to set.
- */
- public void setSeqRefAsReference(
- final java.util.Vector seqRefVector) {
- this._seqRef = seqRefVector;
- }
+ /**
+ *
+ *
+ * @param vSeqRefArray
+ */
+ public void setSeqRef(final java.lang.Object[] vSeqRefArray) {
+ // -- copy array
+ _seqRef.clear();
- /**
- * Method unmarshal.
- *
- * @param reader
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @return the unmarshaled uk.ac.vamsas.objects.core.RangeType
- */
- public static uk.ac.vamsas.objects.core.RangeType unmarshal(
- final java.io.Reader reader)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- return (uk.ac.vamsas.objects.core.RangeType) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.DataSetAnnotations.class, reader);
- }
-
- /**
- *
- *
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void validate(
- )
- throws org.exolab.castor.xml.ValidationException {
- org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
- validator.validate(this);
+ for (int i = 0; i < vSeqRefArray.length; i++) {
+ this._seqRef.add(vSeqRefArray[i]);
}
+ }
+
+ /**
+ * Sets the value of '_seqRef' by copying the given Vector. All elements will
+ * be checked for type safety.
+ *
+ * @param vSeqRefList
+ * the Vector to copy.
+ */
+ public void setSeqRef(final java.util.Vector vSeqRefList) {
+ // copy vector
+ this._seqRef.clear();
+
+ this._seqRef.addAll(vSeqRefList);
+ }
+
+ /**
+ * Sets the value of '_seqRef' by setting it to the given Vector. No type
+ * checking is performed.
+ *
+ * @deprecated
+ *
+ * @param seqRefVector
+ * the Vector to set.
+ */
+ public void setSeqRefAsReference(final java.util.Vector seqRefVector) {
+ this._seqRef = seqRefVector;
+ }
+
+ /**
+ * Method unmarshal.
+ *
+ * @param reader
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @return the unmarshaled uk.ac.vamsas.objects.core.RangeType
+ */
+ public static uk.ac.vamsas.objects.core.RangeType unmarshal(
+ final java.io.Reader reader)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ return (uk.ac.vamsas.objects.core.RangeType) Unmarshaller.unmarshal(
+ uk.ac.vamsas.objects.core.DataSetAnnotations.class, reader);
+ }
+
+ /**
+ *
+ *
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void validate() throws org.exolab.castor.xml.ValidationException {
+ org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+ validator.validate(this);
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/DbRef.java b/src/uk/ac/vamsas/objects/core/DbRef.java
index 7206791..59905b0 100644
--- a/src/uk/ac/vamsas/objects/core/DbRef.java
+++ b/src/uk/ac/vamsas/objects/core/DbRef.java
@@ -1,1085 +1,1102 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import org.exolab.castor.xml.Marshaller;
import org.exolab.castor.xml.Unmarshaller;
/**
- * Store a list of database references
- * for this sequence record - with optional mapping
- * from database sequence to the given sequence record
+ * Store a list of database references for this sequence record - with optional
+ * mapping from database sequence to the given sequence record
*
- * @version $Revision$ $Date$
+ * @version $Revision$ $Date: 2007-06-29 13:23:12 +0100 (Fri, 29 Jun 2007)
+ * $
*/
-public class DbRef extends uk.ac.vamsas.client.Vobject
-implements java.io.Serializable
-{
-
-
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
- * TODO Database Naming
- * Convention: either start using LSID (so
- * change type to URI) or leave this as an
- * uncontrolled/unspecified string ID
- *
- */
- private java.lang.String _source;
-
- /**
- * Version must be specified -
- *
- */
- private java.lang.String _version;
-
- /**
- * TODO: make some specification
- * of the database field from which this
- * accessionId is taken from - should that be a
- * special property of the dbRef object ?
- *
- */
- private java.lang.String _accessionId;
-
- /**
- * Primary Key for vamsas object
- * referencing
- */
- private java.lang.String _id;
-
- /**
- * the local mapType maps from the parent
- * sequence coordinate frame to the reference
- * frame defined by the dbRef element.
- * The mapped mapType is the mapped range defined
- * on the dbRef element's reference frame.
- * Conventionally, the unit attribute defaults to 1, or
- * will be inferred from the local sequence's
- * dictionary type and any dictionary type associated
- * with the database being mapped to.
- * However, it may be used to avoid ambiguity.
- *
- */
- private java.util.Vector _mapList;
-
- /**
- * Field _linkList.
- */
- private java.util.Vector _linkList;
-
- /**
- * Field _propertyList.
- */
- private java.util.Vector _propertyList;
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public DbRef() {
- super();
- this._mapList = new java.util.Vector();
- this._linkList = new java.util.Vector();
- this._propertyList = new java.util.Vector();
- }
-
-
- //-----------/
- //- Methods -/
- //-----------/
-
- /**
- *
- *
- * @param vLink
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addLink(
- final uk.ac.vamsas.objects.core.Link vLink)
- throws java.lang.IndexOutOfBoundsException {
- this._linkList.addElement(vLink);
- }
-
- /**
- *
- *
- * @param index
- * @param vLink
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addLink(
- final int index,
- final uk.ac.vamsas.objects.core.Link vLink)
- throws java.lang.IndexOutOfBoundsException {
- this._linkList.add(index, vLink);
- }
-
- /**
- *
- *
- * @param vMap
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addMap(
- final uk.ac.vamsas.objects.core.Map vMap)
- throws java.lang.IndexOutOfBoundsException {
- this._mapList.addElement(vMap);
- }
-
- /**
- *
- *
- * @param index
- * @param vMap
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addMap(
- final int index,
- final uk.ac.vamsas.objects.core.Map vMap)
- throws java.lang.IndexOutOfBoundsException {
- this._mapList.add(index, vMap);
- }
-
- /**
- *
- *
- * @param vProperty
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addProperty(
- final uk.ac.vamsas.objects.core.Property vProperty)
- throws java.lang.IndexOutOfBoundsException {
- this._propertyList.addElement(vProperty);
- }
-
- /**
- *
- *
- * @param index
- * @param vProperty
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addProperty(
- final int index,
- final uk.ac.vamsas.objects.core.Property vProperty)
- throws java.lang.IndexOutOfBoundsException {
- this._propertyList.add(index, vProperty);
- }
-
- /**
- * Method enumerateLink.
- *
- * @return an Enumeration over all
- * uk.ac.vamsas.objects.core.Link elements
- */
- public java.util.Enumeration enumerateLink(
- ) {
- return this._linkList.elements();
- }
-
- /**
- * Method enumerateMap.
- *
- * @return an Enumeration over all
- * uk.ac.vamsas.objects.core.Map elements
- */
- public java.util.Enumeration enumerateMap(
- ) {
- return this._mapList.elements();
- }
-
- /**
- * Method enumerateProperty.
- *
- * @return an Enumeration over all
- * uk.ac.vamsas.objects.core.Property elements
- */
- public java.util.Enumeration enumerateProperty(
- ) {
- return this._propertyList.elements();
- }
-
- /**
- * Overrides the java.lang.Object.equals method.
- *
- * @param obj
- * @return true if the objects are equal.
- */
- public boolean equals(
- final java.lang.Object obj) {
- if ( this == obj )
- return true;
-
- if (super.equals(obj)==false)
+public class DbRef extends uk.ac.vamsas.client.Vobject implements
+ java.io.Serializable {
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * TODO Database Naming Convention: either start using LSID (so change type to
+ * URI) or leave this as an uncontrolled/unspecified string ID
+ *
+ */
+ private java.lang.String _source;
+
+ /**
+ * Version must be specified -
+ *
+ */
+ private java.lang.String _version;
+
+ /**
+ * TODO: make some specification of the database field from which this
+ * accessionId is taken from - should that be a special property of the dbRef
+ * object ?
+ *
+ */
+ private java.lang.String _accessionId;
+
+ /**
+ * Primary Key for vamsas object referencing
+ */
+ private java.lang.String _id;
+
+ /**
+ * the local mapType maps from the parent sequence coordinate frame to the
+ * reference frame defined by the dbRef element. The mapped mapType is the
+ * mapped range defined on the dbRef element's reference frame.
+ * Conventionally, the unit attribute defaults to 1, or will be inferred from
+ * the local sequence's dictionary type and any dictionary type associated
+ * with the database being mapped to. However, it may be used to avoid
+ * ambiguity.
+ *
+ */
+ private java.util.Vector _mapList;
+
+ /**
+ * Field _linkList.
+ */
+ private java.util.Vector _linkList;
+
+ /**
+ * Field _propertyList.
+ */
+ private java.util.Vector _propertyList;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public DbRef() {
+ super();
+ this._mapList = new java.util.Vector();
+ this._linkList = new java.util.Vector();
+ this._propertyList = new java.util.Vector();
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ *
+ *
+ * @param vLink
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addLink(final uk.ac.vamsas.objects.core.Link vLink)
+ throws java.lang.IndexOutOfBoundsException {
+ this._linkList.addElement(vLink);
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vLink
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addLink(final int index,
+ final uk.ac.vamsas.objects.core.Link vLink)
+ throws java.lang.IndexOutOfBoundsException {
+ this._linkList.add(index, vLink);
+ }
+
+ /**
+ *
+ *
+ * @param vMap
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addMap(final uk.ac.vamsas.objects.core.Map vMap)
+ throws java.lang.IndexOutOfBoundsException {
+ this._mapList.addElement(vMap);
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vMap
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addMap(final int index, final uk.ac.vamsas.objects.core.Map vMap)
+ throws java.lang.IndexOutOfBoundsException {
+ this._mapList.add(index, vMap);
+ }
+
+ /**
+ *
+ *
+ * @param vProperty
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addProperty(final uk.ac.vamsas.objects.core.Property vProperty)
+ throws java.lang.IndexOutOfBoundsException {
+ this._propertyList.addElement(vProperty);
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vProperty
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addProperty(final int index,
+ final uk.ac.vamsas.objects.core.Property vProperty)
+ throws java.lang.IndexOutOfBoundsException {
+ this._propertyList.add(index, vProperty);
+ }
+
+ /**
+ * Method enumerateLink.
+ *
+ * @return an Enumeration over all uk.ac.vamsas.objects.core.Link elements
+ */
+ public java.util.Enumeration enumerateLink() {
+ return this._linkList.elements();
+ }
+
+ /**
+ * Method enumerateMap.
+ *
+ * @return an Enumeration over all uk.ac.vamsas.objects.core.Map elements
+ */
+ public java.util.Enumeration enumerateMap() {
+ return this._mapList.elements();
+ }
+
+ /**
+ * Method enumerateProperty.
+ *
+ * @return an Enumeration over all uk.ac.vamsas.objects.core.Property elements
+ */
+ public java.util.Enumeration enumerateProperty() {
+ return this._propertyList.elements();
+ }
+
+ /**
+ * Overrides the java.lang.Object.equals method.
+ *
+ * @param obj
+ * @return true if the objects are equal.
+ */
+ public boolean equals(final java.lang.Object obj) {
+ if (this == obj)
+ return true;
+
+ if (super.equals(obj) == false)
+ return false;
+
+ if (obj instanceof DbRef) {
+
+ DbRef temp = (DbRef) obj;
+ boolean thcycle;
+ boolean tmcycle;
+ if (this._source != null) {
+ if (temp._source == null)
+ return false;
+ if (this._source != temp._source) {
+ thcycle = org.castor.util.CycleBreaker.startingToCycle(this._source);
+ tmcycle = org.castor.util.CycleBreaker.startingToCycle(temp._source);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._source);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._source);
+ }
+ ;
return false;
-
- if (obj instanceof DbRef) {
-
- DbRef temp = (DbRef)obj;
- boolean thcycle;
- boolean tmcycle;
- if (this._source != null) {
- if (temp._source == null) return false;
- if (this._source != temp._source) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._source);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._source);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._source); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._source); };
- return false;
- }
- if (!thcycle) {
- if (!this._source.equals(temp._source)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._source);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._source);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._source);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._source);
- }
- }
- } else if (temp._source != null)
- return false;
- if (this._version != null) {
- if (temp._version == null) return false;
- if (this._version != temp._version) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._version);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._version);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._version); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._version); };
- return false;
- }
- if (!thcycle) {
- if (!this._version.equals(temp._version)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._version);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._version);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._version);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._version);
- }
- }
- } else if (temp._version != null)
- return false;
- if (this._accessionId != null) {
- if (temp._accessionId == null) return false;
- if (this._accessionId != temp._accessionId) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._accessionId);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._accessionId);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._accessionId); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._accessionId); };
- return false;
- }
- if (!thcycle) {
- if (!this._accessionId.equals(temp._accessionId)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._accessionId);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._accessionId);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._accessionId);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._accessionId);
- }
- }
- } else if (temp._accessionId != null)
- return false;
- if (this._id != null) {
- if (temp._id == null) return false;
- if (this._id != temp._id) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._id);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._id);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._id); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._id); };
- return false;
- }
- if (!thcycle) {
- if (!this._id.equals(temp._id)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
- }
- }
- } else if (temp._id != null)
- return false;
- if (this._mapList != null) {
- if (temp._mapList == null) return false;
- if (this._mapList != temp._mapList) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._mapList);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._mapList);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._mapList); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._mapList); };
- return false;
- }
- if (!thcycle) {
- if (!this._mapList.equals(temp._mapList)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._mapList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._mapList);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._mapList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._mapList);
- }
- }
- } else if (temp._mapList != null)
- return false;
- if (this._linkList != null) {
- if (temp._linkList == null) return false;
- if (this._linkList != temp._linkList) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._linkList);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._linkList);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._linkList); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._linkList); };
- return false;
- }
- if (!thcycle) {
- if (!this._linkList.equals(temp._linkList)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._linkList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._linkList);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._linkList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._linkList);
- }
- }
- } else if (temp._linkList != null)
- return false;
- if (this._propertyList != null) {
- if (temp._propertyList == null) return false;
- if (this._propertyList != temp._propertyList) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._propertyList);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._propertyList);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._propertyList); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._propertyList); };
- return false;
- }
- if (!thcycle) {
- if (!this._propertyList.equals(temp._propertyList)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._propertyList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._propertyList);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._propertyList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._propertyList);
- }
- }
- } else if (temp._propertyList != null)
- return false;
- return true;
+ }
+ if (!thcycle) {
+ if (!this._source.equals(temp._source)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._source);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._source);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._source);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._source);
+ }
}
+ } else if (temp._source != null)
return false;
- }
-
- /**
- * Returns the value of field 'accessionId'. The field
- * 'accessionId' has the following description: TODO: make some
- * specification
- * of the database field from which this
- * accessionId is taken from - should that be a
- * special property of the dbRef object ?
- *
- *
- * @return the value of field 'AccessionId'.
- */
- public java.lang.String getAccessionId(
- ) {
- return this._accessionId;
- }
-
- /**
- * Returns the value of field 'id'. The field 'id' has the
- * following description: Primary Key for vamsas object
- * referencing
- *
- * @return the value of field 'Id'.
- */
- public java.lang.String getId(
- ) {
- return this._id;
- }
-
- /**
- * Method getLink.
- *
- * @param index
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- * @return the value of the uk.ac.vamsas.objects.core.Link at
- * the given index
- */
- public uk.ac.vamsas.objects.core.Link getLink(
- final int index)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._linkList.size()) {
- throw new IndexOutOfBoundsException("getLink: Index value '" + index + "' not in range [0.." + (this._linkList.size() - 1) + "]");
- }
-
- return (uk.ac.vamsas.objects.core.Link) _linkList.get(index);
- }
-
- /**
- * Method getLink.Returns the contents of the collection in an
- * Array.
Note: Just in case the collection contents are
- * changing in another thread, we pass a 0-length Array of the
- * correct type into the API call. This way we know
- * that the Array returned is of exactly the correct length.
- *
- * @return this collection as an Array
- */
- public uk.ac.vamsas.objects.core.Link[] getLink(
- ) {
- uk.ac.vamsas.objects.core.Link[] array = new uk.ac.vamsas.objects.core.Link[0];
- return (uk.ac.vamsas.objects.core.Link[]) this._linkList.toArray(array);
- }
-
- /**
- * Method getLinkAsReference.Returns a reference to
- * '_linkList'. No type checking is performed on any
- * modifications to the Vector.
- *
- * @return a reference to the Vector backing this class
- */
- public java.util.Vector getLinkAsReference(
- ) {
- return this._linkList;
- }
-
- /**
- * Method getLinkCount.
- *
- * @return the size of this collection
- */
- public int getLinkCount(
- ) {
- return this._linkList.size();
- }
-
- /**
- * Method getMap.
- *
- * @param index
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- * @return the value of the uk.ac.vamsas.objects.core.Map at
- * the given index
- */
- public uk.ac.vamsas.objects.core.Map getMap(
- final int index)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._mapList.size()) {
- throw new IndexOutOfBoundsException("getMap: Index value '" + index + "' not in range [0.." + (this._mapList.size() - 1) + "]");
- }
-
- return (uk.ac.vamsas.objects.core.Map) _mapList.get(index);
- }
-
- /**
- * Method getMap.Returns the contents of the collection in an
- * Array.
Note: Just in case the collection contents are
- * changing in another thread, we pass a 0-length Array of the
- * correct type into the API call. This way we know
- * that the Array returned is of exactly the correct length.
- *
- * @return this collection as an Array
- */
- public uk.ac.vamsas.objects.core.Map[] getMap(
- ) {
- uk.ac.vamsas.objects.core.Map[] array = new uk.ac.vamsas.objects.core.Map[0];
- return (uk.ac.vamsas.objects.core.Map[]) this._mapList.toArray(array);
- }
-
- /**
- * Method getMapAsReference.Returns a reference to '_mapList'.
- * No type checking is performed on any modifications to the
- * Vector.
- *
- * @return a reference to the Vector backing this class
- */
- public java.util.Vector getMapAsReference(
- ) {
- return this._mapList;
- }
-
- /**
- * Method getMapCount.
- *
- * @return the size of this collection
- */
- public int getMapCount(
- ) {
- return this._mapList.size();
- }
-
- /**
- * Method getProperty.
- *
- * @param index
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- * @return the value of the uk.ac.vamsas.objects.core.Property
- * at the given index
- */
- public uk.ac.vamsas.objects.core.Property getProperty(
- final int index)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._propertyList.size()) {
- throw new IndexOutOfBoundsException("getProperty: Index value '" + index + "' not in range [0.." + (this._propertyList.size() - 1) + "]");
- }
-
- return (uk.ac.vamsas.objects.core.Property) _propertyList.get(index);
- }
-
- /**
- * Method getProperty.Returns the contents of the collection in
- * an Array.
Note: Just in case the collection contents
- * are changing in another thread, we pass a 0-length Array of
- * the correct type into the API call. This way we know
- * that the Array returned is of exactly the correct length.
- *
- * @return this collection as an Array
- */
- public uk.ac.vamsas.objects.core.Property[] getProperty(
- ) {
- uk.ac.vamsas.objects.core.Property[] array = new uk.ac.vamsas.objects.core.Property[0];
- return (uk.ac.vamsas.objects.core.Property[]) this._propertyList.toArray(array);
- }
-
- /**
- * Method getPropertyAsReference.Returns a reference to
- * '_propertyList'. No type checking is performed on any
- * modifications to the Vector.
- *
- * @return a reference to the Vector backing this class
- */
- public java.util.Vector getPropertyAsReference(
- ) {
- return this._propertyList;
- }
-
- /**
- * Method getPropertyCount.
- *
- * @return the size of this collection
- */
- public int getPropertyCount(
- ) {
- return this._propertyList.size();
- }
-
- /**
- * Returns the value of field 'source'. The field 'source' has
- * the following description: TODO Database Naming
- * Convention: either start using LSID (so
- * change type to URI) or leave this as an
- * uncontrolled/unspecified string ID
- *
- *
- * @return the value of field 'Source'.
- */
- public java.lang.String getSource(
- ) {
- return this._source;
- }
-
- /**
- * Returns the value of field 'version'. The field 'version'
- * has the following description: Version must be specified -
- *
- *
- * @return the value of field 'Version'.
- */
- public java.lang.String getVersion(
- ) {
- return this._version;
- }
-
- /**
- * Overrides the java.lang.Object.hashCode method.
- *
- * The following steps came from Effective Java Programming
- * Language Guide by Joshua Bloch, Chapter 3
- *
- * @return a hash code value for the object.
- */
- public int hashCode(
- ) {
- int result = super.hashCode();
-
- long tmp;
- if (_source != null
- && !org.castor.util.CycleBreaker.startingToCycle(_source)) {
- result = 37 * result + _source.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_source);
- }
- if (_version != null
- && !org.castor.util.CycleBreaker.startingToCycle(_version)) {
- result = 37 * result + _version.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_version);
- }
- if (_accessionId != null
- && !org.castor.util.CycleBreaker.startingToCycle(_accessionId)) {
- result = 37 * result + _accessionId.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_accessionId);
+ if (this._version != null) {
+ if (temp._version == null)
+ return false;
+ if (this._version != temp._version) {
+ thcycle = org.castor.util.CycleBreaker.startingToCycle(this._version);
+ tmcycle = org.castor.util.CycleBreaker.startingToCycle(temp._version);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._version);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._version);
+ }
+ ;
+ return false;
+ }
+ if (!thcycle) {
+ if (!this._version.equals(temp._version)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._version);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._version);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._version);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._version);
+ }
}
- if (_id != null
- && !org.castor.util.CycleBreaker.startingToCycle(_id)) {
- result = 37 * result + _id.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_id);
+ } else if (temp._version != null)
+ return false;
+ if (this._accessionId != null) {
+ if (temp._accessionId == null)
+ return false;
+ if (this._accessionId != temp._accessionId) {
+ thcycle = org.castor.util.CycleBreaker
+ .startingToCycle(this._accessionId);
+ tmcycle = org.castor.util.CycleBreaker
+ .startingToCycle(temp._accessionId);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(this._accessionId);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(temp._accessionId);
+ }
+ ;
+ return false;
+ }
+ if (!thcycle) {
+ if (!this._accessionId.equals(temp._accessionId)) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(this._accessionId);
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(temp._accessionId);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._accessionId);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._accessionId);
+ }
}
- if (_mapList != null
- && !org.castor.util.CycleBreaker.startingToCycle(_mapList)) {
- result = 37 * result + _mapList.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_mapList);
+ } else if (temp._accessionId != null)
+ return false;
+ if (this._id != null) {
+ if (temp._id == null)
+ return false;
+ if (this._id != temp._id) {
+ thcycle = org.castor.util.CycleBreaker.startingToCycle(this._id);
+ tmcycle = org.castor.util.CycleBreaker.startingToCycle(temp._id);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
+ }
+ ;
+ return false;
+ }
+ if (!thcycle) {
+ if (!this._id.equals(temp._id)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
+ }
}
- if (_linkList != null
- && !org.castor.util.CycleBreaker.startingToCycle(_linkList)) {
- result = 37 * result + _linkList.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_linkList);
+ } else if (temp._id != null)
+ return false;
+ if (this._mapList != null) {
+ if (temp._mapList == null)
+ return false;
+ if (this._mapList != temp._mapList) {
+ thcycle = org.castor.util.CycleBreaker.startingToCycle(this._mapList);
+ tmcycle = org.castor.util.CycleBreaker.startingToCycle(temp._mapList);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._mapList);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._mapList);
+ }
+ ;
+ return false;
+ }
+ if (!thcycle) {
+ if (!this._mapList.equals(temp._mapList)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._mapList);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._mapList);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._mapList);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._mapList);
+ }
}
- if (_propertyList != null
- && !org.castor.util.CycleBreaker.startingToCycle(_propertyList)) {
- result = 37 * result + _propertyList.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_propertyList);
+ } else if (temp._mapList != null)
+ return false;
+ if (this._linkList != null) {
+ if (temp._linkList == null)
+ return false;
+ if (this._linkList != temp._linkList) {
+ thcycle = org.castor.util.CycleBreaker
+ .startingToCycle(this._linkList);
+ tmcycle = org.castor.util.CycleBreaker
+ .startingToCycle(temp._linkList);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._linkList);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._linkList);
+ }
+ ;
+ return false;
+ }
+ if (!thcycle) {
+ if (!this._linkList.equals(temp._linkList)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._linkList);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._linkList);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._linkList);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._linkList);
+ }
}
-
- return result;
- }
-
- /**
- * Method isValid.
- *
- * @return true if this object is valid according to the schema
- */
- public boolean isValid(
- ) {
- try {
- validate();
- } catch (org.exolab.castor.xml.ValidationException vex) {
+ } else if (temp._linkList != null)
+ return false;
+ if (this._propertyList != null) {
+ if (temp._propertyList == null)
+ return false;
+ if (this._propertyList != temp._propertyList) {
+ thcycle = org.castor.util.CycleBreaker
+ .startingToCycle(this._propertyList);
+ tmcycle = org.castor.util.CycleBreaker
+ .startingToCycle(temp._propertyList);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(this._propertyList);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(temp._propertyList);
+ }
+ ;
return false;
+ }
+ if (!thcycle) {
+ if (!this._propertyList.equals(temp._propertyList)) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(this._propertyList);
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(temp._propertyList);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._propertyList);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._propertyList);
+ }
}
- return true;
- }
-
- /**
- *
- *
- * @param out
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void marshal(
- final java.io.Writer out)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, out);
- }
-
- /**
- *
- *
- * @param handler
- * @throws java.io.IOException if an IOException occurs during
- * marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- */
- public void marshal(
- final org.xml.sax.ContentHandler handler)
- throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, handler);
- }
-
- /**
- */
- public void removeAllLink(
- ) {
- this._linkList.clear();
- }
-
- /**
- */
- public void removeAllMap(
- ) {
- this._mapList.clear();
- }
-
- /**
- */
- public void removeAllProperty(
- ) {
- this._propertyList.clear();
- }
-
- /**
- * Method removeLink.
- *
- * @param vLink
- * @return true if the object was removed from the collection.
- */
- public boolean removeLink(
- final uk.ac.vamsas.objects.core.Link vLink) {
- boolean removed = _linkList.remove(vLink);
- return removed;
- }
-
- /**
- * Method removeLinkAt.
- *
- * @param index
- * @return the element removed from the collection
- */
- public uk.ac.vamsas.objects.core.Link removeLinkAt(
- final int index) {
- java.lang.Object obj = this._linkList.remove(index);
- return (uk.ac.vamsas.objects.core.Link) obj;
+ } else if (temp._propertyList != null)
+ return false;
+ return true;
}
-
- /**
- * Method removeMap.
- *
- * @param vMap
- * @return true if the object was removed from the collection.
- */
- public boolean removeMap(
- final uk.ac.vamsas.objects.core.Map vMap) {
- boolean removed = _mapList.remove(vMap);
- return removed;
+ return false;
+ }
+
+ /**
+ * Returns the value of field 'accessionId'. The field 'accessionId' has the
+ * following description: TODO: make some specification of the database field
+ * from which this accessionId is taken from - should that be a special
+ * property of the dbRef object ?
+ *
+ *
+ * @return the value of field 'AccessionId'.
+ */
+ public java.lang.String getAccessionId() {
+ return this._accessionId;
+ }
+
+ /**
+ * Returns the value of field 'id'. The field 'id' has the following
+ * description: Primary Key for vamsas object referencing
+ *
+ * @return the value of field 'Id'.
+ */
+ public java.lang.String getId() {
+ return this._id;
+ }
+
+ /**
+ * Method getLink.
+ *
+ * @param index
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ * @return the value of the uk.ac.vamsas.objects.core.Link at the given index
+ */
+ public uk.ac.vamsas.objects.core.Link getLink(final int index)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._linkList.size()) {
+ throw new IndexOutOfBoundsException("getLink: Index value '" + index
+ + "' not in range [0.." + (this._linkList.size() - 1) + "]");
}
- /**
- * Method removeMapAt.
- *
- * @param index
- * @return the element removed from the collection
- */
- public uk.ac.vamsas.objects.core.Map removeMapAt(
- final int index) {
- java.lang.Object obj = this._mapList.remove(index);
- return (uk.ac.vamsas.objects.core.Map) obj;
+ return (uk.ac.vamsas.objects.core.Link) _linkList.get(index);
+ }
+
+ /**
+ * Method getLink.Returns the contents of the collection in an Array.
+ *
+ * Note: Just in case the collection contents are changing in another thread,
+ * we pass a 0-length Array of the correct type into the API call. This way we
+ * know that the Array returned is of exactly the correct length.
+ *
+ * @return this collection as an Array
+ */
+ public uk.ac.vamsas.objects.core.Link[] getLink() {
+ uk.ac.vamsas.objects.core.Link[] array = new uk.ac.vamsas.objects.core.Link[0];
+ return (uk.ac.vamsas.objects.core.Link[]) this._linkList.toArray(array);
+ }
+
+ /**
+ * Method getLinkAsReference.Returns a reference to '_linkList'. No type
+ * checking is performed on any modifications to the Vector.
+ *
+ * @return a reference to the Vector backing this class
+ */
+ public java.util.Vector getLinkAsReference() {
+ return this._linkList;
+ }
+
+ /**
+ * Method getLinkCount.
+ *
+ * @return the size of this collection
+ */
+ public int getLinkCount() {
+ return this._linkList.size();
+ }
+
+ /**
+ * Method getMap.
+ *
+ * @param index
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ * @return the value of the uk.ac.vamsas.objects.core.Map at the given index
+ */
+ public uk.ac.vamsas.objects.core.Map getMap(final int index)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._mapList.size()) {
+ throw new IndexOutOfBoundsException("getMap: Index value '" + index
+ + "' not in range [0.." + (this._mapList.size() - 1) + "]");
}
- /**
- * Method removeProperty.
- *
- * @param vProperty
- * @return true if the object was removed from the collection.
- */
- public boolean removeProperty(
- final uk.ac.vamsas.objects.core.Property vProperty) {
- boolean removed = _propertyList.remove(vProperty);
- return removed;
+ return (uk.ac.vamsas.objects.core.Map) _mapList.get(index);
+ }
+
+ /**
+ * Method getMap.Returns the contents of the collection in an Array.
+ *
+ * Note: Just in case the collection contents are changing in another thread,
+ * we pass a 0-length Array of the correct type into the API call. This way we
+ * know that the Array returned is of exactly the correct length.
+ *
+ * @return this collection as an Array
+ */
+ public uk.ac.vamsas.objects.core.Map[] getMap() {
+ uk.ac.vamsas.objects.core.Map[] array = new uk.ac.vamsas.objects.core.Map[0];
+ return (uk.ac.vamsas.objects.core.Map[]) this._mapList.toArray(array);
+ }
+
+ /**
+ * Method getMapAsReference.Returns a reference to '_mapList'. No type
+ * checking is performed on any modifications to the Vector.
+ *
+ * @return a reference to the Vector backing this class
+ */
+ public java.util.Vector getMapAsReference() {
+ return this._mapList;
+ }
+
+ /**
+ * Method getMapCount.
+ *
+ * @return the size of this collection
+ */
+ public int getMapCount() {
+ return this._mapList.size();
+ }
+
+ /**
+ * Method getProperty.
+ *
+ * @param index
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ * @return the value of the uk.ac.vamsas.objects.core.Property at the given
+ * index
+ */
+ public uk.ac.vamsas.objects.core.Property getProperty(final int index)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._propertyList.size()) {
+ throw new IndexOutOfBoundsException("getProperty: Index value '" + index
+ + "' not in range [0.." + (this._propertyList.size() - 1) + "]");
}
- /**
- * Method removePropertyAt.
- *
- * @param index
- * @return the element removed from the collection
- */
- public uk.ac.vamsas.objects.core.Property removePropertyAt(
- final int index) {
- java.lang.Object obj = this._propertyList.remove(index);
- return (uk.ac.vamsas.objects.core.Property) obj;
+ return (uk.ac.vamsas.objects.core.Property) _propertyList.get(index);
+ }
+
+ /**
+ * Method getProperty.Returns the contents of the collection in an Array.
+ *
+ * Note: Just in case the collection contents are changing in another thread,
+ * we pass a 0-length Array of the correct type into the API call. This way we
+ * know that the Array returned is of exactly the correct length.
+ *
+ * @return this collection as an Array
+ */
+ public uk.ac.vamsas.objects.core.Property[] getProperty() {
+ uk.ac.vamsas.objects.core.Property[] array = new uk.ac.vamsas.objects.core.Property[0];
+ return (uk.ac.vamsas.objects.core.Property[]) this._propertyList
+ .toArray(array);
+ }
+
+ /**
+ * Method getPropertyAsReference.Returns a reference to '_propertyList'. No
+ * type checking is performed on any modifications to the Vector.
+ *
+ * @return a reference to the Vector backing this class
+ */
+ public java.util.Vector getPropertyAsReference() {
+ return this._propertyList;
+ }
+
+ /**
+ * Method getPropertyCount.
+ *
+ * @return the size of this collection
+ */
+ public int getPropertyCount() {
+ return this._propertyList.size();
+ }
+
+ /**
+ * Returns the value of field 'source'. The field 'source' has the following
+ * description: TODO Database Naming Convention: either start using LSID (so
+ * change type to URI) or leave this as an uncontrolled/unspecified string ID
+ *
+ *
+ * @return the value of field 'Source'.
+ */
+ public java.lang.String getSource() {
+ return this._source;
+ }
+
+ /**
+ * Returns the value of field 'version'. The field 'version' has the following
+ * description: Version must be specified -
+ *
+ *
+ * @return the value of field 'Version'.
+ */
+ public java.lang.String getVersion() {
+ return this._version;
+ }
+
+ /**
+ * Overrides the java.lang.Object.hashCode method.
+ *
+ * The following steps came from Effective Java Programming Language
+ * Guide by Joshua Bloch, Chapter 3
+ *
+ * @return a hash code value for the object.
+ */
+ public int hashCode() {
+ int result = super.hashCode();
+
+ long tmp;
+ if (_source != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_source)) {
+ result = 37 * result + _source.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_source);
}
-
- /**
- * Sets the value of field 'accessionId'. The field
- * 'accessionId' has the following description: TODO: make some
- * specification
- * of the database field from which this
- * accessionId is taken from - should that be a
- * special property of the dbRef object ?
- *
- *
- * @param accessionId the value of field 'accessionId'.
- */
- public void setAccessionId(
- final java.lang.String accessionId) {
- this._accessionId = accessionId;
+ if (_version != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_version)) {
+ result = 37 * result + _version.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_version);
}
-
- /**
- * Sets the value of field 'id'. The field 'id' has the
- * following description: Primary Key for vamsas object
- * referencing
- *
- * @param id the value of field 'id'.
- */
- public void setId(
- final java.lang.String id) {
- this._id = id;
+ if (_accessionId != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_accessionId)) {
+ result = 37 * result + _accessionId.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_accessionId);
}
-
- /**
- *
- *
- * @param index
- * @param vLink
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void setLink(
- final int index,
- final uk.ac.vamsas.objects.core.Link vLink)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._linkList.size()) {
- throw new IndexOutOfBoundsException("setLink: Index value '" + index + "' not in range [0.." + (this._linkList.size() - 1) + "]");
- }
-
- this._linkList.set(index, vLink);
+ if (_id != null && !org.castor.util.CycleBreaker.startingToCycle(_id)) {
+ result = 37 * result + _id.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_id);
}
-
- /**
- *
- *
- * @param vLinkArray
- */
- public void setLink(
- final uk.ac.vamsas.objects.core.Link[] vLinkArray) {
- //-- copy array
- _linkList.clear();
-
- for (int i = 0; i < vLinkArray.length; i++) {
- this._linkList.add(vLinkArray[i]);
- }
+ if (_mapList != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_mapList)) {
+ result = 37 * result + _mapList.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_mapList);
}
-
- /**
- * Sets the value of '_linkList' by copying the given Vector.
- * All elements will be checked for type safety.
- *
- * @param vLinkList the Vector to copy.
- */
- public void setLink(
- final java.util.Vector vLinkList) {
- // copy vector
- this._linkList.clear();
-
- this._linkList.addAll(vLinkList);
+ if (_linkList != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_linkList)) {
+ result = 37 * result + _linkList.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_linkList);
}
-
- /**
- * Sets the value of '_linkList' by setting it to the given
- * Vector. No type checking is performed.
- * @deprecated
- *
- * @param linkVector the Vector to set.
- */
- public void setLinkAsReference(
- final java.util.Vector linkVector) {
- this._linkList = linkVector;
+ if (_propertyList != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_propertyList)) {
+ result = 37 * result + _propertyList.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_propertyList);
}
- /**
- *
- *
- * @param index
- * @param vMap
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void setMap(
- final int index,
- final uk.ac.vamsas.objects.core.Map vMap)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._mapList.size()) {
- throw new IndexOutOfBoundsException("setMap: Index value '" + index + "' not in range [0.." + (this._mapList.size() - 1) + "]");
- }
-
- this._mapList.set(index, vMap);
+ return result;
+ }
+
+ /**
+ * Method isValid.
+ *
+ * @return true if this object is valid according to the schema
+ */
+ public boolean isValid() {
+ try {
+ validate();
+ } catch (org.exolab.castor.xml.ValidationException vex) {
+ return false;
}
-
- /**
- *
- *
- * @param vMapArray
- */
- public void setMap(
- final uk.ac.vamsas.objects.core.Map[] vMapArray) {
- //-- copy array
- _mapList.clear();
-
- for (int i = 0; i < vMapArray.length; i++) {
- this._mapList.add(vMapArray[i]);
- }
+ return true;
+ }
+
+ /**
+ *
+ *
+ * @param out
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void marshal(final java.io.Writer out)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, out);
+ }
+
+ /**
+ *
+ *
+ * @param handler
+ * @throws java.io.IOException
+ * if an IOException occurs during marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ */
+ public void marshal(final org.xml.sax.ContentHandler handler)
+ throws java.io.IOException, org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, handler);
+ }
+
+ /**
+ */
+ public void removeAllLink() {
+ this._linkList.clear();
+ }
+
+ /**
+ */
+ public void removeAllMap() {
+ this._mapList.clear();
+ }
+
+ /**
+ */
+ public void removeAllProperty() {
+ this._propertyList.clear();
+ }
+
+ /**
+ * Method removeLink.
+ *
+ * @param vLink
+ * @return true if the object was removed from the collection.
+ */
+ public boolean removeLink(final uk.ac.vamsas.objects.core.Link vLink) {
+ boolean removed = _linkList.remove(vLink);
+ return removed;
+ }
+
+ /**
+ * Method removeLinkAt.
+ *
+ * @param index
+ * @return the element removed from the collection
+ */
+ public uk.ac.vamsas.objects.core.Link removeLinkAt(final int index) {
+ java.lang.Object obj = this._linkList.remove(index);
+ return (uk.ac.vamsas.objects.core.Link) obj;
+ }
+
+ /**
+ * Method removeMap.
+ *
+ * @param vMap
+ * @return true if the object was removed from the collection.
+ */
+ public boolean removeMap(final uk.ac.vamsas.objects.core.Map vMap) {
+ boolean removed = _mapList.remove(vMap);
+ return removed;
+ }
+
+ /**
+ * Method removeMapAt.
+ *
+ * @param index
+ * @return the element removed from the collection
+ */
+ public uk.ac.vamsas.objects.core.Map removeMapAt(final int index) {
+ java.lang.Object obj = this._mapList.remove(index);
+ return (uk.ac.vamsas.objects.core.Map) obj;
+ }
+
+ /**
+ * Method removeProperty.
+ *
+ * @param vProperty
+ * @return true if the object was removed from the collection.
+ */
+ public boolean removeProperty(
+ final uk.ac.vamsas.objects.core.Property vProperty) {
+ boolean removed = _propertyList.remove(vProperty);
+ return removed;
+ }
+
+ /**
+ * Method removePropertyAt.
+ *
+ * @param index
+ * @return the element removed from the collection
+ */
+ public uk.ac.vamsas.objects.core.Property removePropertyAt(final int index) {
+ java.lang.Object obj = this._propertyList.remove(index);
+ return (uk.ac.vamsas.objects.core.Property) obj;
+ }
+
+ /**
+ * Sets the value of field 'accessionId'. The field 'accessionId' has the
+ * following description: TODO: make some specification of the database field
+ * from which this accessionId is taken from - should that be a special
+ * property of the dbRef object ?
+ *
+ *
+ * @param accessionId
+ * the value of field 'accessionId'.
+ */
+ public void setAccessionId(final java.lang.String accessionId) {
+ this._accessionId = accessionId;
+ }
+
+ /**
+ * Sets the value of field 'id'. The field 'id' has the following description:
+ * Primary Key for vamsas object referencing
+ *
+ * @param id
+ * the value of field 'id'.
+ */
+ public void setId(final java.lang.String id) {
+ this._id = id;
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vLink
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void setLink(final int index,
+ final uk.ac.vamsas.objects.core.Link vLink)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._linkList.size()) {
+ throw new IndexOutOfBoundsException("setLink: Index value '" + index
+ + "' not in range [0.." + (this._linkList.size() - 1) + "]");
}
- /**
- * Sets the value of '_mapList' by copying the given Vector.
- * All elements will be checked for type safety.
- *
- * @param vMapList the Vector to copy.
- */
- public void setMap(
- final java.util.Vector vMapList) {
- // copy vector
- this._mapList.clear();
-
- this._mapList.addAll(vMapList);
- }
+ this._linkList.set(index, vLink);
+ }
- /**
- * Sets the value of '_mapList' by setting it to the given
- * Vector. No type checking is performed.
- * @deprecated
- *
- * @param mapVector the Vector to set.
- */
- public void setMapAsReference(
- final java.util.Vector mapVector) {
- this._mapList = mapVector;
- }
+ /**
+ *
+ *
+ * @param vLinkArray
+ */
+ public void setLink(final uk.ac.vamsas.objects.core.Link[] vLinkArray) {
+ // -- copy array
+ _linkList.clear();
- /**
- *
- *
- * @param index
- * @param vProperty
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void setProperty(
- final int index,
- final uk.ac.vamsas.objects.core.Property vProperty)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._propertyList.size()) {
- throw new IndexOutOfBoundsException("setProperty: Index value '" + index + "' not in range [0.." + (this._propertyList.size() - 1) + "]");
- }
-
- this._propertyList.set(index, vProperty);
+ for (int i = 0; i < vLinkArray.length; i++) {
+ this._linkList.add(vLinkArray[i]);
}
-
- /**
- *
- *
- * @param vPropertyArray
- */
- public void setProperty(
- final uk.ac.vamsas.objects.core.Property[] vPropertyArray) {
- //-- copy array
- _propertyList.clear();
-
- for (int i = 0; i < vPropertyArray.length; i++) {
- this._propertyList.add(vPropertyArray[i]);
- }
+ }
+
+ /**
+ * Sets the value of '_linkList' by copying the given Vector. All elements
+ * will be checked for type safety.
+ *
+ * @param vLinkList
+ * the Vector to copy.
+ */
+ public void setLink(final java.util.Vector vLinkList) {
+ // copy vector
+ this._linkList.clear();
+
+ this._linkList.addAll(vLinkList);
+ }
+
+ /**
+ * Sets the value of '_linkList' by setting it to the given Vector. No type
+ * checking is performed.
+ *
+ * @deprecated
+ *
+ * @param linkVector
+ * the Vector to set.
+ */
+ public void setLinkAsReference(final java.util.Vector linkVector) {
+ this._linkList = linkVector;
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vMap
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void setMap(final int index, final uk.ac.vamsas.objects.core.Map vMap)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._mapList.size()) {
+ throw new IndexOutOfBoundsException("setMap: Index value '" + index
+ + "' not in range [0.." + (this._mapList.size() - 1) + "]");
}
- /**
- * Sets the value of '_propertyList' by copying the given
- * Vector. All elements will be checked for type safety.
- *
- * @param vPropertyList the Vector to copy.
- */
- public void setProperty(
- final java.util.Vector vPropertyList) {
- // copy vector
- this._propertyList.clear();
-
- this._propertyList.addAll(vPropertyList);
- }
+ this._mapList.set(index, vMap);
+ }
- /**
- * Sets the value of '_propertyList' by setting it to the given
- * Vector. No type checking is performed.
- * @deprecated
- *
- * @param propertyVector the Vector to set.
- */
- public void setPropertyAsReference(
- final java.util.Vector propertyVector) {
- this._propertyList = propertyVector;
- }
+ /**
+ *
+ *
+ * @param vMapArray
+ */
+ public void setMap(final uk.ac.vamsas.objects.core.Map[] vMapArray) {
+ // -- copy array
+ _mapList.clear();
- /**
- * Sets the value of field 'source'. The field 'source' has the
- * following description: TODO Database Naming
- * Convention: either start using LSID (so
- * change type to URI) or leave this as an
- * uncontrolled/unspecified string ID
- *
- *
- * @param source the value of field 'source'.
- */
- public void setSource(
- final java.lang.String source) {
- this._source = source;
+ for (int i = 0; i < vMapArray.length; i++) {
+ this._mapList.add(vMapArray[i]);
}
-
- /**
- * Sets the value of field 'version'. The field 'version' has
- * the following description: Version must be specified -
- *
- *
- * @param version the value of field 'version'.
- */
- public void setVersion(
- final java.lang.String version) {
- this._version = version;
+ }
+
+ /**
+ * Sets the value of '_mapList' by copying the given Vector. All elements will
+ * be checked for type safety.
+ *
+ * @param vMapList
+ * the Vector to copy.
+ */
+ public void setMap(final java.util.Vector vMapList) {
+ // copy vector
+ this._mapList.clear();
+
+ this._mapList.addAll(vMapList);
+ }
+
+ /**
+ * Sets the value of '_mapList' by setting it to the given Vector. No type
+ * checking is performed.
+ *
+ * @deprecated
+ *
+ * @param mapVector
+ * the Vector to set.
+ */
+ public void setMapAsReference(final java.util.Vector mapVector) {
+ this._mapList = mapVector;
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vProperty
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void setProperty(final int index,
+ final uk.ac.vamsas.objects.core.Property vProperty)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._propertyList.size()) {
+ throw new IndexOutOfBoundsException("setProperty: Index value '" + index
+ + "' not in range [0.." + (this._propertyList.size() - 1) + "]");
}
- /**
- * Method unmarshal.
- *
- * @param reader
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @return the unmarshaled uk.ac.vamsas.objects.core.DbRef
- */
- public static uk.ac.vamsas.objects.core.DbRef unmarshal(
- final java.io.Reader reader)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- return (uk.ac.vamsas.objects.core.DbRef) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.DbRef.class, reader);
- }
-
- /**
- *
- *
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void validate(
- )
- throws org.exolab.castor.xml.ValidationException {
- org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
- validator.validate(this);
+ this._propertyList.set(index, vProperty);
+ }
+
+ /**
+ *
+ *
+ * @param vPropertyArray
+ */
+ public void setProperty(
+ final uk.ac.vamsas.objects.core.Property[] vPropertyArray) {
+ // -- copy array
+ _propertyList.clear();
+
+ for (int i = 0; i < vPropertyArray.length; i++) {
+ this._propertyList.add(vPropertyArray[i]);
}
+ }
+
+ /**
+ * Sets the value of '_propertyList' by copying the given Vector. All elements
+ * will be checked for type safety.
+ *
+ * @param vPropertyList
+ * the Vector to copy.
+ */
+ public void setProperty(final java.util.Vector vPropertyList) {
+ // copy vector
+ this._propertyList.clear();
+
+ this._propertyList.addAll(vPropertyList);
+ }
+
+ /**
+ * Sets the value of '_propertyList' by setting it to the given Vector. No
+ * type checking is performed.
+ *
+ * @deprecated
+ *
+ * @param propertyVector
+ * the Vector to set.
+ */
+ public void setPropertyAsReference(final java.util.Vector propertyVector) {
+ this._propertyList = propertyVector;
+ }
+
+ /**
+ * Sets the value of field 'source'. The field 'source' has the following
+ * description: TODO Database Naming Convention: either start using LSID (so
+ * change type to URI) or leave this as an uncontrolled/unspecified string ID
+ *
+ *
+ * @param source
+ * the value of field 'source'.
+ */
+ public void setSource(final java.lang.String source) {
+ this._source = source;
+ }
+
+ /**
+ * Sets the value of field 'version'. The field 'version' has the following
+ * description: Version must be specified -
+ *
+ *
+ * @param version
+ * the value of field 'version'.
+ */
+ public void setVersion(final java.lang.String version) {
+ this._version = version;
+ }
+
+ /**
+ * Method unmarshal.
+ *
+ * @param reader
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @return the unmarshaled uk.ac.vamsas.objects.core.DbRef
+ */
+ public static uk.ac.vamsas.objects.core.DbRef unmarshal(
+ final java.io.Reader reader)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ return (uk.ac.vamsas.objects.core.DbRef) Unmarshaller.unmarshal(
+ uk.ac.vamsas.objects.core.DbRef.class, reader);
+ }
+
+ /**
+ *
+ *
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void validate() throws org.exolab.castor.xml.ValidationException {
+ org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+ validator.validate(this);
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/Entry.java b/src/uk/ac/vamsas/objects/core/Entry.java
index 3415765..ac6093c 100644
--- a/src/uk/ac/vamsas/objects/core/Entry.java
+++ b/src/uk/ac/vamsas/objects/core/Entry.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import org.exolab.castor.xml.Marshaller;
@@ -17,1085 +31,1105 @@ import org.exolab.castor.xml.Unmarshaller;
/**
* Class Entry.
*
- * @version $Revision$ $Date$
+ * @version $Revision$ $Date: 2007-06-28 14:51:44 +0100 (Thu, 28 Jun 2007)
+ * $
*/
-public class Entry extends uk.ac.vamsas.client.Vobject
-implements java.io.Serializable
-{
-
-
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
- * Primary Key for vamsas object referencing
- *
- */
- private java.lang.String _id;
-
- /**
- * Who
- */
- private java.lang.String _user;
-
- /**
- * With which application
- */
- private java.lang.String _app;
-
- /**
- * Did what
- */
- private java.lang.String _action;
-
- /**
- * When
- */
- private java.util.Date _date;
-
- /**
- * additional information
- */
- private java.util.Vector _propertyList;
-
- /**
- * parameter for the action
- */
- private java.util.Vector _paramList;
-
- /**
- * bioinformatic objects input to action
- *
- */
- private java.util.Vector _inputList;
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public Entry() {
- super();
- this._propertyList = new java.util.Vector();
- this._paramList = new java.util.Vector();
- this._inputList = new java.util.Vector();
- }
-
-
- //-----------/
- //- Methods -/
- //-----------/
-
- /**
- *
- *
- * @param vInput
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addInput(
- final uk.ac.vamsas.objects.core.Input vInput)
- throws java.lang.IndexOutOfBoundsException {
- this._inputList.addElement(vInput);
- }
-
- /**
- *
- *
- * @param index
- * @param vInput
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addInput(
- final int index,
- final uk.ac.vamsas.objects.core.Input vInput)
- throws java.lang.IndexOutOfBoundsException {
- this._inputList.add(index, vInput);
- }
-
- /**
- *
- *
- * @param vParam
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addParam(
- final uk.ac.vamsas.objects.core.Param vParam)
- throws java.lang.IndexOutOfBoundsException {
- this._paramList.addElement(vParam);
- }
-
- /**
- *
- *
- * @param index
- * @param vParam
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addParam(
- final int index,
- final uk.ac.vamsas.objects.core.Param vParam)
- throws java.lang.IndexOutOfBoundsException {
- this._paramList.add(index, vParam);
- }
-
- /**
- *
- *
- * @param vProperty
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addProperty(
- final uk.ac.vamsas.objects.core.Property vProperty)
- throws java.lang.IndexOutOfBoundsException {
- this._propertyList.addElement(vProperty);
- }
-
- /**
- *
- *
- * @param index
- * @param vProperty
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addProperty(
- final int index,
- final uk.ac.vamsas.objects.core.Property vProperty)
- throws java.lang.IndexOutOfBoundsException {
- this._propertyList.add(index, vProperty);
- }
-
- /**
- * Method enumerateInput.
- *
- * @return an Enumeration over all
- * uk.ac.vamsas.objects.core.Input elements
- */
- public java.util.Enumeration enumerateInput(
- ) {
- return this._inputList.elements();
- }
-
- /**
- * Method enumerateParam.
- *
- * @return an Enumeration over all
- * uk.ac.vamsas.objects.core.Param elements
- */
- public java.util.Enumeration enumerateParam(
- ) {
- return this._paramList.elements();
- }
-
- /**
- * Method enumerateProperty.
- *
- * @return an Enumeration over all
- * uk.ac.vamsas.objects.core.Property elements
- */
- public java.util.Enumeration enumerateProperty(
- ) {
- return this._propertyList.elements();
- }
-
- /**
- * Overrides the java.lang.Object.equals method.
- *
- * @param obj
- * @return true if the objects are equal.
- */
- public boolean equals(
- final java.lang.Object obj) {
- if ( this == obj )
- return true;
-
- if (super.equals(obj)==false)
+public class Entry extends uk.ac.vamsas.client.Vobject implements
+ java.io.Serializable {
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * Primary Key for vamsas object referencing
+ *
+ */
+ private java.lang.String _id;
+
+ /**
+ * Who
+ */
+ private java.lang.String _user;
+
+ /**
+ * With which application
+ */
+ private java.lang.String _app;
+
+ /**
+ * Did what
+ */
+ private java.lang.String _action;
+
+ /**
+ * When
+ */
+ private java.util.Date _date;
+
+ /**
+ * additional information
+ */
+ private java.util.Vector _propertyList;
+
+ /**
+ * parameter for the action
+ */
+ private java.util.Vector _paramList;
+
+ /**
+ * bioinformatic objects input to action
+ *
+ */
+ private java.util.Vector _inputList;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public Entry() {
+ super();
+ this._propertyList = new java.util.Vector();
+ this._paramList = new java.util.Vector();
+ this._inputList = new java.util.Vector();
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ *
+ *
+ * @param vInput
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addInput(final uk.ac.vamsas.objects.core.Input vInput)
+ throws java.lang.IndexOutOfBoundsException {
+ this._inputList.addElement(vInput);
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vInput
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addInput(final int index,
+ final uk.ac.vamsas.objects.core.Input vInput)
+ throws java.lang.IndexOutOfBoundsException {
+ this._inputList.add(index, vInput);
+ }
+
+ /**
+ *
+ *
+ * @param vParam
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addParam(final uk.ac.vamsas.objects.core.Param vParam)
+ throws java.lang.IndexOutOfBoundsException {
+ this._paramList.addElement(vParam);
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vParam
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addParam(final int index,
+ final uk.ac.vamsas.objects.core.Param vParam)
+ throws java.lang.IndexOutOfBoundsException {
+ this._paramList.add(index, vParam);
+ }
+
+ /**
+ *
+ *
+ * @param vProperty
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addProperty(final uk.ac.vamsas.objects.core.Property vProperty)
+ throws java.lang.IndexOutOfBoundsException {
+ this._propertyList.addElement(vProperty);
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vProperty
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addProperty(final int index,
+ final uk.ac.vamsas.objects.core.Property vProperty)
+ throws java.lang.IndexOutOfBoundsException {
+ this._propertyList.add(index, vProperty);
+ }
+
+ /**
+ * Method enumerateInput.
+ *
+ * @return an Enumeration over all uk.ac.vamsas.objects.core.Input elements
+ */
+ public java.util.Enumeration enumerateInput() {
+ return this._inputList.elements();
+ }
+
+ /**
+ * Method enumerateParam.
+ *
+ * @return an Enumeration over all uk.ac.vamsas.objects.core.Param elements
+ */
+ public java.util.Enumeration enumerateParam() {
+ return this._paramList.elements();
+ }
+
+ /**
+ * Method enumerateProperty.
+ *
+ * @return an Enumeration over all uk.ac.vamsas.objects.core.Property elements
+ */
+ public java.util.Enumeration enumerateProperty() {
+ return this._propertyList.elements();
+ }
+
+ /**
+ * Overrides the java.lang.Object.equals method.
+ *
+ * @param obj
+ * @return true if the objects are equal.
+ */
+ public boolean equals(final java.lang.Object obj) {
+ if (this == obj)
+ return true;
+
+ if (super.equals(obj) == false)
+ return false;
+
+ if (obj instanceof Entry) {
+
+ Entry temp = (Entry) obj;
+ boolean thcycle;
+ boolean tmcycle;
+ if (this._id != null) {
+ if (temp._id == null)
+ return false;
+ if (this._id != temp._id) {
+ thcycle = org.castor.util.CycleBreaker.startingToCycle(this._id);
+ tmcycle = org.castor.util.CycleBreaker.startingToCycle(temp._id);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
+ }
+ ;
return false;
-
- if (obj instanceof Entry) {
-
- Entry temp = (Entry)obj;
- boolean thcycle;
- boolean tmcycle;
- if (this._id != null) {
- if (temp._id == null) return false;
- if (this._id != temp._id) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._id);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._id);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._id); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._id); };
- return false;
- }
- if (!thcycle) {
- if (!this._id.equals(temp._id)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
- }
- }
- } else if (temp._id != null)
- return false;
- if (this._user != null) {
- if (temp._user == null) return false;
- if (this._user != temp._user) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._user);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._user);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._user); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._user); };
- return false;
- }
- if (!thcycle) {
- if (!this._user.equals(temp._user)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._user);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._user);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._user);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._user);
- }
- }
- } else if (temp._user != null)
- return false;
- if (this._app != null) {
- if (temp._app == null) return false;
- if (this._app != temp._app) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._app);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._app);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._app); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._app); };
- return false;
- }
- if (!thcycle) {
- if (!this._app.equals(temp._app)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._app);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._app);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._app);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._app);
- }
- }
- } else if (temp._app != null)
- return false;
- if (this._action != null) {
- if (temp._action == null) return false;
- if (this._action != temp._action) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._action);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._action);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._action); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._action); };
- return false;
- }
- if (!thcycle) {
- if (!this._action.equals(temp._action)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._action);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._action);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._action);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._action);
- }
- }
- } else if (temp._action != null)
- return false;
- if (this._date != null) {
- if (temp._date == null) return false;
- if (this._date != temp._date) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._date);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._date);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._date); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._date); };
- return false;
- }
- if (!thcycle) {
- if (!this._date.equals(temp._date)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._date);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._date);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._date);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._date);
- }
- }
- } else if (temp._date != null)
- return false;
- if (this._propertyList != null) {
- if (temp._propertyList == null) return false;
- if (this._propertyList != temp._propertyList) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._propertyList);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._propertyList);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._propertyList); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._propertyList); };
- return false;
- }
- if (!thcycle) {
- if (!this._propertyList.equals(temp._propertyList)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._propertyList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._propertyList);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._propertyList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._propertyList);
- }
- }
- } else if (temp._propertyList != null)
- return false;
- if (this._paramList != null) {
- if (temp._paramList == null) return false;
- if (this._paramList != temp._paramList) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._paramList);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._paramList);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._paramList); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._paramList); };
- return false;
- }
- if (!thcycle) {
- if (!this._paramList.equals(temp._paramList)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._paramList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._paramList);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._paramList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._paramList);
- }
- }
- } else if (temp._paramList != null)
- return false;
- if (this._inputList != null) {
- if (temp._inputList == null) return false;
- if (this._inputList != temp._inputList) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._inputList);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._inputList);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._inputList); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._inputList); };
- return false;
- }
- if (!thcycle) {
- if (!this._inputList.equals(temp._inputList)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._inputList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._inputList);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._inputList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._inputList);
- }
- }
- } else if (temp._inputList != null)
- return false;
- return true;
+ }
+ if (!thcycle) {
+ if (!this._id.equals(temp._id)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
+ }
}
+ } else if (temp._id != null)
return false;
- }
-
- /**
- * Returns the value of field 'action'. The field 'action' has
- * the following description: Did what
- *
- * @return the value of field 'Action'.
- */
- public java.lang.String getAction(
- ) {
- return this._action;
- }
-
- /**
- * Returns the value of field 'app'. The field 'app' has the
- * following description: With which application
- *
- * @return the value of field 'App'.
- */
- public java.lang.String getApp(
- ) {
- return this._app;
- }
-
- /**
- * Returns the value of field 'date'. The field 'date' has the
- * following description: When
- *
- * @return the value of field 'Date'.
- */
- public java.util.Date getDate(
- ) {
- return this._date;
- }
-
- /**
- * Returns the value of field 'id'. The field 'id' has the
- * following description: Primary Key for vamsas object
- * referencing
- *
- *
- * @return the value of field 'Id'.
- */
- public java.lang.String getId(
- ) {
- return this._id;
- }
-
- /**
- * Method getInput.
- *
- * @param index
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- * @return the value of the uk.ac.vamsas.objects.core.Input at
- * the given index
- */
- public uk.ac.vamsas.objects.core.Input getInput(
- final int index)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._inputList.size()) {
- throw new IndexOutOfBoundsException("getInput: Index value '" + index + "' not in range [0.." + (this._inputList.size() - 1) + "]");
- }
-
- return (uk.ac.vamsas.objects.core.Input) _inputList.get(index);
- }
-
- /**
- * Method getInput.Returns the contents of the collection in an
- * Array.
Note: Just in case the collection contents are
- * changing in another thread, we pass a 0-length Array of the
- * correct type into the API call. This way we know
- * that the Array returned is of exactly the correct length.
- *
- * @return this collection as an Array
- */
- public uk.ac.vamsas.objects.core.Input[] getInput(
- ) {
- uk.ac.vamsas.objects.core.Input[] array = new uk.ac.vamsas.objects.core.Input[0];
- return (uk.ac.vamsas.objects.core.Input[]) this._inputList.toArray(array);
- }
-
- /**
- * Method getInputAsReference.Returns a reference to
- * '_inputList'. No type checking is performed on any
- * modifications to the Vector.
- *
- * @return a reference to the Vector backing this class
- */
- public java.util.Vector getInputAsReference(
- ) {
- return this._inputList;
- }
-
- /**
- * Method getInputCount.
- *
- * @return the size of this collection
- */
- public int getInputCount(
- ) {
- return this._inputList.size();
- }
-
- /**
- * Method getParam.
- *
- * @param index
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- * @return the value of the uk.ac.vamsas.objects.core.Param at
- * the given index
- */
- public uk.ac.vamsas.objects.core.Param getParam(
- final int index)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._paramList.size()) {
- throw new IndexOutOfBoundsException("getParam: Index value '" + index + "' not in range [0.." + (this._paramList.size() - 1) + "]");
- }
-
- return (uk.ac.vamsas.objects.core.Param) _paramList.get(index);
- }
-
- /**
- * Method getParam.Returns the contents of the collection in an
- * Array.
Note: Just in case the collection contents are
- * changing in another thread, we pass a 0-length Array of the
- * correct type into the API call. This way we know
- * that the Array returned is of exactly the correct length.
- *
- * @return this collection as an Array
- */
- public uk.ac.vamsas.objects.core.Param[] getParam(
- ) {
- uk.ac.vamsas.objects.core.Param[] array = new uk.ac.vamsas.objects.core.Param[0];
- return (uk.ac.vamsas.objects.core.Param[]) this._paramList.toArray(array);
- }
-
- /**
- * Method getParamAsReference.Returns a reference to
- * '_paramList'. No type checking is performed on any
- * modifications to the Vector.
- *
- * @return a reference to the Vector backing this class
- */
- public java.util.Vector getParamAsReference(
- ) {
- return this._paramList;
- }
-
- /**
- * Method getParamCount.
- *
- * @return the size of this collection
- */
- public int getParamCount(
- ) {
- return this._paramList.size();
- }
-
- /**
- * Method getProperty.
- *
- * @param index
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- * @return the value of the uk.ac.vamsas.objects.core.Property
- * at the given index
- */
- public uk.ac.vamsas.objects.core.Property getProperty(
- final int index)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._propertyList.size()) {
- throw new IndexOutOfBoundsException("getProperty: Index value '" + index + "' not in range [0.." + (this._propertyList.size() - 1) + "]");
- }
-
- return (uk.ac.vamsas.objects.core.Property) _propertyList.get(index);
- }
-
- /**
- * Method getProperty.Returns the contents of the collection in
- * an Array.
Note: Just in case the collection contents
- * are changing in another thread, we pass a 0-length Array of
- * the correct type into the API call. This way we know
- * that the Array returned is of exactly the correct length.
- *
- * @return this collection as an Array
- */
- public uk.ac.vamsas.objects.core.Property[] getProperty(
- ) {
- uk.ac.vamsas.objects.core.Property[] array = new uk.ac.vamsas.objects.core.Property[0];
- return (uk.ac.vamsas.objects.core.Property[]) this._propertyList.toArray(array);
- }
-
- /**
- * Method getPropertyAsReference.Returns a reference to
- * '_propertyList'. No type checking is performed on any
- * modifications to the Vector.
- *
- * @return a reference to the Vector backing this class
- */
- public java.util.Vector getPropertyAsReference(
- ) {
- return this._propertyList;
- }
-
- /**
- * Method getPropertyCount.
- *
- * @return the size of this collection
- */
- public int getPropertyCount(
- ) {
- return this._propertyList.size();
- }
-
- /**
- * Returns the value of field 'user'. The field 'user' has the
- * following description: Who
- *
- * @return the value of field 'User'.
- */
- public java.lang.String getUser(
- ) {
- return this._user;
- }
-
- /**
- * Overrides the java.lang.Object.hashCode method.
- *
- * The following steps came from Effective Java Programming
- * Language Guide by Joshua Bloch, Chapter 3
- *
- * @return a hash code value for the object.
- */
- public int hashCode(
- ) {
- int result = super.hashCode();
-
- long tmp;
- if (_id != null
- && !org.castor.util.CycleBreaker.startingToCycle(_id)) {
- result = 37 * result + _id.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_id);
- }
- if (_user != null
- && !org.castor.util.CycleBreaker.startingToCycle(_user)) {
- result = 37 * result + _user.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_user);
- }
- if (_app != null
- && !org.castor.util.CycleBreaker.startingToCycle(_app)) {
- result = 37 * result + _app.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_app);
+ if (this._user != null) {
+ if (temp._user == null)
+ return false;
+ if (this._user != temp._user) {
+ thcycle = org.castor.util.CycleBreaker.startingToCycle(this._user);
+ tmcycle = org.castor.util.CycleBreaker.startingToCycle(temp._user);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._user);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._user);
+ }
+ ;
+ return false;
+ }
+ if (!thcycle) {
+ if (!this._user.equals(temp._user)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._user);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._user);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._user);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._user);
+ }
}
- if (_action != null
- && !org.castor.util.CycleBreaker.startingToCycle(_action)) {
- result = 37 * result + _action.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_action);
+ } else if (temp._user != null)
+ return false;
+ if (this._app != null) {
+ if (temp._app == null)
+ return false;
+ if (this._app != temp._app) {
+ thcycle = org.castor.util.CycleBreaker.startingToCycle(this._app);
+ tmcycle = org.castor.util.CycleBreaker.startingToCycle(temp._app);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._app);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._app);
+ }
+ ;
+ return false;
+ }
+ if (!thcycle) {
+ if (!this._app.equals(temp._app)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._app);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._app);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._app);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._app);
+ }
}
- if (_date != null
- && !org.castor.util.CycleBreaker.startingToCycle(_date)) {
- result = 37 * result + _date.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_date);
+ } else if (temp._app != null)
+ return false;
+ if (this._action != null) {
+ if (temp._action == null)
+ return false;
+ if (this._action != temp._action) {
+ thcycle = org.castor.util.CycleBreaker.startingToCycle(this._action);
+ tmcycle = org.castor.util.CycleBreaker.startingToCycle(temp._action);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._action);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._action);
+ }
+ ;
+ return false;
+ }
+ if (!thcycle) {
+ if (!this._action.equals(temp._action)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._action);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._action);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._action);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._action);
+ }
}
- if (_propertyList != null
- && !org.castor.util.CycleBreaker.startingToCycle(_propertyList)) {
- result = 37 * result + _propertyList.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_propertyList);
+ } else if (temp._action != null)
+ return false;
+ if (this._date != null) {
+ if (temp._date == null)
+ return false;
+ if (this._date != temp._date) {
+ thcycle = org.castor.util.CycleBreaker.startingToCycle(this._date);
+ tmcycle = org.castor.util.CycleBreaker.startingToCycle(temp._date);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._date);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._date);
+ }
+ ;
+ return false;
+ }
+ if (!thcycle) {
+ if (!this._date.equals(temp._date)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._date);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._date);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._date);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._date);
+ }
}
- if (_paramList != null
- && !org.castor.util.CycleBreaker.startingToCycle(_paramList)) {
- result = 37 * result + _paramList.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_paramList);
+ } else if (temp._date != null)
+ return false;
+ if (this._propertyList != null) {
+ if (temp._propertyList == null)
+ return false;
+ if (this._propertyList != temp._propertyList) {
+ thcycle = org.castor.util.CycleBreaker
+ .startingToCycle(this._propertyList);
+ tmcycle = org.castor.util.CycleBreaker
+ .startingToCycle(temp._propertyList);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(this._propertyList);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(temp._propertyList);
+ }
+ ;
+ return false;
+ }
+ if (!thcycle) {
+ if (!this._propertyList.equals(temp._propertyList)) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(this._propertyList);
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(temp._propertyList);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._propertyList);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._propertyList);
+ }
}
- if (_inputList != null
- && !org.castor.util.CycleBreaker.startingToCycle(_inputList)) {
- result = 37 * result + _inputList.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_inputList);
+ } else if (temp._propertyList != null)
+ return false;
+ if (this._paramList != null) {
+ if (temp._paramList == null)
+ return false;
+ if (this._paramList != temp._paramList) {
+ thcycle = org.castor.util.CycleBreaker
+ .startingToCycle(this._paramList);
+ tmcycle = org.castor.util.CycleBreaker
+ .startingToCycle(temp._paramList);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._paramList);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._paramList);
+ }
+ ;
+ return false;
+ }
+ if (!thcycle) {
+ if (!this._paramList.equals(temp._paramList)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._paramList);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._paramList);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._paramList);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._paramList);
+ }
}
-
- return result;
- }
-
- /**
- * Method isValid.
- *
- * @return true if this object is valid according to the schema
- */
- public boolean isValid(
- ) {
- try {
- validate();
- } catch (org.exolab.castor.xml.ValidationException vex) {
+ } else if (temp._paramList != null)
+ return false;
+ if (this._inputList != null) {
+ if (temp._inputList == null)
+ return false;
+ if (this._inputList != temp._inputList) {
+ thcycle = org.castor.util.CycleBreaker
+ .startingToCycle(this._inputList);
+ tmcycle = org.castor.util.CycleBreaker
+ .startingToCycle(temp._inputList);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._inputList);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._inputList);
+ }
+ ;
return false;
+ }
+ if (!thcycle) {
+ if (!this._inputList.equals(temp._inputList)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._inputList);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._inputList);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._inputList);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._inputList);
+ }
}
- return true;
- }
-
- /**
- *
- *
- * @param out
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void marshal(
- final java.io.Writer out)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, out);
- }
-
- /**
- *
- *
- * @param handler
- * @throws java.io.IOException if an IOException occurs during
- * marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- */
- public void marshal(
- final org.xml.sax.ContentHandler handler)
- throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, handler);
- }
-
- /**
- */
- public void removeAllInput(
- ) {
- this._inputList.clear();
- }
-
- /**
- */
- public void removeAllParam(
- ) {
- this._paramList.clear();
- }
-
- /**
- */
- public void removeAllProperty(
- ) {
- this._propertyList.clear();
- }
-
- /**
- * Method removeInput.
- *
- * @param vInput
- * @return true if the object was removed from the collection.
- */
- public boolean removeInput(
- final uk.ac.vamsas.objects.core.Input vInput) {
- boolean removed = _inputList.remove(vInput);
- return removed;
+ } else if (temp._inputList != null)
+ return false;
+ return true;
}
-
- /**
- * Method removeInputAt.
- *
- * @param index
- * @return the element removed from the collection
- */
- public uk.ac.vamsas.objects.core.Input removeInputAt(
- final int index) {
- java.lang.Object obj = this._inputList.remove(index);
- return (uk.ac.vamsas.objects.core.Input) obj;
+ return false;
+ }
+
+ /**
+ * Returns the value of field 'action'. The field 'action' has the following
+ * description: Did what
+ *
+ * @return the value of field 'Action'.
+ */
+ public java.lang.String getAction() {
+ return this._action;
+ }
+
+ /**
+ * Returns the value of field 'app'. The field 'app' has the following
+ * description: With which application
+ *
+ * @return the value of field 'App'.
+ */
+ public java.lang.String getApp() {
+ return this._app;
+ }
+
+ /**
+ * Returns the value of field 'date'. The field 'date' has the following
+ * description: When
+ *
+ * @return the value of field 'Date'.
+ */
+ public java.util.Date getDate() {
+ return this._date;
+ }
+
+ /**
+ * Returns the value of field 'id'. The field 'id' has the following
+ * description: Primary Key for vamsas object referencing
+ *
+ *
+ * @return the value of field 'Id'.
+ */
+ public java.lang.String getId() {
+ return this._id;
+ }
+
+ /**
+ * Method getInput.
+ *
+ * @param index
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ * @return the value of the uk.ac.vamsas.objects.core.Input at the given index
+ */
+ public uk.ac.vamsas.objects.core.Input getInput(final int index)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._inputList.size()) {
+ throw new IndexOutOfBoundsException("getInput: Index value '" + index
+ + "' not in range [0.." + (this._inputList.size() - 1) + "]");
}
- /**
- * Method removeParam.
- *
- * @param vParam
- * @return true if the object was removed from the collection.
- */
- public boolean removeParam(
- final uk.ac.vamsas.objects.core.Param vParam) {
- boolean removed = _paramList.remove(vParam);
- return removed;
+ return (uk.ac.vamsas.objects.core.Input) _inputList.get(index);
+ }
+
+ /**
+ * Method getInput.Returns the contents of the collection in an Array.
+ *
+ * Note: Just in case the collection contents are changing in another thread,
+ * we pass a 0-length Array of the correct type into the API call. This way we
+ * know that the Array returned is of exactly the correct length.
+ *
+ * @return this collection as an Array
+ */
+ public uk.ac.vamsas.objects.core.Input[] getInput() {
+ uk.ac.vamsas.objects.core.Input[] array = new uk.ac.vamsas.objects.core.Input[0];
+ return (uk.ac.vamsas.objects.core.Input[]) this._inputList.toArray(array);
+ }
+
+ /**
+ * Method getInputAsReference.Returns a reference to '_inputList'. No type
+ * checking is performed on any modifications to the Vector.
+ *
+ * @return a reference to the Vector backing this class
+ */
+ public java.util.Vector getInputAsReference() {
+ return this._inputList;
+ }
+
+ /**
+ * Method getInputCount.
+ *
+ * @return the size of this collection
+ */
+ public int getInputCount() {
+ return this._inputList.size();
+ }
+
+ /**
+ * Method getParam.
+ *
+ * @param index
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ * @return the value of the uk.ac.vamsas.objects.core.Param at the given index
+ */
+ public uk.ac.vamsas.objects.core.Param getParam(final int index)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._paramList.size()) {
+ throw new IndexOutOfBoundsException("getParam: Index value '" + index
+ + "' not in range [0.." + (this._paramList.size() - 1) + "]");
}
- /**
- * Method removeParamAt.
- *
- * @param index
- * @return the element removed from the collection
- */
- public uk.ac.vamsas.objects.core.Param removeParamAt(
- final int index) {
- java.lang.Object obj = this._paramList.remove(index);
- return (uk.ac.vamsas.objects.core.Param) obj;
+ return (uk.ac.vamsas.objects.core.Param) _paramList.get(index);
+ }
+
+ /**
+ * Method getParam.Returns the contents of the collection in an Array.
+ *
+ * Note: Just in case the collection contents are changing in another thread,
+ * we pass a 0-length Array of the correct type into the API call. This way we
+ * know that the Array returned is of exactly the correct length.
+ *
+ * @return this collection as an Array
+ */
+ public uk.ac.vamsas.objects.core.Param[] getParam() {
+ uk.ac.vamsas.objects.core.Param[] array = new uk.ac.vamsas.objects.core.Param[0];
+ return (uk.ac.vamsas.objects.core.Param[]) this._paramList.toArray(array);
+ }
+
+ /**
+ * Method getParamAsReference.Returns a reference to '_paramList'. No type
+ * checking is performed on any modifications to the Vector.
+ *
+ * @return a reference to the Vector backing this class
+ */
+ public java.util.Vector getParamAsReference() {
+ return this._paramList;
+ }
+
+ /**
+ * Method getParamCount.
+ *
+ * @return the size of this collection
+ */
+ public int getParamCount() {
+ return this._paramList.size();
+ }
+
+ /**
+ * Method getProperty.
+ *
+ * @param index
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ * @return the value of the uk.ac.vamsas.objects.core.Property at the given
+ * index
+ */
+ public uk.ac.vamsas.objects.core.Property getProperty(final int index)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._propertyList.size()) {
+ throw new IndexOutOfBoundsException("getProperty: Index value '" + index
+ + "' not in range [0.." + (this._propertyList.size() - 1) + "]");
}
- /**
- * Method removeProperty.
- *
- * @param vProperty
- * @return true if the object was removed from the collection.
- */
- public boolean removeProperty(
- final uk.ac.vamsas.objects.core.Property vProperty) {
- boolean removed = _propertyList.remove(vProperty);
- return removed;
+ return (uk.ac.vamsas.objects.core.Property) _propertyList.get(index);
+ }
+
+ /**
+ * Method getProperty.Returns the contents of the collection in an Array.
+ *
+ * Note: Just in case the collection contents are changing in another thread,
+ * we pass a 0-length Array of the correct type into the API call. This way we
+ * know that the Array returned is of exactly the correct length.
+ *
+ * @return this collection as an Array
+ */
+ public uk.ac.vamsas.objects.core.Property[] getProperty() {
+ uk.ac.vamsas.objects.core.Property[] array = new uk.ac.vamsas.objects.core.Property[0];
+ return (uk.ac.vamsas.objects.core.Property[]) this._propertyList
+ .toArray(array);
+ }
+
+ /**
+ * Method getPropertyAsReference.Returns a reference to '_propertyList'. No
+ * type checking is performed on any modifications to the Vector.
+ *
+ * @return a reference to the Vector backing this class
+ */
+ public java.util.Vector getPropertyAsReference() {
+ return this._propertyList;
+ }
+
+ /**
+ * Method getPropertyCount.
+ *
+ * @return the size of this collection
+ */
+ public int getPropertyCount() {
+ return this._propertyList.size();
+ }
+
+ /**
+ * Returns the value of field 'user'. The field 'user' has the following
+ * description: Who
+ *
+ * @return the value of field 'User'.
+ */
+ public java.lang.String getUser() {
+ return this._user;
+ }
+
+ /**
+ * Overrides the java.lang.Object.hashCode method.
+ *
+ * The following steps came from Effective Java Programming Language
+ * Guide by Joshua Bloch, Chapter 3
+ *
+ * @return a hash code value for the object.
+ */
+ public int hashCode() {
+ int result = super.hashCode();
+
+ long tmp;
+ if (_id != null && !org.castor.util.CycleBreaker.startingToCycle(_id)) {
+ result = 37 * result + _id.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_id);
}
-
- /**
- * Method removePropertyAt.
- *
- * @param index
- * @return the element removed from the collection
- */
- public uk.ac.vamsas.objects.core.Property removePropertyAt(
- final int index) {
- java.lang.Object obj = this._propertyList.remove(index);
- return (uk.ac.vamsas.objects.core.Property) obj;
+ if (_user != null && !org.castor.util.CycleBreaker.startingToCycle(_user)) {
+ result = 37 * result + _user.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_user);
}
-
- /**
- * Sets the value of field 'action'. The field 'action' has the
- * following description: Did what
- *
- * @param action the value of field 'action'.
- */
- public void setAction(
- final java.lang.String action) {
- this._action = action;
+ if (_app != null && !org.castor.util.CycleBreaker.startingToCycle(_app)) {
+ result = 37 * result + _app.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_app);
}
-
- /**
- * Sets the value of field 'app'. The field 'app' has the
- * following description: With which application
- *
- * @param app the value of field 'app'.
- */
- public void setApp(
- final java.lang.String app) {
- this._app = app;
+ if (_action != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_action)) {
+ result = 37 * result + _action.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_action);
}
-
- /**
- * Sets the value of field 'date'. The field 'date' has the
- * following description: When
- *
- * @param date the value of field 'date'.
- */
- public void setDate(
- final java.util.Date date) {
- this._date = date;
- }
-
- /**
- * Sets the value of field 'id'. The field 'id' has the
- * following description: Primary Key for vamsas object
- * referencing
- *
- *
- * @param id the value of field 'id'.
- */
- public void setId(
- final java.lang.String id) {
- this._id = id;
- }
-
- /**
- *
- *
- * @param index
- * @param vInput
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void setInput(
- final int index,
- final uk.ac.vamsas.objects.core.Input vInput)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._inputList.size()) {
- throw new IndexOutOfBoundsException("setInput: Index value '" + index + "' not in range [0.." + (this._inputList.size() - 1) + "]");
- }
-
- this._inputList.set(index, vInput);
+ if (_date != null && !org.castor.util.CycleBreaker.startingToCycle(_date)) {
+ result = 37 * result + _date.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_date);
}
-
- /**
- *
- *
- * @param vInputArray
- */
- public void setInput(
- final uk.ac.vamsas.objects.core.Input[] vInputArray) {
- //-- copy array
- _inputList.clear();
-
- for (int i = 0; i < vInputArray.length; i++) {
- this._inputList.add(vInputArray[i]);
- }
+ if (_propertyList != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_propertyList)) {
+ result = 37 * result + _propertyList.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_propertyList);
}
-
- /**
- * Sets the value of '_inputList' by copying the given Vector.
- * All elements will be checked for type safety.
- *
- * @param vInputList the Vector to copy.
- */
- public void setInput(
- final java.util.Vector vInputList) {
- // copy vector
- this._inputList.clear();
-
- this._inputList.addAll(vInputList);
+ if (_paramList != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_paramList)) {
+ result = 37 * result + _paramList.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_paramList);
}
-
- /**
- * Sets the value of '_inputList' by setting it to the given
- * Vector. No type checking is performed.
- * @deprecated
- *
- * @param inputVector the Vector to set.
- */
- public void setInputAsReference(
- final java.util.Vector inputVector) {
- this._inputList = inputVector;
+ if (_inputList != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_inputList)) {
+ result = 37 * result + _inputList.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_inputList);
}
- /**
- *
- *
- * @param index
- * @param vParam
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void setParam(
- final int index,
- final uk.ac.vamsas.objects.core.Param vParam)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._paramList.size()) {
- throw new IndexOutOfBoundsException("setParam: Index value '" + index + "' not in range [0.." + (this._paramList.size() - 1) + "]");
- }
-
- this._paramList.set(index, vParam);
+ return result;
+ }
+
+ /**
+ * Method isValid.
+ *
+ * @return true if this object is valid according to the schema
+ */
+ public boolean isValid() {
+ try {
+ validate();
+ } catch (org.exolab.castor.xml.ValidationException vex) {
+ return false;
}
-
- /**
- *
- *
- * @param vParamArray
- */
- public void setParam(
- final uk.ac.vamsas.objects.core.Param[] vParamArray) {
- //-- copy array
- _paramList.clear();
-
- for (int i = 0; i < vParamArray.length; i++) {
- this._paramList.add(vParamArray[i]);
- }
+ return true;
+ }
+
+ /**
+ *
+ *
+ * @param out
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void marshal(final java.io.Writer out)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, out);
+ }
+
+ /**
+ *
+ *
+ * @param handler
+ * @throws java.io.IOException
+ * if an IOException occurs during marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ */
+ public void marshal(final org.xml.sax.ContentHandler handler)
+ throws java.io.IOException, org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, handler);
+ }
+
+ /**
+ */
+ public void removeAllInput() {
+ this._inputList.clear();
+ }
+
+ /**
+ */
+ public void removeAllParam() {
+ this._paramList.clear();
+ }
+
+ /**
+ */
+ public void removeAllProperty() {
+ this._propertyList.clear();
+ }
+
+ /**
+ * Method removeInput.
+ *
+ * @param vInput
+ * @return true if the object was removed from the collection.
+ */
+ public boolean removeInput(final uk.ac.vamsas.objects.core.Input vInput) {
+ boolean removed = _inputList.remove(vInput);
+ return removed;
+ }
+
+ /**
+ * Method removeInputAt.
+ *
+ * @param index
+ * @return the element removed from the collection
+ */
+ public uk.ac.vamsas.objects.core.Input removeInputAt(final int index) {
+ java.lang.Object obj = this._inputList.remove(index);
+ return (uk.ac.vamsas.objects.core.Input) obj;
+ }
+
+ /**
+ * Method removeParam.
+ *
+ * @param vParam
+ * @return true if the object was removed from the collection.
+ */
+ public boolean removeParam(final uk.ac.vamsas.objects.core.Param vParam) {
+ boolean removed = _paramList.remove(vParam);
+ return removed;
+ }
+
+ /**
+ * Method removeParamAt.
+ *
+ * @param index
+ * @return the element removed from the collection
+ */
+ public uk.ac.vamsas.objects.core.Param removeParamAt(final int index) {
+ java.lang.Object obj = this._paramList.remove(index);
+ return (uk.ac.vamsas.objects.core.Param) obj;
+ }
+
+ /**
+ * Method removeProperty.
+ *
+ * @param vProperty
+ * @return true if the object was removed from the collection.
+ */
+ public boolean removeProperty(
+ final uk.ac.vamsas.objects.core.Property vProperty) {
+ boolean removed = _propertyList.remove(vProperty);
+ return removed;
+ }
+
+ /**
+ * Method removePropertyAt.
+ *
+ * @param index
+ * @return the element removed from the collection
+ */
+ public uk.ac.vamsas.objects.core.Property removePropertyAt(final int index) {
+ java.lang.Object obj = this._propertyList.remove(index);
+ return (uk.ac.vamsas.objects.core.Property) obj;
+ }
+
+ /**
+ * Sets the value of field 'action'. The field 'action' has the following
+ * description: Did what
+ *
+ * @param action
+ * the value of field 'action'.
+ */
+ public void setAction(final java.lang.String action) {
+ this._action = action;
+ }
+
+ /**
+ * Sets the value of field 'app'. The field 'app' has the following
+ * description: With which application
+ *
+ * @param app
+ * the value of field 'app'.
+ */
+ public void setApp(final java.lang.String app) {
+ this._app = app;
+ }
+
+ /**
+ * Sets the value of field 'date'. The field 'date' has the following
+ * description: When
+ *
+ * @param date
+ * the value of field 'date'.
+ */
+ public void setDate(final java.util.Date date) {
+ this._date = date;
+ }
+
+ /**
+ * Sets the value of field 'id'. The field 'id' has the following description:
+ * Primary Key for vamsas object referencing
+ *
+ *
+ * @param id
+ * the value of field 'id'.
+ */
+ public void setId(final java.lang.String id) {
+ this._id = id;
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vInput
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void setInput(final int index,
+ final uk.ac.vamsas.objects.core.Input vInput)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._inputList.size()) {
+ throw new IndexOutOfBoundsException("setInput: Index value '" + index
+ + "' not in range [0.." + (this._inputList.size() - 1) + "]");
}
- /**
- * Sets the value of '_paramList' by copying the given Vector.
- * All elements will be checked for type safety.
- *
- * @param vParamList the Vector to copy.
- */
- public void setParam(
- final java.util.Vector vParamList) {
- // copy vector
- this._paramList.clear();
-
- this._paramList.addAll(vParamList);
- }
+ this._inputList.set(index, vInput);
+ }
- /**
- * Sets the value of '_paramList' by setting it to the given
- * Vector. No type checking is performed.
- * @deprecated
- *
- * @param paramVector the Vector to set.
- */
- public void setParamAsReference(
- final java.util.Vector paramVector) {
- this._paramList = paramVector;
- }
+ /**
+ *
+ *
+ * @param vInputArray
+ */
+ public void setInput(final uk.ac.vamsas.objects.core.Input[] vInputArray) {
+ // -- copy array
+ _inputList.clear();
- /**
- *
- *
- * @param index
- * @param vProperty
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void setProperty(
- final int index,
- final uk.ac.vamsas.objects.core.Property vProperty)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._propertyList.size()) {
- throw new IndexOutOfBoundsException("setProperty: Index value '" + index + "' not in range [0.." + (this._propertyList.size() - 1) + "]");
- }
-
- this._propertyList.set(index, vProperty);
+ for (int i = 0; i < vInputArray.length; i++) {
+ this._inputList.add(vInputArray[i]);
}
-
- /**
- *
- *
- * @param vPropertyArray
- */
- public void setProperty(
- final uk.ac.vamsas.objects.core.Property[] vPropertyArray) {
- //-- copy array
- _propertyList.clear();
-
- for (int i = 0; i < vPropertyArray.length; i++) {
- this._propertyList.add(vPropertyArray[i]);
- }
+ }
+
+ /**
+ * Sets the value of '_inputList' by copying the given Vector. All elements
+ * will be checked for type safety.
+ *
+ * @param vInputList
+ * the Vector to copy.
+ */
+ public void setInput(final java.util.Vector vInputList) {
+ // copy vector
+ this._inputList.clear();
+
+ this._inputList.addAll(vInputList);
+ }
+
+ /**
+ * Sets the value of '_inputList' by setting it to the given Vector. No type
+ * checking is performed.
+ *
+ * @deprecated
+ *
+ * @param inputVector
+ * the Vector to set.
+ */
+ public void setInputAsReference(final java.util.Vector inputVector) {
+ this._inputList = inputVector;
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vParam
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void setParam(final int index,
+ final uk.ac.vamsas.objects.core.Param vParam)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._paramList.size()) {
+ throw new IndexOutOfBoundsException("setParam: Index value '" + index
+ + "' not in range [0.." + (this._paramList.size() - 1) + "]");
}
- /**
- * Sets the value of '_propertyList' by copying the given
- * Vector. All elements will be checked for type safety.
- *
- * @param vPropertyList the Vector to copy.
- */
- public void setProperty(
- final java.util.Vector vPropertyList) {
- // copy vector
- this._propertyList.clear();
-
- this._propertyList.addAll(vPropertyList);
- }
+ this._paramList.set(index, vParam);
+ }
- /**
- * Sets the value of '_propertyList' by setting it to the given
- * Vector. No type checking is performed.
- * @deprecated
- *
- * @param propertyVector the Vector to set.
- */
- public void setPropertyAsReference(
- final java.util.Vector propertyVector) {
- this._propertyList = propertyVector;
- }
+ /**
+ *
+ *
+ * @param vParamArray
+ */
+ public void setParam(final uk.ac.vamsas.objects.core.Param[] vParamArray) {
+ // -- copy array
+ _paramList.clear();
- /**
- * Sets the value of field 'user'. The field 'user' has the
- * following description: Who
- *
- * @param user the value of field 'user'.
- */
- public void setUser(
- final java.lang.String user) {
- this._user = user;
+ for (int i = 0; i < vParamArray.length; i++) {
+ this._paramList.add(vParamArray[i]);
}
-
- /**
- * Method unmarshal.
- *
- * @param reader
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @return the unmarshaled uk.ac.vamsas.objects.core.Entry
- */
- public static uk.ac.vamsas.objects.core.Entry unmarshal(
- final java.io.Reader reader)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- return (uk.ac.vamsas.objects.core.Entry) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Entry.class, reader);
+ }
+
+ /**
+ * Sets the value of '_paramList' by copying the given Vector. All elements
+ * will be checked for type safety.
+ *
+ * @param vParamList
+ * the Vector to copy.
+ */
+ public void setParam(final java.util.Vector vParamList) {
+ // copy vector
+ this._paramList.clear();
+
+ this._paramList.addAll(vParamList);
+ }
+
+ /**
+ * Sets the value of '_paramList' by setting it to the given Vector. No type
+ * checking is performed.
+ *
+ * @deprecated
+ *
+ * @param paramVector
+ * the Vector to set.
+ */
+ public void setParamAsReference(final java.util.Vector paramVector) {
+ this._paramList = paramVector;
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vProperty
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void setProperty(final int index,
+ final uk.ac.vamsas.objects.core.Property vProperty)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._propertyList.size()) {
+ throw new IndexOutOfBoundsException("setProperty: Index value '" + index
+ + "' not in range [0.." + (this._propertyList.size() - 1) + "]");
}
- /**
- *
- *
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void validate(
- )
- throws org.exolab.castor.xml.ValidationException {
- org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
- validator.validate(this);
+ this._propertyList.set(index, vProperty);
+ }
+
+ /**
+ *
+ *
+ * @param vPropertyArray
+ */
+ public void setProperty(
+ final uk.ac.vamsas.objects.core.Property[] vPropertyArray) {
+ // -- copy array
+ _propertyList.clear();
+
+ for (int i = 0; i < vPropertyArray.length; i++) {
+ this._propertyList.add(vPropertyArray[i]);
}
+ }
+
+ /**
+ * Sets the value of '_propertyList' by copying the given Vector. All elements
+ * will be checked for type safety.
+ *
+ * @param vPropertyList
+ * the Vector to copy.
+ */
+ public void setProperty(final java.util.Vector vPropertyList) {
+ // copy vector
+ this._propertyList.clear();
+
+ this._propertyList.addAll(vPropertyList);
+ }
+
+ /**
+ * Sets the value of '_propertyList' by setting it to the given Vector. No
+ * type checking is performed.
+ *
+ * @deprecated
+ *
+ * @param propertyVector
+ * the Vector to set.
+ */
+ public void setPropertyAsReference(final java.util.Vector propertyVector) {
+ this._propertyList = propertyVector;
+ }
+
+ /**
+ * Sets the value of field 'user'. The field 'user' has the following
+ * description: Who
+ *
+ * @param user
+ * the value of field 'user'.
+ */
+ public void setUser(final java.lang.String user) {
+ this._user = user;
+ }
+
+ /**
+ * Method unmarshal.
+ *
+ * @param reader
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @return the unmarshaled uk.ac.vamsas.objects.core.Entry
+ */
+ public static uk.ac.vamsas.objects.core.Entry unmarshal(
+ final java.io.Reader reader)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ return (uk.ac.vamsas.objects.core.Entry) Unmarshaller.unmarshal(
+ uk.ac.vamsas.objects.core.Entry.class, reader);
+ }
+
+ /**
+ *
+ *
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void validate() throws org.exolab.castor.xml.ValidationException {
+ org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+ validator.validate(this);
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/Glyph.java b/src/uk/ac/vamsas/objects/core/Glyph.java
index e96b4fd..20fe7d6 100644
--- a/src/uk/ac/vamsas/objects/core/Glyph.java
+++ b/src/uk/ac/vamsas/objects/core/Glyph.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import org.exolab.castor.xml.Marshaller;
@@ -16,272 +30,271 @@ import org.exolab.castor.xml.Unmarshaller;
/**
* Discrete symbol - possibly graphically represented
- *
+ *
*
* @version $Revision$ $Date$
*/
-public class Glyph extends uk.ac.vamsas.client.Vobject
-implements java.io.Serializable
-{
+public class Glyph extends uk.ac.vamsas.client.Vobject implements
+ java.io.Serializable {
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
+ /**
+ * internal content storage
+ */
+ private java.lang.String _content = "";
- /**
- * internal content storage
- */
- private java.lang.String _content = "";
+ /**
+ * specifies the symbol dictionary for this glyph - eg utf8 (the default),
+ * aasecstr_3 or kd_hydrophobicity - the content is not validated so
+ * applications must ensure they gracefully deal with invalid entries here
+ */
+ private java.lang.String _dict = "utf8";
- /**
- * specifies the symbol dictionary for this
- * glyph - eg utf8 (the default), aasecstr_3 or
- * kd_hydrophobicity - the content is not validated so
- * applications must ensure they gracefully deal with
- * invalid entries here
- */
- private java.lang.String _dict = "utf8";
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+ public Glyph() {
+ super();
+ setContent("");
+ setDict("utf8");
+ }
- //----------------/
- //- Constructors -/
- //----------------/
+ // -----------/
+ // - Methods -/
+ // -----------/
- public Glyph() {
- super();
- setContent("");
- setDict("utf8");
- }
+ /**
+ * Overrides the java.lang.Object.equals method.
+ *
+ * @param obj
+ * @return true if the objects are equal.
+ */
+ public boolean equals(final java.lang.Object obj) {
+ if (this == obj)
+ return true;
+ if (super.equals(obj) == false)
+ return false;
- //-----------/
- //- Methods -/
- //-----------/
+ if (obj instanceof Glyph) {
- /**
- * Overrides the java.lang.Object.equals method.
- *
- * @param obj
- * @return true if the objects are equal.
- */
- public boolean equals(
- final java.lang.Object obj) {
- if ( this == obj )
- return true;
-
- if (super.equals(obj)==false)
+ Glyph temp = (Glyph) obj;
+ boolean thcycle;
+ boolean tmcycle;
+ if (this._content != null) {
+ if (temp._content == null)
+ return false;
+ if (this._content != temp._content) {
+ thcycle = org.castor.util.CycleBreaker.startingToCycle(this._content);
+ tmcycle = org.castor.util.CycleBreaker.startingToCycle(temp._content);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._content);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._content);
+ }
+ ;
return false;
-
- if (obj instanceof Glyph) {
-
- Glyph temp = (Glyph)obj;
- boolean thcycle;
- boolean tmcycle;
- if (this._content != null) {
- if (temp._content == null) return false;
- if (this._content != temp._content) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._content);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._content);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._content); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._content); };
- return false;
- }
- if (!thcycle) {
- if (!this._content.equals(temp._content)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._content);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._content);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._content);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._content);
- }
- }
- } else if (temp._content != null)
- return false;
- if (this._dict != null) {
- if (temp._dict == null) return false;
- if (this._dict != temp._dict) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._dict);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._dict);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._dict); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._dict); };
- return false;
- }
- if (!thcycle) {
- if (!this._dict.equals(temp._dict)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._dict);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._dict);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._dict);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._dict);
- }
- }
- } else if (temp._dict != null)
- return false;
- return true;
+ }
+ if (!thcycle) {
+ if (!this._content.equals(temp._content)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._content);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._content);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._content);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._content);
+ }
}
+ } else if (temp._content != null)
return false;
+ if (this._dict != null) {
+ if (temp._dict == null)
+ return false;
+ if (this._dict != temp._dict) {
+ thcycle = org.castor.util.CycleBreaker.startingToCycle(this._dict);
+ tmcycle = org.castor.util.CycleBreaker.startingToCycle(temp._dict);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._dict);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._dict);
+ }
+ ;
+ return false;
+ }
+ if (!thcycle) {
+ if (!this._dict.equals(temp._dict)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._dict);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._dict);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._dict);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._dict);
+ }
+ }
+ } else if (temp._dict != null)
+ return false;
+ return true;
}
+ return false;
+ }
- /**
- * Returns the value of field 'content'. The field 'content'
- * has the following description: internal content storage
- *
- * @return the value of field 'Content'.
- */
- public java.lang.String getContent(
- ) {
- return this._content;
- }
+ /**
+ * Returns the value of field 'content'. The field 'content' has the following
+ * description: internal content storage
+ *
+ * @return the value of field 'Content'.
+ */
+ public java.lang.String getContent() {
+ return this._content;
+ }
- /**
- * Returns the value of field 'dict'. The field 'dict' has the
- * following description: specifies the symbol dictionary for
- * this
- * glyph - eg utf8 (the default), aasecstr_3 or
- * kd_hydrophobicity - the content is not validated so
- * applications must ensure they gracefully deal with
- * invalid entries here
- *
- * @return the value of field 'Dict'.
- */
- public java.lang.String getDict(
- ) {
- return this._dict;
- }
+ /**
+ * Returns the value of field 'dict'. The field 'dict' has the following
+ * description: specifies the symbol dictionary for this glyph - eg utf8 (the
+ * default), aasecstr_3 or kd_hydrophobicity - the content is not validated so
+ * applications must ensure they gracefully deal with invalid entries here
+ *
+ * @return the value of field 'Dict'.
+ */
+ public java.lang.String getDict() {
+ return this._dict;
+ }
- /**
- * Overrides the java.lang.Object.hashCode method.
- *
- * The following steps came from Effective Java Programming
- * Language Guide by Joshua Bloch, Chapter 3
- *
- * @return a hash code value for the object.
- */
- public int hashCode(
- ) {
- int result = super.hashCode();
-
- long tmp;
- if (_content != null
- && !org.castor.util.CycleBreaker.startingToCycle(_content)) {
- result = 37 * result + _content.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_content);
- }
- if (_dict != null
- && !org.castor.util.CycleBreaker.startingToCycle(_dict)) {
- result = 37 * result + _dict.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_dict);
- }
-
- return result;
- }
+ /**
+ * Overrides the java.lang.Object.hashCode method.
+ *
+ * The following steps came from Effective Java Programming Language
+ * Guide by Joshua Bloch, Chapter 3
+ *
+ * @return a hash code value for the object.
+ */
+ public int hashCode() {
+ int result = super.hashCode();
- /**
- * Method isValid.
- *
- * @return true if this object is valid according to the schema
- */
- public boolean isValid(
- ) {
- try {
- validate();
- } catch (org.exolab.castor.xml.ValidationException vex) {
- return false;
- }
- return true;
+ long tmp;
+ if (_content != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_content)) {
+ result = 37 * result + _content.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_content);
}
-
- /**
- *
- *
- * @param out
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void marshal(
- final java.io.Writer out)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, out);
+ if (_dict != null && !org.castor.util.CycleBreaker.startingToCycle(_dict)) {
+ result = 37 * result + _dict.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_dict);
}
- /**
- *
- *
- * @param handler
- * @throws java.io.IOException if an IOException occurs during
- * marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- */
- public void marshal(
- final org.xml.sax.ContentHandler handler)
- throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, handler);
- }
+ return result;
+ }
- /**
- * Sets the value of field 'content'. The field 'content' has
- * the following description: internal content storage
- *
- * @param content the value of field 'content'.
- */
- public void setContent(
- final java.lang.String content) {
- this._content = content;
+ /**
+ * Method isValid.
+ *
+ * @return true if this object is valid according to the schema
+ */
+ public boolean isValid() {
+ try {
+ validate();
+ } catch (org.exolab.castor.xml.ValidationException vex) {
+ return false;
}
+ return true;
+ }
- /**
- * Sets the value of field 'dict'. The field 'dict' has the
- * following description: specifies the symbol dictionary for
- * this
- * glyph - eg utf8 (the default), aasecstr_3 or
- * kd_hydrophobicity - the content is not validated so
- * applications must ensure they gracefully deal with
- * invalid entries here
- *
- * @param dict the value of field 'dict'.
- */
- public void setDict(
- final java.lang.String dict) {
- this._dict = dict;
- }
+ /**
+ *
+ *
+ * @param out
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void marshal(final java.io.Writer out)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, out);
+ }
- /**
- * Method unmarshal.
- *
- * @param reader
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @return the unmarshaled uk.ac.vamsas.objects.core.Glyph
- */
- public static uk.ac.vamsas.objects.core.Glyph unmarshal(
- final java.io.Reader reader)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- return (uk.ac.vamsas.objects.core.Glyph) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Glyph.class, reader);
- }
+ /**
+ *
+ *
+ * @param handler
+ * @throws java.io.IOException
+ * if an IOException occurs during marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ */
+ public void marshal(final org.xml.sax.ContentHandler handler)
+ throws java.io.IOException, org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, handler);
+ }
- /**
- *
- *
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void validate(
- )
- throws org.exolab.castor.xml.ValidationException {
- org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
- validator.validate(this);
- }
+ /**
+ * Sets the value of field 'content'. The field 'content' has the following
+ * description: internal content storage
+ *
+ * @param content
+ * the value of field 'content'.
+ */
+ public void setContent(final java.lang.String content) {
+ this._content = content;
+ }
+
+ /**
+ * Sets the value of field 'dict'. The field 'dict' has the following
+ * description: specifies the symbol dictionary for this glyph - eg utf8 (the
+ * default), aasecstr_3 or kd_hydrophobicity - the content is not validated so
+ * applications must ensure they gracefully deal with invalid entries here
+ *
+ * @param dict
+ * the value of field 'dict'.
+ */
+ public void setDict(final java.lang.String dict) {
+ this._dict = dict;
+ }
+
+ /**
+ * Method unmarshal.
+ *
+ * @param reader
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @return the unmarshaled uk.ac.vamsas.objects.core.Glyph
+ */
+ public static uk.ac.vamsas.objects.core.Glyph unmarshal(
+ final java.io.Reader reader)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ return (uk.ac.vamsas.objects.core.Glyph) Unmarshaller.unmarshal(
+ uk.ac.vamsas.objects.core.Glyph.class, reader);
+ }
+
+ /**
+ *
+ *
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void validate() throws org.exolab.castor.xml.ValidationException {
+ org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+ validator.validate(this);
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/Input.java b/src/uk/ac/vamsas/objects/core/Input.java
index b5b2de9..3911cdc 100644
--- a/src/uk/ac/vamsas/objects/core/Input.java
+++ b/src/uk/ac/vamsas/objects/core/Input.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import org.exolab.castor.xml.Marshaller;
@@ -19,416 +33,412 @@ import org.exolab.castor.xml.Unmarshaller;
*
* @version $Revision$ $Date$
*/
-public class Input extends uk.ac.vamsas.objects.core.RangeType
-implements java.io.Serializable
-{
-
-
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
- * Field _name.
- */
- private java.lang.String _name;
-
- /**
- * Reference Frame for rangeType specfication
- *
- */
- private java.util.Vector _objRef;
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public Input() {
- super();
- this._objRef = new java.util.Vector();
- }
-
-
- //-----------/
- //- Methods -/
- //-----------/
-
- /**
- *
- *
- * @param vObjRef
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addObjRef(
- final java.lang.Object vObjRef)
- throws java.lang.IndexOutOfBoundsException {
- this._objRef.addElement(vObjRef);
- }
-
- /**
- *
- *
- * @param index
- * @param vObjRef
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addObjRef(
- final int index,
- final java.lang.Object vObjRef)
- throws java.lang.IndexOutOfBoundsException {
- this._objRef.add(index, vObjRef);
- }
-
- /**
- * Method enumerateObjRef.
- *
- * @return an Enumeration over all java.lang.Object elements
- */
- public java.util.Enumeration enumerateObjRef(
- ) {
- return this._objRef.elements();
- }
-
- /**
- * Overrides the java.lang.Object.equals method.
- *
- * @param obj
- * @return true if the objects are equal.
- */
- public boolean equals(
- final java.lang.Object obj) {
- if ( this == obj )
- return true;
-
- if (super.equals(obj)==false)
+public class Input extends uk.ac.vamsas.objects.core.RangeType implements
+ java.io.Serializable {
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * Field _name.
+ */
+ private java.lang.String _name;
+
+ /**
+ * Reference Frame for rangeType specfication
+ *
+ */
+ private java.util.Vector _objRef;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public Input() {
+ super();
+ this._objRef = new java.util.Vector();
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ *
+ *
+ * @param vObjRef
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addObjRef(final java.lang.Object vObjRef)
+ throws java.lang.IndexOutOfBoundsException {
+ this._objRef.addElement(vObjRef);
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vObjRef
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addObjRef(final int index, final java.lang.Object vObjRef)
+ throws java.lang.IndexOutOfBoundsException {
+ this._objRef.add(index, vObjRef);
+ }
+
+ /**
+ * Method enumerateObjRef.
+ *
+ * @return an Enumeration over all java.lang.Object elements
+ */
+ public java.util.Enumeration enumerateObjRef() {
+ return this._objRef.elements();
+ }
+
+ /**
+ * Overrides the java.lang.Object.equals method.
+ *
+ * @param obj
+ * @return true if the objects are equal.
+ */
+ public boolean equals(final java.lang.Object obj) {
+ if (this == obj)
+ return true;
+
+ if (super.equals(obj) == false)
+ return false;
+
+ if (obj instanceof Input) {
+
+ Input temp = (Input) obj;
+ boolean thcycle;
+ boolean tmcycle;
+ if (this._name != null) {
+ if (temp._name == null)
+ return false;
+ if (this._name != temp._name) {
+ thcycle = org.castor.util.CycleBreaker.startingToCycle(this._name);
+ tmcycle = org.castor.util.CycleBreaker.startingToCycle(temp._name);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._name);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._name);
+ }
+ ;
return false;
-
- if (obj instanceof Input) {
-
- Input temp = (Input)obj;
- boolean thcycle;
- boolean tmcycle;
- if (this._name != null) {
- if (temp._name == null) return false;
- if (this._name != temp._name) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._name);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._name);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._name); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._name); };
- return false;
- }
- if (!thcycle) {
- if (!this._name.equals(temp._name)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._name);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._name);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._name);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._name);
- }
- }
- } else if (temp._name != null)
- return false;
- if (this._objRef != null) {
- if (temp._objRef == null) return false;
- if (this._objRef != temp._objRef) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._objRef);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._objRef);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._objRef); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._objRef); };
- return false;
- }
- if (!thcycle) {
- if (!this._objRef.equals(temp._objRef)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._objRef);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._objRef);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._objRef);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._objRef);
- }
- }
- } else if (temp._objRef != null)
- return false;
- return true;
+ }
+ if (!thcycle) {
+ if (!this._name.equals(temp._name)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._name);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._name);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._name);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._name);
+ }
}
+ } else if (temp._name != null)
return false;
- }
-
- /**
- * Returns the value of field 'name'.
- *
- * @return the value of field 'Name'.
- */
- public java.lang.String getName(
- ) {
- return this._name;
- }
-
- /**
- * Method getObjRef.
- *
- * @param index
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- * @return the value of the java.lang.Object at the given index
- */
- public java.lang.Object getObjRef(
- final int index)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._objRef.size()) {
- throw new IndexOutOfBoundsException("getObjRef: Index value '" + index + "' not in range [0.." + (this._objRef.size() - 1) + "]");
- }
-
- return _objRef.get(index);
- }
-
- /**
- * Method getObjRef.Returns the contents of the collection in
- * an Array.
Note: Just in case the collection contents
- * are changing in another thread, we pass a 0-length Array of
- * the correct type into the API call. This way we know
- * that the Array returned is of exactly the correct length.
- *
- * @return this collection as an Array
- */
- public java.lang.Object[] getObjRef(
- ) {
- java.lang.Object[] array = new java.lang.Object[0];
- return (java.lang.Object[]) this._objRef.toArray(array);
- }
-
- /**
- * Method getObjRefAsReference.Returns a reference to
- * '_objRef'. No type checking is performed on any
- * modifications to the Vector.
- *
- * @return a reference to the Vector backing this class
- */
- public java.util.Vector getObjRefAsReference(
- ) {
- return this._objRef;
- }
-
- /**
- * Method getObjRefCount.
- *
- * @return the size of this collection
- */
- public int getObjRefCount(
- ) {
- return this._objRef.size();
- }
-
- /**
- * Overrides the java.lang.Object.hashCode method.
- *
- * The following steps came from Effective Java Programming
- * Language Guide by Joshua Bloch, Chapter 3
- *
- * @return a hash code value for the object.
- */
- public int hashCode(
- ) {
- int result = super.hashCode();
-
- long tmp;
- if (_name != null
- && !org.castor.util.CycleBreaker.startingToCycle(_name)) {
- result = 37 * result + _name.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_name);
- }
- if (_objRef != null
- && !org.castor.util.CycleBreaker.startingToCycle(_objRef)) {
- result = 37 * result + _objRef.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_objRef);
- }
-
- return result;
- }
-
- /**
- * Method isValid.
- *
- * @return true if this object is valid according to the schema
- */
- public boolean isValid(
- ) {
- try {
- validate();
- } catch (org.exolab.castor.xml.ValidationException vex) {
+ if (this._objRef != null) {
+ if (temp._objRef == null)
+ return false;
+ if (this._objRef != temp._objRef) {
+ thcycle = org.castor.util.CycleBreaker.startingToCycle(this._objRef);
+ tmcycle = org.castor.util.CycleBreaker.startingToCycle(temp._objRef);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._objRef);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._objRef);
+ }
+ ;
return false;
+ }
+ if (!thcycle) {
+ if (!this._objRef.equals(temp._objRef)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._objRef);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._objRef);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._objRef);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._objRef);
+ }
}
- return true;
- }
-
- /**
- *
- *
- * @param out
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void marshal(
- final java.io.Writer out)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, out);
- }
-
- /**
- *
- *
- * @param handler
- * @throws java.io.IOException if an IOException occurs during
- * marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- */
- public void marshal(
- final org.xml.sax.ContentHandler handler)
- throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, handler);
- }
-
- /**
- */
- public void removeAllObjRef(
- ) {
- this._objRef.clear();
+ } else if (temp._objRef != null)
+ return false;
+ return true;
}
-
- /**
- * Method removeObjRef.
- *
- * @param vObjRef
- * @return true if the object was removed from the collection.
- */
- public boolean removeObjRef(
- final java.lang.Object vObjRef) {
- boolean removed = _objRef.remove(vObjRef);
- return removed;
+ return false;
+ }
+
+ /**
+ * Returns the value of field 'name'.
+ *
+ * @return the value of field 'Name'.
+ */
+ public java.lang.String getName() {
+ return this._name;
+ }
+
+ /**
+ * Method getObjRef.
+ *
+ * @param index
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ * @return the value of the java.lang.Object at the given index
+ */
+ public java.lang.Object getObjRef(final int index)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._objRef.size()) {
+ throw new IndexOutOfBoundsException("getObjRef: Index value '" + index
+ + "' not in range [0.." + (this._objRef.size() - 1) + "]");
}
- /**
- * Method removeObjRefAt.
- *
- * @param index
- * @return the element removed from the collection
- */
- public java.lang.Object removeObjRefAt(
- final int index) {
- java.lang.Object obj = this._objRef.remove(index);
- return obj;
+ return _objRef.get(index);
+ }
+
+ /**
+ * Method getObjRef.Returns the contents of the collection in an Array.
+ *
+ * Note: Just in case the collection contents are changing in another thread,
+ * we pass a 0-length Array of the correct type into the API call. This way we
+ * know that the Array returned is of exactly the correct length.
+ *
+ * @return this collection as an Array
+ */
+ public java.lang.Object[] getObjRef() {
+ java.lang.Object[] array = new java.lang.Object[0];
+ return (java.lang.Object[]) this._objRef.toArray(array);
+ }
+
+ /**
+ * Method getObjRefAsReference.Returns a reference to '_objRef'. No type
+ * checking is performed on any modifications to the Vector.
+ *
+ * @return a reference to the Vector backing this class
+ */
+ public java.util.Vector getObjRefAsReference() {
+ return this._objRef;
+ }
+
+ /**
+ * Method getObjRefCount.
+ *
+ * @return the size of this collection
+ */
+ public int getObjRefCount() {
+ return this._objRef.size();
+ }
+
+ /**
+ * Overrides the java.lang.Object.hashCode method.
+ *
+ * The following steps came from Effective Java Programming Language
+ * Guide by Joshua Bloch, Chapter 3
+ *
+ * @return a hash code value for the object.
+ */
+ public int hashCode() {
+ int result = super.hashCode();
+
+ long tmp;
+ if (_name != null && !org.castor.util.CycleBreaker.startingToCycle(_name)) {
+ result = 37 * result + _name.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_name);
}
-
- /**
- * Sets the value of field 'name'.
- *
- * @param name the value of field 'name'.
- */
- public void setName(
- final java.lang.String name) {
- this._name = name;
+ if (_objRef != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_objRef)) {
+ result = 37 * result + _objRef.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_objRef);
}
- /**
- *
- *
- * @param index
- * @param vObjRef
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void setObjRef(
- final int index,
- final java.lang.Object vObjRef)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._objRef.size()) {
- throw new IndexOutOfBoundsException("setObjRef: Index value '" + index + "' not in range [0.." + (this._objRef.size() - 1) + "]");
- }
-
- this._objRef.set(index, vObjRef);
+ return result;
+ }
+
+ /**
+ * Method isValid.
+ *
+ * @return true if this object is valid according to the schema
+ */
+ public boolean isValid() {
+ try {
+ validate();
+ } catch (org.exolab.castor.xml.ValidationException vex) {
+ return false;
}
-
- /**
- *
- *
- * @param vObjRefArray
+ return true;
+ }
+
+ /**
+ *
+ *
+ * @param out
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void marshal(final java.io.Writer out)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, out);
+ }
+
+ /**
+ *
+ *
+ * @param handler
+ * @throws java.io.IOException
+ * if an IOException occurs during marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ */
+ public void marshal(final org.xml.sax.ContentHandler handler)
+ throws java.io.IOException, org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, handler);
+ }
+
+ /**
*/
- public void setObjRef(
- final java.lang.Object[] vObjRefArray) {
- //-- copy array
- _objRef.clear();
-
- for (int i = 0; i < vObjRefArray.length; i++) {
- this._objRef.add(vObjRefArray[i]);
- }
+ public void removeAllObjRef() {
+ this._objRef.clear();
+ }
+
+ /**
+ * Method removeObjRef.
+ *
+ * @param vObjRef
+ * @return true if the object was removed from the collection.
+ */
+ public boolean removeObjRef(final java.lang.Object vObjRef) {
+ boolean removed = _objRef.remove(vObjRef);
+ return removed;
+ }
+
+ /**
+ * Method removeObjRefAt.
+ *
+ * @param index
+ * @return the element removed from the collection
+ */
+ public java.lang.Object removeObjRefAt(final int index) {
+ java.lang.Object obj = this._objRef.remove(index);
+ return obj;
+ }
+
+ /**
+ * Sets the value of field 'name'.
+ *
+ * @param name
+ * the value of field 'name'.
+ */
+ public void setName(final java.lang.String name) {
+ this._name = name;
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vObjRef
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void setObjRef(final int index, final java.lang.Object vObjRef)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._objRef.size()) {
+ throw new IndexOutOfBoundsException("setObjRef: Index value '" + index
+ + "' not in range [0.." + (this._objRef.size() - 1) + "]");
}
- /**
- * Sets the value of '_objRef' by copying the given Vector. All
- * elements will be checked for type safety.
- *
- * @param vObjRefList the Vector to copy.
- */
- public void setObjRef(
- final java.util.Vector vObjRefList) {
- // copy vector
- this._objRef.clear();
-
- this._objRef.addAll(vObjRefList);
- }
+ this._objRef.set(index, vObjRef);
+ }
- /**
- * Sets the value of '_objRef' by setting it to the given
- * Vector. No type checking is performed.
- * @deprecated
- *
- * @param objRefVector the Vector to set.
- */
- public void setObjRefAsReference(
- final java.util.Vector objRefVector) {
- this._objRef = objRefVector;
- }
+ /**
+ *
+ *
+ * @param vObjRefArray
+ */
+ public void setObjRef(final java.lang.Object[] vObjRefArray) {
+ // -- copy array
+ _objRef.clear();
- /**
- * Method unmarshal.
- *
- * @param reader
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @return the unmarshaled uk.ac.vamsas.objects.core.RangeType
- */
- public static uk.ac.vamsas.objects.core.RangeType unmarshal(
- final java.io.Reader reader)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- return (uk.ac.vamsas.objects.core.RangeType) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Input.class, reader);
- }
-
- /**
- *
- *
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void validate(
- )
- throws org.exolab.castor.xml.ValidationException {
- org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
- validator.validate(this);
+ for (int i = 0; i < vObjRefArray.length; i++) {
+ this._objRef.add(vObjRefArray[i]);
}
+ }
+
+ /**
+ * Sets the value of '_objRef' by copying the given Vector. All elements will
+ * be checked for type safety.
+ *
+ * @param vObjRefList
+ * the Vector to copy.
+ */
+ public void setObjRef(final java.util.Vector vObjRefList) {
+ // copy vector
+ this._objRef.clear();
+
+ this._objRef.addAll(vObjRefList);
+ }
+
+ /**
+ * Sets the value of '_objRef' by setting it to the given Vector. No type
+ * checking is performed.
+ *
+ * @deprecated
+ *
+ * @param objRefVector
+ * the Vector to set.
+ */
+ public void setObjRefAsReference(final java.util.Vector objRefVector) {
+ this._objRef = objRefVector;
+ }
+
+ /**
+ * Method unmarshal.
+ *
+ * @param reader
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @return the unmarshaled uk.ac.vamsas.objects.core.RangeType
+ */
+ public static uk.ac.vamsas.objects.core.RangeType unmarshal(
+ final java.io.Reader reader)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ return (uk.ac.vamsas.objects.core.RangeType) Unmarshaller.unmarshal(
+ uk.ac.vamsas.objects.core.Input.class, reader);
+ }
+
+ /**
+ *
+ *
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void validate() throws org.exolab.castor.xml.ValidationException {
+ org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+ validator.validate(this);
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/Instance.java b/src/uk/ac/vamsas/objects/core/Instance.java
index 9ffd596..a116b6a 100644
--- a/src/uk/ac/vamsas/objects/core/Instance.java
+++ b/src/uk/ac/vamsas/objects/core/Instance.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import org.exolab.castor.xml.Marshaller;
@@ -19,196 +33,197 @@ import org.exolab.castor.xml.Unmarshaller;
*
* @version $Revision$ $Date$
*/
-public class Instance extends uk.ac.vamsas.objects.core.AppData
-implements java.io.Serializable
-{
-
-
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
- * Field _urn.
- */
- private java.lang.String _urn;
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public Instance() {
- super();
- }
-
-
- //-----------/
- //- Methods -/
- //-----------/
-
- /**
- * Overrides the java.lang.Object.equals method.
- *
- * @param obj
- * @return true if the objects are equal.
- */
- public boolean equals(
- final java.lang.Object obj) {
- if ( this == obj )
- return true;
-
- if (super.equals(obj)==false)
+public class Instance extends uk.ac.vamsas.objects.core.AppData implements
+ java.io.Serializable {
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * Field _urn.
+ */
+ private java.lang.String _urn;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public Instance() {
+ super();
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ * Overrides the java.lang.Object.equals method.
+ *
+ * @param obj
+ * @return true if the objects are equal.
+ */
+ public boolean equals(final java.lang.Object obj) {
+ if (this == obj)
+ return true;
+
+ if (super.equals(obj) == false)
+ return false;
+
+ if (obj instanceof Instance) {
+
+ Instance temp = (Instance) obj;
+ boolean thcycle;
+ boolean tmcycle;
+ if (this._urn != null) {
+ if (temp._urn == null)
+ return false;
+ if (this._urn != temp._urn) {
+ thcycle = org.castor.util.CycleBreaker.startingToCycle(this._urn);
+ tmcycle = org.castor.util.CycleBreaker.startingToCycle(temp._urn);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._urn);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._urn);
+ }
+ ;
return false;
-
- if (obj instanceof Instance) {
-
- Instance temp = (Instance)obj;
- boolean thcycle;
- boolean tmcycle;
- if (this._urn != null) {
- if (temp._urn == null) return false;
- if (this._urn != temp._urn) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._urn);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._urn);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._urn); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._urn); };
- return false;
- }
- if (!thcycle) {
- if (!this._urn.equals(temp._urn)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._urn);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._urn);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._urn);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._urn);
- }
- }
- } else if (temp._urn != null)
- return false;
- return true;
+ }
+ if (!thcycle) {
+ if (!this._urn.equals(temp._urn)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._urn);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._urn);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._urn);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._urn);
+ }
}
+ } else if (temp._urn != null)
return false;
+ return true;
}
-
- /**
- * Returns the value of field 'urn'.
- *
- * @return the value of field 'Urn'.
- */
- public java.lang.String getUrn(
- ) {
- return this._urn;
- }
-
- /**
- * Overrides the java.lang.Object.hashCode method.
- *
- * The following steps came from Effective Java Programming
- * Language Guide by Joshua Bloch, Chapter 3
- *
- * @return a hash code value for the object.
- */
- public int hashCode(
- ) {
- int result = super.hashCode();
-
- long tmp;
- if (_urn != null
- && !org.castor.util.CycleBreaker.startingToCycle(_urn)) {
- result = 37 * result + _urn.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_urn);
- }
-
- return result;
- }
-
- /**
- * Method isValid.
- *
- * @return true if this object is valid according to the schema
- */
- public boolean isValid(
- ) {
- try {
- validate();
- } catch (org.exolab.castor.xml.ValidationException vex) {
- return false;
- }
- return true;
- }
-
- /**
- *
- *
- * @param out
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void marshal(
- final java.io.Writer out)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, out);
- }
-
- /**
- *
- *
- * @param handler
- * @throws java.io.IOException if an IOException occurs during
- * marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- */
- public void marshal(
- final org.xml.sax.ContentHandler handler)
- throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, handler);
- }
-
- /**
- * Sets the value of field 'urn'.
- *
- * @param urn the value of field 'urn'.
- */
- public void setUrn(
- final java.lang.String urn) {
- this._urn = urn;
- }
-
- /**
- * Method unmarshal.
- *
- * @param reader
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @return the unmarshaled uk.ac.vamsas.objects.core.AppData
- */
- public static uk.ac.vamsas.objects.core.AppData unmarshal(
- final java.io.Reader reader)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- return (uk.ac.vamsas.objects.core.AppData) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Instance.class, reader);
+ return false;
+ }
+
+ /**
+ * Returns the value of field 'urn'.
+ *
+ * @return the value of field 'Urn'.
+ */
+ public java.lang.String getUrn() {
+ return this._urn;
+ }
+
+ /**
+ * Overrides the java.lang.Object.hashCode method.
+ *
+ * The following steps came from Effective Java Programming Language
+ * Guide by Joshua Bloch, Chapter 3
+ *
+ * @return a hash code value for the object.
+ */
+ public int hashCode() {
+ int result = super.hashCode();
+
+ long tmp;
+ if (_urn != null && !org.castor.util.CycleBreaker.startingToCycle(_urn)) {
+ result = 37 * result + _urn.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_urn);
}
- /**
- *
- *
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void validate(
- )
- throws org.exolab.castor.xml.ValidationException {
- org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
- validator.validate(this);
+ return result;
+ }
+
+ /**
+ * Method isValid.
+ *
+ * @return true if this object is valid according to the schema
+ */
+ public boolean isValid() {
+ try {
+ validate();
+ } catch (org.exolab.castor.xml.ValidationException vex) {
+ return false;
}
+ return true;
+ }
+
+ /**
+ *
+ *
+ * @param out
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void marshal(final java.io.Writer out)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, out);
+ }
+
+ /**
+ *
+ *
+ * @param handler
+ * @throws java.io.IOException
+ * if an IOException occurs during marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ */
+ public void marshal(final org.xml.sax.ContentHandler handler)
+ throws java.io.IOException, org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, handler);
+ }
+
+ /**
+ * Sets the value of field 'urn'.
+ *
+ * @param urn
+ * the value of field 'urn'.
+ */
+ public void setUrn(final java.lang.String urn) {
+ this._urn = urn;
+ }
+
+ /**
+ * Method unmarshal.
+ *
+ * @param reader
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @return the unmarshaled uk.ac.vamsas.objects.core.AppData
+ */
+ public static uk.ac.vamsas.objects.core.AppData unmarshal(
+ final java.io.Reader reader)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ return (uk.ac.vamsas.objects.core.AppData) Unmarshaller.unmarshal(
+ uk.ac.vamsas.objects.core.Instance.class, reader);
+ }
+
+ /**
+ *
+ *
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void validate() throws org.exolab.castor.xml.ValidationException {
+ org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+ validator.validate(this);
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/Link.java b/src/uk/ac/vamsas/objects/core/Link.java
index 17633cf..5c34acb 100644
--- a/src/uk/ac/vamsas/objects/core/Link.java
+++ b/src/uk/ac/vamsas/objects/core/Link.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import org.exolab.castor.xml.Marshaller;
@@ -19,253 +33,260 @@ import org.exolab.castor.xml.Unmarshaller;
*
* @version $Revision$ $Date$
*/
-public class Link extends uk.ac.vamsas.client.Vobject
-implements java.io.Serializable
-{
+public class Link extends uk.ac.vamsas.client.Vobject implements
+ java.io.Serializable {
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
+ /**
+ * internal content storage
+ */
+ private java.lang.String _content = "";
- /**
- * internal content storage
- */
- private java.lang.String _content = "";
+ /**
+ * The URI
+ */
+ private java.lang.String _href;
- /**
- * The URI
- */
- private java.lang.String _href;
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+ public Link() {
+ super();
+ setContent("");
+ }
- //----------------/
- //- Constructors -/
- //----------------/
+ // -----------/
+ // - Methods -/
+ // -----------/
- public Link() {
- super();
- setContent("");
- }
+ /**
+ * Overrides the java.lang.Object.equals method.
+ *
+ * @param obj
+ * @return true if the objects are equal.
+ */
+ public boolean equals(final java.lang.Object obj) {
+ if (this == obj)
+ return true;
+ if (super.equals(obj) == false)
+ return false;
- //-----------/
- //- Methods -/
- //-----------/
+ if (obj instanceof Link) {
- /**
- * Overrides the java.lang.Object.equals method.
- *
- * @param obj
- * @return true if the objects are equal.
- */
- public boolean equals(
- final java.lang.Object obj) {
- if ( this == obj )
- return true;
-
- if (super.equals(obj)==false)
+ Link temp = (Link) obj;
+ boolean thcycle;
+ boolean tmcycle;
+ if (this._content != null) {
+ if (temp._content == null)
+ return false;
+ if (this._content != temp._content) {
+ thcycle = org.castor.util.CycleBreaker.startingToCycle(this._content);
+ tmcycle = org.castor.util.CycleBreaker.startingToCycle(temp._content);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._content);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._content);
+ }
+ ;
return false;
-
- if (obj instanceof Link) {
-
- Link temp = (Link)obj;
- boolean thcycle;
- boolean tmcycle;
- if (this._content != null) {
- if (temp._content == null) return false;
- if (this._content != temp._content) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._content);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._content);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._content); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._content); };
- return false;
- }
- if (!thcycle) {
- if (!this._content.equals(temp._content)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._content);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._content);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._content);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._content);
- }
- }
- } else if (temp._content != null)
- return false;
- if (this._href != null) {
- if (temp._href == null) return false;
- if (this._href != temp._href) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._href);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._href);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._href); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._href); };
- return false;
- }
- if (!thcycle) {
- if (!this._href.equals(temp._href)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._href);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._href);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._href);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._href);
- }
- }
- } else if (temp._href != null)
- return false;
- return true;
+ }
+ if (!thcycle) {
+ if (!this._content.equals(temp._content)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._content);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._content);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._content);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._content);
+ }
}
+ } else if (temp._content != null)
return false;
+ if (this._href != null) {
+ if (temp._href == null)
+ return false;
+ if (this._href != temp._href) {
+ thcycle = org.castor.util.CycleBreaker.startingToCycle(this._href);
+ tmcycle = org.castor.util.CycleBreaker.startingToCycle(temp._href);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._href);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._href);
+ }
+ ;
+ return false;
+ }
+ if (!thcycle) {
+ if (!this._href.equals(temp._href)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._href);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._href);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._href);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._href);
+ }
+ }
+ } else if (temp._href != null)
+ return false;
+ return true;
}
+ return false;
+ }
- /**
- * Returns the value of field 'content'. The field 'content'
- * has the following description: internal content storage
- *
- * @return the value of field 'Content'.
- */
- public java.lang.String getContent(
- ) {
- return this._content;
- }
+ /**
+ * Returns the value of field 'content'. The field 'content' has the following
+ * description: internal content storage
+ *
+ * @return the value of field 'Content'.
+ */
+ public java.lang.String getContent() {
+ return this._content;
+ }
- /**
- * Returns the value of field 'href'. The field 'href' has the
- * following description: The URI
- *
- * @return the value of field 'Href'.
- */
- public java.lang.String getHref(
- ) {
- return this._href;
- }
+ /**
+ * Returns the value of field 'href'. The field 'href' has the following
+ * description: The URI
+ *
+ * @return the value of field 'Href'.
+ */
+ public java.lang.String getHref() {
+ return this._href;
+ }
- /**
- * Overrides the java.lang.Object.hashCode method.
- *
- * The following steps came from Effective Java Programming
- * Language Guide by Joshua Bloch, Chapter 3
- *
- * @return a hash code value for the object.
- */
- public int hashCode(
- ) {
- int result = super.hashCode();
-
- long tmp;
- if (_content != null
- && !org.castor.util.CycleBreaker.startingToCycle(_content)) {
- result = 37 * result + _content.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_content);
- }
- if (_href != null
- && !org.castor.util.CycleBreaker.startingToCycle(_href)) {
- result = 37 * result + _href.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_href);
- }
-
- return result;
- }
+ /**
+ * Overrides the java.lang.Object.hashCode method.
+ *
+ * The following steps came from Effective Java Programming Language
+ * Guide by Joshua Bloch, Chapter 3
+ *
+ * @return a hash code value for the object.
+ */
+ public int hashCode() {
+ int result = super.hashCode();
- /**
- * Method isValid.
- *
- * @return true if this object is valid according to the schema
- */
- public boolean isValid(
- ) {
- try {
- validate();
- } catch (org.exolab.castor.xml.ValidationException vex) {
- return false;
- }
- return true;
+ long tmp;
+ if (_content != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_content)) {
+ result = 37 * result + _content.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_content);
}
-
- /**
- *
- *
- * @param out
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void marshal(
- final java.io.Writer out)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, out);
+ if (_href != null && !org.castor.util.CycleBreaker.startingToCycle(_href)) {
+ result = 37 * result + _href.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_href);
}
- /**
- *
- *
- * @param handler
- * @throws java.io.IOException if an IOException occurs during
- * marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- */
- public void marshal(
- final org.xml.sax.ContentHandler handler)
- throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, handler);
- }
+ return result;
+ }
- /**
- * Sets the value of field 'content'. The field 'content' has
- * the following description: internal content storage
- *
- * @param content the value of field 'content'.
- */
- public void setContent(
- final java.lang.String content) {
- this._content = content;
+ /**
+ * Method isValid.
+ *
+ * @return true if this object is valid according to the schema
+ */
+ public boolean isValid() {
+ try {
+ validate();
+ } catch (org.exolab.castor.xml.ValidationException vex) {
+ return false;
}
+ return true;
+ }
- /**
- * Sets the value of field 'href'. The field 'href' has the
- * following description: The URI
- *
- * @param href the value of field 'href'.
- */
- public void setHref(
- final java.lang.String href) {
- this._href = href;
- }
+ /**
+ *
+ *
+ * @param out
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void marshal(final java.io.Writer out)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, out);
+ }
- /**
- * Method unmarshal.
- *
- * @param reader
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @return the unmarshaled uk.ac.vamsas.objects.core.Link
- */
- public static uk.ac.vamsas.objects.core.Link unmarshal(
- final java.io.Reader reader)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- return (uk.ac.vamsas.objects.core.Link) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Link.class, reader);
- }
+ /**
+ *
+ *
+ * @param handler
+ * @throws java.io.IOException
+ * if an IOException occurs during marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ */
+ public void marshal(final org.xml.sax.ContentHandler handler)
+ throws java.io.IOException, org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, handler);
+ }
- /**
- *
- *
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void validate(
- )
- throws org.exolab.castor.xml.ValidationException {
- org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
- validator.validate(this);
- }
+ /**
+ * Sets the value of field 'content'. The field 'content' has the following
+ * description: internal content storage
+ *
+ * @param content
+ * the value of field 'content'.
+ */
+ public void setContent(final java.lang.String content) {
+ this._content = content;
+ }
+
+ /**
+ * Sets the value of field 'href'. The field 'href' has the following
+ * description: The URI
+ *
+ * @param href
+ * the value of field 'href'.
+ */
+ public void setHref(final java.lang.String href) {
+ this._href = href;
+ }
+
+ /**
+ * Method unmarshal.
+ *
+ * @param reader
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @return the unmarshaled uk.ac.vamsas.objects.core.Link
+ */
+ public static uk.ac.vamsas.objects.core.Link unmarshal(
+ final java.io.Reader reader)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ return (uk.ac.vamsas.objects.core.Link) Unmarshaller.unmarshal(
+ uk.ac.vamsas.objects.core.Link.class, reader);
+ }
+
+ /**
+ *
+ *
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void validate() throws org.exolab.castor.xml.ValidationException {
+ org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+ validator.validate(this);
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/Local.java b/src/uk/ac/vamsas/objects/core/Local.java
index 8b58b7c..e291177 100644
--- a/src/uk/ac/vamsas/objects/core/Local.java
+++ b/src/uk/ac/vamsas/objects/core/Local.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import org.exolab.castor.xml.Marshaller;
@@ -19,136 +33,132 @@ import org.exolab.castor.xml.Unmarshaller;
*
* @version $Revision$ $Date$
*/
-public class Local extends MapRangeType
-implements java.io.Serializable
-{
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public Local() {
- super();
- }
+public class Local extends MapRangeType implements java.io.Serializable {
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
- //-----------/
- //- Methods -/
- //-----------/
-
- /**
- * Overrides the java.lang.Object.equals method.
- *
- * @param obj
- * @return true if the objects are equal.
- */
- public boolean equals(
- final java.lang.Object obj) {
- if ( this == obj )
- return true;
-
- if (super.equals(obj)==false)
- return false;
-
- if (obj instanceof Local) {
-
- return true;
- }
- return false;
- }
+ public Local() {
+ super();
+ }
- /**
- * Overrides the java.lang.Object.hashCode method.
- *
- * The following steps came from Effective Java Programming
- * Language Guide by Joshua Bloch, Chapter 3
- *
- * @return a hash code value for the object.
- */
- public int hashCode(
- ) {
- int result = super.hashCode();
-
- long tmp;
-
- return result;
- }
+ // -----------/
+ // - Methods -/
+ // -----------/
- /**
- * Method isValid.
- *
- * @return true if this object is valid according to the schema
- */
- public boolean isValid(
- ) {
- try {
- validate();
- } catch (org.exolab.castor.xml.ValidationException vex) {
- return false;
- }
- return true;
- }
+ /**
+ * Overrides the java.lang.Object.equals method.
+ *
+ * @param obj
+ * @return true if the objects are equal.
+ */
+ public boolean equals(final java.lang.Object obj) {
+ if (this == obj)
+ return true;
- /**
- *
- *
- * @param out
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void marshal(
- final java.io.Writer out)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, out);
- }
+ if (super.equals(obj) == false)
+ return false;
- /**
- *
- *
- * @param handler
- * @throws java.io.IOException if an IOException occurs during
- * marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- */
- public void marshal(
- final org.xml.sax.ContentHandler handler)
- throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, handler);
- }
+ if (obj instanceof Local) {
- /**
- * Method unmarshal.
- *
- * @param reader
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @return the unmarshaled uk.ac.vamsas.objects.core.RangeType
- */
- public static uk.ac.vamsas.objects.core.RangeType unmarshal(
- final java.io.Reader reader)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- return (uk.ac.vamsas.objects.core.RangeType) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Local.class, reader);
+ return true;
}
-
- /**
- *
- *
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void validate(
- )
- throws org.exolab.castor.xml.ValidationException {
- org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
- validator.validate(this);
+ return false;
+ }
+
+ /**
+ * Overrides the java.lang.Object.hashCode method.
+ *
+ * The following steps came from Effective Java Programming Language
+ * Guide by Joshua Bloch, Chapter 3
+ *
+ * @return a hash code value for the object.
+ */
+ public int hashCode() {
+ int result = super.hashCode();
+
+ long tmp;
+
+ return result;
+ }
+
+ /**
+ * Method isValid.
+ *
+ * @return true if this object is valid according to the schema
+ */
+ public boolean isValid() {
+ try {
+ validate();
+ } catch (org.exolab.castor.xml.ValidationException vex) {
+ return false;
}
+ return true;
+ }
+
+ /**
+ *
+ *
+ * @param out
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void marshal(final java.io.Writer out)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, out);
+ }
+
+ /**
+ *
+ *
+ * @param handler
+ * @throws java.io.IOException
+ * if an IOException occurs during marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ */
+ public void marshal(final org.xml.sax.ContentHandler handler)
+ throws java.io.IOException, org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, handler);
+ }
+
+ /**
+ * Method unmarshal.
+ *
+ * @param reader
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @return the unmarshaled uk.ac.vamsas.objects.core.RangeType
+ */
+ public static uk.ac.vamsas.objects.core.RangeType unmarshal(
+ final java.io.Reader reader)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ return (uk.ac.vamsas.objects.core.RangeType) Unmarshaller.unmarshal(
+ uk.ac.vamsas.objects.core.Local.class, reader);
+ }
+
+ /**
+ *
+ *
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void validate() throws org.exolab.castor.xml.ValidationException {
+ org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+ validator.validate(this);
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/LockFile.java b/src/uk/ac/vamsas/objects/core/LockFile.java
index cb41ef9..418e743 100644
--- a/src/uk/ac/vamsas/objects/core/LockFile.java
+++ b/src/uk/ac/vamsas/objects/core/LockFile.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import org.exolab.castor.xml.Marshaller;
@@ -17,201 +31,204 @@ import org.exolab.castor.xml.Unmarshaller;
/**
* Class LockFile.
*
- * @version $Revision$ $Date$
+ * @version $Revision$ $Date: 2007-06-28 14:51:44 +0100 (Thu, 28 Jun 2007)
+ * $
*/
-public class LockFile extends uk.ac.vamsas.client.Vobject
-implements java.io.Serializable
-{
-
-
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
- * internal content storage
- */
- private java.lang.String _content = "";
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public LockFile() {
- super();
- setContent("");
- }
-
-
- //-----------/
- //- Methods -/
- //-----------/
-
- /**
- * Overrides the java.lang.Object.equals method.
- *
- * @param obj
- * @return true if the objects are equal.
- */
- public boolean equals(
- final java.lang.Object obj) {
- if ( this == obj )
- return true;
-
- if (super.equals(obj)==false)
+public class LockFile extends uk.ac.vamsas.client.Vobject implements
+ java.io.Serializable {
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * internal content storage
+ */
+ private java.lang.String _content = "";
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public LockFile() {
+ super();
+ setContent("");
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ * Overrides the java.lang.Object.equals method.
+ *
+ * @param obj
+ * @return true if the objects are equal.
+ */
+ public boolean equals(final java.lang.Object obj) {
+ if (this == obj)
+ return true;
+
+ if (super.equals(obj) == false)
+ return false;
+
+ if (obj instanceof LockFile) {
+
+ LockFile temp = (LockFile) obj;
+ boolean thcycle;
+ boolean tmcycle;
+ if (this._content != null) {
+ if (temp._content == null)
+ return false;
+ if (this._content != temp._content) {
+ thcycle = org.castor.util.CycleBreaker.startingToCycle(this._content);
+ tmcycle = org.castor.util.CycleBreaker.startingToCycle(temp._content);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._content);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._content);
+ }
+ ;
return false;
-
- if (obj instanceof LockFile) {
-
- LockFile temp = (LockFile)obj;
- boolean thcycle;
- boolean tmcycle;
- if (this._content != null) {
- if (temp._content == null) return false;
- if (this._content != temp._content) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._content);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._content);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._content); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._content); };
- return false;
- }
- if (!thcycle) {
- if (!this._content.equals(temp._content)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._content);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._content);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._content);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._content);
- }
- }
- } else if (temp._content != null)
- return false;
- return true;
+ }
+ if (!thcycle) {
+ if (!this._content.equals(temp._content)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._content);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._content);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._content);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._content);
+ }
}
+ } else if (temp._content != null)
return false;
+ return true;
}
-
- /**
- * Returns the value of field 'content'. The field 'content'
- * has the following description: internal content storage
- *
- * @return the value of field 'Content'.
- */
- public java.lang.String getContent(
- ) {
- return this._content;
- }
-
- /**
- * Overrides the java.lang.Object.hashCode method.
- *
- * The following steps came from Effective Java Programming
- * Language Guide by Joshua Bloch, Chapter 3
- *
- * @return a hash code value for the object.
- */
- public int hashCode(
- ) {
- int result = super.hashCode();
-
- long tmp;
- if (_content != null
- && !org.castor.util.CycleBreaker.startingToCycle(_content)) {
- result = 37 * result + _content.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_content);
- }
-
- return result;
- }
-
- /**
- * Method isValid.
- *
- * @return true if this object is valid according to the schema
- */
- public boolean isValid(
- ) {
- try {
- validate();
- } catch (org.exolab.castor.xml.ValidationException vex) {
- return false;
- }
- return true;
- }
-
- /**
- *
- *
- * @param out
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void marshal(
- final java.io.Writer out)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, out);
- }
-
- /**
- *
- *
- * @param handler
- * @throws java.io.IOException if an IOException occurs during
- * marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- */
- public void marshal(
- final org.xml.sax.ContentHandler handler)
- throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, handler);
- }
-
- /**
- * Sets the value of field 'content'. The field 'content' has
- * the following description: internal content storage
- *
- * @param content the value of field 'content'.
- */
- public void setContent(
- final java.lang.String content) {
- this._content = content;
- }
-
- /**
- * Method unmarshal.
- *
- * @param reader
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @return the unmarshaled uk.ac.vamsas.objects.core.LockFile
- */
- public static uk.ac.vamsas.objects.core.LockFile unmarshal(
- final java.io.Reader reader)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- return (uk.ac.vamsas.objects.core.LockFile) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.LockFile.class, reader);
+ return false;
+ }
+
+ /**
+ * Returns the value of field 'content'. The field 'content' has the following
+ * description: internal content storage
+ *
+ * @return the value of field 'Content'.
+ */
+ public java.lang.String getContent() {
+ return this._content;
+ }
+
+ /**
+ * Overrides the java.lang.Object.hashCode method.
+ *
+ * The following steps came from Effective Java Programming Language
+ * Guide by Joshua Bloch, Chapter 3
+ *
+ * @return a hash code value for the object.
+ */
+ public int hashCode() {
+ int result = super.hashCode();
+
+ long tmp;
+ if (_content != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_content)) {
+ result = 37 * result + _content.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_content);
}
- /**
- *
- *
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void validate(
- )
- throws org.exolab.castor.xml.ValidationException {
- org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
- validator.validate(this);
+ return result;
+ }
+
+ /**
+ * Method isValid.
+ *
+ * @return true if this object is valid according to the schema
+ */
+ public boolean isValid() {
+ try {
+ validate();
+ } catch (org.exolab.castor.xml.ValidationException vex) {
+ return false;
}
+ return true;
+ }
+
+ /**
+ *
+ *
+ * @param out
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void marshal(final java.io.Writer out)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, out);
+ }
+
+ /**
+ *
+ *
+ * @param handler
+ * @throws java.io.IOException
+ * if an IOException occurs during marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ */
+ public void marshal(final org.xml.sax.ContentHandler handler)
+ throws java.io.IOException, org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, handler);
+ }
+
+ /**
+ * Sets the value of field 'content'. The field 'content' has the following
+ * description: internal content storage
+ *
+ * @param content
+ * the value of field 'content'.
+ */
+ public void setContent(final java.lang.String content) {
+ this._content = content;
+ }
+
+ /**
+ * Method unmarshal.
+ *
+ * @param reader
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @return the unmarshaled uk.ac.vamsas.objects.core.LockFile
+ */
+ public static uk.ac.vamsas.objects.core.LockFile unmarshal(
+ final java.io.Reader reader)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ return (uk.ac.vamsas.objects.core.LockFile) Unmarshaller.unmarshal(
+ uk.ac.vamsas.objects.core.LockFile.class, reader);
+ }
+
+ /**
+ *
+ *
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void validate() throws org.exolab.castor.xml.ValidationException {
+ org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+ validator.validate(this);
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/Map.java b/src/uk/ac/vamsas/objects/core/Map.java
index 561589c..06ea745 100644
--- a/src/uk/ac/vamsas/objects/core/Map.java
+++ b/src/uk/ac/vamsas/objects/core/Map.java
@@ -1,224 +1,235 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import org.exolab.castor.xml.Marshaller;
import org.exolab.castor.xml.Unmarshaller;
/**
- * the local mapType maps from the parent
- * sequence coordinate frame to the reference
- * frame defined by the dbRef element.
- * The mapped mapType is the mapped range defined
- * on the dbRef element's reference frame.
- * Conventionally, the unit attribute defaults to 1, or
- * will be inferred from the local sequence's
- * dictionary type and any dictionary type associated
- * with the database being mapped to.
- * However, it may be used to avoid ambiguity.
- *
+ * the local mapType maps from the parent sequence coordinate frame to the
+ * reference frame defined by the dbRef element. The mapped mapType is the
+ * mapped range defined on the dbRef element's reference frame. Conventionally,
+ * the unit attribute defaults to 1, or will be inferred from the local
+ * sequence's dictionary type and any dictionary type associated with the
+ * database being mapped to. However, it may be used to avoid ambiguity.
+ *
*
* @version $Revision$ $Date$
*/
-public class Map extends uk.ac.vamsas.objects.core.MapType
-implements java.io.Serializable
-{
-
-
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
- * Field _id.
- */
- private java.lang.String _id;
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public Map() {
- super();
- }
-
-
- //-----------/
- //- Methods -/
- //-----------/
-
- /**
- * Overrides the java.lang.Object.equals method.
- *
- * @param obj
- * @return true if the objects are equal.
- */
- public boolean equals(
- final java.lang.Object obj) {
- if ( this == obj )
- return true;
-
- if (super.equals(obj)==false)
+public class Map extends uk.ac.vamsas.objects.core.MapType implements
+ java.io.Serializable {
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * Field _id.
+ */
+ private java.lang.String _id;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public Map() {
+ super();
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ * Overrides the java.lang.Object.equals method.
+ *
+ * @param obj
+ * @return true if the objects are equal.
+ */
+ public boolean equals(final java.lang.Object obj) {
+ if (this == obj)
+ return true;
+
+ if (super.equals(obj) == false)
+ return false;
+
+ if (obj instanceof Map) {
+
+ Map temp = (Map) obj;
+ boolean thcycle;
+ boolean tmcycle;
+ if (this._id != null) {
+ if (temp._id == null)
+ return false;
+ if (this._id != temp._id) {
+ thcycle = org.castor.util.CycleBreaker.startingToCycle(this._id);
+ tmcycle = org.castor.util.CycleBreaker.startingToCycle(temp._id);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
+ }
+ ;
return false;
-
- if (obj instanceof Map) {
-
- Map temp = (Map)obj;
- boolean thcycle;
- boolean tmcycle;
- if (this._id != null) {
- if (temp._id == null) return false;
- if (this._id != temp._id) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._id);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._id);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._id); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._id); };
- return false;
- }
- if (!thcycle) {
- if (!this._id.equals(temp._id)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
- }
- }
- } else if (temp._id != null)
- return false;
- return true;
+ }
+ if (!thcycle) {
+ if (!this._id.equals(temp._id)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
+ }
}
+ } else if (temp._id != null)
return false;
+ return true;
}
-
- /**
- * Returns the value of field 'id'.
- *
- * @return the value of field 'Id'.
- */
- public java.lang.String getId(
- ) {
- return this._id;
- }
-
- /**
- * Overrides the java.lang.Object.hashCode method.
- *
- * The following steps came from Effective Java Programming
- * Language Guide by Joshua Bloch, Chapter 3
- *
- * @return a hash code value for the object.
- */
- public int hashCode(
- ) {
- int result = super.hashCode();
-
- long tmp;
- if (_id != null
- && !org.castor.util.CycleBreaker.startingToCycle(_id)) {
- result = 37 * result + _id.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_id);
- }
-
- return result;
- }
-
- /**
- * Method isValid.
- *
- * @return true if this object is valid according to the schema
- */
- public boolean isValid(
- ) {
- try {
- validate();
- } catch (org.exolab.castor.xml.ValidationException vex) {
- return false;
- }
- return true;
- }
-
- /**
- *
- *
- * @param out
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void marshal(
- final java.io.Writer out)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, out);
- }
-
- /**
- *
- *
- * @param handler
- * @throws java.io.IOException if an IOException occurs during
- * marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- */
- public void marshal(
- final org.xml.sax.ContentHandler handler)
- throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, handler);
- }
-
- /**
- * Sets the value of field 'id'.
- *
- * @param id the value of field 'id'.
- */
- public void setId(
- final java.lang.String id) {
- this._id = id;
- }
-
- /**
- * Method unmarshal.
- *
- * @param reader
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @return the unmarshaled uk.ac.vamsas.objects.core.MapType
- */
- public static uk.ac.vamsas.objects.core.MapType unmarshal(
- final java.io.Reader reader)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- return (uk.ac.vamsas.objects.core.MapType) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Map.class, reader);
+ return false;
+ }
+
+ /**
+ * Returns the value of field 'id'.
+ *
+ * @return the value of field 'Id'.
+ */
+ public java.lang.String getId() {
+ return this._id;
+ }
+
+ /**
+ * Overrides the java.lang.Object.hashCode method.
+ *
+ * The following steps came from Effective Java Programming Language
+ * Guide by Joshua Bloch, Chapter 3
+ *
+ * @return a hash code value for the object.
+ */
+ public int hashCode() {
+ int result = super.hashCode();
+
+ long tmp;
+ if (_id != null && !org.castor.util.CycleBreaker.startingToCycle(_id)) {
+ result = 37 * result + _id.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_id);
}
- /**
- *
- *
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void validate(
- )
- throws org.exolab.castor.xml.ValidationException {
- org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
- validator.validate(this);
+ return result;
+ }
+
+ /**
+ * Method isValid.
+ *
+ * @return true if this object is valid according to the schema
+ */
+ public boolean isValid() {
+ try {
+ validate();
+ } catch (org.exolab.castor.xml.ValidationException vex) {
+ return false;
}
+ return true;
+ }
+
+ /**
+ *
+ *
+ * @param out
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void marshal(final java.io.Writer out)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, out);
+ }
+
+ /**
+ *
+ *
+ * @param handler
+ * @throws java.io.IOException
+ * if an IOException occurs during marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ */
+ public void marshal(final org.xml.sax.ContentHandler handler)
+ throws java.io.IOException, org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, handler);
+ }
+
+ /**
+ * Sets the value of field 'id'.
+ *
+ * @param id
+ * the value of field 'id'.
+ */
+ public void setId(final java.lang.String id) {
+ this._id = id;
+ }
+
+ /**
+ * Method unmarshal.
+ *
+ * @param reader
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @return the unmarshaled uk.ac.vamsas.objects.core.MapType
+ */
+ public static uk.ac.vamsas.objects.core.MapType unmarshal(
+ final java.io.Reader reader)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ return (uk.ac.vamsas.objects.core.MapType) Unmarshaller.unmarshal(
+ uk.ac.vamsas.objects.core.Map.class, reader);
+ }
+
+ /**
+ *
+ *
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void validate() throws org.exolab.castor.xml.ValidationException {
+ org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+ validator.validate(this);
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/MapList.java b/src/uk/ac/vamsas/objects/core/MapList.java
index af7ebb6..770d07f 100644
--- a/src/uk/ac/vamsas/objects/core/MapList.java
+++ b/src/uk/ac/vamsas/objects/core/MapList.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import org.exolab.castor.xml.Marshaller;
@@ -19,384 +33,358 @@ import org.exolab.castor.xml.Unmarshaller;
*
* @version $Revision$ $Date$
*/
-public class MapList extends uk.ac.vamsas.client.Vobject
-implements java.io.Serializable
-{
-
-
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
- * Offset to first position in dataset sequence record that
- * start
- * position on 'onto' maps to
- */
- private long _from = 0;
-
- /**
- * keeps track of state for field: _from
- */
- private boolean _has_from;
-
- /**
- * Offset to last position in dataset sequence record that end
- * position on 'onto' maps to
- */
- private long _to = 0;
-
- /**
- * keeps track of state for field: _to
- */
- private boolean _has_to;
-
- /**
- * Offset to first position in database entry that first (or
- * offset)
- * position in sequence maps to
- */
- private long _start;
-
- /**
- * keeps track of state for field: _start
- */
- private boolean _has_start;
-
- /**
- * Offset to last position in database entry that last (offset)
- * position in sequence maps to
- */
- private long _end;
-
- /**
- * keeps track of state for field: _end
- */
- private boolean _has_end;
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public MapList() {
- super();
- }
-
-
- //-----------/
- //- Methods -/
- //-----------/
-
- /**
+public class MapList extends uk.ac.vamsas.client.Vobject implements
+ java.io.Serializable {
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * Offset to first position in dataset sequence record that start position on
+ * 'onto' maps to
+ */
+ private long _from = 0;
+
+ /**
+ * keeps track of state for field: _from
+ */
+ private boolean _has_from;
+
+ /**
+ * Offset to last position in dataset sequence record that end position on
+ * 'onto' maps to
+ */
+ private long _to = 0;
+
+ /**
+ * keeps track of state for field: _to
+ */
+ private boolean _has_to;
+
+ /**
+ * Offset to first position in database entry that first (or offset) position
+ * in sequence maps to
+ */
+ private long _start;
+
+ /**
+ * keeps track of state for field: _start
+ */
+ private boolean _has_start;
+
+ /**
+ * Offset to last position in database entry that last (offset) position in
+ * sequence maps to
+ */
+ private long _end;
+
+ /**
+ * keeps track of state for field: _end
+ */
+ private boolean _has_end;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public MapList() {
+ super();
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
*/
- public void deleteEnd(
- ) {
- this._has_end= false;
- }
-
- /**
- */
- public void deleteFrom(
- ) {
- this._has_from= false;
- }
+ public void deleteEnd() {
+ this._has_end = false;
+ }
- /**
+ /**
*/
- public void deleteStart(
- ) {
- this._has_start= false;
- }
+ public void deleteFrom() {
+ this._has_from = false;
+ }
- /**
+ /**
*/
- public void deleteTo(
- ) {
- this._has_to= false;
- }
+ public void deleteStart() {
+ this._has_start = false;
+ }
- /**
- * Overrides the java.lang.Object.equals method.
- *
- * @param obj
- * @return true if the objects are equal.
+ /**
*/
- public boolean equals(
- final java.lang.Object obj) {
- if ( this == obj )
- return true;
-
- if (super.equals(obj)==false)
- return false;
-
- if (obj instanceof MapList) {
-
- MapList temp = (MapList)obj;
- if (this._from != temp._from)
- return false;
- if (this._has_from != temp._has_from)
- return false;
- if (this._to != temp._to)
- return false;
- if (this._has_to != temp._has_to)
- return false;
- if (this._start != temp._start)
- return false;
- if (this._has_start != temp._has_start)
- return false;
- if (this._end != temp._end)
- return false;
- if (this._has_end != temp._has_end)
- return false;
- return true;
- }
+ public void deleteTo() {
+ this._has_to = false;
+ }
+
+ /**
+ * Overrides the java.lang.Object.equals method.
+ *
+ * @param obj
+ * @return true if the objects are equal.
+ */
+ public boolean equals(final java.lang.Object obj) {
+ if (this == obj)
+ return true;
+
+ if (super.equals(obj) == false)
+ return false;
+
+ if (obj instanceof MapList) {
+
+ MapList temp = (MapList) obj;
+ if (this._from != temp._from)
return false;
+ if (this._has_from != temp._has_from)
+ return false;
+ if (this._to != temp._to)
+ return false;
+ if (this._has_to != temp._has_to)
+ return false;
+ if (this._start != temp._start)
+ return false;
+ if (this._has_start != temp._has_start)
+ return false;
+ if (this._end != temp._end)
+ return false;
+ if (this._has_end != temp._has_end)
+ return false;
+ return true;
}
-
- /**
- * Returns the value of field 'end'. The field 'end' has the
- * following description: Offset to last position in database
- * entry that last (offset)
- * position in sequence maps to
- *
- * @return the value of field 'End'.
- */
- public long getEnd(
- ) {
- return this._end;
- }
-
- /**
- * Returns the value of field 'from'. The field 'from' has the
- * following description: Offset to first position in dataset
- * sequence record that start
- * position on 'onto' maps to
- *
- * @return the value of field 'From'.
- */
- public long getFrom(
- ) {
- return this._from;
- }
-
- /**
- * Returns the value of field 'start'. The field 'start' has
- * the following description: Offset to first position in
- * database entry that first (or offset)
- * position in sequence maps to
- *
- * @return the value of field 'Start'.
- */
- public long getStart(
- ) {
- return this._start;
- }
-
- /**
- * Returns the value of field 'to'. The field 'to' has the
- * following description: Offset to last position in dataset
- * sequence record that end
- * position on 'onto' maps to
- *
- * @return the value of field 'To'.
- */
- public long getTo(
- ) {
- return this._to;
- }
-
- /**
- * Method hasEnd.
- *
- * @return true if at least one End has been added
- */
- public boolean hasEnd(
- ) {
- return this._has_end;
- }
-
- /**
- * Method hasFrom.
- *
- * @return true if at least one From has been added
- */
- public boolean hasFrom(
- ) {
- return this._has_from;
- }
-
- /**
- * Method hasStart.
- *
- * @return true if at least one Start has been added
- */
- public boolean hasStart(
- ) {
- return this._has_start;
- }
-
- /**
- * Method hasTo.
- *
- * @return true if at least one To has been added
- */
- public boolean hasTo(
- ) {
- return this._has_to;
- }
-
- /**
- * Overrides the java.lang.Object.hashCode method.
- *
- * The following steps came from Effective Java Programming
- * Language Guide by Joshua Bloch, Chapter 3
- *
- * @return a hash code value for the object.
- */
- public int hashCode(
- ) {
- int result = super.hashCode();
-
- long tmp;
- result = 37 * result + (int)(_from^(_from>>>32));
- result = 37 * result + (int)(_to^(_to>>>32));
- result = 37 * result + (int)(_start^(_start>>>32));
- result = 37 * result + (int)(_end^(_end>>>32));
-
- return result;
- }
-
- /**
- * Method isValid.
- *
- * @return true if this object is valid according to the schema
- */
- public boolean isValid(
- ) {
- try {
- validate();
- } catch (org.exolab.castor.xml.ValidationException vex) {
- return false;
- }
- return true;
- }
-
- /**
- *
- *
- * @param out
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void marshal(
- final java.io.Writer out)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, out);
- }
-
- /**
- *
- *
- * @param handler
- * @throws java.io.IOException if an IOException occurs during
- * marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- */
- public void marshal(
- final org.xml.sax.ContentHandler handler)
- throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, handler);
- }
-
- /**
- * Sets the value of field 'end'. The field 'end' has the
- * following description: Offset to last position in database
- * entry that last (offset)
- * position in sequence maps to
- *
- * @param end the value of field 'end'.
- */
- public void setEnd(
- final long end) {
- this._end = end;
- this._has_end = true;
- }
-
- /**
- * Sets the value of field 'from'. The field 'from' has the
- * following description: Offset to first position in dataset
- * sequence record that start
- * position on 'onto' maps to
- *
- * @param from the value of field 'from'.
- */
- public void setFrom(
- final long from) {
- this._from = from;
- this._has_from = true;
- }
-
- /**
- * Sets the value of field 'start'. The field 'start' has the
- * following description: Offset to first position in database
- * entry that first (or offset)
- * position in sequence maps to
- *
- * @param start the value of field 'start'.
- */
- public void setStart(
- final long start) {
- this._start = start;
- this._has_start = true;
- }
-
- /**
- * Sets the value of field 'to'. The field 'to' has the
- * following description: Offset to last position in dataset
- * sequence record that end
- * position on 'onto' maps to
- *
- * @param to the value of field 'to'.
- */
- public void setTo(
- final long to) {
- this._to = to;
- this._has_to = true;
- }
-
- /**
- * Method unmarshal.
- *
- * @param reader
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @return the unmarshaled uk.ac.vamsas.objects.core.MapList
- */
- public static uk.ac.vamsas.objects.core.MapList unmarshal(
- final java.io.Reader reader)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- return (uk.ac.vamsas.objects.core.MapList) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.MapList.class, reader);
- }
-
- /**
- *
- *
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void validate(
- )
- throws org.exolab.castor.xml.ValidationException {
- org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
- validator.validate(this);
+ return false;
+ }
+
+ /**
+ * Returns the value of field 'end'. The field 'end' has the following
+ * description: Offset to last position in database entry that last (offset)
+ * position in sequence maps to
+ *
+ * @return the value of field 'End'.
+ */
+ public long getEnd() {
+ return this._end;
+ }
+
+ /**
+ * Returns the value of field 'from'. The field 'from' has the following
+ * description: Offset to first position in dataset sequence record that start
+ * position on 'onto' maps to
+ *
+ * @return the value of field 'From'.
+ */
+ public long getFrom() {
+ return this._from;
+ }
+
+ /**
+ * Returns the value of field 'start'. The field 'start' has the following
+ * description: Offset to first position in database entry that first (or
+ * offset) position in sequence maps to
+ *
+ * @return the value of field 'Start'.
+ */
+ public long getStart() {
+ return this._start;
+ }
+
+ /**
+ * Returns the value of field 'to'. The field 'to' has the following
+ * description: Offset to last position in dataset sequence record that end
+ * position on 'onto' maps to
+ *
+ * @return the value of field 'To'.
+ */
+ public long getTo() {
+ return this._to;
+ }
+
+ /**
+ * Method hasEnd.
+ *
+ * @return true if at least one End has been added
+ */
+ public boolean hasEnd() {
+ return this._has_end;
+ }
+
+ /**
+ * Method hasFrom.
+ *
+ * @return true if at least one From has been added
+ */
+ public boolean hasFrom() {
+ return this._has_from;
+ }
+
+ /**
+ * Method hasStart.
+ *
+ * @return true if at least one Start has been added
+ */
+ public boolean hasStart() {
+ return this._has_start;
+ }
+
+ /**
+ * Method hasTo.
+ *
+ * @return true if at least one To has been added
+ */
+ public boolean hasTo() {
+ return this._has_to;
+ }
+
+ /**
+ * Overrides the java.lang.Object.hashCode method.
+ *
+ * The following steps came from Effective Java Programming Language
+ * Guide by Joshua Bloch, Chapter 3
+ *
+ * @return a hash code value for the object.
+ */
+ public int hashCode() {
+ int result = super.hashCode();
+
+ long tmp;
+ result = 37 * result + (int) (_from ^ (_from >>> 32));
+ result = 37 * result + (int) (_to ^ (_to >>> 32));
+ result = 37 * result + (int) (_start ^ (_start >>> 32));
+ result = 37 * result + (int) (_end ^ (_end >>> 32));
+
+ return result;
+ }
+
+ /**
+ * Method isValid.
+ *
+ * @return true if this object is valid according to the schema
+ */
+ public boolean isValid() {
+ try {
+ validate();
+ } catch (org.exolab.castor.xml.ValidationException vex) {
+ return false;
}
+ return true;
+ }
+
+ /**
+ *
+ *
+ * @param out
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void marshal(final java.io.Writer out)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, out);
+ }
+
+ /**
+ *
+ *
+ * @param handler
+ * @throws java.io.IOException
+ * if an IOException occurs during marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ */
+ public void marshal(final org.xml.sax.ContentHandler handler)
+ throws java.io.IOException, org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, handler);
+ }
+
+ /**
+ * Sets the value of field 'end'. The field 'end' has the following
+ * description: Offset to last position in database entry that last (offset)
+ * position in sequence maps to
+ *
+ * @param end
+ * the value of field 'end'.
+ */
+ public void setEnd(final long end) {
+ this._end = end;
+ this._has_end = true;
+ }
+
+ /**
+ * Sets the value of field 'from'. The field 'from' has the following
+ * description: Offset to first position in dataset sequence record that start
+ * position on 'onto' maps to
+ *
+ * @param from
+ * the value of field 'from'.
+ */
+ public void setFrom(final long from) {
+ this._from = from;
+ this._has_from = true;
+ }
+
+ /**
+ * Sets the value of field 'start'. The field 'start' has the following
+ * description: Offset to first position in database entry that first (or
+ * offset) position in sequence maps to
+ *
+ * @param start
+ * the value of field 'start'.
+ */
+ public void setStart(final long start) {
+ this._start = start;
+ this._has_start = true;
+ }
+
+ /**
+ * Sets the value of field 'to'. The field 'to' has the following description:
+ * Offset to last position in dataset sequence record that end position on
+ * 'onto' maps to
+ *
+ * @param to
+ * the value of field 'to'.
+ */
+ public void setTo(final long to) {
+ this._to = to;
+ this._has_to = true;
+ }
+
+ /**
+ * Method unmarshal.
+ *
+ * @param reader
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @return the unmarshaled uk.ac.vamsas.objects.core.MapList
+ */
+ public static uk.ac.vamsas.objects.core.MapList unmarshal(
+ final java.io.Reader reader)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ return (uk.ac.vamsas.objects.core.MapList) Unmarshaller.unmarshal(
+ uk.ac.vamsas.objects.core.MapList.class, reader);
+ }
+
+ /**
+ *
+ *
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void validate() throws org.exolab.castor.xml.ValidationException {
+ org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+ validator.validate(this);
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/MapRangeType.java b/src/uk/ac/vamsas/objects/core/MapRangeType.java
index c390687..e5d5ee9 100644
--- a/src/uk/ac/vamsas/objects/core/MapRangeType.java
+++ b/src/uk/ac/vamsas/objects/core/MapRangeType.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import org.exolab.castor.xml.Marshaller;
@@ -19,222 +33,204 @@ import org.exolab.castor.xml.Unmarshaller;
*
* @version $Revision$ $Date$
*/
-public class MapRangeType extends uk.ac.vamsas.objects.core.RangeType
-implements java.io.Serializable
-{
-
-
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
- * number of dictionary symbol widths involved in each
- * mapped position on this sequence (for example, 3 for a dna
- * sequence exon
- * region that is being mapped to a protein sequence). This is
- * optional,
- * since the unit can be usually be inferred from the
- * dictionary type of
- * each sequence involved in the mapping.
- */
- private long _unit;
-
- /**
- * keeps track of state for field: _unit
+public class MapRangeType extends uk.ac.vamsas.objects.core.RangeType implements
+ java.io.Serializable {
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * number of dictionary symbol widths involved in each mapped position on this
+ * sequence (for example, 3 for a dna sequence exon region that is being
+ * mapped to a protein sequence). This is optional, since the unit can be
+ * usually be inferred from the dictionary type of each sequence involved in
+ * the mapping.
+ */
+ private long _unit;
+
+ /**
+ * keeps track of state for field: _unit
+ */
+ private boolean _has_unit;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public MapRangeType() {
+ super();
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
*/
- private boolean _has_unit;
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public MapRangeType() {
- super();
- }
-
-
- //-----------/
- //- Methods -/
- //-----------/
-
- /**
- */
- public void deleteUnit(
- ) {
- this._has_unit= false;
- }
-
- /**
- * Overrides the java.lang.Object.equals method.
- *
- * @param obj
- * @return true if the objects are equal.
- */
- public boolean equals(
- final java.lang.Object obj) {
- if ( this == obj )
- return true;
-
- if (super.equals(obj)==false)
- return false;
-
- if (obj instanceof MapRangeType) {
-
- MapRangeType temp = (MapRangeType)obj;
- boolean thcycle;
- boolean tmcycle;
- if (this._unit != temp._unit)
- return false;
- if (this._has_unit != temp._has_unit)
- return false;
- return true;
- }
+ public void deleteUnit() {
+ this._has_unit = false;
+ }
+
+ /**
+ * Overrides the java.lang.Object.equals method.
+ *
+ * @param obj
+ * @return true if the objects are equal.
+ */
+ public boolean equals(final java.lang.Object obj) {
+ if (this == obj)
+ return true;
+
+ if (super.equals(obj) == false)
+ return false;
+
+ if (obj instanceof MapRangeType) {
+
+ MapRangeType temp = (MapRangeType) obj;
+ boolean thcycle;
+ boolean tmcycle;
+ if (this._unit != temp._unit)
return false;
+ if (this._has_unit != temp._has_unit)
+ return false;
+ return true;
}
-
- /**
- * Returns the value of field 'unit'. The field 'unit' has the
- * following description: number of dictionary symbol widths
- * involved in each
- * mapped position on this sequence (for example, 3 for a dna
- * sequence exon
- * region that is being mapped to a protein sequence). This is
- * optional,
- * since the unit can be usually be inferred from the
- * dictionary type of
- * each sequence involved in the mapping.
- *
- * @return the value of field 'Unit'.
- */
- public long getUnit(
- ) {
- return this._unit;
- }
-
- /**
- * Method hasUnit.
- *
- * @return true if at least one Unit has been added
- */
- public boolean hasUnit(
- ) {
- return this._has_unit;
- }
-
- /**
- * Overrides the java.lang.Object.hashCode method.
- *
- * The following steps came from Effective Java Programming
- * Language Guide by Joshua Bloch, Chapter 3
- *
- * @return a hash code value for the object.
- */
- public int hashCode(
- ) {
- int result = super.hashCode();
-
- long tmp;
- result = 37 * result + (int)(_unit^(_unit>>>32));
-
- return result;
- }
-
- /**
- * Method isValid.
- *
- * @return true if this object is valid according to the schema
- */
- public boolean isValid(
- ) {
- try {
- validate();
- } catch (org.exolab.castor.xml.ValidationException vex) {
- return false;
- }
- return true;
- }
-
- /**
- *
- *
- * @param out
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void marshal(
- final java.io.Writer out)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, out);
- }
-
- /**
- *
- *
- * @param handler
- * @throws java.io.IOException if an IOException occurs during
- * marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- */
- public void marshal(
- final org.xml.sax.ContentHandler handler)
- throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, handler);
- }
-
- /**
- * Sets the value of field 'unit'. The field 'unit' has the
- * following description: number of dictionary symbol widths
- * involved in each
- * mapped position on this sequence (for example, 3 for a dna
- * sequence exon
- * region that is being mapped to a protein sequence). This is
- * optional,
- * since the unit can be usually be inferred from the
- * dictionary type of
- * each sequence involved in the mapping.
- *
- * @param unit the value of field 'unit'.
- */
- public void setUnit(
- final long unit) {
- this._unit = unit;
- this._has_unit = true;
- }
-
- /**
- * Method unmarshal.
- *
- * @param reader
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @return the unmarshaled uk.ac.vamsas.objects.core.RangeType
- */
- public static uk.ac.vamsas.objects.core.RangeType unmarshal(
- final java.io.Reader reader)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- return (uk.ac.vamsas.objects.core.RangeType) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.MapRangeType.class, reader);
- }
-
- /**
- *
- *
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void validate(
- )
- throws org.exolab.castor.xml.ValidationException {
- org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
- validator.validate(this);
+ return false;
+ }
+
+ /**
+ * Returns the value of field 'unit'. The field 'unit' has the following
+ * description: number of dictionary symbol widths involved in each mapped
+ * position on this sequence (for example, 3 for a dna sequence exon region
+ * that is being mapped to a protein sequence). This is optional, since the
+ * unit can be usually be inferred from the dictionary type of each sequence
+ * involved in the mapping.
+ *
+ * @return the value of field 'Unit'.
+ */
+ public long getUnit() {
+ return this._unit;
+ }
+
+ /**
+ * Method hasUnit.
+ *
+ * @return true if at least one Unit has been added
+ */
+ public boolean hasUnit() {
+ return this._has_unit;
+ }
+
+ /**
+ * Overrides the java.lang.Object.hashCode method.
+ *
+ * The following steps came from Effective Java Programming Language
+ * Guide by Joshua Bloch, Chapter 3
+ *
+ * @return a hash code value for the object.
+ */
+ public int hashCode() {
+ int result = super.hashCode();
+
+ long tmp;
+ result = 37 * result + (int) (_unit ^ (_unit >>> 32));
+
+ return result;
+ }
+
+ /**
+ * Method isValid.
+ *
+ * @return true if this object is valid according to the schema
+ */
+ public boolean isValid() {
+ try {
+ validate();
+ } catch (org.exolab.castor.xml.ValidationException vex) {
+ return false;
}
+ return true;
+ }
+
+ /**
+ *
+ *
+ * @param out
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void marshal(final java.io.Writer out)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, out);
+ }
+
+ /**
+ *
+ *
+ * @param handler
+ * @throws java.io.IOException
+ * if an IOException occurs during marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ */
+ public void marshal(final org.xml.sax.ContentHandler handler)
+ throws java.io.IOException, org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, handler);
+ }
+
+ /**
+ * Sets the value of field 'unit'. The field 'unit' has the following
+ * description: number of dictionary symbol widths involved in each mapped
+ * position on this sequence (for example, 3 for a dna sequence exon region
+ * that is being mapped to a protein sequence). This is optional, since the
+ * unit can be usually be inferred from the dictionary type of each sequence
+ * involved in the mapping.
+ *
+ * @param unit
+ * the value of field 'unit'.
+ */
+ public void setUnit(final long unit) {
+ this._unit = unit;
+ this._has_unit = true;
+ }
+
+ /**
+ * Method unmarshal.
+ *
+ * @param reader
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @return the unmarshaled uk.ac.vamsas.objects.core.RangeType
+ */
+ public static uk.ac.vamsas.objects.core.RangeType unmarshal(
+ final java.io.Reader reader)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ return (uk.ac.vamsas.objects.core.RangeType) Unmarshaller.unmarshal(
+ uk.ac.vamsas.objects.core.MapRangeType.class, reader);
+ }
+
+ /**
+ *
+ *
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void validate() throws org.exolab.castor.xml.ValidationException {
+ org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+ validator.validate(this);
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/MapType.java b/src/uk/ac/vamsas/objects/core/MapType.java
index 130f17d..601f4cc 100644
--- a/src/uk/ac/vamsas/objects/core/MapType.java
+++ b/src/uk/ac/vamsas/objects/core/MapType.java
@@ -1,266 +1,286 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import org.exolab.castor.xml.Marshaller;
import org.exolab.castor.xml.Unmarshaller;
/**
- * Two sets of ranges defined between objects - usually sequences,
- * indicating which
- * regions on each are mapped.
+ * Two sets of ranges defined between objects - usually sequences, indicating
+ * which regions on each are mapped.
*
* @version $Revision$ $Date$
*/
-public class MapType extends uk.ac.vamsas.client.Vobject
-implements java.io.Serializable
-{
+public class MapType extends uk.ac.vamsas.client.Vobject implements
+ java.io.Serializable {
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
+ /**
*/
- private uk.ac.vamsas.objects.core.Local _local;
+ private uk.ac.vamsas.objects.core.Local _local;
- /**
+ /**
*/
- private uk.ac.vamsas.objects.core.Mapped _mapped;
+ private uk.ac.vamsas.objects.core.Mapped _mapped;
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
- //----------------/
- //- Constructors -/
- //----------------/
+ public MapType() {
+ super();
+ }
- public MapType() {
- super();
- }
+ // -----------/
+ // - Methods -/
+ // -----------/
+ /**
+ * Overrides the java.lang.Object.equals method.
+ *
+ * @param obj
+ * @return true if the objects are equal.
+ */
+ public boolean equals(final java.lang.Object obj) {
+ if (this == obj)
+ return true;
- //-----------/
- //- Methods -/
- //-----------/
+ if (super.equals(obj) == false)
+ return false;
- /**
- * Overrides the java.lang.Object.equals method.
- *
- * @param obj
- * @return true if the objects are equal.
- */
- public boolean equals(
- final java.lang.Object obj) {
- if ( this == obj )
- return true;
-
- if (super.equals(obj)==false)
+ if (obj instanceof MapType) {
+
+ MapType temp = (MapType) obj;
+ boolean thcycle;
+ boolean tmcycle;
+ if (this._local != null) {
+ if (temp._local == null)
+ return false;
+ if (this._local != temp._local) {
+ thcycle = org.castor.util.CycleBreaker.startingToCycle(this._local);
+ tmcycle = org.castor.util.CycleBreaker.startingToCycle(temp._local);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._local);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._local);
+ }
+ ;
return false;
-
- if (obj instanceof MapType) {
-
- MapType temp = (MapType)obj;
- boolean thcycle;
- boolean tmcycle;
- if (this._local != null) {
- if (temp._local == null) return false;
- if (this._local != temp._local) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._local);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._local);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._local); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._local); };
- return false;
- }
- if (!thcycle) {
- if (!this._local.equals(temp._local)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._local);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._local);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._local);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._local);
- }
- }
- } else if (temp._local != null)
- return false;
- if (this._mapped != null) {
- if (temp._mapped == null) return false;
- if (this._mapped != temp._mapped) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._mapped);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._mapped);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._mapped); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._mapped); };
- return false;
- }
- if (!thcycle) {
- if (!this._mapped.equals(temp._mapped)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._mapped);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._mapped);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._mapped);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._mapped);
- }
- }
- } else if (temp._mapped != null)
- return false;
- return true;
+ }
+ if (!thcycle) {
+ if (!this._local.equals(temp._local)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._local);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._local);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._local);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._local);
+ }
}
+ } else if (temp._local != null)
return false;
+ if (this._mapped != null) {
+ if (temp._mapped == null)
+ return false;
+ if (this._mapped != temp._mapped) {
+ thcycle = org.castor.util.CycleBreaker.startingToCycle(this._mapped);
+ tmcycle = org.castor.util.CycleBreaker.startingToCycle(temp._mapped);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._mapped);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._mapped);
+ }
+ ;
+ return false;
+ }
+ if (!thcycle) {
+ if (!this._mapped.equals(temp._mapped)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._mapped);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._mapped);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._mapped);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._mapped);
+ }
+ }
+ } else if (temp._mapped != null)
+ return false;
+ return true;
}
+ return false;
+ }
- /**
- * Returns the value of field 'local'.
- *
- * @return the value of field 'Local'.
- */
- public uk.ac.vamsas.objects.core.Local getLocal(
- ) {
- return this._local;
- }
+ /**
+ * Returns the value of field 'local'.
+ *
+ * @return the value of field 'Local'.
+ */
+ public uk.ac.vamsas.objects.core.Local getLocal() {
+ return this._local;
+ }
- /**
- * Returns the value of field 'mapped'.
- *
- * @return the value of field 'Mapped'.
- */
- public uk.ac.vamsas.objects.core.Mapped getMapped(
- ) {
- return this._mapped;
- }
+ /**
+ * Returns the value of field 'mapped'.
+ *
+ * @return the value of field 'Mapped'.
+ */
+ public uk.ac.vamsas.objects.core.Mapped getMapped() {
+ return this._mapped;
+ }
- /**
- * Overrides the java.lang.Object.hashCode method.
- *
- * The following steps came from Effective Java Programming
- * Language Guide by Joshua Bloch, Chapter 3
- *
- * @return a hash code value for the object.
- */
- public int hashCode(
- ) {
- int result = super.hashCode();
-
- long tmp;
- if (_local != null
- && !org.castor.util.CycleBreaker.startingToCycle(_local)) {
- result = 37 * result + _local.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_local);
- }
- if (_mapped != null
- && !org.castor.util.CycleBreaker.startingToCycle(_mapped)) {
- result = 37 * result + _mapped.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_mapped);
- }
-
- return result;
- }
+ /**
+ * Overrides the java.lang.Object.hashCode method.
+ *
+ * The following steps came from Effective Java Programming Language
+ * Guide by Joshua Bloch, Chapter 3
+ *
+ * @return a hash code value for the object.
+ */
+ public int hashCode() {
+ int result = super.hashCode();
- /**
- * Method isValid.
- *
- * @return true if this object is valid according to the schema
- */
- public boolean isValid(
- ) {
- try {
- validate();
- } catch (org.exolab.castor.xml.ValidationException vex) {
- return false;
- }
- return true;
+ long tmp;
+ if (_local != null && !org.castor.util.CycleBreaker.startingToCycle(_local)) {
+ result = 37 * result + _local.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_local);
}
-
- /**
- *
- *
- * @param out
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void marshal(
- final java.io.Writer out)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, out);
+ if (_mapped != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_mapped)) {
+ result = 37 * result + _mapped.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_mapped);
}
- /**
- *
- *
- * @param handler
- * @throws java.io.IOException if an IOException occurs during
- * marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- */
- public void marshal(
- final org.xml.sax.ContentHandler handler)
- throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, handler);
- }
+ return result;
+ }
- /**
- * Sets the value of field 'local'.
- *
- * @param local the value of field 'local'.
- */
- public void setLocal(
- final uk.ac.vamsas.objects.core.Local local) {
- this._local = local;
+ /**
+ * Method isValid.
+ *
+ * @return true if this object is valid according to the schema
+ */
+ public boolean isValid() {
+ try {
+ validate();
+ } catch (org.exolab.castor.xml.ValidationException vex) {
+ return false;
}
+ return true;
+ }
- /**
- * Sets the value of field 'mapped'.
- *
- * @param mapped the value of field 'mapped'.
- */
- public void setMapped(
- final uk.ac.vamsas.objects.core.Mapped mapped) {
- this._mapped = mapped;
- }
+ /**
+ *
+ *
+ * @param out
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void marshal(final java.io.Writer out)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, out);
+ }
- /**
- * Method unmarshal.
- *
- * @param reader
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @return the unmarshaled uk.ac.vamsas.objects.core.MapType
- */
- public static uk.ac.vamsas.objects.core.MapType unmarshal(
- final java.io.Reader reader)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- return (uk.ac.vamsas.objects.core.MapType) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.MapType.class, reader);
- }
+ /**
+ *
+ *
+ * @param handler
+ * @throws java.io.IOException
+ * if an IOException occurs during marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ */
+ public void marshal(final org.xml.sax.ContentHandler handler)
+ throws java.io.IOException, org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, handler);
+ }
- /**
- *
- *
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void validate(
- )
- throws org.exolab.castor.xml.ValidationException {
- org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
- validator.validate(this);
- }
+ /**
+ * Sets the value of field 'local'.
+ *
+ * @param local
+ * the value of field 'local'.
+ */
+ public void setLocal(final uk.ac.vamsas.objects.core.Local local) {
+ this._local = local;
+ }
+
+ /**
+ * Sets the value of field 'mapped'.
+ *
+ * @param mapped
+ * the value of field 'mapped'.
+ */
+ public void setMapped(final uk.ac.vamsas.objects.core.Mapped mapped) {
+ this._mapped = mapped;
+ }
+
+ /**
+ * Method unmarshal.
+ *
+ * @param reader
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @return the unmarshaled uk.ac.vamsas.objects.core.MapType
+ */
+ public static uk.ac.vamsas.objects.core.MapType unmarshal(
+ final java.io.Reader reader)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ return (uk.ac.vamsas.objects.core.MapType) Unmarshaller.unmarshal(
+ uk.ac.vamsas.objects.core.MapType.class, reader);
+ }
+
+ /**
+ *
+ *
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void validate() throws org.exolab.castor.xml.ValidationException {
+ org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+ validator.validate(this);
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/Mapped.java b/src/uk/ac/vamsas/objects/core/Mapped.java
index 4d3161f..497d29a 100644
--- a/src/uk/ac/vamsas/objects/core/Mapped.java
+++ b/src/uk/ac/vamsas/objects/core/Mapped.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import org.exolab.castor.xml.Marshaller;
@@ -19,136 +33,132 @@ import org.exolab.castor.xml.Unmarshaller;
*
* @version $Revision$ $Date$
*/
-public class Mapped extends MapRangeType
-implements java.io.Serializable
-{
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public Mapped() {
- super();
- }
+public class Mapped extends MapRangeType implements java.io.Serializable {
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
- //-----------/
- //- Methods -/
- //-----------/
-
- /**
- * Overrides the java.lang.Object.equals method.
- *
- * @param obj
- * @return true if the objects are equal.
- */
- public boolean equals(
- final java.lang.Object obj) {
- if ( this == obj )
- return true;
-
- if (super.equals(obj)==false)
- return false;
-
- if (obj instanceof Mapped) {
-
- return true;
- }
- return false;
- }
+ public Mapped() {
+ super();
+ }
- /**
- * Overrides the java.lang.Object.hashCode method.
- *
- * The following steps came from Effective Java Programming
- * Language Guide by Joshua Bloch, Chapter 3
- *
- * @return a hash code value for the object.
- */
- public int hashCode(
- ) {
- int result = super.hashCode();
-
- long tmp;
-
- return result;
- }
+ // -----------/
+ // - Methods -/
+ // -----------/
- /**
- * Method isValid.
- *
- * @return true if this object is valid according to the schema
- */
- public boolean isValid(
- ) {
- try {
- validate();
- } catch (org.exolab.castor.xml.ValidationException vex) {
- return false;
- }
- return true;
- }
+ /**
+ * Overrides the java.lang.Object.equals method.
+ *
+ * @param obj
+ * @return true if the objects are equal.
+ */
+ public boolean equals(final java.lang.Object obj) {
+ if (this == obj)
+ return true;
- /**
- *
- *
- * @param out
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void marshal(
- final java.io.Writer out)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, out);
- }
+ if (super.equals(obj) == false)
+ return false;
- /**
- *
- *
- * @param handler
- * @throws java.io.IOException if an IOException occurs during
- * marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- */
- public void marshal(
- final org.xml.sax.ContentHandler handler)
- throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, handler);
- }
+ if (obj instanceof Mapped) {
- /**
- * Method unmarshal.
- *
- * @param reader
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @return the unmarshaled uk.ac.vamsas.objects.core.RangeType
- */
- public static uk.ac.vamsas.objects.core.RangeType unmarshal(
- final java.io.Reader reader)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- return (uk.ac.vamsas.objects.core.RangeType) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Mapped.class, reader);
+ return true;
}
-
- /**
- *
- *
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void validate(
- )
- throws org.exolab.castor.xml.ValidationException {
- org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
- validator.validate(this);
+ return false;
+ }
+
+ /**
+ * Overrides the java.lang.Object.hashCode method.
+ *
+ * The following steps came from Effective Java Programming Language
+ * Guide by Joshua Bloch, Chapter 3
+ *
+ * @return a hash code value for the object.
+ */
+ public int hashCode() {
+ int result = super.hashCode();
+
+ long tmp;
+
+ return result;
+ }
+
+ /**
+ * Method isValid.
+ *
+ * @return true if this object is valid according to the schema
+ */
+ public boolean isValid() {
+ try {
+ validate();
+ } catch (org.exolab.castor.xml.ValidationException vex) {
+ return false;
}
+ return true;
+ }
+
+ /**
+ *
+ *
+ * @param out
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void marshal(final java.io.Writer out)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, out);
+ }
+
+ /**
+ *
+ *
+ * @param handler
+ * @throws java.io.IOException
+ * if an IOException occurs during marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ */
+ public void marshal(final org.xml.sax.ContentHandler handler)
+ throws java.io.IOException, org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, handler);
+ }
+
+ /**
+ * Method unmarshal.
+ *
+ * @param reader
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @return the unmarshaled uk.ac.vamsas.objects.core.RangeType
+ */
+ public static uk.ac.vamsas.objects.core.RangeType unmarshal(
+ final java.io.Reader reader)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ return (uk.ac.vamsas.objects.core.RangeType) Unmarshaller.unmarshal(
+ uk.ac.vamsas.objects.core.Mapped.class, reader);
+ }
+
+ /**
+ *
+ *
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void validate() throws org.exolab.castor.xml.ValidationException {
+ org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+ validator.validate(this);
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/Mapping.java b/src/uk/ac/vamsas/objects/core/Mapping.java
index 97eadf1..7ab5e0a 100644
--- a/src/uk/ac/vamsas/objects/core/Mapping.java
+++ b/src/uk/ac/vamsas/objects/core/Mapping.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import org.exolab.castor.xml.Marshaller;
@@ -19,184 +33,177 @@ import org.exolab.castor.xml.Unmarshaller;
*
* @version $Revision$ $Date$
*/
-public class Mapping extends uk.ac.vamsas.objects.core.MapList
-implements java.io.Serializable
-{
-
-
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
- * object to which the mapping is being mapped
- *
- */
- private java.lang.Object _onto;
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public Mapping() {
- super();
- }
-
-
- //-----------/
- //- Methods -/
- //-----------/
-
- /**
- * Overrides the java.lang.Object.equals method.
- *
- * @param obj
- * @return true if the objects are equal.
- */
- public boolean equals(
- final java.lang.Object obj) {
- if ( this == obj )
- return true;
-
- if (super.equals(obj)==false)
- return false;
-
- if (obj instanceof Mapping) {
-
- Mapping temp = (Mapping)obj;
- if (this._onto != null) {
- if (temp._onto == null) return false;
- else if (!(this._onto.equals(temp._onto)))
- return false;
- }
- else if (temp._onto != null)
- return false;
- return true;
- }
+public class Mapping extends uk.ac.vamsas.objects.core.MapList implements
+ java.io.Serializable {
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * object to which the mapping is being mapped
+ *
+ */
+ private java.lang.Object _onto;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public Mapping() {
+ super();
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ * Overrides the java.lang.Object.equals method.
+ *
+ * @param obj
+ * @return true if the objects are equal.
+ */
+ public boolean equals(final java.lang.Object obj) {
+ if (this == obj)
+ return true;
+
+ if (super.equals(obj) == false)
+ return false;
+
+ if (obj instanceof Mapping) {
+
+ Mapping temp = (Mapping) obj;
+ if (this._onto != null) {
+ if (temp._onto == null)
+ return false;
+ else if (!(this._onto.equals(temp._onto)))
+ return false;
+ } else if (temp._onto != null)
return false;
+ return true;
}
-
- /**
- * Returns the value of field 'onto'. The field 'onto' has the
- * following description: object to which the mapping is being
- * mapped
- *
- *
- * @return the value of field 'Onto'.
- */
- public java.lang.Object getOnto(
- ) {
- return this._onto;
- }
-
- /**
- * Overrides the java.lang.Object.hashCode method.
- *
- * The following steps came from Effective Java Programming
- * Language Guide by Joshua Bloch, Chapter 3
- *
- * @return a hash code value for the object.
- */
- public int hashCode(
- ) {
- int result = super.hashCode();
-
- long tmp;
- if (_onto != null) {
- result = 37 * result + _onto.hashCode();
- }
-
- return result;
- }
-
- /**
- * Method isValid.
- *
- * @return true if this object is valid according to the schema
- */
- public boolean isValid(
- ) {
- try {
- validate();
- } catch (org.exolab.castor.xml.ValidationException vex) {
- return false;
- }
- return true;
- }
-
- /**
- *
- *
- * @param out
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void marshal(
- final java.io.Writer out)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, out);
- }
-
- /**
- *
- *
- * @param handler
- * @throws java.io.IOException if an IOException occurs during
- * marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- */
- public void marshal(
- final org.xml.sax.ContentHandler handler)
- throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, handler);
- }
-
- /**
- * Sets the value of field 'onto'. The field 'onto' has the
- * following description: object to which the mapping is being
- * mapped
- *
- *
- * @param onto the value of field 'onto'.
- */
- public void setOnto(
- final java.lang.Object onto) {
- this._onto = onto;
- }
-
- /**
- * Method unmarshal.
- *
- * @param reader
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @return the unmarshaled uk.ac.vamsas.objects.core.MapList
- */
- public static uk.ac.vamsas.objects.core.MapList unmarshal(
- final java.io.Reader reader)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- return (uk.ac.vamsas.objects.core.MapList) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Mapping.class, reader);
+ return false;
+ }
+
+ /**
+ * Returns the value of field 'onto'. The field 'onto' has the following
+ * description: object to which the mapping is being mapped
+ *
+ *
+ * @return the value of field 'Onto'.
+ */
+ public java.lang.Object getOnto() {
+ return this._onto;
+ }
+
+ /**
+ * Overrides the java.lang.Object.hashCode method.
+ *
+ * The following steps came from Effective Java Programming Language
+ * Guide by Joshua Bloch, Chapter 3
+ *
+ * @return a hash code value for the object.
+ */
+ public int hashCode() {
+ int result = super.hashCode();
+
+ long tmp;
+ if (_onto != null) {
+ result = 37 * result + _onto.hashCode();
}
- /**
- *
- *
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void validate(
- )
- throws org.exolab.castor.xml.ValidationException {
- org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
- validator.validate(this);
+ return result;
+ }
+
+ /**
+ * Method isValid.
+ *
+ * @return true if this object is valid according to the schema
+ */
+ public boolean isValid() {
+ try {
+ validate();
+ } catch (org.exolab.castor.xml.ValidationException vex) {
+ return false;
}
+ return true;
+ }
+
+ /**
+ *
+ *
+ * @param out
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void marshal(final java.io.Writer out)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, out);
+ }
+
+ /**
+ *
+ *
+ * @param handler
+ * @throws java.io.IOException
+ * if an IOException occurs during marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ */
+ public void marshal(final org.xml.sax.ContentHandler handler)
+ throws java.io.IOException, org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, handler);
+ }
+
+ /**
+ * Sets the value of field 'onto'. The field 'onto' has the following
+ * description: object to which the mapping is being mapped
+ *
+ *
+ * @param onto
+ * the value of field 'onto'.
+ */
+ public void setOnto(final java.lang.Object onto) {
+ this._onto = onto;
+ }
+
+ /**
+ * Method unmarshal.
+ *
+ * @param reader
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @return the unmarshaled uk.ac.vamsas.objects.core.MapList
+ */
+ public static uk.ac.vamsas.objects.core.MapList unmarshal(
+ final java.io.Reader reader)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ return (uk.ac.vamsas.objects.core.MapList) Unmarshaller.unmarshal(
+ uk.ac.vamsas.objects.core.Mapping.class, reader);
+ }
+
+ /**
+ *
+ *
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void validate() throws org.exolab.castor.xml.ValidationException {
+ org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+ validator.validate(this);
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/Newick.java b/src/uk/ac/vamsas/objects/core/Newick.java
index 2813c56..ac9e2cf 100644
--- a/src/uk/ac/vamsas/objects/core/Newick.java
+++ b/src/uk/ac/vamsas/objects/core/Newick.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import org.exolab.castor.xml.Marshaller;
@@ -17,364 +31,383 @@ import org.exolab.castor.xml.Unmarshaller;
/**
* Class Newick.
*
- * @version $Revision$ $Date$
+ * @version $Revision$ $Date: 2007-06-28 14:51:44 +0100 (Thu, 28 Jun 2007)
+ * $
*/
-public class Newick extends uk.ac.vamsas.client.Vobject
-implements java.io.Serializable
-{
+public class Newick extends uk.ac.vamsas.client.Vobject implements
+ java.io.Serializable {
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
+ /**
+ * internal content storage
+ */
+ private java.lang.String _content = "";
- /**
- * internal content storage
- */
- private java.lang.String _content = "";
+ /**
+ * Field _title.
+ */
+ private java.lang.String _title;
- /**
- * Field _title.
- */
- private java.lang.String _title;
+ /**
+ * Primary Key for vamsas object referencing
+ *
+ */
+ private java.lang.String _id;
- /**
- * Primary Key for vamsas object referencing
- *
- */
- private java.lang.String _id;
+ /**
+ * Field _modifiable.
+ */
+ private java.lang.String _modifiable;
- /**
- * Field _modifiable.
- */
- private java.lang.String _modifiable;
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+ public Newick() {
+ super();
+ setContent("");
+ }
- //----------------/
- //- Constructors -/
- //----------------/
+ // -----------/
+ // - Methods -/
+ // -----------/
- public Newick() {
- super();
- setContent("");
- }
+ /**
+ * Overrides the java.lang.Object.equals method.
+ *
+ * @param obj
+ * @return true if the objects are equal.
+ */
+ public boolean equals(final java.lang.Object obj) {
+ if (this == obj)
+ return true;
+
+ if (super.equals(obj) == false)
+ return false;
+ if (obj instanceof Newick) {
- //-----------/
- //- Methods -/
- //-----------/
-
- /**
- * Overrides the java.lang.Object.equals method.
- *
- * @param obj
- * @return true if the objects are equal.
- */
- public boolean equals(
- final java.lang.Object obj) {
- if ( this == obj )
- return true;
-
- if (super.equals(obj)==false)
+ Newick temp = (Newick) obj;
+ boolean thcycle;
+ boolean tmcycle;
+ if (this._content != null) {
+ if (temp._content == null)
+ return false;
+ if (this._content != temp._content) {
+ thcycle = org.castor.util.CycleBreaker.startingToCycle(this._content);
+ tmcycle = org.castor.util.CycleBreaker.startingToCycle(temp._content);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._content);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._content);
+ }
+ ;
+ return false;
+ }
+ if (!thcycle) {
+ if (!this._content.equals(temp._content)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._content);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._content);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._content);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._content);
+ }
+ }
+ } else if (temp._content != null)
+ return false;
+ if (this._title != null) {
+ if (temp._title == null)
+ return false;
+ if (this._title != temp._title) {
+ thcycle = org.castor.util.CycleBreaker.startingToCycle(this._title);
+ tmcycle = org.castor.util.CycleBreaker.startingToCycle(temp._title);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._title);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._title);
+ }
+ ;
return false;
-
- if (obj instanceof Newick) {
-
- Newick temp = (Newick)obj;
- boolean thcycle;
- boolean tmcycle;
- if (this._content != null) {
- if (temp._content == null) return false;
- if (this._content != temp._content) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._content);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._content);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._content); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._content); };
- return false;
- }
- if (!thcycle) {
- if (!this._content.equals(temp._content)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._content);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._content);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._content);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._content);
- }
- }
- } else if (temp._content != null)
- return false;
- if (this._title != null) {
- if (temp._title == null) return false;
- if (this._title != temp._title) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._title);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._title);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._title); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._title); };
- return false;
- }
- if (!thcycle) {
- if (!this._title.equals(temp._title)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._title);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._title);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._title);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._title);
- }
- }
- } else if (temp._title != null)
- return false;
- if (this._id != null) {
- if (temp._id == null) return false;
- if (this._id != temp._id) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._id);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._id);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._id); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._id); };
- return false;
- }
- if (!thcycle) {
- if (!this._id.equals(temp._id)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
- }
- }
- } else if (temp._id != null)
- return false;
- if (this._modifiable != null) {
- if (temp._modifiable == null) return false;
- if (this._modifiable != temp._modifiable) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._modifiable);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._modifiable);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._modifiable); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._modifiable); };
- return false;
- }
- if (!thcycle) {
- if (!this._modifiable.equals(temp._modifiable)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._modifiable);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._modifiable);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._modifiable);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._modifiable);
- }
- }
- } else if (temp._modifiable != null)
- return false;
- return true;
+ }
+ if (!thcycle) {
+ if (!this._title.equals(temp._title)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._title);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._title);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._title);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._title);
+ }
}
+ } else if (temp._title != null)
return false;
+ if (this._id != null) {
+ if (temp._id == null)
+ return false;
+ if (this._id != temp._id) {
+ thcycle = org.castor.util.CycleBreaker.startingToCycle(this._id);
+ tmcycle = org.castor.util.CycleBreaker.startingToCycle(temp._id);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
+ }
+ ;
+ return false;
+ }
+ if (!thcycle) {
+ if (!this._id.equals(temp._id)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
+ }
+ }
+ } else if (temp._id != null)
+ return false;
+ if (this._modifiable != null) {
+ if (temp._modifiable == null)
+ return false;
+ if (this._modifiable != temp._modifiable) {
+ thcycle = org.castor.util.CycleBreaker
+ .startingToCycle(this._modifiable);
+ tmcycle = org.castor.util.CycleBreaker
+ .startingToCycle(temp._modifiable);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._modifiable);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._modifiable);
+ }
+ ;
+ return false;
+ }
+ if (!thcycle) {
+ if (!this._modifiable.equals(temp._modifiable)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._modifiable);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._modifiable);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._modifiable);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._modifiable);
+ }
+ }
+ } else if (temp._modifiable != null)
+ return false;
+ return true;
}
+ return false;
+ }
- /**
- * Returns the value of field 'content'. The field 'content'
- * has the following description: internal content storage
- *
- * @return the value of field 'Content'.
- */
- public java.lang.String getContent(
- ) {
- return this._content;
- }
+ /**
+ * Returns the value of field 'content'. The field 'content' has the following
+ * description: internal content storage
+ *
+ * @return the value of field 'Content'.
+ */
+ public java.lang.String getContent() {
+ return this._content;
+ }
- /**
- * Returns the value of field 'id'. The field 'id' has the
- * following description: Primary Key for vamsas object
- * referencing
- *
- *
- * @return the value of field 'Id'.
- */
- public java.lang.String getId(
- ) {
- return this._id;
- }
+ /**
+ * Returns the value of field 'id'. The field 'id' has the following
+ * description: Primary Key for vamsas object referencing
+ *
+ *
+ * @return the value of field 'Id'.
+ */
+ public java.lang.String getId() {
+ return this._id;
+ }
- /**
- * Returns the value of field 'modifiable'.
- *
- * @return the value of field 'Modifiable'.
- */
- public java.lang.String getModifiable(
- ) {
- return this._modifiable;
- }
+ /**
+ * Returns the value of field 'modifiable'.
+ *
+ * @return the value of field 'Modifiable'.
+ */
+ public java.lang.String getModifiable() {
+ return this._modifiable;
+ }
- /**
- * Returns the value of field 'title'.
- *
- * @return the value of field 'Title'.
- */
- public java.lang.String getTitle(
- ) {
- return this._title;
- }
+ /**
+ * Returns the value of field 'title'.
+ *
+ * @return the value of field 'Title'.
+ */
+ public java.lang.String getTitle() {
+ return this._title;
+ }
- /**
- * Overrides the java.lang.Object.hashCode method.
- *
- * The following steps came from Effective Java Programming
- * Language Guide by Joshua Bloch, Chapter 3
- *
- * @return a hash code value for the object.
- */
- public int hashCode(
- ) {
- int result = super.hashCode();
-
- long tmp;
- if (_content != null
- && !org.castor.util.CycleBreaker.startingToCycle(_content)) {
- result = 37 * result + _content.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_content);
- }
- if (_title != null
- && !org.castor.util.CycleBreaker.startingToCycle(_title)) {
- result = 37 * result + _title.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_title);
- }
- if (_id != null
- && !org.castor.util.CycleBreaker.startingToCycle(_id)) {
- result = 37 * result + _id.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_id);
- }
- if (_modifiable != null
- && !org.castor.util.CycleBreaker.startingToCycle(_modifiable)) {
- result = 37 * result + _modifiable.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_modifiable);
- }
-
- return result;
- }
+ /**
+ * Overrides the java.lang.Object.hashCode method.
+ *
+ * The following steps came from Effective Java Programming Language
+ * Guide by Joshua Bloch, Chapter 3
+ *
+ * @return a hash code value for the object.
+ */
+ public int hashCode() {
+ int result = super.hashCode();
- /**
- * Method isValid.
- *
- * @return true if this object is valid according to the schema
- */
- public boolean isValid(
- ) {
- try {
- validate();
- } catch (org.exolab.castor.xml.ValidationException vex) {
- return false;
- }
- return true;
+ long tmp;
+ if (_content != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_content)) {
+ result = 37 * result + _content.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_content);
}
-
- /**
- *
- *
- * @param out
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void marshal(
- final java.io.Writer out)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, out);
+ if (_title != null && !org.castor.util.CycleBreaker.startingToCycle(_title)) {
+ result = 37 * result + _title.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_title);
}
-
- /**
- *
- *
- * @param handler
- * @throws java.io.IOException if an IOException occurs during
- * marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- */
- public void marshal(
- final org.xml.sax.ContentHandler handler)
- throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, handler);
+ if (_id != null && !org.castor.util.CycleBreaker.startingToCycle(_id)) {
+ result = 37 * result + _id.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_id);
}
-
- /**
- * Sets the value of field 'content'. The field 'content' has
- * the following description: internal content storage
- *
- * @param content the value of field 'content'.
- */
- public void setContent(
- final java.lang.String content) {
- this._content = content;
+ if (_modifiable != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_modifiable)) {
+ result = 37 * result + _modifiable.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_modifiable);
}
- /**
- * Sets the value of field 'id'. The field 'id' has the
- * following description: Primary Key for vamsas object
- * referencing
- *
- *
- * @param id the value of field 'id'.
- */
- public void setId(
- final java.lang.String id) {
- this._id = id;
- }
+ return result;
+ }
- /**
- * Sets the value of field 'modifiable'.
- *
- * @param modifiable the value of field 'modifiable'.
- */
- public void setModifiable(
- final java.lang.String modifiable) {
- this._modifiable = modifiable;
+ /**
+ * Method isValid.
+ *
+ * @return true if this object is valid according to the schema
+ */
+ public boolean isValid() {
+ try {
+ validate();
+ } catch (org.exolab.castor.xml.ValidationException vex) {
+ return false;
}
+ return true;
+ }
- /**
- * Sets the value of field 'title'.
- *
- * @param title the value of field 'title'.
- */
- public void setTitle(
- final java.lang.String title) {
- this._title = title;
- }
+ /**
+ *
+ *
+ * @param out
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void marshal(final java.io.Writer out)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, out);
+ }
- /**
- * Method unmarshal.
- *
- * @param reader
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @return the unmarshaled uk.ac.vamsas.objects.core.Newick
- */
- public static uk.ac.vamsas.objects.core.Newick unmarshal(
- final java.io.Reader reader)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- return (uk.ac.vamsas.objects.core.Newick) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Newick.class, reader);
- }
+ /**
+ *
+ *
+ * @param handler
+ * @throws java.io.IOException
+ * if an IOException occurs during marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ */
+ public void marshal(final org.xml.sax.ContentHandler handler)
+ throws java.io.IOException, org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, handler);
+ }
- /**
- *
- *
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void validate(
- )
- throws org.exolab.castor.xml.ValidationException {
- org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
- validator.validate(this);
- }
+ /**
+ * Sets the value of field 'content'. The field 'content' has the following
+ * description: internal content storage
+ *
+ * @param content
+ * the value of field 'content'.
+ */
+ public void setContent(final java.lang.String content) {
+ this._content = content;
+ }
+
+ /**
+ * Sets the value of field 'id'. The field 'id' has the following description:
+ * Primary Key for vamsas object referencing
+ *
+ *
+ * @param id
+ * the value of field 'id'.
+ */
+ public void setId(final java.lang.String id) {
+ this._id = id;
+ }
+
+ /**
+ * Sets the value of field 'modifiable'.
+ *
+ * @param modifiable
+ * the value of field 'modifiable'.
+ */
+ public void setModifiable(final java.lang.String modifiable) {
+ this._modifiable = modifiable;
+ }
+
+ /**
+ * Sets the value of field 'title'.
+ *
+ * @param title
+ * the value of field 'title'.
+ */
+ public void setTitle(final java.lang.String title) {
+ this._title = title;
+ }
+
+ /**
+ * Method unmarshal.
+ *
+ * @param reader
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @return the unmarshaled uk.ac.vamsas.objects.core.Newick
+ */
+ public static uk.ac.vamsas.objects.core.Newick unmarshal(
+ final java.io.Reader reader)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ return (uk.ac.vamsas.objects.core.Newick) Unmarshaller.unmarshal(
+ uk.ac.vamsas.objects.core.Newick.class, reader);
+ }
+
+ /**
+ *
+ *
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void validate() throws org.exolab.castor.xml.ValidationException {
+ org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+ validator.validate(this);
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/NodeType.java b/src/uk/ac/vamsas/objects/core/NodeType.java
index 488c0ee..1109722 100644
--- a/src/uk/ac/vamsas/objects/core/NodeType.java
+++ b/src/uk/ac/vamsas/objects/core/NodeType.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import org.exolab.castor.xml.Marshaller;
@@ -19,805 +33,828 @@ import org.exolab.castor.xml.Unmarshaller;
*
* @version $Revision$ $Date$
*/
-public class NodeType extends uk.ac.vamsas.client.Vobject
-implements java.io.Serializable
-{
-
-
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
- * Primary Key for vamsas object referencing
- */
- private java.lang.String _id;
-
- /**
- * Field _modifiable.
- */
- private java.lang.String _modifiable;
-
- /**
- * Short name for this node
- */
- private java.lang.String _name;
-
- /**
- * Descriptive text for this node
- */
- private java.lang.String _description;
-
- /**
- * Direct associations between this node and any vamsas
- * objects
- */
- private java.util.Vector _vrefList;
-
- /**
- * Field _propertyList.
- */
- private java.util.Vector _propertyList;
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public NodeType() {
- super();
- this._vrefList = new java.util.Vector();
- this._propertyList = new java.util.Vector();
- }
-
-
- //-----------/
- //- Methods -/
- //-----------/
-
- /**
- *
- *
- * @param vProperty
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addProperty(
- final uk.ac.vamsas.objects.core.Property vProperty)
- throws java.lang.IndexOutOfBoundsException {
- this._propertyList.addElement(vProperty);
- }
-
- /**
- *
- *
- * @param index
- * @param vProperty
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addProperty(
- final int index,
- final uk.ac.vamsas.objects.core.Property vProperty)
- throws java.lang.IndexOutOfBoundsException {
- this._propertyList.add(index, vProperty);
- }
-
- /**
- *
- *
- * @param vVref
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addVref(
- final uk.ac.vamsas.objects.core.Vref vVref)
- throws java.lang.IndexOutOfBoundsException {
- this._vrefList.addElement(vVref);
- }
-
- /**
- *
- *
- * @param index
- * @param vVref
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addVref(
- final int index,
- final uk.ac.vamsas.objects.core.Vref vVref)
- throws java.lang.IndexOutOfBoundsException {
- this._vrefList.add(index, vVref);
- }
-
- /**
- * Method enumerateProperty.
- *
- * @return an Enumeration over all
- * uk.ac.vamsas.objects.core.Property elements
- */
- public java.util.Enumeration enumerateProperty(
- ) {
- return this._propertyList.elements();
- }
-
- /**
- * Method enumerateVref.
- *
- * @return an Enumeration over all
- * uk.ac.vamsas.objects.core.Vref elements
- */
- public java.util.Enumeration enumerateVref(
- ) {
- return this._vrefList.elements();
- }
-
- /**
- * Overrides the java.lang.Object.equals method.
- *
- * @param obj
- * @return true if the objects are equal.
- */
- public boolean equals(
- final java.lang.Object obj) {
- if ( this == obj )
- return true;
-
- if (super.equals(obj)==false)
+public class NodeType extends uk.ac.vamsas.client.Vobject implements
+ java.io.Serializable {
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * Primary Key for vamsas object referencing
+ */
+ private java.lang.String _id;
+
+ /**
+ * Field _modifiable.
+ */
+ private java.lang.String _modifiable;
+
+ /**
+ * Short name for this node
+ */
+ private java.lang.String _name;
+
+ /**
+ * Descriptive text for this node
+ */
+ private java.lang.String _description;
+
+ /**
+ * Direct associations between this node and any vamsas objects
+ */
+ private java.util.Vector _vrefList;
+
+ /**
+ * Field _propertyList.
+ */
+ private java.util.Vector _propertyList;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public NodeType() {
+ super();
+ this._vrefList = new java.util.Vector();
+ this._propertyList = new java.util.Vector();
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ *
+ *
+ * @param vProperty
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addProperty(final uk.ac.vamsas.objects.core.Property vProperty)
+ throws java.lang.IndexOutOfBoundsException {
+ this._propertyList.addElement(vProperty);
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vProperty
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addProperty(final int index,
+ final uk.ac.vamsas.objects.core.Property vProperty)
+ throws java.lang.IndexOutOfBoundsException {
+ this._propertyList.add(index, vProperty);
+ }
+
+ /**
+ *
+ *
+ * @param vVref
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addVref(final uk.ac.vamsas.objects.core.Vref vVref)
+ throws java.lang.IndexOutOfBoundsException {
+ this._vrefList.addElement(vVref);
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vVref
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addVref(final int index,
+ final uk.ac.vamsas.objects.core.Vref vVref)
+ throws java.lang.IndexOutOfBoundsException {
+ this._vrefList.add(index, vVref);
+ }
+
+ /**
+ * Method enumerateProperty.
+ *
+ * @return an Enumeration over all uk.ac.vamsas.objects.core.Property elements
+ */
+ public java.util.Enumeration enumerateProperty() {
+ return this._propertyList.elements();
+ }
+
+ /**
+ * Method enumerateVref.
+ *
+ * @return an Enumeration over all uk.ac.vamsas.objects.core.Vref elements
+ */
+ public java.util.Enumeration enumerateVref() {
+ return this._vrefList.elements();
+ }
+
+ /**
+ * Overrides the java.lang.Object.equals method.
+ *
+ * @param obj
+ * @return true if the objects are equal.
+ */
+ public boolean equals(final java.lang.Object obj) {
+ if (this == obj)
+ return true;
+
+ if (super.equals(obj) == false)
+ return false;
+
+ if (obj instanceof NodeType) {
+
+ NodeType temp = (NodeType) obj;
+ boolean thcycle;
+ boolean tmcycle;
+ if (this._id != null) {
+ if (temp._id == null)
+ return false;
+ if (this._id != temp._id) {
+ thcycle = org.castor.util.CycleBreaker.startingToCycle(this._id);
+ tmcycle = org.castor.util.CycleBreaker.startingToCycle(temp._id);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
+ }
+ ;
return false;
-
- if (obj instanceof NodeType) {
-
- NodeType temp = (NodeType)obj;
- boolean thcycle;
- boolean tmcycle;
- if (this._id != null) {
- if (temp._id == null) return false;
- if (this._id != temp._id) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._id);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._id);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._id); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._id); };
- return false;
- }
- if (!thcycle) {
- if (!this._id.equals(temp._id)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
- }
- }
- } else if (temp._id != null)
- return false;
- if (this._modifiable != null) {
- if (temp._modifiable == null) return false;
- if (this._modifiable != temp._modifiable) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._modifiable);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._modifiable);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._modifiable); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._modifiable); };
- return false;
- }
- if (!thcycle) {
- if (!this._modifiable.equals(temp._modifiable)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._modifiable);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._modifiable);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._modifiable);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._modifiable);
- }
- }
- } else if (temp._modifiable != null)
- return false;
- if (this._name != null) {
- if (temp._name == null) return false;
- if (this._name != temp._name) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._name);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._name);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._name); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._name); };
- return false;
- }
- if (!thcycle) {
- if (!this._name.equals(temp._name)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._name);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._name);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._name);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._name);
- }
- }
- } else if (temp._name != null)
- return false;
- if (this._description != null) {
- if (temp._description == null) return false;
- if (this._description != temp._description) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._description);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._description);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._description); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._description); };
- return false;
- }
- if (!thcycle) {
- if (!this._description.equals(temp._description)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._description);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._description);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._description);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._description);
- }
- }
- } else if (temp._description != null)
- return false;
- if (this._vrefList != null) {
- if (temp._vrefList == null) return false;
- if (this._vrefList != temp._vrefList) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._vrefList);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._vrefList);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._vrefList); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._vrefList); };
- return false;
- }
- if (!thcycle) {
- if (!this._vrefList.equals(temp._vrefList)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._vrefList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._vrefList);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._vrefList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._vrefList);
- }
- }
- } else if (temp._vrefList != null)
- return false;
- if (this._propertyList != null) {
- if (temp._propertyList == null) return false;
- if (this._propertyList != temp._propertyList) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._propertyList);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._propertyList);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._propertyList); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._propertyList); };
- return false;
- }
- if (!thcycle) {
- if (!this._propertyList.equals(temp._propertyList)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._propertyList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._propertyList);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._propertyList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._propertyList);
- }
- }
- } else if (temp._propertyList != null)
- return false;
- return true;
+ }
+ if (!thcycle) {
+ if (!this._id.equals(temp._id)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
+ }
}
+ } else if (temp._id != null)
return false;
- }
-
- /**
- * Returns the value of field 'description'. The field
- * 'description' has the following description: Descriptive
- * text for this node
- *
- * @return the value of field 'Description'.
- */
- public java.lang.String getDescription(
- ) {
- return this._description;
- }
-
- /**
- * Returns the value of field 'id'. The field 'id' has the
- * following description: Primary Key for vamsas object
- * referencing
- *
- * @return the value of field 'Id'.
- */
- public java.lang.String getId(
- ) {
- return this._id;
- }
-
- /**
- * Returns the value of field 'modifiable'.
- *
- * @return the value of field 'Modifiable'.
- */
- public java.lang.String getModifiable(
- ) {
- return this._modifiable;
- }
-
- /**
- * Returns the value of field 'name'. The field 'name' has the
- * following description: Short name for this node
- *
- * @return the value of field 'Name'.
- */
- public java.lang.String getName(
- ) {
- return this._name;
- }
-
- /**
- * Method getProperty.
- *
- * @param index
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- * @return the value of the uk.ac.vamsas.objects.core.Property
- * at the given index
- */
- public uk.ac.vamsas.objects.core.Property getProperty(
- final int index)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._propertyList.size()) {
- throw new IndexOutOfBoundsException("getProperty: Index value '" + index + "' not in range [0.." + (this._propertyList.size() - 1) + "]");
- }
-
- return (uk.ac.vamsas.objects.core.Property) _propertyList.get(index);
- }
-
- /**
- * Method getProperty.Returns the contents of the collection in
- * an Array.
Note: Just in case the collection contents
- * are changing in another thread, we pass a 0-length Array of
- * the correct type into the API call. This way we know
- * that the Array returned is of exactly the correct length.
- *
- * @return this collection as an Array
- */
- public uk.ac.vamsas.objects.core.Property[] getProperty(
- ) {
- uk.ac.vamsas.objects.core.Property[] array = new uk.ac.vamsas.objects.core.Property[0];
- return (uk.ac.vamsas.objects.core.Property[]) this._propertyList.toArray(array);
- }
-
- /**
- * Method getPropertyAsReference.Returns a reference to
- * '_propertyList'. No type checking is performed on any
- * modifications to the Vector.
- *
- * @return a reference to the Vector backing this class
- */
- public java.util.Vector getPropertyAsReference(
- ) {
- return this._propertyList;
- }
-
- /**
- * Method getPropertyCount.
- *
- * @return the size of this collection
- */
- public int getPropertyCount(
- ) {
- return this._propertyList.size();
- }
-
- /**
- * Method getVref.
- *
- * @param index
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- * @return the value of the uk.ac.vamsas.objects.core.Vref at
- * the given index
- */
- public uk.ac.vamsas.objects.core.Vref getVref(
- final int index)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._vrefList.size()) {
- throw new IndexOutOfBoundsException("getVref: Index value '" + index + "' not in range [0.." + (this._vrefList.size() - 1) + "]");
- }
-
- return (uk.ac.vamsas.objects.core.Vref) _vrefList.get(index);
- }
-
- /**
- * Method getVref.Returns the contents of the collection in an
- * Array.
Note: Just in case the collection contents are
- * changing in another thread, we pass a 0-length Array of the
- * correct type into the API call. This way we know
- * that the Array returned is of exactly the correct length.
- *
- * @return this collection as an Array
- */
- public uk.ac.vamsas.objects.core.Vref[] getVref(
- ) {
- uk.ac.vamsas.objects.core.Vref[] array = new uk.ac.vamsas.objects.core.Vref[0];
- return (uk.ac.vamsas.objects.core.Vref[]) this._vrefList.toArray(array);
- }
-
- /**
- * Method getVrefAsReference.Returns a reference to
- * '_vrefList'. No type checking is performed on any
- * modifications to the Vector.
- *
- * @return a reference to the Vector backing this class
- */
- public java.util.Vector getVrefAsReference(
- ) {
- return this._vrefList;
- }
-
- /**
- * Method getVrefCount.
- *
- * @return the size of this collection
- */
- public int getVrefCount(
- ) {
- return this._vrefList.size();
- }
-
- /**
- * Overrides the java.lang.Object.hashCode method.
- *
- * The following steps came from Effective Java Programming
- * Language Guide by Joshua Bloch, Chapter 3
- *
- * @return a hash code value for the object.
- */
- public int hashCode(
- ) {
- int result = super.hashCode();
-
- long tmp;
- if (_id != null
- && !org.castor.util.CycleBreaker.startingToCycle(_id)) {
- result = 37 * result + _id.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_id);
- }
- if (_modifiable != null
- && !org.castor.util.CycleBreaker.startingToCycle(_modifiable)) {
- result = 37 * result + _modifiable.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_modifiable);
- }
- if (_name != null
- && !org.castor.util.CycleBreaker.startingToCycle(_name)) {
- result = 37 * result + _name.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_name);
- }
- if (_description != null
- && !org.castor.util.CycleBreaker.startingToCycle(_description)) {
- result = 37 * result + _description.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_description);
- }
- if (_vrefList != null
- && !org.castor.util.CycleBreaker.startingToCycle(_vrefList)) {
- result = 37 * result + _vrefList.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_vrefList);
- }
- if (_propertyList != null
- && !org.castor.util.CycleBreaker.startingToCycle(_propertyList)) {
- result = 37 * result + _propertyList.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_propertyList);
- }
-
- return result;
- }
-
- /**
- * Method isValid.
- *
- * @return true if this object is valid according to the schema
- */
- public boolean isValid(
- ) {
- try {
- validate();
- } catch (org.exolab.castor.xml.ValidationException vex) {
+ if (this._modifiable != null) {
+ if (temp._modifiable == null)
+ return false;
+ if (this._modifiable != temp._modifiable) {
+ thcycle = org.castor.util.CycleBreaker
+ .startingToCycle(this._modifiable);
+ tmcycle = org.castor.util.CycleBreaker
+ .startingToCycle(temp._modifiable);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._modifiable);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._modifiable);
+ }
+ ;
return false;
+ }
+ if (!thcycle) {
+ if (!this._modifiable.equals(temp._modifiable)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._modifiable);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._modifiable);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._modifiable);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._modifiable);
+ }
}
- return true;
- }
-
- /**
- *
- *
- * @param out
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void marshal(
- final java.io.Writer out)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, out);
- }
-
- /**
- *
- *
- * @param handler
- * @throws java.io.IOException if an IOException occurs during
- * marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- */
- public void marshal(
- final org.xml.sax.ContentHandler handler)
- throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, handler);
- }
-
- /**
- */
- public void removeAllProperty(
- ) {
- this._propertyList.clear();
- }
-
- /**
- */
- public void removeAllVref(
- ) {
- this._vrefList.clear();
- }
-
- /**
- * Method removeProperty.
- *
- * @param vProperty
- * @return true if the object was removed from the collection.
- */
- public boolean removeProperty(
- final uk.ac.vamsas.objects.core.Property vProperty) {
- boolean removed = _propertyList.remove(vProperty);
- return removed;
- }
-
- /**
- * Method removePropertyAt.
- *
- * @param index
- * @return the element removed from the collection
- */
- public uk.ac.vamsas.objects.core.Property removePropertyAt(
- final int index) {
- java.lang.Object obj = this._propertyList.remove(index);
- return (uk.ac.vamsas.objects.core.Property) obj;
- }
-
- /**
- * Method removeVref.
- *
- * @param vVref
- * @return true if the object was removed from the collection.
- */
- public boolean removeVref(
- final uk.ac.vamsas.objects.core.Vref vVref) {
- boolean removed = _vrefList.remove(vVref);
- return removed;
- }
-
- /**
- * Method removeVrefAt.
- *
- * @param index
- * @return the element removed from the collection
- */
- public uk.ac.vamsas.objects.core.Vref removeVrefAt(
- final int index) {
- java.lang.Object obj = this._vrefList.remove(index);
- return (uk.ac.vamsas.objects.core.Vref) obj;
- }
-
- /**
- * Sets the value of field 'description'. The field
- * 'description' has the following description: Descriptive
- * text for this node
- *
- * @param description the value of field 'description'.
- */
- public void setDescription(
- final java.lang.String description) {
- this._description = description;
- }
-
- /**
- * Sets the value of field 'id'. The field 'id' has the
- * following description: Primary Key for vamsas object
- * referencing
- *
- * @param id the value of field 'id'.
- */
- public void setId(
- final java.lang.String id) {
- this._id = id;
- }
-
- /**
- * Sets the value of field 'modifiable'.
- *
- * @param modifiable the value of field 'modifiable'.
- */
- public void setModifiable(
- final java.lang.String modifiable) {
- this._modifiable = modifiable;
- }
-
- /**
- * Sets the value of field 'name'. The field 'name' has the
- * following description: Short name for this node
- *
- * @param name the value of field 'name'.
- */
- public void setName(
- final java.lang.String name) {
- this._name = name;
- }
-
- /**
- *
- *
- * @param index
- * @param vProperty
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void setProperty(
- final int index,
- final uk.ac.vamsas.objects.core.Property vProperty)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._propertyList.size()) {
- throw new IndexOutOfBoundsException("setProperty: Index value '" + index + "' not in range [0.." + (this._propertyList.size() - 1) + "]");
+ } else if (temp._modifiable != null)
+ return false;
+ if (this._name != null) {
+ if (temp._name == null)
+ return false;
+ if (this._name != temp._name) {
+ thcycle = org.castor.util.CycleBreaker.startingToCycle(this._name);
+ tmcycle = org.castor.util.CycleBreaker.startingToCycle(temp._name);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._name);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._name);
+ }
+ ;
+ return false;
+ }
+ if (!thcycle) {
+ if (!this._name.equals(temp._name)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._name);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._name);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._name);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._name);
+ }
}
-
- this._propertyList.set(index, vProperty);
- }
-
- /**
- *
- *
- * @param vPropertyArray
- */
- public void setProperty(
- final uk.ac.vamsas.objects.core.Property[] vPropertyArray) {
- //-- copy array
- _propertyList.clear();
-
- for (int i = 0; i < vPropertyArray.length; i++) {
- this._propertyList.add(vPropertyArray[i]);
+ } else if (temp._name != null)
+ return false;
+ if (this._description != null) {
+ if (temp._description == null)
+ return false;
+ if (this._description != temp._description) {
+ thcycle = org.castor.util.CycleBreaker
+ .startingToCycle(this._description);
+ tmcycle = org.castor.util.CycleBreaker
+ .startingToCycle(temp._description);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(this._description);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(temp._description);
+ }
+ ;
+ return false;
+ }
+ if (!thcycle) {
+ if (!this._description.equals(temp._description)) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(this._description);
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(temp._description);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._description);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._description);
+ }
}
- }
-
- /**
- * Sets the value of '_propertyList' by copying the given
- * Vector. All elements will be checked for type safety.
- *
- * @param vPropertyList the Vector to copy.
- */
- public void setProperty(
- final java.util.Vector vPropertyList) {
- // copy vector
- this._propertyList.clear();
-
- this._propertyList.addAll(vPropertyList);
- }
-
- /**
- * Sets the value of '_propertyList' by setting it to the given
- * Vector. No type checking is performed.
- * @deprecated
- *
- * @param propertyVector the Vector to set.
- */
- public void setPropertyAsReference(
- final java.util.Vector propertyVector) {
- this._propertyList = propertyVector;
- }
-
- /**
- *
- *
- * @param index
- * @param vVref
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void setVref(
- final int index,
- final uk.ac.vamsas.objects.core.Vref vVref)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._vrefList.size()) {
- throw new IndexOutOfBoundsException("setVref: Index value '" + index + "' not in range [0.." + (this._vrefList.size() - 1) + "]");
+ } else if (temp._description != null)
+ return false;
+ if (this._vrefList != null) {
+ if (temp._vrefList == null)
+ return false;
+ if (this._vrefList != temp._vrefList) {
+ thcycle = org.castor.util.CycleBreaker
+ .startingToCycle(this._vrefList);
+ tmcycle = org.castor.util.CycleBreaker
+ .startingToCycle(temp._vrefList);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._vrefList);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._vrefList);
+ }
+ ;
+ return false;
+ }
+ if (!thcycle) {
+ if (!this._vrefList.equals(temp._vrefList)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._vrefList);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._vrefList);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._vrefList);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._vrefList);
+ }
}
-
- this._vrefList.set(index, vVref);
- }
-
- /**
- *
- *
- * @param vVrefArray
- */
- public void setVref(
- final uk.ac.vamsas.objects.core.Vref[] vVrefArray) {
- //-- copy array
- _vrefList.clear();
-
- for (int i = 0; i < vVrefArray.length; i++) {
- this._vrefList.add(vVrefArray[i]);
+ } else if (temp._vrefList != null)
+ return false;
+ if (this._propertyList != null) {
+ if (temp._propertyList == null)
+ return false;
+ if (this._propertyList != temp._propertyList) {
+ thcycle = org.castor.util.CycleBreaker
+ .startingToCycle(this._propertyList);
+ tmcycle = org.castor.util.CycleBreaker
+ .startingToCycle(temp._propertyList);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(this._propertyList);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(temp._propertyList);
+ }
+ ;
+ return false;
+ }
+ if (!thcycle) {
+ if (!this._propertyList.equals(temp._propertyList)) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(this._propertyList);
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(temp._propertyList);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._propertyList);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._propertyList);
+ }
}
- }
-
- /**
- * Sets the value of '_vrefList' by copying the given Vector.
- * All elements will be checked for type safety.
- *
- * @param vVrefList the Vector to copy.
- */
- public void setVref(
- final java.util.Vector vVrefList) {
- // copy vector
- this._vrefList.clear();
-
- this._vrefList.addAll(vVrefList);
- }
-
- /**
- * Sets the value of '_vrefList' by setting it to the given
- * Vector. No type checking is performed.
- * @deprecated
- *
- * @param vrefVector the Vector to set.
- */
- public void setVrefAsReference(
- final java.util.Vector vrefVector) {
- this._vrefList = vrefVector;
- }
-
- /**
- * Method unmarshal.
- *
- * @param reader
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @return the unmarshaled uk.ac.vamsas.objects.core.NodeType
- */
- public static uk.ac.vamsas.objects.core.NodeType unmarshal(
- final java.io.Reader reader)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- return (uk.ac.vamsas.objects.core.NodeType) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.NodeType.class, reader);
- }
-
- /**
- *
- *
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void validate(
- )
- throws org.exolab.castor.xml.ValidationException {
- org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
- validator.validate(this);
- }
+ } else if (temp._propertyList != null)
+ return false;
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Returns the value of field 'description'. The field 'description' has the
+ * following description: Descriptive text for this node
+ *
+ * @return the value of field 'Description'.
+ */
+ public java.lang.String getDescription() {
+ return this._description;
+ }
+
+ /**
+ * Returns the value of field 'id'. The field 'id' has the following
+ * description: Primary Key for vamsas object referencing
+ *
+ * @return the value of field 'Id'.
+ */
+ public java.lang.String getId() {
+ return this._id;
+ }
+
+ /**
+ * Returns the value of field 'modifiable'.
+ *
+ * @return the value of field 'Modifiable'.
+ */
+ public java.lang.String getModifiable() {
+ return this._modifiable;
+ }
+
+ /**
+ * Returns the value of field 'name'. The field 'name' has the following
+ * description: Short name for this node
+ *
+ * @return the value of field 'Name'.
+ */
+ public java.lang.String getName() {
+ return this._name;
+ }
+
+ /**
+ * Method getProperty.
+ *
+ * @param index
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ * @return the value of the uk.ac.vamsas.objects.core.Property at the given
+ * index
+ */
+ public uk.ac.vamsas.objects.core.Property getProperty(final int index)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._propertyList.size()) {
+ throw new IndexOutOfBoundsException("getProperty: Index value '" + index
+ + "' not in range [0.." + (this._propertyList.size() - 1) + "]");
+ }
+
+ return (uk.ac.vamsas.objects.core.Property) _propertyList.get(index);
+ }
+
+ /**
+ * Method getProperty.Returns the contents of the collection in an Array.
+ *
+ * Note: Just in case the collection contents are changing in another thread,
+ * we pass a 0-length Array of the correct type into the API call. This way we
+ * know that the Array returned is of exactly the correct length.
+ *
+ * @return this collection as an Array
+ */
+ public uk.ac.vamsas.objects.core.Property[] getProperty() {
+ uk.ac.vamsas.objects.core.Property[] array = new uk.ac.vamsas.objects.core.Property[0];
+ return (uk.ac.vamsas.objects.core.Property[]) this._propertyList
+ .toArray(array);
+ }
+
+ /**
+ * Method getPropertyAsReference.Returns a reference to '_propertyList'. No
+ * type checking is performed on any modifications to the Vector.
+ *
+ * @return a reference to the Vector backing this class
+ */
+ public java.util.Vector getPropertyAsReference() {
+ return this._propertyList;
+ }
+
+ /**
+ * Method getPropertyCount.
+ *
+ * @return the size of this collection
+ */
+ public int getPropertyCount() {
+ return this._propertyList.size();
+ }
+
+ /**
+ * Method getVref.
+ *
+ * @param index
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ * @return the value of the uk.ac.vamsas.objects.core.Vref at the given index
+ */
+ public uk.ac.vamsas.objects.core.Vref getVref(final int index)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._vrefList.size()) {
+ throw new IndexOutOfBoundsException("getVref: Index value '" + index
+ + "' not in range [0.." + (this._vrefList.size() - 1) + "]");
+ }
+
+ return (uk.ac.vamsas.objects.core.Vref) _vrefList.get(index);
+ }
+
+ /**
+ * Method getVref.Returns the contents of the collection in an Array.
+ *
+ * Note: Just in case the collection contents are changing in another thread,
+ * we pass a 0-length Array of the correct type into the API call. This way we
+ * know that the Array returned is of exactly the correct length.
+ *
+ * @return this collection as an Array
+ */
+ public uk.ac.vamsas.objects.core.Vref[] getVref() {
+ uk.ac.vamsas.objects.core.Vref[] array = new uk.ac.vamsas.objects.core.Vref[0];
+ return (uk.ac.vamsas.objects.core.Vref[]) this._vrefList.toArray(array);
+ }
+
+ /**
+ * Method getVrefAsReference.Returns a reference to '_vrefList'. No type
+ * checking is performed on any modifications to the Vector.
+ *
+ * @return a reference to the Vector backing this class
+ */
+ public java.util.Vector getVrefAsReference() {
+ return this._vrefList;
+ }
+
+ /**
+ * Method getVrefCount.
+ *
+ * @return the size of this collection
+ */
+ public int getVrefCount() {
+ return this._vrefList.size();
+ }
+
+ /**
+ * Overrides the java.lang.Object.hashCode method.
+ *
+ * The following steps came from Effective Java Programming Language
+ * Guide by Joshua Bloch, Chapter 3
+ *
+ * @return a hash code value for the object.
+ */
+ public int hashCode() {
+ int result = super.hashCode();
+
+ long tmp;
+ if (_id != null && !org.castor.util.CycleBreaker.startingToCycle(_id)) {
+ result = 37 * result + _id.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_id);
+ }
+ if (_modifiable != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_modifiable)) {
+ result = 37 * result + _modifiable.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_modifiable);
+ }
+ if (_name != null && !org.castor.util.CycleBreaker.startingToCycle(_name)) {
+ result = 37 * result + _name.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_name);
+ }
+ if (_description != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_description)) {
+ result = 37 * result + _description.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_description);
+ }
+ if (_vrefList != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_vrefList)) {
+ result = 37 * result + _vrefList.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_vrefList);
+ }
+ if (_propertyList != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_propertyList)) {
+ result = 37 * result + _propertyList.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_propertyList);
+ }
+
+ return result;
+ }
+
+ /**
+ * Method isValid.
+ *
+ * @return true if this object is valid according to the schema
+ */
+ public boolean isValid() {
+ try {
+ validate();
+ } catch (org.exolab.castor.xml.ValidationException vex) {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ *
+ *
+ * @param out
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void marshal(final java.io.Writer out)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, out);
+ }
+
+ /**
+ *
+ *
+ * @param handler
+ * @throws java.io.IOException
+ * if an IOException occurs during marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ */
+ public void marshal(final org.xml.sax.ContentHandler handler)
+ throws java.io.IOException, org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, handler);
+ }
+
+ /**
+ */
+ public void removeAllProperty() {
+ this._propertyList.clear();
+ }
+
+ /**
+ */
+ public void removeAllVref() {
+ this._vrefList.clear();
+ }
+
+ /**
+ * Method removeProperty.
+ *
+ * @param vProperty
+ * @return true if the object was removed from the collection.
+ */
+ public boolean removeProperty(
+ final uk.ac.vamsas.objects.core.Property vProperty) {
+ boolean removed = _propertyList.remove(vProperty);
+ return removed;
+ }
+
+ /**
+ * Method removePropertyAt.
+ *
+ * @param index
+ * @return the element removed from the collection
+ */
+ public uk.ac.vamsas.objects.core.Property removePropertyAt(final int index) {
+ java.lang.Object obj = this._propertyList.remove(index);
+ return (uk.ac.vamsas.objects.core.Property) obj;
+ }
+
+ /**
+ * Method removeVref.
+ *
+ * @param vVref
+ * @return true if the object was removed from the collection.
+ */
+ public boolean removeVref(final uk.ac.vamsas.objects.core.Vref vVref) {
+ boolean removed = _vrefList.remove(vVref);
+ return removed;
+ }
+
+ /**
+ * Method removeVrefAt.
+ *
+ * @param index
+ * @return the element removed from the collection
+ */
+ public uk.ac.vamsas.objects.core.Vref removeVrefAt(final int index) {
+ java.lang.Object obj = this._vrefList.remove(index);
+ return (uk.ac.vamsas.objects.core.Vref) obj;
+ }
+
+ /**
+ * Sets the value of field 'description'. The field 'description' has the
+ * following description: Descriptive text for this node
+ *
+ * @param description
+ * the value of field 'description'.
+ */
+ public void setDescription(final java.lang.String description) {
+ this._description = description;
+ }
+
+ /**
+ * Sets the value of field 'id'. The field 'id' has the following description:
+ * Primary Key for vamsas object referencing
+ *
+ * @param id
+ * the value of field 'id'.
+ */
+ public void setId(final java.lang.String id) {
+ this._id = id;
+ }
+
+ /**
+ * Sets the value of field 'modifiable'.
+ *
+ * @param modifiable
+ * the value of field 'modifiable'.
+ */
+ public void setModifiable(final java.lang.String modifiable) {
+ this._modifiable = modifiable;
+ }
+
+ /**
+ * Sets the value of field 'name'. The field 'name' has the following
+ * description: Short name for this node
+ *
+ * @param name
+ * the value of field 'name'.
+ */
+ public void setName(final java.lang.String name) {
+ this._name = name;
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vProperty
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void setProperty(final int index,
+ final uk.ac.vamsas.objects.core.Property vProperty)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._propertyList.size()) {
+ throw new IndexOutOfBoundsException("setProperty: Index value '" + index
+ + "' not in range [0.." + (this._propertyList.size() - 1) + "]");
+ }
+
+ this._propertyList.set(index, vProperty);
+ }
+
+ /**
+ *
+ *
+ * @param vPropertyArray
+ */
+ public void setProperty(
+ final uk.ac.vamsas.objects.core.Property[] vPropertyArray) {
+ // -- copy array
+ _propertyList.clear();
+
+ for (int i = 0; i < vPropertyArray.length; i++) {
+ this._propertyList.add(vPropertyArray[i]);
+ }
+ }
+
+ /**
+ * Sets the value of '_propertyList' by copying the given Vector. All elements
+ * will be checked for type safety.
+ *
+ * @param vPropertyList
+ * the Vector to copy.
+ */
+ public void setProperty(final java.util.Vector vPropertyList) {
+ // copy vector
+ this._propertyList.clear();
+
+ this._propertyList.addAll(vPropertyList);
+ }
+
+ /**
+ * Sets the value of '_propertyList' by setting it to the given Vector. No
+ * type checking is performed.
+ *
+ * @deprecated
+ *
+ * @param propertyVector
+ * the Vector to set.
+ */
+ public void setPropertyAsReference(final java.util.Vector propertyVector) {
+ this._propertyList = propertyVector;
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vVref
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void setVref(final int index,
+ final uk.ac.vamsas.objects.core.Vref vVref)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._vrefList.size()) {
+ throw new IndexOutOfBoundsException("setVref: Index value '" + index
+ + "' not in range [0.." + (this._vrefList.size() - 1) + "]");
+ }
+
+ this._vrefList.set(index, vVref);
+ }
+
+ /**
+ *
+ *
+ * @param vVrefArray
+ */
+ public void setVref(final uk.ac.vamsas.objects.core.Vref[] vVrefArray) {
+ // -- copy array
+ _vrefList.clear();
+
+ for (int i = 0; i < vVrefArray.length; i++) {
+ this._vrefList.add(vVrefArray[i]);
+ }
+ }
+
+ /**
+ * Sets the value of '_vrefList' by copying the given Vector. All elements
+ * will be checked for type safety.
+ *
+ * @param vVrefList
+ * the Vector to copy.
+ */
+ public void setVref(final java.util.Vector vVrefList) {
+ // copy vector
+ this._vrefList.clear();
+
+ this._vrefList.addAll(vVrefList);
+ }
+
+ /**
+ * Sets the value of '_vrefList' by setting it to the given Vector. No type
+ * checking is performed.
+ *
+ * @deprecated
+ *
+ * @param vrefVector
+ * the Vector to set.
+ */
+ public void setVrefAsReference(final java.util.Vector vrefVector) {
+ this._vrefList = vrefVector;
+ }
+
+ /**
+ * Method unmarshal.
+ *
+ * @param reader
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @return the unmarshaled uk.ac.vamsas.objects.core.NodeType
+ */
+ public static uk.ac.vamsas.objects.core.NodeType unmarshal(
+ final java.io.Reader reader)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ return (uk.ac.vamsas.objects.core.NodeType) Unmarshaller.unmarshal(
+ uk.ac.vamsas.objects.core.NodeType.class, reader);
+ }
+
+ /**
+ *
+ *
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void validate() throws org.exolab.castor.xml.ValidationException {
+ org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+ validator.validate(this);
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/Param.java b/src/uk/ac/vamsas/objects/core/Param.java
index e9cece2..d55f705 100644
--- a/src/uk/ac/vamsas/objects/core/Param.java
+++ b/src/uk/ac/vamsas/objects/core/Param.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import org.exolab.castor.xml.Marshaller;
@@ -19,316 +33,323 @@ import org.exolab.castor.xml.Unmarshaller;
*
* @version $Revision$ $Date$
*/
-public class Param extends uk.ac.vamsas.client.Vobject
-implements java.io.Serializable
-{
+public class Param extends uk.ac.vamsas.client.Vobject implements
+ java.io.Serializable {
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
+ /**
+ * internal content storage
+ */
+ private java.lang.String _content = "";
- /**
- * internal content storage
- */
- private java.lang.String _content = "";
+ /**
+ * Field _name.
+ */
+ private java.lang.String _name;
- /**
- * Field _name.
- */
- private java.lang.String _name;
+ /**
+ * The type specifies how the property will be parsed. Empty property strings
+ * are allowed, and can be used to prototype the input to a document. TODO:
+ * specify allowed types
+ */
+ private java.lang.String _type;
- /**
- * The type specifies how the property will be parsed.
- * Empty property strings are allowed, and can be used to
- * prototype the
- * input to a document. TODO: specify allowed types
- */
- private java.lang.String _type;
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+ public Param() {
+ super();
+ setContent("");
+ }
- //----------------/
- //- Constructors -/
- //----------------/
+ // -----------/
+ // - Methods -/
+ // -----------/
- public Param() {
- super();
- setContent("");
- }
+ /**
+ * Overrides the java.lang.Object.equals method.
+ *
+ * @param obj
+ * @return true if the objects are equal.
+ */
+ public boolean equals(final java.lang.Object obj) {
+ if (this == obj)
+ return true;
+ if (super.equals(obj) == false)
+ return false;
- //-----------/
- //- Methods -/
- //-----------/
+ if (obj instanceof Param) {
- /**
- * Overrides the java.lang.Object.equals method.
- *
- * @param obj
- * @return true if the objects are equal.
- */
- public boolean equals(
- final java.lang.Object obj) {
- if ( this == obj )
- return true;
-
- if (super.equals(obj)==false)
+ Param temp = (Param) obj;
+ boolean thcycle;
+ boolean tmcycle;
+ if (this._content != null) {
+ if (temp._content == null)
+ return false;
+ if (this._content != temp._content) {
+ thcycle = org.castor.util.CycleBreaker.startingToCycle(this._content);
+ tmcycle = org.castor.util.CycleBreaker.startingToCycle(temp._content);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._content);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._content);
+ }
+ ;
+ return false;
+ }
+ if (!thcycle) {
+ if (!this._content.equals(temp._content)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._content);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._content);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._content);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._content);
+ }
+ }
+ } else if (temp._content != null)
+ return false;
+ if (this._name != null) {
+ if (temp._name == null)
+ return false;
+ if (this._name != temp._name) {
+ thcycle = org.castor.util.CycleBreaker.startingToCycle(this._name);
+ tmcycle = org.castor.util.CycleBreaker.startingToCycle(temp._name);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._name);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._name);
+ }
+ ;
+ return false;
+ }
+ if (!thcycle) {
+ if (!this._name.equals(temp._name)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._name);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._name);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._name);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._name);
+ }
+ }
+ } else if (temp._name != null)
+ return false;
+ if (this._type != null) {
+ if (temp._type == null)
+ return false;
+ if (this._type != temp._type) {
+ thcycle = org.castor.util.CycleBreaker.startingToCycle(this._type);
+ tmcycle = org.castor.util.CycleBreaker.startingToCycle(temp._type);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._type);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._type);
+ }
+ ;
return false;
-
- if (obj instanceof Param) {
-
- Param temp = (Param)obj;
- boolean thcycle;
- boolean tmcycle;
- if (this._content != null) {
- if (temp._content == null) return false;
- if (this._content != temp._content) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._content);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._content);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._content); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._content); };
- return false;
- }
- if (!thcycle) {
- if (!this._content.equals(temp._content)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._content);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._content);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._content);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._content);
- }
- }
- } else if (temp._content != null)
- return false;
- if (this._name != null) {
- if (temp._name == null) return false;
- if (this._name != temp._name) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._name);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._name);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._name); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._name); };
- return false;
- }
- if (!thcycle) {
- if (!this._name.equals(temp._name)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._name);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._name);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._name);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._name);
- }
- }
- } else if (temp._name != null)
- return false;
- if (this._type != null) {
- if (temp._type == null) return false;
- if (this._type != temp._type) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._type);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._type);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._type); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._type); };
- return false;
- }
- if (!thcycle) {
- if (!this._type.equals(temp._type)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._type);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._type);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._type);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._type);
- }
- }
- } else if (temp._type != null)
- return false;
- return true;
+ }
+ if (!thcycle) {
+ if (!this._type.equals(temp._type)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._type);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._type);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._type);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._type);
+ }
}
+ } else if (temp._type != null)
return false;
+ return true;
}
+ return false;
+ }
- /**
- * Returns the value of field 'content'. The field 'content'
- * has the following description: internal content storage
- *
- * @return the value of field 'Content'.
- */
- public java.lang.String getContent(
- ) {
- return this._content;
- }
+ /**
+ * Returns the value of field 'content'. The field 'content' has the following
+ * description: internal content storage
+ *
+ * @return the value of field 'Content'.
+ */
+ public java.lang.String getContent() {
+ return this._content;
+ }
- /**
- * Returns the value of field 'name'.
- *
- * @return the value of field 'Name'.
- */
- public java.lang.String getName(
- ) {
- return this._name;
- }
+ /**
+ * Returns the value of field 'name'.
+ *
+ * @return the value of field 'Name'.
+ */
+ public java.lang.String getName() {
+ return this._name;
+ }
- /**
- * Returns the value of field 'type'. The field 'type' has the
- * following description: The type specifies how the property
- * will be parsed.
- * Empty property strings are allowed, and can be used to
- * prototype the
- * input to a document. TODO: specify allowed types
- *
- * @return the value of field 'Type'.
- */
- public java.lang.String getType(
- ) {
- return this._type;
- }
+ /**
+ * Returns the value of field 'type'. The field 'type' has the following
+ * description: The type specifies how the property will be parsed. Empty
+ * property strings are allowed, and can be used to prototype the input to a
+ * document. TODO: specify allowed types
+ *
+ * @return the value of field 'Type'.
+ */
+ public java.lang.String getType() {
+ return this._type;
+ }
- /**
- * Overrides the java.lang.Object.hashCode method.
- *
- * The following steps came from Effective Java Programming
- * Language Guide by Joshua Bloch, Chapter 3
- *
- * @return a hash code value for the object.
- */
- public int hashCode(
- ) {
- int result = super.hashCode();
-
- long tmp;
- if (_content != null
- && !org.castor.util.CycleBreaker.startingToCycle(_content)) {
- result = 37 * result + _content.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_content);
- }
- if (_name != null
- && !org.castor.util.CycleBreaker.startingToCycle(_name)) {
- result = 37 * result + _name.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_name);
- }
- if (_type != null
- && !org.castor.util.CycleBreaker.startingToCycle(_type)) {
- result = 37 * result + _type.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_type);
- }
-
- return result;
- }
+ /**
+ * Overrides the java.lang.Object.hashCode method.
+ *
+ * The following steps came from Effective Java Programming Language
+ * Guide by Joshua Bloch, Chapter 3
+ *
+ * @return a hash code value for the object.
+ */
+ public int hashCode() {
+ int result = super.hashCode();
- /**
- * Method isValid.
- *
- * @return true if this object is valid according to the schema
- */
- public boolean isValid(
- ) {
- try {
- validate();
- } catch (org.exolab.castor.xml.ValidationException vex) {
- return false;
- }
- return true;
+ long tmp;
+ if (_content != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_content)) {
+ result = 37 * result + _content.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_content);
}
-
- /**
- *
- *
- * @param out
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void marshal(
- final java.io.Writer out)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, out);
+ if (_name != null && !org.castor.util.CycleBreaker.startingToCycle(_name)) {
+ result = 37 * result + _name.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_name);
}
-
- /**
- *
- *
- * @param handler
- * @throws java.io.IOException if an IOException occurs during
- * marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- */
- public void marshal(
- final org.xml.sax.ContentHandler handler)
- throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, handler);
+ if (_type != null && !org.castor.util.CycleBreaker.startingToCycle(_type)) {
+ result = 37 * result + _type.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_type);
}
- /**
- * Sets the value of field 'content'. The field 'content' has
- * the following description: internal content storage
- *
- * @param content the value of field 'content'.
- */
- public void setContent(
- final java.lang.String content) {
- this._content = content;
- }
+ return result;
+ }
- /**
- * Sets the value of field 'name'.
- *
- * @param name the value of field 'name'.
- */
- public void setName(
- final java.lang.String name) {
- this._name = name;
+ /**
+ * Method isValid.
+ *
+ * @return true if this object is valid according to the schema
+ */
+ public boolean isValid() {
+ try {
+ validate();
+ } catch (org.exolab.castor.xml.ValidationException vex) {
+ return false;
}
+ return true;
+ }
- /**
- * Sets the value of field 'type'. The field 'type' has the
- * following description: The type specifies how the property
- * will be parsed.
- * Empty property strings are allowed, and can be used to
- * prototype the
- * input to a document. TODO: specify allowed types
- *
- * @param type the value of field 'type'.
- */
- public void setType(
- final java.lang.String type) {
- this._type = type;
- }
+ /**
+ *
+ *
+ * @param out
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void marshal(final java.io.Writer out)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, out);
+ }
- /**
- * Method unmarshal.
- *
- * @param reader
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @return the unmarshaled uk.ac.vamsas.objects.core.Param
- */
- public static uk.ac.vamsas.objects.core.Param unmarshal(
- final java.io.Reader reader)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- return (uk.ac.vamsas.objects.core.Param) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Param.class, reader);
- }
+ /**
+ *
+ *
+ * @param handler
+ * @throws java.io.IOException
+ * if an IOException occurs during marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ */
+ public void marshal(final org.xml.sax.ContentHandler handler)
+ throws java.io.IOException, org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, handler);
+ }
- /**
- *
- *
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void validate(
- )
- throws org.exolab.castor.xml.ValidationException {
- org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
- validator.validate(this);
- }
+ /**
+ * Sets the value of field 'content'. The field 'content' has the following
+ * description: internal content storage
+ *
+ * @param content
+ * the value of field 'content'.
+ */
+ public void setContent(final java.lang.String content) {
+ this._content = content;
+ }
+
+ /**
+ * Sets the value of field 'name'.
+ *
+ * @param name
+ * the value of field 'name'.
+ */
+ public void setName(final java.lang.String name) {
+ this._name = name;
+ }
+
+ /**
+ * Sets the value of field 'type'. The field 'type' has the following
+ * description: The type specifies how the property will be parsed. Empty
+ * property strings are allowed, and can be used to prototype the input to a
+ * document. TODO: specify allowed types
+ *
+ * @param type
+ * the value of field 'type'.
+ */
+ public void setType(final java.lang.String type) {
+ this._type = type;
+ }
+
+ /**
+ * Method unmarshal.
+ *
+ * @param reader
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @return the unmarshaled uk.ac.vamsas.objects.core.Param
+ */
+ public static uk.ac.vamsas.objects.core.Param unmarshal(
+ final java.io.Reader reader)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ return (uk.ac.vamsas.objects.core.Param) Unmarshaller.unmarshal(
+ uk.ac.vamsas.objects.core.Param.class, reader);
+ }
+
+ /**
+ *
+ *
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void validate() throws org.exolab.castor.xml.ValidationException {
+ org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+ validator.validate(this);
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/Pos.java b/src/uk/ac/vamsas/objects/core/Pos.java
index 3877be5..4b7a48f 100644
--- a/src/uk/ac/vamsas/objects/core/Pos.java
+++ b/src/uk/ac/vamsas/objects/core/Pos.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import org.exolab.castor.xml.Marshaller;
@@ -16,201 +30,194 @@ import org.exolab.castor.xml.Unmarshaller;
/**
* a position within the associated object's coordinate system
- *
+ *
*
* @version $Revision$ $Date$
*/
-public class Pos extends uk.ac.vamsas.client.Vobject
-implements java.io.Serializable
-{
-
-
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
- * Field _i.
- */
- private int _i;
-
- /**
- * keeps track of state for field: _i
- */
- private boolean _has_i;
+public class Pos extends uk.ac.vamsas.client.Vobject implements
+ java.io.Serializable {
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
- //----------------/
- //- Constructors -/
- //----------------/
+ /**
+ * Field _i.
+ */
+ private int _i;
- public Pos() {
- super();
- }
+ /**
+ * keeps track of state for field: _i
+ */
+ private boolean _has_i;
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
- //-----------/
- //- Methods -/
- //-----------/
+ public Pos() {
+ super();
+ }
- /**
- */
- public void deleteI(
- ) {
- this._has_i= false;
- }
+ // -----------/
+ // - Methods -/
+ // -----------/
- /**
- * Overrides the java.lang.Object.equals method.
- *
- * @param obj
- * @return true if the objects are equal.
+ /**
*/
- public boolean equals(
- final java.lang.Object obj) {
- if ( this == obj )
- return true;
-
- if (super.equals(obj)==false)
- return false;
-
- if (obj instanceof Pos) {
-
- Pos temp = (Pos)obj;
- boolean thcycle;
- boolean tmcycle;
- if (this._i != temp._i)
- return false;
- if (this._has_i != temp._has_i)
- return false;
- return true;
- }
+ public void deleteI() {
+ this._has_i = false;
+ }
+
+ /**
+ * Overrides the java.lang.Object.equals method.
+ *
+ * @param obj
+ * @return true if the objects are equal.
+ */
+ public boolean equals(final java.lang.Object obj) {
+ if (this == obj)
+ return true;
+
+ if (super.equals(obj) == false)
+ return false;
+
+ if (obj instanceof Pos) {
+
+ Pos temp = (Pos) obj;
+ boolean thcycle;
+ boolean tmcycle;
+ if (this._i != temp._i)
return false;
+ if (this._has_i != temp._has_i)
+ return false;
+ return true;
}
-
- /**
- * Returns the value of field 'i'.
- *
- * @return the value of field 'I'.
- */
- public int getI(
- ) {
- return this._i;
- }
-
- /**
- * Method hasI.
- *
- * @return true if at least one I has been added
- */
- public boolean hasI(
- ) {
- return this._has_i;
- }
-
- /**
- * Overrides the java.lang.Object.hashCode method.
- *
- * The following steps came from Effective Java Programming
- * Language Guide by Joshua Bloch, Chapter 3
- *
- * @return a hash code value for the object.
- */
- public int hashCode(
- ) {
- int result = super.hashCode();
-
- long tmp;
- result = 37 * result + _i;
-
- return result;
- }
-
- /**
- * Method isValid.
- *
- * @return true if this object is valid according to the schema
- */
- public boolean isValid(
- ) {
- try {
- validate();
- } catch (org.exolab.castor.xml.ValidationException vex) {
- return false;
- }
- return true;
- }
-
- /**
- *
- *
- * @param out
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void marshal(
- final java.io.Writer out)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, out);
- }
-
- /**
- *
- *
- * @param handler
- * @throws java.io.IOException if an IOException occurs during
- * marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- */
- public void marshal(
- final org.xml.sax.ContentHandler handler)
- throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, handler);
- }
-
- /**
- * Sets the value of field 'i'.
- *
- * @param i the value of field 'i'.
- */
- public void setI(
- final int i) {
- this._i = i;
- this._has_i = true;
- }
-
- /**
- * Method unmarshal.
- *
- * @param reader
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @return the unmarshaled uk.ac.vamsas.objects.core.Pos
- */
- public static uk.ac.vamsas.objects.core.Pos unmarshal(
- final java.io.Reader reader)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- return (uk.ac.vamsas.objects.core.Pos) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Pos.class, reader);
- }
-
- /**
- *
- *
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void validate(
- )
- throws org.exolab.castor.xml.ValidationException {
- org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
- validator.validate(this);
+ return false;
+ }
+
+ /**
+ * Returns the value of field 'i'.
+ *
+ * @return the value of field 'I'.
+ */
+ public int getI() {
+ return this._i;
+ }
+
+ /**
+ * Method hasI.
+ *
+ * @return true if at least one I has been added
+ */
+ public boolean hasI() {
+ return this._has_i;
+ }
+
+ /**
+ * Overrides the java.lang.Object.hashCode method.
+ *
+ * The following steps came from Effective Java Programming Language
+ * Guide by Joshua Bloch, Chapter 3
+ *
+ * @return a hash code value for the object.
+ */
+ public int hashCode() {
+ int result = super.hashCode();
+
+ long tmp;
+ result = 37 * result + _i;
+
+ return result;
+ }
+
+ /**
+ * Method isValid.
+ *
+ * @return true if this object is valid according to the schema
+ */
+ public boolean isValid() {
+ try {
+ validate();
+ } catch (org.exolab.castor.xml.ValidationException vex) {
+ return false;
}
+ return true;
+ }
+
+ /**
+ *
+ *
+ * @param out
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void marshal(final java.io.Writer out)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, out);
+ }
+
+ /**
+ *
+ *
+ * @param handler
+ * @throws java.io.IOException
+ * if an IOException occurs during marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ */
+ public void marshal(final org.xml.sax.ContentHandler handler)
+ throws java.io.IOException, org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, handler);
+ }
+
+ /**
+ * Sets the value of field 'i'.
+ *
+ * @param i
+ * the value of field 'i'.
+ */
+ public void setI(final int i) {
+ this._i = i;
+ this._has_i = true;
+ }
+
+ /**
+ * Method unmarshal.
+ *
+ * @param reader
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @return the unmarshaled uk.ac.vamsas.objects.core.Pos
+ */
+ public static uk.ac.vamsas.objects.core.Pos unmarshal(
+ final java.io.Reader reader)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ return (uk.ac.vamsas.objects.core.Pos) Unmarshaller.unmarshal(
+ uk.ac.vamsas.objects.core.Pos.class, reader);
+ }
+
+ /**
+ *
+ *
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void validate() throws org.exolab.castor.xml.ValidationException {
+ org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+ validator.validate(this);
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/Property.java b/src/uk/ac/vamsas/objects/core/Property.java
index bccf4bd..1c63807 100644
--- a/src/uk/ac/vamsas/objects/core/Property.java
+++ b/src/uk/ac/vamsas/objects/core/Property.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import org.exolab.castor.xml.Marshaller;
@@ -19,316 +33,323 @@ import org.exolab.castor.xml.Unmarshaller;
*
* @version $Revision$ $Date$
*/
-public class Property extends uk.ac.vamsas.client.Vobject
-implements java.io.Serializable
-{
+public class Property extends uk.ac.vamsas.client.Vobject implements
+ java.io.Serializable {
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
+ /**
+ * internal content storage
+ */
+ private java.lang.String _content = "";
- /**
- * internal content storage
- */
- private java.lang.String _content = "";
+ /**
+ * Field _name.
+ */
+ private java.lang.String _name;
- /**
- * Field _name.
- */
- private java.lang.String _name;
+ /**
+ * The type specifies how the property will be parsed. Empty property strings
+ * are allowed, and can be used to prototype the input to a document. TODO:
+ * specify allowed types
+ */
+ private java.lang.String _type;
- /**
- * The type specifies how the property will be parsed.
- * Empty property strings are allowed, and can be used to
- * prototype the
- * input to a document. TODO: specify allowed types
- */
- private java.lang.String _type;
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+ public Property() {
+ super();
+ setContent("");
+ }
- //----------------/
- //- Constructors -/
- //----------------/
+ // -----------/
+ // - Methods -/
+ // -----------/
- public Property() {
- super();
- setContent("");
- }
+ /**
+ * Overrides the java.lang.Object.equals method.
+ *
+ * @param obj
+ * @return true if the objects are equal.
+ */
+ public boolean equals(final java.lang.Object obj) {
+ if (this == obj)
+ return true;
+ if (super.equals(obj) == false)
+ return false;
- //-----------/
- //- Methods -/
- //-----------/
+ if (obj instanceof Property) {
- /**
- * Overrides the java.lang.Object.equals method.
- *
- * @param obj
- * @return true if the objects are equal.
- */
- public boolean equals(
- final java.lang.Object obj) {
- if ( this == obj )
- return true;
-
- if (super.equals(obj)==false)
+ Property temp = (Property) obj;
+ boolean thcycle;
+ boolean tmcycle;
+ if (this._content != null) {
+ if (temp._content == null)
+ return false;
+ if (this._content != temp._content) {
+ thcycle = org.castor.util.CycleBreaker.startingToCycle(this._content);
+ tmcycle = org.castor.util.CycleBreaker.startingToCycle(temp._content);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._content);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._content);
+ }
+ ;
+ return false;
+ }
+ if (!thcycle) {
+ if (!this._content.equals(temp._content)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._content);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._content);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._content);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._content);
+ }
+ }
+ } else if (temp._content != null)
+ return false;
+ if (this._name != null) {
+ if (temp._name == null)
+ return false;
+ if (this._name != temp._name) {
+ thcycle = org.castor.util.CycleBreaker.startingToCycle(this._name);
+ tmcycle = org.castor.util.CycleBreaker.startingToCycle(temp._name);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._name);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._name);
+ }
+ ;
+ return false;
+ }
+ if (!thcycle) {
+ if (!this._name.equals(temp._name)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._name);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._name);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._name);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._name);
+ }
+ }
+ } else if (temp._name != null)
+ return false;
+ if (this._type != null) {
+ if (temp._type == null)
+ return false;
+ if (this._type != temp._type) {
+ thcycle = org.castor.util.CycleBreaker.startingToCycle(this._type);
+ tmcycle = org.castor.util.CycleBreaker.startingToCycle(temp._type);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._type);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._type);
+ }
+ ;
return false;
-
- if (obj instanceof Property) {
-
- Property temp = (Property)obj;
- boolean thcycle;
- boolean tmcycle;
- if (this._content != null) {
- if (temp._content == null) return false;
- if (this._content != temp._content) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._content);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._content);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._content); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._content); };
- return false;
- }
- if (!thcycle) {
- if (!this._content.equals(temp._content)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._content);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._content);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._content);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._content);
- }
- }
- } else if (temp._content != null)
- return false;
- if (this._name != null) {
- if (temp._name == null) return false;
- if (this._name != temp._name) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._name);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._name);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._name); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._name); };
- return false;
- }
- if (!thcycle) {
- if (!this._name.equals(temp._name)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._name);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._name);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._name);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._name);
- }
- }
- } else if (temp._name != null)
- return false;
- if (this._type != null) {
- if (temp._type == null) return false;
- if (this._type != temp._type) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._type);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._type);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._type); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._type); };
- return false;
- }
- if (!thcycle) {
- if (!this._type.equals(temp._type)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._type);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._type);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._type);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._type);
- }
- }
- } else if (temp._type != null)
- return false;
- return true;
+ }
+ if (!thcycle) {
+ if (!this._type.equals(temp._type)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._type);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._type);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._type);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._type);
+ }
}
+ } else if (temp._type != null)
return false;
+ return true;
}
+ return false;
+ }
- /**
- * Returns the value of field 'content'. The field 'content'
- * has the following description: internal content storage
- *
- * @return the value of field 'Content'.
- */
- public java.lang.String getContent(
- ) {
- return this._content;
- }
+ /**
+ * Returns the value of field 'content'. The field 'content' has the following
+ * description: internal content storage
+ *
+ * @return the value of field 'Content'.
+ */
+ public java.lang.String getContent() {
+ return this._content;
+ }
- /**
- * Returns the value of field 'name'.
- *
- * @return the value of field 'Name'.
- */
- public java.lang.String getName(
- ) {
- return this._name;
- }
+ /**
+ * Returns the value of field 'name'.
+ *
+ * @return the value of field 'Name'.
+ */
+ public java.lang.String getName() {
+ return this._name;
+ }
- /**
- * Returns the value of field 'type'. The field 'type' has the
- * following description: The type specifies how the property
- * will be parsed.
- * Empty property strings are allowed, and can be used to
- * prototype the
- * input to a document. TODO: specify allowed types
- *
- * @return the value of field 'Type'.
- */
- public java.lang.String getType(
- ) {
- return this._type;
- }
+ /**
+ * Returns the value of field 'type'. The field 'type' has the following
+ * description: The type specifies how the property will be parsed. Empty
+ * property strings are allowed, and can be used to prototype the input to a
+ * document. TODO: specify allowed types
+ *
+ * @return the value of field 'Type'.
+ */
+ public java.lang.String getType() {
+ return this._type;
+ }
- /**
- * Overrides the java.lang.Object.hashCode method.
- *
- * The following steps came from Effective Java Programming
- * Language Guide by Joshua Bloch, Chapter 3
- *
- * @return a hash code value for the object.
- */
- public int hashCode(
- ) {
- int result = super.hashCode();
-
- long tmp;
- if (_content != null
- && !org.castor.util.CycleBreaker.startingToCycle(_content)) {
- result = 37 * result + _content.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_content);
- }
- if (_name != null
- && !org.castor.util.CycleBreaker.startingToCycle(_name)) {
- result = 37 * result + _name.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_name);
- }
- if (_type != null
- && !org.castor.util.CycleBreaker.startingToCycle(_type)) {
- result = 37 * result + _type.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_type);
- }
-
- return result;
- }
+ /**
+ * Overrides the java.lang.Object.hashCode method.
+ *
+ * The following steps came from Effective Java Programming Language
+ * Guide by Joshua Bloch, Chapter 3
+ *
+ * @return a hash code value for the object.
+ */
+ public int hashCode() {
+ int result = super.hashCode();
- /**
- * Method isValid.
- *
- * @return true if this object is valid according to the schema
- */
- public boolean isValid(
- ) {
- try {
- validate();
- } catch (org.exolab.castor.xml.ValidationException vex) {
- return false;
- }
- return true;
+ long tmp;
+ if (_content != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_content)) {
+ result = 37 * result + _content.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_content);
}
-
- /**
- *
- *
- * @param out
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void marshal(
- final java.io.Writer out)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, out);
+ if (_name != null && !org.castor.util.CycleBreaker.startingToCycle(_name)) {
+ result = 37 * result + _name.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_name);
}
-
- /**
- *
- *
- * @param handler
- * @throws java.io.IOException if an IOException occurs during
- * marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- */
- public void marshal(
- final org.xml.sax.ContentHandler handler)
- throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, handler);
+ if (_type != null && !org.castor.util.CycleBreaker.startingToCycle(_type)) {
+ result = 37 * result + _type.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_type);
}
- /**
- * Sets the value of field 'content'. The field 'content' has
- * the following description: internal content storage
- *
- * @param content the value of field 'content'.
- */
- public void setContent(
- final java.lang.String content) {
- this._content = content;
- }
+ return result;
+ }
- /**
- * Sets the value of field 'name'.
- *
- * @param name the value of field 'name'.
- */
- public void setName(
- final java.lang.String name) {
- this._name = name;
+ /**
+ * Method isValid.
+ *
+ * @return true if this object is valid according to the schema
+ */
+ public boolean isValid() {
+ try {
+ validate();
+ } catch (org.exolab.castor.xml.ValidationException vex) {
+ return false;
}
+ return true;
+ }
- /**
- * Sets the value of field 'type'. The field 'type' has the
- * following description: The type specifies how the property
- * will be parsed.
- * Empty property strings are allowed, and can be used to
- * prototype the
- * input to a document. TODO: specify allowed types
- *
- * @param type the value of field 'type'.
- */
- public void setType(
- final java.lang.String type) {
- this._type = type;
- }
+ /**
+ *
+ *
+ * @param out
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void marshal(final java.io.Writer out)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, out);
+ }
- /**
- * Method unmarshal.
- *
- * @param reader
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @return the unmarshaled uk.ac.vamsas.objects.core.Property
- */
- public static uk.ac.vamsas.objects.core.Property unmarshal(
- final java.io.Reader reader)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- return (uk.ac.vamsas.objects.core.Property) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Property.class, reader);
- }
+ /**
+ *
+ *
+ * @param handler
+ * @throws java.io.IOException
+ * if an IOException occurs during marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ */
+ public void marshal(final org.xml.sax.ContentHandler handler)
+ throws java.io.IOException, org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, handler);
+ }
- /**
- *
- *
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void validate(
- )
- throws org.exolab.castor.xml.ValidationException {
- org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
- validator.validate(this);
- }
+ /**
+ * Sets the value of field 'content'. The field 'content' has the following
+ * description: internal content storage
+ *
+ * @param content
+ * the value of field 'content'.
+ */
+ public void setContent(final java.lang.String content) {
+ this._content = content;
+ }
+
+ /**
+ * Sets the value of field 'name'.
+ *
+ * @param name
+ * the value of field 'name'.
+ */
+ public void setName(final java.lang.String name) {
+ this._name = name;
+ }
+
+ /**
+ * Sets the value of field 'type'. The field 'type' has the following
+ * description: The type specifies how the property will be parsed. Empty
+ * property strings are allowed, and can be used to prototype the input to a
+ * document. TODO: specify allowed types
+ *
+ * @param type
+ * the value of field 'type'.
+ */
+ public void setType(final java.lang.String type) {
+ this._type = type;
+ }
+
+ /**
+ * Method unmarshal.
+ *
+ * @param reader
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @return the unmarshaled uk.ac.vamsas.objects.core.Property
+ */
+ public static uk.ac.vamsas.objects.core.Property unmarshal(
+ final java.io.Reader reader)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ return (uk.ac.vamsas.objects.core.Property) Unmarshaller.unmarshal(
+ uk.ac.vamsas.objects.core.Property.class, reader);
+ }
+
+ /**
+ *
+ *
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void validate() throws org.exolab.castor.xml.ValidationException {
+ org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+ validator.validate(this);
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/Provenance.java b/src/uk/ac/vamsas/objects/core/Provenance.java
index 12dc17b..54b5ae1 100644
--- a/src/uk/ac/vamsas/objects/core/Provenance.java
+++ b/src/uk/ac/vamsas/objects/core/Provenance.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import org.exolab.castor.xml.Marshaller;
@@ -17,367 +31,361 @@ import org.exolab.castor.xml.Unmarshaller;
/**
* Class Provenance.
*
- * @version $Revision$ $Date$
+ * @version $Revision$ $Date: 2007-06-28 14:51:44 +0100 (Thu, 28 Jun 2007)
+ * $
*/
-public class Provenance extends uk.ac.vamsas.client.Vobject
-implements java.io.Serializable
-{
-
-
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
- * Field _entryList.
- */
- private java.util.Vector _entryList;
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public Provenance() {
- super();
- this._entryList = new java.util.Vector();
- }
-
-
- //-----------/
- //- Methods -/
- //-----------/
-
- /**
- *
- *
- * @param vEntry
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addEntry(
- final uk.ac.vamsas.objects.core.Entry vEntry)
- throws java.lang.IndexOutOfBoundsException {
- this._entryList.addElement(vEntry);
- }
-
- /**
- *
- *
- * @param index
- * @param vEntry
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addEntry(
- final int index,
- final uk.ac.vamsas.objects.core.Entry vEntry)
- throws java.lang.IndexOutOfBoundsException {
- this._entryList.add(index, vEntry);
- }
-
- /**
- * Method enumerateEntry.
- *
- * @return an Enumeration over all
- * uk.ac.vamsas.objects.core.Entry elements
- */
- public java.util.Enumeration enumerateEntry(
- ) {
- return this._entryList.elements();
- }
-
- /**
- * Overrides the java.lang.Object.equals method.
- *
- * @param obj
- * @return true if the objects are equal.
- */
- public boolean equals(
- final java.lang.Object obj) {
- if ( this == obj )
- return true;
-
- if (super.equals(obj)==false)
+public class Provenance extends uk.ac.vamsas.client.Vobject implements
+ java.io.Serializable {
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * Field _entryList.
+ */
+ private java.util.Vector _entryList;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public Provenance() {
+ super();
+ this._entryList = new java.util.Vector();
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ *
+ *
+ * @param vEntry
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addEntry(final uk.ac.vamsas.objects.core.Entry vEntry)
+ throws java.lang.IndexOutOfBoundsException {
+ this._entryList.addElement(vEntry);
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vEntry
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addEntry(final int index,
+ final uk.ac.vamsas.objects.core.Entry vEntry)
+ throws java.lang.IndexOutOfBoundsException {
+ this._entryList.add(index, vEntry);
+ }
+
+ /**
+ * Method enumerateEntry.
+ *
+ * @return an Enumeration over all uk.ac.vamsas.objects.core.Entry elements
+ */
+ public java.util.Enumeration enumerateEntry() {
+ return this._entryList.elements();
+ }
+
+ /**
+ * Overrides the java.lang.Object.equals method.
+ *
+ * @param obj
+ * @return true if the objects are equal.
+ */
+ public boolean equals(final java.lang.Object obj) {
+ if (this == obj)
+ return true;
+
+ if (super.equals(obj) == false)
+ return false;
+
+ if (obj instanceof Provenance) {
+
+ Provenance temp = (Provenance) obj;
+ boolean thcycle;
+ boolean tmcycle;
+ if (this._entryList != null) {
+ if (temp._entryList == null)
+ return false;
+ if (this._entryList != temp._entryList) {
+ thcycle = org.castor.util.CycleBreaker
+ .startingToCycle(this._entryList);
+ tmcycle = org.castor.util.CycleBreaker
+ .startingToCycle(temp._entryList);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._entryList);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._entryList);
+ }
+ ;
return false;
-
- if (obj instanceof Provenance) {
-
- Provenance temp = (Provenance)obj;
- boolean thcycle;
- boolean tmcycle;
- if (this._entryList != null) {
- if (temp._entryList == null) return false;
- if (this._entryList != temp._entryList) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._entryList);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._entryList);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._entryList); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._entryList); };
- return false;
- }
- if (!thcycle) {
- if (!this._entryList.equals(temp._entryList)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._entryList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._entryList);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._entryList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._entryList);
- }
- }
- } else if (temp._entryList != null)
- return false;
- return true;
+ }
+ if (!thcycle) {
+ if (!this._entryList.equals(temp._entryList)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._entryList);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._entryList);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._entryList);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._entryList);
+ }
}
+ } else if (temp._entryList != null)
return false;
+ return true;
}
-
- /**
- * Method getEntry.
- *
- * @param index
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- * @return the value of the uk.ac.vamsas.objects.core.Entry at
- * the given index
- */
- public uk.ac.vamsas.objects.core.Entry getEntry(
- final int index)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._entryList.size()) {
- throw new IndexOutOfBoundsException("getEntry: Index value '" + index + "' not in range [0.." + (this._entryList.size() - 1) + "]");
- }
-
- return (uk.ac.vamsas.objects.core.Entry) _entryList.get(index);
- }
-
- /**
- * Method getEntry.Returns the contents of the collection in an
- * Array.
Note: Just in case the collection contents are
- * changing in another thread, we pass a 0-length Array of the
- * correct type into the API call. This way we know
- * that the Array returned is of exactly the correct length.
- *
- * @return this collection as an Array
- */
- public uk.ac.vamsas.objects.core.Entry[] getEntry(
- ) {
- uk.ac.vamsas.objects.core.Entry[] array = new uk.ac.vamsas.objects.core.Entry[0];
- return (uk.ac.vamsas.objects.core.Entry[]) this._entryList.toArray(array);
- }
-
- /**
- * Method getEntryAsReference.Returns a reference to
- * '_entryList'. No type checking is performed on any
- * modifications to the Vector.
- *
- * @return a reference to the Vector backing this class
- */
- public java.util.Vector getEntryAsReference(
- ) {
- return this._entryList;
- }
-
- /**
- * Method getEntryCount.
- *
- * @return the size of this collection
- */
- public int getEntryCount(
- ) {
- return this._entryList.size();
- }
-
- /**
- * Overrides the java.lang.Object.hashCode method.
- *
- * The following steps came from Effective Java Programming
- * Language Guide by Joshua Bloch, Chapter 3
- *
- * @return a hash code value for the object.
- */
- public int hashCode(
- ) {
- int result = super.hashCode();
-
- long tmp;
- if (_entryList != null
- && !org.castor.util.CycleBreaker.startingToCycle(_entryList)) {
- result = 37 * result + _entryList.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_entryList);
- }
-
- return result;
- }
-
- /**
- * Method isValid.
- *
- * @return true if this object is valid according to the schema
- */
- public boolean isValid(
- ) {
- try {
- validate();
- } catch (org.exolab.castor.xml.ValidationException vex) {
- return false;
- }
- return true;
- }
-
- /**
- *
- *
- * @param out
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void marshal(
- final java.io.Writer out)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, out);
- }
-
- /**
- *
- *
- * @param handler
- * @throws java.io.IOException if an IOException occurs during
- * marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- */
- public void marshal(
- final org.xml.sax.ContentHandler handler)
- throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, handler);
- }
-
- /**
- */
- public void removeAllEntry(
- ) {
- this._entryList.clear();
- }
-
- /**
- * Method removeEntry.
- *
- * @param vEntry
- * @return true if the object was removed from the collection.
- */
- public boolean removeEntry(
- final uk.ac.vamsas.objects.core.Entry vEntry) {
- boolean removed = _entryList.remove(vEntry);
- return removed;
+ return false;
+ }
+
+ /**
+ * Method getEntry.
+ *
+ * @param index
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ * @return the value of the uk.ac.vamsas.objects.core.Entry at the given index
+ */
+ public uk.ac.vamsas.objects.core.Entry getEntry(final int index)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._entryList.size()) {
+ throw new IndexOutOfBoundsException("getEntry: Index value '" + index
+ + "' not in range [0.." + (this._entryList.size() - 1) + "]");
}
- /**
- * Method removeEntryAt.
- *
- * @param index
- * @return the element removed from the collection
- */
- public uk.ac.vamsas.objects.core.Entry removeEntryAt(
- final int index) {
- java.lang.Object obj = this._entryList.remove(index);
- return (uk.ac.vamsas.objects.core.Entry) obj;
- }
-
- /**
- *
- *
- * @param index
- * @param vEntry
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void setEntry(
- final int index,
- final uk.ac.vamsas.objects.core.Entry vEntry)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._entryList.size()) {
- throw new IndexOutOfBoundsException("setEntry: Index value '" + index + "' not in range [0.." + (this._entryList.size() - 1) + "]");
- }
-
- this._entryList.set(index, vEntry);
+ return (uk.ac.vamsas.objects.core.Entry) _entryList.get(index);
+ }
+
+ /**
+ * Method getEntry.Returns the contents of the collection in an Array.
+ *
+ * Note: Just in case the collection contents are changing in another thread,
+ * we pass a 0-length Array of the correct type into the API call. This way we
+ * know that the Array returned is of exactly the correct length.
+ *
+ * @return this collection as an Array
+ */
+ public uk.ac.vamsas.objects.core.Entry[] getEntry() {
+ uk.ac.vamsas.objects.core.Entry[] array = new uk.ac.vamsas.objects.core.Entry[0];
+ return (uk.ac.vamsas.objects.core.Entry[]) this._entryList.toArray(array);
+ }
+
+ /**
+ * Method getEntryAsReference.Returns a reference to '_entryList'. No type
+ * checking is performed on any modifications to the Vector.
+ *
+ * @return a reference to the Vector backing this class
+ */
+ public java.util.Vector getEntryAsReference() {
+ return this._entryList;
+ }
+
+ /**
+ * Method getEntryCount.
+ *
+ * @return the size of this collection
+ */
+ public int getEntryCount() {
+ return this._entryList.size();
+ }
+
+ /**
+ * Overrides the java.lang.Object.hashCode method.
+ *
+ * The following steps came from Effective Java Programming Language
+ * Guide by Joshua Bloch, Chapter 3
+ *
+ * @return a hash code value for the object.
+ */
+ public int hashCode() {
+ int result = super.hashCode();
+
+ long tmp;
+ if (_entryList != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_entryList)) {
+ result = 37 * result + _entryList.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_entryList);
}
- /**
- *
- *
- * @param vEntryArray
- */
- public void setEntry(
- final uk.ac.vamsas.objects.core.Entry[] vEntryArray) {
- //-- copy array
- _entryList.clear();
-
- for (int i = 0; i < vEntryArray.length; i++) {
- this._entryList.add(vEntryArray[i]);
- }
+ return result;
+ }
+
+ /**
+ * Method isValid.
+ *
+ * @return true if this object is valid according to the schema
+ */
+ public boolean isValid() {
+ try {
+ validate();
+ } catch (org.exolab.castor.xml.ValidationException vex) {
+ return false;
}
-
- /**
- * Sets the value of '_entryList' by copying the given Vector.
- * All elements will be checked for type safety.
- *
- * @param vEntryList the Vector to copy.
+ return true;
+ }
+
+ /**
+ *
+ *
+ * @param out
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void marshal(final java.io.Writer out)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, out);
+ }
+
+ /**
+ *
+ *
+ * @param handler
+ * @throws java.io.IOException
+ * if an IOException occurs during marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ */
+ public void marshal(final org.xml.sax.ContentHandler handler)
+ throws java.io.IOException, org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, handler);
+ }
+
+ /**
*/
- public void setEntry(
- final java.util.Vector vEntryList) {
- // copy vector
- this._entryList.clear();
-
- this._entryList.addAll(vEntryList);
+ public void removeAllEntry() {
+ this._entryList.clear();
+ }
+
+ /**
+ * Method removeEntry.
+ *
+ * @param vEntry
+ * @return true if the object was removed from the collection.
+ */
+ public boolean removeEntry(final uk.ac.vamsas.objects.core.Entry vEntry) {
+ boolean removed = _entryList.remove(vEntry);
+ return removed;
+ }
+
+ /**
+ * Method removeEntryAt.
+ *
+ * @param index
+ * @return the element removed from the collection
+ */
+ public uk.ac.vamsas.objects.core.Entry removeEntryAt(final int index) {
+ java.lang.Object obj = this._entryList.remove(index);
+ return (uk.ac.vamsas.objects.core.Entry) obj;
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vEntry
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void setEntry(final int index,
+ final uk.ac.vamsas.objects.core.Entry vEntry)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._entryList.size()) {
+ throw new IndexOutOfBoundsException("setEntry: Index value '" + index
+ + "' not in range [0.." + (this._entryList.size() - 1) + "]");
}
- /**
- * Sets the value of '_entryList' by setting it to the given
- * Vector. No type checking is performed.
- * @deprecated
- *
- * @param entryVector the Vector to set.
- */
- public void setEntryAsReference(
- final java.util.Vector entryVector) {
- this._entryList = entryVector;
- }
+ this._entryList.set(index, vEntry);
+ }
- /**
- * Method unmarshal.
- *
- * @param reader
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @return the unmarshaled uk.ac.vamsas.objects.core.Provenance
- */
- public static uk.ac.vamsas.objects.core.Provenance unmarshal(
- final java.io.Reader reader)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- return (uk.ac.vamsas.objects.core.Provenance) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Provenance.class, reader);
- }
+ /**
+ *
+ *
+ * @param vEntryArray
+ */
+ public void setEntry(final uk.ac.vamsas.objects.core.Entry[] vEntryArray) {
+ // -- copy array
+ _entryList.clear();
- /**
- *
- *
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void validate(
- )
- throws org.exolab.castor.xml.ValidationException {
- org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
- validator.validate(this);
+ for (int i = 0; i < vEntryArray.length; i++) {
+ this._entryList.add(vEntryArray[i]);
}
+ }
+
+ /**
+ * Sets the value of '_entryList' by copying the given Vector. All elements
+ * will be checked for type safety.
+ *
+ * @param vEntryList
+ * the Vector to copy.
+ */
+ public void setEntry(final java.util.Vector vEntryList) {
+ // copy vector
+ this._entryList.clear();
+
+ this._entryList.addAll(vEntryList);
+ }
+
+ /**
+ * Sets the value of '_entryList' by setting it to the given Vector. No type
+ * checking is performed.
+ *
+ * @deprecated
+ *
+ * @param entryVector
+ * the Vector to set.
+ */
+ public void setEntryAsReference(final java.util.Vector entryVector) {
+ this._entryList = entryVector;
+ }
+
+ /**
+ * Method unmarshal.
+ *
+ * @param reader
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @return the unmarshaled uk.ac.vamsas.objects.core.Provenance
+ */
+ public static uk.ac.vamsas.objects.core.Provenance unmarshal(
+ final java.io.Reader reader)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ return (uk.ac.vamsas.objects.core.Provenance) Unmarshaller.unmarshal(
+ uk.ac.vamsas.objects.core.Provenance.class, reader);
+ }
+
+ /**
+ *
+ *
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void validate() throws org.exolab.castor.xml.ValidationException {
+ org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+ validator.validate(this);
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/Range.java b/src/uk/ac/vamsas/objects/core/Range.java
index 11d84d3..7889a17 100644
--- a/src/uk/ac/vamsas/objects/core/Range.java
+++ b/src/uk/ac/vamsas/objects/core/Range.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import org.exolab.castor.xml.Marshaller;
@@ -19,354 +33,338 @@ import org.exolab.castor.xml.Unmarshaller;
*
* @version $Revision$ $Date$
*/
-public class Range extends uk.ac.vamsas.client.Vobject
-implements java.io.Serializable
-{
-
-
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
- * Field _seqAStart.
- */
- private int _seqAStart;
-
- /**
- * keeps track of state for field: _seqAStart
- */
- private boolean _has_seqAStart;
-
- /**
- * Field _seqAEnd.
- */
- private int _seqAEnd;
-
- /**
- * keeps track of state for field: _seqAEnd
- */
- private boolean _has_seqAEnd;
-
- /**
- * Field _seqBStart.
- */
- private int _seqBStart;
-
- /**
- * keeps track of state for field: _seqBStart
- */
- private boolean _has_seqBStart;
-
- /**
- * Field _seqBEnd.
- */
- private int _seqBEnd;
-
- /**
- * keeps track of state for field: _seqBEnd
- */
- private boolean _has_seqBEnd;
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public Range() {
- super();
- }
-
-
- //-----------/
- //- Methods -/
- //-----------/
-
- /**
+public class Range extends uk.ac.vamsas.client.Vobject implements
+ java.io.Serializable {
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * Field _seqAStart.
+ */
+ private int _seqAStart;
+
+ /**
+ * keeps track of state for field: _seqAStart
+ */
+ private boolean _has_seqAStart;
+
+ /**
+ * Field _seqAEnd.
+ */
+ private int _seqAEnd;
+
+ /**
+ * keeps track of state for field: _seqAEnd
+ */
+ private boolean _has_seqAEnd;
+
+ /**
+ * Field _seqBStart.
+ */
+ private int _seqBStart;
+
+ /**
+ * keeps track of state for field: _seqBStart
+ */
+ private boolean _has_seqBStart;
+
+ /**
+ * Field _seqBEnd.
+ */
+ private int _seqBEnd;
+
+ /**
+ * keeps track of state for field: _seqBEnd
+ */
+ private boolean _has_seqBEnd;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public Range() {
+ super();
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
*/
- public void deleteSeqAEnd(
- ) {
- this._has_seqAEnd= false;
- }
-
- /**
- */
- public void deleteSeqAStart(
- ) {
- this._has_seqAStart= false;
- }
+ public void deleteSeqAEnd() {
+ this._has_seqAEnd = false;
+ }
- /**
+ /**
*/
- public void deleteSeqBEnd(
- ) {
- this._has_seqBEnd= false;
- }
+ public void deleteSeqAStart() {
+ this._has_seqAStart = false;
+ }
- /**
+ /**
*/
- public void deleteSeqBStart(
- ) {
- this._has_seqBStart= false;
- }
+ public void deleteSeqBEnd() {
+ this._has_seqBEnd = false;
+ }
- /**
- * Overrides the java.lang.Object.equals method.
- *
- * @param obj
- * @return true if the objects are equal.
+ /**
*/
- public boolean equals(
- final java.lang.Object obj) {
- if ( this == obj )
- return true;
-
- if (super.equals(obj)==false)
- return false;
-
- if (obj instanceof Range) {
-
- Range temp = (Range)obj;
- if (this._seqAStart != temp._seqAStart)
- return false;
- if (this._has_seqAStart != temp._has_seqAStart)
- return false;
- if (this._seqAEnd != temp._seqAEnd)
- return false;
- if (this._has_seqAEnd != temp._has_seqAEnd)
- return false;
- if (this._seqBStart != temp._seqBStart)
- return false;
- if (this._has_seqBStart != temp._has_seqBStart)
- return false;
- if (this._seqBEnd != temp._seqBEnd)
- return false;
- if (this._has_seqBEnd != temp._has_seqBEnd)
- return false;
- return true;
- }
+ public void deleteSeqBStart() {
+ this._has_seqBStart = false;
+ }
+
+ /**
+ * Overrides the java.lang.Object.equals method.
+ *
+ * @param obj
+ * @return true if the objects are equal.
+ */
+ public boolean equals(final java.lang.Object obj) {
+ if (this == obj)
+ return true;
+
+ if (super.equals(obj) == false)
+ return false;
+
+ if (obj instanceof Range) {
+
+ Range temp = (Range) obj;
+ if (this._seqAStart != temp._seqAStart)
return false;
+ if (this._has_seqAStart != temp._has_seqAStart)
+ return false;
+ if (this._seqAEnd != temp._seqAEnd)
+ return false;
+ if (this._has_seqAEnd != temp._has_seqAEnd)
+ return false;
+ if (this._seqBStart != temp._seqBStart)
+ return false;
+ if (this._has_seqBStart != temp._has_seqBStart)
+ return false;
+ if (this._seqBEnd != temp._seqBEnd)
+ return false;
+ if (this._has_seqBEnd != temp._has_seqBEnd)
+ return false;
+ return true;
}
-
- /**
- * Returns the value of field 'seqAEnd'.
- *
- * @return the value of field 'SeqAEnd'.
- */
- public int getSeqAEnd(
- ) {
- return this._seqAEnd;
- }
-
- /**
- * Returns the value of field 'seqAStart'.
- *
- * @return the value of field 'SeqAStart'.
- */
- public int getSeqAStart(
- ) {
- return this._seqAStart;
- }
-
- /**
- * Returns the value of field 'seqBEnd'.
- *
- * @return the value of field 'SeqBEnd'.
- */
- public int getSeqBEnd(
- ) {
- return this._seqBEnd;
- }
-
- /**
- * Returns the value of field 'seqBStart'.
- *
- * @return the value of field 'SeqBStart'.
- */
- public int getSeqBStart(
- ) {
- return this._seqBStart;
- }
-
- /**
- * Method hasSeqAEnd.
- *
- * @return true if at least one SeqAEnd has been added
- */
- public boolean hasSeqAEnd(
- ) {
- return this._has_seqAEnd;
- }
-
- /**
- * Method hasSeqAStart.
- *
- * @return true if at least one SeqAStart has been added
- */
- public boolean hasSeqAStart(
- ) {
- return this._has_seqAStart;
- }
-
- /**
- * Method hasSeqBEnd.
- *
- * @return true if at least one SeqBEnd has been added
- */
- public boolean hasSeqBEnd(
- ) {
- return this._has_seqBEnd;
- }
-
- /**
- * Method hasSeqBStart.
- *
- * @return true if at least one SeqBStart has been added
- */
- public boolean hasSeqBStart(
- ) {
- return this._has_seqBStart;
- }
-
- /**
- * Overrides the java.lang.Object.hashCode method.
- *
- * The following steps came from Effective Java Programming
- * Language Guide by Joshua Bloch, Chapter 3
- *
- * @return a hash code value for the object.
- */
- public int hashCode(
- ) {
- int result = super.hashCode();
-
- long tmp;
- result = 37 * result + _seqAStart;
- result = 37 * result + _seqAEnd;
- result = 37 * result + _seqBStart;
- result = 37 * result + _seqBEnd;
-
- return result;
- }
-
- /**
- * Method isValid.
- *
- * @return true if this object is valid according to the schema
- */
- public boolean isValid(
- ) {
- try {
- validate();
- } catch (org.exolab.castor.xml.ValidationException vex) {
- return false;
- }
- return true;
- }
-
- /**
- *
- *
- * @param out
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void marshal(
- final java.io.Writer out)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, out);
- }
-
- /**
- *
- *
- * @param handler
- * @throws java.io.IOException if an IOException occurs during
- * marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- */
- public void marshal(
- final org.xml.sax.ContentHandler handler)
- throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, handler);
- }
-
- /**
- * Sets the value of field 'seqAEnd'.
- *
- * @param seqAEnd the value of field 'seqAEnd'.
- */
- public void setSeqAEnd(
- final int seqAEnd) {
- this._seqAEnd = seqAEnd;
- this._has_seqAEnd = true;
- }
-
- /**
- * Sets the value of field 'seqAStart'.
- *
- * @param seqAStart the value of field 'seqAStart'.
- */
- public void setSeqAStart(
- final int seqAStart) {
- this._seqAStart = seqAStart;
- this._has_seqAStart = true;
- }
-
- /**
- * Sets the value of field 'seqBEnd'.
- *
- * @param seqBEnd the value of field 'seqBEnd'.
- */
- public void setSeqBEnd(
- final int seqBEnd) {
- this._seqBEnd = seqBEnd;
- this._has_seqBEnd = true;
- }
-
- /**
- * Sets the value of field 'seqBStart'.
- *
- * @param seqBStart the value of field 'seqBStart'.
- */
- public void setSeqBStart(
- final int seqBStart) {
- this._seqBStart = seqBStart;
- this._has_seqBStart = true;
- }
-
- /**
- * Method unmarshal.
- *
- * @param reader
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @return the unmarshaled uk.ac.vamsas.objects.core.Range
- */
- public static uk.ac.vamsas.objects.core.Range unmarshal(
- final java.io.Reader reader)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- return (uk.ac.vamsas.objects.core.Range) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Range.class, reader);
- }
-
- /**
- *
- *
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void validate(
- )
- throws org.exolab.castor.xml.ValidationException {
- org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
- validator.validate(this);
+ return false;
+ }
+
+ /**
+ * Returns the value of field 'seqAEnd'.
+ *
+ * @return the value of field 'SeqAEnd'.
+ */
+ public int getSeqAEnd() {
+ return this._seqAEnd;
+ }
+
+ /**
+ * Returns the value of field 'seqAStart'.
+ *
+ * @return the value of field 'SeqAStart'.
+ */
+ public int getSeqAStart() {
+ return this._seqAStart;
+ }
+
+ /**
+ * Returns the value of field 'seqBEnd'.
+ *
+ * @return the value of field 'SeqBEnd'.
+ */
+ public int getSeqBEnd() {
+ return this._seqBEnd;
+ }
+
+ /**
+ * Returns the value of field 'seqBStart'.
+ *
+ * @return the value of field 'SeqBStart'.
+ */
+ public int getSeqBStart() {
+ return this._seqBStart;
+ }
+
+ /**
+ * Method hasSeqAEnd.
+ *
+ * @return true if at least one SeqAEnd has been added
+ */
+ public boolean hasSeqAEnd() {
+ return this._has_seqAEnd;
+ }
+
+ /**
+ * Method hasSeqAStart.
+ *
+ * @return true if at least one SeqAStart has been added
+ */
+ public boolean hasSeqAStart() {
+ return this._has_seqAStart;
+ }
+
+ /**
+ * Method hasSeqBEnd.
+ *
+ * @return true if at least one SeqBEnd has been added
+ */
+ public boolean hasSeqBEnd() {
+ return this._has_seqBEnd;
+ }
+
+ /**
+ * Method hasSeqBStart.
+ *
+ * @return true if at least one SeqBStart has been added
+ */
+ public boolean hasSeqBStart() {
+ return this._has_seqBStart;
+ }
+
+ /**
+ * Overrides the java.lang.Object.hashCode method.
+ *
+ * The following steps came from Effective Java Programming Language
+ * Guide by Joshua Bloch, Chapter 3
+ *
+ * @return a hash code value for the object.
+ */
+ public int hashCode() {
+ int result = super.hashCode();
+
+ long tmp;
+ result = 37 * result + _seqAStart;
+ result = 37 * result + _seqAEnd;
+ result = 37 * result + _seqBStart;
+ result = 37 * result + _seqBEnd;
+
+ return result;
+ }
+
+ /**
+ * Method isValid.
+ *
+ * @return true if this object is valid according to the schema
+ */
+ public boolean isValid() {
+ try {
+ validate();
+ } catch (org.exolab.castor.xml.ValidationException vex) {
+ return false;
}
+ return true;
+ }
+
+ /**
+ *
+ *
+ * @param out
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void marshal(final java.io.Writer out)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, out);
+ }
+
+ /**
+ *
+ *
+ * @param handler
+ * @throws java.io.IOException
+ * if an IOException occurs during marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ */
+ public void marshal(final org.xml.sax.ContentHandler handler)
+ throws java.io.IOException, org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, handler);
+ }
+
+ /**
+ * Sets the value of field 'seqAEnd'.
+ *
+ * @param seqAEnd
+ * the value of field 'seqAEnd'.
+ */
+ public void setSeqAEnd(final int seqAEnd) {
+ this._seqAEnd = seqAEnd;
+ this._has_seqAEnd = true;
+ }
+
+ /**
+ * Sets the value of field 'seqAStart'.
+ *
+ * @param seqAStart
+ * the value of field 'seqAStart'.
+ */
+ public void setSeqAStart(final int seqAStart) {
+ this._seqAStart = seqAStart;
+ this._has_seqAStart = true;
+ }
+
+ /**
+ * Sets the value of field 'seqBEnd'.
+ *
+ * @param seqBEnd
+ * the value of field 'seqBEnd'.
+ */
+ public void setSeqBEnd(final int seqBEnd) {
+ this._seqBEnd = seqBEnd;
+ this._has_seqBEnd = true;
+ }
+
+ /**
+ * Sets the value of field 'seqBStart'.
+ *
+ * @param seqBStart
+ * the value of field 'seqBStart'.
+ */
+ public void setSeqBStart(final int seqBStart) {
+ this._seqBStart = seqBStart;
+ this._has_seqBStart = true;
+ }
+
+ /**
+ * Method unmarshal.
+ *
+ * @param reader
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @return the unmarshaled uk.ac.vamsas.objects.core.Range
+ */
+ public static uk.ac.vamsas.objects.core.Range unmarshal(
+ final java.io.Reader reader)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ return (uk.ac.vamsas.objects.core.Range) Unmarshaller.unmarshal(
+ uk.ac.vamsas.objects.core.Range.class, reader);
+ }
+
+ /**
+ *
+ *
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void validate() throws org.exolab.castor.xml.ValidationException {
+ org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+ validator.validate(this);
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/RangeAnnotation.java b/src/uk/ac/vamsas/objects/core/RangeAnnotation.java
index 2a2adda..07c3d41 100644
--- a/src/uk/ac/vamsas/objects/core/RangeAnnotation.java
+++ b/src/uk/ac/vamsas/objects/core/RangeAnnotation.java
@@ -1,1493 +1,1528 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import org.exolab.castor.xml.Marshaller;
import org.exolab.castor.xml.Unmarshaller;
/**
- * Annotation for a rangeSpec - values can be attached for the
- * whole
- * specification, and to each position within the spec. following
- * the orientation
- * specified by the ordered set of rangeSpec (pos, seg) elements.
+ * Annotation for a rangeSpec - values can be attached for the whole
+ * specification, and to each position within the spec. following the
+ * orientation specified by the ordered set of rangeSpec (pos, seg) elements.
*
* @version $Revision$ $Date$
*/
-public class RangeAnnotation extends uk.ac.vamsas.objects.core.RangeType
-implements java.io.Serializable
-{
-
-
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
- * Primary Key for vamsas object referencing
- *
- */
- private java.lang.String _id;
-
- /**
- * Field _modifiable.
- */
- private java.lang.String _modifiable;
-
- /**
- * Annotation with the same non-empty group name are grouped
- * together
- */
- private java.lang.String _group = "";
-
- /**
- * A Das Feature has both a type and a Type ID. We go the
- * route of requiring the type string to be taken from a
- * controlled
- * vocabulary if an application expects others to make sense
- * of it. The
- * type may qualified - so uniprot:CHAIN is a valid type name,
- * and
- * considered distinct from someotherDB:CHAIN
- */
- private java.lang.String _type;
-
- /**
- * Short, meaningful name for the annotation - if this
- * is absent, then the type string should be used in its
- * place.
- *
- */
- private java.lang.String _label;
-
- /**
- * Human readable description of the annotation
- *
- */
- private java.lang.String _description;
-
- /**
- * TODO: specify this - we have considered taking the GO
- * evidence codes as a model for assessing a measure of
- * quality to an
- * annotation.
- */
- private java.lang.String _status;
-
- /**
- * Annotation Element position maps to ordered positions
- * defined by the sequence of rangeType pos positions or
- * concatenated
- * seg start/end segments.
- */
- private java.util.Vector _annotationElementList;
-
- /**
- * Ordered set of optionally named float values for the
- * whole annotation
- */
- private java.util.Vector _scoreList;
-
- /**
- * Field _linkList.
- */
- private java.util.Vector _linkList;
-
- /**
- * Note:These are mutable so an application should check
- * them each time.
- */
- private java.util.Vector _propertyList;
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public RangeAnnotation() {
- super();
- setGroup("");
- this._annotationElementList = new java.util.Vector();
- this._scoreList = new java.util.Vector();
- this._linkList = new java.util.Vector();
- this._propertyList = new java.util.Vector();
- }
-
-
- //-----------/
- //- Methods -/
- //-----------/
-
- /**
- *
- *
- * @param vAnnotationElement
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addAnnotationElement(
- final uk.ac.vamsas.objects.core.AnnotationElement vAnnotationElement)
- throws java.lang.IndexOutOfBoundsException {
- this._annotationElementList.addElement(vAnnotationElement);
- }
-
- /**
- *
- *
- * @param index
- * @param vAnnotationElement
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addAnnotationElement(
- final int index,
- final uk.ac.vamsas.objects.core.AnnotationElement vAnnotationElement)
- throws java.lang.IndexOutOfBoundsException {
- this._annotationElementList.add(index, vAnnotationElement);
- }
-
- /**
- *
- *
- * @param vLink
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addLink(
- final uk.ac.vamsas.objects.core.Link vLink)
- throws java.lang.IndexOutOfBoundsException {
- this._linkList.addElement(vLink);
- }
-
- /**
- *
- *
- * @param index
- * @param vLink
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addLink(
- final int index,
- final uk.ac.vamsas.objects.core.Link vLink)
- throws java.lang.IndexOutOfBoundsException {
- this._linkList.add(index, vLink);
- }
-
- /**
- *
- *
- * @param vProperty
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addProperty(
- final uk.ac.vamsas.objects.core.Property vProperty)
- throws java.lang.IndexOutOfBoundsException {
- this._propertyList.addElement(vProperty);
- }
-
- /**
- *
- *
- * @param index
- * @param vProperty
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addProperty(
- final int index,
- final uk.ac.vamsas.objects.core.Property vProperty)
- throws java.lang.IndexOutOfBoundsException {
- this._propertyList.add(index, vProperty);
- }
-
- /**
- *
- *
- * @param vScore
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addScore(
- final uk.ac.vamsas.objects.core.Score vScore)
- throws java.lang.IndexOutOfBoundsException {
- this._scoreList.addElement(vScore);
- }
-
- /**
- *
- *
- * @param index
- * @param vScore
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addScore(
- final int index,
- final uk.ac.vamsas.objects.core.Score vScore)
- throws java.lang.IndexOutOfBoundsException {
- this._scoreList.add(index, vScore);
- }
-
- /**
- * Method enumerateAnnotationElement.
- *
- * @return an Enumeration over all
- * uk.ac.vamsas.objects.core.AnnotationElement elements
- */
- public java.util.Enumeration enumerateAnnotationElement(
- ) {
- return this._annotationElementList.elements();
- }
-
- /**
- * Method enumerateLink.
- *
- * @return an Enumeration over all
- * uk.ac.vamsas.objects.core.Link elements
- */
- public java.util.Enumeration enumerateLink(
- ) {
- return this._linkList.elements();
- }
-
- /**
- * Method enumerateProperty.
- *
- * @return an Enumeration over all
- * uk.ac.vamsas.objects.core.Property elements
- */
- public java.util.Enumeration enumerateProperty(
- ) {
- return this._propertyList.elements();
- }
-
- /**
- * Method enumerateScore.
- *
- * @return an Enumeration over all
- * uk.ac.vamsas.objects.core.Score elements
- */
- public java.util.Enumeration enumerateScore(
- ) {
- return this._scoreList.elements();
- }
-
- /**
- * Overrides the java.lang.Object.equals method.
- *
- * @param obj
- * @return true if the objects are equal.
- */
- public boolean equals(
- final java.lang.Object obj) {
- if ( this == obj )
- return true;
-
- if (super.equals(obj)==false)
+public class RangeAnnotation extends uk.ac.vamsas.objects.core.RangeType
+ implements java.io.Serializable {
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * Primary Key for vamsas object referencing
+ *
+ */
+ private java.lang.String _id;
+
+ /**
+ * Field _modifiable.
+ */
+ private java.lang.String _modifiable;
+
+ /**
+ * Annotation with the same non-empty group name are grouped together
+ */
+ private java.lang.String _group = "";
+
+ /**
+ * A Das Feature has both a type and a Type ID. We go the route of requiring
+ * the type string to be taken from a controlled vocabulary if an application
+ * expects others to make sense of it. The type may qualified - so
+ * uniprot:CHAIN is a valid type name, and considered distinct from
+ * someotherDB:CHAIN
+ */
+ private java.lang.String _type;
+
+ /**
+ * Short, meaningful name for the annotation - if this is absent, then the
+ * type string should be used in its place.
+ *
+ */
+ private java.lang.String _label;
+
+ /**
+ * Human readable description of the annotation
+ *
+ */
+ private java.lang.String _description;
+
+ /**
+ * TODO: specify this - we have considered taking the GO evidence codes as a
+ * model for assessing a measure of quality to an annotation.
+ */
+ private java.lang.String _status;
+
+ /**
+ * Annotation Element position maps to ordered positions defined by the
+ * sequence of rangeType pos positions or concatenated seg start/end segments.
+ */
+ private java.util.Vector _annotationElementList;
+
+ /**
+ * Ordered set of optionally named float values for the whole annotation
+ */
+ private java.util.Vector _scoreList;
+
+ /**
+ * Field _linkList.
+ */
+ private java.util.Vector _linkList;
+
+ /**
+ * Note:These are mutable so an application should check them each time.
+ */
+ private java.util.Vector _propertyList;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public RangeAnnotation() {
+ super();
+ setGroup("");
+ this._annotationElementList = new java.util.Vector();
+ this._scoreList = new java.util.Vector();
+ this._linkList = new java.util.Vector();
+ this._propertyList = new java.util.Vector();
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ *
+ *
+ * @param vAnnotationElement
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addAnnotationElement(
+ final uk.ac.vamsas.objects.core.AnnotationElement vAnnotationElement)
+ throws java.lang.IndexOutOfBoundsException {
+ this._annotationElementList.addElement(vAnnotationElement);
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vAnnotationElement
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addAnnotationElement(final int index,
+ final uk.ac.vamsas.objects.core.AnnotationElement vAnnotationElement)
+ throws java.lang.IndexOutOfBoundsException {
+ this._annotationElementList.add(index, vAnnotationElement);
+ }
+
+ /**
+ *
+ *
+ * @param vLink
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addLink(final uk.ac.vamsas.objects.core.Link vLink)
+ throws java.lang.IndexOutOfBoundsException {
+ this._linkList.addElement(vLink);
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vLink
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addLink(final int index,
+ final uk.ac.vamsas.objects.core.Link vLink)
+ throws java.lang.IndexOutOfBoundsException {
+ this._linkList.add(index, vLink);
+ }
+
+ /**
+ *
+ *
+ * @param vProperty
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addProperty(final uk.ac.vamsas.objects.core.Property vProperty)
+ throws java.lang.IndexOutOfBoundsException {
+ this._propertyList.addElement(vProperty);
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vProperty
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addProperty(final int index,
+ final uk.ac.vamsas.objects.core.Property vProperty)
+ throws java.lang.IndexOutOfBoundsException {
+ this._propertyList.add(index, vProperty);
+ }
+
+ /**
+ *
+ *
+ * @param vScore
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addScore(final uk.ac.vamsas.objects.core.Score vScore)
+ throws java.lang.IndexOutOfBoundsException {
+ this._scoreList.addElement(vScore);
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vScore
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addScore(final int index,
+ final uk.ac.vamsas.objects.core.Score vScore)
+ throws java.lang.IndexOutOfBoundsException {
+ this._scoreList.add(index, vScore);
+ }
+
+ /**
+ * Method enumerateAnnotationElement.
+ *
+ * @return an Enumeration over all uk.ac.vamsas.objects.core.AnnotationElement
+ * elements
+ */
+ public java.util.Enumeration enumerateAnnotationElement() {
+ return this._annotationElementList.elements();
+ }
+
+ /**
+ * Method enumerateLink.
+ *
+ * @return an Enumeration over all uk.ac.vamsas.objects.core.Link elements
+ */
+ public java.util.Enumeration enumerateLink() {
+ return this._linkList.elements();
+ }
+
+ /**
+ * Method enumerateProperty.
+ *
+ * @return an Enumeration over all uk.ac.vamsas.objects.core.Property elements
+ */
+ public java.util.Enumeration enumerateProperty() {
+ return this._propertyList.elements();
+ }
+
+ /**
+ * Method enumerateScore.
+ *
+ * @return an Enumeration over all uk.ac.vamsas.objects.core.Score elements
+ */
+ public java.util.Enumeration enumerateScore() {
+ return this._scoreList.elements();
+ }
+
+ /**
+ * Overrides the java.lang.Object.equals method.
+ *
+ * @param obj
+ * @return true if the objects are equal.
+ */
+ public boolean equals(final java.lang.Object obj) {
+ if (this == obj)
+ return true;
+
+ if (super.equals(obj) == false)
+ return false;
+
+ if (obj instanceof RangeAnnotation) {
+
+ RangeAnnotation temp = (RangeAnnotation) obj;
+ boolean thcycle;
+ boolean tmcycle;
+ if (this._id != null) {
+ if (temp._id == null)
+ return false;
+ if (this._id != temp._id) {
+ thcycle = org.castor.util.CycleBreaker.startingToCycle(this._id);
+ tmcycle = org.castor.util.CycleBreaker.startingToCycle(temp._id);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
+ }
+ ;
return false;
-
- if (obj instanceof RangeAnnotation) {
-
- RangeAnnotation temp = (RangeAnnotation)obj;
- boolean thcycle;
- boolean tmcycle;
- if (this._id != null) {
- if (temp._id == null) return false;
- if (this._id != temp._id) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._id);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._id);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._id); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._id); };
- return false;
- }
- if (!thcycle) {
- if (!this._id.equals(temp._id)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
- }
- }
- } else if (temp._id != null)
- return false;
- if (this._modifiable != null) {
- if (temp._modifiable == null) return false;
- if (this._modifiable != temp._modifiable) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._modifiable);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._modifiable);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._modifiable); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._modifiable); };
- return false;
- }
- if (!thcycle) {
- if (!this._modifiable.equals(temp._modifiable)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._modifiable);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._modifiable);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._modifiable);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._modifiable);
- }
- }
- } else if (temp._modifiable != null)
- return false;
- if (this._group != null) {
- if (temp._group == null) return false;
- if (this._group != temp._group) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._group);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._group);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._group); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._group); };
- return false;
- }
- if (!thcycle) {
- if (!this._group.equals(temp._group)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._group);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._group);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._group);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._group);
- }
- }
- } else if (temp._group != null)
- return false;
- if (this._type != null) {
- if (temp._type == null) return false;
- if (this._type != temp._type) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._type);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._type);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._type); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._type); };
- return false;
- }
- if (!thcycle) {
- if (!this._type.equals(temp._type)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._type);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._type);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._type);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._type);
- }
- }
- } else if (temp._type != null)
- return false;
- if (this._label != null) {
- if (temp._label == null) return false;
- if (this._label != temp._label) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._label);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._label);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._label); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._label); };
- return false;
- }
- if (!thcycle) {
- if (!this._label.equals(temp._label)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._label);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._label);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._label);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._label);
- }
- }
- } else if (temp._label != null)
- return false;
- if (this._description != null) {
- if (temp._description == null) return false;
- if (this._description != temp._description) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._description);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._description);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._description); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._description); };
- return false;
- }
- if (!thcycle) {
- if (!this._description.equals(temp._description)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._description);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._description);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._description);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._description);
- }
- }
- } else if (temp._description != null)
- return false;
- if (this._status != null) {
- if (temp._status == null) return false;
- if (this._status != temp._status) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._status);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._status);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._status); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._status); };
- return false;
- }
- if (!thcycle) {
- if (!this._status.equals(temp._status)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._status);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._status);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._status);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._status);
- }
- }
- } else if (temp._status != null)
- return false;
- if (this._annotationElementList != null) {
- if (temp._annotationElementList == null) return false;
- if (this._annotationElementList != temp._annotationElementList) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._annotationElementList);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._annotationElementList);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._annotationElementList); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._annotationElementList); };
- return false;
- }
- if (!thcycle) {
- if (!this._annotationElementList.equals(temp._annotationElementList)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._annotationElementList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._annotationElementList);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._annotationElementList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._annotationElementList);
- }
- }
- } else if (temp._annotationElementList != null)
- return false;
- if (this._scoreList != null) {
- if (temp._scoreList == null) return false;
- if (this._scoreList != temp._scoreList) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._scoreList);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._scoreList);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._scoreList); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._scoreList); };
- return false;
- }
- if (!thcycle) {
- if (!this._scoreList.equals(temp._scoreList)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._scoreList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._scoreList);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._scoreList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._scoreList);
- }
- }
- } else if (temp._scoreList != null)
- return false;
- if (this._linkList != null) {
- if (temp._linkList == null) return false;
- if (this._linkList != temp._linkList) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._linkList);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._linkList);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._linkList); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._linkList); };
- return false;
- }
- if (!thcycle) {
- if (!this._linkList.equals(temp._linkList)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._linkList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._linkList);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._linkList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._linkList);
- }
- }
- } else if (temp._linkList != null)
- return false;
- if (this._propertyList != null) {
- if (temp._propertyList == null) return false;
- if (this._propertyList != temp._propertyList) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._propertyList);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._propertyList);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._propertyList); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._propertyList); };
- return false;
- }
- if (!thcycle) {
- if (!this._propertyList.equals(temp._propertyList)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._propertyList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._propertyList);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._propertyList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._propertyList);
- }
- }
- } else if (temp._propertyList != null)
- return false;
- return true;
+ }
+ if (!thcycle) {
+ if (!this._id.equals(temp._id)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
+ }
}
+ } else if (temp._id != null)
return false;
- }
-
- /**
- * Method getAnnotationElement.
- *
- * @param index
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- * @return the value of the
- * uk.ac.vamsas.objects.core.AnnotationElement at the given inde
- */
- public uk.ac.vamsas.objects.core.AnnotationElement getAnnotationElement(
- final int index)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._annotationElementList.size()) {
- throw new IndexOutOfBoundsException("getAnnotationElement: Index value '" + index + "' not in range [0.." + (this._annotationElementList.size() - 1) + "]");
- }
-
- return (uk.ac.vamsas.objects.core.AnnotationElement) _annotationElementList.get(index);
- }
-
- /**
- * Method getAnnotationElement.Returns the contents of the
- * collection in an Array.
Note: Just in case the
- * collection contents are changing in another thread, we pass
- * a 0-length Array of the correct type into the API call.
- * This way we know that the Array returned is of
- * exactly the correct length.
- *
- * @return this collection as an Array
- */
- public uk.ac.vamsas.objects.core.AnnotationElement[] getAnnotationElement(
- ) {
- uk.ac.vamsas.objects.core.AnnotationElement[] array = new uk.ac.vamsas.objects.core.AnnotationElement[0];
- return (uk.ac.vamsas.objects.core.AnnotationElement[]) this._annotationElementList.toArray(array);
- }
-
- /**
- * Method getAnnotationElementAsReference.Returns a reference
- * to '_annotationElementList'. No type checking is performed
- * on any modifications to the Vector.
- *
- * @return a reference to the Vector backing this class
- */
- public java.util.Vector getAnnotationElementAsReference(
- ) {
- return this._annotationElementList;
- }
-
- /**
- * Method getAnnotationElementCount.
- *
- * @return the size of this collection
- */
- public int getAnnotationElementCount(
- ) {
- return this._annotationElementList.size();
- }
-
- /**
- * Returns the value of field 'description'. The field
- * 'description' has the following description: Human readable
- * description of the annotation
- *
- *
- * @return the value of field 'Description'.
- */
- public java.lang.String getDescription(
- ) {
- return this._description;
- }
-
- /**
- * Returns the value of field 'group'. The field 'group' has
- * the following description: Annotation with the same
- * non-empty group name are grouped
- * together
- *
- * @return the value of field 'Group'.
- */
- public java.lang.String getGroup(
- ) {
- return this._group;
- }
-
- /**
- * Returns the value of field 'id'. The field 'id' has the
- * following description: Primary Key for vamsas object
- * referencing
- *
- *
- * @return the value of field 'Id'.
- */
- public java.lang.String getId(
- ) {
- return this._id;
- }
-
- /**
- * Returns the value of field 'label'. The field 'label' has
- * the following description: Short, meaningful name for the
- * annotation - if this
- * is absent, then the type string should be used in its
- * place.
- *
- *
- * @return the value of field 'Label'.
- */
- public java.lang.String getLabel(
- ) {
- return this._label;
- }
-
- /**
- * Method getLink.
- *
- * @param index
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- * @return the value of the uk.ac.vamsas.objects.core.Link at
- * the given index
- */
- public uk.ac.vamsas.objects.core.Link getLink(
- final int index)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._linkList.size()) {
- throw new IndexOutOfBoundsException("getLink: Index value '" + index + "' not in range [0.." + (this._linkList.size() - 1) + "]");
- }
-
- return (uk.ac.vamsas.objects.core.Link) _linkList.get(index);
- }
-
- /**
- * Method getLink.Returns the contents of the collection in an
- * Array.
Note: Just in case the collection contents are
- * changing in another thread, we pass a 0-length Array of the
- * correct type into the API call. This way we know
- * that the Array returned is of exactly the correct length.
- *
- * @return this collection as an Array
- */
- public uk.ac.vamsas.objects.core.Link[] getLink(
- ) {
- uk.ac.vamsas.objects.core.Link[] array = new uk.ac.vamsas.objects.core.Link[0];
- return (uk.ac.vamsas.objects.core.Link[]) this._linkList.toArray(array);
- }
-
- /**
- * Method getLinkAsReference.Returns a reference to
- * '_linkList'. No type checking is performed on any
- * modifications to the Vector.
- *
- * @return a reference to the Vector backing this class
- */
- public java.util.Vector getLinkAsReference(
- ) {
- return this._linkList;
- }
-
- /**
- * Method getLinkCount.
- *
- * @return the size of this collection
- */
- public int getLinkCount(
- ) {
- return this._linkList.size();
- }
-
- /**
- * Returns the value of field 'modifiable'.
- *
- * @return the value of field 'Modifiable'.
- */
- public java.lang.String getModifiable(
- ) {
- return this._modifiable;
- }
-
- /**
- * Method getProperty.
- *
- * @param index
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- * @return the value of the uk.ac.vamsas.objects.core.Property
- * at the given index
- */
- public uk.ac.vamsas.objects.core.Property getProperty(
- final int index)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._propertyList.size()) {
- throw new IndexOutOfBoundsException("getProperty: Index value '" + index + "' not in range [0.." + (this._propertyList.size() - 1) + "]");
- }
-
- return (uk.ac.vamsas.objects.core.Property) _propertyList.get(index);
- }
-
- /**
- * Method getProperty.Returns the contents of the collection in
- * an Array.
Note: Just in case the collection contents
- * are changing in another thread, we pass a 0-length Array of
- * the correct type into the API call. This way we know
- * that the Array returned is of exactly the correct length.
- *
- * @return this collection as an Array
- */
- public uk.ac.vamsas.objects.core.Property[] getProperty(
- ) {
- uk.ac.vamsas.objects.core.Property[] array = new uk.ac.vamsas.objects.core.Property[0];
- return (uk.ac.vamsas.objects.core.Property[]) this._propertyList.toArray(array);
- }
-
- /**
- * Method getPropertyAsReference.Returns a reference to
- * '_propertyList'. No type checking is performed on any
- * modifications to the Vector.
- *
- * @return a reference to the Vector backing this class
- */
- public java.util.Vector getPropertyAsReference(
- ) {
- return this._propertyList;
- }
-
- /**
- * Method getPropertyCount.
- *
- * @return the size of this collection
- */
- public int getPropertyCount(
- ) {
- return this._propertyList.size();
- }
-
- /**
- * Method getScore.
- *
- * @param index
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- * @return the value of the uk.ac.vamsas.objects.core.Score at
- * the given index
- */
- public uk.ac.vamsas.objects.core.Score getScore(
- final int index)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._scoreList.size()) {
- throw new IndexOutOfBoundsException("getScore: Index value '" + index + "' not in range [0.." + (this._scoreList.size() - 1) + "]");
- }
-
- return (uk.ac.vamsas.objects.core.Score) _scoreList.get(index);
- }
-
- /**
- * Method getScore.Returns the contents of the collection in an
- * Array.
Note: Just in case the collection contents are
- * changing in another thread, we pass a 0-length Array of the
- * correct type into the API call. This way we know
- * that the Array returned is of exactly the correct length.
- *
- * @return this collection as an Array
- */
- public uk.ac.vamsas.objects.core.Score[] getScore(
- ) {
- uk.ac.vamsas.objects.core.Score[] array = new uk.ac.vamsas.objects.core.Score[0];
- return (uk.ac.vamsas.objects.core.Score[]) this._scoreList.toArray(array);
- }
-
- /**
- * Method getScoreAsReference.Returns a reference to
- * '_scoreList'. No type checking is performed on any
- * modifications to the Vector.
- *
- * @return a reference to the Vector backing this class
- */
- public java.util.Vector getScoreAsReference(
- ) {
- return this._scoreList;
- }
-
- /**
- * Method getScoreCount.
- *
- * @return the size of this collection
- */
- public int getScoreCount(
- ) {
- return this._scoreList.size();
- }
-
- /**
- * Returns the value of field 'status'. The field 'status' has
- * the following description: TODO: specify this - we have
- * considered taking the GO
- * evidence codes as a model for assessing a measure of
- * quality to an
- * annotation.
- *
- * @return the value of field 'Status'.
- */
- public java.lang.String getStatus(
- ) {
- return this._status;
- }
-
- /**
- * Returns the value of field 'type'. The field 'type' has the
- * following description: A Das Feature has both a type and a
- * Type ID. We go the
- * route of requiring the type string to be taken from a
- * controlled
- * vocabulary if an application expects others to make sense
- * of it. The
- * type may qualified - so uniprot:CHAIN is a valid type name,
- * and
- * considered distinct from someotherDB:CHAIN
- *
- * @return the value of field 'Type'.
- */
- public java.lang.String getType(
- ) {
- return this._type;
- }
-
- /**
- * Overrides the java.lang.Object.hashCode method.
- *
- * The following steps came from Effective Java Programming
- * Language Guide by Joshua Bloch, Chapter 3
- *
- * @return a hash code value for the object.
- */
- public int hashCode(
- ) {
- int result = super.hashCode();
-
- long tmp;
- if (_id != null
- && !org.castor.util.CycleBreaker.startingToCycle(_id)) {
- result = 37 * result + _id.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_id);
- }
- if (_modifiable != null
- && !org.castor.util.CycleBreaker.startingToCycle(_modifiable)) {
- result = 37 * result + _modifiable.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_modifiable);
- }
- if (_group != null
- && !org.castor.util.CycleBreaker.startingToCycle(_group)) {
- result = 37 * result + _group.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_group);
- }
- if (_type != null
- && !org.castor.util.CycleBreaker.startingToCycle(_type)) {
- result = 37 * result + _type.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_type);
- }
- if (_label != null
- && !org.castor.util.CycleBreaker.startingToCycle(_label)) {
- result = 37 * result + _label.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_label);
- }
- if (_description != null
- && !org.castor.util.CycleBreaker.startingToCycle(_description)) {
- result = 37 * result + _description.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_description);
- }
- if (_status != null
- && !org.castor.util.CycleBreaker.startingToCycle(_status)) {
- result = 37 * result + _status.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_status);
- }
- if (_annotationElementList != null
- && !org.castor.util.CycleBreaker.startingToCycle(_annotationElementList)) {
- result = 37 * result + _annotationElementList.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_annotationElementList);
- }
- if (_scoreList != null
- && !org.castor.util.CycleBreaker.startingToCycle(_scoreList)) {
- result = 37 * result + _scoreList.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_scoreList);
- }
- if (_linkList != null
- && !org.castor.util.CycleBreaker.startingToCycle(_linkList)) {
- result = 37 * result + _linkList.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_linkList);
- }
- if (_propertyList != null
- && !org.castor.util.CycleBreaker.startingToCycle(_propertyList)) {
- result = 37 * result + _propertyList.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_propertyList);
+ if (this._modifiable != null) {
+ if (temp._modifiable == null)
+ return false;
+ if (this._modifiable != temp._modifiable) {
+ thcycle = org.castor.util.CycleBreaker
+ .startingToCycle(this._modifiable);
+ tmcycle = org.castor.util.CycleBreaker
+ .startingToCycle(temp._modifiable);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._modifiable);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._modifiable);
+ }
+ ;
+ return false;
+ }
+ if (!thcycle) {
+ if (!this._modifiable.equals(temp._modifiable)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._modifiable);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._modifiable);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._modifiable);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._modifiable);
+ }
}
-
- return result;
- }
-
- /**
- * Method isValid.
- *
- * @return true if this object is valid according to the schema
- */
- public boolean isValid(
- ) {
- try {
- validate();
- } catch (org.exolab.castor.xml.ValidationException vex) {
+ } else if (temp._modifiable != null)
+ return false;
+ if (this._group != null) {
+ if (temp._group == null)
+ return false;
+ if (this._group != temp._group) {
+ thcycle = org.castor.util.CycleBreaker.startingToCycle(this._group);
+ tmcycle = org.castor.util.CycleBreaker.startingToCycle(temp._group);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._group);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._group);
+ }
+ ;
return false;
+ }
+ if (!thcycle) {
+ if (!this._group.equals(temp._group)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._group);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._group);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._group);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._group);
+ }
}
- return true;
- }
-
- /**
- *
- *
- * @param out
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void marshal(
- final java.io.Writer out)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, out);
- }
-
- /**
- *
- *
- * @param handler
- * @throws java.io.IOException if an IOException occurs during
- * marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- */
- public void marshal(
- final org.xml.sax.ContentHandler handler)
- throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, handler);
- }
-
- /**
- */
- public void removeAllAnnotationElement(
- ) {
- this._annotationElementList.clear();
- }
-
- /**
- */
- public void removeAllLink(
- ) {
- this._linkList.clear();
- }
-
- /**
- */
- public void removeAllProperty(
- ) {
- this._propertyList.clear();
- }
-
- /**
- */
- public void removeAllScore(
- ) {
- this._scoreList.clear();
- }
-
- /**
- * Method removeAnnotationElement.
- *
- * @param vAnnotationElement
- * @return true if the object was removed from the collection.
- */
- public boolean removeAnnotationElement(
- final uk.ac.vamsas.objects.core.AnnotationElement vAnnotationElement) {
- boolean removed = _annotationElementList.remove(vAnnotationElement);
- return removed;
- }
-
- /**
- * Method removeAnnotationElementAt.
- *
- * @param index
- * @return the element removed from the collection
- */
- public uk.ac.vamsas.objects.core.AnnotationElement removeAnnotationElementAt(
- final int index) {
- java.lang.Object obj = this._annotationElementList.remove(index);
- return (uk.ac.vamsas.objects.core.AnnotationElement) obj;
- }
-
- /**
- * Method removeLink.
- *
- * @param vLink
- * @return true if the object was removed from the collection.
- */
- public boolean removeLink(
- final uk.ac.vamsas.objects.core.Link vLink) {
- boolean removed = _linkList.remove(vLink);
- return removed;
- }
-
- /**
- * Method removeLinkAt.
- *
- * @param index
- * @return the element removed from the collection
- */
- public uk.ac.vamsas.objects.core.Link removeLinkAt(
- final int index) {
- java.lang.Object obj = this._linkList.remove(index);
- return (uk.ac.vamsas.objects.core.Link) obj;
- }
-
- /**
- * Method removeProperty.
- *
- * @param vProperty
- * @return true if the object was removed from the collection.
- */
- public boolean removeProperty(
- final uk.ac.vamsas.objects.core.Property vProperty) {
- boolean removed = _propertyList.remove(vProperty);
- return removed;
- }
-
- /**
- * Method removePropertyAt.
- *
- * @param index
- * @return the element removed from the collection
- */
- public uk.ac.vamsas.objects.core.Property removePropertyAt(
- final int index) {
- java.lang.Object obj = this._propertyList.remove(index);
- return (uk.ac.vamsas.objects.core.Property) obj;
- }
-
- /**
- * Method removeScore.
- *
- * @param vScore
- * @return true if the object was removed from the collection.
- */
- public boolean removeScore(
- final uk.ac.vamsas.objects.core.Score vScore) {
- boolean removed = _scoreList.remove(vScore);
- return removed;
- }
-
- /**
- * Method removeScoreAt.
- *
- * @param index
- * @return the element removed from the collection
- */
- public uk.ac.vamsas.objects.core.Score removeScoreAt(
- final int index) {
- java.lang.Object obj = this._scoreList.remove(index);
- return (uk.ac.vamsas.objects.core.Score) obj;
- }
-
- /**
- *
- *
- * @param index
- * @param vAnnotationElement
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void setAnnotationElement(
- final int index,
- final uk.ac.vamsas.objects.core.AnnotationElement vAnnotationElement)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._annotationElementList.size()) {
- throw new IndexOutOfBoundsException("setAnnotationElement: Index value '" + index + "' not in range [0.." + (this._annotationElementList.size() - 1) + "]");
+ } else if (temp._group != null)
+ return false;
+ if (this._type != null) {
+ if (temp._type == null)
+ return false;
+ if (this._type != temp._type) {
+ thcycle = org.castor.util.CycleBreaker.startingToCycle(this._type);
+ tmcycle = org.castor.util.CycleBreaker.startingToCycle(temp._type);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._type);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._type);
+ }
+ ;
+ return false;
+ }
+ if (!thcycle) {
+ if (!this._type.equals(temp._type)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._type);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._type);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._type);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._type);
+ }
}
-
- this._annotationElementList.set(index, vAnnotationElement);
- }
-
- /**
- *
- *
- * @param vAnnotationElementArray
- */
- public void setAnnotationElement(
- final uk.ac.vamsas.objects.core.AnnotationElement[] vAnnotationElementArray) {
- //-- copy array
- _annotationElementList.clear();
-
- for (int i = 0; i < vAnnotationElementArray.length; i++) {
- this._annotationElementList.add(vAnnotationElementArray[i]);
+ } else if (temp._type != null)
+ return false;
+ if (this._label != null) {
+ if (temp._label == null)
+ return false;
+ if (this._label != temp._label) {
+ thcycle = org.castor.util.CycleBreaker.startingToCycle(this._label);
+ tmcycle = org.castor.util.CycleBreaker.startingToCycle(temp._label);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._label);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._label);
+ }
+ ;
+ return false;
+ }
+ if (!thcycle) {
+ if (!this._label.equals(temp._label)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._label);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._label);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._label);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._label);
+ }
}
- }
-
- /**
- * Sets the value of '_annotationElementList' by copying the
- * given Vector. All elements will be checked for type safety.
- *
- * @param vAnnotationElementList the Vector to copy.
- */
- public void setAnnotationElement(
- final java.util.Vector vAnnotationElementList) {
- // copy vector
- this._annotationElementList.clear();
-
- this._annotationElementList.addAll(vAnnotationElementList);
- }
-
- /**
- * Sets the value of '_annotationElementList' by setting it to
- * the given Vector. No type checking is performed.
- * @deprecated
- *
- * @param annotationElementVector the Vector to set.
- */
- public void setAnnotationElementAsReference(
- final java.util.Vector annotationElementVector) {
- this._annotationElementList = annotationElementVector;
- }
-
- /**
- * Sets the value of field 'description'. The field
- * 'description' has the following description: Human readable
- * description of the annotation
- *
- *
- * @param description the value of field 'description'.
- */
- public void setDescription(
- final java.lang.String description) {
- this._description = description;
- }
-
- /**
- * Sets the value of field 'group'. The field 'group' has the
- * following description: Annotation with the same non-empty
- * group name are grouped
- * together
- *
- * @param group the value of field 'group'.
- */
- public void setGroup(
- final java.lang.String group) {
- this._group = group;
- }
-
- /**
- * Sets the value of field 'id'. The field 'id' has the
- * following description: Primary Key for vamsas object
- * referencing
- *
- *
- * @param id the value of field 'id'.
- */
- public void setId(
- final java.lang.String id) {
- this._id = id;
- }
-
- /**
- * Sets the value of field 'label'. The field 'label' has the
- * following description: Short, meaningful name for the
- * annotation - if this
- * is absent, then the type string should be used in its
- * place.
- *
- *
- * @param label the value of field 'label'.
- */
- public void setLabel(
- final java.lang.String label) {
- this._label = label;
- }
-
- /**
- *
- *
- * @param index
- * @param vLink
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void setLink(
- final int index,
- final uk.ac.vamsas.objects.core.Link vLink)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._linkList.size()) {
- throw new IndexOutOfBoundsException("setLink: Index value '" + index + "' not in range [0.." + (this._linkList.size() - 1) + "]");
+ } else if (temp._label != null)
+ return false;
+ if (this._description != null) {
+ if (temp._description == null)
+ return false;
+ if (this._description != temp._description) {
+ thcycle = org.castor.util.CycleBreaker
+ .startingToCycle(this._description);
+ tmcycle = org.castor.util.CycleBreaker
+ .startingToCycle(temp._description);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(this._description);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(temp._description);
+ }
+ ;
+ return false;
+ }
+ if (!thcycle) {
+ if (!this._description.equals(temp._description)) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(this._description);
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(temp._description);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._description);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._description);
+ }
}
-
- this._linkList.set(index, vLink);
- }
-
- /**
- *
- *
- * @param vLinkArray
- */
- public void setLink(
- final uk.ac.vamsas.objects.core.Link[] vLinkArray) {
- //-- copy array
- _linkList.clear();
-
- for (int i = 0; i < vLinkArray.length; i++) {
- this._linkList.add(vLinkArray[i]);
+ } else if (temp._description != null)
+ return false;
+ if (this._status != null) {
+ if (temp._status == null)
+ return false;
+ if (this._status != temp._status) {
+ thcycle = org.castor.util.CycleBreaker.startingToCycle(this._status);
+ tmcycle = org.castor.util.CycleBreaker.startingToCycle(temp._status);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._status);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._status);
+ }
+ ;
+ return false;
+ }
+ if (!thcycle) {
+ if (!this._status.equals(temp._status)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._status);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._status);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._status);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._status);
+ }
}
- }
-
- /**
- * Sets the value of '_linkList' by copying the given Vector.
- * All elements will be checked for type safety.
- *
- * @param vLinkList the Vector to copy.
- */
- public void setLink(
- final java.util.Vector vLinkList) {
- // copy vector
- this._linkList.clear();
-
- this._linkList.addAll(vLinkList);
- }
-
- /**
- * Sets the value of '_linkList' by setting it to the given
- * Vector. No type checking is performed.
- * @deprecated
- *
- * @param linkVector the Vector to set.
- */
- public void setLinkAsReference(
- final java.util.Vector linkVector) {
- this._linkList = linkVector;
- }
-
- /**
- * Sets the value of field 'modifiable'.
- *
- * @param modifiable the value of field 'modifiable'.
- */
- public void setModifiable(
- final java.lang.String modifiable) {
- this._modifiable = modifiable;
- }
-
- /**
- *
- *
- * @param index
- * @param vProperty
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void setProperty(
- final int index,
- final uk.ac.vamsas.objects.core.Property vProperty)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._propertyList.size()) {
- throw new IndexOutOfBoundsException("setProperty: Index value '" + index + "' not in range [0.." + (this._propertyList.size() - 1) + "]");
+ } else if (temp._status != null)
+ return false;
+ if (this._annotationElementList != null) {
+ if (temp._annotationElementList == null)
+ return false;
+ if (this._annotationElementList != temp._annotationElementList) {
+ thcycle = org.castor.util.CycleBreaker
+ .startingToCycle(this._annotationElementList);
+ tmcycle = org.castor.util.CycleBreaker
+ .startingToCycle(temp._annotationElementList);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(this._annotationElementList);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(temp._annotationElementList);
+ }
+ ;
+ return false;
+ }
+ if (!thcycle) {
+ if (!this._annotationElementList
+ .equals(temp._annotationElementList)) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(this._annotationElementList);
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(temp._annotationElementList);
+ return false;
+ }
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(this._annotationElementList);
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(temp._annotationElementList);
+ }
}
-
- this._propertyList.set(index, vProperty);
- }
-
- /**
- *
- *
- * @param vPropertyArray
- */
- public void setProperty(
- final uk.ac.vamsas.objects.core.Property[] vPropertyArray) {
- //-- copy array
- _propertyList.clear();
-
- for (int i = 0; i < vPropertyArray.length; i++) {
- this._propertyList.add(vPropertyArray[i]);
+ } else if (temp._annotationElementList != null)
+ return false;
+ if (this._scoreList != null) {
+ if (temp._scoreList == null)
+ return false;
+ if (this._scoreList != temp._scoreList) {
+ thcycle = org.castor.util.CycleBreaker
+ .startingToCycle(this._scoreList);
+ tmcycle = org.castor.util.CycleBreaker
+ .startingToCycle(temp._scoreList);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._scoreList);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._scoreList);
+ }
+ ;
+ return false;
+ }
+ if (!thcycle) {
+ if (!this._scoreList.equals(temp._scoreList)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._scoreList);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._scoreList);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._scoreList);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._scoreList);
+ }
}
- }
-
- /**
- * Sets the value of '_propertyList' by copying the given
- * Vector. All elements will be checked for type safety.
- *
- * @param vPropertyList the Vector to copy.
- */
- public void setProperty(
- final java.util.Vector vPropertyList) {
- // copy vector
- this._propertyList.clear();
-
- this._propertyList.addAll(vPropertyList);
- }
-
- /**
- * Sets the value of '_propertyList' by setting it to the given
- * Vector. No type checking is performed.
- * @deprecated
- *
- * @param propertyVector the Vector to set.
- */
- public void setPropertyAsReference(
- final java.util.Vector propertyVector) {
- this._propertyList = propertyVector;
- }
-
- /**
- *
- *
- * @param index
- * @param vScore
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void setScore(
- final int index,
- final uk.ac.vamsas.objects.core.Score vScore)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._scoreList.size()) {
- throw new IndexOutOfBoundsException("setScore: Index value '" + index + "' not in range [0.." + (this._scoreList.size() - 1) + "]");
+ } else if (temp._scoreList != null)
+ return false;
+ if (this._linkList != null) {
+ if (temp._linkList == null)
+ return false;
+ if (this._linkList != temp._linkList) {
+ thcycle = org.castor.util.CycleBreaker
+ .startingToCycle(this._linkList);
+ tmcycle = org.castor.util.CycleBreaker
+ .startingToCycle(temp._linkList);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._linkList);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._linkList);
+ }
+ ;
+ return false;
+ }
+ if (!thcycle) {
+ if (!this._linkList.equals(temp._linkList)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._linkList);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._linkList);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._linkList);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._linkList);
+ }
}
-
- this._scoreList.set(index, vScore);
- }
-
- /**
- *
- *
- * @param vScoreArray
- */
- public void setScore(
- final uk.ac.vamsas.objects.core.Score[] vScoreArray) {
- //-- copy array
- _scoreList.clear();
-
- for (int i = 0; i < vScoreArray.length; i++) {
- this._scoreList.add(vScoreArray[i]);
+ } else if (temp._linkList != null)
+ return false;
+ if (this._propertyList != null) {
+ if (temp._propertyList == null)
+ return false;
+ if (this._propertyList != temp._propertyList) {
+ thcycle = org.castor.util.CycleBreaker
+ .startingToCycle(this._propertyList);
+ tmcycle = org.castor.util.CycleBreaker
+ .startingToCycle(temp._propertyList);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(this._propertyList);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(temp._propertyList);
+ }
+ ;
+ return false;
+ }
+ if (!thcycle) {
+ if (!this._propertyList.equals(temp._propertyList)) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(this._propertyList);
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(temp._propertyList);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._propertyList);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._propertyList);
+ }
}
- }
-
- /**
- * Sets the value of '_scoreList' by copying the given Vector.
- * All elements will be checked for type safety.
- *
- * @param vScoreList the Vector to copy.
- */
- public void setScore(
- final java.util.Vector vScoreList) {
- // copy vector
- this._scoreList.clear();
-
- this._scoreList.addAll(vScoreList);
- }
-
- /**
- * Sets the value of '_scoreList' by setting it to the given
- * Vector. No type checking is performed.
- * @deprecated
- *
- * @param scoreVector the Vector to set.
- */
- public void setScoreAsReference(
- final java.util.Vector scoreVector) {
- this._scoreList = scoreVector;
- }
-
- /**
- * Sets the value of field 'status'. The field 'status' has the
- * following description: TODO: specify this - we have
- * considered taking the GO
- * evidence codes as a model for assessing a measure of
- * quality to an
- * annotation.
- *
- * @param status the value of field 'status'.
- */
- public void setStatus(
- final java.lang.String status) {
- this._status = status;
- }
-
- /**
- * Sets the value of field 'type'. The field 'type' has the
- * following description: A Das Feature has both a type and a
- * Type ID. We go the
- * route of requiring the type string to be taken from a
- * controlled
- * vocabulary if an application expects others to make sense
- * of it. The
- * type may qualified - so uniprot:CHAIN is a valid type name,
- * and
- * considered distinct from someotherDB:CHAIN
- *
- * @param type the value of field 'type'.
- */
- public void setType(
- final java.lang.String type) {
- this._type = type;
- }
-
- /**
- * Method unmarshal.
- *
- * @param reader
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @return the unmarshaled uk.ac.vamsas.objects.core.RangeType
- */
- public static uk.ac.vamsas.objects.core.RangeType unmarshal(
- final java.io.Reader reader)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- return (uk.ac.vamsas.objects.core.RangeType) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.RangeAnnotation.class, reader);
- }
-
- /**
- *
- *
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void validate(
- )
- throws org.exolab.castor.xml.ValidationException {
- org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
- validator.validate(this);
- }
+ } else if (temp._propertyList != null)
+ return false;
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Method getAnnotationElement.
+ *
+ * @param index
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ * @return the value of the uk.ac.vamsas.objects.core.AnnotationElement at the
+ * given inde
+ */
+ public uk.ac.vamsas.objects.core.AnnotationElement getAnnotationElement(
+ final int index) throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._annotationElementList.size()) {
+ throw new IndexOutOfBoundsException("getAnnotationElement: Index value '"
+ + index + "' not in range [0.."
+ + (this._annotationElementList.size() - 1) + "]");
+ }
+
+ return (uk.ac.vamsas.objects.core.AnnotationElement) _annotationElementList
+ .get(index);
+ }
+
+ /**
+ * Method getAnnotationElement.Returns the contents of the collection in an
+ * Array.
+ *
+ * Note: Just in case the collection contents are changing in another thread,
+ * we pass a 0-length Array of the correct type into the API call. This way we
+ * know that the Array returned is of exactly the correct length.
+ *
+ * @return this collection as an Array
+ */
+ public uk.ac.vamsas.objects.core.AnnotationElement[] getAnnotationElement() {
+ uk.ac.vamsas.objects.core.AnnotationElement[] array = new uk.ac.vamsas.objects.core.AnnotationElement[0];
+ return (uk.ac.vamsas.objects.core.AnnotationElement[]) this._annotationElementList
+ .toArray(array);
+ }
+
+ /**
+ * Method getAnnotationElementAsReference.Returns a reference to
+ * '_annotationElementList'. No type checking is performed on any
+ * modifications to the Vector.
+ *
+ * @return a reference to the Vector backing this class
+ */
+ public java.util.Vector getAnnotationElementAsReference() {
+ return this._annotationElementList;
+ }
+
+ /**
+ * Method getAnnotationElementCount.
+ *
+ * @return the size of this collection
+ */
+ public int getAnnotationElementCount() {
+ return this._annotationElementList.size();
+ }
+
+ /**
+ * Returns the value of field 'description'. The field 'description' has the
+ * following description: Human readable description of the annotation
+ *
+ *
+ * @return the value of field 'Description'.
+ */
+ public java.lang.String getDescription() {
+ return this._description;
+ }
+
+ /**
+ * Returns the value of field 'group'. The field 'group' has the following
+ * description: Annotation with the same non-empty group name are grouped
+ * together
+ *
+ * @return the value of field 'Group'.
+ */
+ public java.lang.String getGroup() {
+ return this._group;
+ }
+
+ /**
+ * Returns the value of field 'id'. The field 'id' has the following
+ * description: Primary Key for vamsas object referencing
+ *
+ *
+ * @return the value of field 'Id'.
+ */
+ public java.lang.String getId() {
+ return this._id;
+ }
+
+ /**
+ * Returns the value of field 'label'. The field 'label' has the following
+ * description: Short, meaningful name for the annotation - if this is absent,
+ * then the type string should be used in its place.
+ *
+ *
+ * @return the value of field 'Label'.
+ */
+ public java.lang.String getLabel() {
+ return this._label;
+ }
+
+ /**
+ * Method getLink.
+ *
+ * @param index
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ * @return the value of the uk.ac.vamsas.objects.core.Link at the given index
+ */
+ public uk.ac.vamsas.objects.core.Link getLink(final int index)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._linkList.size()) {
+ throw new IndexOutOfBoundsException("getLink: Index value '" + index
+ + "' not in range [0.." + (this._linkList.size() - 1) + "]");
+ }
+
+ return (uk.ac.vamsas.objects.core.Link) _linkList.get(index);
+ }
+
+ /**
+ * Method getLink.Returns the contents of the collection in an Array.
+ *
+ * Note: Just in case the collection contents are changing in another thread,
+ * we pass a 0-length Array of the correct type into the API call. This way we
+ * know that the Array returned is of exactly the correct length.
+ *
+ * @return this collection as an Array
+ */
+ public uk.ac.vamsas.objects.core.Link[] getLink() {
+ uk.ac.vamsas.objects.core.Link[] array = new uk.ac.vamsas.objects.core.Link[0];
+ return (uk.ac.vamsas.objects.core.Link[]) this._linkList.toArray(array);
+ }
+
+ /**
+ * Method getLinkAsReference.Returns a reference to '_linkList'. No type
+ * checking is performed on any modifications to the Vector.
+ *
+ * @return a reference to the Vector backing this class
+ */
+ public java.util.Vector getLinkAsReference() {
+ return this._linkList;
+ }
+
+ /**
+ * Method getLinkCount.
+ *
+ * @return the size of this collection
+ */
+ public int getLinkCount() {
+ return this._linkList.size();
+ }
+
+ /**
+ * Returns the value of field 'modifiable'.
+ *
+ * @return the value of field 'Modifiable'.
+ */
+ public java.lang.String getModifiable() {
+ return this._modifiable;
+ }
+
+ /**
+ * Method getProperty.
+ *
+ * @param index
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ * @return the value of the uk.ac.vamsas.objects.core.Property at the given
+ * index
+ */
+ public uk.ac.vamsas.objects.core.Property getProperty(final int index)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._propertyList.size()) {
+ throw new IndexOutOfBoundsException("getProperty: Index value '" + index
+ + "' not in range [0.." + (this._propertyList.size() - 1) + "]");
+ }
+
+ return (uk.ac.vamsas.objects.core.Property) _propertyList.get(index);
+ }
+
+ /**
+ * Method getProperty.Returns the contents of the collection in an Array.
+ *
+ * Note: Just in case the collection contents are changing in another thread,
+ * we pass a 0-length Array of the correct type into the API call. This way we
+ * know that the Array returned is of exactly the correct length.
+ *
+ * @return this collection as an Array
+ */
+ public uk.ac.vamsas.objects.core.Property[] getProperty() {
+ uk.ac.vamsas.objects.core.Property[] array = new uk.ac.vamsas.objects.core.Property[0];
+ return (uk.ac.vamsas.objects.core.Property[]) this._propertyList
+ .toArray(array);
+ }
+
+ /**
+ * Method getPropertyAsReference.Returns a reference to '_propertyList'. No
+ * type checking is performed on any modifications to the Vector.
+ *
+ * @return a reference to the Vector backing this class
+ */
+ public java.util.Vector getPropertyAsReference() {
+ return this._propertyList;
+ }
+
+ /**
+ * Method getPropertyCount.
+ *
+ * @return the size of this collection
+ */
+ public int getPropertyCount() {
+ return this._propertyList.size();
+ }
+
+ /**
+ * Method getScore.
+ *
+ * @param index
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ * @return the value of the uk.ac.vamsas.objects.core.Score at the given index
+ */
+ public uk.ac.vamsas.objects.core.Score getScore(final int index)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._scoreList.size()) {
+ throw new IndexOutOfBoundsException("getScore: Index value '" + index
+ + "' not in range [0.." + (this._scoreList.size() - 1) + "]");
+ }
+
+ return (uk.ac.vamsas.objects.core.Score) _scoreList.get(index);
+ }
+
+ /**
+ * Method getScore.Returns the contents of the collection in an Array.
+ *
+ * Note: Just in case the collection contents are changing in another thread,
+ * we pass a 0-length Array of the correct type into the API call. This way we
+ * know that the Array returned is of exactly the correct length.
+ *
+ * @return this collection as an Array
+ */
+ public uk.ac.vamsas.objects.core.Score[] getScore() {
+ uk.ac.vamsas.objects.core.Score[] array = new uk.ac.vamsas.objects.core.Score[0];
+ return (uk.ac.vamsas.objects.core.Score[]) this._scoreList.toArray(array);
+ }
+
+ /**
+ * Method getScoreAsReference.Returns a reference to '_scoreList'. No type
+ * checking is performed on any modifications to the Vector.
+ *
+ * @return a reference to the Vector backing this class
+ */
+ public java.util.Vector getScoreAsReference() {
+ return this._scoreList;
+ }
+
+ /**
+ * Method getScoreCount.
+ *
+ * @return the size of this collection
+ */
+ public int getScoreCount() {
+ return this._scoreList.size();
+ }
+
+ /**
+ * Returns the value of field 'status'. The field 'status' has the following
+ * description: TODO: specify this - we have considered taking the GO evidence
+ * codes as a model for assessing a measure of quality to an annotation.
+ *
+ * @return the value of field 'Status'.
+ */
+ public java.lang.String getStatus() {
+ return this._status;
+ }
+
+ /**
+ * Returns the value of field 'type'. The field 'type' has the following
+ * description: A Das Feature has both a type and a Type ID. We go the route
+ * of requiring the type string to be taken from a controlled vocabulary if an
+ * application expects others to make sense of it. The type may qualified - so
+ * uniprot:CHAIN is a valid type name, and considered distinct from
+ * someotherDB:CHAIN
+ *
+ * @return the value of field 'Type'.
+ */
+ public java.lang.String getType() {
+ return this._type;
+ }
+
+ /**
+ * Overrides the java.lang.Object.hashCode method.
+ *
+ * The following steps came from Effective Java Programming Language
+ * Guide by Joshua Bloch, Chapter 3
+ *
+ * @return a hash code value for the object.
+ */
+ public int hashCode() {
+ int result = super.hashCode();
+
+ long tmp;
+ if (_id != null && !org.castor.util.CycleBreaker.startingToCycle(_id)) {
+ result = 37 * result + _id.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_id);
+ }
+ if (_modifiable != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_modifiable)) {
+ result = 37 * result + _modifiable.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_modifiable);
+ }
+ if (_group != null && !org.castor.util.CycleBreaker.startingToCycle(_group)) {
+ result = 37 * result + _group.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_group);
+ }
+ if (_type != null && !org.castor.util.CycleBreaker.startingToCycle(_type)) {
+ result = 37 * result + _type.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_type);
+ }
+ if (_label != null && !org.castor.util.CycleBreaker.startingToCycle(_label)) {
+ result = 37 * result + _label.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_label);
+ }
+ if (_description != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_description)) {
+ result = 37 * result + _description.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_description);
+ }
+ if (_status != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_status)) {
+ result = 37 * result + _status.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_status);
+ }
+ if (_annotationElementList != null
+ && !org.castor.util.CycleBreaker
+ .startingToCycle(_annotationElementList)) {
+ result = 37 * result + _annotationElementList.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_annotationElementList);
+ }
+ if (_scoreList != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_scoreList)) {
+ result = 37 * result + _scoreList.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_scoreList);
+ }
+ if (_linkList != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_linkList)) {
+ result = 37 * result + _linkList.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_linkList);
+ }
+ if (_propertyList != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_propertyList)) {
+ result = 37 * result + _propertyList.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_propertyList);
+ }
+
+ return result;
+ }
+
+ /**
+ * Method isValid.
+ *
+ * @return true if this object is valid according to the schema
+ */
+ public boolean isValid() {
+ try {
+ validate();
+ } catch (org.exolab.castor.xml.ValidationException vex) {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ *
+ *
+ * @param out
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void marshal(final java.io.Writer out)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, out);
+ }
+
+ /**
+ *
+ *
+ * @param handler
+ * @throws java.io.IOException
+ * if an IOException occurs during marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ */
+ public void marshal(final org.xml.sax.ContentHandler handler)
+ throws java.io.IOException, org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, handler);
+ }
+
+ /**
+ */
+ public void removeAllAnnotationElement() {
+ this._annotationElementList.clear();
+ }
+
+ /**
+ */
+ public void removeAllLink() {
+ this._linkList.clear();
+ }
+
+ /**
+ */
+ public void removeAllProperty() {
+ this._propertyList.clear();
+ }
+
+ /**
+ */
+ public void removeAllScore() {
+ this._scoreList.clear();
+ }
+
+ /**
+ * Method removeAnnotationElement.
+ *
+ * @param vAnnotationElement
+ * @return true if the object was removed from the collection.
+ */
+ public boolean removeAnnotationElement(
+ final uk.ac.vamsas.objects.core.AnnotationElement vAnnotationElement) {
+ boolean removed = _annotationElementList.remove(vAnnotationElement);
+ return removed;
+ }
+
+ /**
+ * Method removeAnnotationElementAt.
+ *
+ * @param index
+ * @return the element removed from the collection
+ */
+ public uk.ac.vamsas.objects.core.AnnotationElement removeAnnotationElementAt(
+ final int index) {
+ java.lang.Object obj = this._annotationElementList.remove(index);
+ return (uk.ac.vamsas.objects.core.AnnotationElement) obj;
+ }
+
+ /**
+ * Method removeLink.
+ *
+ * @param vLink
+ * @return true if the object was removed from the collection.
+ */
+ public boolean removeLink(final uk.ac.vamsas.objects.core.Link vLink) {
+ boolean removed = _linkList.remove(vLink);
+ return removed;
+ }
+
+ /**
+ * Method removeLinkAt.
+ *
+ * @param index
+ * @return the element removed from the collection
+ */
+ public uk.ac.vamsas.objects.core.Link removeLinkAt(final int index) {
+ java.lang.Object obj = this._linkList.remove(index);
+ return (uk.ac.vamsas.objects.core.Link) obj;
+ }
+
+ /**
+ * Method removeProperty.
+ *
+ * @param vProperty
+ * @return true if the object was removed from the collection.
+ */
+ public boolean removeProperty(
+ final uk.ac.vamsas.objects.core.Property vProperty) {
+ boolean removed = _propertyList.remove(vProperty);
+ return removed;
+ }
+
+ /**
+ * Method removePropertyAt.
+ *
+ * @param index
+ * @return the element removed from the collection
+ */
+ public uk.ac.vamsas.objects.core.Property removePropertyAt(final int index) {
+ java.lang.Object obj = this._propertyList.remove(index);
+ return (uk.ac.vamsas.objects.core.Property) obj;
+ }
+
+ /**
+ * Method removeScore.
+ *
+ * @param vScore
+ * @return true if the object was removed from the collection.
+ */
+ public boolean removeScore(final uk.ac.vamsas.objects.core.Score vScore) {
+ boolean removed = _scoreList.remove(vScore);
+ return removed;
+ }
+
+ /**
+ * Method removeScoreAt.
+ *
+ * @param index
+ * @return the element removed from the collection
+ */
+ public uk.ac.vamsas.objects.core.Score removeScoreAt(final int index) {
+ java.lang.Object obj = this._scoreList.remove(index);
+ return (uk.ac.vamsas.objects.core.Score) obj;
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vAnnotationElement
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void setAnnotationElement(final int index,
+ final uk.ac.vamsas.objects.core.AnnotationElement vAnnotationElement)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._annotationElementList.size()) {
+ throw new IndexOutOfBoundsException("setAnnotationElement: Index value '"
+ + index + "' not in range [0.."
+ + (this._annotationElementList.size() - 1) + "]");
+ }
+
+ this._annotationElementList.set(index, vAnnotationElement);
+ }
+
+ /**
+ *
+ *
+ * @param vAnnotationElementArray
+ */
+ public void setAnnotationElement(
+ final uk.ac.vamsas.objects.core.AnnotationElement[] vAnnotationElementArray) {
+ // -- copy array
+ _annotationElementList.clear();
+
+ for (int i = 0; i < vAnnotationElementArray.length; i++) {
+ this._annotationElementList.add(vAnnotationElementArray[i]);
+ }
+ }
+
+ /**
+ * Sets the value of '_annotationElementList' by copying the given Vector. All
+ * elements will be checked for type safety.
+ *
+ * @param vAnnotationElementList
+ * the Vector to copy.
+ */
+ public void setAnnotationElement(final java.util.Vector vAnnotationElementList) {
+ // copy vector
+ this._annotationElementList.clear();
+
+ this._annotationElementList.addAll(vAnnotationElementList);
+ }
+
+ /**
+ * Sets the value of '_annotationElementList' by setting it to the given
+ * Vector. No type checking is performed.
+ *
+ * @deprecated
+ *
+ * @param annotationElementVector
+ * the Vector to set.
+ */
+ public void setAnnotationElementAsReference(
+ final java.util.Vector annotationElementVector) {
+ this._annotationElementList = annotationElementVector;
+ }
+
+ /**
+ * Sets the value of field 'description'. The field 'description' has the
+ * following description: Human readable description of the annotation
+ *
+ *
+ * @param description
+ * the value of field 'description'.
+ */
+ public void setDescription(final java.lang.String description) {
+ this._description = description;
+ }
+
+ /**
+ * Sets the value of field 'group'. The field 'group' has the following
+ * description: Annotation with the same non-empty group name are grouped
+ * together
+ *
+ * @param group
+ * the value of field 'group'.
+ */
+ public void setGroup(final java.lang.String group) {
+ this._group = group;
+ }
+
+ /**
+ * Sets the value of field 'id'. The field 'id' has the following description:
+ * Primary Key for vamsas object referencing
+ *
+ *
+ * @param id
+ * the value of field 'id'.
+ */
+ public void setId(final java.lang.String id) {
+ this._id = id;
+ }
+
+ /**
+ * Sets the value of field 'label'. The field 'label' has the following
+ * description: Short, meaningful name for the annotation - if this is absent,
+ * then the type string should be used in its place.
+ *
+ *
+ * @param label
+ * the value of field 'label'.
+ */
+ public void setLabel(final java.lang.String label) {
+ this._label = label;
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vLink
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void setLink(final int index,
+ final uk.ac.vamsas.objects.core.Link vLink)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._linkList.size()) {
+ throw new IndexOutOfBoundsException("setLink: Index value '" + index
+ + "' not in range [0.." + (this._linkList.size() - 1) + "]");
+ }
+
+ this._linkList.set(index, vLink);
+ }
+
+ /**
+ *
+ *
+ * @param vLinkArray
+ */
+ public void setLink(final uk.ac.vamsas.objects.core.Link[] vLinkArray) {
+ // -- copy array
+ _linkList.clear();
+
+ for (int i = 0; i < vLinkArray.length; i++) {
+ this._linkList.add(vLinkArray[i]);
+ }
+ }
+
+ /**
+ * Sets the value of '_linkList' by copying the given Vector. All elements
+ * will be checked for type safety.
+ *
+ * @param vLinkList
+ * the Vector to copy.
+ */
+ public void setLink(final java.util.Vector vLinkList) {
+ // copy vector
+ this._linkList.clear();
+
+ this._linkList.addAll(vLinkList);
+ }
+
+ /**
+ * Sets the value of '_linkList' by setting it to the given Vector. No type
+ * checking is performed.
+ *
+ * @deprecated
+ *
+ * @param linkVector
+ * the Vector to set.
+ */
+ public void setLinkAsReference(final java.util.Vector linkVector) {
+ this._linkList = linkVector;
+ }
+
+ /**
+ * Sets the value of field 'modifiable'.
+ *
+ * @param modifiable
+ * the value of field 'modifiable'.
+ */
+ public void setModifiable(final java.lang.String modifiable) {
+ this._modifiable = modifiable;
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vProperty
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void setProperty(final int index,
+ final uk.ac.vamsas.objects.core.Property vProperty)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._propertyList.size()) {
+ throw new IndexOutOfBoundsException("setProperty: Index value '" + index
+ + "' not in range [0.." + (this._propertyList.size() - 1) + "]");
+ }
+
+ this._propertyList.set(index, vProperty);
+ }
+
+ /**
+ *
+ *
+ * @param vPropertyArray
+ */
+ public void setProperty(
+ final uk.ac.vamsas.objects.core.Property[] vPropertyArray) {
+ // -- copy array
+ _propertyList.clear();
+
+ for (int i = 0; i < vPropertyArray.length; i++) {
+ this._propertyList.add(vPropertyArray[i]);
+ }
+ }
+
+ /**
+ * Sets the value of '_propertyList' by copying the given Vector. All elements
+ * will be checked for type safety.
+ *
+ * @param vPropertyList
+ * the Vector to copy.
+ */
+ public void setProperty(final java.util.Vector vPropertyList) {
+ // copy vector
+ this._propertyList.clear();
+
+ this._propertyList.addAll(vPropertyList);
+ }
+
+ /**
+ * Sets the value of '_propertyList' by setting it to the given Vector. No
+ * type checking is performed.
+ *
+ * @deprecated
+ *
+ * @param propertyVector
+ * the Vector to set.
+ */
+ public void setPropertyAsReference(final java.util.Vector propertyVector) {
+ this._propertyList = propertyVector;
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vScore
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void setScore(final int index,
+ final uk.ac.vamsas.objects.core.Score vScore)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._scoreList.size()) {
+ throw new IndexOutOfBoundsException("setScore: Index value '" + index
+ + "' not in range [0.." + (this._scoreList.size() - 1) + "]");
+ }
+
+ this._scoreList.set(index, vScore);
+ }
+
+ /**
+ *
+ *
+ * @param vScoreArray
+ */
+ public void setScore(final uk.ac.vamsas.objects.core.Score[] vScoreArray) {
+ // -- copy array
+ _scoreList.clear();
+
+ for (int i = 0; i < vScoreArray.length; i++) {
+ this._scoreList.add(vScoreArray[i]);
+ }
+ }
+
+ /**
+ * Sets the value of '_scoreList' by copying the given Vector. All elements
+ * will be checked for type safety.
+ *
+ * @param vScoreList
+ * the Vector to copy.
+ */
+ public void setScore(final java.util.Vector vScoreList) {
+ // copy vector
+ this._scoreList.clear();
+
+ this._scoreList.addAll(vScoreList);
+ }
+
+ /**
+ * Sets the value of '_scoreList' by setting it to the given Vector. No type
+ * checking is performed.
+ *
+ * @deprecated
+ *
+ * @param scoreVector
+ * the Vector to set.
+ */
+ public void setScoreAsReference(final java.util.Vector scoreVector) {
+ this._scoreList = scoreVector;
+ }
+
+ /**
+ * Sets the value of field 'status'. The field 'status' has the following
+ * description: TODO: specify this - we have considered taking the GO evidence
+ * codes as a model for assessing a measure of quality to an annotation.
+ *
+ * @param status
+ * the value of field 'status'.
+ */
+ public void setStatus(final java.lang.String status) {
+ this._status = status;
+ }
+
+ /**
+ * Sets the value of field 'type'. The field 'type' has the following
+ * description: A Das Feature has both a type and a Type ID. We go the route
+ * of requiring the type string to be taken from a controlled vocabulary if an
+ * application expects others to make sense of it. The type may qualified - so
+ * uniprot:CHAIN is a valid type name, and considered distinct from
+ * someotherDB:CHAIN
+ *
+ * @param type
+ * the value of field 'type'.
+ */
+ public void setType(final java.lang.String type) {
+ this._type = type;
+ }
+
+ /**
+ * Method unmarshal.
+ *
+ * @param reader
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @return the unmarshaled uk.ac.vamsas.objects.core.RangeType
+ */
+ public static uk.ac.vamsas.objects.core.RangeType unmarshal(
+ final java.io.Reader reader)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ return (uk.ac.vamsas.objects.core.RangeType) Unmarshaller.unmarshal(
+ uk.ac.vamsas.objects.core.RangeAnnotation.class, reader);
+ }
+
+ /**
+ *
+ *
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void validate() throws org.exolab.castor.xml.ValidationException {
+ org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+ validator.validate(this);
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/RangeType.java b/src/uk/ac/vamsas/objects/core/RangeType.java
index 3e1f6da..b2573e9 100644
--- a/src/uk/ac/vamsas/objects/core/RangeType.java
+++ b/src/uk/ac/vamsas/objects/core/RangeType.java
@@ -1,601 +1,600 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core;
/**
- * Specify an ordered set of positions and/or regions on the
- * principle
- * dimension of some associated vamsas object Keeping to jaxb-1.0
- * specification for the moment - this choice should
- * become a substitution group when we use jaxb-2.0 capable
- * bindings
- *
+ * Specify an ordered set of positions and/or regions on the principle dimension
+ * of some associated vamsas object Keeping to jaxb-1.0 specification for the
+ * moment - this choice should become a substitution group when we use jaxb-2.0
+ * capable bindings
+ *
*
* @version $Revision$ $Date$
*/
-public abstract class RangeType extends uk.ac.vamsas.client.Vobject
-implements java.io.Serializable
-{
-
-
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
- * Internal choice value storage
- */
- private java.lang.Object _choiceValue;
-
- /**
- * a position within the associated object's coordinate system
- *
- */
- private java.util.Vector _posList;
-
- /**
- * a region from start to end, with flag for inclusivity of
- * terminii
- */
- private java.util.Vector _segList;
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public RangeType() {
- super();
- this._posList = new java.util.Vector();
- this._segList = new java.util.Vector();
- }
-
-
- //-----------/
- //- Methods -/
- //-----------/
-
- /**
- *
- *
- * @param vPos
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addPos(
- final uk.ac.vamsas.objects.core.Pos vPos)
- throws java.lang.IndexOutOfBoundsException {
- this._posList.addElement(vPos);
- }
-
- /**
- *
- *
- * @param index
- * @param vPos
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addPos(
- final int index,
- final uk.ac.vamsas.objects.core.Pos vPos)
- throws java.lang.IndexOutOfBoundsException {
- this._posList.add(index, vPos);
- }
-
- /**
- *
- *
- * @param vSeg
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addSeg(
- final uk.ac.vamsas.objects.core.Seg vSeg)
- throws java.lang.IndexOutOfBoundsException {
- this._segList.addElement(vSeg);
- }
-
- /**
- *
- *
- * @param index
- * @param vSeg
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addSeg(
- final int index,
- final uk.ac.vamsas.objects.core.Seg vSeg)
- throws java.lang.IndexOutOfBoundsException {
- this._segList.add(index, vSeg);
- }
-
- /**
- * Method enumeratePos.
- *
- * @return an Enumeration over all
- * uk.ac.vamsas.objects.core.Pos elements
- */
- public java.util.Enumeration enumeratePos(
- ) {
- return this._posList.elements();
- }
-
- /**
- * Method enumerateSeg.
- *
- * @return an Enumeration over all
- * uk.ac.vamsas.objects.core.Seg elements
- */
- public java.util.Enumeration enumerateSeg(
- ) {
- return this._segList.elements();
- }
-
- /**
- * Overrides the java.lang.Object.equals method.
- *
- * @param obj
- * @return true if the objects are equal.
- */
- public boolean equals(
- final java.lang.Object obj) {
- if ( this == obj )
- return true;
-
- if (super.equals(obj)==false)
+public abstract class RangeType extends uk.ac.vamsas.client.Vobject implements
+ java.io.Serializable {
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * Internal choice value storage
+ */
+ private java.lang.Object _choiceValue;
+
+ /**
+ * a position within the associated object's coordinate system
+ *
+ */
+ private java.util.Vector _posList;
+
+ /**
+ * a region from start to end, with flag for inclusivity of terminii
+ */
+ private java.util.Vector _segList;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public RangeType() {
+ super();
+ this._posList = new java.util.Vector();
+ this._segList = new java.util.Vector();
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ *
+ *
+ * @param vPos
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addPos(final uk.ac.vamsas.objects.core.Pos vPos)
+ throws java.lang.IndexOutOfBoundsException {
+ this._posList.addElement(vPos);
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vPos
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addPos(final int index, final uk.ac.vamsas.objects.core.Pos vPos)
+ throws java.lang.IndexOutOfBoundsException {
+ this._posList.add(index, vPos);
+ }
+
+ /**
+ *
+ *
+ * @param vSeg
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addSeg(final uk.ac.vamsas.objects.core.Seg vSeg)
+ throws java.lang.IndexOutOfBoundsException {
+ this._segList.addElement(vSeg);
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vSeg
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addSeg(final int index, final uk.ac.vamsas.objects.core.Seg vSeg)
+ throws java.lang.IndexOutOfBoundsException {
+ this._segList.add(index, vSeg);
+ }
+
+ /**
+ * Method enumeratePos.
+ *
+ * @return an Enumeration over all uk.ac.vamsas.objects.core.Pos elements
+ */
+ public java.util.Enumeration enumeratePos() {
+ return this._posList.elements();
+ }
+
+ /**
+ * Method enumerateSeg.
+ *
+ * @return an Enumeration over all uk.ac.vamsas.objects.core.Seg elements
+ */
+ public java.util.Enumeration enumerateSeg() {
+ return this._segList.elements();
+ }
+
+ /**
+ * Overrides the java.lang.Object.equals method.
+ *
+ * @param obj
+ * @return true if the objects are equal.
+ */
+ public boolean equals(final java.lang.Object obj) {
+ if (this == obj)
+ return true;
+
+ if (super.equals(obj) == false)
+ return false;
+
+ if (obj instanceof RangeType) {
+
+ RangeType temp = (RangeType) obj;
+ boolean thcycle;
+ boolean tmcycle;
+ if (this._choiceValue != null) {
+ if (temp._choiceValue == null)
+ return false;
+ if (this._choiceValue != temp._choiceValue) {
+ thcycle = org.castor.util.CycleBreaker
+ .startingToCycle(this._choiceValue);
+ tmcycle = org.castor.util.CycleBreaker
+ .startingToCycle(temp._choiceValue);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(this._choiceValue);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(temp._choiceValue);
+ }
+ ;
return false;
-
- if (obj instanceof RangeType) {
-
- RangeType temp = (RangeType)obj;
- boolean thcycle;
- boolean tmcycle;
- if (this._choiceValue != null) {
- if (temp._choiceValue == null) return false;
- if (this._choiceValue != temp._choiceValue) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._choiceValue);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._choiceValue);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._choiceValue); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._choiceValue); };
- return false;
- }
- if (!thcycle) {
- if (!this._choiceValue.equals(temp._choiceValue)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._choiceValue);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._choiceValue);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._choiceValue);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._choiceValue);
- }
- }
- } else if (temp._choiceValue != null)
- return false;
- if (this._posList != null) {
- if (temp._posList == null) return false;
- if (this._posList != temp._posList) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._posList);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._posList);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._posList); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._posList); };
- return false;
- }
- if (!thcycle) {
- if (!this._posList.equals(temp._posList)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._posList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._posList);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._posList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._posList);
- }
- }
- } else if (temp._posList != null)
- return false;
- if (this._segList != null) {
- if (temp._segList == null) return false;
- if (this._segList != temp._segList) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._segList);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._segList);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._segList); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._segList); };
- return false;
- }
- if (!thcycle) {
- if (!this._segList.equals(temp._segList)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._segList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._segList);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._segList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._segList);
- }
- }
- } else if (temp._segList != null)
- return false;
- return true;
+ }
+ if (!thcycle) {
+ if (!this._choiceValue.equals(temp._choiceValue)) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(this._choiceValue);
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(temp._choiceValue);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._choiceValue);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._choiceValue);
+ }
}
+ } else if (temp._choiceValue != null)
return false;
- }
-
- /**
- * Returns the value of field 'choiceValue'. The field
- * 'choiceValue' has the following description: Internal choice
- * value storage
- *
- * @return the value of field 'ChoiceValue'.
- */
- public java.lang.Object getChoiceValue(
- ) {
- return this._choiceValue;
- }
-
- /**
- * Method getPos.
- *
- * @param index
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- * @return the value of the uk.ac.vamsas.objects.core.Pos at
- * the given index
- */
- public uk.ac.vamsas.objects.core.Pos getPos(
- final int index)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._posList.size()) {
- throw new IndexOutOfBoundsException("getPos: Index value '" + index + "' not in range [0.." + (this._posList.size() - 1) + "]");
- }
-
- return (uk.ac.vamsas.objects.core.Pos) _posList.get(index);
- }
-
- /**
- * Method getPos.Returns the contents of the collection in an
- * Array.
Note: Just in case the collection contents are
- * changing in another thread, we pass a 0-length Array of the
- * correct type into the API call. This way we know
- * that the Array returned is of exactly the correct length.
- *
- * @return this collection as an Array
- */
- public uk.ac.vamsas.objects.core.Pos[] getPos(
- ) {
- uk.ac.vamsas.objects.core.Pos[] array = new uk.ac.vamsas.objects.core.Pos[0];
- return (uk.ac.vamsas.objects.core.Pos[]) this._posList.toArray(array);
- }
-
- /**
- * Method getPosAsReference.Returns a reference to '_posList'.
- * No type checking is performed on any modifications to the
- * Vector.
- *
- * @return a reference to the Vector backing this class
- */
- public java.util.Vector getPosAsReference(
- ) {
- return this._posList;
- }
-
- /**
- * Method getPosCount.
- *
- * @return the size of this collection
- */
- public int getPosCount(
- ) {
- return this._posList.size();
- }
-
- /**
- * Method getSeg.
- *
- * @param index
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- * @return the value of the uk.ac.vamsas.objects.core.Seg at
- * the given index
- */
- public uk.ac.vamsas.objects.core.Seg getSeg(
- final int index)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._segList.size()) {
- throw new IndexOutOfBoundsException("getSeg: Index value '" + index + "' not in range [0.." + (this._segList.size() - 1) + "]");
- }
-
- return (uk.ac.vamsas.objects.core.Seg) _segList.get(index);
- }
-
- /**
- * Method getSeg.Returns the contents of the collection in an
- * Array.
Note: Just in case the collection contents are
- * changing in another thread, we pass a 0-length Array of the
- * correct type into the API call. This way we know
- * that the Array returned is of exactly the correct length.
- *
- * @return this collection as an Array
- */
- public uk.ac.vamsas.objects.core.Seg[] getSeg(
- ) {
- uk.ac.vamsas.objects.core.Seg[] array = new uk.ac.vamsas.objects.core.Seg[0];
- return (uk.ac.vamsas.objects.core.Seg[]) this._segList.toArray(array);
- }
-
- /**
- * Method getSegAsReference.Returns a reference to '_segList'.
- * No type checking is performed on any modifications to the
- * Vector.
- *
- * @return a reference to the Vector backing this class
- */
- public java.util.Vector getSegAsReference(
- ) {
- return this._segList;
- }
-
- /**
- * Method getSegCount.
- *
- * @return the size of this collection
- */
- public int getSegCount(
- ) {
- return this._segList.size();
- }
-
- /**
- * Overrides the java.lang.Object.hashCode method.
- *
- * The following steps came from Effective Java Programming
- * Language Guide by Joshua Bloch, Chapter 3
- *
- * @return a hash code value for the object.
- */
- public int hashCode(
- ) {
- int result = super.hashCode();
-
- long tmp;
- if (_choiceValue != null
- && !org.castor.util.CycleBreaker.startingToCycle(_choiceValue)) {
- result = 37 * result + _choiceValue.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_choiceValue);
- }
- if (_posList != null
- && !org.castor.util.CycleBreaker.startingToCycle(_posList)) {
- result = 37 * result + _posList.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_posList);
- }
- if (_segList != null
- && !org.castor.util.CycleBreaker.startingToCycle(_segList)) {
- result = 37 * result + _segList.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_segList);
- }
-
- return result;
- }
-
- /**
- * Method isValid.
- *
- * @return true if this object is valid according to the schema
- */
- public boolean isValid(
- ) {
- try {
- validate();
- } catch (org.exolab.castor.xml.ValidationException vex) {
+ if (this._posList != null) {
+ if (temp._posList == null)
+ return false;
+ if (this._posList != temp._posList) {
+ thcycle = org.castor.util.CycleBreaker.startingToCycle(this._posList);
+ tmcycle = org.castor.util.CycleBreaker.startingToCycle(temp._posList);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._posList);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._posList);
+ }
+ ;
return false;
+ }
+ if (!thcycle) {
+ if (!this._posList.equals(temp._posList)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._posList);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._posList);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._posList);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._posList);
+ }
}
- return true;
- }
-
- /**
- */
- public void removeAllPos(
- ) {
- this._posList.clear();
- }
-
- /**
- */
- public void removeAllSeg(
- ) {
- this._segList.clear();
- }
-
- /**
- * Method removePos.
- *
- * @param vPos
- * @return true if the object was removed from the collection.
- */
- public boolean removePos(
- final uk.ac.vamsas.objects.core.Pos vPos) {
- boolean removed = _posList.remove(vPos);
- return removed;
- }
-
- /**
- * Method removePosAt.
- *
- * @param index
- * @return the element removed from the collection
- */
- public uk.ac.vamsas.objects.core.Pos removePosAt(
- final int index) {
- java.lang.Object obj = this._posList.remove(index);
- return (uk.ac.vamsas.objects.core.Pos) obj;
- }
-
- /**
- * Method removeSeg.
- *
- * @param vSeg
- * @return true if the object was removed from the collection.
- */
- public boolean removeSeg(
- final uk.ac.vamsas.objects.core.Seg vSeg) {
- boolean removed = _segList.remove(vSeg);
- return removed;
- }
-
- /**
- * Method removeSegAt.
- *
- * @param index
- * @return the element removed from the collection
- */
- public uk.ac.vamsas.objects.core.Seg removeSegAt(
- final int index) {
- java.lang.Object obj = this._segList.remove(index);
- return (uk.ac.vamsas.objects.core.Seg) obj;
- }
-
- /**
- *
- *
- * @param index
- * @param vPos
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void setPos(
- final int index,
- final uk.ac.vamsas.objects.core.Pos vPos)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._posList.size()) {
- throw new IndexOutOfBoundsException("setPos: Index value '" + index + "' not in range [0.." + (this._posList.size() - 1) + "]");
- }
-
- this._posList.set(index, vPos);
- }
-
- /**
- *
- *
- * @param vPosArray
- */
- public void setPos(
- final uk.ac.vamsas.objects.core.Pos[] vPosArray) {
- //-- copy array
- _posList.clear();
-
- for (int i = 0; i < vPosArray.length; i++) {
- this._posList.add(vPosArray[i]);
- }
- }
-
- /**
- * Sets the value of '_posList' by copying the given Vector.
- * All elements will be checked for type safety.
- *
- * @param vPosList the Vector to copy.
- */
- public void setPos(
- final java.util.Vector vPosList) {
- // copy vector
- this._posList.clear();
-
- this._posList.addAll(vPosList);
- }
-
- /**
- * Sets the value of '_posList' by setting it to the given
- * Vector. No type checking is performed.
- * @deprecated
- *
- * @param posVector the Vector to set.
- */
- public void setPosAsReference(
- final java.util.Vector posVector) {
- this._posList = posVector;
- }
-
- /**
- *
- *
- * @param index
- * @param vSeg
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void setSeg(
- final int index,
- final uk.ac.vamsas.objects.core.Seg vSeg)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._segList.size()) {
- throw new IndexOutOfBoundsException("setSeg: Index value '" + index + "' not in range [0.." + (this._segList.size() - 1) + "]");
- }
-
- this._segList.set(index, vSeg);
- }
-
- /**
- *
- *
- * @param vSegArray
- */
- public void setSeg(
- final uk.ac.vamsas.objects.core.Seg[] vSegArray) {
- //-- copy array
- _segList.clear();
-
- for (int i = 0; i < vSegArray.length; i++) {
- this._segList.add(vSegArray[i]);
+ } else if (temp._posList != null)
+ return false;
+ if (this._segList != null) {
+ if (temp._segList == null)
+ return false;
+ if (this._segList != temp._segList) {
+ thcycle = org.castor.util.CycleBreaker.startingToCycle(this._segList);
+ tmcycle = org.castor.util.CycleBreaker.startingToCycle(temp._segList);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._segList);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._segList);
+ }
+ ;
+ return false;
+ }
+ if (!thcycle) {
+ if (!this._segList.equals(temp._segList)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._segList);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._segList);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._segList);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._segList);
+ }
}
- }
-
- /**
- * Sets the value of '_segList' by copying the given Vector.
- * All elements will be checked for type safety.
- *
- * @param vSegList the Vector to copy.
- */
- public void setSeg(
- final java.util.Vector vSegList) {
- // copy vector
- this._segList.clear();
-
- this._segList.addAll(vSegList);
- }
-
- /**
- * Sets the value of '_segList' by setting it to the given
- * Vector. No type checking is performed.
- * @deprecated
- *
- * @param segVector the Vector to set.
- */
- public void setSegAsReference(
- final java.util.Vector segVector) {
- this._segList = segVector;
- }
-
- /**
- *
- *
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void validate(
- )
- throws org.exolab.castor.xml.ValidationException {
- org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
- validator.validate(this);
- }
+ } else if (temp._segList != null)
+ return false;
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Returns the value of field 'choiceValue'. The field 'choiceValue' has the
+ * following description: Internal choice value storage
+ *
+ * @return the value of field 'ChoiceValue'.
+ */
+ public java.lang.Object getChoiceValue() {
+ return this._choiceValue;
+ }
+
+ /**
+ * Method getPos.
+ *
+ * @param index
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ * @return the value of the uk.ac.vamsas.objects.core.Pos at the given index
+ */
+ public uk.ac.vamsas.objects.core.Pos getPos(final int index)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._posList.size()) {
+ throw new IndexOutOfBoundsException("getPos: Index value '" + index
+ + "' not in range [0.." + (this._posList.size() - 1) + "]");
+ }
+
+ return (uk.ac.vamsas.objects.core.Pos) _posList.get(index);
+ }
+
+ /**
+ * Method getPos.Returns the contents of the collection in an Array.
+ *
+ * Note: Just in case the collection contents are changing in another thread,
+ * we pass a 0-length Array of the correct type into the API call. This way we
+ * know that the Array returned is of exactly the correct length.
+ *
+ * @return this collection as an Array
+ */
+ public uk.ac.vamsas.objects.core.Pos[] getPos() {
+ uk.ac.vamsas.objects.core.Pos[] array = new uk.ac.vamsas.objects.core.Pos[0];
+ return (uk.ac.vamsas.objects.core.Pos[]) this._posList.toArray(array);
+ }
+
+ /**
+ * Method getPosAsReference.Returns a reference to '_posList'. No type
+ * checking is performed on any modifications to the Vector.
+ *
+ * @return a reference to the Vector backing this class
+ */
+ public java.util.Vector getPosAsReference() {
+ return this._posList;
+ }
+
+ /**
+ * Method getPosCount.
+ *
+ * @return the size of this collection
+ */
+ public int getPosCount() {
+ return this._posList.size();
+ }
+
+ /**
+ * Method getSeg.
+ *
+ * @param index
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ * @return the value of the uk.ac.vamsas.objects.core.Seg at the given index
+ */
+ public uk.ac.vamsas.objects.core.Seg getSeg(final int index)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._segList.size()) {
+ throw new IndexOutOfBoundsException("getSeg: Index value '" + index
+ + "' not in range [0.." + (this._segList.size() - 1) + "]");
+ }
+
+ return (uk.ac.vamsas.objects.core.Seg) _segList.get(index);
+ }
+
+ /**
+ * Method getSeg.Returns the contents of the collection in an Array.
+ *
+ * Note: Just in case the collection contents are changing in another thread,
+ * we pass a 0-length Array of the correct type into the API call. This way we
+ * know that the Array returned is of exactly the correct length.
+ *
+ * @return this collection as an Array
+ */
+ public uk.ac.vamsas.objects.core.Seg[] getSeg() {
+ uk.ac.vamsas.objects.core.Seg[] array = new uk.ac.vamsas.objects.core.Seg[0];
+ return (uk.ac.vamsas.objects.core.Seg[]) this._segList.toArray(array);
+ }
+
+ /**
+ * Method getSegAsReference.Returns a reference to '_segList'. No type
+ * checking is performed on any modifications to the Vector.
+ *
+ * @return a reference to the Vector backing this class
+ */
+ public java.util.Vector getSegAsReference() {
+ return this._segList;
+ }
+
+ /**
+ * Method getSegCount.
+ *
+ * @return the size of this collection
+ */
+ public int getSegCount() {
+ return this._segList.size();
+ }
+
+ /**
+ * Overrides the java.lang.Object.hashCode method.
+ *
+ * The following steps came from Effective Java Programming Language
+ * Guide by Joshua Bloch, Chapter 3
+ *
+ * @return a hash code value for the object.
+ */
+ public int hashCode() {
+ int result = super.hashCode();
+
+ long tmp;
+ if (_choiceValue != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_choiceValue)) {
+ result = 37 * result + _choiceValue.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_choiceValue);
+ }
+ if (_posList != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_posList)) {
+ result = 37 * result + _posList.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_posList);
+ }
+ if (_segList != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_segList)) {
+ result = 37 * result + _segList.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_segList);
+ }
+
+ return result;
+ }
+
+ /**
+ * Method isValid.
+ *
+ * @return true if this object is valid according to the schema
+ */
+ public boolean isValid() {
+ try {
+ validate();
+ } catch (org.exolab.castor.xml.ValidationException vex) {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ */
+ public void removeAllPos() {
+ this._posList.clear();
+ }
+
+ /**
+ */
+ public void removeAllSeg() {
+ this._segList.clear();
+ }
+
+ /**
+ * Method removePos.
+ *
+ * @param vPos
+ * @return true if the object was removed from the collection.
+ */
+ public boolean removePos(final uk.ac.vamsas.objects.core.Pos vPos) {
+ boolean removed = _posList.remove(vPos);
+ return removed;
+ }
+
+ /**
+ * Method removePosAt.
+ *
+ * @param index
+ * @return the element removed from the collection
+ */
+ public uk.ac.vamsas.objects.core.Pos removePosAt(final int index) {
+ java.lang.Object obj = this._posList.remove(index);
+ return (uk.ac.vamsas.objects.core.Pos) obj;
+ }
+
+ /**
+ * Method removeSeg.
+ *
+ * @param vSeg
+ * @return true if the object was removed from the collection.
+ */
+ public boolean removeSeg(final uk.ac.vamsas.objects.core.Seg vSeg) {
+ boolean removed = _segList.remove(vSeg);
+ return removed;
+ }
+
+ /**
+ * Method removeSegAt.
+ *
+ * @param index
+ * @return the element removed from the collection
+ */
+ public uk.ac.vamsas.objects.core.Seg removeSegAt(final int index) {
+ java.lang.Object obj = this._segList.remove(index);
+ return (uk.ac.vamsas.objects.core.Seg) obj;
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vPos
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void setPos(final int index, final uk.ac.vamsas.objects.core.Pos vPos)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._posList.size()) {
+ throw new IndexOutOfBoundsException("setPos: Index value '" + index
+ + "' not in range [0.." + (this._posList.size() - 1) + "]");
+ }
+
+ this._posList.set(index, vPos);
+ }
+
+ /**
+ *
+ *
+ * @param vPosArray
+ */
+ public void setPos(final uk.ac.vamsas.objects.core.Pos[] vPosArray) {
+ // -- copy array
+ _posList.clear();
+
+ for (int i = 0; i < vPosArray.length; i++) {
+ this._posList.add(vPosArray[i]);
+ }
+ }
+
+ /**
+ * Sets the value of '_posList' by copying the given Vector. All elements will
+ * be checked for type safety.
+ *
+ * @param vPosList
+ * the Vector to copy.
+ */
+ public void setPos(final java.util.Vector vPosList) {
+ // copy vector
+ this._posList.clear();
+
+ this._posList.addAll(vPosList);
+ }
+
+ /**
+ * Sets the value of '_posList' by setting it to the given Vector. No type
+ * checking is performed.
+ *
+ * @deprecated
+ *
+ * @param posVector
+ * the Vector to set.
+ */
+ public void setPosAsReference(final java.util.Vector posVector) {
+ this._posList = posVector;
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vSeg
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void setSeg(final int index, final uk.ac.vamsas.objects.core.Seg vSeg)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._segList.size()) {
+ throw new IndexOutOfBoundsException("setSeg: Index value '" + index
+ + "' not in range [0.." + (this._segList.size() - 1) + "]");
+ }
+
+ this._segList.set(index, vSeg);
+ }
+
+ /**
+ *
+ *
+ * @param vSegArray
+ */
+ public void setSeg(final uk.ac.vamsas.objects.core.Seg[] vSegArray) {
+ // -- copy array
+ _segList.clear();
+
+ for (int i = 0; i < vSegArray.length; i++) {
+ this._segList.add(vSegArray[i]);
+ }
+ }
+
+ /**
+ * Sets the value of '_segList' by copying the given Vector. All elements will
+ * be checked for type safety.
+ *
+ * @param vSegList
+ * the Vector to copy.
+ */
+ public void setSeg(final java.util.Vector vSegList) {
+ // copy vector
+ this._segList.clear();
+
+ this._segList.addAll(vSegList);
+ }
+
+ /**
+ * Sets the value of '_segList' by setting it to the given Vector. No type
+ * checking is performed.
+ *
+ * @deprecated
+ *
+ * @param segVector
+ * the Vector to set.
+ */
+ public void setSegAsReference(final java.util.Vector segVector) {
+ this._segList = segVector;
+ }
+
+ /**
+ *
+ *
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void validate() throws org.exolab.castor.xml.ValidationException {
+ org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+ validator.validate(this);
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/ReferenceType.java b/src/uk/ac/vamsas/objects/core/ReferenceType.java
index 6c06137..e6a98da 100644
--- a/src/uk/ac/vamsas/objects/core/ReferenceType.java
+++ b/src/uk/ac/vamsas/objects/core/ReferenceType.java
@@ -1,499 +1,510 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import org.exolab.castor.xml.Marshaller;
import org.exolab.castor.xml.Unmarshaller;
/**
- * base type for citing arbitrary links between vamsas objects
- * Optional human readable description of the relationship
- *
+ * base type for citing arbitrary links between vamsas objects Optional human
+ * readable description of the relationship
+ *
*
* @version $Revision$ $Date$
*/
-public class ReferenceType extends uk.ac.vamsas.client.Vobject
-implements java.io.Serializable
-{
-
-
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
- * internal content storage
- */
- private java.lang.String _content = "";
-
- /**
- * Primary Key for vamsas object referencing
- *
- */
- private java.lang.String _id;
-
- /**
- * List of one or more vamsas object
- * references
- */
- private java.util.Vector _refs;
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public ReferenceType() {
- super();
- setContent("");
- this._refs = new java.util.Vector();
- }
-
-
- //-----------/
- //- Methods -/
- //-----------/
-
- /**
- *
- *
- * @param vRefs
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addRefs(
- final java.lang.Object vRefs)
- throws java.lang.IndexOutOfBoundsException {
- this._refs.addElement(vRefs);
- }
-
- /**
- *
- *
- * @param index
- * @param vRefs
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addRefs(
- final int index,
- final java.lang.Object vRefs)
- throws java.lang.IndexOutOfBoundsException {
- this._refs.add(index, vRefs);
- }
-
- /**
- * Method enumerateRefs.
- *
- * @return an Enumeration over all java.lang.Object elements
- */
- public java.util.Enumeration enumerateRefs(
- ) {
- return this._refs.elements();
- }
-
- /**
- * Overrides the java.lang.Object.equals method.
- *
- * @param obj
- * @return true if the objects are equal.
- */
- public boolean equals(
- final java.lang.Object obj) {
- if ( this == obj )
- return true;
-
- if (super.equals(obj)==false)
+public class ReferenceType extends uk.ac.vamsas.client.Vobject implements
+ java.io.Serializable {
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * internal content storage
+ */
+ private java.lang.String _content = "";
+
+ /**
+ * Primary Key for vamsas object referencing
+ *
+ */
+ private java.lang.String _id;
+
+ /**
+ * List of one or more vamsas object references
+ */
+ private java.util.Vector _refs;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public ReferenceType() {
+ super();
+ setContent("");
+ this._refs = new java.util.Vector();
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ *
+ *
+ * @param vRefs
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addRefs(final java.lang.Object vRefs)
+ throws java.lang.IndexOutOfBoundsException {
+ this._refs.addElement(vRefs);
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vRefs
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addRefs(final int index, final java.lang.Object vRefs)
+ throws java.lang.IndexOutOfBoundsException {
+ this._refs.add(index, vRefs);
+ }
+
+ /**
+ * Method enumerateRefs.
+ *
+ * @return an Enumeration over all java.lang.Object elements
+ */
+ public java.util.Enumeration enumerateRefs() {
+ return this._refs.elements();
+ }
+
+ /**
+ * Overrides the java.lang.Object.equals method.
+ *
+ * @param obj
+ * @return true if the objects are equal.
+ */
+ public boolean equals(final java.lang.Object obj) {
+ if (this == obj)
+ return true;
+
+ if (super.equals(obj) == false)
+ return false;
+
+ if (obj instanceof ReferenceType) {
+
+ ReferenceType temp = (ReferenceType) obj;
+ boolean thcycle;
+ boolean tmcycle;
+ if (this._content != null) {
+ if (temp._content == null)
+ return false;
+ if (this._content != temp._content) {
+ thcycle = org.castor.util.CycleBreaker.startingToCycle(this._content);
+ tmcycle = org.castor.util.CycleBreaker.startingToCycle(temp._content);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._content);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._content);
+ }
+ ;
return false;
-
- if (obj instanceof ReferenceType) {
-
- ReferenceType temp = (ReferenceType)obj;
- boolean thcycle;
- boolean tmcycle;
- if (this._content != null) {
- if (temp._content == null) return false;
- if (this._content != temp._content) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._content);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._content);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._content); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._content); };
- return false;
- }
- if (!thcycle) {
- if (!this._content.equals(temp._content)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._content);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._content);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._content);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._content);
- }
- }
- } else if (temp._content != null)
- return false;
- if (this._id != null) {
- if (temp._id == null) return false;
- if (this._id != temp._id) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._id);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._id);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._id); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._id); };
- return false;
- }
- if (!thcycle) {
- if (!this._id.equals(temp._id)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
- }
- }
- } else if (temp._id != null)
- return false;
- if (this._refs != null) {
- if (temp._refs == null) return false;
- if (this._refs != temp._refs) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._refs);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._refs);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._refs); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._refs); };
- return false;
- }
- if (!thcycle) {
- if (!this._refs.equals(temp._refs)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._refs);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._refs);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._refs);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._refs);
- }
- }
- } else if (temp._refs != null)
- return false;
- return true;
+ }
+ if (!thcycle) {
+ if (!this._content.equals(temp._content)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._content);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._content);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._content);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._content);
+ }
}
+ } else if (temp._content != null)
return false;
- }
-
- /**
- * Returns the value of field 'content'. The field 'content'
- * has the following description: internal content storage
- *
- * @return the value of field 'Content'.
- */
- public java.lang.String getContent(
- ) {
- return this._content;
- }
-
- /**
- * Returns the value of field 'id'. The field 'id' has the
- * following description: Primary Key for vamsas object
- * referencing
- *
- *
- * @return the value of field 'Id'.
- */
- public java.lang.String getId(
- ) {
- return this._id;
- }
-
- /**
- * Method getRefs.
- *
- * @param index
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- * @return the value of the java.lang.Object at the given index
- */
- public java.lang.Object getRefs(
- final int index)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._refs.size()) {
- throw new IndexOutOfBoundsException("getRefs: Index value '" + index + "' not in range [0.." + (this._refs.size() - 1) + "]");
- }
-
- return _refs.get(index);
- }
-
- /**
- * Method getRefs.Returns the contents of the collection in an
- * Array.
Note: Just in case the collection contents are
- * changing in another thread, we pass a 0-length Array of the
- * correct type into the API call. This way we know
- * that the Array returned is of exactly the correct length.
- *
- * @return this collection as an Array
- */
- public java.lang.Object[] getRefs(
- ) {
- java.lang.Object[] array = new java.lang.Object[0];
- return (java.lang.Object[]) this._refs.toArray(array);
- }
-
- /**
- * Method getRefsAsReference.Returns a reference to '_refs'. No
- * type checking is performed on any modifications to the
- * Vector.
- *
- * @return a reference to the Vector backing this class
- */
- public java.util.Vector getRefsAsReference(
- ) {
- return this._refs;
- }
-
- /**
- * Method getRefsCount.
- *
- * @return the size of this collection
- */
- public int getRefsCount(
- ) {
- return this._refs.size();
- }
-
- /**
- * Overrides the java.lang.Object.hashCode method.
- *
- * The following steps came from Effective Java Programming
- * Language Guide by Joshua Bloch, Chapter 3
- *
- * @return a hash code value for the object.
- */
- public int hashCode(
- ) {
- int result = super.hashCode();
-
- long tmp;
- if (_content != null
- && !org.castor.util.CycleBreaker.startingToCycle(_content)) {
- result = 37 * result + _content.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_content);
- }
- if (_id != null
- && !org.castor.util.CycleBreaker.startingToCycle(_id)) {
- result = 37 * result + _id.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_id);
- }
- if (_refs != null
- && !org.castor.util.CycleBreaker.startingToCycle(_refs)) {
- result = 37 * result + _refs.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_refs);
+ if (this._id != null) {
+ if (temp._id == null)
+ return false;
+ if (this._id != temp._id) {
+ thcycle = org.castor.util.CycleBreaker.startingToCycle(this._id);
+ tmcycle = org.castor.util.CycleBreaker.startingToCycle(temp._id);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
+ }
+ ;
+ return false;
+ }
+ if (!thcycle) {
+ if (!this._id.equals(temp._id)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
+ }
}
-
- return result;
- }
-
- /**
- * Method isValid.
- *
- * @return true if this object is valid according to the schema
- */
- public boolean isValid(
- ) {
- try {
- validate();
- } catch (org.exolab.castor.xml.ValidationException vex) {
+ } else if (temp._id != null)
+ return false;
+ if (this._refs != null) {
+ if (temp._refs == null)
+ return false;
+ if (this._refs != temp._refs) {
+ thcycle = org.castor.util.CycleBreaker.startingToCycle(this._refs);
+ tmcycle = org.castor.util.CycleBreaker.startingToCycle(temp._refs);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._refs);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._refs);
+ }
+ ;
return false;
+ }
+ if (!thcycle) {
+ if (!this._refs.equals(temp._refs)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._refs);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._refs);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._refs);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._refs);
+ }
}
- return true;
- }
-
- /**
- *
- *
- * @param out
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void marshal(
- final java.io.Writer out)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, out);
- }
-
- /**
- *
- *
- * @param handler
- * @throws java.io.IOException if an IOException occurs during
- * marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- */
- public void marshal(
- final org.xml.sax.ContentHandler handler)
- throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, handler);
- }
-
- /**
- */
- public void removeAllRefs(
- ) {
- this._refs.clear();
+ } else if (temp._refs != null)
+ return false;
+ return true;
}
-
- /**
- * Method removeRefs.
- *
- * @param vRefs
- * @return true if the object was removed from the collection.
- */
- public boolean removeRefs(
- final java.lang.Object vRefs) {
- boolean removed = _refs.remove(vRefs);
- return removed;
+ return false;
+ }
+
+ /**
+ * Returns the value of field 'content'. The field 'content' has the following
+ * description: internal content storage
+ *
+ * @return the value of field 'Content'.
+ */
+ public java.lang.String getContent() {
+ return this._content;
+ }
+
+ /**
+ * Returns the value of field 'id'. The field 'id' has the following
+ * description: Primary Key for vamsas object referencing
+ *
+ *
+ * @return the value of field 'Id'.
+ */
+ public java.lang.String getId() {
+ return this._id;
+ }
+
+ /**
+ * Method getRefs.
+ *
+ * @param index
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ * @return the value of the java.lang.Object at the given index
+ */
+ public java.lang.Object getRefs(final int index)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._refs.size()) {
+ throw new IndexOutOfBoundsException("getRefs: Index value '" + index
+ + "' not in range [0.." + (this._refs.size() - 1) + "]");
}
- /**
- * Method removeRefsAt.
- *
- * @param index
- * @return the element removed from the collection
- */
- public java.lang.Object removeRefsAt(
- final int index) {
- java.lang.Object obj = this._refs.remove(index);
- return obj;
+ return _refs.get(index);
+ }
+
+ /**
+ * Method getRefs.Returns the contents of the collection in an Array.
+ *
+ * Note: Just in case the collection contents are changing in another thread,
+ * we pass a 0-length Array of the correct type into the API call. This way we
+ * know that the Array returned is of exactly the correct length.
+ *
+ * @return this collection as an Array
+ */
+ public java.lang.Object[] getRefs() {
+ java.lang.Object[] array = new java.lang.Object[0];
+ return (java.lang.Object[]) this._refs.toArray(array);
+ }
+
+ /**
+ * Method getRefsAsReference.Returns a reference to '_refs'. No type checking
+ * is performed on any modifications to the Vector.
+ *
+ * @return a reference to the Vector backing this class
+ */
+ public java.util.Vector getRefsAsReference() {
+ return this._refs;
+ }
+
+ /**
+ * Method getRefsCount.
+ *
+ * @return the size of this collection
+ */
+ public int getRefsCount() {
+ return this._refs.size();
+ }
+
+ /**
+ * Overrides the java.lang.Object.hashCode method.
+ *
+ * The following steps came from Effective Java Programming Language
+ * Guide by Joshua Bloch, Chapter 3
+ *
+ * @return a hash code value for the object.
+ */
+ public int hashCode() {
+ int result = super.hashCode();
+
+ long tmp;
+ if (_content != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_content)) {
+ result = 37 * result + _content.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_content);
}
-
- /**
- * Sets the value of field 'content'. The field 'content' has
- * the following description: internal content storage
- *
- * @param content the value of field 'content'.
- */
- public void setContent(
- final java.lang.String content) {
- this._content = content;
- }
-
- /**
- * Sets the value of field 'id'. The field 'id' has the
- * following description: Primary Key for vamsas object
- * referencing
- *
- *
- * @param id the value of field 'id'.
- */
- public void setId(
- final java.lang.String id) {
- this._id = id;
+ if (_id != null && !org.castor.util.CycleBreaker.startingToCycle(_id)) {
+ result = 37 * result + _id.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_id);
}
-
- /**
- *
- *
- * @param index
- * @param vRefs
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void setRefs(
- final int index,
- final java.lang.Object vRefs)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._refs.size()) {
- throw new IndexOutOfBoundsException("setRefs: Index value '" + index + "' not in range [0.." + (this._refs.size() - 1) + "]");
- }
-
- this._refs.set(index, vRefs);
+ if (_refs != null && !org.castor.util.CycleBreaker.startingToCycle(_refs)) {
+ result = 37 * result + _refs.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_refs);
}
- /**
- *
- *
- * @param vRefsArray
- */
- public void setRefs(
- final java.lang.Object[] vRefsArray) {
- //-- copy array
- _refs.clear();
-
- for (int i = 0; i < vRefsArray.length; i++) {
- this._refs.add(vRefsArray[i]);
- }
+ return result;
+ }
+
+ /**
+ * Method isValid.
+ *
+ * @return true if this object is valid according to the schema
+ */
+ public boolean isValid() {
+ try {
+ validate();
+ } catch (org.exolab.castor.xml.ValidationException vex) {
+ return false;
}
-
- /**
- * Sets the value of '_refs' by copying the given Vector. All
- * elements will be checked for type safety.
- *
- * @param vRefsList the Vector to copy.
+ return true;
+ }
+
+ /**
+ *
+ *
+ * @param out
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void marshal(final java.io.Writer out)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, out);
+ }
+
+ /**
+ *
+ *
+ * @param handler
+ * @throws java.io.IOException
+ * if an IOException occurs during marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ */
+ public void marshal(final org.xml.sax.ContentHandler handler)
+ throws java.io.IOException, org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, handler);
+ }
+
+ /**
*/
- public void setRefs(
- final java.util.Vector vRefsList) {
- // copy vector
- this._refs.clear();
-
- this._refs.addAll(vRefsList);
+ public void removeAllRefs() {
+ this._refs.clear();
+ }
+
+ /**
+ * Method removeRefs.
+ *
+ * @param vRefs
+ * @return true if the object was removed from the collection.
+ */
+ public boolean removeRefs(final java.lang.Object vRefs) {
+ boolean removed = _refs.remove(vRefs);
+ return removed;
+ }
+
+ /**
+ * Method removeRefsAt.
+ *
+ * @param index
+ * @return the element removed from the collection
+ */
+ public java.lang.Object removeRefsAt(final int index) {
+ java.lang.Object obj = this._refs.remove(index);
+ return obj;
+ }
+
+ /**
+ * Sets the value of field 'content'. The field 'content' has the following
+ * description: internal content storage
+ *
+ * @param content
+ * the value of field 'content'.
+ */
+ public void setContent(final java.lang.String content) {
+ this._content = content;
+ }
+
+ /**
+ * Sets the value of field 'id'. The field 'id' has the following description:
+ * Primary Key for vamsas object referencing
+ *
+ *
+ * @param id
+ * the value of field 'id'.
+ */
+ public void setId(final java.lang.String id) {
+ this._id = id;
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vRefs
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void setRefs(final int index, final java.lang.Object vRefs)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._refs.size()) {
+ throw new IndexOutOfBoundsException("setRefs: Index value '" + index
+ + "' not in range [0.." + (this._refs.size() - 1) + "]");
}
- /**
- * Sets the value of '_refs' by setting it to the given Vector.
- * No type checking is performed.
- * @deprecated
- *
- * @param refsVector the Vector to set.
- */
- public void setRefsAsReference(
- final java.util.Vector refsVector) {
- this._refs = refsVector;
- }
+ this._refs.set(index, vRefs);
+ }
- /**
- * Method unmarshal.
- *
- * @param reader
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @return the unmarshaled
- * uk.ac.vamsas.objects.core.ReferenceType
- */
- public static uk.ac.vamsas.objects.core.ReferenceType unmarshal(
- final java.io.Reader reader)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- return (uk.ac.vamsas.objects.core.ReferenceType) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.ReferenceType.class, reader);
- }
+ /**
+ *
+ *
+ * @param vRefsArray
+ */
+ public void setRefs(final java.lang.Object[] vRefsArray) {
+ // -- copy array
+ _refs.clear();
- /**
- *
- *
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void validate(
- )
- throws org.exolab.castor.xml.ValidationException {
- org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
- validator.validate(this);
+ for (int i = 0; i < vRefsArray.length; i++) {
+ this._refs.add(vRefsArray[i]);
}
+ }
+
+ /**
+ * Sets the value of '_refs' by copying the given Vector. All elements will be
+ * checked for type safety.
+ *
+ * @param vRefsList
+ * the Vector to copy.
+ */
+ public void setRefs(final java.util.Vector vRefsList) {
+ // copy vector
+ this._refs.clear();
+
+ this._refs.addAll(vRefsList);
+ }
+
+ /**
+ * Sets the value of '_refs' by setting it to the given Vector. No type
+ * checking is performed.
+ *
+ * @deprecated
+ *
+ * @param refsVector
+ * the Vector to set.
+ */
+ public void setRefsAsReference(final java.util.Vector refsVector) {
+ this._refs = refsVector;
+ }
+
+ /**
+ * Method unmarshal.
+ *
+ * @param reader
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @return the unmarshaled uk.ac.vamsas.objects.core.ReferenceType
+ */
+ public static uk.ac.vamsas.objects.core.ReferenceType unmarshal(
+ final java.io.Reader reader)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ return (uk.ac.vamsas.objects.core.ReferenceType) Unmarshaller.unmarshal(
+ uk.ac.vamsas.objects.core.ReferenceType.class, reader);
+ }
+
+ /**
+ *
+ *
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void validate() throws org.exolab.castor.xml.ValidationException {
+ org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+ validator.validate(this);
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/Score.java b/src/uk/ac/vamsas/objects/core/Score.java
index 357deb2..bf0ce88 100644
--- a/src/uk/ac/vamsas/objects/core/Score.java
+++ b/src/uk/ac/vamsas/objects/core/Score.java
@@ -1,271 +1,282 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import org.exolab.castor.xml.Marshaller;
import org.exolab.castor.xml.Unmarshaller;
/**
- * Ordered set of optionally named float values for the
- * whole annotation
+ * Ordered set of optionally named float values for the whole annotation
*
* @version $Revision$ $Date$
*/
-public class Score extends uk.ac.vamsas.client.Vobject
-implements java.io.Serializable
-{
+public class Score extends uk.ac.vamsas.client.Vobject implements
+ java.io.Serializable {
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
+ /**
+ * internal content storage
+ */
+ private float _content;
- /**
- * internal content storage
- */
- private float _content;
+ /**
+ * keeps track of state for field: _content
+ */
+ private boolean _has_content;
- /**
- * keeps track of state for field: _content
- */
- private boolean _has_content;
+ /**
+ * Field _name.
+ */
+ private java.lang.String _name = "score";
- /**
- * Field _name.
- */
- private java.lang.String _name = "score";
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+ public Score() {
+ super();
+ setName("score");
+ }
- //----------------/
- //- Constructors -/
- //----------------/
+ // -----------/
+ // - Methods -/
+ // -----------/
- public Score() {
- super();
- setName("score");
- }
+ /**
+ */
+ public void deleteContent() {
+ this._has_content = false;
+ }
+ /**
+ * Overrides the java.lang.Object.equals method.
+ *
+ * @param obj
+ * @return true if the objects are equal.
+ */
+ public boolean equals(final java.lang.Object obj) {
+ if (this == obj)
+ return true;
- //-----------/
- //- Methods -/
- //-----------/
+ if (super.equals(obj) == false)
+ return false;
- /**
- */
- public void deleteContent(
- ) {
- this._has_content= false;
- }
+ if (obj instanceof Score) {
- /**
- * Overrides the java.lang.Object.equals method.
- *
- * @param obj
- * @return true if the objects are equal.
- */
- public boolean equals(
- final java.lang.Object obj) {
- if ( this == obj )
- return true;
-
- if (super.equals(obj)==false)
+ Score temp = (Score) obj;
+ boolean thcycle;
+ boolean tmcycle;
+ if (this._content != temp._content)
+ return false;
+ if (this._has_content != temp._has_content)
+ return false;
+ if (this._name != null) {
+ if (temp._name == null)
+ return false;
+ if (this._name != temp._name) {
+ thcycle = org.castor.util.CycleBreaker.startingToCycle(this._name);
+ tmcycle = org.castor.util.CycleBreaker.startingToCycle(temp._name);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._name);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._name);
+ }
+ ;
return false;
-
- if (obj instanceof Score) {
-
- Score temp = (Score)obj;
- boolean thcycle;
- boolean tmcycle;
- if (this._content != temp._content)
- return false;
- if (this._has_content != temp._has_content)
- return false;
- if (this._name != null) {
- if (temp._name == null) return false;
- if (this._name != temp._name) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._name);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._name);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._name); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._name); };
- return false;
- }
- if (!thcycle) {
- if (!this._name.equals(temp._name)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._name);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._name);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._name);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._name);
- }
- }
- } else if (temp._name != null)
- return false;
- return true;
+ }
+ if (!thcycle) {
+ if (!this._name.equals(temp._name)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._name);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._name);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._name);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._name);
+ }
}
+ } else if (temp._name != null)
return false;
+ return true;
}
+ return false;
+ }
- /**
- * Returns the value of field 'content'. The field 'content'
- * has the following description: internal content storage
- *
- * @return the value of field 'Content'.
- */
- public float getContent(
- ) {
- return this._content;
- }
+ /**
+ * Returns the value of field 'content'. The field 'content' has the following
+ * description: internal content storage
+ *
+ * @return the value of field 'Content'.
+ */
+ public float getContent() {
+ return this._content;
+ }
- /**
- * Returns the value of field 'name'.
- *
- * @return the value of field 'Name'.
- */
- public java.lang.String getName(
- ) {
- return this._name;
- }
+ /**
+ * Returns the value of field 'name'.
+ *
+ * @return the value of field 'Name'.
+ */
+ public java.lang.String getName() {
+ return this._name;
+ }
- /**
- * Method hasContent.
- *
- * @return true if at least one Content has been added
- */
- public boolean hasContent(
- ) {
- return this._has_content;
- }
+ /**
+ * Method hasContent.
+ *
+ * @return true if at least one Content has been added
+ */
+ public boolean hasContent() {
+ return this._has_content;
+ }
- /**
- * Overrides the java.lang.Object.hashCode method.
- *
- * The following steps came from Effective Java Programming
- * Language Guide by Joshua Bloch, Chapter 3
- *
- * @return a hash code value for the object.
- */
- public int hashCode(
- ) {
- int result = super.hashCode();
-
- long tmp;
- result = 37 * result + java.lang.Float.floatToIntBits(_content);
- if (_name != null
- && !org.castor.util.CycleBreaker.startingToCycle(_name)) {
- result = 37 * result + _name.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_name);
- }
-
- return result;
- }
+ /**
+ * Overrides the java.lang.Object.hashCode method.
+ *
+ * The following steps came from Effective Java Programming Language
+ * Guide by Joshua Bloch, Chapter 3
+ *
+ * @return a hash code value for the object.
+ */
+ public int hashCode() {
+ int result = super.hashCode();
- /**
- * Method isValid.
- *
- * @return true if this object is valid according to the schema
- */
- public boolean isValid(
- ) {
- try {
- validate();
- } catch (org.exolab.castor.xml.ValidationException vex) {
- return false;
- }
- return true;
+ long tmp;
+ result = 37 * result + java.lang.Float.floatToIntBits(_content);
+ if (_name != null && !org.castor.util.CycleBreaker.startingToCycle(_name)) {
+ result = 37 * result + _name.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_name);
}
- /**
- *
- *
- * @param out
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void marshal(
- final java.io.Writer out)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, out);
- }
+ return result;
+ }
- /**
- *
- *
- * @param handler
- * @throws java.io.IOException if an IOException occurs during
- * marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- */
- public void marshal(
- final org.xml.sax.ContentHandler handler)
- throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, handler);
+ /**
+ * Method isValid.
+ *
+ * @return true if this object is valid according to the schema
+ */
+ public boolean isValid() {
+ try {
+ validate();
+ } catch (org.exolab.castor.xml.ValidationException vex) {
+ return false;
}
+ return true;
+ }
- /**
- * Sets the value of field 'content'. The field 'content' has
- * the following description: internal content storage
- *
- * @param content the value of field 'content'.
- */
- public void setContent(
- final float content) {
- this._content = content;
- this._has_content = true;
- }
+ /**
+ *
+ *
+ * @param out
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void marshal(final java.io.Writer out)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, out);
+ }
- /**
- * Sets the value of field 'name'.
- *
- * @param name the value of field 'name'.
- */
- public void setName(
- final java.lang.String name) {
- this._name = name;
- }
+ /**
+ *
+ *
+ * @param handler
+ * @throws java.io.IOException
+ * if an IOException occurs during marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ */
+ public void marshal(final org.xml.sax.ContentHandler handler)
+ throws java.io.IOException, org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, handler);
+ }
- /**
- * Method unmarshal.
- *
- * @param reader
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @return the unmarshaled uk.ac.vamsas.objects.core.Score
- */
- public static uk.ac.vamsas.objects.core.Score unmarshal(
- final java.io.Reader reader)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- return (uk.ac.vamsas.objects.core.Score) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Score.class, reader);
- }
+ /**
+ * Sets the value of field 'content'. The field 'content' has the following
+ * description: internal content storage
+ *
+ * @param content
+ * the value of field 'content'.
+ */
+ public void setContent(final float content) {
+ this._content = content;
+ this._has_content = true;
+ }
- /**
- *
- *
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void validate(
- )
- throws org.exolab.castor.xml.ValidationException {
- org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
- validator.validate(this);
- }
+ /**
+ * Sets the value of field 'name'.
+ *
+ * @param name
+ * the value of field 'name'.
+ */
+ public void setName(final java.lang.String name) {
+ this._name = name;
+ }
+
+ /**
+ * Method unmarshal.
+ *
+ * @param reader
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @return the unmarshaled uk.ac.vamsas.objects.core.Score
+ */
+ public static uk.ac.vamsas.objects.core.Score unmarshal(
+ final java.io.Reader reader)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ return (uk.ac.vamsas.objects.core.Score) Unmarshaller.unmarshal(
+ uk.ac.vamsas.objects.core.Score.class, reader);
+ }
+
+ /**
+ *
+ *
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void validate() throws org.exolab.castor.xml.ValidationException {
+ org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+ validator.validate(this);
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/Seg.java b/src/uk/ac/vamsas/objects/core/Seg.java
index 5174b80..5ad851d 100644
--- a/src/uk/ac/vamsas/objects/core/Seg.java
+++ b/src/uk/ac/vamsas/objects/core/Seg.java
@@ -1,350 +1,342 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import org.exolab.castor.xml.Marshaller;
import org.exolab.castor.xml.Unmarshaller;
/**
- * a region from start to end, with flag for inclusivity of
- * terminii
+ * a region from start to end, with flag for inclusivity of terminii
*
* @version $Revision$ $Date$
*/
-public class Seg extends uk.ac.vamsas.client.Vobject
-implements java.io.Serializable
-{
-
-
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
- * Field _start.
- */
- private int _start;
-
- /**
- * keeps track of state for field: _start
- */
- private boolean _has_start;
-
- /**
- * Field _end.
- */
- private int _end;
-
- /**
- * keeps track of state for field: _end
- */
- private boolean _has_end;
-
- /**
- * when false, a consecutive range like 'start=1, end=2'
- * means the region lying after position 1 and before position
- * 2
- *
- */
- private boolean _inclusive;
-
- /**
- * keeps track of state for field: _inclusive
- */
- private boolean _has_inclusive;
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public Seg() {
- super();
- }
-
-
- //-----------/
- //- Methods -/
- //-----------/
-
- /**
+public class Seg extends uk.ac.vamsas.client.Vobject implements
+ java.io.Serializable {
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * Field _start.
+ */
+ private int _start;
+
+ /**
+ * keeps track of state for field: _start
+ */
+ private boolean _has_start;
+
+ /**
+ * Field _end.
+ */
+ private int _end;
+
+ /**
+ * keeps track of state for field: _end
+ */
+ private boolean _has_end;
+
+ /**
+ * when false, a consecutive range like 'start=1, end=2' means the region
+ * lying after position 1 and before position 2
+ *
+ */
+ private boolean _inclusive;
+
+ /**
+ * keeps track of state for field: _inclusive
+ */
+ private boolean _has_inclusive;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public Seg() {
+ super();
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
*/
- public void deleteEnd(
- ) {
- this._has_end= false;
- }
+ public void deleteEnd() {
+ this._has_end = false;
+ }
- /**
+ /**
*/
- public void deleteInclusive(
- ) {
- this._has_inclusive= false;
- }
+ public void deleteInclusive() {
+ this._has_inclusive = false;
+ }
- /**
+ /**
*/
- public void deleteStart(
- ) {
- this._has_start= false;
- }
-
- /**
- * Overrides the java.lang.Object.equals method.
- *
- * @param obj
- * @return true if the objects are equal.
- */
- public boolean equals(
- final java.lang.Object obj) {
- if ( this == obj )
- return true;
-
- if (super.equals(obj)==false)
- return false;
-
- if (obj instanceof Seg) {
-
- Seg temp = (Seg)obj;
- boolean thcycle;
- boolean tmcycle;
- if (this._start != temp._start)
- return false;
- if (this._has_start != temp._has_start)
- return false;
- if (this._end != temp._end)
- return false;
- if (this._has_end != temp._has_end)
- return false;
- if (this._inclusive != temp._inclusive)
- return false;
- if (this._has_inclusive != temp._has_inclusive)
- return false;
- return true;
- }
+ public void deleteStart() {
+ this._has_start = false;
+ }
+
+ /**
+ * Overrides the java.lang.Object.equals method.
+ *
+ * @param obj
+ * @return true if the objects are equal.
+ */
+ public boolean equals(final java.lang.Object obj) {
+ if (this == obj)
+ return true;
+
+ if (super.equals(obj) == false)
+ return false;
+
+ if (obj instanceof Seg) {
+
+ Seg temp = (Seg) obj;
+ boolean thcycle;
+ boolean tmcycle;
+ if (this._start != temp._start)
return false;
+ if (this._has_start != temp._has_start)
+ return false;
+ if (this._end != temp._end)
+ return false;
+ if (this._has_end != temp._has_end)
+ return false;
+ if (this._inclusive != temp._inclusive)
+ return false;
+ if (this._has_inclusive != temp._has_inclusive)
+ return false;
+ return true;
}
-
- /**
- * Returns the value of field 'end'.
- *
- * @return the value of field 'End'.
- */
- public int getEnd(
- ) {
- return this._end;
- }
-
- /**
- * Returns the value of field 'inclusive'. The field
- * 'inclusive' has the following description: when false, a
- * consecutive range like 'start=1, end=2'
- * means the region lying after position 1 and before position
- * 2
- *
- *
- * @return the value of field 'Inclusive'.
- */
- public boolean getInclusive(
- ) {
- return this._inclusive;
- }
-
- /**
- * Returns the value of field 'start'.
- *
- * @return the value of field 'Start'.
- */
- public int getStart(
- ) {
- return this._start;
- }
-
- /**
- * Method hasEnd.
- *
- * @return true if at least one End has been added
- */
- public boolean hasEnd(
- ) {
- return this._has_end;
- }
-
- /**
- * Method hasInclusive.
- *
- * @return true if at least one Inclusive has been added
- */
- public boolean hasInclusive(
- ) {
- return this._has_inclusive;
- }
-
- /**
- * Method hasStart.
- *
- * @return true if at least one Start has been added
- */
- public boolean hasStart(
- ) {
- return this._has_start;
- }
-
- /**
- * Overrides the java.lang.Object.hashCode method.
- *
- * The following steps came from Effective Java Programming
- * Language Guide by Joshua Bloch, Chapter 3
- *
- * @return a hash code value for the object.
- */
- public int hashCode(
- ) {
- int result = super.hashCode();
-
- long tmp;
- result = 37 * result + _start;
- result = 37 * result + _end;
- result = 37 * result + (_inclusive?0:1);
-
- return result;
- }
-
- /**
- * Returns the value of field 'inclusive'. The field
- * 'inclusive' has the following description: when false, a
- * consecutive range like 'start=1, end=2'
- * means the region lying after position 1 and before position
- * 2
- *
- *
- * @return the value of field 'Inclusive'.
- */
- public boolean isInclusive(
- ) {
- return this._inclusive;
- }
-
- /**
- * Method isValid.
- *
- * @return true if this object is valid according to the schema
- */
- public boolean isValid(
- ) {
- try {
- validate();
- } catch (org.exolab.castor.xml.ValidationException vex) {
- return false;
- }
- return true;
- }
-
- /**
- *
- *
- * @param out
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void marshal(
- final java.io.Writer out)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, out);
- }
-
- /**
- *
- *
- * @param handler
- * @throws java.io.IOException if an IOException occurs during
- * marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- */
- public void marshal(
- final org.xml.sax.ContentHandler handler)
- throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, handler);
- }
-
- /**
- * Sets the value of field 'end'.
- *
- * @param end the value of field 'end'.
- */
- public void setEnd(
- final int end) {
- this._end = end;
- this._has_end = true;
- }
-
- /**
- * Sets the value of field 'inclusive'. The field 'inclusive'
- * has the following description: when false, a consecutive
- * range like 'start=1, end=2'
- * means the region lying after position 1 and before position
- * 2
- *
- *
- * @param inclusive the value of field 'inclusive'.
- */
- public void setInclusive(
- final boolean inclusive) {
- this._inclusive = inclusive;
- this._has_inclusive = true;
- }
-
- /**
- * Sets the value of field 'start'.
- *
- * @param start the value of field 'start'.
- */
- public void setStart(
- final int start) {
- this._start = start;
- this._has_start = true;
- }
-
- /**
- * Method unmarshal.
- *
- * @param reader
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @return the unmarshaled uk.ac.vamsas.objects.core.Seg
- */
- public static uk.ac.vamsas.objects.core.Seg unmarshal(
- final java.io.Reader reader)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- return (uk.ac.vamsas.objects.core.Seg) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Seg.class, reader);
- }
-
- /**
- *
- *
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void validate(
- )
- throws org.exolab.castor.xml.ValidationException {
- org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
- validator.validate(this);
+ return false;
+ }
+
+ /**
+ * Returns the value of field 'end'.
+ *
+ * @return the value of field 'End'.
+ */
+ public int getEnd() {
+ return this._end;
+ }
+
+ /**
+ * Returns the value of field 'inclusive'. The field 'inclusive' has the
+ * following description: when false, a consecutive range like 'start=1,
+ * end=2' means the region lying after position 1 and before position 2
+ *
+ *
+ * @return the value of field 'Inclusive'.
+ */
+ public boolean getInclusive() {
+ return this._inclusive;
+ }
+
+ /**
+ * Returns the value of field 'start'.
+ *
+ * @return the value of field 'Start'.
+ */
+ public int getStart() {
+ return this._start;
+ }
+
+ /**
+ * Method hasEnd.
+ *
+ * @return true if at least one End has been added
+ */
+ public boolean hasEnd() {
+ return this._has_end;
+ }
+
+ /**
+ * Method hasInclusive.
+ *
+ * @return true if at least one Inclusive has been added
+ */
+ public boolean hasInclusive() {
+ return this._has_inclusive;
+ }
+
+ /**
+ * Method hasStart.
+ *
+ * @return true if at least one Start has been added
+ */
+ public boolean hasStart() {
+ return this._has_start;
+ }
+
+ /**
+ * Overrides the java.lang.Object.hashCode method.
+ *
+ * The following steps came from Effective Java Programming Language
+ * Guide by Joshua Bloch, Chapter 3
+ *
+ * @return a hash code value for the object.
+ */
+ public int hashCode() {
+ int result = super.hashCode();
+
+ long tmp;
+ result = 37 * result + _start;
+ result = 37 * result + _end;
+ result = 37 * result + (_inclusive ? 0 : 1);
+
+ return result;
+ }
+
+ /**
+ * Returns the value of field 'inclusive'. The field 'inclusive' has the
+ * following description: when false, a consecutive range like 'start=1,
+ * end=2' means the region lying after position 1 and before position 2
+ *
+ *
+ * @return the value of field 'Inclusive'.
+ */
+ public boolean isInclusive() {
+ return this._inclusive;
+ }
+
+ /**
+ * Method isValid.
+ *
+ * @return true if this object is valid according to the schema
+ */
+ public boolean isValid() {
+ try {
+ validate();
+ } catch (org.exolab.castor.xml.ValidationException vex) {
+ return false;
}
+ return true;
+ }
+
+ /**
+ *
+ *
+ * @param out
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void marshal(final java.io.Writer out)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, out);
+ }
+
+ /**
+ *
+ *
+ * @param handler
+ * @throws java.io.IOException
+ * if an IOException occurs during marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ */
+ public void marshal(final org.xml.sax.ContentHandler handler)
+ throws java.io.IOException, org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, handler);
+ }
+
+ /**
+ * Sets the value of field 'end'.
+ *
+ * @param end
+ * the value of field 'end'.
+ */
+ public void setEnd(final int end) {
+ this._end = end;
+ this._has_end = true;
+ }
+
+ /**
+ * Sets the value of field 'inclusive'. The field 'inclusive' has the
+ * following description: when false, a consecutive range like 'start=1,
+ * end=2' means the region lying after position 1 and before position 2
+ *
+ *
+ * @param inclusive
+ * the value of field 'inclusive'.
+ */
+ public void setInclusive(final boolean inclusive) {
+ this._inclusive = inclusive;
+ this._has_inclusive = true;
+ }
+
+ /**
+ * Sets the value of field 'start'.
+ *
+ * @param start
+ * the value of field 'start'.
+ */
+ public void setStart(final int start) {
+ this._start = start;
+ this._has_start = true;
+ }
+
+ /**
+ * Method unmarshal.
+ *
+ * @param reader
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @return the unmarshaled uk.ac.vamsas.objects.core.Seg
+ */
+ public static uk.ac.vamsas.objects.core.Seg unmarshal(
+ final java.io.Reader reader)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ return (uk.ac.vamsas.objects.core.Seg) Unmarshaller.unmarshal(
+ uk.ac.vamsas.objects.core.Seg.class, reader);
+ }
+
+ /**
+ *
+ *
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void validate() throws org.exolab.castor.xml.ValidationException {
+ org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+ validator.validate(this);
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/Sequence.java b/src/uk/ac/vamsas/objects/core/Sequence.java
index 519f57a..461b7d1 100644
--- a/src/uk/ac/vamsas/objects/core/Sequence.java
+++ b/src/uk/ac/vamsas/objects/core/Sequence.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import org.exolab.castor.xml.Marshaller;
@@ -17,708 +31,707 @@ import org.exolab.castor.xml.Unmarshaller;
/**
* Class Sequence.
*
- * @version $Revision$ $Date$
+ * @version $Revision$ $Date: 2007-06-28 14:51:44 +0100 (Thu, 28 Jun 2007)
+ * $
*/
-public class Sequence extends uk.ac.vamsas.objects.core.SequenceType
-implements java.io.Serializable
-{
-
-
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
- * Primary Key for vamsas object referencing
- *
- */
- private java.lang.String _id;
-
- /**
- * symbol class for sequence
- *
- */
- private java.lang.String _dictionary;
-
- /**
- * Store a list of database references
- * for this sequence record - with optional mapping
- * from database sequence to the given sequence record
- */
- private java.util.Vector _dbRefList;
-
- /**
- * explicitly named cross reference to
- * other objects in the document.
- */
- private java.util.Vector _vxrefList;
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public Sequence() {
- super();
- this._dbRefList = new java.util.Vector();
- this._vxrefList = new java.util.Vector();
- }
-
-
- //-----------/
- //- Methods -/
- //-----------/
-
- /**
- *
- *
- * @param vDbRef
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addDbRef(
- final uk.ac.vamsas.objects.core.DbRef vDbRef)
- throws java.lang.IndexOutOfBoundsException {
- this._dbRefList.addElement(vDbRef);
- }
-
- /**
- *
- *
- * @param index
- * @param vDbRef
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addDbRef(
- final int index,
- final uk.ac.vamsas.objects.core.DbRef vDbRef)
- throws java.lang.IndexOutOfBoundsException {
- this._dbRefList.add(index, vDbRef);
- }
-
- /**
- *
- *
- * @param vVxref
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addVxref(
- final uk.ac.vamsas.objects.core.Vxref vVxref)
- throws java.lang.IndexOutOfBoundsException {
- this._vxrefList.addElement(vVxref);
- }
-
- /**
- *
- *
- * @param index
- * @param vVxref
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addVxref(
- final int index,
- final uk.ac.vamsas.objects.core.Vxref vVxref)
- throws java.lang.IndexOutOfBoundsException {
- this._vxrefList.add(index, vVxref);
- }
-
- /**
- * Method enumerateDbRef.
- *
- * @return an Enumeration over all
- * uk.ac.vamsas.objects.core.DbRef elements
- */
- public java.util.Enumeration enumerateDbRef(
- ) {
- return this._dbRefList.elements();
- }
-
- /**
- * Method enumerateVxref.
- *
- * @return an Enumeration over all
- * uk.ac.vamsas.objects.core.Vxref elements
- */
- public java.util.Enumeration enumerateVxref(
- ) {
- return this._vxrefList.elements();
- }
-
- /**
- * Overrides the java.lang.Object.equals method.
- *
- * @param obj
- * @return true if the objects are equal.
- */
- public boolean equals(
- final java.lang.Object obj) {
- if ( this == obj )
- return true;
-
- if (super.equals(obj)==false)
+public class Sequence extends uk.ac.vamsas.objects.core.SequenceType implements
+ java.io.Serializable {
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * Primary Key for vamsas object referencing
+ *
+ */
+ private java.lang.String _id;
+
+ /**
+ * symbol class for sequence
+ *
+ */
+ private java.lang.String _dictionary;
+
+ /**
+ * Store a list of database references for this sequence record - with
+ * optional mapping from database sequence to the given sequence record
+ */
+ private java.util.Vector _dbRefList;
+
+ /**
+ * explicitly named cross reference to other objects in the document.
+ */
+ private java.util.Vector _vxrefList;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public Sequence() {
+ super();
+ this._dbRefList = new java.util.Vector();
+ this._vxrefList = new java.util.Vector();
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ *
+ *
+ * @param vDbRef
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addDbRef(final uk.ac.vamsas.objects.core.DbRef vDbRef)
+ throws java.lang.IndexOutOfBoundsException {
+ this._dbRefList.addElement(vDbRef);
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vDbRef
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addDbRef(final int index,
+ final uk.ac.vamsas.objects.core.DbRef vDbRef)
+ throws java.lang.IndexOutOfBoundsException {
+ this._dbRefList.add(index, vDbRef);
+ }
+
+ /**
+ *
+ *
+ * @param vVxref
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addVxref(final uk.ac.vamsas.objects.core.Vxref vVxref)
+ throws java.lang.IndexOutOfBoundsException {
+ this._vxrefList.addElement(vVxref);
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vVxref
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addVxref(final int index,
+ final uk.ac.vamsas.objects.core.Vxref vVxref)
+ throws java.lang.IndexOutOfBoundsException {
+ this._vxrefList.add(index, vVxref);
+ }
+
+ /**
+ * Method enumerateDbRef.
+ *
+ * @return an Enumeration over all uk.ac.vamsas.objects.core.DbRef elements
+ */
+ public java.util.Enumeration enumerateDbRef() {
+ return this._dbRefList.elements();
+ }
+
+ /**
+ * Method enumerateVxref.
+ *
+ * @return an Enumeration over all uk.ac.vamsas.objects.core.Vxref elements
+ */
+ public java.util.Enumeration enumerateVxref() {
+ return this._vxrefList.elements();
+ }
+
+ /**
+ * Overrides the java.lang.Object.equals method.
+ *
+ * @param obj
+ * @return true if the objects are equal.
+ */
+ public boolean equals(final java.lang.Object obj) {
+ if (this == obj)
+ return true;
+
+ if (super.equals(obj) == false)
+ return false;
+
+ if (obj instanceof Sequence) {
+
+ Sequence temp = (Sequence) obj;
+ boolean thcycle;
+ boolean tmcycle;
+ if (this._id != null) {
+ if (temp._id == null)
+ return false;
+ if (this._id != temp._id) {
+ thcycle = org.castor.util.CycleBreaker.startingToCycle(this._id);
+ tmcycle = org.castor.util.CycleBreaker.startingToCycle(temp._id);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
+ }
+ ;
return false;
-
- if (obj instanceof Sequence) {
-
- Sequence temp = (Sequence)obj;
- boolean thcycle;
- boolean tmcycle;
- if (this._id != null) {
- if (temp._id == null) return false;
- if (this._id != temp._id) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._id);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._id);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._id); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._id); };
- return false;
- }
- if (!thcycle) {
- if (!this._id.equals(temp._id)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
- }
- }
- } else if (temp._id != null)
- return false;
- if (this._dictionary != null) {
- if (temp._dictionary == null) return false;
- if (this._dictionary != temp._dictionary) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._dictionary);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._dictionary);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._dictionary); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._dictionary); };
- return false;
- }
- if (!thcycle) {
- if (!this._dictionary.equals(temp._dictionary)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._dictionary);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._dictionary);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._dictionary);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._dictionary);
- }
- }
- } else if (temp._dictionary != null)
- return false;
- if (this._dbRefList != null) {
- if (temp._dbRefList == null) return false;
- if (this._dbRefList != temp._dbRefList) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._dbRefList);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._dbRefList);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._dbRefList); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._dbRefList); };
- return false;
- }
- if (!thcycle) {
- if (!this._dbRefList.equals(temp._dbRefList)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._dbRefList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._dbRefList);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._dbRefList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._dbRefList);
- }
- }
- } else if (temp._dbRefList != null)
- return false;
- if (this._vxrefList != null) {
- if (temp._vxrefList == null) return false;
- if (this._vxrefList != temp._vxrefList) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._vxrefList);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._vxrefList);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._vxrefList); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._vxrefList); };
- return false;
- }
- if (!thcycle) {
- if (!this._vxrefList.equals(temp._vxrefList)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._vxrefList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._vxrefList);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._vxrefList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._vxrefList);
- }
- }
- } else if (temp._vxrefList != null)
- return false;
- return true;
+ }
+ if (!thcycle) {
+ if (!this._id.equals(temp._id)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
+ }
}
+ } else if (temp._id != null)
return false;
- }
-
- /**
- * Method getDbRef.
- *
- * @param index
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- * @return the value of the uk.ac.vamsas.objects.core.DbRef at
- * the given index
- */
- public uk.ac.vamsas.objects.core.DbRef getDbRef(
- final int index)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._dbRefList.size()) {
- throw new IndexOutOfBoundsException("getDbRef: Index value '" + index + "' not in range [0.." + (this._dbRefList.size() - 1) + "]");
- }
-
- return (uk.ac.vamsas.objects.core.DbRef) _dbRefList.get(index);
- }
-
- /**
- * Method getDbRef.Returns the contents of the collection in an
- * Array.
Note: Just in case the collection contents are
- * changing in another thread, we pass a 0-length Array of the
- * correct type into the API call. This way we know
- * that the Array returned is of exactly the correct length.
- *
- * @return this collection as an Array
- */
- public uk.ac.vamsas.objects.core.DbRef[] getDbRef(
- ) {
- uk.ac.vamsas.objects.core.DbRef[] array = new uk.ac.vamsas.objects.core.DbRef[0];
- return (uk.ac.vamsas.objects.core.DbRef[]) this._dbRefList.toArray(array);
- }
-
- /**
- * Method getDbRefAsReference.Returns a reference to
- * '_dbRefList'. No type checking is performed on any
- * modifications to the Vector.
- *
- * @return a reference to the Vector backing this class
- */
- public java.util.Vector getDbRefAsReference(
- ) {
- return this._dbRefList;
- }
-
- /**
- * Method getDbRefCount.
- *
- * @return the size of this collection
- */
- public int getDbRefCount(
- ) {
- return this._dbRefList.size();
- }
-
- /**
- * Returns the value of field 'dictionary'. The field
- * 'dictionary' has the following description: symbol class for
- * sequence
- *
- *
- * @return the value of field 'Dictionary'.
- */
- public java.lang.String getDictionary(
- ) {
- return this._dictionary;
- }
-
- /**
- * Returns the value of field 'id'. The field 'id' has the
- * following description: Primary Key for vamsas object
- * referencing
- *
- *
- * @return the value of field 'Id'.
- */
- public java.lang.String getId(
- ) {
- return this._id;
- }
-
- /**
- * Method getVxref.
- *
- * @param index
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- * @return the value of the uk.ac.vamsas.objects.core.Vxref at
- * the given index
- */
- public uk.ac.vamsas.objects.core.Vxref getVxref(
- final int index)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._vxrefList.size()) {
- throw new IndexOutOfBoundsException("getVxref: Index value '" + index + "' not in range [0.." + (this._vxrefList.size() - 1) + "]");
- }
-
- return (uk.ac.vamsas.objects.core.Vxref) _vxrefList.get(index);
- }
-
- /**
- * Method getVxref.Returns the contents of the collection in an
- * Array.
Note: Just in case the collection contents are
- * changing in another thread, we pass a 0-length Array of the
- * correct type into the API call. This way we know
- * that the Array returned is of exactly the correct length.
- *
- * @return this collection as an Array
- */
- public uk.ac.vamsas.objects.core.Vxref[] getVxref(
- ) {
- uk.ac.vamsas.objects.core.Vxref[] array = new uk.ac.vamsas.objects.core.Vxref[0];
- return (uk.ac.vamsas.objects.core.Vxref[]) this._vxrefList.toArray(array);
- }
-
- /**
- * Method getVxrefAsReference.Returns a reference to
- * '_vxrefList'. No type checking is performed on any
- * modifications to the Vector.
- *
- * @return a reference to the Vector backing this class
- */
- public java.util.Vector getVxrefAsReference(
- ) {
- return this._vxrefList;
- }
-
- /**
- * Method getVxrefCount.
- *
- * @return the size of this collection
- */
- public int getVxrefCount(
- ) {
- return this._vxrefList.size();
- }
-
- /**
- * Overrides the java.lang.Object.hashCode method.
- *
- * The following steps came from Effective Java Programming
- * Language Guide by Joshua Bloch, Chapter 3
- *
- * @return a hash code value for the object.
- */
- public int hashCode(
- ) {
- int result = super.hashCode();
-
- long tmp;
- if (_id != null
- && !org.castor.util.CycleBreaker.startingToCycle(_id)) {
- result = 37 * result + _id.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_id);
- }
- if (_dictionary != null
- && !org.castor.util.CycleBreaker.startingToCycle(_dictionary)) {
- result = 37 * result + _dictionary.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_dictionary);
- }
- if (_dbRefList != null
- && !org.castor.util.CycleBreaker.startingToCycle(_dbRefList)) {
- result = 37 * result + _dbRefList.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_dbRefList);
- }
- if (_vxrefList != null
- && !org.castor.util.CycleBreaker.startingToCycle(_vxrefList)) {
- result = 37 * result + _vxrefList.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_vxrefList);
- }
-
- return result;
- }
-
- /**
- * Method isValid.
- *
- * @return true if this object is valid according to the schema
- */
- public boolean isValid(
- ) {
- try {
- validate();
- } catch (org.exolab.castor.xml.ValidationException vex) {
+ if (this._dictionary != null) {
+ if (temp._dictionary == null)
+ return false;
+ if (this._dictionary != temp._dictionary) {
+ thcycle = org.castor.util.CycleBreaker
+ .startingToCycle(this._dictionary);
+ tmcycle = org.castor.util.CycleBreaker
+ .startingToCycle(temp._dictionary);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._dictionary);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._dictionary);
+ }
+ ;
return false;
+ }
+ if (!thcycle) {
+ if (!this._dictionary.equals(temp._dictionary)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._dictionary);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._dictionary);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._dictionary);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._dictionary);
+ }
}
- return true;
- }
-
- /**
- *
- *
- * @param out
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void marshal(
- final java.io.Writer out)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, out);
- }
-
- /**
- *
- *
- * @param handler
- * @throws java.io.IOException if an IOException occurs during
- * marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- */
- public void marshal(
- final org.xml.sax.ContentHandler handler)
- throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, handler);
- }
-
- /**
- */
- public void removeAllDbRef(
- ) {
- this._dbRefList.clear();
- }
-
- /**
- */
- public void removeAllVxref(
- ) {
- this._vxrefList.clear();
- }
-
- /**
- * Method removeDbRef.
- *
- * @param vDbRef
- * @return true if the object was removed from the collection.
- */
- public boolean removeDbRef(
- final uk.ac.vamsas.objects.core.DbRef vDbRef) {
- boolean removed = _dbRefList.remove(vDbRef);
- return removed;
- }
-
- /**
- * Method removeDbRefAt.
- *
- * @param index
- * @return the element removed from the collection
- */
- public uk.ac.vamsas.objects.core.DbRef removeDbRefAt(
- final int index) {
- java.lang.Object obj = this._dbRefList.remove(index);
- return (uk.ac.vamsas.objects.core.DbRef) obj;
- }
-
- /**
- * Method removeVxref.
- *
- * @param vVxref
- * @return true if the object was removed from the collection.
- */
- public boolean removeVxref(
- final uk.ac.vamsas.objects.core.Vxref vVxref) {
- boolean removed = _vxrefList.remove(vVxref);
- return removed;
- }
-
- /**
- * Method removeVxrefAt.
- *
- * @param index
- * @return the element removed from the collection
- */
- public uk.ac.vamsas.objects.core.Vxref removeVxrefAt(
- final int index) {
- java.lang.Object obj = this._vxrefList.remove(index);
- return (uk.ac.vamsas.objects.core.Vxref) obj;
- }
-
- /**
- *
- *
- * @param index
- * @param vDbRef
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void setDbRef(
- final int index,
- final uk.ac.vamsas.objects.core.DbRef vDbRef)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._dbRefList.size()) {
- throw new IndexOutOfBoundsException("setDbRef: Index value '" + index + "' not in range [0.." + (this._dbRefList.size() - 1) + "]");
- }
-
- this._dbRefList.set(index, vDbRef);
- }
-
- /**
- *
- *
- * @param vDbRefArray
- */
- public void setDbRef(
- final uk.ac.vamsas.objects.core.DbRef[] vDbRefArray) {
- //-- copy array
- _dbRefList.clear();
-
- for (int i = 0; i < vDbRefArray.length; i++) {
- this._dbRefList.add(vDbRefArray[i]);
- }
- }
-
- /**
- * Sets the value of '_dbRefList' by copying the given Vector.
- * All elements will be checked for type safety.
- *
- * @param vDbRefList the Vector to copy.
- */
- public void setDbRef(
- final java.util.Vector vDbRefList) {
- // copy vector
- this._dbRefList.clear();
-
- this._dbRefList.addAll(vDbRefList);
- }
-
- /**
- * Sets the value of '_dbRefList' by setting it to the given
- * Vector. No type checking is performed.
- * @deprecated
- *
- * @param dbRefVector the Vector to set.
- */
- public void setDbRefAsReference(
- final java.util.Vector dbRefVector) {
- this._dbRefList = dbRefVector;
- }
-
- /**
- * Sets the value of field 'dictionary'. The field 'dictionary'
- * has the following description: symbol class for sequence
- *
- *
- * @param dictionary the value of field 'dictionary'.
- */
- public void setDictionary(
- final java.lang.String dictionary) {
- this._dictionary = dictionary;
- }
-
- /**
- * Sets the value of field 'id'. The field 'id' has the
- * following description: Primary Key for vamsas object
- * referencing
- *
- *
- * @param id the value of field 'id'.
- */
- public void setId(
- final java.lang.String id) {
- this._id = id;
- }
-
- /**
- *
- *
- * @param index
- * @param vVxref
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void setVxref(
- final int index,
- final uk.ac.vamsas.objects.core.Vxref vVxref)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._vxrefList.size()) {
- throw new IndexOutOfBoundsException("setVxref: Index value '" + index + "' not in range [0.." + (this._vxrefList.size() - 1) + "]");
+ } else if (temp._dictionary != null)
+ return false;
+ if (this._dbRefList != null) {
+ if (temp._dbRefList == null)
+ return false;
+ if (this._dbRefList != temp._dbRefList) {
+ thcycle = org.castor.util.CycleBreaker
+ .startingToCycle(this._dbRefList);
+ tmcycle = org.castor.util.CycleBreaker
+ .startingToCycle(temp._dbRefList);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._dbRefList);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._dbRefList);
+ }
+ ;
+ return false;
+ }
+ if (!thcycle) {
+ if (!this._dbRefList.equals(temp._dbRefList)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._dbRefList);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._dbRefList);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._dbRefList);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._dbRefList);
+ }
}
-
- this._vxrefList.set(index, vVxref);
- }
-
- /**
- *
- *
- * @param vVxrefArray
- */
- public void setVxref(
- final uk.ac.vamsas.objects.core.Vxref[] vVxrefArray) {
- //-- copy array
- _vxrefList.clear();
-
- for (int i = 0; i < vVxrefArray.length; i++) {
- this._vxrefList.add(vVxrefArray[i]);
+ } else if (temp._dbRefList != null)
+ return false;
+ if (this._vxrefList != null) {
+ if (temp._vxrefList == null)
+ return false;
+ if (this._vxrefList != temp._vxrefList) {
+ thcycle = org.castor.util.CycleBreaker
+ .startingToCycle(this._vxrefList);
+ tmcycle = org.castor.util.CycleBreaker
+ .startingToCycle(temp._vxrefList);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._vxrefList);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._vxrefList);
+ }
+ ;
+ return false;
+ }
+ if (!thcycle) {
+ if (!this._vxrefList.equals(temp._vxrefList)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._vxrefList);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._vxrefList);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._vxrefList);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._vxrefList);
+ }
}
- }
-
- /**
- * Sets the value of '_vxrefList' by copying the given Vector.
- * All elements will be checked for type safety.
- *
- * @param vVxrefList the Vector to copy.
- */
- public void setVxref(
- final java.util.Vector vVxrefList) {
- // copy vector
- this._vxrefList.clear();
-
- this._vxrefList.addAll(vVxrefList);
- }
-
- /**
- * Sets the value of '_vxrefList' by setting it to the given
- * Vector. No type checking is performed.
- * @deprecated
- *
- * @param vxrefVector the Vector to set.
- */
- public void setVxrefAsReference(
- final java.util.Vector vxrefVector) {
- this._vxrefList = vxrefVector;
- }
-
- /**
- * Method unmarshal.
- *
- * @param reader
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @return the unmarshaled uk.ac.vamsas.objects.core.SequenceTyp
- */
- public static uk.ac.vamsas.objects.core.SequenceType unmarshal(
- final java.io.Reader reader)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- return (uk.ac.vamsas.objects.core.SequenceType) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Sequence.class, reader);
- }
-
- /**
- *
- *
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void validate(
- )
- throws org.exolab.castor.xml.ValidationException {
- org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
- validator.validate(this);
- }
+ } else if (temp._vxrefList != null)
+ return false;
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Method getDbRef.
+ *
+ * @param index
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ * @return the value of the uk.ac.vamsas.objects.core.DbRef at the given index
+ */
+ public uk.ac.vamsas.objects.core.DbRef getDbRef(final int index)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._dbRefList.size()) {
+ throw new IndexOutOfBoundsException("getDbRef: Index value '" + index
+ + "' not in range [0.." + (this._dbRefList.size() - 1) + "]");
+ }
+
+ return (uk.ac.vamsas.objects.core.DbRef) _dbRefList.get(index);
+ }
+
+ /**
+ * Method getDbRef.Returns the contents of the collection in an Array.
+ *
+ * Note: Just in case the collection contents are changing in another thread,
+ * we pass a 0-length Array of the correct type into the API call. This way we
+ * know that the Array returned is of exactly the correct length.
+ *
+ * @return this collection as an Array
+ */
+ public uk.ac.vamsas.objects.core.DbRef[] getDbRef() {
+ uk.ac.vamsas.objects.core.DbRef[] array = new uk.ac.vamsas.objects.core.DbRef[0];
+ return (uk.ac.vamsas.objects.core.DbRef[]) this._dbRefList.toArray(array);
+ }
+
+ /**
+ * Method getDbRefAsReference.Returns a reference to '_dbRefList'. No type
+ * checking is performed on any modifications to the Vector.
+ *
+ * @return a reference to the Vector backing this class
+ */
+ public java.util.Vector getDbRefAsReference() {
+ return this._dbRefList;
+ }
+
+ /**
+ * Method getDbRefCount.
+ *
+ * @return the size of this collection
+ */
+ public int getDbRefCount() {
+ return this._dbRefList.size();
+ }
+
+ /**
+ * Returns the value of field 'dictionary'. The field 'dictionary' has the
+ * following description: symbol class for sequence
+ *
+ *
+ * @return the value of field 'Dictionary'.
+ */
+ public java.lang.String getDictionary() {
+ return this._dictionary;
+ }
+
+ /**
+ * Returns the value of field 'id'. The field 'id' has the following
+ * description: Primary Key for vamsas object referencing
+ *
+ *
+ * @return the value of field 'Id'.
+ */
+ public java.lang.String getId() {
+ return this._id;
+ }
+
+ /**
+ * Method getVxref.
+ *
+ * @param index
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ * @return the value of the uk.ac.vamsas.objects.core.Vxref at the given index
+ */
+ public uk.ac.vamsas.objects.core.Vxref getVxref(final int index)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._vxrefList.size()) {
+ throw new IndexOutOfBoundsException("getVxref: Index value '" + index
+ + "' not in range [0.." + (this._vxrefList.size() - 1) + "]");
+ }
+
+ return (uk.ac.vamsas.objects.core.Vxref) _vxrefList.get(index);
+ }
+
+ /**
+ * Method getVxref.Returns the contents of the collection in an Array.
+ *
+ * Note: Just in case the collection contents are changing in another thread,
+ * we pass a 0-length Array of the correct type into the API call. This way we
+ * know that the Array returned is of exactly the correct length.
+ *
+ * @return this collection as an Array
+ */
+ public uk.ac.vamsas.objects.core.Vxref[] getVxref() {
+ uk.ac.vamsas.objects.core.Vxref[] array = new uk.ac.vamsas.objects.core.Vxref[0];
+ return (uk.ac.vamsas.objects.core.Vxref[]) this._vxrefList.toArray(array);
+ }
+
+ /**
+ * Method getVxrefAsReference.Returns a reference to '_vxrefList'. No type
+ * checking is performed on any modifications to the Vector.
+ *
+ * @return a reference to the Vector backing this class
+ */
+ public java.util.Vector getVxrefAsReference() {
+ return this._vxrefList;
+ }
+
+ /**
+ * Method getVxrefCount.
+ *
+ * @return the size of this collection
+ */
+ public int getVxrefCount() {
+ return this._vxrefList.size();
+ }
+
+ /**
+ * Overrides the java.lang.Object.hashCode method.
+ *
+ * The following steps came from Effective Java Programming Language
+ * Guide by Joshua Bloch, Chapter 3
+ *
+ * @return a hash code value for the object.
+ */
+ public int hashCode() {
+ int result = super.hashCode();
+
+ long tmp;
+ if (_id != null && !org.castor.util.CycleBreaker.startingToCycle(_id)) {
+ result = 37 * result + _id.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_id);
+ }
+ if (_dictionary != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_dictionary)) {
+ result = 37 * result + _dictionary.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_dictionary);
+ }
+ if (_dbRefList != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_dbRefList)) {
+ result = 37 * result + _dbRefList.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_dbRefList);
+ }
+ if (_vxrefList != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_vxrefList)) {
+ result = 37 * result + _vxrefList.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_vxrefList);
+ }
+
+ return result;
+ }
+
+ /**
+ * Method isValid.
+ *
+ * @return true if this object is valid according to the schema
+ */
+ public boolean isValid() {
+ try {
+ validate();
+ } catch (org.exolab.castor.xml.ValidationException vex) {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ *
+ *
+ * @param out
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void marshal(final java.io.Writer out)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, out);
+ }
+
+ /**
+ *
+ *
+ * @param handler
+ * @throws java.io.IOException
+ * if an IOException occurs during marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ */
+ public void marshal(final org.xml.sax.ContentHandler handler)
+ throws java.io.IOException, org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, handler);
+ }
+
+ /**
+ */
+ public void removeAllDbRef() {
+ this._dbRefList.clear();
+ }
+
+ /**
+ */
+ public void removeAllVxref() {
+ this._vxrefList.clear();
+ }
+
+ /**
+ * Method removeDbRef.
+ *
+ * @param vDbRef
+ * @return true if the object was removed from the collection.
+ */
+ public boolean removeDbRef(final uk.ac.vamsas.objects.core.DbRef vDbRef) {
+ boolean removed = _dbRefList.remove(vDbRef);
+ return removed;
+ }
+
+ /**
+ * Method removeDbRefAt.
+ *
+ * @param index
+ * @return the element removed from the collection
+ */
+ public uk.ac.vamsas.objects.core.DbRef removeDbRefAt(final int index) {
+ java.lang.Object obj = this._dbRefList.remove(index);
+ return (uk.ac.vamsas.objects.core.DbRef) obj;
+ }
+
+ /**
+ * Method removeVxref.
+ *
+ * @param vVxref
+ * @return true if the object was removed from the collection.
+ */
+ public boolean removeVxref(final uk.ac.vamsas.objects.core.Vxref vVxref) {
+ boolean removed = _vxrefList.remove(vVxref);
+ return removed;
+ }
+
+ /**
+ * Method removeVxrefAt.
+ *
+ * @param index
+ * @return the element removed from the collection
+ */
+ public uk.ac.vamsas.objects.core.Vxref removeVxrefAt(final int index) {
+ java.lang.Object obj = this._vxrefList.remove(index);
+ return (uk.ac.vamsas.objects.core.Vxref) obj;
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vDbRef
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void setDbRef(final int index,
+ final uk.ac.vamsas.objects.core.DbRef vDbRef)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._dbRefList.size()) {
+ throw new IndexOutOfBoundsException("setDbRef: Index value '" + index
+ + "' not in range [0.." + (this._dbRefList.size() - 1) + "]");
+ }
+
+ this._dbRefList.set(index, vDbRef);
+ }
+
+ /**
+ *
+ *
+ * @param vDbRefArray
+ */
+ public void setDbRef(final uk.ac.vamsas.objects.core.DbRef[] vDbRefArray) {
+ // -- copy array
+ _dbRefList.clear();
+
+ for (int i = 0; i < vDbRefArray.length; i++) {
+ this._dbRefList.add(vDbRefArray[i]);
+ }
+ }
+
+ /**
+ * Sets the value of '_dbRefList' by copying the given Vector. All elements
+ * will be checked for type safety.
+ *
+ * @param vDbRefList
+ * the Vector to copy.
+ */
+ public void setDbRef(final java.util.Vector vDbRefList) {
+ // copy vector
+ this._dbRefList.clear();
+
+ this._dbRefList.addAll(vDbRefList);
+ }
+
+ /**
+ * Sets the value of '_dbRefList' by setting it to the given Vector. No type
+ * checking is performed.
+ *
+ * @deprecated
+ *
+ * @param dbRefVector
+ * the Vector to set.
+ */
+ public void setDbRefAsReference(final java.util.Vector dbRefVector) {
+ this._dbRefList = dbRefVector;
+ }
+
+ /**
+ * Sets the value of field 'dictionary'. The field 'dictionary' has the
+ * following description: symbol class for sequence
+ *
+ *
+ * @param dictionary
+ * the value of field 'dictionary'.
+ */
+ public void setDictionary(final java.lang.String dictionary) {
+ this._dictionary = dictionary;
+ }
+
+ /**
+ * Sets the value of field 'id'. The field 'id' has the following description:
+ * Primary Key for vamsas object referencing
+ *
+ *
+ * @param id
+ * the value of field 'id'.
+ */
+ public void setId(final java.lang.String id) {
+ this._id = id;
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vVxref
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void setVxref(final int index,
+ final uk.ac.vamsas.objects.core.Vxref vVxref)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._vxrefList.size()) {
+ throw new IndexOutOfBoundsException("setVxref: Index value '" + index
+ + "' not in range [0.." + (this._vxrefList.size() - 1) + "]");
+ }
+
+ this._vxrefList.set(index, vVxref);
+ }
+
+ /**
+ *
+ *
+ * @param vVxrefArray
+ */
+ public void setVxref(final uk.ac.vamsas.objects.core.Vxref[] vVxrefArray) {
+ // -- copy array
+ _vxrefList.clear();
+
+ for (int i = 0; i < vVxrefArray.length; i++) {
+ this._vxrefList.add(vVxrefArray[i]);
+ }
+ }
+
+ /**
+ * Sets the value of '_vxrefList' by copying the given Vector. All elements
+ * will be checked for type safety.
+ *
+ * @param vVxrefList
+ * the Vector to copy.
+ */
+ public void setVxref(final java.util.Vector vVxrefList) {
+ // copy vector
+ this._vxrefList.clear();
+
+ this._vxrefList.addAll(vVxrefList);
+ }
+
+ /**
+ * Sets the value of '_vxrefList' by setting it to the given Vector. No type
+ * checking is performed.
+ *
+ * @deprecated
+ *
+ * @param vxrefVector
+ * the Vector to set.
+ */
+ public void setVxrefAsReference(final java.util.Vector vxrefVector) {
+ this._vxrefList = vxrefVector;
+ }
+
+ /**
+ * Method unmarshal.
+ *
+ * @param reader
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @return the unmarshaled uk.ac.vamsas.objects.core.SequenceTyp
+ */
+ public static uk.ac.vamsas.objects.core.SequenceType unmarshal(
+ final java.io.Reader reader)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ return (uk.ac.vamsas.objects.core.SequenceType) Unmarshaller.unmarshal(
+ uk.ac.vamsas.objects.core.Sequence.class, reader);
+ }
+
+ /**
+ *
+ *
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void validate() throws org.exolab.castor.xml.ValidationException {
+ org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+ validator.validate(this);
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/SequenceMapping.java b/src/uk/ac/vamsas/objects/core/SequenceMapping.java
index 7f7bcb0..9370bae 100644
--- a/src/uk/ac/vamsas/objects/core/SequenceMapping.java
+++ b/src/uk/ac/vamsas/objects/core/SequenceMapping.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import org.exolab.castor.xml.Marshaller;
@@ -19,362 +33,376 @@ import org.exolab.castor.xml.Unmarshaller;
*
* @version $Revision$ $Date$
*/
-public class SequenceMapping extends uk.ac.vamsas.objects.core.MapType
-implements java.io.Serializable
-{
+public class SequenceMapping extends uk.ac.vamsas.objects.core.MapType
+ implements java.io.Serializable {
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
+ /**
+ * Object on which the local range is defined.
+ */
+ private java.lang.Object _loc;
- /**
- * Object on which the local
- * range is defined.
- */
- private java.lang.Object _loc;
+ /**
+ * Object on which the mapped range is defined.
+ */
+ private java.lang.Object _map;
- /**
- * Object on which the mapped
- * range is defined.
- */
- private java.lang.Object _map;
+ /**
+ * Field _id.
+ */
+ private java.lang.String _id;
- /**
- * Field _id.
- */
- private java.lang.String _id;
+ /**
+ * Field _provenance.
+ */
+ private uk.ac.vamsas.objects.core.Provenance _provenance;
- /**
- * Field _provenance.
- */
- private uk.ac.vamsas.objects.core.Provenance _provenance;
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+ public SequenceMapping() {
+ super();
+ }
- //----------------/
- //- Constructors -/
- //----------------/
+ // -----------/
+ // - Methods -/
+ // -----------/
- public SequenceMapping() {
- super();
- }
+ /**
+ * Overrides the java.lang.Object.equals method.
+ *
+ * @param obj
+ * @return true if the objects are equal.
+ */
+ public boolean equals(final java.lang.Object obj) {
+ if (this == obj)
+ return true;
+
+ if (super.equals(obj) == false)
+ return false;
+ if (obj instanceof SequenceMapping) {
- //-----------/
- //- Methods -/
- //-----------/
-
- /**
- * Overrides the java.lang.Object.equals method.
- *
- * @param obj
- * @return true if the objects are equal.
- */
- public boolean equals(
- final java.lang.Object obj) {
- if ( this == obj )
- return true;
-
- if (super.equals(obj)==false)
+ SequenceMapping temp = (SequenceMapping) obj;
+ boolean thcycle;
+ boolean tmcycle;
+ if (this._loc != null) {
+ if (temp._loc == null)
+ return false;
+ if (this._loc != temp._loc) {
+ thcycle = org.castor.util.CycleBreaker.startingToCycle(this._loc);
+ tmcycle = org.castor.util.CycleBreaker.startingToCycle(temp._loc);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._loc);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._loc);
+ }
+ ;
+ return false;
+ }
+ if (!thcycle) {
+ if (!this._loc.equals(temp._loc)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._loc);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._loc);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._loc);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._loc);
+ }
+ }
+ } else if (temp._loc != null)
+ return false;
+ if (this._map != null) {
+ if (temp._map == null)
+ return false;
+ if (this._map != temp._map) {
+ thcycle = org.castor.util.CycleBreaker.startingToCycle(this._map);
+ tmcycle = org.castor.util.CycleBreaker.startingToCycle(temp._map);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._map);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._map);
+ }
+ ;
return false;
-
- if (obj instanceof SequenceMapping) {
-
- SequenceMapping temp = (SequenceMapping)obj;
- boolean thcycle;
- boolean tmcycle;
- if (this._loc != null) {
- if (temp._loc == null) return false;
- if (this._loc != temp._loc) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._loc);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._loc);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._loc); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._loc); };
- return false;
- }
- if (!thcycle) {
- if (!this._loc.equals(temp._loc)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._loc);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._loc);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._loc);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._loc);
- }
- }
- } else if (temp._loc != null)
- return false;
- if (this._map != null) {
- if (temp._map == null) return false;
- if (this._map != temp._map) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._map);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._map);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._map); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._map); };
- return false;
- }
- if (!thcycle) {
- if (!this._map.equals(temp._map)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._map);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._map);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._map);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._map);
- }
- }
- } else if (temp._map != null)
- return false;
- if (this._id != null) {
- if (temp._id == null) return false;
- if (this._id != temp._id) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._id);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._id);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._id); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._id); };
- return false;
- }
- if (!thcycle) {
- if (!this._id.equals(temp._id)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
- }
- }
- } else if (temp._id != null)
- return false;
- if (this._provenance != null) {
- if (temp._provenance == null) return false;
- if (this._provenance != temp._provenance) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._provenance);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._provenance);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance); };
- return false;
- }
- if (!thcycle) {
- if (!this._provenance.equals(temp._provenance)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance);
- }
- }
- } else if (temp._provenance != null)
- return false;
- return true;
+ }
+ if (!thcycle) {
+ if (!this._map.equals(temp._map)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._map);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._map);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._map);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._map);
+ }
}
+ } else if (temp._map != null)
return false;
+ if (this._id != null) {
+ if (temp._id == null)
+ return false;
+ if (this._id != temp._id) {
+ thcycle = org.castor.util.CycleBreaker.startingToCycle(this._id);
+ tmcycle = org.castor.util.CycleBreaker.startingToCycle(temp._id);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
+ }
+ ;
+ return false;
+ }
+ if (!thcycle) {
+ if (!this._id.equals(temp._id)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
+ }
+ }
+ } else if (temp._id != null)
+ return false;
+ if (this._provenance != null) {
+ if (temp._provenance == null)
+ return false;
+ if (this._provenance != temp._provenance) {
+ thcycle = org.castor.util.CycleBreaker
+ .startingToCycle(this._provenance);
+ tmcycle = org.castor.util.CycleBreaker
+ .startingToCycle(temp._provenance);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance);
+ }
+ ;
+ return false;
+ }
+ if (!thcycle) {
+ if (!this._provenance.equals(temp._provenance)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance);
+ }
+ }
+ } else if (temp._provenance != null)
+ return false;
+ return true;
}
+ return false;
+ }
- /**
- * Returns the value of field 'id'.
- *
- * @return the value of field 'Id'.
- */
- public java.lang.String getId(
- ) {
- return this._id;
- }
+ /**
+ * Returns the value of field 'id'.
+ *
+ * @return the value of field 'Id'.
+ */
+ public java.lang.String getId() {
+ return this._id;
+ }
- /**
- * Returns the value of field 'loc'. The field 'loc' has the
- * following description: Object on which the local
- * range is defined.
- *
- * @return the value of field 'Loc'.
- */
- public java.lang.Object getLoc(
- ) {
- return this._loc;
- }
+ /**
+ * Returns the value of field 'loc'. The field 'loc' has the following
+ * description: Object on which the local range is defined.
+ *
+ * @return the value of field 'Loc'.
+ */
+ public java.lang.Object getLoc() {
+ return this._loc;
+ }
- /**
- * Returns the value of field 'map'. The field 'map' has the
- * following description: Object on which the mapped
- * range is defined.
- *
- * @return the value of field 'Map'.
- */
- public java.lang.Object getMap(
- ) {
- return this._map;
- }
+ /**
+ * Returns the value of field 'map'. The field 'map' has the following
+ * description: Object on which the mapped range is defined.
+ *
+ * @return the value of field 'Map'.
+ */
+ public java.lang.Object getMap() {
+ return this._map;
+ }
- /**
- * Returns the value of field 'provenance'.
- *
- * @return the value of field 'Provenance'.
- */
- public uk.ac.vamsas.objects.core.Provenance getProvenance(
- ) {
- return this._provenance;
- }
+ /**
+ * Returns the value of field 'provenance'.
+ *
+ * @return the value of field 'Provenance'.
+ */
+ public uk.ac.vamsas.objects.core.Provenance getProvenance() {
+ return this._provenance;
+ }
- /**
- * Overrides the java.lang.Object.hashCode method.
- *
- * The following steps came from Effective Java Programming
- * Language Guide by Joshua Bloch, Chapter 3
- *
- * @return a hash code value for the object.
- */
- public int hashCode(
- ) {
- int result = super.hashCode();
-
- long tmp;
- if (_loc != null
- && !org.castor.util.CycleBreaker.startingToCycle(_loc)) {
- result = 37 * result + _loc.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_loc);
- }
- if (_map != null
- && !org.castor.util.CycleBreaker.startingToCycle(_map)) {
- result = 37 * result + _map.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_map);
- }
- if (_id != null
- && !org.castor.util.CycleBreaker.startingToCycle(_id)) {
- result = 37 * result + _id.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_id);
- }
- if (_provenance != null
- && !org.castor.util.CycleBreaker.startingToCycle(_provenance)) {
- result = 37 * result + _provenance.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_provenance);
- }
-
- return result;
- }
+ /**
+ * Overrides the java.lang.Object.hashCode method.
+ *
+ * The following steps came from Effective Java Programming Language
+ * Guide by Joshua Bloch, Chapter 3
+ *
+ * @return a hash code value for the object.
+ */
+ public int hashCode() {
+ int result = super.hashCode();
- /**
- * Method isValid.
- *
- * @return true if this object is valid according to the schema
- */
- public boolean isValid(
- ) {
- try {
- validate();
- } catch (org.exolab.castor.xml.ValidationException vex) {
- return false;
- }
- return true;
+ long tmp;
+ if (_loc != null && !org.castor.util.CycleBreaker.startingToCycle(_loc)) {
+ result = 37 * result + _loc.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_loc);
}
-
- /**
- *
- *
- * @param out
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void marshal(
- final java.io.Writer out)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, out);
+ if (_map != null && !org.castor.util.CycleBreaker.startingToCycle(_map)) {
+ result = 37 * result + _map.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_map);
}
-
- /**
- *
- *
- * @param handler
- * @throws java.io.IOException if an IOException occurs during
- * marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- */
- public void marshal(
- final org.xml.sax.ContentHandler handler)
- throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, handler);
+ if (_id != null && !org.castor.util.CycleBreaker.startingToCycle(_id)) {
+ result = 37 * result + _id.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_id);
}
-
- /**
- * Sets the value of field 'id'.
- *
- * @param id the value of field 'id'.
- */
- public void setId(
- final java.lang.String id) {
- this._id = id;
+ if (_provenance != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_provenance)) {
+ result = 37 * result + _provenance.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_provenance);
}
- /**
- * Sets the value of field 'loc'. The field 'loc' has the
- * following description: Object on which the local
- * range is defined.
- *
- * @param loc the value of field 'loc'.
- */
- public void setLoc(
- final java.lang.Object loc) {
- this._loc = loc;
- }
+ return result;
+ }
- /**
- * Sets the value of field 'map'. The field 'map' has the
- * following description: Object on which the mapped
- * range is defined.
- *
- * @param map the value of field 'map'.
- */
- public void setMap(
- final java.lang.Object map) {
- this._map = map;
+ /**
+ * Method isValid.
+ *
+ * @return true if this object is valid according to the schema
+ */
+ public boolean isValid() {
+ try {
+ validate();
+ } catch (org.exolab.castor.xml.ValidationException vex) {
+ return false;
}
+ return true;
+ }
- /**
- * Sets the value of field 'provenance'.
- *
- * @param provenance the value of field 'provenance'.
- */
- public void setProvenance(
- final uk.ac.vamsas.objects.core.Provenance provenance) {
- this._provenance = provenance;
- }
+ /**
+ *
+ *
+ * @param out
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void marshal(final java.io.Writer out)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, out);
+ }
- /**
- * Method unmarshal.
- *
- * @param reader
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @return the unmarshaled uk.ac.vamsas.objects.core.MapType
- */
- public static uk.ac.vamsas.objects.core.MapType unmarshal(
- final java.io.Reader reader)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- return (uk.ac.vamsas.objects.core.MapType) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.SequenceMapping.class, reader);
- }
+ /**
+ *
+ *
+ * @param handler
+ * @throws java.io.IOException
+ * if an IOException occurs during marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ */
+ public void marshal(final org.xml.sax.ContentHandler handler)
+ throws java.io.IOException, org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, handler);
+ }
- /**
- *
- *
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void validate(
- )
- throws org.exolab.castor.xml.ValidationException {
- org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
- validator.validate(this);
- }
+ /**
+ * Sets the value of field 'id'.
+ *
+ * @param id
+ * the value of field 'id'.
+ */
+ public void setId(final java.lang.String id) {
+ this._id = id;
+ }
+
+ /**
+ * Sets the value of field 'loc'. The field 'loc' has the following
+ * description: Object on which the local range is defined.
+ *
+ * @param loc
+ * the value of field 'loc'.
+ */
+ public void setLoc(final java.lang.Object loc) {
+ this._loc = loc;
+ }
+
+ /**
+ * Sets the value of field 'map'. The field 'map' has the following
+ * description: Object on which the mapped range is defined.
+ *
+ * @param map
+ * the value of field 'map'.
+ */
+ public void setMap(final java.lang.Object map) {
+ this._map = map;
+ }
+
+ /**
+ * Sets the value of field 'provenance'.
+ *
+ * @param provenance
+ * the value of field 'provenance'.
+ */
+ public void setProvenance(
+ final uk.ac.vamsas.objects.core.Provenance provenance) {
+ this._provenance = provenance;
+ }
+
+ /**
+ * Method unmarshal.
+ *
+ * @param reader
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @return the unmarshaled uk.ac.vamsas.objects.core.MapType
+ */
+ public static uk.ac.vamsas.objects.core.MapType unmarshal(
+ final java.io.Reader reader)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ return (uk.ac.vamsas.objects.core.MapType) Unmarshaller.unmarshal(
+ uk.ac.vamsas.objects.core.SequenceMapping.class, reader);
+ }
+
+ /**
+ *
+ *
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void validate() throws org.exolab.castor.xml.ValidationException {
+ org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+ validator.validate(this);
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/SequenceType.java b/src/uk/ac/vamsas/objects/core/SequenceType.java
index 1a89b6c..1655f75 100644
--- a/src/uk/ac/vamsas/objects/core/SequenceType.java
+++ b/src/uk/ac/vamsas/objects/core/SequenceType.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import org.exolab.castor.xml.Marshaller;
@@ -17,629 +31,650 @@ import org.exolab.castor.xml.Unmarshaller;
/**
* Class SequenceType.
*
- * @version $Revision$ $Date$
+ * @version $Revision$ $Date: 2007-06-28 14:51:44 +0100 (Thu, 28 Jun 2007)
+ * $
*/
-public class SequenceType extends uk.ac.vamsas.client.Vobject
-implements java.io.Serializable
-{
-
-
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
- * Field _start.
- */
- private long _start;
-
- /**
- * keeps track of state for field: _start
- */
- private boolean _has_start;
-
- /**
- * Field _end.
- */
- private long _end;
-
- /**
- * keeps track of state for field: _end
- */
- private boolean _has_end;
-
- /**
- * Field _sequence.
- */
- private java.lang.String _sequence;
-
- /**
- * Field _name.
- */
- private java.lang.String _name;
-
- /**
- * Field _description.
- */
- private java.lang.String _description;
-
- /**
- * additional typed properties
- */
- private java.util.Vector _propertyList;
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public SequenceType() {
- super();
- this._propertyList = new java.util.Vector();
- }
-
-
- //-----------/
- //- Methods -/
- //-----------/
-
- /**
- *
- *
- * @param vProperty
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addProperty(
- final uk.ac.vamsas.objects.core.Property vProperty)
- throws java.lang.IndexOutOfBoundsException {
- this._propertyList.addElement(vProperty);
- }
-
- /**
- *
- *
- * @param index
- * @param vProperty
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addProperty(
- final int index,
- final uk.ac.vamsas.objects.core.Property vProperty)
- throws java.lang.IndexOutOfBoundsException {
- this._propertyList.add(index, vProperty);
- }
-
- /**
- */
- public void deleteEnd(
- ) {
- this._has_end= false;
- }
-
- /**
- */
- public void deleteStart(
- ) {
- this._has_start= false;
- }
-
- /**
- * Method enumerateProperty.
- *
- * @return an Enumeration over all
- * uk.ac.vamsas.objects.core.Property elements
- */
- public java.util.Enumeration enumerateProperty(
- ) {
- return this._propertyList.elements();
- }
-
- /**
- * Overrides the java.lang.Object.equals method.
- *
- * @param obj
- * @return true if the objects are equal.
- */
- public boolean equals(
- final java.lang.Object obj) {
- if ( this == obj )
- return true;
-
- if (super.equals(obj)==false)
+public class SequenceType extends uk.ac.vamsas.client.Vobject implements
+ java.io.Serializable {
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * Field _start.
+ */
+ private long _start;
+
+ /**
+ * keeps track of state for field: _start
+ */
+ private boolean _has_start;
+
+ /**
+ * Field _end.
+ */
+ private long _end;
+
+ /**
+ * keeps track of state for field: _end
+ */
+ private boolean _has_end;
+
+ /**
+ * Field _sequence.
+ */
+ private java.lang.String _sequence;
+
+ /**
+ * Field _name.
+ */
+ private java.lang.String _name;
+
+ /**
+ * Field _description.
+ */
+ private java.lang.String _description;
+
+ /**
+ * additional typed properties
+ */
+ private java.util.Vector _propertyList;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public SequenceType() {
+ super();
+ this._propertyList = new java.util.Vector();
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ *
+ *
+ * @param vProperty
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addProperty(final uk.ac.vamsas.objects.core.Property vProperty)
+ throws java.lang.IndexOutOfBoundsException {
+ this._propertyList.addElement(vProperty);
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vProperty
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addProperty(final int index,
+ final uk.ac.vamsas.objects.core.Property vProperty)
+ throws java.lang.IndexOutOfBoundsException {
+ this._propertyList.add(index, vProperty);
+ }
+
+ /**
+ */
+ public void deleteEnd() {
+ this._has_end = false;
+ }
+
+ /**
+ */
+ public void deleteStart() {
+ this._has_start = false;
+ }
+
+ /**
+ * Method enumerateProperty.
+ *
+ * @return an Enumeration over all uk.ac.vamsas.objects.core.Property elements
+ */
+ public java.util.Enumeration enumerateProperty() {
+ return this._propertyList.elements();
+ }
+
+ /**
+ * Overrides the java.lang.Object.equals method.
+ *
+ * @param obj
+ * @return true if the objects are equal.
+ */
+ public boolean equals(final java.lang.Object obj) {
+ if (this == obj)
+ return true;
+
+ if (super.equals(obj) == false)
+ return false;
+
+ if (obj instanceof SequenceType) {
+
+ SequenceType temp = (SequenceType) obj;
+ boolean thcycle;
+ boolean tmcycle;
+ if (this._start != temp._start)
+ return false;
+ if (this._has_start != temp._has_start)
+ return false;
+ if (this._end != temp._end)
+ return false;
+ if (this._has_end != temp._has_end)
+ return false;
+ if (this._sequence != null) {
+ if (temp._sequence == null)
+ return false;
+ if (this._sequence != temp._sequence) {
+ thcycle = org.castor.util.CycleBreaker
+ .startingToCycle(this._sequence);
+ tmcycle = org.castor.util.CycleBreaker
+ .startingToCycle(temp._sequence);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._sequence);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._sequence);
+ }
+ ;
return false;
-
- if (obj instanceof SequenceType) {
-
- SequenceType temp = (SequenceType)obj;
- boolean thcycle;
- boolean tmcycle;
- if (this._start != temp._start)
- return false;
- if (this._has_start != temp._has_start)
- return false;
- if (this._end != temp._end)
- return false;
- if (this._has_end != temp._has_end)
- return false;
- if (this._sequence != null) {
- if (temp._sequence == null) return false;
- if (this._sequence != temp._sequence) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._sequence);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._sequence);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._sequence); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._sequence); };
- return false;
- }
- if (!thcycle) {
- if (!this._sequence.equals(temp._sequence)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._sequence);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._sequence);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._sequence);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._sequence);
- }
- }
- } else if (temp._sequence != null)
- return false;
- if (this._name != null) {
- if (temp._name == null) return false;
- if (this._name != temp._name) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._name);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._name);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._name); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._name); };
- return false;
- }
- if (!thcycle) {
- if (!this._name.equals(temp._name)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._name);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._name);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._name);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._name);
- }
- }
- } else if (temp._name != null)
- return false;
- if (this._description != null) {
- if (temp._description == null) return false;
- if (this._description != temp._description) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._description);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._description);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._description); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._description); };
- return false;
- }
- if (!thcycle) {
- if (!this._description.equals(temp._description)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._description);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._description);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._description);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._description);
- }
- }
- } else if (temp._description != null)
- return false;
- if (this._propertyList != null) {
- if (temp._propertyList == null) return false;
- if (this._propertyList != temp._propertyList) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._propertyList);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._propertyList);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._propertyList); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._propertyList); };
- return false;
- }
- if (!thcycle) {
- if (!this._propertyList.equals(temp._propertyList)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._propertyList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._propertyList);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._propertyList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._propertyList);
- }
- }
- } else if (temp._propertyList != null)
- return false;
- return true;
+ }
+ if (!thcycle) {
+ if (!this._sequence.equals(temp._sequence)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._sequence);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._sequence);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._sequence);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._sequence);
+ }
}
+ } else if (temp._sequence != null)
return false;
- }
-
- /**
- * Returns the value of field 'description'.
- *
- * @return the value of field 'Description'.
- */
- public java.lang.String getDescription(
- ) {
- return this._description;
- }
-
- /**
- * Returns the value of field 'end'.
- *
- * @return the value of field 'End'.
- */
- public long getEnd(
- ) {
- return this._end;
- }
-
- /**
- * Returns the value of field 'name'.
- *
- * @return the value of field 'Name'.
- */
- public java.lang.String getName(
- ) {
- return this._name;
- }
-
- /**
- * Method getProperty.
- *
- * @param index
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- * @return the value of the uk.ac.vamsas.objects.core.Property
- * at the given index
- */
- public uk.ac.vamsas.objects.core.Property getProperty(
- final int index)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._propertyList.size()) {
- throw new IndexOutOfBoundsException("getProperty: Index value '" + index + "' not in range [0.." + (this._propertyList.size() - 1) + "]");
- }
-
- return (uk.ac.vamsas.objects.core.Property) _propertyList.get(index);
- }
-
- /**
- * Method getProperty.Returns the contents of the collection in
- * an Array.
Note: Just in case the collection contents
- * are changing in another thread, we pass a 0-length Array of
- * the correct type into the API call. This way we know
- * that the Array returned is of exactly the correct length.
- *
- * @return this collection as an Array
- */
- public uk.ac.vamsas.objects.core.Property[] getProperty(
- ) {
- uk.ac.vamsas.objects.core.Property[] array = new uk.ac.vamsas.objects.core.Property[0];
- return (uk.ac.vamsas.objects.core.Property[]) this._propertyList.toArray(array);
- }
-
- /**
- * Method getPropertyAsReference.Returns a reference to
- * '_propertyList'. No type checking is performed on any
- * modifications to the Vector.
- *
- * @return a reference to the Vector backing this class
- */
- public java.util.Vector getPropertyAsReference(
- ) {
- return this._propertyList;
- }
-
- /**
- * Method getPropertyCount.
- *
- * @return the size of this collection
- */
- public int getPropertyCount(
- ) {
- return this._propertyList.size();
- }
-
- /**
- * Returns the value of field 'sequence'.
- *
- * @return the value of field 'Sequence'.
- */
- public java.lang.String getSequence(
- ) {
- return this._sequence;
- }
-
- /**
- * Returns the value of field 'start'.
- *
- * @return the value of field 'Start'.
- */
- public long getStart(
- ) {
- return this._start;
- }
-
- /**
- * Method hasEnd.
- *
- * @return true if at least one End has been added
- */
- public boolean hasEnd(
- ) {
- return this._has_end;
- }
-
- /**
- * Method hasStart.
- *
- * @return true if at least one Start has been added
- */
- public boolean hasStart(
- ) {
- return this._has_start;
- }
-
- /**
- * Overrides the java.lang.Object.hashCode method.
- *
- * The following steps came from Effective Java Programming
- * Language Guide by Joshua Bloch, Chapter 3
- *
- * @return a hash code value for the object.
- */
- public int hashCode(
- ) {
- int result = super.hashCode();
-
- long tmp;
- result = 37 * result + (int)(_start^(_start>>>32));
- result = 37 * result + (int)(_end^(_end>>>32));
- if (_sequence != null
- && !org.castor.util.CycleBreaker.startingToCycle(_sequence)) {
- result = 37 * result + _sequence.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_sequence);
- }
- if (_name != null
- && !org.castor.util.CycleBreaker.startingToCycle(_name)) {
- result = 37 * result + _name.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_name);
- }
- if (_description != null
- && !org.castor.util.CycleBreaker.startingToCycle(_description)) {
- result = 37 * result + _description.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_description);
- }
- if (_propertyList != null
- && !org.castor.util.CycleBreaker.startingToCycle(_propertyList)) {
- result = 37 * result + _propertyList.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_propertyList);
- }
-
- return result;
- }
-
- /**
- * Method isValid.
- *
- * @return true if this object is valid according to the schema
- */
- public boolean isValid(
- ) {
- try {
- validate();
- } catch (org.exolab.castor.xml.ValidationException vex) {
+ if (this._name != null) {
+ if (temp._name == null)
+ return false;
+ if (this._name != temp._name) {
+ thcycle = org.castor.util.CycleBreaker.startingToCycle(this._name);
+ tmcycle = org.castor.util.CycleBreaker.startingToCycle(temp._name);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._name);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._name);
+ }
+ ;
return false;
+ }
+ if (!thcycle) {
+ if (!this._name.equals(temp._name)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._name);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._name);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._name);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._name);
+ }
}
- return true;
- }
-
- /**
- *
- *
- * @param out
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void marshal(
- final java.io.Writer out)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, out);
- }
-
- /**
- *
- *
- * @param handler
- * @throws java.io.IOException if an IOException occurs during
- * marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- */
- public void marshal(
- final org.xml.sax.ContentHandler handler)
- throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, handler);
- }
-
- /**
- */
- public void removeAllProperty(
- ) {
- this._propertyList.clear();
- }
-
- /**
- * Method removeProperty.
- *
- * @param vProperty
- * @return true if the object was removed from the collection.
- */
- public boolean removeProperty(
- final uk.ac.vamsas.objects.core.Property vProperty) {
- boolean removed = _propertyList.remove(vProperty);
- return removed;
- }
-
- /**
- * Method removePropertyAt.
- *
- * @param index
- * @return the element removed from the collection
- */
- public uk.ac.vamsas.objects.core.Property removePropertyAt(
- final int index) {
- java.lang.Object obj = this._propertyList.remove(index);
- return (uk.ac.vamsas.objects.core.Property) obj;
- }
-
- /**
- * Sets the value of field 'description'.
- *
- * @param description the value of field 'description'.
- */
- public void setDescription(
- final java.lang.String description) {
- this._description = description;
- }
-
- /**
- * Sets the value of field 'end'.
- *
- * @param end the value of field 'end'.
- */
- public void setEnd(
- final long end) {
- this._end = end;
- this._has_end = true;
- }
-
- /**
- * Sets the value of field 'name'.
- *
- * @param name the value of field 'name'.
- */
- public void setName(
- final java.lang.String name) {
- this._name = name;
- }
-
- /**
- *
- *
- * @param index
- * @param vProperty
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void setProperty(
- final int index,
- final uk.ac.vamsas.objects.core.Property vProperty)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._propertyList.size()) {
- throw new IndexOutOfBoundsException("setProperty: Index value '" + index + "' not in range [0.." + (this._propertyList.size() - 1) + "]");
+ } else if (temp._name != null)
+ return false;
+ if (this._description != null) {
+ if (temp._description == null)
+ return false;
+ if (this._description != temp._description) {
+ thcycle = org.castor.util.CycleBreaker
+ .startingToCycle(this._description);
+ tmcycle = org.castor.util.CycleBreaker
+ .startingToCycle(temp._description);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(this._description);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(temp._description);
+ }
+ ;
+ return false;
+ }
+ if (!thcycle) {
+ if (!this._description.equals(temp._description)) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(this._description);
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(temp._description);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._description);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._description);
+ }
}
-
- this._propertyList.set(index, vProperty);
- }
-
- /**
- *
- *
- * @param vPropertyArray
- */
- public void setProperty(
- final uk.ac.vamsas.objects.core.Property[] vPropertyArray) {
- //-- copy array
- _propertyList.clear();
-
- for (int i = 0; i < vPropertyArray.length; i++) {
- this._propertyList.add(vPropertyArray[i]);
+ } else if (temp._description != null)
+ return false;
+ if (this._propertyList != null) {
+ if (temp._propertyList == null)
+ return false;
+ if (this._propertyList != temp._propertyList) {
+ thcycle = org.castor.util.CycleBreaker
+ .startingToCycle(this._propertyList);
+ tmcycle = org.castor.util.CycleBreaker
+ .startingToCycle(temp._propertyList);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(this._propertyList);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(temp._propertyList);
+ }
+ ;
+ return false;
+ }
+ if (!thcycle) {
+ if (!this._propertyList.equals(temp._propertyList)) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(this._propertyList);
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(temp._propertyList);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._propertyList);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._propertyList);
+ }
}
- }
-
- /**
- * Sets the value of '_propertyList' by copying the given
- * Vector. All elements will be checked for type safety.
- *
- * @param vPropertyList the Vector to copy.
- */
- public void setProperty(
- final java.util.Vector vPropertyList) {
- // copy vector
- this._propertyList.clear();
-
- this._propertyList.addAll(vPropertyList);
- }
-
- /**
- * Sets the value of '_propertyList' by setting it to the given
- * Vector. No type checking is performed.
- * @deprecated
- *
- * @param propertyVector the Vector to set.
- */
- public void setPropertyAsReference(
- final java.util.Vector propertyVector) {
- this._propertyList = propertyVector;
- }
-
- /**
- * Sets the value of field 'sequence'.
- *
- * @param sequence the value of field 'sequence'.
- */
- public void setSequence(
- final java.lang.String sequence) {
- this._sequence = sequence;
- }
-
- /**
- * Sets the value of field 'start'.
- *
- * @param start the value of field 'start'.
- */
- public void setStart(
- final long start) {
- this._start = start;
- this._has_start = true;
- }
-
- /**
- * Method unmarshal.
- *
- * @param reader
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @return the unmarshaled uk.ac.vamsas.objects.core.SequenceTyp
- */
- public static uk.ac.vamsas.objects.core.SequenceType unmarshal(
- final java.io.Reader reader)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- return (uk.ac.vamsas.objects.core.SequenceType) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.SequenceType.class, reader);
- }
-
- /**
- *
- *
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void validate(
- )
- throws org.exolab.castor.xml.ValidationException {
- org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
- validator.validate(this);
- }
+ } else if (temp._propertyList != null)
+ return false;
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Returns the value of field 'description'.
+ *
+ * @return the value of field 'Description'.
+ */
+ public java.lang.String getDescription() {
+ return this._description;
+ }
+
+ /**
+ * Returns the value of field 'end'.
+ *
+ * @return the value of field 'End'.
+ */
+ public long getEnd() {
+ return this._end;
+ }
+
+ /**
+ * Returns the value of field 'name'.
+ *
+ * @return the value of field 'Name'.
+ */
+ public java.lang.String getName() {
+ return this._name;
+ }
+
+ /**
+ * Method getProperty.
+ *
+ * @param index
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ * @return the value of the uk.ac.vamsas.objects.core.Property at the given
+ * index
+ */
+ public uk.ac.vamsas.objects.core.Property getProperty(final int index)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._propertyList.size()) {
+ throw new IndexOutOfBoundsException("getProperty: Index value '" + index
+ + "' not in range [0.." + (this._propertyList.size() - 1) + "]");
+ }
+
+ return (uk.ac.vamsas.objects.core.Property) _propertyList.get(index);
+ }
+
+ /**
+ * Method getProperty.Returns the contents of the collection in an Array.
+ *
+ * Note: Just in case the collection contents are changing in another thread,
+ * we pass a 0-length Array of the correct type into the API call. This way we
+ * know that the Array returned is of exactly the correct length.
+ *
+ * @return this collection as an Array
+ */
+ public uk.ac.vamsas.objects.core.Property[] getProperty() {
+ uk.ac.vamsas.objects.core.Property[] array = new uk.ac.vamsas.objects.core.Property[0];
+ return (uk.ac.vamsas.objects.core.Property[]) this._propertyList
+ .toArray(array);
+ }
+
+ /**
+ * Method getPropertyAsReference.Returns a reference to '_propertyList'. No
+ * type checking is performed on any modifications to the Vector.
+ *
+ * @return a reference to the Vector backing this class
+ */
+ public java.util.Vector getPropertyAsReference() {
+ return this._propertyList;
+ }
+
+ /**
+ * Method getPropertyCount.
+ *
+ * @return the size of this collection
+ */
+ public int getPropertyCount() {
+ return this._propertyList.size();
+ }
+
+ /**
+ * Returns the value of field 'sequence'.
+ *
+ * @return the value of field 'Sequence'.
+ */
+ public java.lang.String getSequence() {
+ return this._sequence;
+ }
+
+ /**
+ * Returns the value of field 'start'.
+ *
+ * @return the value of field 'Start'.
+ */
+ public long getStart() {
+ return this._start;
+ }
+
+ /**
+ * Method hasEnd.
+ *
+ * @return true if at least one End has been added
+ */
+ public boolean hasEnd() {
+ return this._has_end;
+ }
+
+ /**
+ * Method hasStart.
+ *
+ * @return true if at least one Start has been added
+ */
+ public boolean hasStart() {
+ return this._has_start;
+ }
+
+ /**
+ * Overrides the java.lang.Object.hashCode method.
+ *
+ * The following steps came from Effective Java Programming Language
+ * Guide by Joshua Bloch, Chapter 3
+ *
+ * @return a hash code value for the object.
+ */
+ public int hashCode() {
+ int result = super.hashCode();
+
+ long tmp;
+ result = 37 * result + (int) (_start ^ (_start >>> 32));
+ result = 37 * result + (int) (_end ^ (_end >>> 32));
+ if (_sequence != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_sequence)) {
+ result = 37 * result + _sequence.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_sequence);
+ }
+ if (_name != null && !org.castor.util.CycleBreaker.startingToCycle(_name)) {
+ result = 37 * result + _name.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_name);
+ }
+ if (_description != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_description)) {
+ result = 37 * result + _description.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_description);
+ }
+ if (_propertyList != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_propertyList)) {
+ result = 37 * result + _propertyList.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_propertyList);
+ }
+
+ return result;
+ }
+
+ /**
+ * Method isValid.
+ *
+ * @return true if this object is valid according to the schema
+ */
+ public boolean isValid() {
+ try {
+ validate();
+ } catch (org.exolab.castor.xml.ValidationException vex) {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ *
+ *
+ * @param out
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void marshal(final java.io.Writer out)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, out);
+ }
+
+ /**
+ *
+ *
+ * @param handler
+ * @throws java.io.IOException
+ * if an IOException occurs during marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ */
+ public void marshal(final org.xml.sax.ContentHandler handler)
+ throws java.io.IOException, org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, handler);
+ }
+
+ /**
+ */
+ public void removeAllProperty() {
+ this._propertyList.clear();
+ }
+
+ /**
+ * Method removeProperty.
+ *
+ * @param vProperty
+ * @return true if the object was removed from the collection.
+ */
+ public boolean removeProperty(
+ final uk.ac.vamsas.objects.core.Property vProperty) {
+ boolean removed = _propertyList.remove(vProperty);
+ return removed;
+ }
+
+ /**
+ * Method removePropertyAt.
+ *
+ * @param index
+ * @return the element removed from the collection
+ */
+ public uk.ac.vamsas.objects.core.Property removePropertyAt(final int index) {
+ java.lang.Object obj = this._propertyList.remove(index);
+ return (uk.ac.vamsas.objects.core.Property) obj;
+ }
+
+ /**
+ * Sets the value of field 'description'.
+ *
+ * @param description
+ * the value of field 'description'.
+ */
+ public void setDescription(final java.lang.String description) {
+ this._description = description;
+ }
+
+ /**
+ * Sets the value of field 'end'.
+ *
+ * @param end
+ * the value of field 'end'.
+ */
+ public void setEnd(final long end) {
+ this._end = end;
+ this._has_end = true;
+ }
+
+ /**
+ * Sets the value of field 'name'.
+ *
+ * @param name
+ * the value of field 'name'.
+ */
+ public void setName(final java.lang.String name) {
+ this._name = name;
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vProperty
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void setProperty(final int index,
+ final uk.ac.vamsas.objects.core.Property vProperty)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._propertyList.size()) {
+ throw new IndexOutOfBoundsException("setProperty: Index value '" + index
+ + "' not in range [0.." + (this._propertyList.size() - 1) + "]");
+ }
+
+ this._propertyList.set(index, vProperty);
+ }
+
+ /**
+ *
+ *
+ * @param vPropertyArray
+ */
+ public void setProperty(
+ final uk.ac.vamsas.objects.core.Property[] vPropertyArray) {
+ // -- copy array
+ _propertyList.clear();
+
+ for (int i = 0; i < vPropertyArray.length; i++) {
+ this._propertyList.add(vPropertyArray[i]);
+ }
+ }
+
+ /**
+ * Sets the value of '_propertyList' by copying the given Vector. All elements
+ * will be checked for type safety.
+ *
+ * @param vPropertyList
+ * the Vector to copy.
+ */
+ public void setProperty(final java.util.Vector vPropertyList) {
+ // copy vector
+ this._propertyList.clear();
+
+ this._propertyList.addAll(vPropertyList);
+ }
+
+ /**
+ * Sets the value of '_propertyList' by setting it to the given Vector. No
+ * type checking is performed.
+ *
+ * @deprecated
+ *
+ * @param propertyVector
+ * the Vector to set.
+ */
+ public void setPropertyAsReference(final java.util.Vector propertyVector) {
+ this._propertyList = propertyVector;
+ }
+
+ /**
+ * Sets the value of field 'sequence'.
+ *
+ * @param sequence
+ * the value of field 'sequence'.
+ */
+ public void setSequence(final java.lang.String sequence) {
+ this._sequence = sequence;
+ }
+
+ /**
+ * Sets the value of field 'start'.
+ *
+ * @param start
+ * the value of field 'start'.
+ */
+ public void setStart(final long start) {
+ this._start = start;
+ this._has_start = true;
+ }
+
+ /**
+ * Method unmarshal.
+ *
+ * @param reader
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @return the unmarshaled uk.ac.vamsas.objects.core.SequenceTyp
+ */
+ public static uk.ac.vamsas.objects.core.SequenceType unmarshal(
+ final java.io.Reader reader)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ return (uk.ac.vamsas.objects.core.SequenceType) Unmarshaller.unmarshal(
+ uk.ac.vamsas.objects.core.SequenceType.class, reader);
+ }
+
+ /**
+ *
+ *
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void validate() throws org.exolab.castor.xml.ValidationException {
+ org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+ validator.validate(this);
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/Tree.java b/src/uk/ac/vamsas/objects/core/Tree.java
index 39eb763..12b8031 100644
--- a/src/uk/ac/vamsas/objects/core/Tree.java
+++ b/src/uk/ac/vamsas/objects/core/Tree.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import org.exolab.castor.xml.Marshaller;
@@ -17,1022 +31,1052 @@ import org.exolab.castor.xml.Unmarshaller;
/**
* Class Tree.
*
- * @version $Revision$ $Date$
+ * @version $Revision$ $Date: 2007-06-28 14:51:44 +0100 (Thu, 28 Jun 2007)
+ * $
*/
-public class Tree extends uk.ac.vamsas.client.Vobject
-implements java.io.Serializable
-{
-
-
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
- * Primary Key for vamsas object referencing
- */
- private java.lang.String _id;
-
- /**
- * Field _modifiable.
- */
- private java.lang.String _modifiable;
-
- /**
- * Field _title.
- */
- private java.lang.String _title;
-
- /**
- * Field _newickList.
- */
- private java.util.Vector _newickList;
-
- /**
- * node identity and mapping data between tree
- * representations and vamsas document objects
- */
- private java.util.Vector _treenodeList;
-
- /**
- * Field _propertyList.
- */
- private java.util.Vector _propertyList;
-
- /**
- * Field _provenance.
- */
- private uk.ac.vamsas.objects.core.Provenance _provenance;
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public Tree() {
- super();
- this._newickList = new java.util.Vector();
- this._treenodeList = new java.util.Vector();
- this._propertyList = new java.util.Vector();
- }
-
-
- //-----------/
- //- Methods -/
- //-----------/
-
- /**
- *
- *
- * @param vNewick
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addNewick(
- final uk.ac.vamsas.objects.core.Newick vNewick)
- throws java.lang.IndexOutOfBoundsException {
- this._newickList.addElement(vNewick);
- }
-
- /**
- *
- *
- * @param index
- * @param vNewick
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addNewick(
- final int index,
- final uk.ac.vamsas.objects.core.Newick vNewick)
- throws java.lang.IndexOutOfBoundsException {
- this._newickList.add(index, vNewick);
- }
-
- /**
- *
- *
- * @param vProperty
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addProperty(
- final uk.ac.vamsas.objects.core.Property vProperty)
- throws java.lang.IndexOutOfBoundsException {
- this._propertyList.addElement(vProperty);
- }
-
- /**
- *
- *
- * @param index
- * @param vProperty
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addProperty(
- final int index,
- final uk.ac.vamsas.objects.core.Property vProperty)
- throws java.lang.IndexOutOfBoundsException {
- this._propertyList.add(index, vProperty);
- }
-
- /**
- *
- *
- * @param vTreenode
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addTreenode(
- final uk.ac.vamsas.objects.core.Treenode vTreenode)
- throws java.lang.IndexOutOfBoundsException {
- this._treenodeList.addElement(vTreenode);
- }
-
- /**
- *
- *
- * @param index
- * @param vTreenode
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addTreenode(
- final int index,
- final uk.ac.vamsas.objects.core.Treenode vTreenode)
- throws java.lang.IndexOutOfBoundsException {
- this._treenodeList.add(index, vTreenode);
- }
-
- /**
- * Method enumerateNewick.
- *
- * @return an Enumeration over all
- * uk.ac.vamsas.objects.core.Newick elements
- */
- public java.util.Enumeration enumerateNewick(
- ) {
- return this._newickList.elements();
- }
-
- /**
- * Method enumerateProperty.
- *
- * @return an Enumeration over all
- * uk.ac.vamsas.objects.core.Property elements
- */
- public java.util.Enumeration enumerateProperty(
- ) {
- return this._propertyList.elements();
- }
-
- /**
- * Method enumerateTreenode.
- *
- * @return an Enumeration over all
- * uk.ac.vamsas.objects.core.Treenode elements
- */
- public java.util.Enumeration enumerateTreenode(
- ) {
- return this._treenodeList.elements();
- }
-
- /**
- * Overrides the java.lang.Object.equals method.
- *
- * @param obj
- * @return true if the objects are equal.
- */
- public boolean equals(
- final java.lang.Object obj) {
- if ( this == obj )
- return true;
-
- if (super.equals(obj)==false)
+public class Tree extends uk.ac.vamsas.client.Vobject implements
+ java.io.Serializable {
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * Primary Key for vamsas object referencing
+ */
+ private java.lang.String _id;
+
+ /**
+ * Field _modifiable.
+ */
+ private java.lang.String _modifiable;
+
+ /**
+ * Field _title.
+ */
+ private java.lang.String _title;
+
+ /**
+ * Field _newickList.
+ */
+ private java.util.Vector _newickList;
+
+ /**
+ * node identity and mapping data between tree representations and vamsas
+ * document objects
+ */
+ private java.util.Vector _treenodeList;
+
+ /**
+ * Field _propertyList.
+ */
+ private java.util.Vector _propertyList;
+
+ /**
+ * Field _provenance.
+ */
+ private uk.ac.vamsas.objects.core.Provenance _provenance;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public Tree() {
+ super();
+ this._newickList = new java.util.Vector();
+ this._treenodeList = new java.util.Vector();
+ this._propertyList = new java.util.Vector();
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ *
+ *
+ * @param vNewick
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addNewick(final uk.ac.vamsas.objects.core.Newick vNewick)
+ throws java.lang.IndexOutOfBoundsException {
+ this._newickList.addElement(vNewick);
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vNewick
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addNewick(final int index,
+ final uk.ac.vamsas.objects.core.Newick vNewick)
+ throws java.lang.IndexOutOfBoundsException {
+ this._newickList.add(index, vNewick);
+ }
+
+ /**
+ *
+ *
+ * @param vProperty
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addProperty(final uk.ac.vamsas.objects.core.Property vProperty)
+ throws java.lang.IndexOutOfBoundsException {
+ this._propertyList.addElement(vProperty);
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vProperty
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addProperty(final int index,
+ final uk.ac.vamsas.objects.core.Property vProperty)
+ throws java.lang.IndexOutOfBoundsException {
+ this._propertyList.add(index, vProperty);
+ }
+
+ /**
+ *
+ *
+ * @param vTreenode
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addTreenode(final uk.ac.vamsas.objects.core.Treenode vTreenode)
+ throws java.lang.IndexOutOfBoundsException {
+ this._treenodeList.addElement(vTreenode);
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vTreenode
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addTreenode(final int index,
+ final uk.ac.vamsas.objects.core.Treenode vTreenode)
+ throws java.lang.IndexOutOfBoundsException {
+ this._treenodeList.add(index, vTreenode);
+ }
+
+ /**
+ * Method enumerateNewick.
+ *
+ * @return an Enumeration over all uk.ac.vamsas.objects.core.Newick elements
+ */
+ public java.util.Enumeration enumerateNewick() {
+ return this._newickList.elements();
+ }
+
+ /**
+ * Method enumerateProperty.
+ *
+ * @return an Enumeration over all uk.ac.vamsas.objects.core.Property elements
+ */
+ public java.util.Enumeration enumerateProperty() {
+ return this._propertyList.elements();
+ }
+
+ /**
+ * Method enumerateTreenode.
+ *
+ * @return an Enumeration over all uk.ac.vamsas.objects.core.Treenode elements
+ */
+ public java.util.Enumeration enumerateTreenode() {
+ return this._treenodeList.elements();
+ }
+
+ /**
+ * Overrides the java.lang.Object.equals method.
+ *
+ * @param obj
+ * @return true if the objects are equal.
+ */
+ public boolean equals(final java.lang.Object obj) {
+ if (this == obj)
+ return true;
+
+ if (super.equals(obj) == false)
+ return false;
+
+ if (obj instanceof Tree) {
+
+ Tree temp = (Tree) obj;
+ boolean thcycle;
+ boolean tmcycle;
+ if (this._id != null) {
+ if (temp._id == null)
+ return false;
+ if (this._id != temp._id) {
+ thcycle = org.castor.util.CycleBreaker.startingToCycle(this._id);
+ tmcycle = org.castor.util.CycleBreaker.startingToCycle(temp._id);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
+ }
+ ;
return false;
-
- if (obj instanceof Tree) {
-
- Tree temp = (Tree)obj;
- boolean thcycle;
- boolean tmcycle;
- if (this._id != null) {
- if (temp._id == null) return false;
- if (this._id != temp._id) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._id);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._id);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._id); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._id); };
- return false;
- }
- if (!thcycle) {
- if (!this._id.equals(temp._id)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
- }
- }
- } else if (temp._id != null)
- return false;
- if (this._modifiable != null) {
- if (temp._modifiable == null) return false;
- if (this._modifiable != temp._modifiable) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._modifiable);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._modifiable);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._modifiable); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._modifiable); };
- return false;
- }
- if (!thcycle) {
- if (!this._modifiable.equals(temp._modifiable)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._modifiable);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._modifiable);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._modifiable);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._modifiable);
- }
- }
- } else if (temp._modifiable != null)
- return false;
- if (this._title != null) {
- if (temp._title == null) return false;
- if (this._title != temp._title) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._title);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._title);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._title); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._title); };
- return false;
- }
- if (!thcycle) {
- if (!this._title.equals(temp._title)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._title);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._title);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._title);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._title);
- }
- }
- } else if (temp._title != null)
- return false;
- if (this._newickList != null) {
- if (temp._newickList == null) return false;
- if (this._newickList != temp._newickList) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._newickList);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._newickList);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._newickList); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._newickList); };
- return false;
- }
- if (!thcycle) {
- if (!this._newickList.equals(temp._newickList)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._newickList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._newickList);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._newickList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._newickList);
- }
- }
- } else if (temp._newickList != null)
- return false;
- if (this._treenodeList != null) {
- if (temp._treenodeList == null) return false;
- if (this._treenodeList != temp._treenodeList) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._treenodeList);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._treenodeList);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._treenodeList); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._treenodeList); };
- return false;
- }
- if (!thcycle) {
- if (!this._treenodeList.equals(temp._treenodeList)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._treenodeList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._treenodeList);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._treenodeList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._treenodeList);
- }
- }
- } else if (temp._treenodeList != null)
- return false;
- if (this._propertyList != null) {
- if (temp._propertyList == null) return false;
- if (this._propertyList != temp._propertyList) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._propertyList);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._propertyList);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._propertyList); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._propertyList); };
- return false;
- }
- if (!thcycle) {
- if (!this._propertyList.equals(temp._propertyList)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._propertyList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._propertyList);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._propertyList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._propertyList);
- }
- }
- } else if (temp._propertyList != null)
- return false;
- if (this._provenance != null) {
- if (temp._provenance == null) return false;
- if (this._provenance != temp._provenance) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._provenance);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._provenance);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance); };
- return false;
- }
- if (!thcycle) {
- if (!this._provenance.equals(temp._provenance)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance);
- }
- }
- } else if (temp._provenance != null)
- return false;
- return true;
+ }
+ if (!thcycle) {
+ if (!this._id.equals(temp._id)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
+ }
}
+ } else if (temp._id != null)
return false;
- }
-
- /**
- * Returns the value of field 'id'. The field 'id' has the
- * following description: Primary Key for vamsas object
- * referencing
- *
- * @return the value of field 'Id'.
- */
- public java.lang.String getId(
- ) {
- return this._id;
- }
-
- /**
- * Returns the value of field 'modifiable'.
- *
- * @return the value of field 'Modifiable'.
- */
- public java.lang.String getModifiable(
- ) {
- return this._modifiable;
- }
-
- /**
- * Method getNewick.
- *
- * @param index
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- * @return the value of the uk.ac.vamsas.objects.core.Newick at
- * the given index
- */
- public uk.ac.vamsas.objects.core.Newick getNewick(
- final int index)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._newickList.size()) {
- throw new IndexOutOfBoundsException("getNewick: Index value '" + index + "' not in range [0.." + (this._newickList.size() - 1) + "]");
- }
-
- return (uk.ac.vamsas.objects.core.Newick) _newickList.get(index);
- }
-
- /**
- * Method getNewick.Returns the contents of the collection in
- * an Array.
Note: Just in case the collection contents
- * are changing in another thread, we pass a 0-length Array of
- * the correct type into the API call. This way we know
- * that the Array returned is of exactly the correct length.
- *
- * @return this collection as an Array
- */
- public uk.ac.vamsas.objects.core.Newick[] getNewick(
- ) {
- uk.ac.vamsas.objects.core.Newick[] array = new uk.ac.vamsas.objects.core.Newick[0];
- return (uk.ac.vamsas.objects.core.Newick[]) this._newickList.toArray(array);
- }
-
- /**
- * Method getNewickAsReference.Returns a reference to
- * '_newickList'. No type checking is performed on any
- * modifications to the Vector.
- *
- * @return a reference to the Vector backing this class
- */
- public java.util.Vector getNewickAsReference(
- ) {
- return this._newickList;
- }
-
- /**
- * Method getNewickCount.
- *
- * @return the size of this collection
- */
- public int getNewickCount(
- ) {
- return this._newickList.size();
- }
-
- /**
- * Method getProperty.
- *
- * @param index
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- * @return the value of the uk.ac.vamsas.objects.core.Property
- * at the given index
- */
- public uk.ac.vamsas.objects.core.Property getProperty(
- final int index)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._propertyList.size()) {
- throw new IndexOutOfBoundsException("getProperty: Index value '" + index + "' not in range [0.." + (this._propertyList.size() - 1) + "]");
- }
-
- return (uk.ac.vamsas.objects.core.Property) _propertyList.get(index);
- }
-
- /**
- * Method getProperty.Returns the contents of the collection in
- * an Array.
Note: Just in case the collection contents
- * are changing in another thread, we pass a 0-length Array of
- * the correct type into the API call. This way we know
- * that the Array returned is of exactly the correct length.
- *
- * @return this collection as an Array
- */
- public uk.ac.vamsas.objects.core.Property[] getProperty(
- ) {
- uk.ac.vamsas.objects.core.Property[] array = new uk.ac.vamsas.objects.core.Property[0];
- return (uk.ac.vamsas.objects.core.Property[]) this._propertyList.toArray(array);
- }
-
- /**
- * Method getPropertyAsReference.Returns a reference to
- * '_propertyList'. No type checking is performed on any
- * modifications to the Vector.
- *
- * @return a reference to the Vector backing this class
- */
- public java.util.Vector getPropertyAsReference(
- ) {
- return this._propertyList;
- }
-
- /**
- * Method getPropertyCount.
- *
- * @return the size of this collection
- */
- public int getPropertyCount(
- ) {
- return this._propertyList.size();
- }
-
- /**
- * Returns the value of field 'provenance'.
- *
- * @return the value of field 'Provenance'.
- */
- public uk.ac.vamsas.objects.core.Provenance getProvenance(
- ) {
- return this._provenance;
- }
-
- /**
- * Returns the value of field 'title'.
- *
- * @return the value of field 'Title'.
- */
- public java.lang.String getTitle(
- ) {
- return this._title;
- }
-
- /**
- * Method getTreenode.
- *
- * @param index
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- * @return the value of the uk.ac.vamsas.objects.core.Treenode
- * at the given index
- */
- public uk.ac.vamsas.objects.core.Treenode getTreenode(
- final int index)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._treenodeList.size()) {
- throw new IndexOutOfBoundsException("getTreenode: Index value '" + index + "' not in range [0.." + (this._treenodeList.size() - 1) + "]");
- }
-
- return (uk.ac.vamsas.objects.core.Treenode) _treenodeList.get(index);
- }
-
- /**
- * Method getTreenode.Returns the contents of the collection in
- * an Array.
Note: Just in case the collection contents
- * are changing in another thread, we pass a 0-length Array of
- * the correct type into the API call. This way we know
- * that the Array returned is of exactly the correct length.
- *
- * @return this collection as an Array
- */
- public uk.ac.vamsas.objects.core.Treenode[] getTreenode(
- ) {
- uk.ac.vamsas.objects.core.Treenode[] array = new uk.ac.vamsas.objects.core.Treenode[0];
- return (uk.ac.vamsas.objects.core.Treenode[]) this._treenodeList.toArray(array);
- }
-
- /**
- * Method getTreenodeAsReference.Returns a reference to
- * '_treenodeList'. No type checking is performed on any
- * modifications to the Vector.
- *
- * @return a reference to the Vector backing this class
- */
- public java.util.Vector getTreenodeAsReference(
- ) {
- return this._treenodeList;
- }
-
- /**
- * Method getTreenodeCount.
- *
- * @return the size of this collection
- */
- public int getTreenodeCount(
- ) {
- return this._treenodeList.size();
- }
-
- /**
- * Overrides the java.lang.Object.hashCode method.
- *
- * The following steps came from Effective Java Programming
- * Language Guide by Joshua Bloch, Chapter 3
- *
- * @return a hash code value for the object.
- */
- public int hashCode(
- ) {
- int result = super.hashCode();
-
- long tmp;
- if (_id != null
- && !org.castor.util.CycleBreaker.startingToCycle(_id)) {
- result = 37 * result + _id.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_id);
- }
- if (_modifiable != null
- && !org.castor.util.CycleBreaker.startingToCycle(_modifiable)) {
- result = 37 * result + _modifiable.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_modifiable);
- }
- if (_title != null
- && !org.castor.util.CycleBreaker.startingToCycle(_title)) {
- result = 37 * result + _title.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_title);
+ if (this._modifiable != null) {
+ if (temp._modifiable == null)
+ return false;
+ if (this._modifiable != temp._modifiable) {
+ thcycle = org.castor.util.CycleBreaker
+ .startingToCycle(this._modifiable);
+ tmcycle = org.castor.util.CycleBreaker
+ .startingToCycle(temp._modifiable);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._modifiable);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._modifiable);
+ }
+ ;
+ return false;
+ }
+ if (!thcycle) {
+ if (!this._modifiable.equals(temp._modifiable)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._modifiable);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._modifiable);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._modifiable);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._modifiable);
+ }
}
- if (_newickList != null
- && !org.castor.util.CycleBreaker.startingToCycle(_newickList)) {
- result = 37 * result + _newickList.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_newickList);
+ } else if (temp._modifiable != null)
+ return false;
+ if (this._title != null) {
+ if (temp._title == null)
+ return false;
+ if (this._title != temp._title) {
+ thcycle = org.castor.util.CycleBreaker.startingToCycle(this._title);
+ tmcycle = org.castor.util.CycleBreaker.startingToCycle(temp._title);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._title);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._title);
+ }
+ ;
+ return false;
+ }
+ if (!thcycle) {
+ if (!this._title.equals(temp._title)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._title);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._title);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._title);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._title);
+ }
}
- if (_treenodeList != null
- && !org.castor.util.CycleBreaker.startingToCycle(_treenodeList)) {
- result = 37 * result + _treenodeList.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_treenodeList);
+ } else if (temp._title != null)
+ return false;
+ if (this._newickList != null) {
+ if (temp._newickList == null)
+ return false;
+ if (this._newickList != temp._newickList) {
+ thcycle = org.castor.util.CycleBreaker
+ .startingToCycle(this._newickList);
+ tmcycle = org.castor.util.CycleBreaker
+ .startingToCycle(temp._newickList);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._newickList);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._newickList);
+ }
+ ;
+ return false;
+ }
+ if (!thcycle) {
+ if (!this._newickList.equals(temp._newickList)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._newickList);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._newickList);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._newickList);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._newickList);
+ }
}
- if (_propertyList != null
- && !org.castor.util.CycleBreaker.startingToCycle(_propertyList)) {
- result = 37 * result + _propertyList.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_propertyList);
+ } else if (temp._newickList != null)
+ return false;
+ if (this._treenodeList != null) {
+ if (temp._treenodeList == null)
+ return false;
+ if (this._treenodeList != temp._treenodeList) {
+ thcycle = org.castor.util.CycleBreaker
+ .startingToCycle(this._treenodeList);
+ tmcycle = org.castor.util.CycleBreaker
+ .startingToCycle(temp._treenodeList);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(this._treenodeList);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(temp._treenodeList);
+ }
+ ;
+ return false;
+ }
+ if (!thcycle) {
+ if (!this._treenodeList.equals(temp._treenodeList)) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(this._treenodeList);
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(temp._treenodeList);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._treenodeList);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._treenodeList);
+ }
}
- if (_provenance != null
- && !org.castor.util.CycleBreaker.startingToCycle(_provenance)) {
- result = 37 * result + _provenance.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_provenance);
+ } else if (temp._treenodeList != null)
+ return false;
+ if (this._propertyList != null) {
+ if (temp._propertyList == null)
+ return false;
+ if (this._propertyList != temp._propertyList) {
+ thcycle = org.castor.util.CycleBreaker
+ .startingToCycle(this._propertyList);
+ tmcycle = org.castor.util.CycleBreaker
+ .startingToCycle(temp._propertyList);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(this._propertyList);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(temp._propertyList);
+ }
+ ;
+ return false;
+ }
+ if (!thcycle) {
+ if (!this._propertyList.equals(temp._propertyList)) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(this._propertyList);
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(temp._propertyList);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._propertyList);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._propertyList);
+ }
}
-
- return result;
- }
-
- /**
- * Method isValid.
- *
- * @return true if this object is valid according to the schema
- */
- public boolean isValid(
- ) {
- try {
- validate();
- } catch (org.exolab.castor.xml.ValidationException vex) {
+ } else if (temp._propertyList != null)
+ return false;
+ if (this._provenance != null) {
+ if (temp._provenance == null)
+ return false;
+ if (this._provenance != temp._provenance) {
+ thcycle = org.castor.util.CycleBreaker
+ .startingToCycle(this._provenance);
+ tmcycle = org.castor.util.CycleBreaker
+ .startingToCycle(temp._provenance);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance);
+ }
+ ;
return false;
+ }
+ if (!thcycle) {
+ if (!this._provenance.equals(temp._provenance)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance);
+ }
}
- return true;
- }
-
- /**
- *
- *
- * @param out
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void marshal(
- final java.io.Writer out)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, out);
- }
-
- /**
- *
- *
- * @param handler
- * @throws java.io.IOException if an IOException occurs during
- * marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- */
- public void marshal(
- final org.xml.sax.ContentHandler handler)
- throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, handler);
- }
-
- /**
- */
- public void removeAllNewick(
- ) {
- this._newickList.clear();
- }
-
- /**
- */
- public void removeAllProperty(
- ) {
- this._propertyList.clear();
- }
-
- /**
- */
- public void removeAllTreenode(
- ) {
- this._treenodeList.clear();
- }
-
- /**
- * Method removeNewick.
- *
- * @param vNewick
- * @return true if the object was removed from the collection.
- */
- public boolean removeNewick(
- final uk.ac.vamsas.objects.core.Newick vNewick) {
- boolean removed = _newickList.remove(vNewick);
- return removed;
- }
-
- /**
- * Method removeNewickAt.
- *
- * @param index
- * @return the element removed from the collection
- */
- public uk.ac.vamsas.objects.core.Newick removeNewickAt(
- final int index) {
- java.lang.Object obj = this._newickList.remove(index);
- return (uk.ac.vamsas.objects.core.Newick) obj;
- }
-
- /**
- * Method removeProperty.
- *
- * @param vProperty
- * @return true if the object was removed from the collection.
- */
- public boolean removeProperty(
- final uk.ac.vamsas.objects.core.Property vProperty) {
- boolean removed = _propertyList.remove(vProperty);
- return removed;
- }
-
- /**
- * Method removePropertyAt.
- *
- * @param index
- * @return the element removed from the collection
- */
- public uk.ac.vamsas.objects.core.Property removePropertyAt(
- final int index) {
- java.lang.Object obj = this._propertyList.remove(index);
- return (uk.ac.vamsas.objects.core.Property) obj;
- }
-
- /**
- * Method removeTreenode.
- *
- * @param vTreenode
- * @return true if the object was removed from the collection.
- */
- public boolean removeTreenode(
- final uk.ac.vamsas.objects.core.Treenode vTreenode) {
- boolean removed = _treenodeList.remove(vTreenode);
- return removed;
+ } else if (temp._provenance != null)
+ return false;
+ return true;
}
-
- /**
- * Method removeTreenodeAt.
- *
- * @param index
- * @return the element removed from the collection
- */
- public uk.ac.vamsas.objects.core.Treenode removeTreenodeAt(
- final int index) {
- java.lang.Object obj = this._treenodeList.remove(index);
- return (uk.ac.vamsas.objects.core.Treenode) obj;
+ return false;
+ }
+
+ /**
+ * Returns the value of field 'id'. The field 'id' has the following
+ * description: Primary Key for vamsas object referencing
+ *
+ * @return the value of field 'Id'.
+ */
+ public java.lang.String getId() {
+ return this._id;
+ }
+
+ /**
+ * Returns the value of field 'modifiable'.
+ *
+ * @return the value of field 'Modifiable'.
+ */
+ public java.lang.String getModifiable() {
+ return this._modifiable;
+ }
+
+ /**
+ * Method getNewick.
+ *
+ * @param index
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ * @return the value of the uk.ac.vamsas.objects.core.Newick at the given
+ * index
+ */
+ public uk.ac.vamsas.objects.core.Newick getNewick(final int index)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._newickList.size()) {
+ throw new IndexOutOfBoundsException("getNewick: Index value '" + index
+ + "' not in range [0.." + (this._newickList.size() - 1) + "]");
}
- /**
- * Sets the value of field 'id'. The field 'id' has the
- * following description: Primary Key for vamsas object
- * referencing
- *
- * @param id the value of field 'id'.
- */
- public void setId(
- final java.lang.String id) {
- this._id = id;
+ return (uk.ac.vamsas.objects.core.Newick) _newickList.get(index);
+ }
+
+ /**
+ * Method getNewick.Returns the contents of the collection in an Array.
+ *
+ * Note: Just in case the collection contents are changing in another thread,
+ * we pass a 0-length Array of the correct type into the API call. This way we
+ * know that the Array returned is of exactly the correct length.
+ *
+ * @return this collection as an Array
+ */
+ public uk.ac.vamsas.objects.core.Newick[] getNewick() {
+ uk.ac.vamsas.objects.core.Newick[] array = new uk.ac.vamsas.objects.core.Newick[0];
+ return (uk.ac.vamsas.objects.core.Newick[]) this._newickList.toArray(array);
+ }
+
+ /**
+ * Method getNewickAsReference.Returns a reference to '_newickList'. No type
+ * checking is performed on any modifications to the Vector.
+ *
+ * @return a reference to the Vector backing this class
+ */
+ public java.util.Vector getNewickAsReference() {
+ return this._newickList;
+ }
+
+ /**
+ * Method getNewickCount.
+ *
+ * @return the size of this collection
+ */
+ public int getNewickCount() {
+ return this._newickList.size();
+ }
+
+ /**
+ * Method getProperty.
+ *
+ * @param index
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ * @return the value of the uk.ac.vamsas.objects.core.Property at the given
+ * index
+ */
+ public uk.ac.vamsas.objects.core.Property getProperty(final int index)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._propertyList.size()) {
+ throw new IndexOutOfBoundsException("getProperty: Index value '" + index
+ + "' not in range [0.." + (this._propertyList.size() - 1) + "]");
}
- /**
- * Sets the value of field 'modifiable'.
- *
- * @param modifiable the value of field 'modifiable'.
- */
- public void setModifiable(
- final java.lang.String modifiable) {
- this._modifiable = modifiable;
+ return (uk.ac.vamsas.objects.core.Property) _propertyList.get(index);
+ }
+
+ /**
+ * Method getProperty.Returns the contents of the collection in an Array.
+ *
+ * Note: Just in case the collection contents are changing in another thread,
+ * we pass a 0-length Array of the correct type into the API call. This way we
+ * know that the Array returned is of exactly the correct length.
+ *
+ * @return this collection as an Array
+ */
+ public uk.ac.vamsas.objects.core.Property[] getProperty() {
+ uk.ac.vamsas.objects.core.Property[] array = new uk.ac.vamsas.objects.core.Property[0];
+ return (uk.ac.vamsas.objects.core.Property[]) this._propertyList
+ .toArray(array);
+ }
+
+ /**
+ * Method getPropertyAsReference.Returns a reference to '_propertyList'. No
+ * type checking is performed on any modifications to the Vector.
+ *
+ * @return a reference to the Vector backing this class
+ */
+ public java.util.Vector getPropertyAsReference() {
+ return this._propertyList;
+ }
+
+ /**
+ * Method getPropertyCount.
+ *
+ * @return the size of this collection
+ */
+ public int getPropertyCount() {
+ return this._propertyList.size();
+ }
+
+ /**
+ * Returns the value of field 'provenance'.
+ *
+ * @return the value of field 'Provenance'.
+ */
+ public uk.ac.vamsas.objects.core.Provenance getProvenance() {
+ return this._provenance;
+ }
+
+ /**
+ * Returns the value of field 'title'.
+ *
+ * @return the value of field 'Title'.
+ */
+ public java.lang.String getTitle() {
+ return this._title;
+ }
+
+ /**
+ * Method getTreenode.
+ *
+ * @param index
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ * @return the value of the uk.ac.vamsas.objects.core.Treenode at the given
+ * index
+ */
+ public uk.ac.vamsas.objects.core.Treenode getTreenode(final int index)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._treenodeList.size()) {
+ throw new IndexOutOfBoundsException("getTreenode: Index value '" + index
+ + "' not in range [0.." + (this._treenodeList.size() - 1) + "]");
}
- /**
- *
- *
- * @param index
- * @param vNewick
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void setNewick(
- final int index,
- final uk.ac.vamsas.objects.core.Newick vNewick)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._newickList.size()) {
- throw new IndexOutOfBoundsException("setNewick: Index value '" + index + "' not in range [0.." + (this._newickList.size() - 1) + "]");
- }
-
- this._newickList.set(index, vNewick);
+ return (uk.ac.vamsas.objects.core.Treenode) _treenodeList.get(index);
+ }
+
+ /**
+ * Method getTreenode.Returns the contents of the collection in an Array.
+ *
+ * Note: Just in case the collection contents are changing in another thread,
+ * we pass a 0-length Array of the correct type into the API call. This way we
+ * know that the Array returned is of exactly the correct length.
+ *
+ * @return this collection as an Array
+ */
+ public uk.ac.vamsas.objects.core.Treenode[] getTreenode() {
+ uk.ac.vamsas.objects.core.Treenode[] array = new uk.ac.vamsas.objects.core.Treenode[0];
+ return (uk.ac.vamsas.objects.core.Treenode[]) this._treenodeList
+ .toArray(array);
+ }
+
+ /**
+ * Method getTreenodeAsReference.Returns a reference to '_treenodeList'. No
+ * type checking is performed on any modifications to the Vector.
+ *
+ * @return a reference to the Vector backing this class
+ */
+ public java.util.Vector getTreenodeAsReference() {
+ return this._treenodeList;
+ }
+
+ /**
+ * Method getTreenodeCount.
+ *
+ * @return the size of this collection
+ */
+ public int getTreenodeCount() {
+ return this._treenodeList.size();
+ }
+
+ /**
+ * Overrides the java.lang.Object.hashCode method.
+ *
+ * The following steps came from Effective Java Programming Language
+ * Guide by Joshua Bloch, Chapter 3
+ *
+ * @return a hash code value for the object.
+ */
+ public int hashCode() {
+ int result = super.hashCode();
+
+ long tmp;
+ if (_id != null && !org.castor.util.CycleBreaker.startingToCycle(_id)) {
+ result = 37 * result + _id.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_id);
}
-
- /**
- *
- *
- * @param vNewickArray
- */
- public void setNewick(
- final uk.ac.vamsas.objects.core.Newick[] vNewickArray) {
- //-- copy array
- _newickList.clear();
-
- for (int i = 0; i < vNewickArray.length; i++) {
- this._newickList.add(vNewickArray[i]);
- }
+ if (_modifiable != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_modifiable)) {
+ result = 37 * result + _modifiable.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_modifiable);
}
-
- /**
- * Sets the value of '_newickList' by copying the given Vector.
- * All elements will be checked for type safety.
- *
- * @param vNewickList the Vector to copy.
- */
- public void setNewick(
- final java.util.Vector vNewickList) {
- // copy vector
- this._newickList.clear();
-
- this._newickList.addAll(vNewickList);
+ if (_title != null && !org.castor.util.CycleBreaker.startingToCycle(_title)) {
+ result = 37 * result + _title.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_title);
}
-
- /**
- * Sets the value of '_newickList' by setting it to the given
- * Vector. No type checking is performed.
- * @deprecated
- *
- * @param newickVector the Vector to set.
- */
- public void setNewickAsReference(
- final java.util.Vector newickVector) {
- this._newickList = newickVector;
+ if (_newickList != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_newickList)) {
+ result = 37 * result + _newickList.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_newickList);
}
-
- /**
- *
- *
- * @param index
- * @param vProperty
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void setProperty(
- final int index,
- final uk.ac.vamsas.objects.core.Property vProperty)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._propertyList.size()) {
- throw new IndexOutOfBoundsException("setProperty: Index value '" + index + "' not in range [0.." + (this._propertyList.size() - 1) + "]");
- }
-
- this._propertyList.set(index, vProperty);
+ if (_treenodeList != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_treenodeList)) {
+ result = 37 * result + _treenodeList.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_treenodeList);
}
-
- /**
- *
- *
- * @param vPropertyArray
- */
- public void setProperty(
- final uk.ac.vamsas.objects.core.Property[] vPropertyArray) {
- //-- copy array
- _propertyList.clear();
-
- for (int i = 0; i < vPropertyArray.length; i++) {
- this._propertyList.add(vPropertyArray[i]);
- }
+ if (_propertyList != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_propertyList)) {
+ result = 37 * result + _propertyList.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_propertyList);
}
-
- /**
- * Sets the value of '_propertyList' by copying the given
- * Vector. All elements will be checked for type safety.
- *
- * @param vPropertyList the Vector to copy.
- */
- public void setProperty(
- final java.util.Vector vPropertyList) {
- // copy vector
- this._propertyList.clear();
-
- this._propertyList.addAll(vPropertyList);
+ if (_provenance != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_provenance)) {
+ result = 37 * result + _provenance.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_provenance);
}
- /**
- * Sets the value of '_propertyList' by setting it to the given
- * Vector. No type checking is performed.
- * @deprecated
- *
- * @param propertyVector the Vector to set.
- */
- public void setPropertyAsReference(
- final java.util.Vector propertyVector) {
- this._propertyList = propertyVector;
+ return result;
+ }
+
+ /**
+ * Method isValid.
+ *
+ * @return true if this object is valid according to the schema
+ */
+ public boolean isValid() {
+ try {
+ validate();
+ } catch (org.exolab.castor.xml.ValidationException vex) {
+ return false;
}
-
- /**
- * Sets the value of field 'provenance'.
- *
- * @param provenance the value of field 'provenance'.
- */
- public void setProvenance(
- final uk.ac.vamsas.objects.core.Provenance provenance) {
- this._provenance = provenance;
+ return true;
+ }
+
+ /**
+ *
+ *
+ * @param out
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void marshal(final java.io.Writer out)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, out);
+ }
+
+ /**
+ *
+ *
+ * @param handler
+ * @throws java.io.IOException
+ * if an IOException occurs during marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ */
+ public void marshal(final org.xml.sax.ContentHandler handler)
+ throws java.io.IOException, org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, handler);
+ }
+
+ /**
+ */
+ public void removeAllNewick() {
+ this._newickList.clear();
+ }
+
+ /**
+ */
+ public void removeAllProperty() {
+ this._propertyList.clear();
+ }
+
+ /**
+ */
+ public void removeAllTreenode() {
+ this._treenodeList.clear();
+ }
+
+ /**
+ * Method removeNewick.
+ *
+ * @param vNewick
+ * @return true if the object was removed from the collection.
+ */
+ public boolean removeNewick(final uk.ac.vamsas.objects.core.Newick vNewick) {
+ boolean removed = _newickList.remove(vNewick);
+ return removed;
+ }
+
+ /**
+ * Method removeNewickAt.
+ *
+ * @param index
+ * @return the element removed from the collection
+ */
+ public uk.ac.vamsas.objects.core.Newick removeNewickAt(final int index) {
+ java.lang.Object obj = this._newickList.remove(index);
+ return (uk.ac.vamsas.objects.core.Newick) obj;
+ }
+
+ /**
+ * Method removeProperty.
+ *
+ * @param vProperty
+ * @return true if the object was removed from the collection.
+ */
+ public boolean removeProperty(
+ final uk.ac.vamsas.objects.core.Property vProperty) {
+ boolean removed = _propertyList.remove(vProperty);
+ return removed;
+ }
+
+ /**
+ * Method removePropertyAt.
+ *
+ * @param index
+ * @return the element removed from the collection
+ */
+ public uk.ac.vamsas.objects.core.Property removePropertyAt(final int index) {
+ java.lang.Object obj = this._propertyList.remove(index);
+ return (uk.ac.vamsas.objects.core.Property) obj;
+ }
+
+ /**
+ * Method removeTreenode.
+ *
+ * @param vTreenode
+ * @return true if the object was removed from the collection.
+ */
+ public boolean removeTreenode(
+ final uk.ac.vamsas.objects.core.Treenode vTreenode) {
+ boolean removed = _treenodeList.remove(vTreenode);
+ return removed;
+ }
+
+ /**
+ * Method removeTreenodeAt.
+ *
+ * @param index
+ * @return the element removed from the collection
+ */
+ public uk.ac.vamsas.objects.core.Treenode removeTreenodeAt(final int index) {
+ java.lang.Object obj = this._treenodeList.remove(index);
+ return (uk.ac.vamsas.objects.core.Treenode) obj;
+ }
+
+ /**
+ * Sets the value of field 'id'. The field 'id' has the following description:
+ * Primary Key for vamsas object referencing
+ *
+ * @param id
+ * the value of field 'id'.
+ */
+ public void setId(final java.lang.String id) {
+ this._id = id;
+ }
+
+ /**
+ * Sets the value of field 'modifiable'.
+ *
+ * @param modifiable
+ * the value of field 'modifiable'.
+ */
+ public void setModifiable(final java.lang.String modifiable) {
+ this._modifiable = modifiable;
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vNewick
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void setNewick(final int index,
+ final uk.ac.vamsas.objects.core.Newick vNewick)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._newickList.size()) {
+ throw new IndexOutOfBoundsException("setNewick: Index value '" + index
+ + "' not in range [0.." + (this._newickList.size() - 1) + "]");
}
- /**
- * Sets the value of field 'title'.
- *
- * @param title the value of field 'title'.
- */
- public void setTitle(
- final java.lang.String title) {
- this._title = title;
- }
+ this._newickList.set(index, vNewick);
+ }
- /**
- *
- *
- * @param index
- * @param vTreenode
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void setTreenode(
- final int index,
- final uk.ac.vamsas.objects.core.Treenode vTreenode)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._treenodeList.size()) {
- throw new IndexOutOfBoundsException("setTreenode: Index value '" + index + "' not in range [0.." + (this._treenodeList.size() - 1) + "]");
- }
-
- this._treenodeList.set(index, vTreenode);
- }
+ /**
+ *
+ *
+ * @param vNewickArray
+ */
+ public void setNewick(final uk.ac.vamsas.objects.core.Newick[] vNewickArray) {
+ // -- copy array
+ _newickList.clear();
- /**
- *
- *
- * @param vTreenodeArray
- */
- public void setTreenode(
- final uk.ac.vamsas.objects.core.Treenode[] vTreenodeArray) {
- //-- copy array
- _treenodeList.clear();
-
- for (int i = 0; i < vTreenodeArray.length; i++) {
- this._treenodeList.add(vTreenodeArray[i]);
- }
+ for (int i = 0; i < vNewickArray.length; i++) {
+ this._newickList.add(vNewickArray[i]);
}
-
- /**
- * Sets the value of '_treenodeList' by copying the given
- * Vector. All elements will be checked for type safety.
- *
- * @param vTreenodeList the Vector to copy.
- */
- public void setTreenode(
- final java.util.Vector vTreenodeList) {
- // copy vector
- this._treenodeList.clear();
-
- this._treenodeList.addAll(vTreenodeList);
+ }
+
+ /**
+ * Sets the value of '_newickList' by copying the given Vector. All elements
+ * will be checked for type safety.
+ *
+ * @param vNewickList
+ * the Vector to copy.
+ */
+ public void setNewick(final java.util.Vector vNewickList) {
+ // copy vector
+ this._newickList.clear();
+
+ this._newickList.addAll(vNewickList);
+ }
+
+ /**
+ * Sets the value of '_newickList' by setting it to the given Vector. No type
+ * checking is performed.
+ *
+ * @deprecated
+ *
+ * @param newickVector
+ * the Vector to set.
+ */
+ public void setNewickAsReference(final java.util.Vector newickVector) {
+ this._newickList = newickVector;
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vProperty
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void setProperty(final int index,
+ final uk.ac.vamsas.objects.core.Property vProperty)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._propertyList.size()) {
+ throw new IndexOutOfBoundsException("setProperty: Index value '" + index
+ + "' not in range [0.." + (this._propertyList.size() - 1) + "]");
}
- /**
- * Sets the value of '_treenodeList' by setting it to the given
- * Vector. No type checking is performed.
- * @deprecated
- *
- * @param treenodeVector the Vector to set.
- */
- public void setTreenodeAsReference(
- final java.util.Vector treenodeVector) {
- this._treenodeList = treenodeVector;
+ this._propertyList.set(index, vProperty);
+ }
+
+ /**
+ *
+ *
+ * @param vPropertyArray
+ */
+ public void setProperty(
+ final uk.ac.vamsas.objects.core.Property[] vPropertyArray) {
+ // -- copy array
+ _propertyList.clear();
+
+ for (int i = 0; i < vPropertyArray.length; i++) {
+ this._propertyList.add(vPropertyArray[i]);
}
-
- /**
- * Method unmarshal.
- *
- * @param reader
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @return the unmarshaled uk.ac.vamsas.objects.core.Tree
- */
- public static uk.ac.vamsas.objects.core.Tree unmarshal(
- final java.io.Reader reader)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- return (uk.ac.vamsas.objects.core.Tree) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Tree.class, reader);
+ }
+
+ /**
+ * Sets the value of '_propertyList' by copying the given Vector. All elements
+ * will be checked for type safety.
+ *
+ * @param vPropertyList
+ * the Vector to copy.
+ */
+ public void setProperty(final java.util.Vector vPropertyList) {
+ // copy vector
+ this._propertyList.clear();
+
+ this._propertyList.addAll(vPropertyList);
+ }
+
+ /**
+ * Sets the value of '_propertyList' by setting it to the given Vector. No
+ * type checking is performed.
+ *
+ * @deprecated
+ *
+ * @param propertyVector
+ * the Vector to set.
+ */
+ public void setPropertyAsReference(final java.util.Vector propertyVector) {
+ this._propertyList = propertyVector;
+ }
+
+ /**
+ * Sets the value of field 'provenance'.
+ *
+ * @param provenance
+ * the value of field 'provenance'.
+ */
+ public void setProvenance(
+ final uk.ac.vamsas.objects.core.Provenance provenance) {
+ this._provenance = provenance;
+ }
+
+ /**
+ * Sets the value of field 'title'.
+ *
+ * @param title
+ * the value of field 'title'.
+ */
+ public void setTitle(final java.lang.String title) {
+ this._title = title;
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vTreenode
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void setTreenode(final int index,
+ final uk.ac.vamsas.objects.core.Treenode vTreenode)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._treenodeList.size()) {
+ throw new IndexOutOfBoundsException("setTreenode: Index value '" + index
+ + "' not in range [0.." + (this._treenodeList.size() - 1) + "]");
}
- /**
- *
- *
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void validate(
- )
- throws org.exolab.castor.xml.ValidationException {
- org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
- validator.validate(this);
+ this._treenodeList.set(index, vTreenode);
+ }
+
+ /**
+ *
+ *
+ * @param vTreenodeArray
+ */
+ public void setTreenode(
+ final uk.ac.vamsas.objects.core.Treenode[] vTreenodeArray) {
+ // -- copy array
+ _treenodeList.clear();
+
+ for (int i = 0; i < vTreenodeArray.length; i++) {
+ this._treenodeList.add(vTreenodeArray[i]);
}
+ }
+
+ /**
+ * Sets the value of '_treenodeList' by copying the given Vector. All elements
+ * will be checked for type safety.
+ *
+ * @param vTreenodeList
+ * the Vector to copy.
+ */
+ public void setTreenode(final java.util.Vector vTreenodeList) {
+ // copy vector
+ this._treenodeList.clear();
+
+ this._treenodeList.addAll(vTreenodeList);
+ }
+
+ /**
+ * Sets the value of '_treenodeList' by setting it to the given Vector. No
+ * type checking is performed.
+ *
+ * @deprecated
+ *
+ * @param treenodeVector
+ * the Vector to set.
+ */
+ public void setTreenodeAsReference(final java.util.Vector treenodeVector) {
+ this._treenodeList = treenodeVector;
+ }
+
+ /**
+ * Method unmarshal.
+ *
+ * @param reader
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @return the unmarshaled uk.ac.vamsas.objects.core.Tree
+ */
+ public static uk.ac.vamsas.objects.core.Tree unmarshal(
+ final java.io.Reader reader)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ return (uk.ac.vamsas.objects.core.Tree) Unmarshaller.unmarshal(
+ uk.ac.vamsas.objects.core.Tree.class, reader);
+ }
+
+ /**
+ *
+ *
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void validate() throws org.exolab.castor.xml.ValidationException {
+ org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+ validator.validate(this);
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/Treenode.java b/src/uk/ac/vamsas/objects/core/Treenode.java
index 1a8620e..51ecd7e 100644
--- a/src/uk/ac/vamsas/objects/core/Treenode.java
+++ b/src/uk/ac/vamsas/objects/core/Treenode.java
@@ -1,448 +1,457 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import org.exolab.castor.xml.Marshaller;
import org.exolab.castor.xml.Unmarshaller;
/**
- * node identity and mapping data between tree
- * representations and vamsas document objects
+ * node identity and mapping data between tree representations and vamsas
+ * document objects
*
* @version $Revision$ $Date$
*/
-public class Treenode extends uk.ac.vamsas.objects.core.NodeType
-implements java.io.Serializable
-{
-
-
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
- * reference to one or more trees containing
- * the node being described.
- */
- private java.util.Vector _treeId;
-
- /**
- * String uniquely identifying a particular
- * node in the referenced tree according to the format of
- * the tree representation that is referenced.
- *
- */
- private java.lang.String _nodespec;
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public Treenode() {
- super();
- this._treeId = new java.util.Vector();
- }
-
-
- //-----------/
- //- Methods -/
- //-----------/
-
- /**
- *
- *
- * @param vTreeId
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addTreeId(
- final java.lang.Object vTreeId)
- throws java.lang.IndexOutOfBoundsException {
- this._treeId.addElement(vTreeId);
- }
-
- /**
- *
- *
- * @param index
- * @param vTreeId
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addTreeId(
- final int index,
- final java.lang.Object vTreeId)
- throws java.lang.IndexOutOfBoundsException {
- this._treeId.add(index, vTreeId);
- }
-
- /**
- * Method enumerateTreeId.
- *
- * @return an Enumeration over all java.lang.Object elements
- */
- public java.util.Enumeration enumerateTreeId(
- ) {
- return this._treeId.elements();
- }
-
- /**
- * Overrides the java.lang.Object.equals method.
- *
- * @param obj
- * @return true if the objects are equal.
- */
- public boolean equals(
- final java.lang.Object obj) {
- if ( this == obj )
- return true;
-
- if (super.equals(obj)==false)
+public class Treenode extends uk.ac.vamsas.objects.core.NodeType implements
+ java.io.Serializable {
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * reference to one or more trees containing the node being described.
+ */
+ private java.util.Vector _treeId;
+
+ /**
+ * String uniquely identifying a particular node in the referenced tree
+ * according to the format of the tree representation that is referenced.
+ *
+ */
+ private java.lang.String _nodespec;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public Treenode() {
+ super();
+ this._treeId = new java.util.Vector();
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ *
+ *
+ * @param vTreeId
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addTreeId(final java.lang.Object vTreeId)
+ throws java.lang.IndexOutOfBoundsException {
+ this._treeId.addElement(vTreeId);
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vTreeId
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addTreeId(final int index, final java.lang.Object vTreeId)
+ throws java.lang.IndexOutOfBoundsException {
+ this._treeId.add(index, vTreeId);
+ }
+
+ /**
+ * Method enumerateTreeId.
+ *
+ * @return an Enumeration over all java.lang.Object elements
+ */
+ public java.util.Enumeration enumerateTreeId() {
+ return this._treeId.elements();
+ }
+
+ /**
+ * Overrides the java.lang.Object.equals method.
+ *
+ * @param obj
+ * @return true if the objects are equal.
+ */
+ public boolean equals(final java.lang.Object obj) {
+ if (this == obj)
+ return true;
+
+ if (super.equals(obj) == false)
+ return false;
+
+ if (obj instanceof Treenode) {
+
+ Treenode temp = (Treenode) obj;
+ boolean thcycle;
+ boolean tmcycle;
+ if (this._treeId != null) {
+ if (temp._treeId == null)
+ return false;
+ if (this._treeId != temp._treeId) {
+ thcycle = org.castor.util.CycleBreaker.startingToCycle(this._treeId);
+ tmcycle = org.castor.util.CycleBreaker.startingToCycle(temp._treeId);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._treeId);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._treeId);
+ }
+ ;
return false;
-
- if (obj instanceof Treenode) {
-
- Treenode temp = (Treenode)obj;
- boolean thcycle;
- boolean tmcycle;
- if (this._treeId != null) {
- if (temp._treeId == null) return false;
- if (this._treeId != temp._treeId) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._treeId);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._treeId);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._treeId); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._treeId); };
- return false;
- }
- if (!thcycle) {
- if (!this._treeId.equals(temp._treeId)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._treeId);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._treeId);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._treeId);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._treeId);
- }
- }
- } else if (temp._treeId != null)
- return false;
- if (this._nodespec != null) {
- if (temp._nodespec == null) return false;
- if (this._nodespec != temp._nodespec) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._nodespec);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._nodespec);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._nodespec); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._nodespec); };
- return false;
- }
- if (!thcycle) {
- if (!this._nodespec.equals(temp._nodespec)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._nodespec);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._nodespec);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._nodespec);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._nodespec);
- }
- }
- } else if (temp._nodespec != null)
- return false;
- return true;
+ }
+ if (!thcycle) {
+ if (!this._treeId.equals(temp._treeId)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._treeId);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._treeId);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._treeId);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._treeId);
+ }
}
+ } else if (temp._treeId != null)
return false;
- }
-
- /**
- * Returns the value of field 'nodespec'. The field 'nodespec'
- * has the following description: String uniquely identifying a
- * particular
- * node in the referenced tree according to the format of
- * the tree representation that is referenced.
- *
- *
- * @return the value of field 'Nodespec'.
- */
- public java.lang.String getNodespec(
- ) {
- return this._nodespec;
- }
-
- /**
- * Method getTreeId.
- *
- * @param index
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- * @return the value of the java.lang.Object at the given index
- */
- public java.lang.Object getTreeId(
- final int index)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._treeId.size()) {
- throw new IndexOutOfBoundsException("getTreeId: Index value '" + index + "' not in range [0.." + (this._treeId.size() - 1) + "]");
- }
-
- return _treeId.get(index);
- }
-
- /**
- * Method getTreeId.Returns the contents of the collection in
- * an Array.
Note: Just in case the collection contents
- * are changing in another thread, we pass a 0-length Array of
- * the correct type into the API call. This way we know
- * that the Array returned is of exactly the correct length.
- *
- * @return this collection as an Array
- */
- public java.lang.Object[] getTreeId(
- ) {
- java.lang.Object[] array = new java.lang.Object[0];
- return (java.lang.Object[]) this._treeId.toArray(array);
- }
-
- /**
- * Method getTreeIdAsReference.Returns a reference to
- * '_treeId'. No type checking is performed on any
- * modifications to the Vector.
- *
- * @return a reference to the Vector backing this class
- */
- public java.util.Vector getTreeIdAsReference(
- ) {
- return this._treeId;
- }
-
- /**
- * Method getTreeIdCount.
- *
- * @return the size of this collection
- */
- public int getTreeIdCount(
- ) {
- return this._treeId.size();
- }
-
- /**
- * Overrides the java.lang.Object.hashCode method.
- *
- * The following steps came from Effective Java Programming
- * Language Guide by Joshua Bloch, Chapter 3
- *
- * @return a hash code value for the object.
- */
- public int hashCode(
- ) {
- int result = super.hashCode();
-
- long tmp;
- if (_treeId != null
- && !org.castor.util.CycleBreaker.startingToCycle(_treeId)) {
- result = 37 * result + _treeId.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_treeId);
- }
- if (_nodespec != null
- && !org.castor.util.CycleBreaker.startingToCycle(_nodespec)) {
- result = 37 * result + _nodespec.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_nodespec);
- }
-
- return result;
- }
-
- /**
- * Method isValid.
- *
- * @return true if this object is valid according to the schema
- */
- public boolean isValid(
- ) {
- try {
- validate();
- } catch (org.exolab.castor.xml.ValidationException vex) {
+ if (this._nodespec != null) {
+ if (temp._nodespec == null)
+ return false;
+ if (this._nodespec != temp._nodespec) {
+ thcycle = org.castor.util.CycleBreaker
+ .startingToCycle(this._nodespec);
+ tmcycle = org.castor.util.CycleBreaker
+ .startingToCycle(temp._nodespec);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._nodespec);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._nodespec);
+ }
+ ;
return false;
+ }
+ if (!thcycle) {
+ if (!this._nodespec.equals(temp._nodespec)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._nodespec);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._nodespec);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._nodespec);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._nodespec);
+ }
}
- return true;
- }
-
- /**
- *
- *
- * @param out
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void marshal(
- final java.io.Writer out)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, out);
- }
-
- /**
- *
- *
- * @param handler
- * @throws java.io.IOException if an IOException occurs during
- * marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- */
- public void marshal(
- final org.xml.sax.ContentHandler handler)
- throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, handler);
- }
-
- /**
- */
- public void removeAllTreeId(
- ) {
- this._treeId.clear();
+ } else if (temp._nodespec != null)
+ return false;
+ return true;
}
-
- /**
- * Method removeTreeId.
- *
- * @param vTreeId
- * @return true if the object was removed from the collection.
- */
- public boolean removeTreeId(
- final java.lang.Object vTreeId) {
- boolean removed = _treeId.remove(vTreeId);
- return removed;
+ return false;
+ }
+
+ /**
+ * Returns the value of field 'nodespec'. The field 'nodespec' has the
+ * following description: String uniquely identifying a particular node in the
+ * referenced tree according to the format of the tree representation that is
+ * referenced.
+ *
+ *
+ * @return the value of field 'Nodespec'.
+ */
+ public java.lang.String getNodespec() {
+ return this._nodespec;
+ }
+
+ /**
+ * Method getTreeId.
+ *
+ * @param index
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ * @return the value of the java.lang.Object at the given index
+ */
+ public java.lang.Object getTreeId(final int index)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._treeId.size()) {
+ throw new IndexOutOfBoundsException("getTreeId: Index value '" + index
+ + "' not in range [0.." + (this._treeId.size() - 1) + "]");
}
- /**
- * Method removeTreeIdAt.
- *
- * @param index
- * @return the element removed from the collection
- */
- public java.lang.Object removeTreeIdAt(
- final int index) {
- java.lang.Object obj = this._treeId.remove(index);
- return obj;
+ return _treeId.get(index);
+ }
+
+ /**
+ * Method getTreeId.Returns the contents of the collection in an Array.
+ *
+ * Note: Just in case the collection contents are changing in another thread,
+ * we pass a 0-length Array of the correct type into the API call. This way we
+ * know that the Array returned is of exactly the correct length.
+ *
+ * @return this collection as an Array
+ */
+ public java.lang.Object[] getTreeId() {
+ java.lang.Object[] array = new java.lang.Object[0];
+ return (java.lang.Object[]) this._treeId.toArray(array);
+ }
+
+ /**
+ * Method getTreeIdAsReference.Returns a reference to '_treeId'. No type
+ * checking is performed on any modifications to the Vector.
+ *
+ * @return a reference to the Vector backing this class
+ */
+ public java.util.Vector getTreeIdAsReference() {
+ return this._treeId;
+ }
+
+ /**
+ * Method getTreeIdCount.
+ *
+ * @return the size of this collection
+ */
+ public int getTreeIdCount() {
+ return this._treeId.size();
+ }
+
+ /**
+ * Overrides the java.lang.Object.hashCode method.
+ *
+ * The following steps came from Effective Java Programming Language
+ * Guide by Joshua Bloch, Chapter 3
+ *
+ * @return a hash code value for the object.
+ */
+ public int hashCode() {
+ int result = super.hashCode();
+
+ long tmp;
+ if (_treeId != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_treeId)) {
+ result = 37 * result + _treeId.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_treeId);
}
-
- /**
- * Sets the value of field 'nodespec'. The field 'nodespec' has
- * the following description: String uniquely identifying a
- * particular
- * node in the referenced tree according to the format of
- * the tree representation that is referenced.
- *
- *
- * @param nodespec the value of field 'nodespec'.
- */
- public void setNodespec(
- final java.lang.String nodespec) {
- this._nodespec = nodespec;
+ if (_nodespec != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_nodespec)) {
+ result = 37 * result + _nodespec.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_nodespec);
}
- /**
- *
- *
- * @param index
- * @param vTreeId
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void setTreeId(
- final int index,
- final java.lang.Object vTreeId)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._treeId.size()) {
- throw new IndexOutOfBoundsException("setTreeId: Index value '" + index + "' not in range [0.." + (this._treeId.size() - 1) + "]");
- }
-
- this._treeId.set(index, vTreeId);
+ return result;
+ }
+
+ /**
+ * Method isValid.
+ *
+ * @return true if this object is valid according to the schema
+ */
+ public boolean isValid() {
+ try {
+ validate();
+ } catch (org.exolab.castor.xml.ValidationException vex) {
+ return false;
}
-
- /**
- *
- *
- * @param vTreeIdArray
+ return true;
+ }
+
+ /**
+ *
+ *
+ * @param out
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void marshal(final java.io.Writer out)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, out);
+ }
+
+ /**
+ *
+ *
+ * @param handler
+ * @throws java.io.IOException
+ * if an IOException occurs during marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ */
+ public void marshal(final org.xml.sax.ContentHandler handler)
+ throws java.io.IOException, org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, handler);
+ }
+
+ /**
*/
- public void setTreeId(
- final java.lang.Object[] vTreeIdArray) {
- //-- copy array
- _treeId.clear();
-
- for (int i = 0; i < vTreeIdArray.length; i++) {
- this._treeId.add(vTreeIdArray[i]);
- }
+ public void removeAllTreeId() {
+ this._treeId.clear();
+ }
+
+ /**
+ * Method removeTreeId.
+ *
+ * @param vTreeId
+ * @return true if the object was removed from the collection.
+ */
+ public boolean removeTreeId(final java.lang.Object vTreeId) {
+ boolean removed = _treeId.remove(vTreeId);
+ return removed;
+ }
+
+ /**
+ * Method removeTreeIdAt.
+ *
+ * @param index
+ * @return the element removed from the collection
+ */
+ public java.lang.Object removeTreeIdAt(final int index) {
+ java.lang.Object obj = this._treeId.remove(index);
+ return obj;
+ }
+
+ /**
+ * Sets the value of field 'nodespec'. The field 'nodespec' has the following
+ * description: String uniquely identifying a particular node in the
+ * referenced tree according to the format of the tree representation that is
+ * referenced.
+ *
+ *
+ * @param nodespec
+ * the value of field 'nodespec'.
+ */
+ public void setNodespec(final java.lang.String nodespec) {
+ this._nodespec = nodespec;
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vTreeId
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void setTreeId(final int index, final java.lang.Object vTreeId)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._treeId.size()) {
+ throw new IndexOutOfBoundsException("setTreeId: Index value '" + index
+ + "' not in range [0.." + (this._treeId.size() - 1) + "]");
}
- /**
- * Sets the value of '_treeId' by copying the given Vector. All
- * elements will be checked for type safety.
- *
- * @param vTreeIdList the Vector to copy.
- */
- public void setTreeId(
- final java.util.Vector vTreeIdList) {
- // copy vector
- this._treeId.clear();
-
- this._treeId.addAll(vTreeIdList);
- }
+ this._treeId.set(index, vTreeId);
+ }
- /**
- * Sets the value of '_treeId' by setting it to the given
- * Vector. No type checking is performed.
- * @deprecated
- *
- * @param treeIdVector the Vector to set.
- */
- public void setTreeIdAsReference(
- final java.util.Vector treeIdVector) {
- this._treeId = treeIdVector;
- }
+ /**
+ *
+ *
+ * @param vTreeIdArray
+ */
+ public void setTreeId(final java.lang.Object[] vTreeIdArray) {
+ // -- copy array
+ _treeId.clear();
- /**
- * Method unmarshal.
- *
- * @param reader
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @return the unmarshaled uk.ac.vamsas.objects.core.NodeType
- */
- public static uk.ac.vamsas.objects.core.NodeType unmarshal(
- final java.io.Reader reader)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- return (uk.ac.vamsas.objects.core.NodeType) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Treenode.class, reader);
- }
-
- /**
- *
- *
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void validate(
- )
- throws org.exolab.castor.xml.ValidationException {
- org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
- validator.validate(this);
+ for (int i = 0; i < vTreeIdArray.length; i++) {
+ this._treeId.add(vTreeIdArray[i]);
}
+ }
+
+ /**
+ * Sets the value of '_treeId' by copying the given Vector. All elements will
+ * be checked for type safety.
+ *
+ * @param vTreeIdList
+ * the Vector to copy.
+ */
+ public void setTreeId(final java.util.Vector vTreeIdList) {
+ // copy vector
+ this._treeId.clear();
+
+ this._treeId.addAll(vTreeIdList);
+ }
+
+ /**
+ * Sets the value of '_treeId' by setting it to the given Vector. No type
+ * checking is performed.
+ *
+ * @deprecated
+ *
+ * @param treeIdVector
+ * the Vector to set.
+ */
+ public void setTreeIdAsReference(final java.util.Vector treeIdVector) {
+ this._treeId = treeIdVector;
+ }
+
+ /**
+ * Method unmarshal.
+ *
+ * @param reader
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @return the unmarshaled uk.ac.vamsas.objects.core.NodeType
+ */
+ public static uk.ac.vamsas.objects.core.NodeType unmarshal(
+ final java.io.Reader reader)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ return (uk.ac.vamsas.objects.core.NodeType) Unmarshaller.unmarshal(
+ uk.ac.vamsas.objects.core.Treenode.class, reader);
+ }
+
+ /**
+ *
+ *
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void validate() throws org.exolab.castor.xml.ValidationException {
+ org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+ validator.validate(this);
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/User.java b/src/uk/ac/vamsas/objects/core/User.java
index 0339959..957c99c 100644
--- a/src/uk/ac/vamsas/objects/core/User.java
+++ b/src/uk/ac/vamsas/objects/core/User.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import org.exolab.castor.xml.Marshaller;
@@ -17,250 +31,267 @@ import org.exolab.castor.xml.Unmarshaller;
/**
* Class User.
*
- * @version $Revision$ $Date$
+ * @version $Revision$ $Date: 2007-06-28 14:51:44 +0100 (Thu, 28 Jun 2007)
+ * $
*/
-public class User extends uk.ac.vamsas.objects.core.AppData
-implements java.io.Serializable
-{
+public class User extends uk.ac.vamsas.objects.core.AppData implements
+ java.io.Serializable {
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
+ /**
+ * Field _fullname.
+ */
+ private java.lang.String _fullname;
- /**
- * Field _fullname.
- */
- private java.lang.String _fullname;
+ /**
+ * Field _organization.
+ */
+ private java.lang.String _organization;
- /**
- * Field _organization.
- */
- private java.lang.String _organization;
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+ public User() {
+ super();
+ }
- //----------------/
- //- Constructors -/
- //----------------/
+ // -----------/
+ // - Methods -/
+ // -----------/
- public User() {
- super();
- }
+ /**
+ * Overrides the java.lang.Object.equals method.
+ *
+ * @param obj
+ * @return true if the objects are equal.
+ */
+ public boolean equals(final java.lang.Object obj) {
+ if (this == obj)
+ return true;
+ if (super.equals(obj) == false)
+ return false;
- //-----------/
- //- Methods -/
- //-----------/
+ if (obj instanceof User) {
- /**
- * Overrides the java.lang.Object.equals method.
- *
- * @param obj
- * @return true if the objects are equal.
- */
- public boolean equals(
- final java.lang.Object obj) {
- if ( this == obj )
- return true;
-
- if (super.equals(obj)==false)
+ User temp = (User) obj;
+ boolean thcycle;
+ boolean tmcycle;
+ if (this._fullname != null) {
+ if (temp._fullname == null)
+ return false;
+ if (this._fullname != temp._fullname) {
+ thcycle = org.castor.util.CycleBreaker
+ .startingToCycle(this._fullname);
+ tmcycle = org.castor.util.CycleBreaker
+ .startingToCycle(temp._fullname);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._fullname);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._fullname);
+ }
+ ;
return false;
-
- if (obj instanceof User) {
-
- User temp = (User)obj;
- boolean thcycle;
- boolean tmcycle;
- if (this._fullname != null) {
- if (temp._fullname == null) return false;
- if (this._fullname != temp._fullname) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._fullname);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._fullname);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._fullname); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._fullname); };
- return false;
- }
- if (!thcycle) {
- if (!this._fullname.equals(temp._fullname)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._fullname);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._fullname);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._fullname);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._fullname);
- }
- }
- } else if (temp._fullname != null)
- return false;
- if (this._organization != null) {
- if (temp._organization == null) return false;
- if (this._organization != temp._organization) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._organization);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._organization);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._organization); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._organization); };
- return false;
- }
- if (!thcycle) {
- if (!this._organization.equals(temp._organization)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._organization);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._organization);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._organization);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._organization);
- }
- }
- } else if (temp._organization != null)
- return false;
- return true;
+ }
+ if (!thcycle) {
+ if (!this._fullname.equals(temp._fullname)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._fullname);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._fullname);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._fullname);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._fullname);
+ }
}
+ } else if (temp._fullname != null)
return false;
+ if (this._organization != null) {
+ if (temp._organization == null)
+ return false;
+ if (this._organization != temp._organization) {
+ thcycle = org.castor.util.CycleBreaker
+ .startingToCycle(this._organization);
+ tmcycle = org.castor.util.CycleBreaker
+ .startingToCycle(temp._organization);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(this._organization);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(temp._organization);
+ }
+ ;
+ return false;
+ }
+ if (!thcycle) {
+ if (!this._organization.equals(temp._organization)) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(this._organization);
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(temp._organization);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._organization);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._organization);
+ }
+ }
+ } else if (temp._organization != null)
+ return false;
+ return true;
}
+ return false;
+ }
- /**
- * Returns the value of field 'fullname'.
- *
- * @return the value of field 'Fullname'.
- */
- public java.lang.String getFullname(
- ) {
- return this._fullname;
- }
+ /**
+ * Returns the value of field 'fullname'.
+ *
+ * @return the value of field 'Fullname'.
+ */
+ public java.lang.String getFullname() {
+ return this._fullname;
+ }
- /**
- * Returns the value of field 'organization'.
- *
- * @return the value of field 'Organization'.
- */
- public java.lang.String getOrganization(
- ) {
- return this._organization;
- }
+ /**
+ * Returns the value of field 'organization'.
+ *
+ * @return the value of field 'Organization'.
+ */
+ public java.lang.String getOrganization() {
+ return this._organization;
+ }
- /**
- * Overrides the java.lang.Object.hashCode method.
- *
- * The following steps came from Effective Java Programming
- * Language Guide by Joshua Bloch, Chapter 3
- *
- * @return a hash code value for the object.
- */
- public int hashCode(
- ) {
- int result = super.hashCode();
-
- long tmp;
- if (_fullname != null
- && !org.castor.util.CycleBreaker.startingToCycle(_fullname)) {
- result = 37 * result + _fullname.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_fullname);
- }
- if (_organization != null
- && !org.castor.util.CycleBreaker.startingToCycle(_organization)) {
- result = 37 * result + _organization.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_organization);
- }
-
- return result;
- }
+ /**
+ * Overrides the java.lang.Object.hashCode method.
+ *
+ * The following steps came from Effective Java Programming Language
+ * Guide by Joshua Bloch, Chapter 3
+ *
+ * @return a hash code value for the object.
+ */
+ public int hashCode() {
+ int result = super.hashCode();
- /**
- * Method isValid.
- *
- * @return true if this object is valid according to the schema
- */
- public boolean isValid(
- ) {
- try {
- validate();
- } catch (org.exolab.castor.xml.ValidationException vex) {
- return false;
- }
- return true;
+ long tmp;
+ if (_fullname != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_fullname)) {
+ result = 37 * result + _fullname.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_fullname);
}
-
- /**
- *
- *
- * @param out
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void marshal(
- final java.io.Writer out)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, out);
+ if (_organization != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_organization)) {
+ result = 37 * result + _organization.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_organization);
}
- /**
- *
- *
- * @param handler
- * @throws java.io.IOException if an IOException occurs during
- * marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- */
- public void marshal(
- final org.xml.sax.ContentHandler handler)
- throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, handler);
- }
+ return result;
+ }
- /**
- * Sets the value of field 'fullname'.
- *
- * @param fullname the value of field 'fullname'.
- */
- public void setFullname(
- final java.lang.String fullname) {
- this._fullname = fullname;
+ /**
+ * Method isValid.
+ *
+ * @return true if this object is valid according to the schema
+ */
+ public boolean isValid() {
+ try {
+ validate();
+ } catch (org.exolab.castor.xml.ValidationException vex) {
+ return false;
}
+ return true;
+ }
- /**
- * Sets the value of field 'organization'.
- *
- * @param organization the value of field 'organization'.
- */
- public void setOrganization(
- final java.lang.String organization) {
- this._organization = organization;
- }
+ /**
+ *
+ *
+ * @param out
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void marshal(final java.io.Writer out)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, out);
+ }
- /**
- * Method unmarshal.
- *
- * @param reader
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @return the unmarshaled uk.ac.vamsas.objects.core.AppData
- */
- public static uk.ac.vamsas.objects.core.AppData unmarshal(
- final java.io.Reader reader)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- return (uk.ac.vamsas.objects.core.AppData) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.User.class, reader);
- }
+ /**
+ *
+ *
+ * @param handler
+ * @throws java.io.IOException
+ * if an IOException occurs during marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ */
+ public void marshal(final org.xml.sax.ContentHandler handler)
+ throws java.io.IOException, org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, handler);
+ }
- /**
- *
- *
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void validate(
- )
- throws org.exolab.castor.xml.ValidationException {
- org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
- validator.validate(this);
- }
+ /**
+ * Sets the value of field 'fullname'.
+ *
+ * @param fullname
+ * the value of field 'fullname'.
+ */
+ public void setFullname(final java.lang.String fullname) {
+ this._fullname = fullname;
+ }
+
+ /**
+ * Sets the value of field 'organization'.
+ *
+ * @param organization
+ * the value of field 'organization'.
+ */
+ public void setOrganization(final java.lang.String organization) {
+ this._organization = organization;
+ }
+
+ /**
+ * Method unmarshal.
+ *
+ * @param reader
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @return the unmarshaled uk.ac.vamsas.objects.core.AppData
+ */
+ public static uk.ac.vamsas.objects.core.AppData unmarshal(
+ final java.io.Reader reader)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ return (uk.ac.vamsas.objects.core.AppData) Unmarshaller.unmarshal(
+ uk.ac.vamsas.objects.core.User.class, reader);
+ }
+
+ /**
+ *
+ *
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void validate() throws org.exolab.castor.xml.ValidationException {
+ org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+ validator.validate(this);
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/VAMSAS.java b/src/uk/ac/vamsas/objects/core/VAMSAS.java
index a762b20..320dcb5 100644
--- a/src/uk/ac/vamsas/objects/core/VAMSAS.java
+++ b/src/uk/ac/vamsas/objects/core/VAMSAS.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import org.exolab.castor.xml.Marshaller;
@@ -16,698 +30,706 @@ import org.exolab.castor.xml.Unmarshaller;
/**
* contains unassociated trees and a number of analysis sets
- *
*
- * @version $Revision$ $Date$
+ *
+ * @version $Revision$ $Date: 2007-06-28 14:51:44 +0100 (Thu, 28 Jun 2007)
+ * $
*/
-public class VAMSAS extends uk.ac.vamsas.client.Vobject
-implements java.io.Serializable
-{
-
-
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
- * Primary Key for vamsas object referencing
- */
- private java.lang.String _id;
-
- /**
- * Field _modifiable.
- */
- private java.lang.String _modifiable;
-
- /**
- * Field _treeList.
- */
- private java.util.Vector _treeList;
-
- /**
- * Field _dataSetList.
- */
- private java.util.Vector _dataSetList;
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public VAMSAS() {
- super();
- this._treeList = new java.util.Vector();
- this._dataSetList = new java.util.Vector();
- }
-
-
- //-----------/
- //- Methods -/
- //-----------/
-
- /**
- *
- *
- * @param vDataSet
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addDataSet(
- final uk.ac.vamsas.objects.core.DataSet vDataSet)
- throws java.lang.IndexOutOfBoundsException {
- this._dataSetList.addElement(vDataSet);
- }
-
- /**
- *
- *
- * @param index
- * @param vDataSet
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addDataSet(
- final int index,
- final uk.ac.vamsas.objects.core.DataSet vDataSet)
- throws java.lang.IndexOutOfBoundsException {
- this._dataSetList.add(index, vDataSet);
- }
-
- /**
- *
- *
- * @param vTree
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addTree(
- final uk.ac.vamsas.objects.core.Tree vTree)
- throws java.lang.IndexOutOfBoundsException {
- this._treeList.addElement(vTree);
- }
-
- /**
- *
- *
- * @param index
- * @param vTree
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addTree(
- final int index,
- final uk.ac.vamsas.objects.core.Tree vTree)
- throws java.lang.IndexOutOfBoundsException {
- this._treeList.add(index, vTree);
- }
-
- /**
- * Method enumerateDataSet.
- *
- * @return an Enumeration over all
- * uk.ac.vamsas.objects.core.DataSet elements
- */
- public java.util.Enumeration enumerateDataSet(
- ) {
- return this._dataSetList.elements();
- }
-
- /**
- * Method enumerateTree.
- *
- * @return an Enumeration over all
- * uk.ac.vamsas.objects.core.Tree elements
- */
- public java.util.Enumeration enumerateTree(
- ) {
- return this._treeList.elements();
- }
-
- /**
- * Overrides the java.lang.Object.equals method.
- *
- * @param obj
- * @return true if the objects are equal.
- */
- public boolean equals(
- final java.lang.Object obj) {
- if ( this == obj )
- return true;
-
- if (super.equals(obj)==false)
+public class VAMSAS extends uk.ac.vamsas.client.Vobject implements
+ java.io.Serializable {
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * Primary Key for vamsas object referencing
+ */
+ private java.lang.String _id;
+
+ /**
+ * Field _modifiable.
+ */
+ private java.lang.String _modifiable;
+
+ /**
+ * Field _treeList.
+ */
+ private java.util.Vector _treeList;
+
+ /**
+ * Field _dataSetList.
+ */
+ private java.util.Vector _dataSetList;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public VAMSAS() {
+ super();
+ this._treeList = new java.util.Vector();
+ this._dataSetList = new java.util.Vector();
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ *
+ *
+ * @param vDataSet
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addDataSet(final uk.ac.vamsas.objects.core.DataSet vDataSet)
+ throws java.lang.IndexOutOfBoundsException {
+ this._dataSetList.addElement(vDataSet);
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vDataSet
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addDataSet(final int index,
+ final uk.ac.vamsas.objects.core.DataSet vDataSet)
+ throws java.lang.IndexOutOfBoundsException {
+ this._dataSetList.add(index, vDataSet);
+ }
+
+ /**
+ *
+ *
+ * @param vTree
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addTree(final uk.ac.vamsas.objects.core.Tree vTree)
+ throws java.lang.IndexOutOfBoundsException {
+ this._treeList.addElement(vTree);
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vTree
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addTree(final int index,
+ final uk.ac.vamsas.objects.core.Tree vTree)
+ throws java.lang.IndexOutOfBoundsException {
+ this._treeList.add(index, vTree);
+ }
+
+ /**
+ * Method enumerateDataSet.
+ *
+ * @return an Enumeration over all uk.ac.vamsas.objects.core.DataSet elements
+ */
+ public java.util.Enumeration enumerateDataSet() {
+ return this._dataSetList.elements();
+ }
+
+ /**
+ * Method enumerateTree.
+ *
+ * @return an Enumeration over all uk.ac.vamsas.objects.core.Tree elements
+ */
+ public java.util.Enumeration enumerateTree() {
+ return this._treeList.elements();
+ }
+
+ /**
+ * Overrides the java.lang.Object.equals method.
+ *
+ * @param obj
+ * @return true if the objects are equal.
+ */
+ public boolean equals(final java.lang.Object obj) {
+ if (this == obj)
+ return true;
+
+ if (super.equals(obj) == false)
+ return false;
+
+ if (obj instanceof VAMSAS) {
+
+ VAMSAS temp = (VAMSAS) obj;
+ boolean thcycle;
+ boolean tmcycle;
+ if (this._id != null) {
+ if (temp._id == null)
+ return false;
+ if (this._id != temp._id) {
+ thcycle = org.castor.util.CycleBreaker.startingToCycle(this._id);
+ tmcycle = org.castor.util.CycleBreaker.startingToCycle(temp._id);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
+ }
+ ;
return false;
-
- if (obj instanceof VAMSAS) {
-
- VAMSAS temp = (VAMSAS)obj;
- boolean thcycle;
- boolean tmcycle;
- if (this._id != null) {
- if (temp._id == null) return false;
- if (this._id != temp._id) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._id);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._id);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._id); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._id); };
- return false;
- }
- if (!thcycle) {
- if (!this._id.equals(temp._id)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
- }
- }
- } else if (temp._id != null)
- return false;
- if (this._modifiable != null) {
- if (temp._modifiable == null) return false;
- if (this._modifiable != temp._modifiable) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._modifiable);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._modifiable);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._modifiable); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._modifiable); };
- return false;
- }
- if (!thcycle) {
- if (!this._modifiable.equals(temp._modifiable)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._modifiable);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._modifiable);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._modifiable);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._modifiable);
- }
- }
- } else if (temp._modifiable != null)
- return false;
- if (this._treeList != null) {
- if (temp._treeList == null) return false;
- if (this._treeList != temp._treeList) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._treeList);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._treeList);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._treeList); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._treeList); };
- return false;
- }
- if (!thcycle) {
- if (!this._treeList.equals(temp._treeList)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._treeList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._treeList);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._treeList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._treeList);
- }
- }
- } else if (temp._treeList != null)
- return false;
- if (this._dataSetList != null) {
- if (temp._dataSetList == null) return false;
- if (this._dataSetList != temp._dataSetList) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._dataSetList);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._dataSetList);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._dataSetList); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._dataSetList); };
- return false;
- }
- if (!thcycle) {
- if (!this._dataSetList.equals(temp._dataSetList)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._dataSetList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._dataSetList);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._dataSetList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._dataSetList);
- }
- }
- } else if (temp._dataSetList != null)
- return false;
- return true;
+ }
+ if (!thcycle) {
+ if (!this._id.equals(temp._id)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
+ }
}
+ } else if (temp._id != null)
return false;
- }
-
- /**
- * Method getDataSet.
- *
- * @param index
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- * @return the value of the uk.ac.vamsas.objects.core.DataSet
- * at the given index
- */
- public uk.ac.vamsas.objects.core.DataSet getDataSet(
- final int index)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._dataSetList.size()) {
- throw new IndexOutOfBoundsException("getDataSet: Index value '" + index + "' not in range [0.." + (this._dataSetList.size() - 1) + "]");
- }
-
- return (uk.ac.vamsas.objects.core.DataSet) _dataSetList.get(index);
- }
-
- /**
- * Method getDataSet.Returns the contents of the collection in
- * an Array.
Note: Just in case the collection contents
- * are changing in another thread, we pass a 0-length Array of
- * the correct type into the API call. This way we know
- * that the Array returned is of exactly the correct length.
- *
- * @return this collection as an Array
- */
- public uk.ac.vamsas.objects.core.DataSet[] getDataSet(
- ) {
- uk.ac.vamsas.objects.core.DataSet[] array = new uk.ac.vamsas.objects.core.DataSet[0];
- return (uk.ac.vamsas.objects.core.DataSet[]) this._dataSetList.toArray(array);
- }
-
- /**
- * Method getDataSetAsReference.Returns a reference to
- * '_dataSetList'. No type checking is performed on any
- * modifications to the Vector.
- *
- * @return a reference to the Vector backing this class
- */
- public java.util.Vector getDataSetAsReference(
- ) {
- return this._dataSetList;
- }
-
- /**
- * Method getDataSetCount.
- *
- * @return the size of this collection
- */
- public int getDataSetCount(
- ) {
- return this._dataSetList.size();
- }
-
- /**
- * Returns the value of field 'id'. The field 'id' has the
- * following description: Primary Key for vamsas object
- * referencing
- *
- * @return the value of field 'Id'.
- */
- public java.lang.String getId(
- ) {
- return this._id;
- }
-
- /**
- * Returns the value of field 'modifiable'.
- *
- * @return the value of field 'Modifiable'.
- */
- public java.lang.String getModifiable(
- ) {
- return this._modifiable;
- }
-
- /**
- * Method getTree.
- *
- * @param index
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- * @return the value of the uk.ac.vamsas.objects.core.Tree at
- * the given index
- */
- public uk.ac.vamsas.objects.core.Tree getTree(
- final int index)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._treeList.size()) {
- throw new IndexOutOfBoundsException("getTree: Index value '" + index + "' not in range [0.." + (this._treeList.size() - 1) + "]");
- }
-
- return (uk.ac.vamsas.objects.core.Tree) _treeList.get(index);
- }
-
- /**
- * Method getTree.Returns the contents of the collection in an
- * Array.
Note: Just in case the collection contents are
- * changing in another thread, we pass a 0-length Array of the
- * correct type into the API call. This way we know
- * that the Array returned is of exactly the correct length.
- *
- * @return this collection as an Array
- */
- public uk.ac.vamsas.objects.core.Tree[] getTree(
- ) {
- uk.ac.vamsas.objects.core.Tree[] array = new uk.ac.vamsas.objects.core.Tree[0];
- return (uk.ac.vamsas.objects.core.Tree[]) this._treeList.toArray(array);
- }
-
- /**
- * Method getTreeAsReference.Returns a reference to
- * '_treeList'. No type checking is performed on any
- * modifications to the Vector.
- *
- * @return a reference to the Vector backing this class
- */
- public java.util.Vector getTreeAsReference(
- ) {
- return this._treeList;
- }
-
- /**
- * Method getTreeCount.
- *
- * @return the size of this collection
- */
- public int getTreeCount(
- ) {
- return this._treeList.size();
- }
-
- /**
- * Overrides the java.lang.Object.hashCode method.
- *
- * The following steps came from Effective Java Programming
- * Language Guide by Joshua Bloch, Chapter 3
- *
- * @return a hash code value for the object.
- */
- public int hashCode(
- ) {
- int result = super.hashCode();
-
- long tmp;
- if (_id != null
- && !org.castor.util.CycleBreaker.startingToCycle(_id)) {
- result = 37 * result + _id.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_id);
- }
- if (_modifiable != null
- && !org.castor.util.CycleBreaker.startingToCycle(_modifiable)) {
- result = 37 * result + _modifiable.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_modifiable);
- }
- if (_treeList != null
- && !org.castor.util.CycleBreaker.startingToCycle(_treeList)) {
- result = 37 * result + _treeList.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_treeList);
- }
- if (_dataSetList != null
- && !org.castor.util.CycleBreaker.startingToCycle(_dataSetList)) {
- result = 37 * result + _dataSetList.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_dataSetList);
- }
-
- return result;
- }
-
- /**
- * Method isValid.
- *
- * @return true if this object is valid according to the schema
- */
- public boolean isValid(
- ) {
- try {
- validate();
- } catch (org.exolab.castor.xml.ValidationException vex) {
+ if (this._modifiable != null) {
+ if (temp._modifiable == null)
+ return false;
+ if (this._modifiable != temp._modifiable) {
+ thcycle = org.castor.util.CycleBreaker
+ .startingToCycle(this._modifiable);
+ tmcycle = org.castor.util.CycleBreaker
+ .startingToCycle(temp._modifiable);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._modifiable);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._modifiable);
+ }
+ ;
return false;
+ }
+ if (!thcycle) {
+ if (!this._modifiable.equals(temp._modifiable)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._modifiable);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._modifiable);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._modifiable);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._modifiable);
+ }
}
- return true;
- }
-
- /**
- *
- *
- * @param out
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void marshal(
- final java.io.Writer out)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, out);
- }
-
- /**
- *
- *
- * @param handler
- * @throws java.io.IOException if an IOException occurs during
- * marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- */
- public void marshal(
- final org.xml.sax.ContentHandler handler)
- throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, handler);
- }
-
- /**
- */
- public void removeAllDataSet(
- ) {
- this._dataSetList.clear();
- }
-
- /**
- */
- public void removeAllTree(
- ) {
- this._treeList.clear();
- }
-
- /**
- * Method removeDataSet.
- *
- * @param vDataSet
- * @return true if the object was removed from the collection.
- */
- public boolean removeDataSet(
- final uk.ac.vamsas.objects.core.DataSet vDataSet) {
- boolean removed = _dataSetList.remove(vDataSet);
- return removed;
- }
-
- /**
- * Method removeDataSetAt.
- *
- * @param index
- * @return the element removed from the collection
- */
- public uk.ac.vamsas.objects.core.DataSet removeDataSetAt(
- final int index) {
- java.lang.Object obj = this._dataSetList.remove(index);
- return (uk.ac.vamsas.objects.core.DataSet) obj;
- }
-
- /**
- * Method removeTree.
- *
- * @param vTree
- * @return true if the object was removed from the collection.
- */
- public boolean removeTree(
- final uk.ac.vamsas.objects.core.Tree vTree) {
- boolean removed = _treeList.remove(vTree);
- return removed;
- }
-
- /**
- * Method removeTreeAt.
- *
- * @param index
- * @return the element removed from the collection
- */
- public uk.ac.vamsas.objects.core.Tree removeTreeAt(
- final int index) {
- java.lang.Object obj = this._treeList.remove(index);
- return (uk.ac.vamsas.objects.core.Tree) obj;
- }
-
- /**
- *
- *
- * @param index
- * @param vDataSet
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void setDataSet(
- final int index,
- final uk.ac.vamsas.objects.core.DataSet vDataSet)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._dataSetList.size()) {
- throw new IndexOutOfBoundsException("setDataSet: Index value '" + index + "' not in range [0.." + (this._dataSetList.size() - 1) + "]");
- }
-
- this._dataSetList.set(index, vDataSet);
- }
-
- /**
- *
- *
- * @param vDataSetArray
- */
- public void setDataSet(
- final uk.ac.vamsas.objects.core.DataSet[] vDataSetArray) {
- //-- copy array
- _dataSetList.clear();
-
- for (int i = 0; i < vDataSetArray.length; i++) {
- this._dataSetList.add(vDataSetArray[i]);
- }
- }
-
- /**
- * Sets the value of '_dataSetList' by copying the given
- * Vector. All elements will be checked for type safety.
- *
- * @param vDataSetList the Vector to copy.
- */
- public void setDataSet(
- final java.util.Vector vDataSetList) {
- // copy vector
- this._dataSetList.clear();
-
- this._dataSetList.addAll(vDataSetList);
- }
-
- /**
- * Sets the value of '_dataSetList' by setting it to the given
- * Vector. No type checking is performed.
- * @deprecated
- *
- * @param dataSetVector the Vector to set.
- */
- public void setDataSetAsReference(
- final java.util.Vector dataSetVector) {
- this._dataSetList = dataSetVector;
- }
-
- /**
- * Sets the value of field 'id'. The field 'id' has the
- * following description: Primary Key for vamsas object
- * referencing
- *
- * @param id the value of field 'id'.
- */
- public void setId(
- final java.lang.String id) {
- this._id = id;
- }
-
- /**
- * Sets the value of field 'modifiable'.
- *
- * @param modifiable the value of field 'modifiable'.
- */
- public void setModifiable(
- final java.lang.String modifiable) {
- this._modifiable = modifiable;
- }
-
- /**
- *
- *
- * @param index
- * @param vTree
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void setTree(
- final int index,
- final uk.ac.vamsas.objects.core.Tree vTree)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._treeList.size()) {
- throw new IndexOutOfBoundsException("setTree: Index value '" + index + "' not in range [0.." + (this._treeList.size() - 1) + "]");
+ } else if (temp._modifiable != null)
+ return false;
+ if (this._treeList != null) {
+ if (temp._treeList == null)
+ return false;
+ if (this._treeList != temp._treeList) {
+ thcycle = org.castor.util.CycleBreaker
+ .startingToCycle(this._treeList);
+ tmcycle = org.castor.util.CycleBreaker
+ .startingToCycle(temp._treeList);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._treeList);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._treeList);
+ }
+ ;
+ return false;
+ }
+ if (!thcycle) {
+ if (!this._treeList.equals(temp._treeList)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._treeList);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._treeList);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._treeList);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._treeList);
+ }
}
-
- this._treeList.set(index, vTree);
- }
-
- /**
- *
- *
- * @param vTreeArray
- */
- public void setTree(
- final uk.ac.vamsas.objects.core.Tree[] vTreeArray) {
- //-- copy array
- _treeList.clear();
-
- for (int i = 0; i < vTreeArray.length; i++) {
- this._treeList.add(vTreeArray[i]);
+ } else if (temp._treeList != null)
+ return false;
+ if (this._dataSetList != null) {
+ if (temp._dataSetList == null)
+ return false;
+ if (this._dataSetList != temp._dataSetList) {
+ thcycle = org.castor.util.CycleBreaker
+ .startingToCycle(this._dataSetList);
+ tmcycle = org.castor.util.CycleBreaker
+ .startingToCycle(temp._dataSetList);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(this._dataSetList);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(temp._dataSetList);
+ }
+ ;
+ return false;
+ }
+ if (!thcycle) {
+ if (!this._dataSetList.equals(temp._dataSetList)) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(this._dataSetList);
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(temp._dataSetList);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._dataSetList);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._dataSetList);
+ }
}
- }
-
- /**
- * Sets the value of '_treeList' by copying the given Vector.
- * All elements will be checked for type safety.
- *
- * @param vTreeList the Vector to copy.
- */
- public void setTree(
- final java.util.Vector vTreeList) {
- // copy vector
- this._treeList.clear();
-
- this._treeList.addAll(vTreeList);
- }
-
- /**
- * Sets the value of '_treeList' by setting it to the given
- * Vector. No type checking is performed.
- * @deprecated
- *
- * @param treeVector the Vector to set.
- */
- public void setTreeAsReference(
- final java.util.Vector treeVector) {
- this._treeList = treeVector;
- }
-
- /**
- * Method unmarshal.
- *
- * @param reader
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @return the unmarshaled uk.ac.vamsas.objects.core.VAMSAS
- */
- public static uk.ac.vamsas.objects.core.VAMSAS unmarshal(
- final java.io.Reader reader)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- return (uk.ac.vamsas.objects.core.VAMSAS) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.VAMSAS.class, reader);
- }
-
- /**
- *
- *
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void validate(
- )
- throws org.exolab.castor.xml.ValidationException {
- org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
- validator.validate(this);
- }
+ } else if (temp._dataSetList != null)
+ return false;
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Method getDataSet.
+ *
+ * @param index
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ * @return the value of the uk.ac.vamsas.objects.core.DataSet at the given
+ * index
+ */
+ public uk.ac.vamsas.objects.core.DataSet getDataSet(final int index)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._dataSetList.size()) {
+ throw new IndexOutOfBoundsException("getDataSet: Index value '" + index
+ + "' not in range [0.." + (this._dataSetList.size() - 1) + "]");
+ }
+
+ return (uk.ac.vamsas.objects.core.DataSet) _dataSetList.get(index);
+ }
+
+ /**
+ * Method getDataSet.Returns the contents of the collection in an Array.
+ *
+ * Note: Just in case the collection contents are changing in another thread,
+ * we pass a 0-length Array of the correct type into the API call. This way we
+ * know that the Array returned is of exactly the correct length.
+ *
+ * @return this collection as an Array
+ */
+ public uk.ac.vamsas.objects.core.DataSet[] getDataSet() {
+ uk.ac.vamsas.objects.core.DataSet[] array = new uk.ac.vamsas.objects.core.DataSet[0];
+ return (uk.ac.vamsas.objects.core.DataSet[]) this._dataSetList
+ .toArray(array);
+ }
+
+ /**
+ * Method getDataSetAsReference.Returns a reference to '_dataSetList'. No type
+ * checking is performed on any modifications to the Vector.
+ *
+ * @return a reference to the Vector backing this class
+ */
+ public java.util.Vector getDataSetAsReference() {
+ return this._dataSetList;
+ }
+
+ /**
+ * Method getDataSetCount.
+ *
+ * @return the size of this collection
+ */
+ public int getDataSetCount() {
+ return this._dataSetList.size();
+ }
+
+ /**
+ * Returns the value of field 'id'. The field 'id' has the following
+ * description: Primary Key for vamsas object referencing
+ *
+ * @return the value of field 'Id'.
+ */
+ public java.lang.String getId() {
+ return this._id;
+ }
+
+ /**
+ * Returns the value of field 'modifiable'.
+ *
+ * @return the value of field 'Modifiable'.
+ */
+ public java.lang.String getModifiable() {
+ return this._modifiable;
+ }
+
+ /**
+ * Method getTree.
+ *
+ * @param index
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ * @return the value of the uk.ac.vamsas.objects.core.Tree at the given index
+ */
+ public uk.ac.vamsas.objects.core.Tree getTree(final int index)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._treeList.size()) {
+ throw new IndexOutOfBoundsException("getTree: Index value '" + index
+ + "' not in range [0.." + (this._treeList.size() - 1) + "]");
+ }
+
+ return (uk.ac.vamsas.objects.core.Tree) _treeList.get(index);
+ }
+
+ /**
+ * Method getTree.Returns the contents of the collection in an Array.
+ *
+ * Note: Just in case the collection contents are changing in another thread,
+ * we pass a 0-length Array of the correct type into the API call. This way we
+ * know that the Array returned is of exactly the correct length.
+ *
+ * @return this collection as an Array
+ */
+ public uk.ac.vamsas.objects.core.Tree[] getTree() {
+ uk.ac.vamsas.objects.core.Tree[] array = new uk.ac.vamsas.objects.core.Tree[0];
+ return (uk.ac.vamsas.objects.core.Tree[]) this._treeList.toArray(array);
+ }
+
+ /**
+ * Method getTreeAsReference.Returns a reference to '_treeList'. No type
+ * checking is performed on any modifications to the Vector.
+ *
+ * @return a reference to the Vector backing this class
+ */
+ public java.util.Vector getTreeAsReference() {
+ return this._treeList;
+ }
+
+ /**
+ * Method getTreeCount.
+ *
+ * @return the size of this collection
+ */
+ public int getTreeCount() {
+ return this._treeList.size();
+ }
+
+ /**
+ * Overrides the java.lang.Object.hashCode method.
+ *
+ * The following steps came from Effective Java Programming Language
+ * Guide by Joshua Bloch, Chapter 3
+ *
+ * @return a hash code value for the object.
+ */
+ public int hashCode() {
+ int result = super.hashCode();
+
+ long tmp;
+ if (_id != null && !org.castor.util.CycleBreaker.startingToCycle(_id)) {
+ result = 37 * result + _id.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_id);
+ }
+ if (_modifiable != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_modifiable)) {
+ result = 37 * result + _modifiable.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_modifiable);
+ }
+ if (_treeList != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_treeList)) {
+ result = 37 * result + _treeList.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_treeList);
+ }
+ if (_dataSetList != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_dataSetList)) {
+ result = 37 * result + _dataSetList.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_dataSetList);
+ }
+
+ return result;
+ }
+
+ /**
+ * Method isValid.
+ *
+ * @return true if this object is valid according to the schema
+ */
+ public boolean isValid() {
+ try {
+ validate();
+ } catch (org.exolab.castor.xml.ValidationException vex) {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ *
+ *
+ * @param out
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void marshal(final java.io.Writer out)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, out);
+ }
+
+ /**
+ *
+ *
+ * @param handler
+ * @throws java.io.IOException
+ * if an IOException occurs during marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ */
+ public void marshal(final org.xml.sax.ContentHandler handler)
+ throws java.io.IOException, org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, handler);
+ }
+
+ /**
+ */
+ public void removeAllDataSet() {
+ this._dataSetList.clear();
+ }
+
+ /**
+ */
+ public void removeAllTree() {
+ this._treeList.clear();
+ }
+
+ /**
+ * Method removeDataSet.
+ *
+ * @param vDataSet
+ * @return true if the object was removed from the collection.
+ */
+ public boolean removeDataSet(final uk.ac.vamsas.objects.core.DataSet vDataSet) {
+ boolean removed = _dataSetList.remove(vDataSet);
+ return removed;
+ }
+
+ /**
+ * Method removeDataSetAt.
+ *
+ * @param index
+ * @return the element removed from the collection
+ */
+ public uk.ac.vamsas.objects.core.DataSet removeDataSetAt(final int index) {
+ java.lang.Object obj = this._dataSetList.remove(index);
+ return (uk.ac.vamsas.objects.core.DataSet) obj;
+ }
+
+ /**
+ * Method removeTree.
+ *
+ * @param vTree
+ * @return true if the object was removed from the collection.
+ */
+ public boolean removeTree(final uk.ac.vamsas.objects.core.Tree vTree) {
+ boolean removed = _treeList.remove(vTree);
+ return removed;
+ }
+
+ /**
+ * Method removeTreeAt.
+ *
+ * @param index
+ * @return the element removed from the collection
+ */
+ public uk.ac.vamsas.objects.core.Tree removeTreeAt(final int index) {
+ java.lang.Object obj = this._treeList.remove(index);
+ return (uk.ac.vamsas.objects.core.Tree) obj;
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vDataSet
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void setDataSet(final int index,
+ final uk.ac.vamsas.objects.core.DataSet vDataSet)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._dataSetList.size()) {
+ throw new IndexOutOfBoundsException("setDataSet: Index value '" + index
+ + "' not in range [0.." + (this._dataSetList.size() - 1) + "]");
+ }
+
+ this._dataSetList.set(index, vDataSet);
+ }
+
+ /**
+ *
+ *
+ * @param vDataSetArray
+ */
+ public void setDataSet(final uk.ac.vamsas.objects.core.DataSet[] vDataSetArray) {
+ // -- copy array
+ _dataSetList.clear();
+
+ for (int i = 0; i < vDataSetArray.length; i++) {
+ this._dataSetList.add(vDataSetArray[i]);
+ }
+ }
+
+ /**
+ * Sets the value of '_dataSetList' by copying the given Vector. All elements
+ * will be checked for type safety.
+ *
+ * @param vDataSetList
+ * the Vector to copy.
+ */
+ public void setDataSet(final java.util.Vector vDataSetList) {
+ // copy vector
+ this._dataSetList.clear();
+
+ this._dataSetList.addAll(vDataSetList);
+ }
+
+ /**
+ * Sets the value of '_dataSetList' by setting it to the given Vector. No type
+ * checking is performed.
+ *
+ * @deprecated
+ *
+ * @param dataSetVector
+ * the Vector to set.
+ */
+ public void setDataSetAsReference(final java.util.Vector dataSetVector) {
+ this._dataSetList = dataSetVector;
+ }
+
+ /**
+ * Sets the value of field 'id'. The field 'id' has the following description:
+ * Primary Key for vamsas object referencing
+ *
+ * @param id
+ * the value of field 'id'.
+ */
+ public void setId(final java.lang.String id) {
+ this._id = id;
+ }
+
+ /**
+ * Sets the value of field 'modifiable'.
+ *
+ * @param modifiable
+ * the value of field 'modifiable'.
+ */
+ public void setModifiable(final java.lang.String modifiable) {
+ this._modifiable = modifiable;
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vTree
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void setTree(final int index,
+ final uk.ac.vamsas.objects.core.Tree vTree)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._treeList.size()) {
+ throw new IndexOutOfBoundsException("setTree: Index value '" + index
+ + "' not in range [0.." + (this._treeList.size() - 1) + "]");
+ }
+
+ this._treeList.set(index, vTree);
+ }
+
+ /**
+ *
+ *
+ * @param vTreeArray
+ */
+ public void setTree(final uk.ac.vamsas.objects.core.Tree[] vTreeArray) {
+ // -- copy array
+ _treeList.clear();
+
+ for (int i = 0; i < vTreeArray.length; i++) {
+ this._treeList.add(vTreeArray[i]);
+ }
+ }
+
+ /**
+ * Sets the value of '_treeList' by copying the given Vector. All elements
+ * will be checked for type safety.
+ *
+ * @param vTreeList
+ * the Vector to copy.
+ */
+ public void setTree(final java.util.Vector vTreeList) {
+ // copy vector
+ this._treeList.clear();
+
+ this._treeList.addAll(vTreeList);
+ }
+
+ /**
+ * Sets the value of '_treeList' by setting it to the given Vector. No type
+ * checking is performed.
+ *
+ * @deprecated
+ *
+ * @param treeVector
+ * the Vector to set.
+ */
+ public void setTreeAsReference(final java.util.Vector treeVector) {
+ this._treeList = treeVector;
+ }
+
+ /**
+ * Method unmarshal.
+ *
+ * @param reader
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @return the unmarshaled uk.ac.vamsas.objects.core.VAMSAS
+ */
+ public static uk.ac.vamsas.objects.core.VAMSAS unmarshal(
+ final java.io.Reader reader)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ return (uk.ac.vamsas.objects.core.VAMSAS) Unmarshaller.unmarshal(
+ uk.ac.vamsas.objects.core.VAMSAS.class, reader);
+ }
+
+ /**
+ *
+ *
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void validate() throws org.exolab.castor.xml.ValidationException {
+ org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+ validator.validate(this);
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/VamsasDocument.java b/src/uk/ac/vamsas/objects/core/VamsasDocument.java
index 10ee854..c964ec6 100644
--- a/src/uk/ac/vamsas/objects/core/VamsasDocument.java
+++ b/src/uk/ac/vamsas/objects/core/VamsasDocument.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import org.exolab.castor.xml.Marshaller;
@@ -17,971 +31,1013 @@ import org.exolab.castor.xml.Unmarshaller;
/**
* Class VamsasDocument.
*
- * @version $Revision$ $Date$
+ * @version $Revision$ $Date: 2007-06-28 14:51:44 +0100 (Thu, 28 Jun 2007)
+ * $
*/
-public class VamsasDocument extends uk.ac.vamsas.client.Vobject
-implements java.io.Serializable
-{
-
-
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
- * Vamsas Document Version Number
- */
- private java.lang.String _version;
-
- /**
- * Field _lockFile.
- */
- private uk.ac.vamsas.objects.core.LockFile _lockFile;
-
- /**
- * Field _provenance.
- */
- private uk.ac.vamsas.objects.core.Provenance _provenance;
-
- /**
- * contains unassociated trees and a number of analysis sets
- *
- */
- private java.util.Vector _VAMSASList;
-
- /**
- * Field _applicationDataList.
- */
- private java.util.Vector _applicationDataList;
-
- /**
- * Field _attachmentList.
- */
- private java.util.Vector _attachmentList;
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public VamsasDocument() {
- super();
- this._VAMSASList = new java.util.Vector();
- this._applicationDataList = new java.util.Vector();
- this._attachmentList = new java.util.Vector();
- }
-
-
- //-----------/
- //- Methods -/
- //-----------/
-
- /**
- *
- *
- * @param vApplicationData
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addApplicationData(
- final uk.ac.vamsas.objects.core.ApplicationData vApplicationData)
- throws java.lang.IndexOutOfBoundsException {
- this._applicationDataList.addElement(vApplicationData);
- }
-
- /**
- *
- *
- * @param index
- * @param vApplicationData
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addApplicationData(
- final int index,
- final uk.ac.vamsas.objects.core.ApplicationData vApplicationData)
- throws java.lang.IndexOutOfBoundsException {
- this._applicationDataList.add(index, vApplicationData);
- }
-
- /**
- *
- *
- * @param vAttachment
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addAttachment(
- final uk.ac.vamsas.objects.core.Attachment vAttachment)
- throws java.lang.IndexOutOfBoundsException {
- this._attachmentList.addElement(vAttachment);
- }
-
- /**
- *
- *
- * @param index
- * @param vAttachment
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addAttachment(
- final int index,
- final uk.ac.vamsas.objects.core.Attachment vAttachment)
- throws java.lang.IndexOutOfBoundsException {
- this._attachmentList.add(index, vAttachment);
- }
-
- /**
- *
- *
- * @param vVAMSAS
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addVAMSAS(
- final uk.ac.vamsas.objects.core.VAMSAS vVAMSAS)
- throws java.lang.IndexOutOfBoundsException {
- this._VAMSASList.addElement(vVAMSAS);
- }
-
- /**
- *
- *
- * @param index
- * @param vVAMSAS
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addVAMSAS(
- final int index,
- final uk.ac.vamsas.objects.core.VAMSAS vVAMSAS)
- throws java.lang.IndexOutOfBoundsException {
- this._VAMSASList.add(index, vVAMSAS);
- }
-
- /**
- * Method enumerateApplicationData.
- *
- * @return an Enumeration over all
- * uk.ac.vamsas.objects.core.ApplicationData elements
- */
- public java.util.Enumeration enumerateApplicationData(
- ) {
- return this._applicationDataList.elements();
- }
-
- /**
- * Method enumerateAttachment.
- *
- * @return an Enumeration over all
- * uk.ac.vamsas.objects.core.Attachment elements
- */
- public java.util.Enumeration enumerateAttachment(
- ) {
- return this._attachmentList.elements();
- }
-
- /**
- * Method enumerateVAMSAS.
- *
- * @return an Enumeration over all
- * uk.ac.vamsas.objects.core.VAMSAS elements
- */
- public java.util.Enumeration enumerateVAMSAS(
- ) {
- return this._VAMSASList.elements();
- }
-
- /**
- * Overrides the java.lang.Object.equals method.
- *
- * @param obj
- * @return true if the objects are equal.
- */
- public boolean equals(
- final java.lang.Object obj) {
- if ( this == obj )
- return true;
-
- if (super.equals(obj)==false)
+public class VamsasDocument extends uk.ac.vamsas.client.Vobject implements
+ java.io.Serializable {
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * Vamsas Document Version Number
+ */
+ private java.lang.String _version;
+
+ /**
+ * Field _lockFile.
+ */
+ private uk.ac.vamsas.objects.core.LockFile _lockFile;
+
+ /**
+ * Field _provenance.
+ */
+ private uk.ac.vamsas.objects.core.Provenance _provenance;
+
+ /**
+ * contains unassociated trees and a number of analysis sets
+ *
+ */
+ private java.util.Vector _VAMSASList;
+
+ /**
+ * Field _applicationDataList.
+ */
+ private java.util.Vector _applicationDataList;
+
+ /**
+ * Field _attachmentList.
+ */
+ private java.util.Vector _attachmentList;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public VamsasDocument() {
+ super();
+ this._VAMSASList = new java.util.Vector();
+ this._applicationDataList = new java.util.Vector();
+ this._attachmentList = new java.util.Vector();
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ *
+ *
+ * @param vApplicationData
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addApplicationData(
+ final uk.ac.vamsas.objects.core.ApplicationData vApplicationData)
+ throws java.lang.IndexOutOfBoundsException {
+ this._applicationDataList.addElement(vApplicationData);
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vApplicationData
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addApplicationData(final int index,
+ final uk.ac.vamsas.objects.core.ApplicationData vApplicationData)
+ throws java.lang.IndexOutOfBoundsException {
+ this._applicationDataList.add(index, vApplicationData);
+ }
+
+ /**
+ *
+ *
+ * @param vAttachment
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addAttachment(
+ final uk.ac.vamsas.objects.core.Attachment vAttachment)
+ throws java.lang.IndexOutOfBoundsException {
+ this._attachmentList.addElement(vAttachment);
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vAttachment
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addAttachment(final int index,
+ final uk.ac.vamsas.objects.core.Attachment vAttachment)
+ throws java.lang.IndexOutOfBoundsException {
+ this._attachmentList.add(index, vAttachment);
+ }
+
+ /**
+ *
+ *
+ * @param vVAMSAS
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addVAMSAS(final uk.ac.vamsas.objects.core.VAMSAS vVAMSAS)
+ throws java.lang.IndexOutOfBoundsException {
+ this._VAMSASList.addElement(vVAMSAS);
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vVAMSAS
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addVAMSAS(final int index,
+ final uk.ac.vamsas.objects.core.VAMSAS vVAMSAS)
+ throws java.lang.IndexOutOfBoundsException {
+ this._VAMSASList.add(index, vVAMSAS);
+ }
+
+ /**
+ * Method enumerateApplicationData.
+ *
+ * @return an Enumeration over all uk.ac.vamsas.objects.core.ApplicationData
+ * elements
+ */
+ public java.util.Enumeration enumerateApplicationData() {
+ return this._applicationDataList.elements();
+ }
+
+ /**
+ * Method enumerateAttachment.
+ *
+ * @return an Enumeration over all uk.ac.vamsas.objects.core.Attachment
+ * elements
+ */
+ public java.util.Enumeration enumerateAttachment() {
+ return this._attachmentList.elements();
+ }
+
+ /**
+ * Method enumerateVAMSAS.
+ *
+ * @return an Enumeration over all uk.ac.vamsas.objects.core.VAMSAS elements
+ */
+ public java.util.Enumeration enumerateVAMSAS() {
+ return this._VAMSASList.elements();
+ }
+
+ /**
+ * Overrides the java.lang.Object.equals method.
+ *
+ * @param obj
+ * @return true if the objects are equal.
+ */
+ public boolean equals(final java.lang.Object obj) {
+ if (this == obj)
+ return true;
+
+ if (super.equals(obj) == false)
+ return false;
+
+ if (obj instanceof VamsasDocument) {
+
+ VamsasDocument temp = (VamsasDocument) obj;
+ boolean thcycle;
+ boolean tmcycle;
+ if (this._version != null) {
+ if (temp._version == null)
+ return false;
+ if (this._version != temp._version) {
+ thcycle = org.castor.util.CycleBreaker.startingToCycle(this._version);
+ tmcycle = org.castor.util.CycleBreaker.startingToCycle(temp._version);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._version);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._version);
+ }
+ ;
return false;
-
- if (obj instanceof VamsasDocument) {
-
- VamsasDocument temp = (VamsasDocument)obj;
- boolean thcycle;
- boolean tmcycle;
- if (this._version != null) {
- if (temp._version == null) return false;
- if (this._version != temp._version) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._version);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._version);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._version); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._version); };
- return false;
- }
- if (!thcycle) {
- if (!this._version.equals(temp._version)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._version);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._version);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._version);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._version);
- }
- }
- } else if (temp._version != null)
- return false;
- if (this._lockFile != null) {
- if (temp._lockFile == null) return false;
- if (this._lockFile != temp._lockFile) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._lockFile);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._lockFile);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._lockFile); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._lockFile); };
- return false;
- }
- if (!thcycle) {
- if (!this._lockFile.equals(temp._lockFile)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._lockFile);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._lockFile);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._lockFile);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._lockFile);
- }
- }
- } else if (temp._lockFile != null)
- return false;
- if (this._provenance != null) {
- if (temp._provenance == null) return false;
- if (this._provenance != temp._provenance) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._provenance);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._provenance);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance); };
- return false;
- }
- if (!thcycle) {
- if (!this._provenance.equals(temp._provenance)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance);
- }
- }
- } else if (temp._provenance != null)
- return false;
- if (this._VAMSASList != null) {
- if (temp._VAMSASList == null) return false;
- if (this._VAMSASList != temp._VAMSASList) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._VAMSASList);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._VAMSASList);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._VAMSASList); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._VAMSASList); };
- return false;
- }
- if (!thcycle) {
- if (!this._VAMSASList.equals(temp._VAMSASList)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._VAMSASList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._VAMSASList);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._VAMSASList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._VAMSASList);
- }
- }
- } else if (temp._VAMSASList != null)
- return false;
- if (this._applicationDataList != null) {
- if (temp._applicationDataList == null) return false;
- if (this._applicationDataList != temp._applicationDataList) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._applicationDataList);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._applicationDataList);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._applicationDataList); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._applicationDataList); };
- return false;
- }
- if (!thcycle) {
- if (!this._applicationDataList.equals(temp._applicationDataList)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._applicationDataList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._applicationDataList);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._applicationDataList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._applicationDataList);
- }
- }
- } else if (temp._applicationDataList != null)
- return false;
- if (this._attachmentList != null) {
- if (temp._attachmentList == null) return false;
- if (this._attachmentList != temp._attachmentList) {
- thcycle=org.castor.util.CycleBreaker.startingToCycle(this._attachmentList);
- tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._attachmentList);
- if (thcycle!=tmcycle) {
- if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._attachmentList); };
- if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._attachmentList); };
- return false;
- }
- if (!thcycle) {
- if (!this._attachmentList.equals(temp._attachmentList)) {
- org.castor.util.CycleBreaker.releaseCycleHandle(this._attachmentList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._attachmentList);
- return false;
- }
- org.castor.util.CycleBreaker.releaseCycleHandle(this._attachmentList);
- org.castor.util.CycleBreaker.releaseCycleHandle(temp._attachmentList);
- }
- }
- } else if (temp._attachmentList != null)
- return false;
- return true;
+ }
+ if (!thcycle) {
+ if (!this._version.equals(temp._version)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._version);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._version);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._version);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._version);
+ }
}
+ } else if (temp._version != null)
return false;
- }
-
- /**
- * Method getApplicationData.
- *
- * @param index
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- * @return the value of the
- * uk.ac.vamsas.objects.core.ApplicationData at the given index
- */
- public uk.ac.vamsas.objects.core.ApplicationData getApplicationData(
- final int index)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._applicationDataList.size()) {
- throw new IndexOutOfBoundsException("getApplicationData: Index value '" + index + "' not in range [0.." + (this._applicationDataList.size() - 1) + "]");
- }
-
- return (uk.ac.vamsas.objects.core.ApplicationData) _applicationDataList.get(index);
- }
-
- /**
- * Method getApplicationData.Returns the contents of the
- * collection in an Array.
Note: Just in case the
- * collection contents are changing in another thread, we pass
- * a 0-length Array of the correct type into the API call.
- * This way we know that the Array returned is of
- * exactly the correct length.
- *
- * @return this collection as an Array
- */
- public uk.ac.vamsas.objects.core.ApplicationData[] getApplicationData(
- ) {
- uk.ac.vamsas.objects.core.ApplicationData[] array = new uk.ac.vamsas.objects.core.ApplicationData[0];
- return (uk.ac.vamsas.objects.core.ApplicationData[]) this._applicationDataList.toArray(array);
- }
-
- /**
- * Method getApplicationDataAsReference.Returns a reference to
- * '_applicationDataList'. No type checking is performed on any
- * modifications to the Vector.
- *
- * @return a reference to the Vector backing this class
- */
- public java.util.Vector getApplicationDataAsReference(
- ) {
- return this._applicationDataList;
- }
-
- /**
- * Method getApplicationDataCount.
- *
- * @return the size of this collection
- */
- public int getApplicationDataCount(
- ) {
- return this._applicationDataList.size();
- }
-
- /**
- * Method getAttachment.
- *
- * @param index
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- * @return the value of the
- * uk.ac.vamsas.objects.core.Attachment at the given index
- */
- public uk.ac.vamsas.objects.core.Attachment getAttachment(
- final int index)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._attachmentList.size()) {
- throw new IndexOutOfBoundsException("getAttachment: Index value '" + index + "' not in range [0.." + (this._attachmentList.size() - 1) + "]");
- }
-
- return (uk.ac.vamsas.objects.core.Attachment) _attachmentList.get(index);
- }
-
- /**
- * Method getAttachment.Returns the contents of the collection
- * in an Array.
Note: Just in case the collection contents
- * are changing in another thread, we pass a 0-length Array of
- * the correct type into the API call. This way we know
- * that the Array returned is of exactly the correct length.
- *
- * @return this collection as an Array
- */
- public uk.ac.vamsas.objects.core.Attachment[] getAttachment(
- ) {
- uk.ac.vamsas.objects.core.Attachment[] array = new uk.ac.vamsas.objects.core.Attachment[0];
- return (uk.ac.vamsas.objects.core.Attachment[]) this._attachmentList.toArray(array);
- }
-
- /**
- * Method getAttachmentAsReference.Returns a reference to
- * '_attachmentList'. No type checking is performed on any
- * modifications to the Vector.
- *
- * @return a reference to the Vector backing this class
- */
- public java.util.Vector getAttachmentAsReference(
- ) {
- return this._attachmentList;
- }
-
- /**
- * Method getAttachmentCount.
- *
- * @return the size of this collection
- */
- public int getAttachmentCount(
- ) {
- return this._attachmentList.size();
- }
-
- /**
- * Returns the value of field 'lockFile'.
- *
- * @return the value of field 'LockFile'.
- */
- public uk.ac.vamsas.objects.core.LockFile getLockFile(
- ) {
- return this._lockFile;
- }
-
- /**
- * Returns the value of field 'provenance'.
- *
- * @return the value of field 'Provenance'.
- */
- public uk.ac.vamsas.objects.core.Provenance getProvenance(
- ) {
- return this._provenance;
- }
-
- /**
- * Method getVAMSAS.
- *
- * @param index
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- * @return the value of the uk.ac.vamsas.objects.core.VAMSAS at
- * the given index
- */
- public uk.ac.vamsas.objects.core.VAMSAS getVAMSAS(
- final int index)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._VAMSASList.size()) {
- throw new IndexOutOfBoundsException("getVAMSAS: Index value '" + index + "' not in range [0.." + (this._VAMSASList.size() - 1) + "]");
- }
-
- return (uk.ac.vamsas.objects.core.VAMSAS) _VAMSASList.get(index);
- }
-
- /**
- * Method getVAMSAS.Returns the contents of the collection in
- * an Array.
Note: Just in case the collection contents
- * are changing in another thread, we pass a 0-length Array of
- * the correct type into the API call. This way we know
- * that the Array returned is of exactly the correct length.
- *
- * @return this collection as an Array
- */
- public uk.ac.vamsas.objects.core.VAMSAS[] getVAMSAS(
- ) {
- uk.ac.vamsas.objects.core.VAMSAS[] array = new uk.ac.vamsas.objects.core.VAMSAS[0];
- return (uk.ac.vamsas.objects.core.VAMSAS[]) this._VAMSASList.toArray(array);
- }
-
- /**
- * Method getVAMSASAsReference.Returns a reference to
- * '_VAMSASList'. No type checking is performed on any
- * modifications to the Vector.
- *
- * @return a reference to the Vector backing this class
- */
- public java.util.Vector getVAMSASAsReference(
- ) {
- return this._VAMSASList;
- }
-
- /**
- * Method getVAMSASCount.
- *
- * @return the size of this collection
- */
- public int getVAMSASCount(
- ) {
- return this._VAMSASList.size();
- }
-
- /**
- * Returns the value of field 'version'. The field 'version'
- * has the following description: Vamsas Document Version
- * Number
- *
- * @return the value of field 'Version'.
- */
- public java.lang.String getVersion(
- ) {
- return this._version;
- }
-
- /**
- * Overrides the java.lang.Object.hashCode method.
- *
- * The following steps came from Effective Java Programming
- * Language Guide by Joshua Bloch, Chapter 3
- *
- * @return a hash code value for the object.
- */
- public int hashCode(
- ) {
- int result = super.hashCode();
-
- long tmp;
- if (_version != null
- && !org.castor.util.CycleBreaker.startingToCycle(_version)) {
- result = 37 * result + _version.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_version);
- }
- if (_lockFile != null
- && !org.castor.util.CycleBreaker.startingToCycle(_lockFile)) {
- result = 37 * result + _lockFile.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_lockFile);
- }
- if (_provenance != null
- && !org.castor.util.CycleBreaker.startingToCycle(_provenance)) {
- result = 37 * result + _provenance.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_provenance);
+ if (this._lockFile != null) {
+ if (temp._lockFile == null)
+ return false;
+ if (this._lockFile != temp._lockFile) {
+ thcycle = org.castor.util.CycleBreaker
+ .startingToCycle(this._lockFile);
+ tmcycle = org.castor.util.CycleBreaker
+ .startingToCycle(temp._lockFile);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._lockFile);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._lockFile);
+ }
+ ;
+ return false;
+ }
+ if (!thcycle) {
+ if (!this._lockFile.equals(temp._lockFile)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._lockFile);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._lockFile);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._lockFile);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._lockFile);
+ }
}
- if (_VAMSASList != null
- && !org.castor.util.CycleBreaker.startingToCycle(_VAMSASList)) {
- result = 37 * result + _VAMSASList.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_VAMSASList);
+ } else if (temp._lockFile != null)
+ return false;
+ if (this._provenance != null) {
+ if (temp._provenance == null)
+ return false;
+ if (this._provenance != temp._provenance) {
+ thcycle = org.castor.util.CycleBreaker
+ .startingToCycle(this._provenance);
+ tmcycle = org.castor.util.CycleBreaker
+ .startingToCycle(temp._provenance);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance);
+ }
+ ;
+ return false;
+ }
+ if (!thcycle) {
+ if (!this._provenance.equals(temp._provenance)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance);
+ }
}
- if (_applicationDataList != null
- && !org.castor.util.CycleBreaker.startingToCycle(_applicationDataList)) {
- result = 37 * result + _applicationDataList.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_applicationDataList);
+ } else if (temp._provenance != null)
+ return false;
+ if (this._VAMSASList != null) {
+ if (temp._VAMSASList == null)
+ return false;
+ if (this._VAMSASList != temp._VAMSASList) {
+ thcycle = org.castor.util.CycleBreaker
+ .startingToCycle(this._VAMSASList);
+ tmcycle = org.castor.util.CycleBreaker
+ .startingToCycle(temp._VAMSASList);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._VAMSASList);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._VAMSASList);
+ }
+ ;
+ return false;
+ }
+ if (!thcycle) {
+ if (!this._VAMSASList.equals(temp._VAMSASList)) {
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._VAMSASList);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._VAMSASList);
+ return false;
+ }
+ org.castor.util.CycleBreaker.releaseCycleHandle(this._VAMSASList);
+ org.castor.util.CycleBreaker.releaseCycleHandle(temp._VAMSASList);
+ }
}
- if (_attachmentList != null
- && !org.castor.util.CycleBreaker.startingToCycle(_attachmentList)) {
- result = 37 * result + _attachmentList.hashCode();
- org.castor.util.CycleBreaker.releaseCycleHandle(_attachmentList);
+ } else if (temp._VAMSASList != null)
+ return false;
+ if (this._applicationDataList != null) {
+ if (temp._applicationDataList == null)
+ return false;
+ if (this._applicationDataList != temp._applicationDataList) {
+ thcycle = org.castor.util.CycleBreaker
+ .startingToCycle(this._applicationDataList);
+ tmcycle = org.castor.util.CycleBreaker
+ .startingToCycle(temp._applicationDataList);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(this._applicationDataList);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(temp._applicationDataList);
+ }
+ ;
+ return false;
+ }
+ if (!thcycle) {
+ if (!this._applicationDataList.equals(temp._applicationDataList)) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(this._applicationDataList);
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(temp._applicationDataList);
+ return false;
+ }
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(this._applicationDataList);
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(temp._applicationDataList);
+ }
}
-
- return result;
- }
-
- /**
- * Method isValid.
- *
- * @return true if this object is valid according to the schema
- */
- public boolean isValid(
- ) {
- try {
- validate();
- } catch (org.exolab.castor.xml.ValidationException vex) {
+ } else if (temp._applicationDataList != null)
+ return false;
+ if (this._attachmentList != null) {
+ if (temp._attachmentList == null)
+ return false;
+ if (this._attachmentList != temp._attachmentList) {
+ thcycle = org.castor.util.CycleBreaker
+ .startingToCycle(this._attachmentList);
+ tmcycle = org.castor.util.CycleBreaker
+ .startingToCycle(temp._attachmentList);
+ if (thcycle != tmcycle) {
+ if (!thcycle) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(this._attachmentList);
+ }
+ ;
+ if (!tmcycle) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(temp._attachmentList);
+ }
+ ;
return false;
+ }
+ if (!thcycle) {
+ if (!this._attachmentList.equals(temp._attachmentList)) {
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(this._attachmentList);
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(temp._attachmentList);
+ return false;
+ }
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(this._attachmentList);
+ org.castor.util.CycleBreaker
+ .releaseCycleHandle(temp._attachmentList);
+ }
}
- return true;
- }
-
- /**
- *
- *
- * @param out
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void marshal(
- final java.io.Writer out)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, out);
- }
-
- /**
- *
- *
- * @param handler
- * @throws java.io.IOException if an IOException occurs during
- * marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- */
- public void marshal(
- final org.xml.sax.ContentHandler handler)
- throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, handler);
- }
-
- /**
- */
- public void removeAllApplicationData(
- ) {
- this._applicationDataList.clear();
- }
-
- /**
- */
- public void removeAllAttachment(
- ) {
- this._attachmentList.clear();
- }
-
- /**
- */
- public void removeAllVAMSAS(
- ) {
- this._VAMSASList.clear();
- }
-
- /**
- * Method removeApplicationData.
- *
- * @param vApplicationData
- * @return true if the object was removed from the collection.
- */
- public boolean removeApplicationData(
- final uk.ac.vamsas.objects.core.ApplicationData vApplicationData) {
- boolean removed = _applicationDataList.remove(vApplicationData);
- return removed;
- }
-
- /**
- * Method removeApplicationDataAt.
- *
- * @param index
- * @return the element removed from the collection
- */
- public uk.ac.vamsas.objects.core.ApplicationData removeApplicationDataAt(
- final int index) {
- java.lang.Object obj = this._applicationDataList.remove(index);
- return (uk.ac.vamsas.objects.core.ApplicationData) obj;
- }
-
- /**
- * Method removeAttachment.
- *
- * @param vAttachment
- * @return true if the object was removed from the collection.
- */
- public boolean removeAttachment(
- final uk.ac.vamsas.objects.core.Attachment vAttachment) {
- boolean removed = _attachmentList.remove(vAttachment);
- return removed;
+ } else if (temp._attachmentList != null)
+ return false;
+ return true;
}
-
- /**
- * Method removeAttachmentAt.
- *
- * @param index
- * @return the element removed from the collection
- */
- public uk.ac.vamsas.objects.core.Attachment removeAttachmentAt(
- final int index) {
- java.lang.Object obj = this._attachmentList.remove(index);
- return (uk.ac.vamsas.objects.core.Attachment) obj;
+ return false;
+ }
+
+ /**
+ * Method getApplicationData.
+ *
+ * @param index
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ * @return the value of the uk.ac.vamsas.objects.core.ApplicationData at the
+ * given index
+ */
+ public uk.ac.vamsas.objects.core.ApplicationData getApplicationData(
+ final int index) throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._applicationDataList.size()) {
+ throw new IndexOutOfBoundsException("getApplicationData: Index value '"
+ + index + "' not in range [0.."
+ + (this._applicationDataList.size() - 1) + "]");
}
- /**
- * Method removeVAMSAS.
- *
- * @param vVAMSAS
- * @return true if the object was removed from the collection.
- */
- public boolean removeVAMSAS(
- final uk.ac.vamsas.objects.core.VAMSAS vVAMSAS) {
- boolean removed = _VAMSASList.remove(vVAMSAS);
- return removed;
+ return (uk.ac.vamsas.objects.core.ApplicationData) _applicationDataList
+ .get(index);
+ }
+
+ /**
+ * Method getApplicationData.Returns the contents of the collection in an
+ * Array.
+ *
+ * Note: Just in case the collection contents are changing in another thread,
+ * we pass a 0-length Array of the correct type into the API call. This way we
+ * know that the Array returned is of exactly the correct length.
+ *
+ * @return this collection as an Array
+ */
+ public uk.ac.vamsas.objects.core.ApplicationData[] getApplicationData() {
+ uk.ac.vamsas.objects.core.ApplicationData[] array = new uk.ac.vamsas.objects.core.ApplicationData[0];
+ return (uk.ac.vamsas.objects.core.ApplicationData[]) this._applicationDataList
+ .toArray(array);
+ }
+
+ /**
+ * Method getApplicationDataAsReference.Returns a reference to
+ * '_applicationDataList'. No type checking is performed on any modifications
+ * to the Vector.
+ *
+ * @return a reference to the Vector backing this class
+ */
+ public java.util.Vector getApplicationDataAsReference() {
+ return this._applicationDataList;
+ }
+
+ /**
+ * Method getApplicationDataCount.
+ *
+ * @return the size of this collection
+ */
+ public int getApplicationDataCount() {
+ return this._applicationDataList.size();
+ }
+
+ /**
+ * Method getAttachment.
+ *
+ * @param index
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ * @return the value of the uk.ac.vamsas.objects.core.Attachment at the given
+ * index
+ */
+ public uk.ac.vamsas.objects.core.Attachment getAttachment(final int index)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._attachmentList.size()) {
+ throw new IndexOutOfBoundsException("getAttachment: Index value '"
+ + index + "' not in range [0.." + (this._attachmentList.size() - 1)
+ + "]");
}
- /**
- * Method removeVAMSASAt.
- *
- * @param index
- * @return the element removed from the collection
- */
- public uk.ac.vamsas.objects.core.VAMSAS removeVAMSASAt(
- final int index) {
- java.lang.Object obj = this._VAMSASList.remove(index);
- return (uk.ac.vamsas.objects.core.VAMSAS) obj;
+ return (uk.ac.vamsas.objects.core.Attachment) _attachmentList.get(index);
+ }
+
+ /**
+ * Method getAttachment.Returns the contents of the collection in an Array.
+ *
+ * Note: Just in case the collection contents are changing in another thread,
+ * we pass a 0-length Array of the correct type into the API call. This way we
+ * know that the Array returned is of exactly the correct length.
+ *
+ * @return this collection as an Array
+ */
+ public uk.ac.vamsas.objects.core.Attachment[] getAttachment() {
+ uk.ac.vamsas.objects.core.Attachment[] array = new uk.ac.vamsas.objects.core.Attachment[0];
+ return (uk.ac.vamsas.objects.core.Attachment[]) this._attachmentList
+ .toArray(array);
+ }
+
+ /**
+ * Method getAttachmentAsReference.Returns a reference to '_attachmentList'.
+ * No type checking is performed on any modifications to the Vector.
+ *
+ * @return a reference to the Vector backing this class
+ */
+ public java.util.Vector getAttachmentAsReference() {
+ return this._attachmentList;
+ }
+
+ /**
+ * Method getAttachmentCount.
+ *
+ * @return the size of this collection
+ */
+ public int getAttachmentCount() {
+ return this._attachmentList.size();
+ }
+
+ /**
+ * Returns the value of field 'lockFile'.
+ *
+ * @return the value of field 'LockFile'.
+ */
+ public uk.ac.vamsas.objects.core.LockFile getLockFile() {
+ return this._lockFile;
+ }
+
+ /**
+ * Returns the value of field 'provenance'.
+ *
+ * @return the value of field 'Provenance'.
+ */
+ public uk.ac.vamsas.objects.core.Provenance getProvenance() {
+ return this._provenance;
+ }
+
+ /**
+ * Method getVAMSAS.
+ *
+ * @param index
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ * @return the value of the uk.ac.vamsas.objects.core.VAMSAS at the given
+ * index
+ */
+ public uk.ac.vamsas.objects.core.VAMSAS getVAMSAS(final int index)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._VAMSASList.size()) {
+ throw new IndexOutOfBoundsException("getVAMSAS: Index value '" + index
+ + "' not in range [0.." + (this._VAMSASList.size() - 1) + "]");
}
- /**
- *
- *
- * @param index
- * @param vApplicationData
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void setApplicationData(
- final int index,
- final uk.ac.vamsas.objects.core.ApplicationData vApplicationData)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._applicationDataList.size()) {
- throw new IndexOutOfBoundsException("setApplicationData: Index value '" + index + "' not in range [0.." + (this._applicationDataList.size() - 1) + "]");
- }
-
- this._applicationDataList.set(index, vApplicationData);
+ return (uk.ac.vamsas.objects.core.VAMSAS) _VAMSASList.get(index);
+ }
+
+ /**
+ * Method getVAMSAS.Returns the contents of the collection in an Array.
+ *
+ * Note: Just in case the collection contents are changing in another thread,
+ * we pass a 0-length Array of the correct type into the API call. This way we
+ * know that the Array returned is of exactly the correct length.
+ *
+ * @return this collection as an Array
+ */
+ public uk.ac.vamsas.objects.core.VAMSAS[] getVAMSAS() {
+ uk.ac.vamsas.objects.core.VAMSAS[] array = new uk.ac.vamsas.objects.core.VAMSAS[0];
+ return (uk.ac.vamsas.objects.core.VAMSAS[]) this._VAMSASList.toArray(array);
+ }
+
+ /**
+ * Method getVAMSASAsReference.Returns a reference to '_VAMSASList'. No type
+ * checking is performed on any modifications to the Vector.
+ *
+ * @return a reference to the Vector backing this class
+ */
+ public java.util.Vector getVAMSASAsReference() {
+ return this._VAMSASList;
+ }
+
+ /**
+ * Method getVAMSASCount.
+ *
+ * @return the size of this collection
+ */
+ public int getVAMSASCount() {
+ return this._VAMSASList.size();
+ }
+
+ /**
+ * Returns the value of field 'version'. The field 'version' has the following
+ * description: Vamsas Document Version Number
+ *
+ * @return the value of field 'Version'.
+ */
+ public java.lang.String getVersion() {
+ return this._version;
+ }
+
+ /**
+ * Overrides the java.lang.Object.hashCode method.
+ *
+ * The following steps came from Effective Java Programming Language
+ * Guide by Joshua Bloch, Chapter 3
+ *
+ * @return a hash code value for the object.
+ */
+ public int hashCode() {
+ int result = super.hashCode();
+
+ long tmp;
+ if (_version != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_version)) {
+ result = 37 * result + _version.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_version);
}
-
- /**
- *
- *
- * @param vApplicationDataArray
- */
- public void setApplicationData(
- final uk.ac.vamsas.objects.core.ApplicationData[] vApplicationDataArray) {
- //-- copy array
- _applicationDataList.clear();
-
- for (int i = 0; i < vApplicationDataArray.length; i++) {
- this._applicationDataList.add(vApplicationDataArray[i]);
- }
+ if (_lockFile != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_lockFile)) {
+ result = 37 * result + _lockFile.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_lockFile);
}
-
- /**
- * Sets the value of '_applicationDataList' by copying the
- * given Vector. All elements will be checked for type safety.
- *
- * @param vApplicationDataList the Vector to copy.
- */
- public void setApplicationData(
- final java.util.Vector vApplicationDataList) {
- // copy vector
- this._applicationDataList.clear();
-
- this._applicationDataList.addAll(vApplicationDataList);
+ if (_provenance != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_provenance)) {
+ result = 37 * result + _provenance.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_provenance);
}
-
- /**
- * Sets the value of '_applicationDataList' by setting it to
- * the given Vector. No type checking is performed.
- * @deprecated
- *
- * @param applicationDataVector the Vector to set.
- */
- public void setApplicationDataAsReference(
- final java.util.Vector applicationDataVector) {
- this._applicationDataList = applicationDataVector;
+ if (_VAMSASList != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_VAMSASList)) {
+ result = 37 * result + _VAMSASList.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_VAMSASList);
}
-
- /**
- *
- *
- * @param index
- * @param vAttachment
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void setAttachment(
- final int index,
- final uk.ac.vamsas.objects.core.Attachment vAttachment)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._attachmentList.size()) {
- throw new IndexOutOfBoundsException("setAttachment: Index value '" + index + "' not in range [0.." + (this._attachmentList.size() - 1) + "]");
- }
-
- this._attachmentList.set(index, vAttachment);
+ if (_applicationDataList != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_applicationDataList)) {
+ result = 37 * result + _applicationDataList.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_applicationDataList);
}
-
- /**
- *
- *
- * @param vAttachmentArray
- */
- public void setAttachment(
- final uk.ac.vamsas.objects.core.Attachment[] vAttachmentArray) {
- //-- copy array
- _attachmentList.clear();
-
- for (int i = 0; i < vAttachmentArray.length; i++) {
- this._attachmentList.add(vAttachmentArray[i]);
- }
+ if (_attachmentList != null
+ && !org.castor.util.CycleBreaker.startingToCycle(_attachmentList)) {
+ result = 37 * result + _attachmentList.hashCode();
+ org.castor.util.CycleBreaker.releaseCycleHandle(_attachmentList);
}
- /**
- * Sets the value of '_attachmentList' by copying the given
- * Vector. All elements will be checked for type safety.
- *
- * @param vAttachmentList the Vector to copy.
- */
- public void setAttachment(
- final java.util.Vector vAttachmentList) {
- // copy vector
- this._attachmentList.clear();
-
- this._attachmentList.addAll(vAttachmentList);
+ return result;
+ }
+
+ /**
+ * Method isValid.
+ *
+ * @return true if this object is valid according to the schema
+ */
+ public boolean isValid() {
+ try {
+ validate();
+ } catch (org.exolab.castor.xml.ValidationException vex) {
+ return false;
}
-
- /**
- * Sets the value of '_attachmentList' by setting it to the
- * given Vector. No type checking is performed.
- * @deprecated
- *
- * @param attachmentVector the Vector to set.
+ return true;
+ }
+
+ /**
+ *
+ *
+ * @param out
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void marshal(final java.io.Writer out)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, out);
+ }
+
+ /**
+ *
+ *
+ * @param handler
+ * @throws java.io.IOException
+ * if an IOException occurs during marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ */
+ public void marshal(final org.xml.sax.ContentHandler handler)
+ throws java.io.IOException, org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, handler);
+ }
+
+ /**
*/
- public void setAttachmentAsReference(
- final java.util.Vector attachmentVector) {
- this._attachmentList = attachmentVector;
- }
+ public void removeAllApplicationData() {
+ this._applicationDataList.clear();
+ }
- /**
- * Sets the value of field 'lockFile'.
- *
- * @param lockFile the value of field 'lockFile'.
+ /**
*/
- public void setLockFile(
- final uk.ac.vamsas.objects.core.LockFile lockFile) {
- this._lockFile = lockFile;
- }
+ public void removeAllAttachment() {
+ this._attachmentList.clear();
+ }
- /**
- * Sets the value of field 'provenance'.
- *
- * @param provenance the value of field 'provenance'.
+ /**
*/
- public void setProvenance(
- final uk.ac.vamsas.objects.core.Provenance provenance) {
- this._provenance = provenance;
+ public void removeAllVAMSAS() {
+ this._VAMSASList.clear();
+ }
+
+ /**
+ * Method removeApplicationData.
+ *
+ * @param vApplicationData
+ * @return true if the object was removed from the collection.
+ */
+ public boolean removeApplicationData(
+ final uk.ac.vamsas.objects.core.ApplicationData vApplicationData) {
+ boolean removed = _applicationDataList.remove(vApplicationData);
+ return removed;
+ }
+
+ /**
+ * Method removeApplicationDataAt.
+ *
+ * @param index
+ * @return the element removed from the collection
+ */
+ public uk.ac.vamsas.objects.core.ApplicationData removeApplicationDataAt(
+ final int index) {
+ java.lang.Object obj = this._applicationDataList.remove(index);
+ return (uk.ac.vamsas.objects.core.ApplicationData) obj;
+ }
+
+ /**
+ * Method removeAttachment.
+ *
+ * @param vAttachment
+ * @return true if the object was removed from the collection.
+ */
+ public boolean removeAttachment(
+ final uk.ac.vamsas.objects.core.Attachment vAttachment) {
+ boolean removed = _attachmentList.remove(vAttachment);
+ return removed;
+ }
+
+ /**
+ * Method removeAttachmentAt.
+ *
+ * @param index
+ * @return the element removed from the collection
+ */
+ public uk.ac.vamsas.objects.core.Attachment removeAttachmentAt(final int index) {
+ java.lang.Object obj = this._attachmentList.remove(index);
+ return (uk.ac.vamsas.objects.core.Attachment) obj;
+ }
+
+ /**
+ * Method removeVAMSAS.
+ *
+ * @param vVAMSAS
+ * @return true if the object was removed from the collection.
+ */
+ public boolean removeVAMSAS(final uk.ac.vamsas.objects.core.VAMSAS vVAMSAS) {
+ boolean removed = _VAMSASList.remove(vVAMSAS);
+ return removed;
+ }
+
+ /**
+ * Method removeVAMSASAt.
+ *
+ * @param index
+ * @return the element removed from the collection
+ */
+ public uk.ac.vamsas.objects.core.VAMSAS removeVAMSASAt(final int index) {
+ java.lang.Object obj = this._VAMSASList.remove(index);
+ return (uk.ac.vamsas.objects.core.VAMSAS) obj;
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vApplicationData
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void setApplicationData(final int index,
+ final uk.ac.vamsas.objects.core.ApplicationData vApplicationData)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._applicationDataList.size()) {
+ throw new IndexOutOfBoundsException("setApplicationData: Index value '"
+ + index + "' not in range [0.."
+ + (this._applicationDataList.size() - 1) + "]");
}
- /**
- *
- *
- * @param index
- * @param vVAMSAS
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void setVAMSAS(
- final int index,
- final uk.ac.vamsas.objects.core.VAMSAS vVAMSAS)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._VAMSASList.size()) {
- throw new IndexOutOfBoundsException("setVAMSAS: Index value '" + index + "' not in range [0.." + (this._VAMSASList.size() - 1) + "]");
- }
-
- this._VAMSASList.set(index, vVAMSAS);
+ this._applicationDataList.set(index, vApplicationData);
+ }
+
+ /**
+ *
+ *
+ * @param vApplicationDataArray
+ */
+ public void setApplicationData(
+ final uk.ac.vamsas.objects.core.ApplicationData[] vApplicationDataArray) {
+ // -- copy array
+ _applicationDataList.clear();
+
+ for (int i = 0; i < vApplicationDataArray.length; i++) {
+ this._applicationDataList.add(vApplicationDataArray[i]);
}
-
- /**
- *
- *
- * @param vVAMSASArray
- */
- public void setVAMSAS(
- final uk.ac.vamsas.objects.core.VAMSAS[] vVAMSASArray) {
- //-- copy array
- _VAMSASList.clear();
-
- for (int i = 0; i < vVAMSASArray.length; i++) {
- this._VAMSASList.add(vVAMSASArray[i]);
- }
+ }
+
+ /**
+ * Sets the value of '_applicationDataList' by copying the given Vector. All
+ * elements will be checked for type safety.
+ *
+ * @param vApplicationDataList
+ * the Vector to copy.
+ */
+ public void setApplicationData(final java.util.Vector vApplicationDataList) {
+ // copy vector
+ this._applicationDataList.clear();
+
+ this._applicationDataList.addAll(vApplicationDataList);
+ }
+
+ /**
+ * Sets the value of '_applicationDataList' by setting it to the given Vector.
+ * No type checking is performed.
+ *
+ * @deprecated
+ *
+ * @param applicationDataVector
+ * the Vector to set.
+ */
+ public void setApplicationDataAsReference(
+ final java.util.Vector applicationDataVector) {
+ this._applicationDataList = applicationDataVector;
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vAttachment
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void setAttachment(final int index,
+ final uk.ac.vamsas.objects.core.Attachment vAttachment)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._attachmentList.size()) {
+ throw new IndexOutOfBoundsException("setAttachment: Index value '"
+ + index + "' not in range [0.." + (this._attachmentList.size() - 1)
+ + "]");
}
- /**
- * Sets the value of '_VAMSASList' by copying the given Vector.
- * All elements will be checked for type safety.
- *
- * @param vVAMSASList the Vector to copy.
- */
- public void setVAMSAS(
- final java.util.Vector vVAMSASList) {
- // copy vector
- this._VAMSASList.clear();
-
- this._VAMSASList.addAll(vVAMSASList);
+ this._attachmentList.set(index, vAttachment);
+ }
+
+ /**
+ *
+ *
+ * @param vAttachmentArray
+ */
+ public void setAttachment(
+ final uk.ac.vamsas.objects.core.Attachment[] vAttachmentArray) {
+ // -- copy array
+ _attachmentList.clear();
+
+ for (int i = 0; i < vAttachmentArray.length; i++) {
+ this._attachmentList.add(vAttachmentArray[i]);
}
-
- /**
- * Sets the value of '_VAMSASList' by setting it to the given
- * Vector. No type checking is performed.
- * @deprecated
- *
- * @param VAMSASVector the Vector to set.
- */
- public void setVAMSASAsReference(
- final java.util.Vector VAMSASVector) {
- this._VAMSASList = VAMSASVector;
+ }
+
+ /**
+ * Sets the value of '_attachmentList' by copying the given Vector. All
+ * elements will be checked for type safety.
+ *
+ * @param vAttachmentList
+ * the Vector to copy.
+ */
+ public void setAttachment(final java.util.Vector vAttachmentList) {
+ // copy vector
+ this._attachmentList.clear();
+
+ this._attachmentList.addAll(vAttachmentList);
+ }
+
+ /**
+ * Sets the value of '_attachmentList' by setting it to the given Vector. No
+ * type checking is performed.
+ *
+ * @deprecated
+ *
+ * @param attachmentVector
+ * the Vector to set.
+ */
+ public void setAttachmentAsReference(final java.util.Vector attachmentVector) {
+ this._attachmentList = attachmentVector;
+ }
+
+ /**
+ * Sets the value of field 'lockFile'.
+ *
+ * @param lockFile
+ * the value of field 'lockFile'.
+ */
+ public void setLockFile(final uk.ac.vamsas.objects.core.LockFile lockFile) {
+ this._lockFile = lockFile;
+ }
+
+ /**
+ * Sets the value of field 'provenance'.
+ *
+ * @param provenance
+ * the value of field 'provenance'.
+ */
+ public void setProvenance(
+ final uk.ac.vamsas.objects.core.Provenance provenance) {
+ this._provenance = provenance;
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vVAMSAS
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void setVAMSAS(final int index,
+ final uk.ac.vamsas.objects.core.VAMSAS vVAMSAS)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._VAMSASList.size()) {
+ throw new IndexOutOfBoundsException("setVAMSAS: Index value '" + index
+ + "' not in range [0.." + (this._VAMSASList.size() - 1) + "]");
}
- /**
- * Sets the value of field 'version'. The field 'version' has
- * the following description: Vamsas Document Version Number
- *
- * @param version the value of field 'version'.
- */
- public void setVersion(
- final java.lang.String version) {
- this._version = version;
- }
+ this._VAMSASList.set(index, vVAMSAS);
+ }
- /**
- * Method unmarshal.
- *
- * @param reader
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @return the unmarshaled
- * uk.ac.vamsas.objects.core.VamsasDocument
- */
- public static uk.ac.vamsas.objects.core.VamsasDocument unmarshal(
- final java.io.Reader reader)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- return (uk.ac.vamsas.objects.core.VamsasDocument) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.VamsasDocument.class, reader);
- }
+ /**
+ *
+ *
+ * @param vVAMSASArray
+ */
+ public void setVAMSAS(final uk.ac.vamsas.objects.core.VAMSAS[] vVAMSASArray) {
+ // -- copy array
+ _VAMSASList.clear();
- /**
- *
- *
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void validate(
- )
- throws org.exolab.castor.xml.ValidationException {
- org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
- validator.validate(this);
+ for (int i = 0; i < vVAMSASArray.length; i++) {
+ this._VAMSASList.add(vVAMSASArray[i]);
}
+ }
+
+ /**
+ * Sets the value of '_VAMSASList' by copying the given Vector. All elements
+ * will be checked for type safety.
+ *
+ * @param vVAMSASList
+ * the Vector to copy.
+ */
+ public void setVAMSAS(final java.util.Vector vVAMSASList) {
+ // copy vector
+ this._VAMSASList.clear();
+
+ this._VAMSASList.addAll(vVAMSASList);
+ }
+
+ /**
+ * Sets the value of '_VAMSASList' by setting it to the given Vector. No type
+ * checking is performed.
+ *
+ * @deprecated
+ *
+ * @param VAMSASVector
+ * the Vector to set.
+ */
+ public void setVAMSASAsReference(final java.util.Vector VAMSASVector) {
+ this._VAMSASList = VAMSASVector;
+ }
+
+ /**
+ * Sets the value of field 'version'. The field 'version' has the following
+ * description: Vamsas Document Version Number
+ *
+ * @param version
+ * the value of field 'version'.
+ */
+ public void setVersion(final java.lang.String version) {
+ this._version = version;
+ }
+
+ /**
+ * Method unmarshal.
+ *
+ * @param reader
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @return the unmarshaled uk.ac.vamsas.objects.core.VamsasDocument
+ */
+ public static uk.ac.vamsas.objects.core.VamsasDocument unmarshal(
+ final java.io.Reader reader)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ return (uk.ac.vamsas.objects.core.VamsasDocument) Unmarshaller.unmarshal(
+ uk.ac.vamsas.objects.core.VamsasDocument.class, reader);
+ }
+
+ /**
+ *
+ *
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void validate() throws org.exolab.castor.xml.ValidationException {
+ org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+ validator.validate(this);
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/Vref.java b/src/uk/ac/vamsas/objects/core/Vref.java
index 87f0444..78c50c5 100644
--- a/src/uk/ac/vamsas/objects/core/Vref.java
+++ b/src/uk/ac/vamsas/objects/core/Vref.java
@@ -1,156 +1,164 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import org.exolab.castor.xml.Marshaller;
import org.exolab.castor.xml.Unmarshaller;
/**
- * Direct associations between this node and any vamsas
- * objects
+ * Direct associations between this node and any vamsas objects
*
* @version $Revision$ $Date$
*/
-public class Vref extends ReferenceType
-implements java.io.Serializable
-{
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public Vref() {
- super();
- }
+public class Vref extends ReferenceType implements java.io.Serializable {
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
- //-----------/
- //- Methods -/
- //-----------/
-
- /**
- * Overrides the java.lang.Object.equals method.
- *
- * @param obj
- * @return true if the objects are equal.
- */
- public boolean equals(
- final java.lang.Object obj) {
- if ( this == obj )
- return true;
-
- if (super.equals(obj)==false)
- return false;
-
- if (obj instanceof Vref) {
-
- return true;
- }
- return false;
- }
+ public Vref() {
+ super();
+ }
- /**
- * Overrides the java.lang.Object.hashCode method.
- *
- * The following steps came from Effective Java Programming
- * Language Guide by Joshua Bloch, Chapter 3
- *
- * @return a hash code value for the object.
- */
- public int hashCode(
- ) {
- int result = super.hashCode();
-
- long tmp;
-
- return result;
- }
+ // -----------/
+ // - Methods -/
+ // -----------/
- /**
- * Method isValid.
- *
- * @return true if this object is valid according to the schema
- */
- public boolean isValid(
- ) {
- try {
- validate();
- } catch (org.exolab.castor.xml.ValidationException vex) {
- return false;
- }
- return true;
- }
+ /**
+ * Overrides the java.lang.Object.equals method.
+ *
+ * @param obj
+ * @return true if the objects are equal.
+ */
+ public boolean equals(final java.lang.Object obj) {
+ if (this == obj)
+ return true;
- /**
- *
- *
- * @param out
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void marshal(
- final java.io.Writer out)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, out);
- }
+ if (super.equals(obj) == false)
+ return false;
- /**
- *
- *
- * @param handler
- * @throws java.io.IOException if an IOException occurs during
- * marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- */
- public void marshal(
- final org.xml.sax.ContentHandler handler)
- throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, handler);
- }
+ if (obj instanceof Vref) {
- /**
- * Method unmarshal.
- *
- * @param reader
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @return the unmarshaled
- * uk.ac.vamsas.objects.core.ReferenceType
- */
- public static uk.ac.vamsas.objects.core.ReferenceType unmarshal(
- final java.io.Reader reader)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- return (uk.ac.vamsas.objects.core.ReferenceType) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Vref.class, reader);
+ return true;
}
-
- /**
- *
- *
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void validate(
- )
- throws org.exolab.castor.xml.ValidationException {
- org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
- validator.validate(this);
+ return false;
+ }
+
+ /**
+ * Overrides the java.lang.Object.hashCode method.
+ *
+ * The following steps came from Effective Java Programming Language
+ * Guide by Joshua Bloch, Chapter 3
+ *
+ * @return a hash code value for the object.
+ */
+ public int hashCode() {
+ int result = super.hashCode();
+
+ long tmp;
+
+ return result;
+ }
+
+ /**
+ * Method isValid.
+ *
+ * @return true if this object is valid according to the schema
+ */
+ public boolean isValid() {
+ try {
+ validate();
+ } catch (org.exolab.castor.xml.ValidationException vex) {
+ return false;
}
+ return true;
+ }
+
+ /**
+ *
+ *
+ * @param out
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void marshal(final java.io.Writer out)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, out);
+ }
+
+ /**
+ *
+ *
+ * @param handler
+ * @throws java.io.IOException
+ * if an IOException occurs during marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ */
+ public void marshal(final org.xml.sax.ContentHandler handler)
+ throws java.io.IOException, org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, handler);
+ }
+
+ /**
+ * Method unmarshal.
+ *
+ * @param reader
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @return the unmarshaled uk.ac.vamsas.objects.core.ReferenceType
+ */
+ public static uk.ac.vamsas.objects.core.ReferenceType unmarshal(
+ final java.io.Reader reader)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ return (uk.ac.vamsas.objects.core.ReferenceType) Unmarshaller.unmarshal(
+ uk.ac.vamsas.objects.core.Vref.class, reader);
+ }
+
+ /**
+ *
+ *
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void validate() throws org.exolab.castor.xml.ValidationException {
+ org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+ validator.validate(this);
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/Vxref.java b/src/uk/ac/vamsas/objects/core/Vxref.java
index 0614ee1..c000265 100644
--- a/src/uk/ac/vamsas/objects/core/Vxref.java
+++ b/src/uk/ac/vamsas/objects/core/Vxref.java
@@ -1,156 +1,164 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import org.exolab.castor.xml.Marshaller;
import org.exolab.castor.xml.Unmarshaller;
/**
- * explicitly named cross reference to
- * other objects in the document.
+ * explicitly named cross reference to other objects in the document.
*
* @version $Revision$ $Date$
*/
-public class Vxref extends ReferenceType
-implements java.io.Serializable
-{
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public Vxref() {
- super();
- }
+public class Vxref extends ReferenceType implements java.io.Serializable {
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
- //-----------/
- //- Methods -/
- //-----------/
-
- /**
- * Overrides the java.lang.Object.equals method.
- *
- * @param obj
- * @return true if the objects are equal.
- */
- public boolean equals(
- final java.lang.Object obj) {
- if ( this == obj )
- return true;
-
- if (super.equals(obj)==false)
- return false;
-
- if (obj instanceof Vxref) {
-
- return true;
- }
- return false;
- }
+ public Vxref() {
+ super();
+ }
- /**
- * Overrides the java.lang.Object.hashCode method.
- *
- * The following steps came from Effective Java Programming
- * Language Guide by Joshua Bloch, Chapter 3
- *
- * @return a hash code value for the object.
- */
- public int hashCode(
- ) {
- int result = super.hashCode();
-
- long tmp;
-
- return result;
- }
+ // -----------/
+ // - Methods -/
+ // -----------/
- /**
- * Method isValid.
- *
- * @return true if this object is valid according to the schema
- */
- public boolean isValid(
- ) {
- try {
- validate();
- } catch (org.exolab.castor.xml.ValidationException vex) {
- return false;
- }
- return true;
- }
+ /**
+ * Overrides the java.lang.Object.equals method.
+ *
+ * @param obj
+ * @return true if the objects are equal.
+ */
+ public boolean equals(final java.lang.Object obj) {
+ if (this == obj)
+ return true;
- /**
- *
- *
- * @param out
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void marshal(
- final java.io.Writer out)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, out);
- }
+ if (super.equals(obj) == false)
+ return false;
- /**
- *
- *
- * @param handler
- * @throws java.io.IOException if an IOException occurs during
- * marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- */
- public void marshal(
- final org.xml.sax.ContentHandler handler)
- throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, handler);
- }
+ if (obj instanceof Vxref) {
- /**
- * Method unmarshal.
- *
- * @param reader
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @return the unmarshaled
- * uk.ac.vamsas.objects.core.ReferenceType
- */
- public static uk.ac.vamsas.objects.core.ReferenceType unmarshal(
- final java.io.Reader reader)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- return (uk.ac.vamsas.objects.core.ReferenceType) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Vxref.class, reader);
+ return true;
}
-
- /**
- *
- *
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void validate(
- )
- throws org.exolab.castor.xml.ValidationException {
- org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
- validator.validate(this);
+ return false;
+ }
+
+ /**
+ * Overrides the java.lang.Object.hashCode method.
+ *
+ * The following steps came from Effective Java Programming Language
+ * Guide by Joshua Bloch, Chapter 3
+ *
+ * @return a hash code value for the object.
+ */
+ public int hashCode() {
+ int result = super.hashCode();
+
+ long tmp;
+
+ return result;
+ }
+
+ /**
+ * Method isValid.
+ *
+ * @return true if this object is valid according to the schema
+ */
+ public boolean isValid() {
+ try {
+ validate();
+ } catch (org.exolab.castor.xml.ValidationException vex) {
+ return false;
}
+ return true;
+ }
+
+ /**
+ *
+ *
+ * @param out
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void marshal(final java.io.Writer out)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, out);
+ }
+
+ /**
+ *
+ *
+ * @param handler
+ * @throws java.io.IOException
+ * if an IOException occurs during marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ */
+ public void marshal(final org.xml.sax.ContentHandler handler)
+ throws java.io.IOException, org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, handler);
+ }
+
+ /**
+ * Method unmarshal.
+ *
+ * @param reader
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @return the unmarshaled uk.ac.vamsas.objects.core.ReferenceType
+ */
+ public static uk.ac.vamsas.objects.core.ReferenceType unmarshal(
+ final java.io.Reader reader)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException {
+ return (uk.ac.vamsas.objects.core.ReferenceType) Unmarshaller.unmarshal(
+ uk.ac.vamsas.objects.core.Vxref.class, reader);
+ }
+
+ /**
+ *
+ *
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void validate() throws org.exolab.castor.xml.ValidationException {
+ org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+ validator.validate(this);
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/descriptors/AlignmentAnnotationDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/AlignmentAnnotationDescriptor.java
index 3edd3e3..179b9e5 100644
--- a/src/uk/ac/vamsas/objects/core/descriptors/AlignmentAnnotationDescriptor.java
+++ b/src/uk/ac/vamsas/objects/core/descriptors/AlignmentAnnotationDescriptor.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core.descriptors;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import uk.ac.vamsas.objects.core.AlignmentAnnotation;
@@ -18,266 +32,266 @@ import uk.ac.vamsas.objects.core.AlignmentAnnotation;
*
* @version $Revision$ $Date$
*/
-public class AlignmentAnnotationDescriptor extends uk.ac.vamsas.objects.core.descriptors.RangeAnnotationDescriptor {
-
-
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
- * Field _elementDefinition.
- */
- private boolean _elementDefinition;
-
- /**
- * Field _nsPrefix.
- */
- private java.lang.String _nsPrefix;
-
- /**
- * Field _nsURI.
- */
- private java.lang.String _nsURI;
-
- /**
- * Field _xmlName.
- */
- private java.lang.String _xmlName;
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public AlignmentAnnotationDescriptor() {
- super();
- setExtendsWithoutFlatten(new uk.ac.vamsas.objects.core.descriptors.RangeAnnotationDescriptor());
- _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
- _xmlName = "AlignmentAnnotation";
- _elementDefinition = true;
-
- //-- set grouping compositor
- setCompositorAsSequence();
- org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
- org.exolab.castor.mapping.FieldHandler handler = null;
- org.exolab.castor.xml.FieldValidator fieldValidator = null;
- //-- initialize attribute descriptors
-
- //-- _graph
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_graph", "graph", org.exolab.castor.xml.NodeType.Attribute);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- AlignmentAnnotation target = (AlignmentAnnotation) object;
- if (!target.hasGraph()) { return null; }
- return (target.getGraph() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE);
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- AlignmentAnnotation target = (AlignmentAnnotation) object;
- // ignore null values for non optional primitives
- if (value == null) { return; }
-
- target.setGraph( ((java.lang.Boolean) value).booleanValue());
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setRequired(true);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _graph
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(1);
- { //-- local scope
- org.exolab.castor.xml.validators.BooleanValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
- fieldValidator.setValidator(typeValidator);
- }
- desc.setValidator(fieldValidator);
- //-- _seqrefs
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Object.class, "_seqrefs", "seqrefs", org.exolab.castor.xml.NodeType.Attribute);
- desc.setReference(true);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- AlignmentAnnotation target = (AlignmentAnnotation) object;
- return target.getSeqrefs();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- AlignmentAnnotation target = (AlignmentAnnotation) object;
- target.addSeqrefs( (java.lang.Object) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException {
- try {
- AlignmentAnnotation target = (AlignmentAnnotation) object;
- target.removeAllSeqrefs();
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new java.lang.Object();
- }
- };
- desc.setMultivalued(true);
- desc.setHandler(handler);
- desc.setMultivalued(true);
- addFieldDescriptor(desc);
-
- //-- validation code for: _seqrefs
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(0);
- { //-- local scope
- org.exolab.castor.xml.validators.IdRefsValidator typeValidator = new org.exolab.castor.xml.validators.IdRefsValidator();
- fieldValidator.setValidator(typeValidator);
- desc.setValidator(fieldValidator);
- }
- desc.setValidator(fieldValidator);
- //-- initialize element descriptors
-
- //-- _provenance
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Provenance.class, "_provenance", "Provenance", org.exolab.castor.xml.NodeType.Element);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- AlignmentAnnotation target = (AlignmentAnnotation) object;
- return target.getProvenance();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- AlignmentAnnotation target = (AlignmentAnnotation) object;
- target.setProvenance( (uk.ac.vamsas.objects.core.Provenance) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new uk.ac.vamsas.objects.core.Provenance();
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
- desc.setRequired(true);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _provenance
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(1);
- { //-- local scope
+public class AlignmentAnnotationDescriptor extends
+ uk.ac.vamsas.objects.core.descriptors.RangeAnnotationDescriptor {
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * Field _elementDefinition.
+ */
+ private boolean _elementDefinition;
+
+ /**
+ * Field _nsPrefix.
+ */
+ private java.lang.String _nsPrefix;
+
+ /**
+ * Field _nsURI.
+ */
+ private java.lang.String _nsURI;
+
+ /**
+ * Field _xmlName.
+ */
+ private java.lang.String _xmlName;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public AlignmentAnnotationDescriptor() {
+ super();
+ setExtendsWithoutFlatten(new uk.ac.vamsas.objects.core.descriptors.RangeAnnotationDescriptor());
+ _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
+ _xmlName = "AlignmentAnnotation";
+ _elementDefinition = true;
+
+ // -- set grouping compositor
+ setCompositorAsSequence();
+ org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
+ org.exolab.castor.mapping.FieldHandler handler = null;
+ org.exolab.castor.xml.FieldValidator fieldValidator = null;
+ // -- initialize attribute descriptors
+
+ // -- _graph
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.Boolean.TYPE, "_graph", "graph",
+ org.exolab.castor.xml.NodeType.Attribute);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ AlignmentAnnotation target = (AlignmentAnnotation) object;
+ if (!target.hasGraph()) {
+ return null;
}
- desc.setValidator(fieldValidator);
- }
+ return (target.getGraph() ? java.lang.Boolean.TRUE
+ : java.lang.Boolean.FALSE);
+ }
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ AlignmentAnnotation target = (AlignmentAnnotation) object;
+ // ignore null values for non optional primitives
+ if (value == null) {
+ return;
+ }
- //-----------/
- //- Methods -/
- //-----------/
+ target.setGraph(((java.lang.Boolean) value).booleanValue());
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- /**
- * Method getAccessMode.
- *
- * @return the access mode specified for this class.
- */
- public org.exolab.castor.mapping.AccessMode getAccessMode(
- ) {
+ public java.lang.Object newInstance(java.lang.Object parent) {
return null;
- }
+ }
+ };
+ desc.setHandler(handler);
+ desc.setRequired(true);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
- /**
- * Method getIdentity.
- *
- * @return the identity field, null if this class has no
- * identity.
- */
- public org.exolab.castor.mapping.FieldDescriptor getIdentity(
- ) {
- return super.getIdentity();
+ // -- validation code for: _graph
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(1);
+ { // -- local scope
+ org.exolab.castor.xml.validators.BooleanValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
+ fieldValidator.setValidator(typeValidator);
}
+ desc.setValidator(fieldValidator);
+ // -- _seqrefs
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.Object.class, "_seqrefs", "seqrefs",
+ org.exolab.castor.xml.NodeType.Attribute);
+ desc.setReference(true);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ AlignmentAnnotation target = (AlignmentAnnotation) object;
+ return target.getSeqrefs();
+ }
- /**
- * Method getJavaClass.
- *
- * @return the Java class represented by this descriptor.
- */
- public java.lang.Class getJavaClass(
- ) {
- return uk.ac.vamsas.objects.core.AlignmentAnnotation.class;
- }
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ AlignmentAnnotation target = (AlignmentAnnotation) object;
+ target.addSeqrefs((java.lang.Object) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- /**
- * Method getNameSpacePrefix.
- *
- * @return the namespace prefix to use when marshaling as XML.
- */
- public java.lang.String getNameSpacePrefix(
- ) {
- return _nsPrefix;
- }
+ public void resetValue(Object object) throws IllegalStateException,
+ IllegalArgumentException {
+ try {
+ AlignmentAnnotation target = (AlignmentAnnotation) object;
+ target.removeAllSeqrefs();
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- /**
- * Method getNameSpaceURI.
- *
- * @return the namespace URI used when marshaling and
- * unmarshaling as XML.
- */
- public java.lang.String getNameSpaceURI(
- ) {
- return _nsURI;
- }
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new java.lang.Object();
+ }
+ };
+ desc.setMultivalued(true);
+ desc.setHandler(handler);
+ desc.setMultivalued(true);
+ addFieldDescriptor(desc);
- /**
- * Method getValidator.
- *
- * @return a specific validator for the class described by this
- * ClassDescriptor.
- */
- public org.exolab.castor.xml.TypeValidator getValidator(
- ) {
- return this;
+ // -- validation code for: _seqrefs
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(0);
+ { // -- local scope
+ org.exolab.castor.xml.validators.IdRefsValidator typeValidator = new org.exolab.castor.xml.validators.IdRefsValidator();
+ fieldValidator.setValidator(typeValidator);
+ desc.setValidator(fieldValidator);
}
+ desc.setValidator(fieldValidator);
+ // -- initialize element descriptors
- /**
- * Method getXMLName.
- *
- * @return the XML Name for the Class being described.
- */
- public java.lang.String getXMLName(
- ) {
- return _xmlName;
- }
+ // -- _provenance
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ uk.ac.vamsas.objects.core.Provenance.class, "_provenance",
+ "Provenance", org.exolab.castor.xml.NodeType.Element);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ AlignmentAnnotation target = (AlignmentAnnotation) object;
+ return target.getProvenance();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ AlignmentAnnotation target = (AlignmentAnnotation) object;
+ target.setProvenance((uk.ac.vamsas.objects.core.Provenance) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new uk.ac.vamsas.objects.core.Provenance();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
+ desc.setRequired(true);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
- /**
- * Method isElementDefinition.
- *
- * @return true if XML schema definition of this Class is that
- * of a global
- * element or element with anonymous type definition.
- */
- public boolean isElementDefinition(
- ) {
- return _elementDefinition;
+ // -- validation code for: _provenance
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(1);
+ { // -- local scope
}
+ desc.setValidator(fieldValidator);
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ * Method getAccessMode.
+ *
+ * @return the access mode specified for this class.
+ */
+ public org.exolab.castor.mapping.AccessMode getAccessMode() {
+ return null;
+ }
+
+ /**
+ * Method getIdentity.
+ *
+ * @return the identity field, null if this class has no identity.
+ */
+ public org.exolab.castor.mapping.FieldDescriptor getIdentity() {
+ return super.getIdentity();
+ }
+
+ /**
+ * Method getJavaClass.
+ *
+ * @return the Java class represented by this descriptor.
+ */
+ public java.lang.Class getJavaClass() {
+ return uk.ac.vamsas.objects.core.AlignmentAnnotation.class;
+ }
+
+ /**
+ * Method getNameSpacePrefix.
+ *
+ * @return the namespace prefix to use when marshaling as XML.
+ */
+ public java.lang.String getNameSpacePrefix() {
+ return _nsPrefix;
+ }
+
+ /**
+ * Method getNameSpaceURI.
+ *
+ * @return the namespace URI used when marshaling and unmarshaling as XML.
+ */
+ public java.lang.String getNameSpaceURI() {
+ return _nsURI;
+ }
+
+ /**
+ * Method getValidator.
+ *
+ * @return a specific validator for the class described by this
+ * ClassDescriptor.
+ */
+ public org.exolab.castor.xml.TypeValidator getValidator() {
+ return this;
+ }
+
+ /**
+ * Method getXMLName.
+ *
+ * @return the XML Name for the Class being described.
+ */
+ public java.lang.String getXMLName() {
+ return _xmlName;
+ }
+
+ /**
+ * Method isElementDefinition.
+ *
+ * @return true if XML schema definition of this Class is that of a global
+ * element or element with anonymous type definition.
+ */
+ public boolean isElementDefinition() {
+ return _elementDefinition;
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/descriptors/AlignmentDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/AlignmentDescriptor.java
index 4d3607e..94d9c08 100644
--- a/src/uk/ac/vamsas/objects/core/descriptors/AlignmentDescriptor.java
+++ b/src/uk/ac/vamsas/objects/core/descriptors/AlignmentDescriptor.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core.descriptors;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import uk.ac.vamsas.objects.core.Alignment;
@@ -18,500 +32,520 @@ import uk.ac.vamsas.objects.core.Alignment;
*
* @version $Revision$ $Date$
*/
-public class AlignmentDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl {
-
-
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
- * Field _elementDefinition.
- */
- private boolean _elementDefinition;
-
- /**
- * Field _nsPrefix.
- */
- private java.lang.String _nsPrefix;
-
- /**
- * Field _nsURI.
- */
- private java.lang.String _nsURI;
-
- /**
- * Field _xmlName.
- */
- private java.lang.String _xmlName;
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public AlignmentDescriptor() {
- super();
- _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
- _xmlName = "Alignment";
- _elementDefinition = true;
-
- //-- set grouping compositor
- setCompositorAsSequence();
- org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
- org.exolab.castor.mapping.FieldHandler handler = null;
- org.exolab.castor.xml.FieldValidator fieldValidator = null;
- //-- initialize attribute descriptors
-
- //-- _gapChar
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_gapChar", "gapChar", org.exolab.castor.xml.NodeType.Attribute);
- desc.setImmutable(true);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- Alignment target = (Alignment) object;
- return target.getGapChar();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- Alignment target = (Alignment) object;
- target.setGapChar( (java.lang.String) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setRequired(true);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _gapChar
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(1);
- { //-- local scope
- org.exolab.castor.xml.validators.StringValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.StringValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setWhiteSpace("preserve");
+public class AlignmentDescriptor extends
+ org.exolab.castor.xml.util.XMLClassDescriptorImpl {
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * Field _elementDefinition.
+ */
+ private boolean _elementDefinition;
+
+ /**
+ * Field _nsPrefix.
+ */
+ private java.lang.String _nsPrefix;
+
+ /**
+ * Field _nsURI.
+ */
+ private java.lang.String _nsURI;
+
+ /**
+ * Field _xmlName.
+ */
+ private java.lang.String _xmlName;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public AlignmentDescriptor() {
+ super();
+ _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
+ _xmlName = "Alignment";
+ _elementDefinition = true;
+
+ // -- set grouping compositor
+ setCompositorAsSequence();
+ org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
+ org.exolab.castor.mapping.FieldHandler handler = null;
+ org.exolab.castor.xml.FieldValidator fieldValidator = null;
+ // -- initialize attribute descriptors
+
+ // -- _gapChar
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.String.class, "_gapChar", "gapChar",
+ org.exolab.castor.xml.NodeType.Attribute);
+ desc.setImmutable(true);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ Alignment target = (Alignment) object;
+ return target.getGapChar();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ Alignment target = (Alignment) object;
+ target.setGapChar((java.lang.String) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
- //-- _aligned
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_aligned", "aligned", org.exolab.castor.xml.NodeType.Attribute);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- Alignment target = (Alignment) object;
- if (!target.hasAligned()) { return null; }
- return (target.getAligned() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE);
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- Alignment target = (Alignment) object;
- // if null, use delete method for optional primitives
- if (value == null) {
- target.deleteAligned();
- return;
- }
- target.setAligned( ((java.lang.Boolean) value).booleanValue());
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _aligned
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { //-- local scope
- org.exolab.castor.xml.validators.BooleanValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
- fieldValidator.setValidator(typeValidator);
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return null;
+ }
+ };
+ desc.setHandler(handler);
+ desc.setRequired(true);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _gapChar
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(1);
+ { // -- local scope
+ org.exolab.castor.xml.validators.StringValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.StringValidator();
+ fieldValidator.setValidator(typeValidator);
+ typeValidator.setWhiteSpace("preserve");
+ }
+ desc.setValidator(fieldValidator);
+ // -- _aligned
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.Boolean.TYPE, "_aligned", "aligned",
+ org.exolab.castor.xml.NodeType.Attribute);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ Alignment target = (Alignment) object;
+ if (!target.hasAligned()) {
+ return null;
}
- desc.setValidator(fieldValidator);
- //-- _id
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_id", "id", org.exolab.castor.xml.NodeType.Attribute);
- super.setIdentity(desc);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- Alignment target = (Alignment) object;
- return target.getId();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- Alignment target = (Alignment) object;
- target.setId( (java.lang.String) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new java.lang.String();
- }
- };
- desc.setHandler(handler);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _id
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { //-- local scope
- org.exolab.castor.xml.validators.IdValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.IdValidator();
- fieldValidator.setValidator(typeValidator);
+ return (target.getAligned() ? java.lang.Boolean.TRUE
+ : java.lang.Boolean.FALSE);
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ Alignment target = (Alignment) object;
+ // if null, use delete method for optional primitives
+ if (value == null) {
+ target.deleteAligned();
+ return;
+ }
+ target.setAligned(((java.lang.Boolean) value).booleanValue());
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
- //-- _modifiable
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_modifiable", "modifiable", org.exolab.castor.xml.NodeType.Attribute);
- desc.setImmutable(true);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- Alignment target = (Alignment) object;
- return target.getModifiable();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- Alignment target = (Alignment) object;
- target.setModifiable( (java.lang.String) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _modifiable
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { //-- local scope
- org.exolab.castor.xml.validators.StringValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.StringValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setWhiteSpace("preserve");
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return null;
+ }
+ };
+ desc.setHandler(handler);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _aligned
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ { // -- local scope
+ org.exolab.castor.xml.validators.BooleanValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
+ fieldValidator.setValidator(typeValidator);
+ }
+ desc.setValidator(fieldValidator);
+ // -- _id
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.String.class, "_id", "id",
+ org.exolab.castor.xml.NodeType.Attribute);
+ super.setIdentity(desc);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ Alignment target = (Alignment) object;
+ return target.getId();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ Alignment target = (Alignment) object;
+ target.setId((java.lang.String) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
- //-- initialize element descriptors
-
- //-- _alignmentAnnotationList
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.AlignmentAnnotation.class, "_alignmentAnnotationList", "AlignmentAnnotation", org.exolab.castor.xml.NodeType.Element);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- Alignment target = (Alignment) object;
- return target.getAlignmentAnnotation();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- Alignment target = (Alignment) object;
- target.addAlignmentAnnotation( (uk.ac.vamsas.objects.core.AlignmentAnnotation) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException {
- try {
- Alignment target = (Alignment) object;
- target.removeAllAlignmentAnnotation();
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new uk.ac.vamsas.objects.core.AlignmentAnnotation();
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
- desc.setMultivalued(true);
- addFieldDescriptor(desc);
-
- //-- validation code for: _alignmentAnnotationList
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(0);
- { //-- local scope
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new java.lang.String();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _id
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ { // -- local scope
+ org.exolab.castor.xml.validators.IdValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.IdValidator();
+ fieldValidator.setValidator(typeValidator);
+ }
+ desc.setValidator(fieldValidator);
+ // -- _modifiable
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.String.class, "_modifiable", "modifiable",
+ org.exolab.castor.xml.NodeType.Attribute);
+ desc.setImmutable(true);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ Alignment target = (Alignment) object;
+ return target.getModifiable();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ Alignment target = (Alignment) object;
+ target.setModifiable((java.lang.String) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
- //-- _treeList
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Tree.class, "_treeList", "Tree", org.exolab.castor.xml.NodeType.Element);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- Alignment target = (Alignment) object;
- return target.getTree();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- Alignment target = (Alignment) object;
- target.addTree( (uk.ac.vamsas.objects.core.Tree) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException {
- try {
- Alignment target = (Alignment) object;
- target.removeAllTree();
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new uk.ac.vamsas.objects.core.Tree();
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
- desc.setMultivalued(true);
- addFieldDescriptor(desc);
-
- //-- validation code for: _treeList
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(0);
- { //-- local scope
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return null;
+ }
+ };
+ desc.setHandler(handler);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _modifiable
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ { // -- local scope
+ org.exolab.castor.xml.validators.StringValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.StringValidator();
+ fieldValidator.setValidator(typeValidator);
+ typeValidator.setWhiteSpace("preserve");
+ }
+ desc.setValidator(fieldValidator);
+ // -- initialize element descriptors
+
+ // -- _alignmentAnnotationList
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ uk.ac.vamsas.objects.core.AlignmentAnnotation.class,
+ "_alignmentAnnotationList", "AlignmentAnnotation",
+ org.exolab.castor.xml.NodeType.Element);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ Alignment target = (Alignment) object;
+ return target.getAlignmentAnnotation();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ Alignment target = (Alignment) object;
+ target
+ .addAlignmentAnnotation((uk.ac.vamsas.objects.core.AlignmentAnnotation) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
- //-- _alignmentSequenceList
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.AlignmentSequence.class, "_alignmentSequenceList", "alignmentSequence", org.exolab.castor.xml.NodeType.Element);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- Alignment target = (Alignment) object;
- return target.getAlignmentSequence();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- Alignment target = (Alignment) object;
- target.addAlignmentSequence( (uk.ac.vamsas.objects.core.AlignmentSequence) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException {
- try {
- Alignment target = (Alignment) object;
- target.removeAllAlignmentSequence();
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new uk.ac.vamsas.objects.core.AlignmentSequence();
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
- desc.setRequired(true);
- desc.setMultivalued(true);
- addFieldDescriptor(desc);
-
- //-- validation code for: _alignmentSequenceList
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(1);
- { //-- local scope
+ }
+
+ public void resetValue(Object object) throws IllegalStateException,
+ IllegalArgumentException {
+ try {
+ Alignment target = (Alignment) object;
+ target.removeAllAlignmentAnnotation();
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
- //-- _propertyList
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Property.class, "_propertyList", "property", org.exolab.castor.xml.NodeType.Element);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- Alignment target = (Alignment) object;
- return target.getProperty();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- Alignment target = (Alignment) object;
- target.addProperty( (uk.ac.vamsas.objects.core.Property) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException {
- try {
- Alignment target = (Alignment) object;
- target.removeAllProperty();
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new uk.ac.vamsas.objects.core.Property();
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
- desc.setMultivalued(true);
- addFieldDescriptor(desc);
-
- //-- validation code for: _propertyList
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(0);
- { //-- local scope
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new uk.ac.vamsas.objects.core.AlignmentAnnotation();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
+ desc.setMultivalued(true);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _alignmentAnnotationList
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(0);
+ { // -- local scope
+ }
+ desc.setValidator(fieldValidator);
+ // -- _treeList
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ uk.ac.vamsas.objects.core.Tree.class, "_treeList", "Tree",
+ org.exolab.castor.xml.NodeType.Element);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ Alignment target = (Alignment) object;
+ return target.getTree();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ Alignment target = (Alignment) object;
+ target.addTree((uk.ac.vamsas.objects.core.Tree) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
- //-- _provenance
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Provenance.class, "_provenance", "Provenance", org.exolab.castor.xml.NodeType.Element);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- Alignment target = (Alignment) object;
- return target.getProvenance();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- Alignment target = (Alignment) object;
- target.setProvenance( (uk.ac.vamsas.objects.core.Provenance) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new uk.ac.vamsas.objects.core.Provenance();
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
- desc.setRequired(true);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _provenance
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(1);
- { //-- local scope
+ }
+
+ public void resetValue(Object object) throws IllegalStateException,
+ IllegalArgumentException {
+ try {
+ Alignment target = (Alignment) object;
+ target.removeAllTree();
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new uk.ac.vamsas.objects.core.Tree();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
+ desc.setMultivalued(true);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _treeList
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(0);
+ { // -- local scope
}
+ desc.setValidator(fieldValidator);
+ // -- _alignmentSequenceList
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ uk.ac.vamsas.objects.core.AlignmentSequence.class,
+ "_alignmentSequenceList", "alignmentSequence",
+ org.exolab.castor.xml.NodeType.Element);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ Alignment target = (Alignment) object;
+ return target.getAlignmentSequence();
+ }
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ Alignment target = (Alignment) object;
+ target
+ .addAlignmentSequence((uk.ac.vamsas.objects.core.AlignmentSequence) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- //-----------/
- //- Methods -/
- //-----------/
+ public void resetValue(Object object) throws IllegalStateException,
+ IllegalArgumentException {
+ try {
+ Alignment target = (Alignment) object;
+ target.removeAllAlignmentSequence();
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- /**
- * Method getAccessMode.
- *
- * @return the access mode specified for this class.
- */
- public org.exolab.castor.mapping.AccessMode getAccessMode(
- ) {
- return null;
- }
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new uk.ac.vamsas.objects.core.AlignmentSequence();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
+ desc.setRequired(true);
+ desc.setMultivalued(true);
+ addFieldDescriptor(desc);
- /**
- * Method getIdentity.
- *
- * @return the identity field, null if this class has no
- * identity.
- */
- public org.exolab.castor.mapping.FieldDescriptor getIdentity(
- ) {
- return super.getIdentity();
+ // -- validation code for: _alignmentSequenceList
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(1);
+ { // -- local scope
}
+ desc.setValidator(fieldValidator);
+ // -- _propertyList
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ uk.ac.vamsas.objects.core.Property.class, "_propertyList", "property",
+ org.exolab.castor.xml.NodeType.Element);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ Alignment target = (Alignment) object;
+ return target.getProperty();
+ }
- /**
- * Method getJavaClass.
- *
- * @return the Java class represented by this descriptor.
- */
- public java.lang.Class getJavaClass(
- ) {
- return uk.ac.vamsas.objects.core.Alignment.class;
- }
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ Alignment target = (Alignment) object;
+ target.addProperty((uk.ac.vamsas.objects.core.Property) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- /**
- * Method getNameSpacePrefix.
- *
- * @return the namespace prefix to use when marshaling as XML.
- */
- public java.lang.String getNameSpacePrefix(
- ) {
- return _nsPrefix;
- }
+ public void resetValue(Object object) throws IllegalStateException,
+ IllegalArgumentException {
+ try {
+ Alignment target = (Alignment) object;
+ target.removeAllProperty();
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- /**
- * Method getNameSpaceURI.
- *
- * @return the namespace URI used when marshaling and
- * unmarshaling as XML.
- */
- public java.lang.String getNameSpaceURI(
- ) {
- return _nsURI;
- }
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new uk.ac.vamsas.objects.core.Property();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
+ desc.setMultivalued(true);
+ addFieldDescriptor(desc);
- /**
- * Method getValidator.
- *
- * @return a specific validator for the class described by this
- * ClassDescriptor.
- */
- public org.exolab.castor.xml.TypeValidator getValidator(
- ) {
- return this;
+ // -- validation code for: _propertyList
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(0);
+ { // -- local scope
}
+ desc.setValidator(fieldValidator);
+ // -- _provenance
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ uk.ac.vamsas.objects.core.Provenance.class, "_provenance",
+ "Provenance", org.exolab.castor.xml.NodeType.Element);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ Alignment target = (Alignment) object;
+ return target.getProvenance();
+ }
- /**
- * Method getXMLName.
- *
- * @return the XML Name for the Class being described.
- */
- public java.lang.String getXMLName(
- ) {
- return _xmlName;
- }
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ Alignment target = (Alignment) object;
+ target.setProvenance((uk.ac.vamsas.objects.core.Provenance) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- /**
- * Method isElementDefinition.
- *
- * @return true if XML schema definition of this Class is that
- * of a global
- * element or element with anonymous type definition.
- */
- public boolean isElementDefinition(
- ) {
- return _elementDefinition;
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new uk.ac.vamsas.objects.core.Provenance();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
+ desc.setRequired(true);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _provenance
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(1);
+ { // -- local scope
}
+ desc.setValidator(fieldValidator);
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ * Method getAccessMode.
+ *
+ * @return the access mode specified for this class.
+ */
+ public org.exolab.castor.mapping.AccessMode getAccessMode() {
+ return null;
+ }
+
+ /**
+ * Method getIdentity.
+ *
+ * @return the identity field, null if this class has no identity.
+ */
+ public org.exolab.castor.mapping.FieldDescriptor getIdentity() {
+ return super.getIdentity();
+ }
+
+ /**
+ * Method getJavaClass.
+ *
+ * @return the Java class represented by this descriptor.
+ */
+ public java.lang.Class getJavaClass() {
+ return uk.ac.vamsas.objects.core.Alignment.class;
+ }
+
+ /**
+ * Method getNameSpacePrefix.
+ *
+ * @return the namespace prefix to use when marshaling as XML.
+ */
+ public java.lang.String getNameSpacePrefix() {
+ return _nsPrefix;
+ }
+
+ /**
+ * Method getNameSpaceURI.
+ *
+ * @return the namespace URI used when marshaling and unmarshaling as XML.
+ */
+ public java.lang.String getNameSpaceURI() {
+ return _nsURI;
+ }
+
+ /**
+ * Method getValidator.
+ *
+ * @return a specific validator for the class described by this
+ * ClassDescriptor.
+ */
+ public org.exolab.castor.xml.TypeValidator getValidator() {
+ return this;
+ }
+
+ /**
+ * Method getXMLName.
+ *
+ * @return the XML Name for the Class being described.
+ */
+ public java.lang.String getXMLName() {
+ return _xmlName;
+ }
+
+ /**
+ * Method isElementDefinition.
+ *
+ * @return true if XML schema definition of this Class is that of a global
+ * element or element with anonymous type definition.
+ */
+ public boolean isElementDefinition() {
+ return _elementDefinition;
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/descriptors/AlignmentSequenceAnnotationDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/AlignmentSequenceAnnotationDescriptor.java
index 44d0c00..ad6b662 100644
--- a/src/uk/ac/vamsas/objects/core/descriptors/AlignmentSequenceAnnotationDescriptor.java
+++ b/src/uk/ac/vamsas/objects/core/descriptors/AlignmentSequenceAnnotationDescriptor.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core.descriptors;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation;
@@ -18,220 +32,216 @@ import uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation;
*
* @version $Revision$ $Date$
*/
-public class AlignmentSequenceAnnotationDescriptor extends uk.ac.vamsas.objects.core.descriptors.RangeAnnotationDescriptor {
-
-
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
- * Field _elementDefinition.
- */
- private boolean _elementDefinition;
-
- /**
- * Field _nsPrefix.
- */
- private java.lang.String _nsPrefix;
-
- /**
- * Field _nsURI.
- */
- private java.lang.String _nsURI;
-
- /**
- * Field _xmlName.
- */
- private java.lang.String _xmlName;
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public AlignmentSequenceAnnotationDescriptor() {
- super();
- setExtendsWithoutFlatten(new uk.ac.vamsas.objects.core.descriptors.RangeAnnotationDescriptor());
- _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
- _xmlName = "AlignmentSequenceAnnotation";
- _elementDefinition = true;
-
- //-- set grouping compositor
- setCompositorAsSequence();
- org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
- org.exolab.castor.mapping.FieldHandler handler = null;
- org.exolab.castor.xml.FieldValidator fieldValidator = null;
- //-- initialize attribute descriptors
-
- //-- _graph
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_graph", "graph", org.exolab.castor.xml.NodeType.Attribute);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- AlignmentSequenceAnnotation target = (AlignmentSequenceAnnotation) object;
- if (!target.hasGraph()) { return null; }
- return (target.getGraph() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE);
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- AlignmentSequenceAnnotation target = (AlignmentSequenceAnnotation) object;
- // ignore null values for non optional primitives
- if (value == null) { return; }
-
- target.setGraph( ((java.lang.Boolean) value).booleanValue());
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setRequired(true);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _graph
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(1);
- { //-- local scope
- org.exolab.castor.xml.validators.BooleanValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
- fieldValidator.setValidator(typeValidator);
+public class AlignmentSequenceAnnotationDescriptor extends
+ uk.ac.vamsas.objects.core.descriptors.RangeAnnotationDescriptor {
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * Field _elementDefinition.
+ */
+ private boolean _elementDefinition;
+
+ /**
+ * Field _nsPrefix.
+ */
+ private java.lang.String _nsPrefix;
+
+ /**
+ * Field _nsURI.
+ */
+ private java.lang.String _nsURI;
+
+ /**
+ * Field _xmlName.
+ */
+ private java.lang.String _xmlName;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public AlignmentSequenceAnnotationDescriptor() {
+ super();
+ setExtendsWithoutFlatten(new uk.ac.vamsas.objects.core.descriptors.RangeAnnotationDescriptor());
+ _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
+ _xmlName = "AlignmentSequenceAnnotation";
+ _elementDefinition = true;
+
+ // -- set grouping compositor
+ setCompositorAsSequence();
+ org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
+ org.exolab.castor.mapping.FieldHandler handler = null;
+ org.exolab.castor.xml.FieldValidator fieldValidator = null;
+ // -- initialize attribute descriptors
+
+ // -- _graph
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.Boolean.TYPE, "_graph", "graph",
+ org.exolab.castor.xml.NodeType.Attribute);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ AlignmentSequenceAnnotation target = (AlignmentSequenceAnnotation) object;
+ if (!target.hasGraph()) {
+ return null;
}
- desc.setValidator(fieldValidator);
- //-- initialize element descriptors
-
- //-- _provenance
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Provenance.class, "_provenance", "Provenance", org.exolab.castor.xml.NodeType.Element);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- AlignmentSequenceAnnotation target = (AlignmentSequenceAnnotation) object;
- return target.getProvenance();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- AlignmentSequenceAnnotation target = (AlignmentSequenceAnnotation) object;
- target.setProvenance( (uk.ac.vamsas.objects.core.Provenance) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new uk.ac.vamsas.objects.core.Provenance();
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
- desc.setRequired(true);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _provenance
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(1);
- { //-- local scope
+ return (target.getGraph() ? java.lang.Boolean.TRUE
+ : java.lang.Boolean.FALSE);
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ AlignmentSequenceAnnotation target = (AlignmentSequenceAnnotation) object;
+ // ignore null values for non optional primitives
+ if (value == null) {
+ return;
+ }
+
+ target.setGraph(((java.lang.Boolean) value).booleanValue());
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
- }
+ }
-
- //-----------/
- //- Methods -/
- //-----------/
-
- /**
- * Method getAccessMode.
- *
- * @return the access mode specified for this class.
- */
- public org.exolab.castor.mapping.AccessMode getAccessMode(
- ) {
+ public java.lang.Object newInstance(java.lang.Object parent) {
return null;
+ }
+ };
+ desc.setHandler(handler);
+ desc.setRequired(true);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _graph
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(1);
+ { // -- local scope
+ org.exolab.castor.xml.validators.BooleanValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
+ fieldValidator.setValidator(typeValidator);
}
-
- /**
- * Method getIdentity.
- *
- * @return the identity field, null if this class has no
- * identity.
- */
- public org.exolab.castor.mapping.FieldDescriptor getIdentity(
- ) {
- return super.getIdentity();
- }
-
- /**
- * Method getJavaClass.
- *
- * @return the Java class represented by this descriptor.
- */
- public java.lang.Class getJavaClass(
- ) {
- return uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation.class;
- }
-
- /**
- * Method getNameSpacePrefix.
- *
- * @return the namespace prefix to use when marshaling as XML.
- */
- public java.lang.String getNameSpacePrefix(
- ) {
- return _nsPrefix;
- }
-
- /**
- * Method getNameSpaceURI.
- *
- * @return the namespace URI used when marshaling and
- * unmarshaling as XML.
- */
- public java.lang.String getNameSpaceURI(
- ) {
- return _nsURI;
- }
-
- /**
- * Method getValidator.
- *
- * @return a specific validator for the class described by this
- * ClassDescriptor.
- */
- public org.exolab.castor.xml.TypeValidator getValidator(
- ) {
- return this;
- }
-
- /**
- * Method getXMLName.
- *
- * @return the XML Name for the Class being described.
- */
- public java.lang.String getXMLName(
- ) {
- return _xmlName;
- }
-
- /**
- * Method isElementDefinition.
- *
- * @return true if XML schema definition of this Class is that
- * of a global
- * element or element with anonymous type definition.
- */
- public boolean isElementDefinition(
- ) {
- return _elementDefinition;
+ desc.setValidator(fieldValidator);
+ // -- initialize element descriptors
+
+ // -- _provenance
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ uk.ac.vamsas.objects.core.Provenance.class, "_provenance",
+ "Provenance", org.exolab.castor.xml.NodeType.Element);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ AlignmentSequenceAnnotation target = (AlignmentSequenceAnnotation) object;
+ return target.getProvenance();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ AlignmentSequenceAnnotation target = (AlignmentSequenceAnnotation) object;
+ target.setProvenance((uk.ac.vamsas.objects.core.Provenance) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new uk.ac.vamsas.objects.core.Provenance();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
+ desc.setRequired(true);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _provenance
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(1);
+ { // -- local scope
}
+ desc.setValidator(fieldValidator);
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ * Method getAccessMode.
+ *
+ * @return the access mode specified for this class.
+ */
+ public org.exolab.castor.mapping.AccessMode getAccessMode() {
+ return null;
+ }
+
+ /**
+ * Method getIdentity.
+ *
+ * @return the identity field, null if this class has no identity.
+ */
+ public org.exolab.castor.mapping.FieldDescriptor getIdentity() {
+ return super.getIdentity();
+ }
+
+ /**
+ * Method getJavaClass.
+ *
+ * @return the Java class represented by this descriptor.
+ */
+ public java.lang.Class getJavaClass() {
+ return uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation.class;
+ }
+
+ /**
+ * Method getNameSpacePrefix.
+ *
+ * @return the namespace prefix to use when marshaling as XML.
+ */
+ public java.lang.String getNameSpacePrefix() {
+ return _nsPrefix;
+ }
+
+ /**
+ * Method getNameSpaceURI.
+ *
+ * @return the namespace URI used when marshaling and unmarshaling as XML.
+ */
+ public java.lang.String getNameSpaceURI() {
+ return _nsURI;
+ }
+
+ /**
+ * Method getValidator.
+ *
+ * @return a specific validator for the class described by this
+ * ClassDescriptor.
+ */
+ public org.exolab.castor.xml.TypeValidator getValidator() {
+ return this;
+ }
+
+ /**
+ * Method getXMLName.
+ *
+ * @return the XML Name for the Class being described.
+ */
+ public java.lang.String getXMLName() {
+ return _xmlName;
+ }
+
+ /**
+ * Method isElementDefinition.
+ *
+ * @return true if XML schema definition of this Class is that of a global
+ * element or element with anonymous type definition.
+ */
+ public boolean isElementDefinition() {
+ return _elementDefinition;
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/descriptors/AlignmentSequenceDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/AlignmentSequenceDescriptor.java
index d1b7830..5478a26 100644
--- a/src/uk/ac/vamsas/objects/core/descriptors/AlignmentSequenceDescriptor.java
+++ b/src/uk/ac/vamsas/objects/core/descriptors/AlignmentSequenceDescriptor.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core.descriptors;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import uk.ac.vamsas.objects.core.AlignmentSequence;
@@ -18,260 +32,257 @@ import uk.ac.vamsas.objects.core.AlignmentSequence;
*
* @version $Revision$ $Date$
*/
-public class AlignmentSequenceDescriptor extends uk.ac.vamsas.objects.core.descriptors.SequenceTypeDescriptor {
-
-
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
- * Field _elementDefinition.
- */
- private boolean _elementDefinition;
-
- /**
- * Field _nsPrefix.
- */
- private java.lang.String _nsPrefix;
-
- /**
- * Field _nsURI.
- */
- private java.lang.String _nsURI;
-
- /**
- * Field _xmlName.
- */
- private java.lang.String _xmlName;
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public AlignmentSequenceDescriptor() {
- super();
- setExtendsWithoutFlatten(new uk.ac.vamsas.objects.core.descriptors.SequenceTypeDescriptor());
- _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
- _xmlName = "alignmentSequence";
- _elementDefinition = true;
-
- //-- set grouping compositor
- setCompositorAsSequence();
- org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
- org.exolab.castor.mapping.FieldHandler handler = null;
- org.exolab.castor.xml.FieldValidator fieldValidator = null;
- //-- initialize attribute descriptors
-
- //-- _id
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_id", "id", org.exolab.castor.xml.NodeType.Attribute);
- super.setIdentity(desc);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- AlignmentSequence target = (AlignmentSequence) object;
- return target.getId();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- AlignmentSequence target = (AlignmentSequence) object;
- target.setId( (java.lang.String) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new java.lang.String();
- }
- };
- desc.setHandler(handler);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _id
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { //-- local scope
- org.exolab.castor.xml.validators.IdValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.IdValidator();
- fieldValidator.setValidator(typeValidator);
- }
- desc.setValidator(fieldValidator);
- //-- _refid
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Object.class, "_refid", "refid", org.exolab.castor.xml.NodeType.Attribute);
- desc.setReference(true);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- AlignmentSequence target = (AlignmentSequence) object;
- return target.getRefid();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- AlignmentSequence target = (AlignmentSequence) object;
- target.setRefid( (java.lang.Object) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new java.lang.Object();
- }
- };
- desc.setHandler(handler);
- desc.setRequired(true);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _refid
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(1);
- { //-- local scope
- org.exolab.castor.xml.validators.IdRefValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.IdRefValidator();
- fieldValidator.setValidator(typeValidator);
- }
- desc.setValidator(fieldValidator);
- //-- initialize element descriptors
-
- //-- _alignmentSequenceAnnotationList
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation.class, "_alignmentSequenceAnnotationList", "AlignmentSequenceAnnotation", org.exolab.castor.xml.NodeType.Element);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- AlignmentSequence target = (AlignmentSequence) object;
- return target.getAlignmentSequenceAnnotation();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- AlignmentSequence target = (AlignmentSequence) object;
- target.addAlignmentSequenceAnnotation( (uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException {
- try {
- AlignmentSequence target = (AlignmentSequence) object;
- target.removeAllAlignmentSequenceAnnotation();
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation();
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
- desc.setMultivalued(true);
- addFieldDescriptor(desc);
-
- //-- validation code for: _alignmentSequenceAnnotationList
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(0);
- { //-- local scope
+public class AlignmentSequenceDescriptor extends
+ uk.ac.vamsas.objects.core.descriptors.SequenceTypeDescriptor {
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * Field _elementDefinition.
+ */
+ private boolean _elementDefinition;
+
+ /**
+ * Field _nsPrefix.
+ */
+ private java.lang.String _nsPrefix;
+
+ /**
+ * Field _nsURI.
+ */
+ private java.lang.String _nsURI;
+
+ /**
+ * Field _xmlName.
+ */
+ private java.lang.String _xmlName;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public AlignmentSequenceDescriptor() {
+ super();
+ setExtendsWithoutFlatten(new uk.ac.vamsas.objects.core.descriptors.SequenceTypeDescriptor());
+ _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
+ _xmlName = "alignmentSequence";
+ _elementDefinition = true;
+
+ // -- set grouping compositor
+ setCompositorAsSequence();
+ org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
+ org.exolab.castor.mapping.FieldHandler handler = null;
+ org.exolab.castor.xml.FieldValidator fieldValidator = null;
+ // -- initialize attribute descriptors
+
+ // -- _id
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.String.class, "_id", "id",
+ org.exolab.castor.xml.NodeType.Attribute);
+ super.setIdentity(desc);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ AlignmentSequence target = (AlignmentSequence) object;
+ return target.getId();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ AlignmentSequence target = (AlignmentSequence) object;
+ target.setId((java.lang.String) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new java.lang.String();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _id
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ { // -- local scope
+ org.exolab.castor.xml.validators.IdValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.IdValidator();
+ fieldValidator.setValidator(typeValidator);
}
+ desc.setValidator(fieldValidator);
+ // -- _refid
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.Object.class, "_refid", "refid",
+ org.exolab.castor.xml.NodeType.Attribute);
+ desc.setReference(true);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ AlignmentSequence target = (AlignmentSequence) object;
+ return target.getRefid();
+ }
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ AlignmentSequence target = (AlignmentSequence) object;
+ target.setRefid((java.lang.Object) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- //-----------/
- //- Methods -/
- //-----------/
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new java.lang.Object();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setRequired(true);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
- /**
- * Method getAccessMode.
- *
- * @return the access mode specified for this class.
- */
- public org.exolab.castor.mapping.AccessMode getAccessMode(
- ) {
- return null;
+ // -- validation code for: _refid
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(1);
+ { // -- local scope
+ org.exolab.castor.xml.validators.IdRefValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.IdRefValidator();
+ fieldValidator.setValidator(typeValidator);
}
+ desc.setValidator(fieldValidator);
+ // -- initialize element descriptors
- /**
- * Method getIdentity.
- *
- * @return the identity field, null if this class has no
- * identity.
- */
- public org.exolab.castor.mapping.FieldDescriptor getIdentity(
- ) {
- return super.getIdentity();
- }
+ // -- _alignmentSequenceAnnotationList
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation.class,
+ "_alignmentSequenceAnnotationList", "AlignmentSequenceAnnotation",
+ org.exolab.castor.xml.NodeType.Element);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ AlignmentSequence target = (AlignmentSequence) object;
+ return target.getAlignmentSequenceAnnotation();
+ }
- /**
- * Method getJavaClass.
- *
- * @return the Java class represented by this descriptor.
- */
- public java.lang.Class getJavaClass(
- ) {
- return uk.ac.vamsas.objects.core.AlignmentSequence.class;
- }
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ AlignmentSequence target = (AlignmentSequence) object;
+ target
+ .addAlignmentSequenceAnnotation((uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- /**
- * Method getNameSpacePrefix.
- *
- * @return the namespace prefix to use when marshaling as XML.
- */
- public java.lang.String getNameSpacePrefix(
- ) {
- return _nsPrefix;
- }
+ public void resetValue(Object object) throws IllegalStateException,
+ IllegalArgumentException {
+ try {
+ AlignmentSequence target = (AlignmentSequence) object;
+ target.removeAllAlignmentSequenceAnnotation();
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- /**
- * Method getNameSpaceURI.
- *
- * @return the namespace URI used when marshaling and
- * unmarshaling as XML.
- */
- public java.lang.String getNameSpaceURI(
- ) {
- return _nsURI;
- }
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
+ desc.setMultivalued(true);
+ addFieldDescriptor(desc);
- /**
- * Method getValidator.
- *
- * @return a specific validator for the class described by this
- * ClassDescriptor.
- */
- public org.exolab.castor.xml.TypeValidator getValidator(
- ) {
- return this;
+ // -- validation code for: _alignmentSequenceAnnotationList
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(0);
+ { // -- local scope
}
+ desc.setValidator(fieldValidator);
+ }
- /**
- * Method getXMLName.
- *
- * @return the XML Name for the Class being described.
- */
- public java.lang.String getXMLName(
- ) {
- return _xmlName;
- }
+ // -----------/
+ // - Methods -/
+ // -----------/
- /**
- * Method isElementDefinition.
- *
- * @return true if XML schema definition of this Class is that
- * of a global
- * element or element with anonymous type definition.
- */
- public boolean isElementDefinition(
- ) {
- return _elementDefinition;
- }
+ /**
+ * Method getAccessMode.
+ *
+ * @return the access mode specified for this class.
+ */
+ public org.exolab.castor.mapping.AccessMode getAccessMode() {
+ return null;
+ }
+
+ /**
+ * Method getIdentity.
+ *
+ * @return the identity field, null if this class has no identity.
+ */
+ public org.exolab.castor.mapping.FieldDescriptor getIdentity() {
+ return super.getIdentity();
+ }
+
+ /**
+ * Method getJavaClass.
+ *
+ * @return the Java class represented by this descriptor.
+ */
+ public java.lang.Class getJavaClass() {
+ return uk.ac.vamsas.objects.core.AlignmentSequence.class;
+ }
+
+ /**
+ * Method getNameSpacePrefix.
+ *
+ * @return the namespace prefix to use when marshaling as XML.
+ */
+ public java.lang.String getNameSpacePrefix() {
+ return _nsPrefix;
+ }
+
+ /**
+ * Method getNameSpaceURI.
+ *
+ * @return the namespace URI used when marshaling and unmarshaling as XML.
+ */
+ public java.lang.String getNameSpaceURI() {
+ return _nsURI;
+ }
+
+ /**
+ * Method getValidator.
+ *
+ * @return a specific validator for the class described by this
+ * ClassDescriptor.
+ */
+ public org.exolab.castor.xml.TypeValidator getValidator() {
+ return this;
+ }
+
+ /**
+ * Method getXMLName.
+ *
+ * @return the XML Name for the Class being described.
+ */
+ public java.lang.String getXMLName() {
+ return _xmlName;
+ }
+
+ /**
+ * Method isElementDefinition.
+ *
+ * @return true if XML schema definition of this Class is that of a global
+ * element or element with anonymous type definition.
+ */
+ public boolean isElementDefinition() {
+ return _elementDefinition;
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/descriptors/AnnotationElementDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/AnnotationElementDescriptor.java
index 1e98793..159293b 100644
--- a/src/uk/ac/vamsas/objects/core/descriptors/AnnotationElementDescriptor.java
+++ b/src/uk/ac/vamsas/objects/core/descriptors/AnnotationElementDescriptor.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core.descriptors;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import uk.ac.vamsas.objects.core.AnnotationElement;
@@ -18,391 +32,403 @@ import uk.ac.vamsas.objects.core.AnnotationElement;
*
* @version $Revision$ $Date$
*/
-public class AnnotationElementDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl {
-
-
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
- * Field _elementDefinition.
- */
- private boolean _elementDefinition;
-
- /**
- * Field _nsPrefix.
- */
- private java.lang.String _nsPrefix;
-
- /**
- * Field _nsURI.
- */
- private java.lang.String _nsURI;
-
- /**
- * Field _xmlName.
- */
- private java.lang.String _xmlName;
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public AnnotationElementDescriptor() {
- super();
- _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
- _xmlName = "annotationElement";
- _elementDefinition = true;
-
- //-- set grouping compositor
- setCompositorAsSequence();
- org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
- org.exolab.castor.mapping.FieldHandler handler = null;
- org.exolab.castor.xml.FieldValidator fieldValidator = null;
- //-- initialize attribute descriptors
-
- //-- _position
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Long.TYPE, "_position", "position", org.exolab.castor.xml.NodeType.Attribute);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- AnnotationElement target = (AnnotationElement) object;
- if (!target.hasPosition()) { return null; }
- return new java.lang.Long(target.getPosition());
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- AnnotationElement target = (AnnotationElement) object;
- // ignore null values for non optional primitives
- if (value == null) { return; }
-
- target.setPosition( ((java.lang.Long) value).longValue());
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setRequired(true);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _position
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(1);
- { //-- local scope
- org.exolab.castor.xml.validators.LongValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.LongValidator();
- fieldValidator.setValidator(typeValidator);
- }
- desc.setValidator(fieldValidator);
- //-- _after
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_after", "after", org.exolab.castor.xml.NodeType.Attribute);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- AnnotationElement target = (AnnotationElement) object;
- if (!target.hasAfter()) { return null; }
- return (target.getAfter() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE);
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- AnnotationElement target = (AnnotationElement) object;
- // if null, use delete method for optional primitives
- if (value == null) {
- target.deleteAfter();
- return;
- }
- target.setAfter( ((java.lang.Boolean) value).booleanValue());
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _after
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { //-- local scope
- org.exolab.castor.xml.validators.BooleanValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
- fieldValidator.setValidator(typeValidator);
+public class AnnotationElementDescriptor extends
+ org.exolab.castor.xml.util.XMLClassDescriptorImpl {
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * Field _elementDefinition.
+ */
+ private boolean _elementDefinition;
+
+ /**
+ * Field _nsPrefix.
+ */
+ private java.lang.String _nsPrefix;
+
+ /**
+ * Field _nsURI.
+ */
+ private java.lang.String _nsURI;
+
+ /**
+ * Field _xmlName.
+ */
+ private java.lang.String _xmlName;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public AnnotationElementDescriptor() {
+ super();
+ _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
+ _xmlName = "annotationElement";
+ _elementDefinition = true;
+
+ // -- set grouping compositor
+ setCompositorAsSequence();
+ org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
+ org.exolab.castor.mapping.FieldHandler handler = null;
+ org.exolab.castor.xml.FieldValidator fieldValidator = null;
+ // -- initialize attribute descriptors
+
+ // -- _position
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.Long.TYPE, "_position", "position",
+ org.exolab.castor.xml.NodeType.Attribute);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ AnnotationElement target = (AnnotationElement) object;
+ if (!target.hasPosition()) {
+ return null;
}
- desc.setValidator(fieldValidator);
- //-- _id
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_id", "id", org.exolab.castor.xml.NodeType.Attribute);
- super.setIdentity(desc);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- AnnotationElement target = (AnnotationElement) object;
- return target.getId();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- AnnotationElement target = (AnnotationElement) object;
- target.setId( (java.lang.String) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new java.lang.String();
- }
- };
- desc.setHandler(handler);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _id
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { //-- local scope
- org.exolab.castor.xml.validators.IdValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.IdValidator();
- fieldValidator.setValidator(typeValidator);
+ return new java.lang.Long(target.getPosition());
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ AnnotationElement target = (AnnotationElement) object;
+ // ignore null values for non optional primitives
+ if (value == null) {
+ return;
+ }
+
+ target.setPosition(((java.lang.Long) value).longValue());
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
- //-- initialize element descriptors
-
- //-- _description
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_description", "description", org.exolab.castor.xml.NodeType.Element);
- desc.setImmutable(true);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- AnnotationElement target = (AnnotationElement) object;
- return target.getDescription();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- AnnotationElement target = (AnnotationElement) object;
- target.setDescription( (java.lang.String) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _description
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { //-- local scope
- org.exolab.castor.xml.validators.StringValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.StringValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setWhiteSpace("preserve");
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return null;
+ }
+ };
+ desc.setHandler(handler);
+ desc.setRequired(true);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _position
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(1);
+ { // -- local scope
+ org.exolab.castor.xml.validators.LongValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.LongValidator();
+ fieldValidator.setValidator(typeValidator);
+ }
+ desc.setValidator(fieldValidator);
+ // -- _after
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.Boolean.TYPE, "_after", "after",
+ org.exolab.castor.xml.NodeType.Attribute);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ AnnotationElement target = (AnnotationElement) object;
+ if (!target.hasAfter()) {
+ return null;
}
- desc.setValidator(fieldValidator);
- //-- _glyphList
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Glyph.class, "_glyphList", "glyph", org.exolab.castor.xml.NodeType.Element);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- AnnotationElement target = (AnnotationElement) object;
- return target.getGlyph();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- AnnotationElement target = (AnnotationElement) object;
- target.addGlyph( (uk.ac.vamsas.objects.core.Glyph) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException {
- try {
- AnnotationElement target = (AnnotationElement) object;
- target.removeAllGlyph();
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new uk.ac.vamsas.objects.core.Glyph();
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
- desc.setMultivalued(true);
- addFieldDescriptor(desc);
-
- //-- validation code for: _glyphList
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(0);
- { //-- local scope
+ return (target.getAfter() ? java.lang.Boolean.TRUE
+ : java.lang.Boolean.FALSE);
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ AnnotationElement target = (AnnotationElement) object;
+ // if null, use delete method for optional primitives
+ if (value == null) {
+ target.deleteAfter();
+ return;
+ }
+ target.setAfter(((java.lang.Boolean) value).booleanValue());
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
- //-- _valueList
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Float.TYPE, "_valueList", "value", org.exolab.castor.xml.NodeType.Element);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- AnnotationElement target = (AnnotationElement) object;
- return target.getValue();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- AnnotationElement target = (AnnotationElement) object;
- // ignore null values for non optional primitives
- if (value == null) { return; }
-
- target.addValue( ((java.lang.Float) value).floatValue());
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException {
- try {
- AnnotationElement target = (AnnotationElement) object;
- target.removeAllValue();
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
- desc.setMultivalued(true);
- addFieldDescriptor(desc);
-
- //-- validation code for: _valueList
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(0);
- { //-- local scope
- org.exolab.castor.xml.validators.FloatValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.FloatValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setMinInclusive((float) -3.4028235E38);
- typeValidator.setMaxInclusive((float) 3.4028235E38);
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return null;
+ }
+ };
+ desc.setHandler(handler);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _after
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ { // -- local scope
+ org.exolab.castor.xml.validators.BooleanValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
+ fieldValidator.setValidator(typeValidator);
+ }
+ desc.setValidator(fieldValidator);
+ // -- _id
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.String.class, "_id", "id",
+ org.exolab.castor.xml.NodeType.Attribute);
+ super.setIdentity(desc);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ AnnotationElement target = (AnnotationElement) object;
+ return target.getId();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ AnnotationElement target = (AnnotationElement) object;
+ target.setId((java.lang.String) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new java.lang.String();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _id
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ { // -- local scope
+ org.exolab.castor.xml.validators.IdValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.IdValidator();
+ fieldValidator.setValidator(typeValidator);
}
+ desc.setValidator(fieldValidator);
+ // -- initialize element descriptors
+ // -- _description
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.String.class, "_description", "description",
+ org.exolab.castor.xml.NodeType.Element);
+ desc.setImmutable(true);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ AnnotationElement target = (AnnotationElement) object;
+ return target.getDescription();
+ }
- //-----------/
- //- Methods -/
- //-----------/
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ AnnotationElement target = (AnnotationElement) object;
+ target.setDescription((java.lang.String) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- /**
- * Method getAccessMode.
- *
- * @return the access mode specified for this class.
- */
- public org.exolab.castor.mapping.AccessMode getAccessMode(
- ) {
+ public java.lang.Object newInstance(java.lang.Object parent) {
return null;
- }
+ }
+ };
+ desc.setHandler(handler);
+ desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
- /**
- * Method getIdentity.
- *
- * @return the identity field, null if this class has no
- * identity.
- */
- public org.exolab.castor.mapping.FieldDescriptor getIdentity(
- ) {
- return super.getIdentity();
+ // -- validation code for: _description
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ { // -- local scope
+ org.exolab.castor.xml.validators.StringValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.StringValidator();
+ fieldValidator.setValidator(typeValidator);
+ typeValidator.setWhiteSpace("preserve");
}
+ desc.setValidator(fieldValidator);
+ // -- _glyphList
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ uk.ac.vamsas.objects.core.Glyph.class, "_glyphList", "glyph",
+ org.exolab.castor.xml.NodeType.Element);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ AnnotationElement target = (AnnotationElement) object;
+ return target.getGlyph();
+ }
- /**
- * Method getJavaClass.
- *
- * @return the Java class represented by this descriptor.
- */
- public java.lang.Class getJavaClass(
- ) {
- return uk.ac.vamsas.objects.core.AnnotationElement.class;
- }
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ AnnotationElement target = (AnnotationElement) object;
+ target.addGlyph((uk.ac.vamsas.objects.core.Glyph) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- /**
- * Method getNameSpacePrefix.
- *
- * @return the namespace prefix to use when marshaling as XML.
- */
- public java.lang.String getNameSpacePrefix(
- ) {
- return _nsPrefix;
- }
+ public void resetValue(Object object) throws IllegalStateException,
+ IllegalArgumentException {
+ try {
+ AnnotationElement target = (AnnotationElement) object;
+ target.removeAllGlyph();
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- /**
- * Method getNameSpaceURI.
- *
- * @return the namespace URI used when marshaling and
- * unmarshaling as XML.
- */
- public java.lang.String getNameSpaceURI(
- ) {
- return _nsURI;
- }
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new uk.ac.vamsas.objects.core.Glyph();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
+ desc.setMultivalued(true);
+ addFieldDescriptor(desc);
- /**
- * Method getValidator.
- *
- * @return a specific validator for the class described by this
- * ClassDescriptor.
- */
- public org.exolab.castor.xml.TypeValidator getValidator(
- ) {
- return this;
+ // -- validation code for: _glyphList
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(0);
+ { // -- local scope
}
+ desc.setValidator(fieldValidator);
+ // -- _valueList
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.Float.TYPE, "_valueList", "value",
+ org.exolab.castor.xml.NodeType.Element);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ AnnotationElement target = (AnnotationElement) object;
+ return target.getValue();
+ }
- /**
- * Method getXMLName.
- *
- * @return the XML Name for the Class being described.
- */
- public java.lang.String getXMLName(
- ) {
- return _xmlName;
- }
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ AnnotationElement target = (AnnotationElement) object;
+ // ignore null values for non optional primitives
+ if (value == null) {
+ return;
+ }
+
+ target.addValue(((java.lang.Float) value).floatValue());
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- /**
- * Method isElementDefinition.
- *
- * @return true if XML schema definition of this Class is that
- * of a global
- * element or element with anonymous type definition.
- */
- public boolean isElementDefinition(
- ) {
- return _elementDefinition;
+ public void resetValue(Object object) throws IllegalStateException,
+ IllegalArgumentException {
+ try {
+ AnnotationElement target = (AnnotationElement) object;
+ target.removeAllValue();
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return null;
+ }
+ };
+ desc.setHandler(handler);
+ desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
+ desc.setMultivalued(true);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _valueList
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(0);
+ { // -- local scope
+ org.exolab.castor.xml.validators.FloatValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.FloatValidator();
+ fieldValidator.setValidator(typeValidator);
+ typeValidator.setMinInclusive((float) -3.4028235E38);
+ typeValidator.setMaxInclusive((float) 3.4028235E38);
}
+ desc.setValidator(fieldValidator);
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ * Method getAccessMode.
+ *
+ * @return the access mode specified for this class.
+ */
+ public org.exolab.castor.mapping.AccessMode getAccessMode() {
+ return null;
+ }
+
+ /**
+ * Method getIdentity.
+ *
+ * @return the identity field, null if this class has no identity.
+ */
+ public org.exolab.castor.mapping.FieldDescriptor getIdentity() {
+ return super.getIdentity();
+ }
+
+ /**
+ * Method getJavaClass.
+ *
+ * @return the Java class represented by this descriptor.
+ */
+ public java.lang.Class getJavaClass() {
+ return uk.ac.vamsas.objects.core.AnnotationElement.class;
+ }
+
+ /**
+ * Method getNameSpacePrefix.
+ *
+ * @return the namespace prefix to use when marshaling as XML.
+ */
+ public java.lang.String getNameSpacePrefix() {
+ return _nsPrefix;
+ }
+
+ /**
+ * Method getNameSpaceURI.
+ *
+ * @return the namespace URI used when marshaling and unmarshaling as XML.
+ */
+ public java.lang.String getNameSpaceURI() {
+ return _nsURI;
+ }
+
+ /**
+ * Method getValidator.
+ *
+ * @return a specific validator for the class described by this
+ * ClassDescriptor.
+ */
+ public org.exolab.castor.xml.TypeValidator getValidator() {
+ return this;
+ }
+
+ /**
+ * Method getXMLName.
+ *
+ * @return the XML Name for the Class being described.
+ */
+ public java.lang.String getXMLName() {
+ return _xmlName;
+ }
+
+ /**
+ * Method isElementDefinition.
+ *
+ * @return true if XML schema definition of this Class is that of a global
+ * element or element with anonymous type definition.
+ */
+ public boolean isElementDefinition() {
+ return _elementDefinition;
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/descriptors/AppDataDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/AppDataDescriptor.java
index dab611a..21ce243 100644
--- a/src/uk/ac/vamsas/objects/core/descriptors/AppDataDescriptor.java
+++ b/src/uk/ac/vamsas/objects/core/descriptors/AppDataDescriptor.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core.descriptors;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import uk.ac.vamsas.objects.core.AppData;
@@ -18,218 +32,208 @@ import uk.ac.vamsas.objects.core.AppData;
*
* @version $Revision$ $Date$
*/
-public class AppDataDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl {
-
-
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
- * Field _elementDefinition.
- */
- private boolean _elementDefinition;
-
- /**
- * Field _nsPrefix.
- */
- private java.lang.String _nsPrefix;
-
- /**
- * Field _nsURI.
- */
- private java.lang.String _nsURI;
-
- /**
- * Field _xmlName.
- */
- private java.lang.String _xmlName;
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public AppDataDescriptor() {
- super();
- _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
- _xmlName = "appData";
- _elementDefinition = false;
-
- //-- set grouping compositor
- setCompositorAsChoice();
- org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
- org.exolab.castor.mapping.FieldHandler handler = null;
- org.exolab.castor.xml.FieldValidator fieldValidator = null;
- //-- initialize attribute descriptors
-
- //-- initialize element descriptors
-
- //-- _data
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(byte[].class, "_data", "data", org.exolab.castor.xml.NodeType.Element);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- AppData target = (AppData) object;
- return target.getData();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- AppData target = (AppData) object;
- target.setData( (byte[]) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
- desc.setRequired(true);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _data
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(1);
- { //-- local scope
- }
- desc.setValidator(fieldValidator);
- //-- _dataReference
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_dataReference", "dataReference", org.exolab.castor.xml.NodeType.Element);
- desc.setImmutable(true);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- AppData target = (AppData) object;
- return target.getDataReference();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- AppData target = (AppData) object;
- target.setDataReference( (java.lang.String) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
- desc.setRequired(true);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _dataReference
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(1);
- { //-- local scope
- org.exolab.castor.xml.validators.StringValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.StringValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setWhiteSpace("preserve");
+public class AppDataDescriptor extends
+ org.exolab.castor.xml.util.XMLClassDescriptorImpl {
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * Field _elementDefinition.
+ */
+ private boolean _elementDefinition;
+
+ /**
+ * Field _nsPrefix.
+ */
+ private java.lang.String _nsPrefix;
+
+ /**
+ * Field _nsURI.
+ */
+ private java.lang.String _nsURI;
+
+ /**
+ * Field _xmlName.
+ */
+ private java.lang.String _xmlName;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public AppDataDescriptor() {
+ super();
+ _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
+ _xmlName = "appData";
+ _elementDefinition = false;
+
+ // -- set grouping compositor
+ setCompositorAsChoice();
+ org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
+ org.exolab.castor.mapping.FieldHandler handler = null;
+ org.exolab.castor.xml.FieldValidator fieldValidator = null;
+ // -- initialize attribute descriptors
+
+ // -- initialize element descriptors
+
+ // -- _data
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(byte[].class,
+ "_data", "data", org.exolab.castor.xml.NodeType.Element);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ AppData target = (AppData) object;
+ return target.getData();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ AppData target = (AppData) object;
+ target.setData((byte[]) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
- }
-
-
- //-----------/
- //- Methods -/
- //-----------/
+ }
- /**
- * Method getAccessMode.
- *
- * @return the access mode specified for this class.
- */
- public org.exolab.castor.mapping.AccessMode getAccessMode(
- ) {
+ public java.lang.Object newInstance(java.lang.Object parent) {
return null;
+ }
+ };
+ desc.setHandler(handler);
+ desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
+ desc.setRequired(true);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _data
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(1);
+ { // -- local scope
}
+ desc.setValidator(fieldValidator);
+ // -- _dataReference
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.String.class, "_dataReference", "dataReference",
+ org.exolab.castor.xml.NodeType.Element);
+ desc.setImmutable(true);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ AppData target = (AppData) object;
+ return target.getDataReference();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ AppData target = (AppData) object;
+ target.setDataReference((java.lang.String) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- /**
- * Method getIdentity.
- *
- * @return the identity field, null if this class has no
- * identity.
- */
- public org.exolab.castor.mapping.FieldDescriptor getIdentity(
- ) {
- return super.getIdentity();
- }
-
- /**
- * Method getJavaClass.
- *
- * @return the Java class represented by this descriptor.
- */
- public java.lang.Class getJavaClass(
- ) {
- return uk.ac.vamsas.objects.core.AppData.class;
- }
-
- /**
- * Method getNameSpacePrefix.
- *
- * @return the namespace prefix to use when marshaling as XML.
- */
- public java.lang.String getNameSpacePrefix(
- ) {
- return _nsPrefix;
- }
-
- /**
- * Method getNameSpaceURI.
- *
- * @return the namespace URI used when marshaling and
- * unmarshaling as XML.
- */
- public java.lang.String getNameSpaceURI(
- ) {
- return _nsURI;
- }
-
- /**
- * Method getValidator.
- *
- * @return a specific validator for the class described by this
- * ClassDescriptor.
- */
- public org.exolab.castor.xml.TypeValidator getValidator(
- ) {
- return this;
- }
-
- /**
- * Method getXMLName.
- *
- * @return the XML Name for the Class being described.
- */
- public java.lang.String getXMLName(
- ) {
- return _xmlName;
- }
-
- /**
- * Method isElementDefinition.
- *
- * @return true if XML schema definition of this Class is that
- * of a global
- * element or element with anonymous type definition.
- */
- public boolean isElementDefinition(
- ) {
- return _elementDefinition;
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return null;
+ }
+ };
+ desc.setHandler(handler);
+ desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
+ desc.setRequired(true);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _dataReference
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(1);
+ { // -- local scope
+ org.exolab.castor.xml.validators.StringValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.StringValidator();
+ fieldValidator.setValidator(typeValidator);
+ typeValidator.setWhiteSpace("preserve");
}
+ desc.setValidator(fieldValidator);
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ * Method getAccessMode.
+ *
+ * @return the access mode specified for this class.
+ */
+ public org.exolab.castor.mapping.AccessMode getAccessMode() {
+ return null;
+ }
+
+ /**
+ * Method getIdentity.
+ *
+ * @return the identity field, null if this class has no identity.
+ */
+ public org.exolab.castor.mapping.FieldDescriptor getIdentity() {
+ return super.getIdentity();
+ }
+
+ /**
+ * Method getJavaClass.
+ *
+ * @return the Java class represented by this descriptor.
+ */
+ public java.lang.Class getJavaClass() {
+ return uk.ac.vamsas.objects.core.AppData.class;
+ }
+
+ /**
+ * Method getNameSpacePrefix.
+ *
+ * @return the namespace prefix to use when marshaling as XML.
+ */
+ public java.lang.String getNameSpacePrefix() {
+ return _nsPrefix;
+ }
+
+ /**
+ * Method getNameSpaceURI.
+ *
+ * @return the namespace URI used when marshaling and unmarshaling as XML.
+ */
+ public java.lang.String getNameSpaceURI() {
+ return _nsURI;
+ }
+
+ /**
+ * Method getValidator.
+ *
+ * @return a specific validator for the class described by this
+ * ClassDescriptor.
+ */
+ public org.exolab.castor.xml.TypeValidator getValidator() {
+ return this;
+ }
+
+ /**
+ * Method getXMLName.
+ *
+ * @return the XML Name for the Class being described.
+ */
+ public java.lang.String getXMLName() {
+ return _xmlName;
+ }
+
+ /**
+ * Method isElementDefinition.
+ *
+ * @return true if XML schema definition of this Class is that of a global
+ * element or element with anonymous type definition.
+ */
+ public boolean isElementDefinition() {
+ return _elementDefinition;
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/descriptors/ApplicationDataDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/ApplicationDataDescriptor.java
index 79c6364..80688cd 100644
--- a/src/uk/ac/vamsas/objects/core/descriptors/ApplicationDataDescriptor.java
+++ b/src/uk/ac/vamsas/objects/core/descriptors/ApplicationDataDescriptor.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core.descriptors;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import uk.ac.vamsas.objects.core.ApplicationData;
@@ -18,339 +32,340 @@ import uk.ac.vamsas.objects.core.ApplicationData;
*
* @version $Revision$ $Date$
*/
-public class ApplicationDataDescriptor extends uk.ac.vamsas.objects.core.descriptors.AppDataDescriptor {
-
-
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
- * Field _elementDefinition.
- */
- private boolean _elementDefinition;
-
- /**
- * Field _nsPrefix.
- */
- private java.lang.String _nsPrefix;
-
- /**
- * Field _nsURI.
- */
- private java.lang.String _nsURI;
-
- /**
- * Field _xmlName.
- */
- private java.lang.String _xmlName;
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public ApplicationDataDescriptor() {
- super();
- setExtendsWithoutFlatten(new uk.ac.vamsas.objects.core.descriptors.AppDataDescriptor());
- _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
- _xmlName = "ApplicationData";
- _elementDefinition = true;
-
- //-- set grouping compositor
- setCompositorAsSequence();
- org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
- org.exolab.castor.mapping.FieldHandler handler = null;
- org.exolab.castor.xml.FieldValidator fieldValidator = null;
- //-- initialize attribute descriptors
-
- //-- _version
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_version", "version", org.exolab.castor.xml.NodeType.Attribute);
- desc.setImmutable(true);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- ApplicationData target = (ApplicationData) object;
- return target.getVersion();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- ApplicationData target = (ApplicationData) object;
- target.setVersion( (java.lang.String) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setRequired(true);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _version
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(1);
- { //-- local scope
- org.exolab.castor.xml.validators.StringValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.StringValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setWhiteSpace("preserve");
- }
- desc.setValidator(fieldValidator);
- //-- _name
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_name", "name", org.exolab.castor.xml.NodeType.Attribute);
- desc.setImmutable(true);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- ApplicationData target = (ApplicationData) object;
- return target.getName();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- ApplicationData target = (ApplicationData) object;
- target.setName( (java.lang.String) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setRequired(true);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _name
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(1);
- { //-- local scope
- org.exolab.castor.xml.validators.StringValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.StringValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setWhiteSpace("preserve");
+public class ApplicationDataDescriptor extends
+ uk.ac.vamsas.objects.core.descriptors.AppDataDescriptor {
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * Field _elementDefinition.
+ */
+ private boolean _elementDefinition;
+
+ /**
+ * Field _nsPrefix.
+ */
+ private java.lang.String _nsPrefix;
+
+ /**
+ * Field _nsURI.
+ */
+ private java.lang.String _nsURI;
+
+ /**
+ * Field _xmlName.
+ */
+ private java.lang.String _xmlName;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public ApplicationDataDescriptor() {
+ super();
+ setExtendsWithoutFlatten(new uk.ac.vamsas.objects.core.descriptors.AppDataDescriptor());
+ _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
+ _xmlName = "ApplicationData";
+ _elementDefinition = true;
+
+ // -- set grouping compositor
+ setCompositorAsSequence();
+ org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
+ org.exolab.castor.mapping.FieldHandler handler = null;
+ org.exolab.castor.xml.FieldValidator fieldValidator = null;
+ // -- initialize attribute descriptors
+
+ // -- _version
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.String.class, "_version", "version",
+ org.exolab.castor.xml.NodeType.Attribute);
+ desc.setImmutable(true);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ ApplicationData target = (ApplicationData) object;
+ return target.getVersion();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ ApplicationData target = (ApplicationData) object;
+ target.setVersion((java.lang.String) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
- //-- initialize element descriptors
-
- //-- _userList
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.User.class, "_userList", "User", org.exolab.castor.xml.NodeType.Element);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- ApplicationData target = (ApplicationData) object;
- return target.getUser();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- ApplicationData target = (ApplicationData) object;
- target.addUser( (uk.ac.vamsas.objects.core.User) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException {
- try {
- ApplicationData target = (ApplicationData) object;
- target.removeAllUser();
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new uk.ac.vamsas.objects.core.User();
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
- desc.setMultivalued(true);
- addFieldDescriptor(desc);
-
- //-- validation code for: _userList
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(0);
- { //-- local scope
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return null;
+ }
+ };
+ desc.setHandler(handler);
+ desc.setRequired(true);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _version
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(1);
+ { // -- local scope
+ org.exolab.castor.xml.validators.StringValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.StringValidator();
+ fieldValidator.setValidator(typeValidator);
+ typeValidator.setWhiteSpace("preserve");
+ }
+ desc.setValidator(fieldValidator);
+ // -- _name
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.String.class, "_name", "name",
+ org.exolab.castor.xml.NodeType.Attribute);
+ desc.setImmutable(true);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ ApplicationData target = (ApplicationData) object;
+ return target.getName();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ ApplicationData target = (ApplicationData) object;
+ target.setName((java.lang.String) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
- //-- _common
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Common.class, "_common", "Common", org.exolab.castor.xml.NodeType.Element);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- ApplicationData target = (ApplicationData) object;
- return target.getCommon();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- ApplicationData target = (ApplicationData) object;
- target.setCommon( (uk.ac.vamsas.objects.core.Common) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new uk.ac.vamsas.objects.core.Common();
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _common
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { //-- local scope
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return null;
+ }
+ };
+ desc.setHandler(handler);
+ desc.setRequired(true);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _name
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(1);
+ { // -- local scope
+ org.exolab.castor.xml.validators.StringValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.StringValidator();
+ fieldValidator.setValidator(typeValidator);
+ typeValidator.setWhiteSpace("preserve");
+ }
+ desc.setValidator(fieldValidator);
+ // -- initialize element descriptors
+
+ // -- _userList
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ uk.ac.vamsas.objects.core.User.class, "_userList", "User",
+ org.exolab.castor.xml.NodeType.Element);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ ApplicationData target = (ApplicationData) object;
+ return target.getUser();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ ApplicationData target = (ApplicationData) object;
+ target.addUser((uk.ac.vamsas.objects.core.User) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
- //-- _instanceList
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Instance.class, "_instanceList", "Instance", org.exolab.castor.xml.NodeType.Element);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- ApplicationData target = (ApplicationData) object;
- return target.getInstance();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- ApplicationData target = (ApplicationData) object;
- target.addInstance( (uk.ac.vamsas.objects.core.Instance) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException {
- try {
- ApplicationData target = (ApplicationData) object;
- target.removeAllInstance();
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new uk.ac.vamsas.objects.core.Instance();
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
- desc.setMultivalued(true);
- addFieldDescriptor(desc);
-
- //-- validation code for: _instanceList
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(0);
- { //-- local scope
+ }
+
+ public void resetValue(Object object) throws IllegalStateException,
+ IllegalArgumentException {
+ try {
+ ApplicationData target = (ApplicationData) object;
+ target.removeAllUser();
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new uk.ac.vamsas.objects.core.User();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
+ desc.setMultivalued(true);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _userList
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(0);
+ { // -- local scope
}
+ desc.setValidator(fieldValidator);
+ // -- _common
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ uk.ac.vamsas.objects.core.Common.class, "_common", "Common",
+ org.exolab.castor.xml.NodeType.Element);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ ApplicationData target = (ApplicationData) object;
+ return target.getCommon();
+ }
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ ApplicationData target = (ApplicationData) object;
+ target.setCommon((uk.ac.vamsas.objects.core.Common) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- //-----------/
- //- Methods -/
- //-----------/
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new uk.ac.vamsas.objects.core.Common();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
- /**
- * Method getAccessMode.
- *
- * @return the access mode specified for this class.
- */
- public org.exolab.castor.mapping.AccessMode getAccessMode(
- ) {
- return null;
+ // -- validation code for: _common
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ { // -- local scope
}
+ desc.setValidator(fieldValidator);
+ // -- _instanceList
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ uk.ac.vamsas.objects.core.Instance.class, "_instanceList", "Instance",
+ org.exolab.castor.xml.NodeType.Element);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ ApplicationData target = (ApplicationData) object;
+ return target.getInstance();
+ }
- /**
- * Method getIdentity.
- *
- * @return the identity field, null if this class has no
- * identity.
- */
- public org.exolab.castor.mapping.FieldDescriptor getIdentity(
- ) {
- return super.getIdentity();
- }
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ ApplicationData target = (ApplicationData) object;
+ target.addInstance((uk.ac.vamsas.objects.core.Instance) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- /**
- * Method getJavaClass.
- *
- * @return the Java class represented by this descriptor.
- */
- public java.lang.Class getJavaClass(
- ) {
- return uk.ac.vamsas.objects.core.ApplicationData.class;
- }
+ public void resetValue(Object object) throws IllegalStateException,
+ IllegalArgumentException {
+ try {
+ ApplicationData target = (ApplicationData) object;
+ target.removeAllInstance();
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- /**
- * Method getNameSpacePrefix.
- *
- * @return the namespace prefix to use when marshaling as XML.
- */
- public java.lang.String getNameSpacePrefix(
- ) {
- return _nsPrefix;
- }
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new uk.ac.vamsas.objects.core.Instance();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
+ desc.setMultivalued(true);
+ addFieldDescriptor(desc);
- /**
- * Method getNameSpaceURI.
- *
- * @return the namespace URI used when marshaling and
- * unmarshaling as XML.
- */
- public java.lang.String getNameSpaceURI(
- ) {
- return _nsURI;
+ // -- validation code for: _instanceList
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(0);
+ { // -- local scope
}
+ desc.setValidator(fieldValidator);
+ }
- /**
- * Method getValidator.
- *
- * @return a specific validator for the class described by this
- * ClassDescriptor.
- */
- public org.exolab.castor.xml.TypeValidator getValidator(
- ) {
- return this;
- }
+ // -----------/
+ // - Methods -/
+ // -----------/
- /**
- * Method getXMLName.
- *
- * @return the XML Name for the Class being described.
- */
- public java.lang.String getXMLName(
- ) {
- return _xmlName;
- }
+ /**
+ * Method getAccessMode.
+ *
+ * @return the access mode specified for this class.
+ */
+ public org.exolab.castor.mapping.AccessMode getAccessMode() {
+ return null;
+ }
- /**
- * Method isElementDefinition.
- *
- * @return true if XML schema definition of this Class is that
- * of a global
- * element or element with anonymous type definition.
- */
- public boolean isElementDefinition(
- ) {
- return _elementDefinition;
- }
+ /**
+ * Method getIdentity.
+ *
+ * @return the identity field, null if this class has no identity.
+ */
+ public org.exolab.castor.mapping.FieldDescriptor getIdentity() {
+ return super.getIdentity();
+ }
+
+ /**
+ * Method getJavaClass.
+ *
+ * @return the Java class represented by this descriptor.
+ */
+ public java.lang.Class getJavaClass() {
+ return uk.ac.vamsas.objects.core.ApplicationData.class;
+ }
+
+ /**
+ * Method getNameSpacePrefix.
+ *
+ * @return the namespace prefix to use when marshaling as XML.
+ */
+ public java.lang.String getNameSpacePrefix() {
+ return _nsPrefix;
+ }
+
+ /**
+ * Method getNameSpaceURI.
+ *
+ * @return the namespace URI used when marshaling and unmarshaling as XML.
+ */
+ public java.lang.String getNameSpaceURI() {
+ return _nsURI;
+ }
+
+ /**
+ * Method getValidator.
+ *
+ * @return a specific validator for the class described by this
+ * ClassDescriptor.
+ */
+ public org.exolab.castor.xml.TypeValidator getValidator() {
+ return this;
+ }
+
+ /**
+ * Method getXMLName.
+ *
+ * @return the XML Name for the Class being described.
+ */
+ public java.lang.String getXMLName() {
+ return _xmlName;
+ }
+
+ /**
+ * Method isElementDefinition.
+ *
+ * @return true if XML schema definition of this Class is that of a global
+ * element or element with anonymous type definition.
+ */
+ public boolean isElementDefinition() {
+ return _elementDefinition;
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/descriptors/AttachmentDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/AttachmentDescriptor.java
index d6b5823..be5adb4 100644
--- a/src/uk/ac/vamsas/objects/core/descriptors/AttachmentDescriptor.java
+++ b/src/uk/ac/vamsas/objects/core/descriptors/AttachmentDescriptor.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core.descriptors;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import uk.ac.vamsas.objects.core.Attachment;
@@ -18,295 +32,293 @@ import uk.ac.vamsas.objects.core.Attachment;
*
* @version $Revision$ $Date$
*/
-public class AttachmentDescriptor extends uk.ac.vamsas.objects.core.descriptors.AppDataDescriptor {
-
-
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
- * Field _elementDefinition.
- */
- private boolean _elementDefinition;
-
- /**
- * Field _nsPrefix.
- */
- private java.lang.String _nsPrefix;
-
- /**
- * Field _nsURI.
- */
- private java.lang.String _nsURI;
-
- /**
- * Field _xmlName.
- */
- private java.lang.String _xmlName;
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public AttachmentDescriptor() {
- super();
- setExtendsWithoutFlatten(new uk.ac.vamsas.objects.core.descriptors.AppDataDescriptor());
- _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
- _xmlName = "Attachment";
- _elementDefinition = true;
- org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
- org.exolab.castor.mapping.FieldHandler handler = null;
- org.exolab.castor.xml.FieldValidator fieldValidator = null;
- //-- initialize attribute descriptors
-
- //-- _compressed
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_compressed", "compressed", org.exolab.castor.xml.NodeType.Attribute);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- Attachment target = (Attachment) object;
- if (!target.hasCompressed()) { return null; }
- return (target.getCompressed() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE);
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- Attachment target = (Attachment) object;
- // if null, use delete method for optional primitives
- if (value == null) {
- target.deleteCompressed();
- return;
- }
- target.setCompressed( ((java.lang.Boolean) value).booleanValue());
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _compressed
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { //-- local scope
- org.exolab.castor.xml.validators.BooleanValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
- fieldValidator.setValidator(typeValidator);
- }
- desc.setValidator(fieldValidator);
- //-- _type
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_type", "type", org.exolab.castor.xml.NodeType.Attribute);
- desc.setImmutable(true);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- Attachment target = (Attachment) object;
- return target.getType();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- Attachment target = (Attachment) object;
- target.setType( (java.lang.String) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setRequired(true);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _type
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(1);
- { //-- local scope
- org.exolab.castor.xml.validators.StringValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.StringValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setWhiteSpace("preserve");
- }
- desc.setValidator(fieldValidator);
- //-- _objectref
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Object.class, "_objectref", "objectref", org.exolab.castor.xml.NodeType.Attribute);
- desc.setReference(true);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- Attachment target = (Attachment) object;
- return target.getObjectref();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- Attachment target = (Attachment) object;
- target.setObjectref( (java.lang.Object) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new java.lang.Object();
- }
- };
- desc.setHandler(handler);
- desc.setRequired(true);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _objectref
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(1);
- { //-- local scope
- org.exolab.castor.xml.validators.IdRefValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.IdRefValidator();
- fieldValidator.setValidator(typeValidator);
+public class AttachmentDescriptor extends
+ uk.ac.vamsas.objects.core.descriptors.AppDataDescriptor {
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * Field _elementDefinition.
+ */
+ private boolean _elementDefinition;
+
+ /**
+ * Field _nsPrefix.
+ */
+ private java.lang.String _nsPrefix;
+
+ /**
+ * Field _nsURI.
+ */
+ private java.lang.String _nsURI;
+
+ /**
+ * Field _xmlName.
+ */
+ private java.lang.String _xmlName;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public AttachmentDescriptor() {
+ super();
+ setExtendsWithoutFlatten(new uk.ac.vamsas.objects.core.descriptors.AppDataDescriptor());
+ _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
+ _xmlName = "Attachment";
+ _elementDefinition = true;
+ org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
+ org.exolab.castor.mapping.FieldHandler handler = null;
+ org.exolab.castor.xml.FieldValidator fieldValidator = null;
+ // -- initialize attribute descriptors
+
+ // -- _compressed
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.Boolean.TYPE, "_compressed", "compressed",
+ org.exolab.castor.xml.NodeType.Attribute);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ Attachment target = (Attachment) object;
+ if (!target.hasCompressed()) {
+ return null;
}
- desc.setValidator(fieldValidator);
- //-- _id
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_id", "id", org.exolab.castor.xml.NodeType.Attribute);
- super.setIdentity(desc);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- Attachment target = (Attachment) object;
- return target.getId();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- Attachment target = (Attachment) object;
- target.setId( (java.lang.String) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new java.lang.String();
- }
- };
- desc.setHandler(handler);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _id
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { //-- local scope
- org.exolab.castor.xml.validators.IdValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.IdValidator();
- fieldValidator.setValidator(typeValidator);
+ return (target.getCompressed() ? java.lang.Boolean.TRUE
+ : java.lang.Boolean.FALSE);
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ Attachment target = (Attachment) object;
+ // if null, use delete method for optional primitives
+ if (value == null) {
+ target.deleteCompressed();
+ return;
+ }
+ target.setCompressed(((java.lang.Boolean) value).booleanValue());
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
- //-- initialize element descriptors
-
- }
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return null;
+ }
+ };
+ desc.setHandler(handler);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+ // -- validation code for: _compressed
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ { // -- local scope
+ org.exolab.castor.xml.validators.BooleanValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
+ fieldValidator.setValidator(typeValidator);
+ }
+ desc.setValidator(fieldValidator);
+ // -- _type
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.String.class, "_type", "type",
+ org.exolab.castor.xml.NodeType.Attribute);
+ desc.setImmutable(true);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ Attachment target = (Attachment) object;
+ return target.getType();
+ }
- //-----------/
- //- Methods -/
- //-----------/
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ Attachment target = (Attachment) object;
+ target.setType((java.lang.String) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- /**
- * Method getAccessMode.
- *
- * @return the access mode specified for this class.
- */
- public org.exolab.castor.mapping.AccessMode getAccessMode(
- ) {
+ public java.lang.Object newInstance(java.lang.Object parent) {
return null;
- }
+ }
+ };
+ desc.setHandler(handler);
+ desc.setRequired(true);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
- /**
- * Method getIdentity.
- *
- * @return the identity field, null if this class has no
- * identity.
- */
- public org.exolab.castor.mapping.FieldDescriptor getIdentity(
- ) {
- return super.getIdentity();
+ // -- validation code for: _type
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(1);
+ { // -- local scope
+ org.exolab.castor.xml.validators.StringValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.StringValidator();
+ fieldValidator.setValidator(typeValidator);
+ typeValidator.setWhiteSpace("preserve");
}
+ desc.setValidator(fieldValidator);
+ // -- _objectref
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.Object.class, "_objectref", "objectref",
+ org.exolab.castor.xml.NodeType.Attribute);
+ desc.setReference(true);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ Attachment target = (Attachment) object;
+ return target.getObjectref();
+ }
- /**
- * Method getJavaClass.
- *
- * @return the Java class represented by this descriptor.
- */
- public java.lang.Class getJavaClass(
- ) {
- return uk.ac.vamsas.objects.core.Attachment.class;
- }
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ Attachment target = (Attachment) object;
+ target.setObjectref((java.lang.Object) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- /**
- * Method getNameSpacePrefix.
- *
- * @return the namespace prefix to use when marshaling as XML.
- */
- public java.lang.String getNameSpacePrefix(
- ) {
- return _nsPrefix;
- }
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new java.lang.Object();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setRequired(true);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
- /**
- * Method getNameSpaceURI.
- *
- * @return the namespace URI used when marshaling and
- * unmarshaling as XML.
- */
- public java.lang.String getNameSpaceURI(
- ) {
- return _nsURI;
+ // -- validation code for: _objectref
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(1);
+ { // -- local scope
+ org.exolab.castor.xml.validators.IdRefValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.IdRefValidator();
+ fieldValidator.setValidator(typeValidator);
}
+ desc.setValidator(fieldValidator);
+ // -- _id
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.String.class, "_id", "id",
+ org.exolab.castor.xml.NodeType.Attribute);
+ super.setIdentity(desc);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ Attachment target = (Attachment) object;
+ return target.getId();
+ }
- /**
- * Method getValidator.
- *
- * @return a specific validator for the class described by this
- * ClassDescriptor.
- */
- public org.exolab.castor.xml.TypeValidator getValidator(
- ) {
- return this;
- }
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ Attachment target = (Attachment) object;
+ target.setId((java.lang.String) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- /**
- * Method getXMLName.
- *
- * @return the XML Name for the Class being described.
- */
- public java.lang.String getXMLName(
- ) {
- return _xmlName;
- }
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new java.lang.String();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
- /**
- * Method isElementDefinition.
- *
- * @return true if XML schema definition of this Class is that
- * of a global
- * element or element with anonymous type definition.
- */
- public boolean isElementDefinition(
- ) {
- return _elementDefinition;
+ // -- validation code for: _id
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ { // -- local scope
+ org.exolab.castor.xml.validators.IdValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.IdValidator();
+ fieldValidator.setValidator(typeValidator);
}
+ desc.setValidator(fieldValidator);
+ // -- initialize element descriptors
+
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ * Method getAccessMode.
+ *
+ * @return the access mode specified for this class.
+ */
+ public org.exolab.castor.mapping.AccessMode getAccessMode() {
+ return null;
+ }
+
+ /**
+ * Method getIdentity.
+ *
+ * @return the identity field, null if this class has no identity.
+ */
+ public org.exolab.castor.mapping.FieldDescriptor getIdentity() {
+ return super.getIdentity();
+ }
+
+ /**
+ * Method getJavaClass.
+ *
+ * @return the Java class represented by this descriptor.
+ */
+ public java.lang.Class getJavaClass() {
+ return uk.ac.vamsas.objects.core.Attachment.class;
+ }
+
+ /**
+ * Method getNameSpacePrefix.
+ *
+ * @return the namespace prefix to use when marshaling as XML.
+ */
+ public java.lang.String getNameSpacePrefix() {
+ return _nsPrefix;
+ }
+
+ /**
+ * Method getNameSpaceURI.
+ *
+ * @return the namespace URI used when marshaling and unmarshaling as XML.
+ */
+ public java.lang.String getNameSpaceURI() {
+ return _nsURI;
+ }
+
+ /**
+ * Method getValidator.
+ *
+ * @return a specific validator for the class described by this
+ * ClassDescriptor.
+ */
+ public org.exolab.castor.xml.TypeValidator getValidator() {
+ return this;
+ }
+
+ /**
+ * Method getXMLName.
+ *
+ * @return the XML Name for the Class being described.
+ */
+ public java.lang.String getXMLName() {
+ return _xmlName;
+ }
+
+ /**
+ * Method isElementDefinition.
+ *
+ * @return true if XML schema definition of this Class is that of a global
+ * element or element with anonymous type definition.
+ */
+ public boolean isElementDefinition() {
+ return _elementDefinition;
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/descriptors/CommonDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/CommonDescriptor.java
index d4ec584..80c4608 100644
--- a/src/uk/ac/vamsas/objects/core/descriptors/CommonDescriptor.java
+++ b/src/uk/ac/vamsas/objects/core/descriptors/CommonDescriptor.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core.descriptors;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import uk.ac.vamsas.objects.core.Common;
@@ -18,134 +32,121 @@ import uk.ac.vamsas.objects.core.Common;
*
* @version $Revision$ $Date$
*/
-public class CommonDescriptor extends uk.ac.vamsas.objects.core.descriptors.AppDataDescriptor {
-
-
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
- * Field _elementDefinition.
- */
- private boolean _elementDefinition;
-
- /**
- * Field _nsPrefix.
- */
- private java.lang.String _nsPrefix;
-
- /**
- * Field _nsURI.
- */
- private java.lang.String _nsURI;
-
- /**
- * Field _xmlName.
- */
- private java.lang.String _xmlName;
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public CommonDescriptor() {
- super();
- setExtendsWithoutFlatten(new uk.ac.vamsas.objects.core.descriptors.AppDataDescriptor());
- _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
- _xmlName = "Common";
- _elementDefinition = true;
- }
-
-
- //-----------/
- //- Methods -/
- //-----------/
-
- /**
- * Method getAccessMode.
- *
- * @return the access mode specified for this class.
- */
- public org.exolab.castor.mapping.AccessMode getAccessMode(
- ) {
- return null;
- }
-
- /**
- * Method getIdentity.
- *
- * @return the identity field, null if this class has no
- * identity.
- */
- public org.exolab.castor.mapping.FieldDescriptor getIdentity(
- ) {
- return super.getIdentity();
- }
-
- /**
- * Method getJavaClass.
- *
- * @return the Java class represented by this descriptor.
- */
- public java.lang.Class getJavaClass(
- ) {
- return uk.ac.vamsas.objects.core.Common.class;
- }
-
- /**
- * Method getNameSpacePrefix.
- *
- * @return the namespace prefix to use when marshaling as XML.
- */
- public java.lang.String getNameSpacePrefix(
- ) {
- return _nsPrefix;
- }
-
- /**
- * Method getNameSpaceURI.
- *
- * @return the namespace URI used when marshaling and
- * unmarshaling as XML.
- */
- public java.lang.String getNameSpaceURI(
- ) {
- return _nsURI;
- }
-
- /**
- * Method getValidator.
- *
- * @return a specific validator for the class described by this
- * ClassDescriptor.
- */
- public org.exolab.castor.xml.TypeValidator getValidator(
- ) {
- return this;
- }
-
- /**
- * Method getXMLName.
- *
- * @return the XML Name for the Class being described.
- */
- public java.lang.String getXMLName(
- ) {
- return _xmlName;
- }
-
- /**
- * Method isElementDefinition.
- *
- * @return true if XML schema definition of this Class is that
- * of a global
- * element or element with anonymous type definition.
- */
- public boolean isElementDefinition(
- ) {
- return _elementDefinition;
- }
+public class CommonDescriptor extends
+ uk.ac.vamsas.objects.core.descriptors.AppDataDescriptor {
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * Field _elementDefinition.
+ */
+ private boolean _elementDefinition;
+
+ /**
+ * Field _nsPrefix.
+ */
+ private java.lang.String _nsPrefix;
+
+ /**
+ * Field _nsURI.
+ */
+ private java.lang.String _nsURI;
+
+ /**
+ * Field _xmlName.
+ */
+ private java.lang.String _xmlName;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public CommonDescriptor() {
+ super();
+ setExtendsWithoutFlatten(new uk.ac.vamsas.objects.core.descriptors.AppDataDescriptor());
+ _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
+ _xmlName = "Common";
+ _elementDefinition = true;
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ * Method getAccessMode.
+ *
+ * @return the access mode specified for this class.
+ */
+ public org.exolab.castor.mapping.AccessMode getAccessMode() {
+ return null;
+ }
+
+ /**
+ * Method getIdentity.
+ *
+ * @return the identity field, null if this class has no identity.
+ */
+ public org.exolab.castor.mapping.FieldDescriptor getIdentity() {
+ return super.getIdentity();
+ }
+
+ /**
+ * Method getJavaClass.
+ *
+ * @return the Java class represented by this descriptor.
+ */
+ public java.lang.Class getJavaClass() {
+ return uk.ac.vamsas.objects.core.Common.class;
+ }
+
+ /**
+ * Method getNameSpacePrefix.
+ *
+ * @return the namespace prefix to use when marshaling as XML.
+ */
+ public java.lang.String getNameSpacePrefix() {
+ return _nsPrefix;
+ }
+
+ /**
+ * Method getNameSpaceURI.
+ *
+ * @return the namespace URI used when marshaling and unmarshaling as XML.
+ */
+ public java.lang.String getNameSpaceURI() {
+ return _nsURI;
+ }
+
+ /**
+ * Method getValidator.
+ *
+ * @return a specific validator for the class described by this
+ * ClassDescriptor.
+ */
+ public org.exolab.castor.xml.TypeValidator getValidator() {
+ return this;
+ }
+
+ /**
+ * Method getXMLName.
+ *
+ * @return the XML Name for the Class being described.
+ */
+ public java.lang.String getXMLName() {
+ return _xmlName;
+ }
+
+ /**
+ * Method isElementDefinition.
+ *
+ * @return true if XML schema definition of this Class is that of a global
+ * element or element with anonymous type definition.
+ */
+ public boolean isElementDefinition() {
+ return _elementDefinition;
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/descriptors/DataSetAnnotationsDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/DataSetAnnotationsDescriptor.java
index ec113d2..a829b07 100644
--- a/src/uk/ac/vamsas/objects/core/descriptors/DataSetAnnotationsDescriptor.java
+++ b/src/uk/ac/vamsas/objects/core/descriptors/DataSetAnnotationsDescriptor.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core.descriptors;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import uk.ac.vamsas.objects.core.DataSetAnnotations;
@@ -18,226 +32,219 @@ import uk.ac.vamsas.objects.core.DataSetAnnotations;
*
* @version $Revision$ $Date$
*/
-public class DataSetAnnotationsDescriptor extends uk.ac.vamsas.objects.core.descriptors.RangeAnnotationDescriptor {
-
-
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
- * Field _elementDefinition.
- */
- private boolean _elementDefinition;
-
- /**
- * Field _nsPrefix.
- */
- private java.lang.String _nsPrefix;
-
- /**
- * Field _nsURI.
- */
- private java.lang.String _nsURI;
-
- /**
- * Field _xmlName.
- */
- private java.lang.String _xmlName;
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public DataSetAnnotationsDescriptor() {
- super();
- setExtendsWithoutFlatten(new uk.ac.vamsas.objects.core.descriptors.RangeAnnotationDescriptor());
- _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
- _xmlName = "DataSetAnnotations";
- _elementDefinition = true;
-
- //-- set grouping compositor
- setCompositorAsSequence();
- org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
- org.exolab.castor.mapping.FieldHandler handler = null;
- org.exolab.castor.xml.FieldValidator fieldValidator = null;
- //-- initialize attribute descriptors
-
- //-- _seqRef
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Object.class, "_seqRef", "seqRef", org.exolab.castor.xml.NodeType.Attribute);
- desc.setReference(true);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- DataSetAnnotations target = (DataSetAnnotations) object;
- return target.getSeqRef();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- DataSetAnnotations target = (DataSetAnnotations) object;
- target.addSeqRef( (java.lang.Object) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException {
- try {
- DataSetAnnotations target = (DataSetAnnotations) object;
- target.removeAllSeqRef();
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new java.lang.Object();
- }
- };
- desc.setMultivalued(true);
- desc.setHandler(handler);
- desc.setRequired(true);
- desc.setMultivalued(true);
- addFieldDescriptor(desc);
-
- //-- validation code for: _seqRef
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(0);
- { //-- local scope
- org.exolab.castor.xml.validators.IdRefsValidator typeValidator = new org.exolab.castor.xml.validators.IdRefsValidator();
- fieldValidator.setValidator(typeValidator);
- desc.setValidator(fieldValidator);
+public class DataSetAnnotationsDescriptor extends
+ uk.ac.vamsas.objects.core.descriptors.RangeAnnotationDescriptor {
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * Field _elementDefinition.
+ */
+ private boolean _elementDefinition;
+
+ /**
+ * Field _nsPrefix.
+ */
+ private java.lang.String _nsPrefix;
+
+ /**
+ * Field _nsURI.
+ */
+ private java.lang.String _nsURI;
+
+ /**
+ * Field _xmlName.
+ */
+ private java.lang.String _xmlName;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public DataSetAnnotationsDescriptor() {
+ super();
+ setExtendsWithoutFlatten(new uk.ac.vamsas.objects.core.descriptors.RangeAnnotationDescriptor());
+ _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
+ _xmlName = "DataSetAnnotations";
+ _elementDefinition = true;
+
+ // -- set grouping compositor
+ setCompositorAsSequence();
+ org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
+ org.exolab.castor.mapping.FieldHandler handler = null;
+ org.exolab.castor.xml.FieldValidator fieldValidator = null;
+ // -- initialize attribute descriptors
+
+ // -- _seqRef
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.Object.class, "_seqRef", "seqRef",
+ org.exolab.castor.xml.NodeType.Attribute);
+ desc.setReference(true);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ DataSetAnnotations target = (DataSetAnnotations) object;
+ return target.getSeqRef();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ DataSetAnnotations target = (DataSetAnnotations) object;
+ target.addSeqRef((java.lang.Object) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
- //-- initialize element descriptors
-
- //-- _provenance
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Provenance.class, "_provenance", "Provenance", org.exolab.castor.xml.NodeType.Element);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- DataSetAnnotations target = (DataSetAnnotations) object;
- return target.getProvenance();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- DataSetAnnotations target = (DataSetAnnotations) object;
- target.setProvenance( (uk.ac.vamsas.objects.core.Provenance) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new uk.ac.vamsas.objects.core.Provenance();
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
- desc.setRequired(true);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _provenance
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(1);
- { //-- local scope
+ }
+
+ public void resetValue(Object object) throws IllegalStateException,
+ IllegalArgumentException {
+ try {
+ DataSetAnnotations target = (DataSetAnnotations) object;
+ target.removeAllSeqRef();
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
- }
-
-
- //-----------/
- //- Methods -/
- //-----------/
-
- /**
- * Method getAccessMode.
- *
- * @return the access mode specified for this class.
- */
- public org.exolab.castor.mapping.AccessMode getAccessMode(
- ) {
- return null;
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new java.lang.Object();
+ }
+ };
+ desc.setMultivalued(true);
+ desc.setHandler(handler);
+ desc.setRequired(true);
+ desc.setMultivalued(true);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _seqRef
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(0);
+ { // -- local scope
+ org.exolab.castor.xml.validators.IdRefsValidator typeValidator = new org.exolab.castor.xml.validators.IdRefsValidator();
+ fieldValidator.setValidator(typeValidator);
+ desc.setValidator(fieldValidator);
}
-
- /**
- * Method getIdentity.
- *
- * @return the identity field, null if this class has no
- * identity.
- */
- public org.exolab.castor.mapping.FieldDescriptor getIdentity(
- ) {
- return super.getIdentity();
- }
-
- /**
- * Method getJavaClass.
- *
- * @return the Java class represented by this descriptor.
- */
- public java.lang.Class getJavaClass(
- ) {
- return uk.ac.vamsas.objects.core.DataSetAnnotations.class;
- }
-
- /**
- * Method getNameSpacePrefix.
- *
- * @return the namespace prefix to use when marshaling as XML.
- */
- public java.lang.String getNameSpacePrefix(
- ) {
- return _nsPrefix;
- }
-
- /**
- * Method getNameSpaceURI.
- *
- * @return the namespace URI used when marshaling and
- * unmarshaling as XML.
- */
- public java.lang.String getNameSpaceURI(
- ) {
- return _nsURI;
- }
-
- /**
- * Method getValidator.
- *
- * @return a specific validator for the class described by this
- * ClassDescriptor.
- */
- public org.exolab.castor.xml.TypeValidator getValidator(
- ) {
- return this;
- }
-
- /**
- * Method getXMLName.
- *
- * @return the XML Name for the Class being described.
- */
- public java.lang.String getXMLName(
- ) {
- return _xmlName;
- }
-
- /**
- * Method isElementDefinition.
- *
- * @return true if XML schema definition of this Class is that
- * of a global
- * element or element with anonymous type definition.
- */
- public boolean isElementDefinition(
- ) {
- return _elementDefinition;
+ desc.setValidator(fieldValidator);
+ // -- initialize element descriptors
+
+ // -- _provenance
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ uk.ac.vamsas.objects.core.Provenance.class, "_provenance",
+ "Provenance", org.exolab.castor.xml.NodeType.Element);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ DataSetAnnotations target = (DataSetAnnotations) object;
+ return target.getProvenance();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ DataSetAnnotations target = (DataSetAnnotations) object;
+ target.setProvenance((uk.ac.vamsas.objects.core.Provenance) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new uk.ac.vamsas.objects.core.Provenance();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
+ desc.setRequired(true);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _provenance
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(1);
+ { // -- local scope
}
+ desc.setValidator(fieldValidator);
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ * Method getAccessMode.
+ *
+ * @return the access mode specified for this class.
+ */
+ public org.exolab.castor.mapping.AccessMode getAccessMode() {
+ return null;
+ }
+
+ /**
+ * Method getIdentity.
+ *
+ * @return the identity field, null if this class has no identity.
+ */
+ public org.exolab.castor.mapping.FieldDescriptor getIdentity() {
+ return super.getIdentity();
+ }
+
+ /**
+ * Method getJavaClass.
+ *
+ * @return the Java class represented by this descriptor.
+ */
+ public java.lang.Class getJavaClass() {
+ return uk.ac.vamsas.objects.core.DataSetAnnotations.class;
+ }
+
+ /**
+ * Method getNameSpacePrefix.
+ *
+ * @return the namespace prefix to use when marshaling as XML.
+ */
+ public java.lang.String getNameSpacePrefix() {
+ return _nsPrefix;
+ }
+
+ /**
+ * Method getNameSpaceURI.
+ *
+ * @return the namespace URI used when marshaling and unmarshaling as XML.
+ */
+ public java.lang.String getNameSpaceURI() {
+ return _nsURI;
+ }
+
+ /**
+ * Method getValidator.
+ *
+ * @return a specific validator for the class described by this
+ * ClassDescriptor.
+ */
+ public org.exolab.castor.xml.TypeValidator getValidator() {
+ return this;
+ }
+
+ /**
+ * Method getXMLName.
+ *
+ * @return the XML Name for the Class being described.
+ */
+ public java.lang.String getXMLName() {
+ return _xmlName;
+ }
+
+ /**
+ * Method isElementDefinition.
+ *
+ * @return true if XML schema definition of this Class is that of a global
+ * element or element with anonymous type definition.
+ */
+ public boolean isElementDefinition() {
+ return _elementDefinition;
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/descriptors/DataSetDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/DataSetDescriptor.java
index f677adf..16d6cc2 100644
--- a/src/uk/ac/vamsas/objects/core/descriptors/DataSetDescriptor.java
+++ b/src/uk/ac/vamsas/objects/core/descriptors/DataSetDescriptor.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core.descriptors;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import uk.ac.vamsas.objects.core.DataSet;
@@ -18,425 +32,440 @@ import uk.ac.vamsas.objects.core.DataSet;
*
* @version $Revision$ $Date$
*/
-public class DataSetDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl {
-
-
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
- * Field _elementDefinition.
- */
- private boolean _elementDefinition;
-
- /**
- * Field _nsPrefix.
- */
- private java.lang.String _nsPrefix;
-
- /**
- * Field _nsURI.
- */
- private java.lang.String _nsURI;
-
- /**
- * Field _xmlName.
- */
- private java.lang.String _xmlName;
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public DataSetDescriptor() {
- super();
- _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
- _xmlName = "DataSet";
- _elementDefinition = true;
-
- //-- set grouping compositor
- setCompositorAsSequence();
- org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
- org.exolab.castor.mapping.FieldHandler handler = null;
- org.exolab.castor.xml.FieldValidator fieldValidator = null;
- //-- initialize attribute descriptors
-
- //-- _id
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_id", "id", org.exolab.castor.xml.NodeType.Attribute);
- super.setIdentity(desc);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- DataSet target = (DataSet) object;
- return target.getId();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- DataSet target = (DataSet) object;
- target.setId( (java.lang.String) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new java.lang.String();
- }
- };
- desc.setHandler(handler);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _id
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { //-- local scope
- org.exolab.castor.xml.validators.IdValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.IdValidator();
- fieldValidator.setValidator(typeValidator);
+public class DataSetDescriptor extends
+ org.exolab.castor.xml.util.XMLClassDescriptorImpl {
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * Field _elementDefinition.
+ */
+ private boolean _elementDefinition;
+
+ /**
+ * Field _nsPrefix.
+ */
+ private java.lang.String _nsPrefix;
+
+ /**
+ * Field _nsURI.
+ */
+ private java.lang.String _nsURI;
+
+ /**
+ * Field _xmlName.
+ */
+ private java.lang.String _xmlName;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public DataSetDescriptor() {
+ super();
+ _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
+ _xmlName = "DataSet";
+ _elementDefinition = true;
+
+ // -- set grouping compositor
+ setCompositorAsSequence();
+ org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
+ org.exolab.castor.mapping.FieldHandler handler = null;
+ org.exolab.castor.xml.FieldValidator fieldValidator = null;
+ // -- initialize attribute descriptors
+
+ // -- _id
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.String.class, "_id", "id",
+ org.exolab.castor.xml.NodeType.Attribute);
+ super.setIdentity(desc);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ DataSet target = (DataSet) object;
+ return target.getId();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ DataSet target = (DataSet) object;
+ target.setId((java.lang.String) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
- //-- initialize element descriptors
-
- //-- _sequenceList
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Sequence.class, "_sequenceList", "Sequence", org.exolab.castor.xml.NodeType.Element);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- DataSet target = (DataSet) object;
- return target.getSequence();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- DataSet target = (DataSet) object;
- target.addSequence( (uk.ac.vamsas.objects.core.Sequence) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException {
- try {
- DataSet target = (DataSet) object;
- target.removeAllSequence();
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new uk.ac.vamsas.objects.core.Sequence();
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
- desc.setRequired(true);
- desc.setMultivalued(true);
- addFieldDescriptor(desc);
-
- //-- validation code for: _sequenceList
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(1);
- { //-- local scope
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new java.lang.String();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _id
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ { // -- local scope
+ org.exolab.castor.xml.validators.IdValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.IdValidator();
+ fieldValidator.setValidator(typeValidator);
+ }
+ desc.setValidator(fieldValidator);
+ // -- initialize element descriptors
+
+ // -- _sequenceList
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ uk.ac.vamsas.objects.core.Sequence.class, "_sequenceList", "Sequence",
+ org.exolab.castor.xml.NodeType.Element);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ DataSet target = (DataSet) object;
+ return target.getSequence();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ DataSet target = (DataSet) object;
+ target.addSequence((uk.ac.vamsas.objects.core.Sequence) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
- //-- _sequenceMappingList
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.SequenceMapping.class, "_sequenceMappingList", "sequenceMapping", org.exolab.castor.xml.NodeType.Element);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- DataSet target = (DataSet) object;
- return target.getSequenceMapping();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- DataSet target = (DataSet) object;
- target.addSequenceMapping( (uk.ac.vamsas.objects.core.SequenceMapping) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException {
- try {
- DataSet target = (DataSet) object;
- target.removeAllSequenceMapping();
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new uk.ac.vamsas.objects.core.SequenceMapping();
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
- desc.setMultivalued(true);
- addFieldDescriptor(desc);
-
- //-- validation code for: _sequenceMappingList
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(0);
- { //-- local scope
+ }
+
+ public void resetValue(Object object) throws IllegalStateException,
+ IllegalArgumentException {
+ try {
+ DataSet target = (DataSet) object;
+ target.removeAllSequence();
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
- //-- _dataSetAnnotationsList
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.DataSetAnnotations.class, "_dataSetAnnotationsList", "DataSetAnnotations", org.exolab.castor.xml.NodeType.Element);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- DataSet target = (DataSet) object;
- return target.getDataSetAnnotations();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- DataSet target = (DataSet) object;
- target.addDataSetAnnotations( (uk.ac.vamsas.objects.core.DataSetAnnotations) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException {
- try {
- DataSet target = (DataSet) object;
- target.removeAllDataSetAnnotations();
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new uk.ac.vamsas.objects.core.DataSetAnnotations();
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
- desc.setMultivalued(true);
- addFieldDescriptor(desc);
-
- //-- validation code for: _dataSetAnnotationsList
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(0);
- { //-- local scope
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new uk.ac.vamsas.objects.core.Sequence();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
+ desc.setRequired(true);
+ desc.setMultivalued(true);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _sequenceList
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(1);
+ { // -- local scope
+ }
+ desc.setValidator(fieldValidator);
+ // -- _sequenceMappingList
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ uk.ac.vamsas.objects.core.SequenceMapping.class,
+ "_sequenceMappingList", "sequenceMapping",
+ org.exolab.castor.xml.NodeType.Element);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ DataSet target = (DataSet) object;
+ return target.getSequenceMapping();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ DataSet target = (DataSet) object;
+ target
+ .addSequenceMapping((uk.ac.vamsas.objects.core.SequenceMapping) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
- //-- _alignmentList
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Alignment.class, "_alignmentList", "Alignment", org.exolab.castor.xml.NodeType.Element);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- DataSet target = (DataSet) object;
- return target.getAlignment();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- DataSet target = (DataSet) object;
- target.addAlignment( (uk.ac.vamsas.objects.core.Alignment) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException {
- try {
- DataSet target = (DataSet) object;
- target.removeAllAlignment();
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new uk.ac.vamsas.objects.core.Alignment();
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
- desc.setMultivalued(true);
- addFieldDescriptor(desc);
-
- //-- validation code for: _alignmentList
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(0);
- { //-- local scope
+ }
+
+ public void resetValue(Object object) throws IllegalStateException,
+ IllegalArgumentException {
+ try {
+ DataSet target = (DataSet) object;
+ target.removeAllSequenceMapping();
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
- //-- _treeList
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Tree.class, "_treeList", "Tree", org.exolab.castor.xml.NodeType.Element);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- DataSet target = (DataSet) object;
- return target.getTree();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- DataSet target = (DataSet) object;
- target.addTree( (uk.ac.vamsas.objects.core.Tree) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException {
- try {
- DataSet target = (DataSet) object;
- target.removeAllTree();
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new uk.ac.vamsas.objects.core.Tree();
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
- desc.setMultivalued(true);
- addFieldDescriptor(desc);
-
- //-- validation code for: _treeList
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(0);
- { //-- local scope
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new uk.ac.vamsas.objects.core.SequenceMapping();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
+ desc.setMultivalued(true);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _sequenceMappingList
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(0);
+ { // -- local scope
+ }
+ desc.setValidator(fieldValidator);
+ // -- _dataSetAnnotationsList
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ uk.ac.vamsas.objects.core.DataSetAnnotations.class,
+ "_dataSetAnnotationsList", "DataSetAnnotations",
+ org.exolab.castor.xml.NodeType.Element);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ DataSet target = (DataSet) object;
+ return target.getDataSetAnnotations();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ DataSet target = (DataSet) object;
+ target
+ .addDataSetAnnotations((uk.ac.vamsas.objects.core.DataSetAnnotations) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
- //-- _provenance
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Provenance.class, "_provenance", "Provenance", org.exolab.castor.xml.NodeType.Element);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- DataSet target = (DataSet) object;
- return target.getProvenance();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- DataSet target = (DataSet) object;
- target.setProvenance( (uk.ac.vamsas.objects.core.Provenance) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new uk.ac.vamsas.objects.core.Provenance();
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
- desc.setRequired(true);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _provenance
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(1);
- { //-- local scope
+ }
+
+ public void resetValue(Object object) throws IllegalStateException,
+ IllegalArgumentException {
+ try {
+ DataSet target = (DataSet) object;
+ target.removeAllDataSetAnnotations();
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new uk.ac.vamsas.objects.core.DataSetAnnotations();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
+ desc.setMultivalued(true);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _dataSetAnnotationsList
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(0);
+ { // -- local scope
}
+ desc.setValidator(fieldValidator);
+ // -- _alignmentList
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ uk.ac.vamsas.objects.core.Alignment.class, "_alignmentList",
+ "Alignment", org.exolab.castor.xml.NodeType.Element);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ DataSet target = (DataSet) object;
+ return target.getAlignment();
+ }
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ DataSet target = (DataSet) object;
+ target.addAlignment((uk.ac.vamsas.objects.core.Alignment) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- //-----------/
- //- Methods -/
- //-----------/
+ public void resetValue(Object object) throws IllegalStateException,
+ IllegalArgumentException {
+ try {
+ DataSet target = (DataSet) object;
+ target.removeAllAlignment();
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- /**
- * Method getAccessMode.
- *
- * @return the access mode specified for this class.
- */
- public org.exolab.castor.mapping.AccessMode getAccessMode(
- ) {
- return null;
- }
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new uk.ac.vamsas.objects.core.Alignment();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
+ desc.setMultivalued(true);
+ addFieldDescriptor(desc);
- /**
- * Method getIdentity.
- *
- * @return the identity field, null if this class has no
- * identity.
- */
- public org.exolab.castor.mapping.FieldDescriptor getIdentity(
- ) {
- return super.getIdentity();
+ // -- validation code for: _alignmentList
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(0);
+ { // -- local scope
}
+ desc.setValidator(fieldValidator);
+ // -- _treeList
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ uk.ac.vamsas.objects.core.Tree.class, "_treeList", "Tree",
+ org.exolab.castor.xml.NodeType.Element);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ DataSet target = (DataSet) object;
+ return target.getTree();
+ }
- /**
- * Method getJavaClass.
- *
- * @return the Java class represented by this descriptor.
- */
- public java.lang.Class getJavaClass(
- ) {
- return uk.ac.vamsas.objects.core.DataSet.class;
- }
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ DataSet target = (DataSet) object;
+ target.addTree((uk.ac.vamsas.objects.core.Tree) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- /**
- * Method getNameSpacePrefix.
- *
- * @return the namespace prefix to use when marshaling as XML.
- */
- public java.lang.String getNameSpacePrefix(
- ) {
- return _nsPrefix;
- }
+ public void resetValue(Object object) throws IllegalStateException,
+ IllegalArgumentException {
+ try {
+ DataSet target = (DataSet) object;
+ target.removeAllTree();
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- /**
- * Method getNameSpaceURI.
- *
- * @return the namespace URI used when marshaling and
- * unmarshaling as XML.
- */
- public java.lang.String getNameSpaceURI(
- ) {
- return _nsURI;
- }
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new uk.ac.vamsas.objects.core.Tree();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
+ desc.setMultivalued(true);
+ addFieldDescriptor(desc);
- /**
- * Method getValidator.
- *
- * @return a specific validator for the class described by this
- * ClassDescriptor.
- */
- public org.exolab.castor.xml.TypeValidator getValidator(
- ) {
- return this;
+ // -- validation code for: _treeList
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(0);
+ { // -- local scope
}
+ desc.setValidator(fieldValidator);
+ // -- _provenance
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ uk.ac.vamsas.objects.core.Provenance.class, "_provenance",
+ "Provenance", org.exolab.castor.xml.NodeType.Element);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ DataSet target = (DataSet) object;
+ return target.getProvenance();
+ }
- /**
- * Method getXMLName.
- *
- * @return the XML Name for the Class being described.
- */
- public java.lang.String getXMLName(
- ) {
- return _xmlName;
- }
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ DataSet target = (DataSet) object;
+ target.setProvenance((uk.ac.vamsas.objects.core.Provenance) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new uk.ac.vamsas.objects.core.Provenance();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
+ desc.setRequired(true);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
- /**
- * Method isElementDefinition.
- *
- * @return true if XML schema definition of this Class is that
- * of a global
- * element or element with anonymous type definition.
- */
- public boolean isElementDefinition(
- ) {
- return _elementDefinition;
+ // -- validation code for: _provenance
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(1);
+ { // -- local scope
}
+ desc.setValidator(fieldValidator);
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ * Method getAccessMode.
+ *
+ * @return the access mode specified for this class.
+ */
+ public org.exolab.castor.mapping.AccessMode getAccessMode() {
+ return null;
+ }
+
+ /**
+ * Method getIdentity.
+ *
+ * @return the identity field, null if this class has no identity.
+ */
+ public org.exolab.castor.mapping.FieldDescriptor getIdentity() {
+ return super.getIdentity();
+ }
+
+ /**
+ * Method getJavaClass.
+ *
+ * @return the Java class represented by this descriptor.
+ */
+ public java.lang.Class getJavaClass() {
+ return uk.ac.vamsas.objects.core.DataSet.class;
+ }
+
+ /**
+ * Method getNameSpacePrefix.
+ *
+ * @return the namespace prefix to use when marshaling as XML.
+ */
+ public java.lang.String getNameSpacePrefix() {
+ return _nsPrefix;
+ }
+
+ /**
+ * Method getNameSpaceURI.
+ *
+ * @return the namespace URI used when marshaling and unmarshaling as XML.
+ */
+ public java.lang.String getNameSpaceURI() {
+ return _nsURI;
+ }
+
+ /**
+ * Method getValidator.
+ *
+ * @return a specific validator for the class described by this
+ * ClassDescriptor.
+ */
+ public org.exolab.castor.xml.TypeValidator getValidator() {
+ return this;
+ }
+
+ /**
+ * Method getXMLName.
+ *
+ * @return the XML Name for the Class being described.
+ */
+ public java.lang.String getXMLName() {
+ return _xmlName;
+ }
+
+ /**
+ * Method isElementDefinition.
+ *
+ * @return true if XML schema definition of this Class is that of a global
+ * element or element with anonymous type definition.
+ */
+ public boolean isElementDefinition() {
+ return _elementDefinition;
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/descriptors/DbRefDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/DbRefDescriptor.java
index 9f13e4f..eee7f9a 100644
--- a/src/uk/ac/vamsas/objects/core/descriptors/DbRefDescriptor.java
+++ b/src/uk/ac/vamsas/objects/core/descriptors/DbRefDescriptor.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core.descriptors;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import uk.ac.vamsas.objects.core.DbRef;
@@ -18,422 +32,429 @@ import uk.ac.vamsas.objects.core.DbRef;
*
* @version $Revision$ $Date$
*/
-public class DbRefDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl {
-
-
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
- * Field _elementDefinition.
- */
- private boolean _elementDefinition;
-
- /**
- * Field _nsPrefix.
- */
- private java.lang.String _nsPrefix;
-
- /**
- * Field _nsURI.
- */
- private java.lang.String _nsURI;
-
- /**
- * Field _xmlName.
- */
- private java.lang.String _xmlName;
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public DbRefDescriptor() {
- super();
- _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
- _xmlName = "dbRef";
- _elementDefinition = true;
-
- //-- set grouping compositor
- setCompositorAsSequence();
- org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
- org.exolab.castor.mapping.FieldHandler handler = null;
- org.exolab.castor.xml.FieldValidator fieldValidator = null;
- //-- initialize attribute descriptors
-
- //-- _source
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_source", "source", org.exolab.castor.xml.NodeType.Attribute);
- desc.setImmutable(true);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- DbRef target = (DbRef) object;
- return target.getSource();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- DbRef target = (DbRef) object;
- target.setSource( (java.lang.String) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setRequired(true);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _source
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(1);
- { //-- local scope
- org.exolab.castor.xml.validators.StringValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.StringValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setWhiteSpace("preserve");
- }
- desc.setValidator(fieldValidator);
- //-- _version
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_version", "version", org.exolab.castor.xml.NodeType.Attribute);
- desc.setImmutable(true);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- DbRef target = (DbRef) object;
- return target.getVersion();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- DbRef target = (DbRef) object;
- target.setVersion( (java.lang.String) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setRequired(true);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _version
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(1);
- { //-- local scope
- org.exolab.castor.xml.validators.StringValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.StringValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setWhiteSpace("preserve");
+public class DbRefDescriptor extends
+ org.exolab.castor.xml.util.XMLClassDescriptorImpl {
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * Field _elementDefinition.
+ */
+ private boolean _elementDefinition;
+
+ /**
+ * Field _nsPrefix.
+ */
+ private java.lang.String _nsPrefix;
+
+ /**
+ * Field _nsURI.
+ */
+ private java.lang.String _nsURI;
+
+ /**
+ * Field _xmlName.
+ */
+ private java.lang.String _xmlName;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public DbRefDescriptor() {
+ super();
+ _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
+ _xmlName = "dbRef";
+ _elementDefinition = true;
+
+ // -- set grouping compositor
+ setCompositorAsSequence();
+ org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
+ org.exolab.castor.mapping.FieldHandler handler = null;
+ org.exolab.castor.xml.FieldValidator fieldValidator = null;
+ // -- initialize attribute descriptors
+
+ // -- _source
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.String.class, "_source", "source",
+ org.exolab.castor.xml.NodeType.Attribute);
+ desc.setImmutable(true);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ DbRef target = (DbRef) object;
+ return target.getSource();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ DbRef target = (DbRef) object;
+ target.setSource((java.lang.String) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
- //-- _accessionId
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_accessionId", "accessionId", org.exolab.castor.xml.NodeType.Attribute);
- desc.setImmutable(true);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- DbRef target = (DbRef) object;
- return target.getAccessionId();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- DbRef target = (DbRef) object;
- target.setAccessionId( (java.lang.String) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setRequired(true);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _accessionId
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(1);
- { //-- local scope
- org.exolab.castor.xml.validators.StringValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.StringValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setWhiteSpace("preserve");
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return null;
+ }
+ };
+ desc.setHandler(handler);
+ desc.setRequired(true);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _source
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(1);
+ { // -- local scope
+ org.exolab.castor.xml.validators.StringValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.StringValidator();
+ fieldValidator.setValidator(typeValidator);
+ typeValidator.setWhiteSpace("preserve");
+ }
+ desc.setValidator(fieldValidator);
+ // -- _version
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.String.class, "_version", "version",
+ org.exolab.castor.xml.NodeType.Attribute);
+ desc.setImmutable(true);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ DbRef target = (DbRef) object;
+ return target.getVersion();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ DbRef target = (DbRef) object;
+ target.setVersion((java.lang.String) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
- //-- _id
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_id", "id", org.exolab.castor.xml.NodeType.Attribute);
- super.setIdentity(desc);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- DbRef target = (DbRef) object;
- return target.getId();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- DbRef target = (DbRef) object;
- target.setId( (java.lang.String) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new java.lang.String();
- }
- };
- desc.setHandler(handler);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _id
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { //-- local scope
- org.exolab.castor.xml.validators.IdValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.IdValidator();
- fieldValidator.setValidator(typeValidator);
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return null;
+ }
+ };
+ desc.setHandler(handler);
+ desc.setRequired(true);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _version
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(1);
+ { // -- local scope
+ org.exolab.castor.xml.validators.StringValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.StringValidator();
+ fieldValidator.setValidator(typeValidator);
+ typeValidator.setWhiteSpace("preserve");
+ }
+ desc.setValidator(fieldValidator);
+ // -- _accessionId
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.String.class, "_accessionId", "accessionId",
+ org.exolab.castor.xml.NodeType.Attribute);
+ desc.setImmutable(true);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ DbRef target = (DbRef) object;
+ return target.getAccessionId();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ DbRef target = (DbRef) object;
+ target.setAccessionId((java.lang.String) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
- //-- initialize element descriptors
-
- //-- _mapList
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Map.class, "_mapList", "map", org.exolab.castor.xml.NodeType.Element);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- DbRef target = (DbRef) object;
- return target.getMap();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- DbRef target = (DbRef) object;
- target.addMap( (uk.ac.vamsas.objects.core.Map) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException {
- try {
- DbRef target = (DbRef) object;
- target.removeAllMap();
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new uk.ac.vamsas.objects.core.Map();
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
- desc.setMultivalued(true);
- addFieldDescriptor(desc);
-
- //-- validation code for: _mapList
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(0);
- { //-- local scope
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return null;
+ }
+ };
+ desc.setHandler(handler);
+ desc.setRequired(true);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _accessionId
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(1);
+ { // -- local scope
+ org.exolab.castor.xml.validators.StringValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.StringValidator();
+ fieldValidator.setValidator(typeValidator);
+ typeValidator.setWhiteSpace("preserve");
+ }
+ desc.setValidator(fieldValidator);
+ // -- _id
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.String.class, "_id", "id",
+ org.exolab.castor.xml.NodeType.Attribute);
+ super.setIdentity(desc);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ DbRef target = (DbRef) object;
+ return target.getId();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ DbRef target = (DbRef) object;
+ target.setId((java.lang.String) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
- //-- _linkList
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Link.class, "_linkList", "link", org.exolab.castor.xml.NodeType.Element);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- DbRef target = (DbRef) object;
- return target.getLink();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- DbRef target = (DbRef) object;
- target.addLink( (uk.ac.vamsas.objects.core.Link) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException {
- try {
- DbRef target = (DbRef) object;
- target.removeAllLink();
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new uk.ac.vamsas.objects.core.Link();
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
- desc.setMultivalued(true);
- addFieldDescriptor(desc);
-
- //-- validation code for: _linkList
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(0);
- { //-- local scope
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new java.lang.String();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _id
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ { // -- local scope
+ org.exolab.castor.xml.validators.IdValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.IdValidator();
+ fieldValidator.setValidator(typeValidator);
+ }
+ desc.setValidator(fieldValidator);
+ // -- initialize element descriptors
+
+ // -- _mapList
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ uk.ac.vamsas.objects.core.Map.class, "_mapList", "map",
+ org.exolab.castor.xml.NodeType.Element);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ DbRef target = (DbRef) object;
+ return target.getMap();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ DbRef target = (DbRef) object;
+ target.addMap((uk.ac.vamsas.objects.core.Map) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
- //-- _propertyList
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Property.class, "_propertyList", "property", org.exolab.castor.xml.NodeType.Element);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- DbRef target = (DbRef) object;
- return target.getProperty();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- DbRef target = (DbRef) object;
- target.addProperty( (uk.ac.vamsas.objects.core.Property) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException {
- try {
- DbRef target = (DbRef) object;
- target.removeAllProperty();
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new uk.ac.vamsas.objects.core.Property();
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
- desc.setMultivalued(true);
- addFieldDescriptor(desc);
-
- //-- validation code for: _propertyList
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(0);
- { //-- local scope
+ }
+
+ public void resetValue(Object object) throws IllegalStateException,
+ IllegalArgumentException {
+ try {
+ DbRef target = (DbRef) object;
+ target.removeAllMap();
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new uk.ac.vamsas.objects.core.Map();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
+ desc.setMultivalued(true);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _mapList
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(0);
+ { // -- local scope
}
+ desc.setValidator(fieldValidator);
+ // -- _linkList
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ uk.ac.vamsas.objects.core.Link.class, "_linkList", "link",
+ org.exolab.castor.xml.NodeType.Element);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ DbRef target = (DbRef) object;
+ return target.getLink();
+ }
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ DbRef target = (DbRef) object;
+ target.addLink((uk.ac.vamsas.objects.core.Link) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- //-----------/
- //- Methods -/
- //-----------/
+ public void resetValue(Object object) throws IllegalStateException,
+ IllegalArgumentException {
+ try {
+ DbRef target = (DbRef) object;
+ target.removeAllLink();
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- /**
- * Method getAccessMode.
- *
- * @return the access mode specified for this class.
- */
- public org.exolab.castor.mapping.AccessMode getAccessMode(
- ) {
- return null;
- }
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new uk.ac.vamsas.objects.core.Link();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
+ desc.setMultivalued(true);
+ addFieldDescriptor(desc);
- /**
- * Method getIdentity.
- *
- * @return the identity field, null if this class has no
- * identity.
- */
- public org.exolab.castor.mapping.FieldDescriptor getIdentity(
- ) {
- return super.getIdentity();
+ // -- validation code for: _linkList
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(0);
+ { // -- local scope
}
+ desc.setValidator(fieldValidator);
+ // -- _propertyList
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ uk.ac.vamsas.objects.core.Property.class, "_propertyList", "property",
+ org.exolab.castor.xml.NodeType.Element);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ DbRef target = (DbRef) object;
+ return target.getProperty();
+ }
- /**
- * Method getJavaClass.
- *
- * @return the Java class represented by this descriptor.
- */
- public java.lang.Class getJavaClass(
- ) {
- return uk.ac.vamsas.objects.core.DbRef.class;
- }
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ DbRef target = (DbRef) object;
+ target.addProperty((uk.ac.vamsas.objects.core.Property) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- /**
- * Method getNameSpacePrefix.
- *
- * @return the namespace prefix to use when marshaling as XML.
- */
- public java.lang.String getNameSpacePrefix(
- ) {
- return _nsPrefix;
- }
+ public void resetValue(Object object) throws IllegalStateException,
+ IllegalArgumentException {
+ try {
+ DbRef target = (DbRef) object;
+ target.removeAllProperty();
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- /**
- * Method getNameSpaceURI.
- *
- * @return the namespace URI used when marshaling and
- * unmarshaling as XML.
- */
- public java.lang.String getNameSpaceURI(
- ) {
- return _nsURI;
- }
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new uk.ac.vamsas.objects.core.Property();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
+ desc.setMultivalued(true);
+ addFieldDescriptor(desc);
- /**
- * Method getValidator.
- *
- * @return a specific validator for the class described by this
- * ClassDescriptor.
- */
- public org.exolab.castor.xml.TypeValidator getValidator(
- ) {
- return this;
+ // -- validation code for: _propertyList
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(0);
+ { // -- local scope
}
+ desc.setValidator(fieldValidator);
+ }
- /**
- * Method getXMLName.
- *
- * @return the XML Name for the Class being described.
- */
- public java.lang.String getXMLName(
- ) {
- return _xmlName;
- }
+ // -----------/
+ // - Methods -/
+ // -----------/
- /**
- * Method isElementDefinition.
- *
- * @return true if XML schema definition of this Class is that
- * of a global
- * element or element with anonymous type definition.
- */
- public boolean isElementDefinition(
- ) {
- return _elementDefinition;
- }
+ /**
+ * Method getAccessMode.
+ *
+ * @return the access mode specified for this class.
+ */
+ public org.exolab.castor.mapping.AccessMode getAccessMode() {
+ return null;
+ }
+
+ /**
+ * Method getIdentity.
+ *
+ * @return the identity field, null if this class has no identity.
+ */
+ public org.exolab.castor.mapping.FieldDescriptor getIdentity() {
+ return super.getIdentity();
+ }
+
+ /**
+ * Method getJavaClass.
+ *
+ * @return the Java class represented by this descriptor.
+ */
+ public java.lang.Class getJavaClass() {
+ return uk.ac.vamsas.objects.core.DbRef.class;
+ }
+
+ /**
+ * Method getNameSpacePrefix.
+ *
+ * @return the namespace prefix to use when marshaling as XML.
+ */
+ public java.lang.String getNameSpacePrefix() {
+ return _nsPrefix;
+ }
+
+ /**
+ * Method getNameSpaceURI.
+ *
+ * @return the namespace URI used when marshaling and unmarshaling as XML.
+ */
+ public java.lang.String getNameSpaceURI() {
+ return _nsURI;
+ }
+
+ /**
+ * Method getValidator.
+ *
+ * @return a specific validator for the class described by this
+ * ClassDescriptor.
+ */
+ public org.exolab.castor.xml.TypeValidator getValidator() {
+ return this;
+ }
+
+ /**
+ * Method getXMLName.
+ *
+ * @return the XML Name for the Class being described.
+ */
+ public java.lang.String getXMLName() {
+ return _xmlName;
+ }
+
+ /**
+ * Method isElementDefinition.
+ *
+ * @return true if XML schema definition of this Class is that of a global
+ * element or element with anonymous type definition.
+ */
+ public boolean isElementDefinition() {
+ return _elementDefinition;
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/descriptors/EntryDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/EntryDescriptor.java
index 6b3eb45..3041196 100644
--- a/src/uk/ac/vamsas/objects/core/descriptors/EntryDescriptor.java
+++ b/src/uk/ac/vamsas/objects/core/descriptors/EntryDescriptor.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core.descriptors;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import uk.ac.vamsas.objects.core.Entry;
@@ -18,465 +32,474 @@ import uk.ac.vamsas.objects.core.Entry;
*
* @version $Revision$ $Date$
*/
-public class EntryDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl {
-
-
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
- * Field _elementDefinition.
- */
- private boolean _elementDefinition;
-
- /**
- * Field _nsPrefix.
- */
- private java.lang.String _nsPrefix;
-
- /**
- * Field _nsURI.
- */
- private java.lang.String _nsURI;
-
- /**
- * Field _xmlName.
- */
- private java.lang.String _xmlName;
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public EntryDescriptor() {
- super();
- _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
- _xmlName = "entry";
- _elementDefinition = true;
-
- //-- set grouping compositor
- setCompositorAsSequence();
- org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
- org.exolab.castor.mapping.FieldHandler handler = null;
- org.exolab.castor.xml.FieldValidator fieldValidator = null;
- //-- initialize attribute descriptors
-
- //-- _id
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_id", "id", org.exolab.castor.xml.NodeType.Attribute);
- super.setIdentity(desc);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- Entry target = (Entry) object;
- return target.getId();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- Entry target = (Entry) object;
- target.setId( (java.lang.String) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new java.lang.String();
- }
- };
- desc.setHandler(handler);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _id
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { //-- local scope
- org.exolab.castor.xml.validators.IdValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.IdValidator();
- fieldValidator.setValidator(typeValidator);
- }
- desc.setValidator(fieldValidator);
- //-- initialize element descriptors
-
- //-- _user
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_user", "User", org.exolab.castor.xml.NodeType.Element);
- desc.setImmutable(true);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- Entry target = (Entry) object;
- return target.getUser();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- Entry target = (Entry) object;
- target.setUser( (java.lang.String) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
- desc.setRequired(true);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _user
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(1);
- { //-- local scope
- org.exolab.castor.xml.validators.StringValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.StringValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setWhiteSpace("preserve");
- }
- desc.setValidator(fieldValidator);
- //-- _app
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_app", "App", org.exolab.castor.xml.NodeType.Element);
- desc.setImmutable(true);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- Entry target = (Entry) object;
- return target.getApp();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- Entry target = (Entry) object;
- target.setApp( (java.lang.String) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
- desc.setRequired(true);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _app
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(1);
- { //-- local scope
- org.exolab.castor.xml.validators.StringValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.StringValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setWhiteSpace("preserve");
- }
- desc.setValidator(fieldValidator);
- //-- _action
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_action", "Action", org.exolab.castor.xml.NodeType.Element);
- desc.setImmutable(true);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- Entry target = (Entry) object;
- return target.getAction();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- Entry target = (Entry) object;
- target.setAction( (java.lang.String) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
- desc.setRequired(true);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _action
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(1);
- { //-- local scope
- org.exolab.castor.xml.validators.StringValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.StringValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setWhiteSpace("preserve");
- }
- desc.setValidator(fieldValidator);
- //-- _date
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.util.Date.class, "_date", "Date", org.exolab.castor.xml.NodeType.Element);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- Entry target = (Entry) object;
- return target.getDate();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- Entry target = (Entry) object;
- target.setDate( (java.util.Date) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new java.util.Date();
- }
- };
- handler = new org.exolab.castor.xml.handlers.DateFieldHandler(handler);
- desc.setImmutable(true);
- desc.setHandler(handler);
- desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
- desc.setRequired(true);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _date
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(1);
- { //-- local scope
- org.exolab.castor.xml.validators.DateTimeValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.DateTimeValidator();
- fieldValidator.setValidator(typeValidator);
- }
- desc.setValidator(fieldValidator);
- //-- _propertyList
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Property.class, "_propertyList", "property", org.exolab.castor.xml.NodeType.Element);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- Entry target = (Entry) object;
- return target.getProperty();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- Entry target = (Entry) object;
- target.addProperty( (uk.ac.vamsas.objects.core.Property) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException {
- try {
- Entry target = (Entry) object;
- target.removeAllProperty();
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new uk.ac.vamsas.objects.core.Property();
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
- desc.setMultivalued(true);
- addFieldDescriptor(desc);
-
- //-- validation code for: _propertyList
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(0);
- { //-- local scope
- }
- desc.setValidator(fieldValidator);
- //-- _paramList
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Param.class, "_paramList", "param", org.exolab.castor.xml.NodeType.Element);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- Entry target = (Entry) object;
- return target.getParam();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- Entry target = (Entry) object;
- target.addParam( (uk.ac.vamsas.objects.core.Param) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException {
- try {
- Entry target = (Entry) object;
- target.removeAllParam();
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new uk.ac.vamsas.objects.core.Param();
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
- desc.setMultivalued(true);
- addFieldDescriptor(desc);
-
- //-- validation code for: _paramList
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(0);
- { //-- local scope
- }
- desc.setValidator(fieldValidator);
- //-- _inputList
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Input.class, "_inputList", "input", org.exolab.castor.xml.NodeType.Element);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- Entry target = (Entry) object;
- return target.getInput();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- Entry target = (Entry) object;
- target.addInput( (uk.ac.vamsas.objects.core.Input) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException {
- try {
- Entry target = (Entry) object;
- target.removeAllInput();
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new uk.ac.vamsas.objects.core.Input();
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
- desc.setMultivalued(true);
- addFieldDescriptor(desc);
-
- //-- validation code for: _inputList
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(0);
- { //-- local scope
+public class EntryDescriptor extends
+ org.exolab.castor.xml.util.XMLClassDescriptorImpl {
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * Field _elementDefinition.
+ */
+ private boolean _elementDefinition;
+
+ /**
+ * Field _nsPrefix.
+ */
+ private java.lang.String _nsPrefix;
+
+ /**
+ * Field _nsURI.
+ */
+ private java.lang.String _nsURI;
+
+ /**
+ * Field _xmlName.
+ */
+ private java.lang.String _xmlName;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public EntryDescriptor() {
+ super();
+ _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
+ _xmlName = "entry";
+ _elementDefinition = true;
+
+ // -- set grouping compositor
+ setCompositorAsSequence();
+ org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
+ org.exolab.castor.mapping.FieldHandler handler = null;
+ org.exolab.castor.xml.FieldValidator fieldValidator = null;
+ // -- initialize attribute descriptors
+
+ // -- _id
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.String.class, "_id", "id",
+ org.exolab.castor.xml.NodeType.Attribute);
+ super.setIdentity(desc);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ Entry target = (Entry) object;
+ return target.getId();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ Entry target = (Entry) object;
+ target.setId((java.lang.String) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new java.lang.String();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _id
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ { // -- local scope
+ org.exolab.castor.xml.validators.IdValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.IdValidator();
+ fieldValidator.setValidator(typeValidator);
}
+ desc.setValidator(fieldValidator);
+ // -- initialize element descriptors
+ // -- _user
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.String.class, "_user", "User",
+ org.exolab.castor.xml.NodeType.Element);
+ desc.setImmutable(true);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ Entry target = (Entry) object;
+ return target.getUser();
+ }
- //-----------/
- //- Methods -/
- //-----------/
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ Entry target = (Entry) object;
+ target.setUser((java.lang.String) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- /**
- * Method getAccessMode.
- *
- * @return the access mode specified for this class.
- */
- public org.exolab.castor.mapping.AccessMode getAccessMode(
- ) {
+ public java.lang.Object newInstance(java.lang.Object parent) {
return null;
- }
+ }
+ };
+ desc.setHandler(handler);
+ desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
+ desc.setRequired(true);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
- /**
- * Method getIdentity.
- *
- * @return the identity field, null if this class has no
- * identity.
- */
- public org.exolab.castor.mapping.FieldDescriptor getIdentity(
- ) {
- return super.getIdentity();
+ // -- validation code for: _user
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(1);
+ { // -- local scope
+ org.exolab.castor.xml.validators.StringValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.StringValidator();
+ fieldValidator.setValidator(typeValidator);
+ typeValidator.setWhiteSpace("preserve");
}
+ desc.setValidator(fieldValidator);
+ // -- _app
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.String.class, "_app", "App",
+ org.exolab.castor.xml.NodeType.Element);
+ desc.setImmutable(true);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ Entry target = (Entry) object;
+ return target.getApp();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ Entry target = (Entry) object;
+ target.setApp((java.lang.String) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- /**
- * Method getJavaClass.
- *
- * @return the Java class represented by this descriptor.
- */
- public java.lang.Class getJavaClass(
- ) {
- return uk.ac.vamsas.objects.core.Entry.class;
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return null;
+ }
+ };
+ desc.setHandler(handler);
+ desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
+ desc.setRequired(true);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _app
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(1);
+ { // -- local scope
+ org.exolab.castor.xml.validators.StringValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.StringValidator();
+ fieldValidator.setValidator(typeValidator);
+ typeValidator.setWhiteSpace("preserve");
}
+ desc.setValidator(fieldValidator);
+ // -- _action
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.String.class, "_action", "Action",
+ org.exolab.castor.xml.NodeType.Element);
+ desc.setImmutable(true);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ Entry target = (Entry) object;
+ return target.getAction();
+ }
- /**
- * Method getNameSpacePrefix.
- *
- * @return the namespace prefix to use when marshaling as XML.
- */
- public java.lang.String getNameSpacePrefix(
- ) {
- return _nsPrefix;
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ Entry target = (Entry) object;
+ target.setAction((java.lang.String) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return null;
+ }
+ };
+ desc.setHandler(handler);
+ desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
+ desc.setRequired(true);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _action
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(1);
+ { // -- local scope
+ org.exolab.castor.xml.validators.StringValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.StringValidator();
+ fieldValidator.setValidator(typeValidator);
+ typeValidator.setWhiteSpace("preserve");
}
+ desc.setValidator(fieldValidator);
+ // -- _date
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.util.Date.class, "_date", "Date",
+ org.exolab.castor.xml.NodeType.Element);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ Entry target = (Entry) object;
+ return target.getDate();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ Entry target = (Entry) object;
+ target.setDate((java.util.Date) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new java.util.Date();
+ }
+ };
+ handler = new org.exolab.castor.xml.handlers.DateFieldHandler(handler);
+ desc.setImmutable(true);
+ desc.setHandler(handler);
+ desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
+ desc.setRequired(true);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
- /**
- * Method getNameSpaceURI.
- *
- * @return the namespace URI used when marshaling and
- * unmarshaling as XML.
- */
- public java.lang.String getNameSpaceURI(
- ) {
- return _nsURI;
+ // -- validation code for: _date
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(1);
+ { // -- local scope
+ org.exolab.castor.xml.validators.DateTimeValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.DateTimeValidator();
+ fieldValidator.setValidator(typeValidator);
}
+ desc.setValidator(fieldValidator);
+ // -- _propertyList
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ uk.ac.vamsas.objects.core.Property.class, "_propertyList", "property",
+ org.exolab.castor.xml.NodeType.Element);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ Entry target = (Entry) object;
+ return target.getProperty();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ Entry target = (Entry) object;
+ target.addProperty((uk.ac.vamsas.objects.core.Property) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- /**
- * Method getValidator.
- *
- * @return a specific validator for the class described by this
- * ClassDescriptor.
- */
- public org.exolab.castor.xml.TypeValidator getValidator(
- ) {
- return this;
+ public void resetValue(Object object) throws IllegalStateException,
+ IllegalArgumentException {
+ try {
+ Entry target = (Entry) object;
+ target.removeAllProperty();
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new uk.ac.vamsas.objects.core.Property();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
+ desc.setMultivalued(true);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _propertyList
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(0);
+ { // -- local scope
}
+ desc.setValidator(fieldValidator);
+ // -- _paramList
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ uk.ac.vamsas.objects.core.Param.class, "_paramList", "param",
+ org.exolab.castor.xml.NodeType.Element);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ Entry target = (Entry) object;
+ return target.getParam();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ Entry target = (Entry) object;
+ target.addParam((uk.ac.vamsas.objects.core.Param) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
+
+ public void resetValue(Object object) throws IllegalStateException,
+ IllegalArgumentException {
+ try {
+ Entry target = (Entry) object;
+ target.removeAllParam();
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- /**
- * Method getXMLName.
- *
- * @return the XML Name for the Class being described.
- */
- public java.lang.String getXMLName(
- ) {
- return _xmlName;
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new uk.ac.vamsas.objects.core.Param();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
+ desc.setMultivalued(true);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _paramList
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(0);
+ { // -- local scope
}
+ desc.setValidator(fieldValidator);
+ // -- _inputList
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ uk.ac.vamsas.objects.core.Input.class, "_inputList", "input",
+ org.exolab.castor.xml.NodeType.Element);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ Entry target = (Entry) object;
+ return target.getInput();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ Entry target = (Entry) object;
+ target.addInput((uk.ac.vamsas.objects.core.Input) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
+
+ public void resetValue(Object object) throws IllegalStateException,
+ IllegalArgumentException {
+ try {
+ Entry target = (Entry) object;
+ target.removeAllInput();
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new uk.ac.vamsas.objects.core.Input();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
+ desc.setMultivalued(true);
+ addFieldDescriptor(desc);
- /**
- * Method isElementDefinition.
- *
- * @return true if XML schema definition of this Class is that
- * of a global
- * element or element with anonymous type definition.
- */
- public boolean isElementDefinition(
- ) {
- return _elementDefinition;
+ // -- validation code for: _inputList
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(0);
+ { // -- local scope
}
+ desc.setValidator(fieldValidator);
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ * Method getAccessMode.
+ *
+ * @return the access mode specified for this class.
+ */
+ public org.exolab.castor.mapping.AccessMode getAccessMode() {
+ return null;
+ }
+
+ /**
+ * Method getIdentity.
+ *
+ * @return the identity field, null if this class has no identity.
+ */
+ public org.exolab.castor.mapping.FieldDescriptor getIdentity() {
+ return super.getIdentity();
+ }
+
+ /**
+ * Method getJavaClass.
+ *
+ * @return the Java class represented by this descriptor.
+ */
+ public java.lang.Class getJavaClass() {
+ return uk.ac.vamsas.objects.core.Entry.class;
+ }
+
+ /**
+ * Method getNameSpacePrefix.
+ *
+ * @return the namespace prefix to use when marshaling as XML.
+ */
+ public java.lang.String getNameSpacePrefix() {
+ return _nsPrefix;
+ }
+
+ /**
+ * Method getNameSpaceURI.
+ *
+ * @return the namespace URI used when marshaling and unmarshaling as XML.
+ */
+ public java.lang.String getNameSpaceURI() {
+ return _nsURI;
+ }
+
+ /**
+ * Method getValidator.
+ *
+ * @return a specific validator for the class described by this
+ * ClassDescriptor.
+ */
+ public org.exolab.castor.xml.TypeValidator getValidator() {
+ return this;
+ }
+
+ /**
+ * Method getXMLName.
+ *
+ * @return the XML Name for the Class being described.
+ */
+ public java.lang.String getXMLName() {
+ return _xmlName;
+ }
+
+ /**
+ * Method isElementDefinition.
+ *
+ * @return true if XML schema definition of this Class is that of a global
+ * element or element with anonymous type definition.
+ */
+ public boolean isElementDefinition() {
+ return _elementDefinition;
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/descriptors/GlyphDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/GlyphDescriptor.java
index 0d694f0..c171da0 100644
--- a/src/uk/ac/vamsas/objects/core/descriptors/GlyphDescriptor.java
+++ b/src/uk/ac/vamsas/objects/core/descriptors/GlyphDescriptor.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core.descriptors;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import uk.ac.vamsas.objects.core.Glyph;
@@ -18,213 +32,204 @@ import uk.ac.vamsas.objects.core.Glyph;
*
* @version $Revision$ $Date$
*/
-public class GlyphDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl {
-
-
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
- * Field _elementDefinition.
- */
- private boolean _elementDefinition;
-
- /**
- * Field _nsPrefix.
- */
- private java.lang.String _nsPrefix;
-
- /**
- * Field _nsURI.
- */
- private java.lang.String _nsURI;
-
- /**
- * Field _xmlName.
- */
- private java.lang.String _xmlName;
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public GlyphDescriptor() {
- super();
- _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
- _xmlName = "glyph";
- _elementDefinition = true;
- org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
- org.exolab.castor.mapping.FieldHandler handler = null;
- org.exolab.castor.xml.FieldValidator fieldValidator = null;
- //-- _content
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_content", "PCDATA", org.exolab.castor.xml.NodeType.Text);
- desc.setImmutable(true);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- Glyph target = (Glyph) object;
- return target.getContent();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- Glyph target = (Glyph) object;
- target.setContent( (java.lang.String) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return null;
- }
- };
- desc.setHandler(handler);
- addFieldDescriptor(desc);
-
- //-- validation code for: _content
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { //-- local scope
- org.exolab.castor.xml.validators.StringValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.StringValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setWhiteSpace("preserve");
- }
- desc.setValidator(fieldValidator);
- //-- initialize attribute descriptors
-
- //-- _dict
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_dict", "dict", org.exolab.castor.xml.NodeType.Attribute);
- desc.setImmutable(true);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- Glyph target = (Glyph) object;
- return target.getDict();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- Glyph target = (Glyph) object;
- target.setDict( (java.lang.String) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _dict
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { //-- local scope
- org.exolab.castor.xml.validators.StringValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.StringValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setWhiteSpace("preserve");
+public class GlyphDescriptor extends
+ org.exolab.castor.xml.util.XMLClassDescriptorImpl {
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * Field _elementDefinition.
+ */
+ private boolean _elementDefinition;
+
+ /**
+ * Field _nsPrefix.
+ */
+ private java.lang.String _nsPrefix;
+
+ /**
+ * Field _nsURI.
+ */
+ private java.lang.String _nsURI;
+
+ /**
+ * Field _xmlName.
+ */
+ private java.lang.String _xmlName;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public GlyphDescriptor() {
+ super();
+ _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
+ _xmlName = "glyph";
+ _elementDefinition = true;
+ org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
+ org.exolab.castor.mapping.FieldHandler handler = null;
+ org.exolab.castor.xml.FieldValidator fieldValidator = null;
+ // -- _content
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.String.class, "_content", "PCDATA",
+ org.exolab.castor.xml.NodeType.Text);
+ desc.setImmutable(true);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ Glyph target = (Glyph) object;
+ return target.getContent();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ Glyph target = (Glyph) object;
+ target.setContent((java.lang.String) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
- //-- initialize element descriptors
-
- }
-
-
- //-----------/
- //- Methods -/
- //-----------/
+ }
- /**
- * Method getAccessMode.
- *
- * @return the access mode specified for this class.
- */
- public org.exolab.castor.mapping.AccessMode getAccessMode(
- ) {
+ public java.lang.Object newInstance(java.lang.Object parent) {
return null;
+ }
+ };
+ desc.setHandler(handler);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _content
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ { // -- local scope
+ org.exolab.castor.xml.validators.StringValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.StringValidator();
+ fieldValidator.setValidator(typeValidator);
+ typeValidator.setWhiteSpace("preserve");
}
+ desc.setValidator(fieldValidator);
+ // -- initialize attribute descriptors
+
+ // -- _dict
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.String.class, "_dict", "dict",
+ org.exolab.castor.xml.NodeType.Attribute);
+ desc.setImmutable(true);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ Glyph target = (Glyph) object;
+ return target.getDict();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ Glyph target = (Glyph) object;
+ target.setDict((java.lang.String) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- /**
- * Method getIdentity.
- *
- * @return the identity field, null if this class has no
- * identity.
- */
- public org.exolab.castor.mapping.FieldDescriptor getIdentity(
- ) {
- return super.getIdentity();
- }
-
- /**
- * Method getJavaClass.
- *
- * @return the Java class represented by this descriptor.
- */
- public java.lang.Class getJavaClass(
- ) {
- return uk.ac.vamsas.objects.core.Glyph.class;
- }
-
- /**
- * Method getNameSpacePrefix.
- *
- * @return the namespace prefix to use when marshaling as XML.
- */
- public java.lang.String getNameSpacePrefix(
- ) {
- return _nsPrefix;
- }
-
- /**
- * Method getNameSpaceURI.
- *
- * @return the namespace URI used when marshaling and
- * unmarshaling as XML.
- */
- public java.lang.String getNameSpaceURI(
- ) {
- return _nsURI;
- }
-
- /**
- * Method getValidator.
- *
- * @return a specific validator for the class described by this
- * ClassDescriptor.
- */
- public org.exolab.castor.xml.TypeValidator getValidator(
- ) {
- return this;
- }
-
- /**
- * Method getXMLName.
- *
- * @return the XML Name for the Class being described.
- */
- public java.lang.String getXMLName(
- ) {
- return _xmlName;
- }
-
- /**
- * Method isElementDefinition.
- *
- * @return true if XML schema definition of this Class is that
- * of a global
- * element or element with anonymous type definition.
- */
- public boolean isElementDefinition(
- ) {
- return _elementDefinition;
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return null;
+ }
+ };
+ desc.setHandler(handler);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _dict
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ { // -- local scope
+ org.exolab.castor.xml.validators.StringValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.StringValidator();
+ fieldValidator.setValidator(typeValidator);
+ typeValidator.setWhiteSpace("preserve");
}
+ desc.setValidator(fieldValidator);
+ // -- initialize element descriptors
+
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ * Method getAccessMode.
+ *
+ * @return the access mode specified for this class.
+ */
+ public org.exolab.castor.mapping.AccessMode getAccessMode() {
+ return null;
+ }
+
+ /**
+ * Method getIdentity.
+ *
+ * @return the identity field, null if this class has no identity.
+ */
+ public org.exolab.castor.mapping.FieldDescriptor getIdentity() {
+ return super.getIdentity();
+ }
+
+ /**
+ * Method getJavaClass.
+ *
+ * @return the Java class represented by this descriptor.
+ */
+ public java.lang.Class getJavaClass() {
+ return uk.ac.vamsas.objects.core.Glyph.class;
+ }
+
+ /**
+ * Method getNameSpacePrefix.
+ *
+ * @return the namespace prefix to use when marshaling as XML.
+ */
+ public java.lang.String getNameSpacePrefix() {
+ return _nsPrefix;
+ }
+
+ /**
+ * Method getNameSpaceURI.
+ *
+ * @return the namespace URI used when marshaling and unmarshaling as XML.
+ */
+ public java.lang.String getNameSpaceURI() {
+ return _nsURI;
+ }
+
+ /**
+ * Method getValidator.
+ *
+ * @return a specific validator for the class described by this
+ * ClassDescriptor.
+ */
+ public org.exolab.castor.xml.TypeValidator getValidator() {
+ return this;
+ }
+
+ /**
+ * Method getXMLName.
+ *
+ * @return the XML Name for the Class being described.
+ */
+ public java.lang.String getXMLName() {
+ return _xmlName;
+ }
+
+ /**
+ * Method isElementDefinition.
+ *
+ * @return true if XML schema definition of this Class is that of a global
+ * element or element with anonymous type definition.
+ */
+ public boolean isElementDefinition() {
+ return _elementDefinition;
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/descriptors/InputDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/InputDescriptor.java
index 649ff90..17267bb 100644
--- a/src/uk/ac/vamsas/objects/core/descriptors/InputDescriptor.java
+++ b/src/uk/ac/vamsas/objects/core/descriptors/InputDescriptor.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core.descriptors;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import uk.ac.vamsas.objects.core.Input;
@@ -18,226 +32,219 @@ import uk.ac.vamsas.objects.core.Input;
*
* @version $Revision$ $Date$
*/
-public class InputDescriptor extends uk.ac.vamsas.objects.core.descriptors.RangeTypeDescriptor {
-
-
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
- * Field _elementDefinition.
- */
- private boolean _elementDefinition;
-
- /**
- * Field _nsPrefix.
- */
- private java.lang.String _nsPrefix;
-
- /**
- * Field _nsURI.
- */
- private java.lang.String _nsURI;
-
- /**
- * Field _xmlName.
- */
- private java.lang.String _xmlName;
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public InputDescriptor() {
- super();
- setExtendsWithoutFlatten(new uk.ac.vamsas.objects.core.descriptors.RangeTypeDescriptor());
- _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
- _xmlName = "input";
- _elementDefinition = true;
- org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
- org.exolab.castor.mapping.FieldHandler handler = null;
- org.exolab.castor.xml.FieldValidator fieldValidator = null;
- //-- initialize attribute descriptors
-
- //-- _name
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_name", "name", org.exolab.castor.xml.NodeType.Attribute);
- desc.setImmutable(true);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- Input target = (Input) object;
- return target.getName();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- Input target = (Input) object;
- target.setName( (java.lang.String) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setRequired(true);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _name
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(1);
- { //-- local scope
- org.exolab.castor.xml.validators.StringValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.StringValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setWhiteSpace("preserve");
- }
- desc.setValidator(fieldValidator);
- //-- _objRef
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Object.class, "_objRef", "objRef", org.exolab.castor.xml.NodeType.Attribute);
- desc.setReference(true);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- Input target = (Input) object;
- return target.getObjRef();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- Input target = (Input) object;
- target.addObjRef( (java.lang.Object) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException {
- try {
- Input target = (Input) object;
- target.removeAllObjRef();
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new java.lang.Object();
- }
- };
- desc.setMultivalued(true);
- desc.setHandler(handler);
- desc.setMultivalued(true);
- addFieldDescriptor(desc);
-
- //-- validation code for: _objRef
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(0);
- { //-- local scope
- org.exolab.castor.xml.validators.IdRefsValidator typeValidator = new org.exolab.castor.xml.validators.IdRefsValidator();
- fieldValidator.setValidator(typeValidator);
- desc.setValidator(fieldValidator);
+public class InputDescriptor extends
+ uk.ac.vamsas.objects.core.descriptors.RangeTypeDescriptor {
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * Field _elementDefinition.
+ */
+ private boolean _elementDefinition;
+
+ /**
+ * Field _nsPrefix.
+ */
+ private java.lang.String _nsPrefix;
+
+ /**
+ * Field _nsURI.
+ */
+ private java.lang.String _nsURI;
+
+ /**
+ * Field _xmlName.
+ */
+ private java.lang.String _xmlName;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public InputDescriptor() {
+ super();
+ setExtendsWithoutFlatten(new uk.ac.vamsas.objects.core.descriptors.RangeTypeDescriptor());
+ _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
+ _xmlName = "input";
+ _elementDefinition = true;
+ org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
+ org.exolab.castor.mapping.FieldHandler handler = null;
+ org.exolab.castor.xml.FieldValidator fieldValidator = null;
+ // -- initialize attribute descriptors
+
+ // -- _name
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.String.class, "_name", "name",
+ org.exolab.castor.xml.NodeType.Attribute);
+ desc.setImmutable(true);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ Input target = (Input) object;
+ return target.getName();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ Input target = (Input) object;
+ target.setName((java.lang.String) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
- //-- initialize element descriptors
-
- }
-
-
- //-----------/
- //- Methods -/
- //-----------/
+ }
- /**
- * Method getAccessMode.
- *
- * @return the access mode specified for this class.
- */
- public org.exolab.castor.mapping.AccessMode getAccessMode(
- ) {
+ public java.lang.Object newInstance(java.lang.Object parent) {
return null;
+ }
+ };
+ desc.setHandler(handler);
+ desc.setRequired(true);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _name
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(1);
+ { // -- local scope
+ org.exolab.castor.xml.validators.StringValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.StringValidator();
+ fieldValidator.setValidator(typeValidator);
+ typeValidator.setWhiteSpace("preserve");
}
-
- /**
- * Method getIdentity.
- *
- * @return the identity field, null if this class has no
- * identity.
- */
- public org.exolab.castor.mapping.FieldDescriptor getIdentity(
- ) {
- return super.getIdentity();
- }
-
- /**
- * Method getJavaClass.
- *
- * @return the Java class represented by this descriptor.
- */
- public java.lang.Class getJavaClass(
- ) {
- return uk.ac.vamsas.objects.core.Input.class;
- }
-
- /**
- * Method getNameSpacePrefix.
- *
- * @return the namespace prefix to use when marshaling as XML.
- */
- public java.lang.String getNameSpacePrefix(
- ) {
- return _nsPrefix;
- }
-
- /**
- * Method getNameSpaceURI.
- *
- * @return the namespace URI used when marshaling and
- * unmarshaling as XML.
- */
- public java.lang.String getNameSpaceURI(
- ) {
- return _nsURI;
- }
-
- /**
- * Method getValidator.
- *
- * @return a specific validator for the class described by this
- * ClassDescriptor.
- */
- public org.exolab.castor.xml.TypeValidator getValidator(
- ) {
- return this;
- }
-
- /**
- * Method getXMLName.
- *
- * @return the XML Name for the Class being described.
- */
- public java.lang.String getXMLName(
- ) {
- return _xmlName;
- }
-
- /**
- * Method isElementDefinition.
- *
- * @return true if XML schema definition of this Class is that
- * of a global
- * element or element with anonymous type definition.
- */
- public boolean isElementDefinition(
- ) {
- return _elementDefinition;
+ desc.setValidator(fieldValidator);
+ // -- _objRef
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.Object.class, "_objRef", "objRef",
+ org.exolab.castor.xml.NodeType.Attribute);
+ desc.setReference(true);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ Input target = (Input) object;
+ return target.getObjRef();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ Input target = (Input) object;
+ target.addObjRef((java.lang.Object) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
+
+ public void resetValue(Object object) throws IllegalStateException,
+ IllegalArgumentException {
+ try {
+ Input target = (Input) object;
+ target.removeAllObjRef();
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new java.lang.Object();
+ }
+ };
+ desc.setMultivalued(true);
+ desc.setHandler(handler);
+ desc.setMultivalued(true);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _objRef
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(0);
+ { // -- local scope
+ org.exolab.castor.xml.validators.IdRefsValidator typeValidator = new org.exolab.castor.xml.validators.IdRefsValidator();
+ fieldValidator.setValidator(typeValidator);
+ desc.setValidator(fieldValidator);
}
+ desc.setValidator(fieldValidator);
+ // -- initialize element descriptors
+
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ * Method getAccessMode.
+ *
+ * @return the access mode specified for this class.
+ */
+ public org.exolab.castor.mapping.AccessMode getAccessMode() {
+ return null;
+ }
+
+ /**
+ * Method getIdentity.
+ *
+ * @return the identity field, null if this class has no identity.
+ */
+ public org.exolab.castor.mapping.FieldDescriptor getIdentity() {
+ return super.getIdentity();
+ }
+
+ /**
+ * Method getJavaClass.
+ *
+ * @return the Java class represented by this descriptor.
+ */
+ public java.lang.Class getJavaClass() {
+ return uk.ac.vamsas.objects.core.Input.class;
+ }
+
+ /**
+ * Method getNameSpacePrefix.
+ *
+ * @return the namespace prefix to use when marshaling as XML.
+ */
+ public java.lang.String getNameSpacePrefix() {
+ return _nsPrefix;
+ }
+
+ /**
+ * Method getNameSpaceURI.
+ *
+ * @return the namespace URI used when marshaling and unmarshaling as XML.
+ */
+ public java.lang.String getNameSpaceURI() {
+ return _nsURI;
+ }
+
+ /**
+ * Method getValidator.
+ *
+ * @return a specific validator for the class described by this
+ * ClassDescriptor.
+ */
+ public org.exolab.castor.xml.TypeValidator getValidator() {
+ return this;
+ }
+
+ /**
+ * Method getXMLName.
+ *
+ * @return the XML Name for the Class being described.
+ */
+ public java.lang.String getXMLName() {
+ return _xmlName;
+ }
+
+ /**
+ * Method isElementDefinition.
+ *
+ * @return true if XML schema definition of this Class is that of a global
+ * element or element with anonymous type definition.
+ */
+ public boolean isElementDefinition() {
+ return _elementDefinition;
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/descriptors/InstanceDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/InstanceDescriptor.java
index d24131a..a9b62e3 100644
--- a/src/uk/ac/vamsas/objects/core/descriptors/InstanceDescriptor.java
+++ b/src/uk/ac/vamsas/objects/core/descriptors/InstanceDescriptor.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core.descriptors;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import uk.ac.vamsas.objects.core.Instance;
@@ -18,180 +32,169 @@ import uk.ac.vamsas.objects.core.Instance;
*
* @version $Revision$ $Date$
*/
-public class InstanceDescriptor extends uk.ac.vamsas.objects.core.descriptors.AppDataDescriptor {
-
-
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
- * Field _elementDefinition.
- */
- private boolean _elementDefinition;
-
- /**
- * Field _nsPrefix.
- */
- private java.lang.String _nsPrefix;
-
- /**
- * Field _nsURI.
- */
- private java.lang.String _nsURI;
-
- /**
- * Field _xmlName.
- */
- private java.lang.String _xmlName;
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public InstanceDescriptor() {
- super();
- setExtendsWithoutFlatten(new uk.ac.vamsas.objects.core.descriptors.AppDataDescriptor());
- _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
- _xmlName = "Instance";
- _elementDefinition = true;
- org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
- org.exolab.castor.mapping.FieldHandler handler = null;
- org.exolab.castor.xml.FieldValidator fieldValidator = null;
- //-- initialize attribute descriptors
-
- //-- _urn
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_urn", "urn", org.exolab.castor.xml.NodeType.Attribute);
- desc.setImmutable(true);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- Instance target = (Instance) object;
- return target.getUrn();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- Instance target = (Instance) object;
- target.setUrn( (java.lang.String) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setRequired(true);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _urn
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(1);
- { //-- local scope
- org.exolab.castor.xml.validators.StringValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.StringValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setWhiteSpace("preserve");
+public class InstanceDescriptor extends
+ uk.ac.vamsas.objects.core.descriptors.AppDataDescriptor {
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * Field _elementDefinition.
+ */
+ private boolean _elementDefinition;
+
+ /**
+ * Field _nsPrefix.
+ */
+ private java.lang.String _nsPrefix;
+
+ /**
+ * Field _nsURI.
+ */
+ private java.lang.String _nsURI;
+
+ /**
+ * Field _xmlName.
+ */
+ private java.lang.String _xmlName;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public InstanceDescriptor() {
+ super();
+ setExtendsWithoutFlatten(new uk.ac.vamsas.objects.core.descriptors.AppDataDescriptor());
+ _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
+ _xmlName = "Instance";
+ _elementDefinition = true;
+ org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
+ org.exolab.castor.mapping.FieldHandler handler = null;
+ org.exolab.castor.xml.FieldValidator fieldValidator = null;
+ // -- initialize attribute descriptors
+
+ // -- _urn
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.String.class, "_urn", "urn",
+ org.exolab.castor.xml.NodeType.Attribute);
+ desc.setImmutable(true);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ Instance target = (Instance) object;
+ return target.getUrn();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ Instance target = (Instance) object;
+ target.setUrn((java.lang.String) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
- //-- initialize element descriptors
-
- }
+ }
-
- //-----------/
- //- Methods -/
- //-----------/
-
- /**
- * Method getAccessMode.
- *
- * @return the access mode specified for this class.
- */
- public org.exolab.castor.mapping.AccessMode getAccessMode(
- ) {
+ public java.lang.Object newInstance(java.lang.Object parent) {
return null;
+ }
+ };
+ desc.setHandler(handler);
+ desc.setRequired(true);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _urn
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(1);
+ { // -- local scope
+ org.exolab.castor.xml.validators.StringValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.StringValidator();
+ fieldValidator.setValidator(typeValidator);
+ typeValidator.setWhiteSpace("preserve");
}
-
- /**
- * Method getIdentity.
- *
- * @return the identity field, null if this class has no
- * identity.
- */
- public org.exolab.castor.mapping.FieldDescriptor getIdentity(
- ) {
- return super.getIdentity();
- }
-
- /**
- * Method getJavaClass.
- *
- * @return the Java class represented by this descriptor.
- */
- public java.lang.Class getJavaClass(
- ) {
- return uk.ac.vamsas.objects.core.Instance.class;
- }
-
- /**
- * Method getNameSpacePrefix.
- *
- * @return the namespace prefix to use when marshaling as XML.
- */
- public java.lang.String getNameSpacePrefix(
- ) {
- return _nsPrefix;
- }
-
- /**
- * Method getNameSpaceURI.
- *
- * @return the namespace URI used when marshaling and
- * unmarshaling as XML.
- */
- public java.lang.String getNameSpaceURI(
- ) {
- return _nsURI;
- }
-
- /**
- * Method getValidator.
- *
- * @return a specific validator for the class described by this
- * ClassDescriptor.
- */
- public org.exolab.castor.xml.TypeValidator getValidator(
- ) {
- return this;
- }
-
- /**
- * Method getXMLName.
- *
- * @return the XML Name for the Class being described.
- */
- public java.lang.String getXMLName(
- ) {
- return _xmlName;
- }
-
- /**
- * Method isElementDefinition.
- *
- * @return true if XML schema definition of this Class is that
- * of a global
- * element or element with anonymous type definition.
- */
- public boolean isElementDefinition(
- ) {
- return _elementDefinition;
- }
+ desc.setValidator(fieldValidator);
+ // -- initialize element descriptors
+
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ * Method getAccessMode.
+ *
+ * @return the access mode specified for this class.
+ */
+ public org.exolab.castor.mapping.AccessMode getAccessMode() {
+ return null;
+ }
+
+ /**
+ * Method getIdentity.
+ *
+ * @return the identity field, null if this class has no identity.
+ */
+ public org.exolab.castor.mapping.FieldDescriptor getIdentity() {
+ return super.getIdentity();
+ }
+
+ /**
+ * Method getJavaClass.
+ *
+ * @return the Java class represented by this descriptor.
+ */
+ public java.lang.Class getJavaClass() {
+ return uk.ac.vamsas.objects.core.Instance.class;
+ }
+
+ /**
+ * Method getNameSpacePrefix.
+ *
+ * @return the namespace prefix to use when marshaling as XML.
+ */
+ public java.lang.String getNameSpacePrefix() {
+ return _nsPrefix;
+ }
+
+ /**
+ * Method getNameSpaceURI.
+ *
+ * @return the namespace URI used when marshaling and unmarshaling as XML.
+ */
+ public java.lang.String getNameSpaceURI() {
+ return _nsURI;
+ }
+
+ /**
+ * Method getValidator.
+ *
+ * @return a specific validator for the class described by this
+ * ClassDescriptor.
+ */
+ public org.exolab.castor.xml.TypeValidator getValidator() {
+ return this;
+ }
+
+ /**
+ * Method getXMLName.
+ *
+ * @return the XML Name for the Class being described.
+ */
+ public java.lang.String getXMLName() {
+ return _xmlName;
+ }
+
+ /**
+ * Method isElementDefinition.
+ *
+ * @return true if XML schema definition of this Class is that of a global
+ * element or element with anonymous type definition.
+ */
+ public boolean isElementDefinition() {
+ return _elementDefinition;
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/descriptors/LinkDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/LinkDescriptor.java
index e8c70a5..fde0663 100644
--- a/src/uk/ac/vamsas/objects/core/descriptors/LinkDescriptor.java
+++ b/src/uk/ac/vamsas/objects/core/descriptors/LinkDescriptor.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core.descriptors;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import uk.ac.vamsas.objects.core.Link;
@@ -18,208 +32,199 @@ import uk.ac.vamsas.objects.core.Link;
*
* @version $Revision$ $Date$
*/
-public class LinkDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl {
-
-
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
- * Field _elementDefinition.
- */
- private boolean _elementDefinition;
-
- /**
- * Field _nsPrefix.
- */
- private java.lang.String _nsPrefix;
-
- /**
- * Field _nsURI.
- */
- private java.lang.String _nsURI;
-
- /**
- * Field _xmlName.
- */
- private java.lang.String _xmlName;
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public LinkDescriptor() {
- super();
- _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
- _xmlName = "link";
- _elementDefinition = true;
- org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
- org.exolab.castor.mapping.FieldHandler handler = null;
- org.exolab.castor.xml.FieldValidator fieldValidator = null;
- //-- _content
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_content", "PCDATA", org.exolab.castor.xml.NodeType.Text);
- desc.setImmutable(true);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- Link target = (Link) object;
- return target.getContent();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- Link target = (Link) object;
- target.setContent( (java.lang.String) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return null;
- }
- };
- desc.setHandler(handler);
- addFieldDescriptor(desc);
-
- //-- validation code for: _content
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { //-- local scope
- org.exolab.castor.xml.validators.StringValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.StringValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setWhiteSpace("preserve");
- }
- desc.setValidator(fieldValidator);
- //-- initialize attribute descriptors
-
- //-- _href
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_href", "href", org.exolab.castor.xml.NodeType.Attribute);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- Link target = (Link) object;
- return target.getHref();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- Link target = (Link) object;
- target.setHref( (java.lang.String) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new java.lang.String();
- }
- };
- desc.setHandler(handler);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _href
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { //-- local scope
+public class LinkDescriptor extends
+ org.exolab.castor.xml.util.XMLClassDescriptorImpl {
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * Field _elementDefinition.
+ */
+ private boolean _elementDefinition;
+
+ /**
+ * Field _nsPrefix.
+ */
+ private java.lang.String _nsPrefix;
+
+ /**
+ * Field _nsURI.
+ */
+ private java.lang.String _nsURI;
+
+ /**
+ * Field _xmlName.
+ */
+ private java.lang.String _xmlName;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public LinkDescriptor() {
+ super();
+ _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
+ _xmlName = "link";
+ _elementDefinition = true;
+ org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
+ org.exolab.castor.mapping.FieldHandler handler = null;
+ org.exolab.castor.xml.FieldValidator fieldValidator = null;
+ // -- _content
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.String.class, "_content", "PCDATA",
+ org.exolab.castor.xml.NodeType.Text);
+ desc.setImmutable(true);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ Link target = (Link) object;
+ return target.getContent();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ Link target = (Link) object;
+ target.setContent((java.lang.String) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
- //-- initialize element descriptors
-
- }
-
-
- //-----------/
- //- Methods -/
- //-----------/
+ }
- /**
- * Method getAccessMode.
- *
- * @return the access mode specified for this class.
- */
- public org.exolab.castor.mapping.AccessMode getAccessMode(
- ) {
+ public java.lang.Object newInstance(java.lang.Object parent) {
return null;
+ }
+ };
+ desc.setHandler(handler);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _content
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ { // -- local scope
+ org.exolab.castor.xml.validators.StringValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.StringValidator();
+ fieldValidator.setValidator(typeValidator);
+ typeValidator.setWhiteSpace("preserve");
}
-
- /**
- * Method getIdentity.
- *
- * @return the identity field, null if this class has no
- * identity.
- */
- public org.exolab.castor.mapping.FieldDescriptor getIdentity(
- ) {
- return super.getIdentity();
- }
-
- /**
- * Method getJavaClass.
- *
- * @return the Java class represented by this descriptor.
- */
- public java.lang.Class getJavaClass(
- ) {
- return uk.ac.vamsas.objects.core.Link.class;
- }
-
- /**
- * Method getNameSpacePrefix.
- *
- * @return the namespace prefix to use when marshaling as XML.
- */
- public java.lang.String getNameSpacePrefix(
- ) {
- return _nsPrefix;
- }
-
- /**
- * Method getNameSpaceURI.
- *
- * @return the namespace URI used when marshaling and
- * unmarshaling as XML.
- */
- public java.lang.String getNameSpaceURI(
- ) {
- return _nsURI;
- }
-
- /**
- * Method getValidator.
- *
- * @return a specific validator for the class described by this
- * ClassDescriptor.
- */
- public org.exolab.castor.xml.TypeValidator getValidator(
- ) {
- return this;
- }
-
- /**
- * Method getXMLName.
- *
- * @return the XML Name for the Class being described.
- */
- public java.lang.String getXMLName(
- ) {
- return _xmlName;
- }
-
- /**
- * Method isElementDefinition.
- *
- * @return true if XML schema definition of this Class is that
- * of a global
- * element or element with anonymous type definition.
- */
- public boolean isElementDefinition(
- ) {
- return _elementDefinition;
+ desc.setValidator(fieldValidator);
+ // -- initialize attribute descriptors
+
+ // -- _href
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.String.class, "_href", "href",
+ org.exolab.castor.xml.NodeType.Attribute);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ Link target = (Link) object;
+ return target.getHref();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ Link target = (Link) object;
+ target.setHref((java.lang.String) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new java.lang.String();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _href
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ { // -- local scope
}
+ desc.setValidator(fieldValidator);
+ // -- initialize element descriptors
+
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ * Method getAccessMode.
+ *
+ * @return the access mode specified for this class.
+ */
+ public org.exolab.castor.mapping.AccessMode getAccessMode() {
+ return null;
+ }
+
+ /**
+ * Method getIdentity.
+ *
+ * @return the identity field, null if this class has no identity.
+ */
+ public org.exolab.castor.mapping.FieldDescriptor getIdentity() {
+ return super.getIdentity();
+ }
+
+ /**
+ * Method getJavaClass.
+ *
+ * @return the Java class represented by this descriptor.
+ */
+ public java.lang.Class getJavaClass() {
+ return uk.ac.vamsas.objects.core.Link.class;
+ }
+
+ /**
+ * Method getNameSpacePrefix.
+ *
+ * @return the namespace prefix to use when marshaling as XML.
+ */
+ public java.lang.String getNameSpacePrefix() {
+ return _nsPrefix;
+ }
+
+ /**
+ * Method getNameSpaceURI.
+ *
+ * @return the namespace URI used when marshaling and unmarshaling as XML.
+ */
+ public java.lang.String getNameSpaceURI() {
+ return _nsURI;
+ }
+
+ /**
+ * Method getValidator.
+ *
+ * @return a specific validator for the class described by this
+ * ClassDescriptor.
+ */
+ public org.exolab.castor.xml.TypeValidator getValidator() {
+ return this;
+ }
+
+ /**
+ * Method getXMLName.
+ *
+ * @return the XML Name for the Class being described.
+ */
+ public java.lang.String getXMLName() {
+ return _xmlName;
+ }
+
+ /**
+ * Method isElementDefinition.
+ *
+ * @return true if XML schema definition of this Class is that of a global
+ * element or element with anonymous type definition.
+ */
+ public boolean isElementDefinition() {
+ return _elementDefinition;
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/descriptors/LocalDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/LocalDescriptor.java
index 409177c..d172d0b 100644
--- a/src/uk/ac/vamsas/objects/core/descriptors/LocalDescriptor.java
+++ b/src/uk/ac/vamsas/objects/core/descriptors/LocalDescriptor.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core.descriptors;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import uk.ac.vamsas.objects.core.Local;
@@ -18,134 +32,121 @@ import uk.ac.vamsas.objects.core.Local;
*
* @version $Revision$ $Date$
*/
-public class LocalDescriptor extends uk.ac.vamsas.objects.core.descriptors.MapRangeTypeDescriptor {
-
-
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
- * Field _elementDefinition.
- */
- private boolean _elementDefinition;
-
- /**
- * Field _nsPrefix.
- */
- private java.lang.String _nsPrefix;
-
- /**
- * Field _nsURI.
- */
- private java.lang.String _nsURI;
-
- /**
- * Field _xmlName.
- */
- private java.lang.String _xmlName;
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public LocalDescriptor() {
- super();
- setExtendsWithoutFlatten(new uk.ac.vamsas.objects.core.descriptors.MapRangeTypeDescriptor());
- _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
- _xmlName = "local";
- _elementDefinition = true;
- }
-
-
- //-----------/
- //- Methods -/
- //-----------/
-
- /**
- * Method getAccessMode.
- *
- * @return the access mode specified for this class.
- */
- public org.exolab.castor.mapping.AccessMode getAccessMode(
- ) {
- return null;
- }
-
- /**
- * Method getIdentity.
- *
- * @return the identity field, null if this class has no
- * identity.
- */
- public org.exolab.castor.mapping.FieldDescriptor getIdentity(
- ) {
- return super.getIdentity();
- }
-
- /**
- * Method getJavaClass.
- *
- * @return the Java class represented by this descriptor.
- */
- public java.lang.Class getJavaClass(
- ) {
- return uk.ac.vamsas.objects.core.Local.class;
- }
-
- /**
- * Method getNameSpacePrefix.
- *
- * @return the namespace prefix to use when marshaling as XML.
- */
- public java.lang.String getNameSpacePrefix(
- ) {
- return _nsPrefix;
- }
-
- /**
- * Method getNameSpaceURI.
- *
- * @return the namespace URI used when marshaling and
- * unmarshaling as XML.
- */
- public java.lang.String getNameSpaceURI(
- ) {
- return _nsURI;
- }
-
- /**
- * Method getValidator.
- *
- * @return a specific validator for the class described by this
- * ClassDescriptor.
- */
- public org.exolab.castor.xml.TypeValidator getValidator(
- ) {
- return this;
- }
-
- /**
- * Method getXMLName.
- *
- * @return the XML Name for the Class being described.
- */
- public java.lang.String getXMLName(
- ) {
- return _xmlName;
- }
-
- /**
- * Method isElementDefinition.
- *
- * @return true if XML schema definition of this Class is that
- * of a global
- * element or element with anonymous type definition.
- */
- public boolean isElementDefinition(
- ) {
- return _elementDefinition;
- }
+public class LocalDescriptor extends
+ uk.ac.vamsas.objects.core.descriptors.MapRangeTypeDescriptor {
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * Field _elementDefinition.
+ */
+ private boolean _elementDefinition;
+
+ /**
+ * Field _nsPrefix.
+ */
+ private java.lang.String _nsPrefix;
+
+ /**
+ * Field _nsURI.
+ */
+ private java.lang.String _nsURI;
+
+ /**
+ * Field _xmlName.
+ */
+ private java.lang.String _xmlName;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public LocalDescriptor() {
+ super();
+ setExtendsWithoutFlatten(new uk.ac.vamsas.objects.core.descriptors.MapRangeTypeDescriptor());
+ _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
+ _xmlName = "local";
+ _elementDefinition = true;
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ * Method getAccessMode.
+ *
+ * @return the access mode specified for this class.
+ */
+ public org.exolab.castor.mapping.AccessMode getAccessMode() {
+ return null;
+ }
+
+ /**
+ * Method getIdentity.
+ *
+ * @return the identity field, null if this class has no identity.
+ */
+ public org.exolab.castor.mapping.FieldDescriptor getIdentity() {
+ return super.getIdentity();
+ }
+
+ /**
+ * Method getJavaClass.
+ *
+ * @return the Java class represented by this descriptor.
+ */
+ public java.lang.Class getJavaClass() {
+ return uk.ac.vamsas.objects.core.Local.class;
+ }
+
+ /**
+ * Method getNameSpacePrefix.
+ *
+ * @return the namespace prefix to use when marshaling as XML.
+ */
+ public java.lang.String getNameSpacePrefix() {
+ return _nsPrefix;
+ }
+
+ /**
+ * Method getNameSpaceURI.
+ *
+ * @return the namespace URI used when marshaling and unmarshaling as XML.
+ */
+ public java.lang.String getNameSpaceURI() {
+ return _nsURI;
+ }
+
+ /**
+ * Method getValidator.
+ *
+ * @return a specific validator for the class described by this
+ * ClassDescriptor.
+ */
+ public org.exolab.castor.xml.TypeValidator getValidator() {
+ return this;
+ }
+
+ /**
+ * Method getXMLName.
+ *
+ * @return the XML Name for the Class being described.
+ */
+ public java.lang.String getXMLName() {
+ return _xmlName;
+ }
+
+ /**
+ * Method isElementDefinition.
+ *
+ * @return true if XML schema definition of this Class is that of a global
+ * element or element with anonymous type definition.
+ */
+ public boolean isElementDefinition() {
+ return _elementDefinition;
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/descriptors/LockFileDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/LockFileDescriptor.java
index 26cd7cc..d073c6d 100644
--- a/src/uk/ac/vamsas/objects/core/descriptors/LockFileDescriptor.java
+++ b/src/uk/ac/vamsas/objects/core/descriptors/LockFileDescriptor.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core.descriptors;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import uk.ac.vamsas.objects.core.LockFile;
@@ -18,176 +32,165 @@ import uk.ac.vamsas.objects.core.LockFile;
*
* @version $Revision$ $Date$
*/
-public class LockFileDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl {
-
-
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
- * Field _elementDefinition.
- */
- private boolean _elementDefinition;
-
- /**
- * Field _nsPrefix.
- */
- private java.lang.String _nsPrefix;
-
- /**
- * Field _nsURI.
- */
- private java.lang.String _nsURI;
-
- /**
- * Field _xmlName.
- */
- private java.lang.String _xmlName;
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public LockFileDescriptor() {
- super();
- _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasDocument";
- _xmlName = "LockFile";
- _elementDefinition = true;
- org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
- org.exolab.castor.mapping.FieldHandler handler = null;
- org.exolab.castor.xml.FieldValidator fieldValidator = null;
- //-- _content
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_content", "PCDATA", org.exolab.castor.xml.NodeType.Text);
- desc.setImmutable(true);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- LockFile target = (LockFile) object;
- return target.getContent();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- LockFile target = (LockFile) object;
- target.setContent( (java.lang.String) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return null;
- }
- };
- desc.setHandler(handler);
- addFieldDescriptor(desc);
-
- //-- validation code for: _content
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { //-- local scope
- org.exolab.castor.xml.validators.StringValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.StringValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setWhiteSpace("preserve");
+public class LockFileDescriptor extends
+ org.exolab.castor.xml.util.XMLClassDescriptorImpl {
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * Field _elementDefinition.
+ */
+ private boolean _elementDefinition;
+
+ /**
+ * Field _nsPrefix.
+ */
+ private java.lang.String _nsPrefix;
+
+ /**
+ * Field _nsURI.
+ */
+ private java.lang.String _nsURI;
+
+ /**
+ * Field _xmlName.
+ */
+ private java.lang.String _xmlName;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public LockFileDescriptor() {
+ super();
+ _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasDocument";
+ _xmlName = "LockFile";
+ _elementDefinition = true;
+ org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
+ org.exolab.castor.mapping.FieldHandler handler = null;
+ org.exolab.castor.xml.FieldValidator fieldValidator = null;
+ // -- _content
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.String.class, "_content", "PCDATA",
+ org.exolab.castor.xml.NodeType.Text);
+ desc.setImmutable(true);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ LockFile target = (LockFile) object;
+ return target.getContent();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ LockFile target = (LockFile) object;
+ target.setContent((java.lang.String) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
- //-- initialize attribute descriptors
-
- //-- initialize element descriptors
-
- }
+ }
-
- //-----------/
- //- Methods -/
- //-----------/
-
- /**
- * Method getAccessMode.
- *
- * @return the access mode specified for this class.
- */
- public org.exolab.castor.mapping.AccessMode getAccessMode(
- ) {
+ public java.lang.Object newInstance(java.lang.Object parent) {
return null;
+ }
+ };
+ desc.setHandler(handler);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _content
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ { // -- local scope
+ org.exolab.castor.xml.validators.StringValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.StringValidator();
+ fieldValidator.setValidator(typeValidator);
+ typeValidator.setWhiteSpace("preserve");
}
-
- /**
- * Method getIdentity.
- *
- * @return the identity field, null if this class has no
- * identity.
- */
- public org.exolab.castor.mapping.FieldDescriptor getIdentity(
- ) {
- return super.getIdentity();
- }
-
- /**
- * Method getJavaClass.
- *
- * @return the Java class represented by this descriptor.
- */
- public java.lang.Class getJavaClass(
- ) {
- return uk.ac.vamsas.objects.core.LockFile.class;
- }
-
- /**
- * Method getNameSpacePrefix.
- *
- * @return the namespace prefix to use when marshaling as XML.
- */
- public java.lang.String getNameSpacePrefix(
- ) {
- return _nsPrefix;
- }
-
- /**
- * Method getNameSpaceURI.
- *
- * @return the namespace URI used when marshaling and
- * unmarshaling as XML.
- */
- public java.lang.String getNameSpaceURI(
- ) {
- return _nsURI;
- }
-
- /**
- * Method getValidator.
- *
- * @return a specific validator for the class described by this
- * ClassDescriptor.
- */
- public org.exolab.castor.xml.TypeValidator getValidator(
- ) {
- return this;
- }
-
- /**
- * Method getXMLName.
- *
- * @return the XML Name for the Class being described.
- */
- public java.lang.String getXMLName(
- ) {
- return _xmlName;
- }
-
- /**
- * Method isElementDefinition.
- *
- * @return true if XML schema definition of this Class is that
- * of a global
- * element or element with anonymous type definition.
- */
- public boolean isElementDefinition(
- ) {
- return _elementDefinition;
- }
+ desc.setValidator(fieldValidator);
+ // -- initialize attribute descriptors
+
+ // -- initialize element descriptors
+
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ * Method getAccessMode.
+ *
+ * @return the access mode specified for this class.
+ */
+ public org.exolab.castor.mapping.AccessMode getAccessMode() {
+ return null;
+ }
+
+ /**
+ * Method getIdentity.
+ *
+ * @return the identity field, null if this class has no identity.
+ */
+ public org.exolab.castor.mapping.FieldDescriptor getIdentity() {
+ return super.getIdentity();
+ }
+
+ /**
+ * Method getJavaClass.
+ *
+ * @return the Java class represented by this descriptor.
+ */
+ public java.lang.Class getJavaClass() {
+ return uk.ac.vamsas.objects.core.LockFile.class;
+ }
+
+ /**
+ * Method getNameSpacePrefix.
+ *
+ * @return the namespace prefix to use when marshaling as XML.
+ */
+ public java.lang.String getNameSpacePrefix() {
+ return _nsPrefix;
+ }
+
+ /**
+ * Method getNameSpaceURI.
+ *
+ * @return the namespace URI used when marshaling and unmarshaling as XML.
+ */
+ public java.lang.String getNameSpaceURI() {
+ return _nsURI;
+ }
+
+ /**
+ * Method getValidator.
+ *
+ * @return a specific validator for the class described by this
+ * ClassDescriptor.
+ */
+ public org.exolab.castor.xml.TypeValidator getValidator() {
+ return this;
+ }
+
+ /**
+ * Method getXMLName.
+ *
+ * @return the XML Name for the Class being described.
+ */
+ public java.lang.String getXMLName() {
+ return _xmlName;
+ }
+
+ /**
+ * Method isElementDefinition.
+ *
+ * @return true if XML schema definition of this Class is that of a global
+ * element or element with anonymous type definition.
+ */
+ public boolean isElementDefinition() {
+ return _elementDefinition;
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/descriptors/MapDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/MapDescriptor.java
index 14efb4b..6653ba6 100644
--- a/src/uk/ac/vamsas/objects/core/descriptors/MapDescriptor.java
+++ b/src/uk/ac/vamsas/objects/core/descriptors/MapDescriptor.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core.descriptors;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import uk.ac.vamsas.objects.core.Map;
@@ -18,177 +32,166 @@ import uk.ac.vamsas.objects.core.Map;
*
* @version $Revision$ $Date$
*/
-public class MapDescriptor extends uk.ac.vamsas.objects.core.descriptors.MapTypeDescriptor {
-
-
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
- * Field _elementDefinition.
- */
- private boolean _elementDefinition;
-
- /**
- * Field _nsPrefix.
- */
- private java.lang.String _nsPrefix;
-
- /**
- * Field _nsURI.
- */
- private java.lang.String _nsURI;
-
- /**
- * Field _xmlName.
- */
- private java.lang.String _xmlName;
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public MapDescriptor() {
- super();
- setExtendsWithoutFlatten(new uk.ac.vamsas.objects.core.descriptors.MapTypeDescriptor());
- _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
- _xmlName = "map";
- _elementDefinition = true;
- org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
- org.exolab.castor.mapping.FieldHandler handler = null;
- org.exolab.castor.xml.FieldValidator fieldValidator = null;
- //-- initialize attribute descriptors
-
- //-- _id
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_id", "id", org.exolab.castor.xml.NodeType.Attribute);
- super.setIdentity(desc);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- Map target = (Map) object;
- return target.getId();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- Map target = (Map) object;
- target.setId( (java.lang.String) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new java.lang.String();
- }
- };
- desc.setHandler(handler);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _id
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { //-- local scope
- org.exolab.castor.xml.validators.IdValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.IdValidator();
- fieldValidator.setValidator(typeValidator);
+public class MapDescriptor extends
+ uk.ac.vamsas.objects.core.descriptors.MapTypeDescriptor {
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * Field _elementDefinition.
+ */
+ private boolean _elementDefinition;
+
+ /**
+ * Field _nsPrefix.
+ */
+ private java.lang.String _nsPrefix;
+
+ /**
+ * Field _nsURI.
+ */
+ private java.lang.String _nsURI;
+
+ /**
+ * Field _xmlName.
+ */
+ private java.lang.String _xmlName;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public MapDescriptor() {
+ super();
+ setExtendsWithoutFlatten(new uk.ac.vamsas.objects.core.descriptors.MapTypeDescriptor());
+ _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
+ _xmlName = "map";
+ _elementDefinition = true;
+ org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
+ org.exolab.castor.mapping.FieldHandler handler = null;
+ org.exolab.castor.xml.FieldValidator fieldValidator = null;
+ // -- initialize attribute descriptors
+
+ // -- _id
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.String.class, "_id", "id",
+ org.exolab.castor.xml.NodeType.Attribute);
+ super.setIdentity(desc);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ Map target = (Map) object;
+ return target.getId();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ Map target = (Map) object;
+ target.setId((java.lang.String) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
- //-- initialize element descriptors
-
- }
-
-
- //-----------/
- //- Methods -/
- //-----------/
-
- /**
- * Method getAccessMode.
- *
- * @return the access mode specified for this class.
- */
- public org.exolab.castor.mapping.AccessMode getAccessMode(
- ) {
- return null;
- }
-
- /**
- * Method getIdentity.
- *
- * @return the identity field, null if this class has no
- * identity.
- */
- public org.exolab.castor.mapping.FieldDescriptor getIdentity(
- ) {
- return super.getIdentity();
- }
-
- /**
- * Method getJavaClass.
- *
- * @return the Java class represented by this descriptor.
- */
- public java.lang.Class getJavaClass(
- ) {
- return uk.ac.vamsas.objects.core.Map.class;
- }
-
- /**
- * Method getNameSpacePrefix.
- *
- * @return the namespace prefix to use when marshaling as XML.
- */
- public java.lang.String getNameSpacePrefix(
- ) {
- return _nsPrefix;
- }
-
- /**
- * Method getNameSpaceURI.
- *
- * @return the namespace URI used when marshaling and
- * unmarshaling as XML.
- */
- public java.lang.String getNameSpaceURI(
- ) {
- return _nsURI;
- }
-
- /**
- * Method getValidator.
- *
- * @return a specific validator for the class described by this
- * ClassDescriptor.
- */
- public org.exolab.castor.xml.TypeValidator getValidator(
- ) {
- return this;
- }
-
- /**
- * Method getXMLName.
- *
- * @return the XML Name for the Class being described.
- */
- public java.lang.String getXMLName(
- ) {
- return _xmlName;
- }
-
- /**
- * Method isElementDefinition.
- *
- * @return true if XML schema definition of this Class is that
- * of a global
- * element or element with anonymous type definition.
- */
- public boolean isElementDefinition(
- ) {
- return _elementDefinition;
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new java.lang.String();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _id
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ { // -- local scope
+ org.exolab.castor.xml.validators.IdValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.IdValidator();
+ fieldValidator.setValidator(typeValidator);
}
+ desc.setValidator(fieldValidator);
+ // -- initialize element descriptors
+
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ * Method getAccessMode.
+ *
+ * @return the access mode specified for this class.
+ */
+ public org.exolab.castor.mapping.AccessMode getAccessMode() {
+ return null;
+ }
+
+ /**
+ * Method getIdentity.
+ *
+ * @return the identity field, null if this class has no identity.
+ */
+ public org.exolab.castor.mapping.FieldDescriptor getIdentity() {
+ return super.getIdentity();
+ }
+
+ /**
+ * Method getJavaClass.
+ *
+ * @return the Java class represented by this descriptor.
+ */
+ public java.lang.Class getJavaClass() {
+ return uk.ac.vamsas.objects.core.Map.class;
+ }
+
+ /**
+ * Method getNameSpacePrefix.
+ *
+ * @return the namespace prefix to use when marshaling as XML.
+ */
+ public java.lang.String getNameSpacePrefix() {
+ return _nsPrefix;
+ }
+
+ /**
+ * Method getNameSpaceURI.
+ *
+ * @return the namespace URI used when marshaling and unmarshaling as XML.
+ */
+ public java.lang.String getNameSpaceURI() {
+ return _nsURI;
+ }
+
+ /**
+ * Method getValidator.
+ *
+ * @return a specific validator for the class described by this
+ * ClassDescriptor.
+ */
+ public org.exolab.castor.xml.TypeValidator getValidator() {
+ return this;
+ }
+
+ /**
+ * Method getXMLName.
+ *
+ * @return the XML Name for the Class being described.
+ */
+ public java.lang.String getXMLName() {
+ return _xmlName;
+ }
+
+ /**
+ * Method isElementDefinition.
+ *
+ * @return true if XML schema definition of this Class is that of a global
+ * element or element with anonymous type definition.
+ */
+ public boolean isElementDefinition() {
+ return _elementDefinition;
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/descriptors/MapListDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/MapListDescriptor.java
index 542a713..08b1b2f 100644
--- a/src/uk/ac/vamsas/objects/core/descriptors/MapListDescriptor.java
+++ b/src/uk/ac/vamsas/objects/core/descriptors/MapListDescriptor.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core.descriptors;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import uk.ac.vamsas.objects.core.MapList;
@@ -18,309 +32,316 @@ import uk.ac.vamsas.objects.core.MapList;
*
* @version $Revision$ $Date$
*/
-public class MapListDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl {
-
-
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
- * Field _elementDefinition.
- */
- private boolean _elementDefinition;
-
- /**
- * Field _nsPrefix.
- */
- private java.lang.String _nsPrefix;
-
- /**
- * Field _nsURI.
- */
- private java.lang.String _nsURI;
-
- /**
- * Field _xmlName.
- */
- private java.lang.String _xmlName;
-
- /**
- * Field _identity.
- */
- private org.exolab.castor.xml.XMLFieldDescriptor _identity;
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public MapListDescriptor() {
- super();
- _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
- _xmlName = "mapList";
- _elementDefinition = false;
- org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
- org.exolab.castor.mapping.FieldHandler handler = null;
- org.exolab.castor.xml.FieldValidator fieldValidator = null;
- //-- initialize attribute descriptors
-
- //-- _from
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Long.TYPE, "_from", "from", org.exolab.castor.xml.NodeType.Attribute);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- MapList target = (MapList) object;
- if (!target.hasFrom()) { return null; }
- return new java.lang.Long(target.getFrom());
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- MapList target = (MapList) object;
- // if null, use delete method for optional primitives
- if (value == null) {
- target.deleteFrom();
- return;
- }
- target.setFrom( ((java.lang.Long) value).longValue());
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _from
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { //-- local scope
- org.exolab.castor.xml.validators.LongValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.LongValidator();
- fieldValidator.setValidator(typeValidator);
+public class MapListDescriptor extends
+ org.exolab.castor.xml.util.XMLClassDescriptorImpl {
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * Field _elementDefinition.
+ */
+ private boolean _elementDefinition;
+
+ /**
+ * Field _nsPrefix.
+ */
+ private java.lang.String _nsPrefix;
+
+ /**
+ * Field _nsURI.
+ */
+ private java.lang.String _nsURI;
+
+ /**
+ * Field _xmlName.
+ */
+ private java.lang.String _xmlName;
+
+ /**
+ * Field _identity.
+ */
+ private org.exolab.castor.xml.XMLFieldDescriptor _identity;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public MapListDescriptor() {
+ super();
+ _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
+ _xmlName = "mapList";
+ _elementDefinition = false;
+ org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
+ org.exolab.castor.mapping.FieldHandler handler = null;
+ org.exolab.castor.xml.FieldValidator fieldValidator = null;
+ // -- initialize attribute descriptors
+
+ // -- _from
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.Long.TYPE, "_from", "from",
+ org.exolab.castor.xml.NodeType.Attribute);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ MapList target = (MapList) object;
+ if (!target.hasFrom()) {
+ return null;
}
- desc.setValidator(fieldValidator);
- //-- _to
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Long.TYPE, "_to", "to", org.exolab.castor.xml.NodeType.Attribute);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- MapList target = (MapList) object;
- if (!target.hasTo()) { return null; }
- return new java.lang.Long(target.getTo());
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- MapList target = (MapList) object;
- // if null, use delete method for optional primitives
- if (value == null) {
- target.deleteTo();
- return;
- }
- target.setTo( ((java.lang.Long) value).longValue());
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _to
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { //-- local scope
- org.exolab.castor.xml.validators.LongValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.LongValidator();
- fieldValidator.setValidator(typeValidator);
+ return new java.lang.Long(target.getFrom());
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ MapList target = (MapList) object;
+ // if null, use delete method for optional primitives
+ if (value == null) {
+ target.deleteFrom();
+ return;
+ }
+ target.setFrom(((java.lang.Long) value).longValue());
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
- //-- _start
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Long.TYPE, "_start", "start", org.exolab.castor.xml.NodeType.Attribute);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- MapList target = (MapList) object;
- if (!target.hasStart()) { return null; }
- return new java.lang.Long(target.getStart());
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- MapList target = (MapList) object;
- // ignore null values for non optional primitives
- if (value == null) { return; }
-
- target.setStart( ((java.lang.Long) value).longValue());
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setRequired(true);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _start
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(1);
- { //-- local scope
- org.exolab.castor.xml.validators.LongValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.LongValidator();
- fieldValidator.setValidator(typeValidator);
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return null;
+ }
+ };
+ desc.setHandler(handler);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _from
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ { // -- local scope
+ org.exolab.castor.xml.validators.LongValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.LongValidator();
+ fieldValidator.setValidator(typeValidator);
+ }
+ desc.setValidator(fieldValidator);
+ // -- _to
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.Long.TYPE, "_to", "to",
+ org.exolab.castor.xml.NodeType.Attribute);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ MapList target = (MapList) object;
+ if (!target.hasTo()) {
+ return null;
}
- desc.setValidator(fieldValidator);
- //-- _end
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Long.TYPE, "_end", "end", org.exolab.castor.xml.NodeType.Attribute);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- MapList target = (MapList) object;
- if (!target.hasEnd()) { return null; }
- return new java.lang.Long(target.getEnd());
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- MapList target = (MapList) object;
- // ignore null values for non optional primitives
- if (value == null) { return; }
-
- target.setEnd( ((java.lang.Long) value).longValue());
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setRequired(true);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _end
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(1);
- { //-- local scope
- org.exolab.castor.xml.validators.LongValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.LongValidator();
- fieldValidator.setValidator(typeValidator);
+ return new java.lang.Long(target.getTo());
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ MapList target = (MapList) object;
+ // if null, use delete method for optional primitives
+ if (value == null) {
+ target.deleteTo();
+ return;
+ }
+ target.setTo(((java.lang.Long) value).longValue());
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
- //-- initialize element descriptors
-
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return null;
+ }
+ };
+ desc.setHandler(handler);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _to
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ { // -- local scope
+ org.exolab.castor.xml.validators.LongValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.LongValidator();
+ fieldValidator.setValidator(typeValidator);
}
+ desc.setValidator(fieldValidator);
+ // -- _start
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.Long.TYPE, "_start", "start",
+ org.exolab.castor.xml.NodeType.Attribute);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ MapList target = (MapList) object;
+ if (!target.hasStart()) {
+ return null;
+ }
+ return new java.lang.Long(target.getStart());
+ }
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ MapList target = (MapList) object;
+ // ignore null values for non optional primitives
+ if (value == null) {
+ return;
+ }
- //-----------/
- //- Methods -/
- //-----------/
+ target.setStart(((java.lang.Long) value).longValue());
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- /**
- * Method getAccessMode.
- *
- * @return the access mode specified for this class.
- */
- public org.exolab.castor.mapping.AccessMode getAccessMode(
- ) {
+ public java.lang.Object newInstance(java.lang.Object parent) {
return null;
- }
+ }
+ };
+ desc.setHandler(handler);
+ desc.setRequired(true);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
- /**
- * Method getIdentity.
- *
- * @return the identity field, null if this class has no
- * identity.
- */
- public org.exolab.castor.mapping.FieldDescriptor getIdentity(
- ) {
- return _identity;
+ // -- validation code for: _start
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(1);
+ { // -- local scope
+ org.exolab.castor.xml.validators.LongValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.LongValidator();
+ fieldValidator.setValidator(typeValidator);
}
+ desc.setValidator(fieldValidator);
+ // -- _end
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.Long.TYPE, "_end", "end",
+ org.exolab.castor.xml.NodeType.Attribute);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ MapList target = (MapList) object;
+ if (!target.hasEnd()) {
+ return null;
+ }
+ return new java.lang.Long(target.getEnd());
+ }
- /**
- * Method getJavaClass.
- *
- * @return the Java class represented by this descriptor.
- */
- public java.lang.Class getJavaClass(
- ) {
- return uk.ac.vamsas.objects.core.MapList.class;
- }
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ MapList target = (MapList) object;
+ // ignore null values for non optional primitives
+ if (value == null) {
+ return;
+ }
- /**
- * Method getNameSpacePrefix.
- *
- * @return the namespace prefix to use when marshaling as XML.
- */
- public java.lang.String getNameSpacePrefix(
- ) {
- return _nsPrefix;
- }
+ target.setEnd(((java.lang.Long) value).longValue());
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- /**
- * Method getNameSpaceURI.
- *
- * @return the namespace URI used when marshaling and
- * unmarshaling as XML.
- */
- public java.lang.String getNameSpaceURI(
- ) {
- return _nsURI;
- }
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return null;
+ }
+ };
+ desc.setHandler(handler);
+ desc.setRequired(true);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
- /**
- * Method getValidator.
- *
- * @return a specific validator for the class described by this
- * ClassDescriptor.
- */
- public org.exolab.castor.xml.TypeValidator getValidator(
- ) {
- return this;
+ // -- validation code for: _end
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(1);
+ { // -- local scope
+ org.exolab.castor.xml.validators.LongValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.LongValidator();
+ fieldValidator.setValidator(typeValidator);
}
+ desc.setValidator(fieldValidator);
+ // -- initialize element descriptors
- /**
- * Method getXMLName.
- *
- * @return the XML Name for the Class being described.
- */
- public java.lang.String getXMLName(
- ) {
- return _xmlName;
- }
+ }
- /**
- * Method isElementDefinition.
- *
- * @return true if XML schema definition of this Class is that
- * of a global
- * element or element with anonymous type definition.
- */
- public boolean isElementDefinition(
- ) {
- return _elementDefinition;
- }
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ * Method getAccessMode.
+ *
+ * @return the access mode specified for this class.
+ */
+ public org.exolab.castor.mapping.AccessMode getAccessMode() {
+ return null;
+ }
+
+ /**
+ * Method getIdentity.
+ *
+ * @return the identity field, null if this class has no identity.
+ */
+ public org.exolab.castor.mapping.FieldDescriptor getIdentity() {
+ return _identity;
+ }
+
+ /**
+ * Method getJavaClass.
+ *
+ * @return the Java class represented by this descriptor.
+ */
+ public java.lang.Class getJavaClass() {
+ return uk.ac.vamsas.objects.core.MapList.class;
+ }
+
+ /**
+ * Method getNameSpacePrefix.
+ *
+ * @return the namespace prefix to use when marshaling as XML.
+ */
+ public java.lang.String getNameSpacePrefix() {
+ return _nsPrefix;
+ }
+
+ /**
+ * Method getNameSpaceURI.
+ *
+ * @return the namespace URI used when marshaling and unmarshaling as XML.
+ */
+ public java.lang.String getNameSpaceURI() {
+ return _nsURI;
+ }
+
+ /**
+ * Method getValidator.
+ *
+ * @return a specific validator for the class described by this
+ * ClassDescriptor.
+ */
+ public org.exolab.castor.xml.TypeValidator getValidator() {
+ return this;
+ }
+
+ /**
+ * Method getXMLName.
+ *
+ * @return the XML Name for the Class being described.
+ */
+ public java.lang.String getXMLName() {
+ return _xmlName;
+ }
+
+ /**
+ * Method isElementDefinition.
+ *
+ * @return true if XML schema definition of this Class is that of a global
+ * element or element with anonymous type definition.
+ */
+ public boolean isElementDefinition() {
+ return _elementDefinition;
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/descriptors/MapRangeTypeDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/MapRangeTypeDescriptor.java
index 174449d..e7af789 100644
--- a/src/uk/ac/vamsas/objects/core/descriptors/MapRangeTypeDescriptor.java
+++ b/src/uk/ac/vamsas/objects/core/descriptors/MapRangeTypeDescriptor.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core.descriptors;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import uk.ac.vamsas.objects.core.MapRangeType;
@@ -18,183 +32,174 @@ import uk.ac.vamsas.objects.core.MapRangeType;
*
* @version $Revision$ $Date$
*/
-public class MapRangeTypeDescriptor extends uk.ac.vamsas.objects.core.descriptors.RangeTypeDescriptor {
-
-
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
- * Field _elementDefinition.
- */
- private boolean _elementDefinition;
-
- /**
- * Field _nsPrefix.
- */
- private java.lang.String _nsPrefix;
-
- /**
- * Field _nsURI.
- */
- private java.lang.String _nsURI;
-
- /**
- * Field _xmlName.
- */
- private java.lang.String _xmlName;
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public MapRangeTypeDescriptor() {
- super();
- setExtendsWithoutFlatten(new uk.ac.vamsas.objects.core.descriptors.RangeTypeDescriptor());
- _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
- _xmlName = "mapRangeType";
- _elementDefinition = false;
- org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
- org.exolab.castor.mapping.FieldHandler handler = null;
- org.exolab.castor.xml.FieldValidator fieldValidator = null;
- //-- initialize attribute descriptors
-
- //-- _unit
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Long.TYPE, "_unit", "unit", org.exolab.castor.xml.NodeType.Attribute);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- MapRangeType target = (MapRangeType) object;
- if (!target.hasUnit()) { return null; }
- return new java.lang.Long(target.getUnit());
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- MapRangeType target = (MapRangeType) object;
- // if null, use delete method for optional primitives
- if (value == null) {
- target.deleteUnit();
- return;
- }
- target.setUnit( ((java.lang.Long) value).longValue());
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _unit
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { //-- local scope
- org.exolab.castor.xml.validators.LongValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.LongValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setMinInclusive(1L);
+public class MapRangeTypeDescriptor extends
+ uk.ac.vamsas.objects.core.descriptors.RangeTypeDescriptor {
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * Field _elementDefinition.
+ */
+ private boolean _elementDefinition;
+
+ /**
+ * Field _nsPrefix.
+ */
+ private java.lang.String _nsPrefix;
+
+ /**
+ * Field _nsURI.
+ */
+ private java.lang.String _nsURI;
+
+ /**
+ * Field _xmlName.
+ */
+ private java.lang.String _xmlName;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public MapRangeTypeDescriptor() {
+ super();
+ setExtendsWithoutFlatten(new uk.ac.vamsas.objects.core.descriptors.RangeTypeDescriptor());
+ _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
+ _xmlName = "mapRangeType";
+ _elementDefinition = false;
+ org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
+ org.exolab.castor.mapping.FieldHandler handler = null;
+ org.exolab.castor.xml.FieldValidator fieldValidator = null;
+ // -- initialize attribute descriptors
+
+ // -- _unit
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.Long.TYPE, "_unit", "unit",
+ org.exolab.castor.xml.NodeType.Attribute);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ MapRangeType target = (MapRangeType) object;
+ if (!target.hasUnit()) {
+ return null;
}
- desc.setValidator(fieldValidator);
- //-- initialize element descriptors
-
- }
-
-
- //-----------/
- //- Methods -/
- //-----------/
+ return new java.lang.Long(target.getUnit());
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ MapRangeType target = (MapRangeType) object;
+ // if null, use delete method for optional primitives
+ if (value == null) {
+ target.deleteUnit();
+ return;
+ }
+ target.setUnit(((java.lang.Long) value).longValue());
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- /**
- * Method getAccessMode.
- *
- * @return the access mode specified for this class.
- */
- public org.exolab.castor.mapping.AccessMode getAccessMode(
- ) {
+ public java.lang.Object newInstance(java.lang.Object parent) {
return null;
+ }
+ };
+ desc.setHandler(handler);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _unit
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ { // -- local scope
+ org.exolab.castor.xml.validators.LongValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.LongValidator();
+ fieldValidator.setValidator(typeValidator);
+ typeValidator.setMinInclusive(1L);
}
-
- /**
- * Method getIdentity.
- *
- * @return the identity field, null if this class has no
- * identity.
- */
- public org.exolab.castor.mapping.FieldDescriptor getIdentity(
- ) {
- return super.getIdentity();
- }
-
- /**
- * Method getJavaClass.
- *
- * @return the Java class represented by this descriptor.
- */
- public java.lang.Class getJavaClass(
- ) {
- return uk.ac.vamsas.objects.core.MapRangeType.class;
- }
-
- /**
- * Method getNameSpacePrefix.
- *
- * @return the namespace prefix to use when marshaling as XML.
- */
- public java.lang.String getNameSpacePrefix(
- ) {
- return _nsPrefix;
- }
-
- /**
- * Method getNameSpaceURI.
- *
- * @return the namespace URI used when marshaling and
- * unmarshaling as XML.
- */
- public java.lang.String getNameSpaceURI(
- ) {
- return _nsURI;
- }
-
- /**
- * Method getValidator.
- *
- * @return a specific validator for the class described by this
- * ClassDescriptor.
- */
- public org.exolab.castor.xml.TypeValidator getValidator(
- ) {
- return this;
- }
-
- /**
- * Method getXMLName.
- *
- * @return the XML Name for the Class being described.
- */
- public java.lang.String getXMLName(
- ) {
- return _xmlName;
- }
-
- /**
- * Method isElementDefinition.
- *
- * @return true if XML schema definition of this Class is that
- * of a global
- * element or element with anonymous type definition.
- */
- public boolean isElementDefinition(
- ) {
- return _elementDefinition;
- }
+ desc.setValidator(fieldValidator);
+ // -- initialize element descriptors
+
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ * Method getAccessMode.
+ *
+ * @return the access mode specified for this class.
+ */
+ public org.exolab.castor.mapping.AccessMode getAccessMode() {
+ return null;
+ }
+
+ /**
+ * Method getIdentity.
+ *
+ * @return the identity field, null if this class has no identity.
+ */
+ public org.exolab.castor.mapping.FieldDescriptor getIdentity() {
+ return super.getIdentity();
+ }
+
+ /**
+ * Method getJavaClass.
+ *
+ * @return the Java class represented by this descriptor.
+ */
+ public java.lang.Class getJavaClass() {
+ return uk.ac.vamsas.objects.core.MapRangeType.class;
+ }
+
+ /**
+ * Method getNameSpacePrefix.
+ *
+ * @return the namespace prefix to use when marshaling as XML.
+ */
+ public java.lang.String getNameSpacePrefix() {
+ return _nsPrefix;
+ }
+
+ /**
+ * Method getNameSpaceURI.
+ *
+ * @return the namespace URI used when marshaling and unmarshaling as XML.
+ */
+ public java.lang.String getNameSpaceURI() {
+ return _nsURI;
+ }
+
+ /**
+ * Method getValidator.
+ *
+ * @return a specific validator for the class described by this
+ * ClassDescriptor.
+ */
+ public org.exolab.castor.xml.TypeValidator getValidator() {
+ return this;
+ }
+
+ /**
+ * Method getXMLName.
+ *
+ * @return the XML Name for the Class being described.
+ */
+ public java.lang.String getXMLName() {
+ return _xmlName;
+ }
+
+ /**
+ * Method isElementDefinition.
+ *
+ * @return true if XML schema definition of this Class is that of a global
+ * element or element with anonymous type definition.
+ */
+ public boolean isElementDefinition() {
+ return _elementDefinition;
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/descriptors/MapTypeDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/MapTypeDescriptor.java
index 39ee736..a6abd90 100644
--- a/src/uk/ac/vamsas/objects/core/descriptors/MapTypeDescriptor.java
+++ b/src/uk/ac/vamsas/objects/core/descriptors/MapTypeDescriptor.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core.descriptors;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import uk.ac.vamsas.objects.core.MapType;
@@ -18,213 +32,204 @@ import uk.ac.vamsas.objects.core.MapType;
*
* @version $Revision$ $Date$
*/
-public class MapTypeDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl {
-
-
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
- * Field _elementDefinition.
- */
- private boolean _elementDefinition;
-
- /**
- * Field _nsPrefix.
- */
- private java.lang.String _nsPrefix;
-
- /**
- * Field _nsURI.
- */
- private java.lang.String _nsURI;
-
- /**
- * Field _xmlName.
- */
- private java.lang.String _xmlName;
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public MapTypeDescriptor() {
- super();
- _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
- _xmlName = "mapType";
- _elementDefinition = false;
-
- //-- set grouping compositor
- setCompositorAsSequence();
- org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
- org.exolab.castor.mapping.FieldHandler handler = null;
- org.exolab.castor.xml.FieldValidator fieldValidator = null;
- //-- initialize attribute descriptors
-
- //-- initialize element descriptors
-
- //-- _local
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Local.class, "_local", "local", org.exolab.castor.xml.NodeType.Element);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- MapType target = (MapType) object;
- return target.getLocal();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- MapType target = (MapType) object;
- target.setLocal( (uk.ac.vamsas.objects.core.Local) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new uk.ac.vamsas.objects.core.Local();
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
- desc.setRequired(true);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _local
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(1);
- { //-- local scope
- }
- desc.setValidator(fieldValidator);
- //-- _mapped
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Mapped.class, "_mapped", "mapped", org.exolab.castor.xml.NodeType.Element);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- MapType target = (MapType) object;
- return target.getMapped();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- MapType target = (MapType) object;
- target.setMapped( (uk.ac.vamsas.objects.core.Mapped) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new uk.ac.vamsas.objects.core.Mapped();
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
- desc.setRequired(true);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _mapped
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(1);
- { //-- local scope
+public class MapTypeDescriptor extends
+ org.exolab.castor.xml.util.XMLClassDescriptorImpl {
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * Field _elementDefinition.
+ */
+ private boolean _elementDefinition;
+
+ /**
+ * Field _nsPrefix.
+ */
+ private java.lang.String _nsPrefix;
+
+ /**
+ * Field _nsURI.
+ */
+ private java.lang.String _nsURI;
+
+ /**
+ * Field _xmlName.
+ */
+ private java.lang.String _xmlName;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public MapTypeDescriptor() {
+ super();
+ _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
+ _xmlName = "mapType";
+ _elementDefinition = false;
+
+ // -- set grouping compositor
+ setCompositorAsSequence();
+ org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
+ org.exolab.castor.mapping.FieldHandler handler = null;
+ org.exolab.castor.xml.FieldValidator fieldValidator = null;
+ // -- initialize attribute descriptors
+
+ // -- initialize element descriptors
+
+ // -- _local
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ uk.ac.vamsas.objects.core.Local.class, "_local", "local",
+ org.exolab.castor.xml.NodeType.Element);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ MapType target = (MapType) object;
+ return target.getLocal();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ MapType target = (MapType) object;
+ target.setLocal((uk.ac.vamsas.objects.core.Local) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
- }
-
-
- //-----------/
- //- Methods -/
- //-----------/
-
- /**
- * Method getAccessMode.
- *
- * @return the access mode specified for this class.
- */
- public org.exolab.castor.mapping.AccessMode getAccessMode(
- ) {
- return null;
- }
-
- /**
- * Method getIdentity.
- *
- * @return the identity field, null if this class has no
- * identity.
- */
- public org.exolab.castor.mapping.FieldDescriptor getIdentity(
- ) {
- return super.getIdentity();
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new uk.ac.vamsas.objects.core.Local();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
+ desc.setRequired(true);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _local
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(1);
+ { // -- local scope
}
-
- /**
- * Method getJavaClass.
- *
- * @return the Java class represented by this descriptor.
- */
- public java.lang.Class getJavaClass(
- ) {
- return uk.ac.vamsas.objects.core.MapType.class;
- }
-
- /**
- * Method getNameSpacePrefix.
- *
- * @return the namespace prefix to use when marshaling as XML.
- */
- public java.lang.String getNameSpacePrefix(
- ) {
- return _nsPrefix;
- }
-
- /**
- * Method getNameSpaceURI.
- *
- * @return the namespace URI used when marshaling and
- * unmarshaling as XML.
- */
- public java.lang.String getNameSpaceURI(
- ) {
- return _nsURI;
- }
-
- /**
- * Method getValidator.
- *
- * @return a specific validator for the class described by this
- * ClassDescriptor.
- */
- public org.exolab.castor.xml.TypeValidator getValidator(
- ) {
- return this;
- }
-
- /**
- * Method getXMLName.
- *
- * @return the XML Name for the Class being described.
- */
- public java.lang.String getXMLName(
- ) {
- return _xmlName;
- }
-
- /**
- * Method isElementDefinition.
- *
- * @return true if XML schema definition of this Class is that
- * of a global
- * element or element with anonymous type definition.
- */
- public boolean isElementDefinition(
- ) {
- return _elementDefinition;
+ desc.setValidator(fieldValidator);
+ // -- _mapped
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ uk.ac.vamsas.objects.core.Mapped.class, "_mapped", "mapped",
+ org.exolab.castor.xml.NodeType.Element);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ MapType target = (MapType) object;
+ return target.getMapped();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ MapType target = (MapType) object;
+ target.setMapped((uk.ac.vamsas.objects.core.Mapped) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new uk.ac.vamsas.objects.core.Mapped();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
+ desc.setRequired(true);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _mapped
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(1);
+ { // -- local scope
}
+ desc.setValidator(fieldValidator);
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ * Method getAccessMode.
+ *
+ * @return the access mode specified for this class.
+ */
+ public org.exolab.castor.mapping.AccessMode getAccessMode() {
+ return null;
+ }
+
+ /**
+ * Method getIdentity.
+ *
+ * @return the identity field, null if this class has no identity.
+ */
+ public org.exolab.castor.mapping.FieldDescriptor getIdentity() {
+ return super.getIdentity();
+ }
+
+ /**
+ * Method getJavaClass.
+ *
+ * @return the Java class represented by this descriptor.
+ */
+ public java.lang.Class getJavaClass() {
+ return uk.ac.vamsas.objects.core.MapType.class;
+ }
+
+ /**
+ * Method getNameSpacePrefix.
+ *
+ * @return the namespace prefix to use when marshaling as XML.
+ */
+ public java.lang.String getNameSpacePrefix() {
+ return _nsPrefix;
+ }
+
+ /**
+ * Method getNameSpaceURI.
+ *
+ * @return the namespace URI used when marshaling and unmarshaling as XML.
+ */
+ public java.lang.String getNameSpaceURI() {
+ return _nsURI;
+ }
+
+ /**
+ * Method getValidator.
+ *
+ * @return a specific validator for the class described by this
+ * ClassDescriptor.
+ */
+ public org.exolab.castor.xml.TypeValidator getValidator() {
+ return this;
+ }
+
+ /**
+ * Method getXMLName.
+ *
+ * @return the XML Name for the Class being described.
+ */
+ public java.lang.String getXMLName() {
+ return _xmlName;
+ }
+
+ /**
+ * Method isElementDefinition.
+ *
+ * @return true if XML schema definition of this Class is that of a global
+ * element or element with anonymous type definition.
+ */
+ public boolean isElementDefinition() {
+ return _elementDefinition;
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/descriptors/MappedDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/MappedDescriptor.java
index 9162ab5..f5e7d8b 100644
--- a/src/uk/ac/vamsas/objects/core/descriptors/MappedDescriptor.java
+++ b/src/uk/ac/vamsas/objects/core/descriptors/MappedDescriptor.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core.descriptors;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import uk.ac.vamsas.objects.core.Mapped;
@@ -18,134 +32,121 @@ import uk.ac.vamsas.objects.core.Mapped;
*
* @version $Revision$ $Date$
*/
-public class MappedDescriptor extends uk.ac.vamsas.objects.core.descriptors.MapRangeTypeDescriptor {
-
-
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
- * Field _elementDefinition.
- */
- private boolean _elementDefinition;
-
- /**
- * Field _nsPrefix.
- */
- private java.lang.String _nsPrefix;
-
- /**
- * Field _nsURI.
- */
- private java.lang.String _nsURI;
-
- /**
- * Field _xmlName.
- */
- private java.lang.String _xmlName;
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public MappedDescriptor() {
- super();
- setExtendsWithoutFlatten(new uk.ac.vamsas.objects.core.descriptors.MapRangeTypeDescriptor());
- _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
- _xmlName = "mapped";
- _elementDefinition = true;
- }
-
-
- //-----------/
- //- Methods -/
- //-----------/
-
- /**
- * Method getAccessMode.
- *
- * @return the access mode specified for this class.
- */
- public org.exolab.castor.mapping.AccessMode getAccessMode(
- ) {
- return null;
- }
-
- /**
- * Method getIdentity.
- *
- * @return the identity field, null if this class has no
- * identity.
- */
- public org.exolab.castor.mapping.FieldDescriptor getIdentity(
- ) {
- return super.getIdentity();
- }
-
- /**
- * Method getJavaClass.
- *
- * @return the Java class represented by this descriptor.
- */
- public java.lang.Class getJavaClass(
- ) {
- return uk.ac.vamsas.objects.core.Mapped.class;
- }
-
- /**
- * Method getNameSpacePrefix.
- *
- * @return the namespace prefix to use when marshaling as XML.
- */
- public java.lang.String getNameSpacePrefix(
- ) {
- return _nsPrefix;
- }
-
- /**
- * Method getNameSpaceURI.
- *
- * @return the namespace URI used when marshaling and
- * unmarshaling as XML.
- */
- public java.lang.String getNameSpaceURI(
- ) {
- return _nsURI;
- }
-
- /**
- * Method getValidator.
- *
- * @return a specific validator for the class described by this
- * ClassDescriptor.
- */
- public org.exolab.castor.xml.TypeValidator getValidator(
- ) {
- return this;
- }
-
- /**
- * Method getXMLName.
- *
- * @return the XML Name for the Class being described.
- */
- public java.lang.String getXMLName(
- ) {
- return _xmlName;
- }
-
- /**
- * Method isElementDefinition.
- *
- * @return true if XML schema definition of this Class is that
- * of a global
- * element or element with anonymous type definition.
- */
- public boolean isElementDefinition(
- ) {
- return _elementDefinition;
- }
+public class MappedDescriptor extends
+ uk.ac.vamsas.objects.core.descriptors.MapRangeTypeDescriptor {
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * Field _elementDefinition.
+ */
+ private boolean _elementDefinition;
+
+ /**
+ * Field _nsPrefix.
+ */
+ private java.lang.String _nsPrefix;
+
+ /**
+ * Field _nsURI.
+ */
+ private java.lang.String _nsURI;
+
+ /**
+ * Field _xmlName.
+ */
+ private java.lang.String _xmlName;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public MappedDescriptor() {
+ super();
+ setExtendsWithoutFlatten(new uk.ac.vamsas.objects.core.descriptors.MapRangeTypeDescriptor());
+ _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
+ _xmlName = "mapped";
+ _elementDefinition = true;
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ * Method getAccessMode.
+ *
+ * @return the access mode specified for this class.
+ */
+ public org.exolab.castor.mapping.AccessMode getAccessMode() {
+ return null;
+ }
+
+ /**
+ * Method getIdentity.
+ *
+ * @return the identity field, null if this class has no identity.
+ */
+ public org.exolab.castor.mapping.FieldDescriptor getIdentity() {
+ return super.getIdentity();
+ }
+
+ /**
+ * Method getJavaClass.
+ *
+ * @return the Java class represented by this descriptor.
+ */
+ public java.lang.Class getJavaClass() {
+ return uk.ac.vamsas.objects.core.Mapped.class;
+ }
+
+ /**
+ * Method getNameSpacePrefix.
+ *
+ * @return the namespace prefix to use when marshaling as XML.
+ */
+ public java.lang.String getNameSpacePrefix() {
+ return _nsPrefix;
+ }
+
+ /**
+ * Method getNameSpaceURI.
+ *
+ * @return the namespace URI used when marshaling and unmarshaling as XML.
+ */
+ public java.lang.String getNameSpaceURI() {
+ return _nsURI;
+ }
+
+ /**
+ * Method getValidator.
+ *
+ * @return a specific validator for the class described by this
+ * ClassDescriptor.
+ */
+ public org.exolab.castor.xml.TypeValidator getValidator() {
+ return this;
+ }
+
+ /**
+ * Method getXMLName.
+ *
+ * @return the XML Name for the Class being described.
+ */
+ public java.lang.String getXMLName() {
+ return _xmlName;
+ }
+
+ /**
+ * Method isElementDefinition.
+ *
+ * @return true if XML schema definition of this Class is that of a global
+ * element or element with anonymous type definition.
+ */
+ public boolean isElementDefinition() {
+ return _elementDefinition;
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/descriptors/MappingDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/MappingDescriptor.java
index a369678..5105668 100644
--- a/src/uk/ac/vamsas/objects/core/descriptors/MappingDescriptor.java
+++ b/src/uk/ac/vamsas/objects/core/descriptors/MappingDescriptor.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core.descriptors;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import uk.ac.vamsas.objects.core.Mapping;
@@ -18,187 +32,176 @@ import uk.ac.vamsas.objects.core.Mapping;
*
* @version $Revision$ $Date$
*/
-public class MappingDescriptor extends uk.ac.vamsas.objects.core.descriptors.MapListDescriptor {
-
-
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
- * Field _elementDefinition.
- */
- private boolean _elementDefinition;
-
- /**
- * Field _nsPrefix.
- */
- private java.lang.String _nsPrefix;
-
- /**
- * Field _nsURI.
- */
- private java.lang.String _nsURI;
-
- /**
- * Field _xmlName.
- */
- private java.lang.String _xmlName;
-
- /**
- * Field _identity.
- */
- private org.exolab.castor.xml.XMLFieldDescriptor _identity;
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public MappingDescriptor() {
- super();
- setExtendsWithoutFlatten(new uk.ac.vamsas.objects.core.descriptors.MapListDescriptor());
- _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
- _xmlName = "mapping";
- _elementDefinition = true;
- org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
- org.exolab.castor.mapping.FieldHandler handler = null;
- org.exolab.castor.xml.FieldValidator fieldValidator = null;
- //-- initialize attribute descriptors
-
- //-- _onto
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Object.class, "_onto", "onto", org.exolab.castor.xml.NodeType.Attribute);
- desc.setReference(true);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- Mapping target = (Mapping) object;
- return target.getOnto();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- Mapping target = (Mapping) object;
- target.setOnto( (java.lang.Object) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new java.lang.Object();
- }
- };
- desc.setHandler(handler);
- desc.setRequired(true);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _onto
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(1);
- { //-- local scope
- org.exolab.castor.xml.validators.IdRefValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.IdRefValidator();
- fieldValidator.setValidator(typeValidator);
- }
- desc.setValidator(fieldValidator);
- //-- initialize element descriptors
-
- }
-
-
- //-----------/
- //- Methods -/
- //-----------/
-
- /**
- * Method getAccessMode.
- *
- * @return the access mode specified for this class.
- */
- public org.exolab.castor.mapping.AccessMode getAccessMode(
- ) {
- return null;
- }
-
- /**
- * Method getIdentity.
- *
- * @return the identity field, null if this class has no
- * identity.
- */
- public org.exolab.castor.mapping.FieldDescriptor getIdentity(
- ) {
- if (_identity == null) {
- return super.getIdentity();
+public class MappingDescriptor extends
+ uk.ac.vamsas.objects.core.descriptors.MapListDescriptor {
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * Field _elementDefinition.
+ */
+ private boolean _elementDefinition;
+
+ /**
+ * Field _nsPrefix.
+ */
+ private java.lang.String _nsPrefix;
+
+ /**
+ * Field _nsURI.
+ */
+ private java.lang.String _nsURI;
+
+ /**
+ * Field _xmlName.
+ */
+ private java.lang.String _xmlName;
+
+ /**
+ * Field _identity.
+ */
+ private org.exolab.castor.xml.XMLFieldDescriptor _identity;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public MappingDescriptor() {
+ super();
+ setExtendsWithoutFlatten(new uk.ac.vamsas.objects.core.descriptors.MapListDescriptor());
+ _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
+ _xmlName = "mapping";
+ _elementDefinition = true;
+ org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
+ org.exolab.castor.mapping.FieldHandler handler = null;
+ org.exolab.castor.xml.FieldValidator fieldValidator = null;
+ // -- initialize attribute descriptors
+
+ // -- _onto
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.Object.class, "_onto", "onto",
+ org.exolab.castor.xml.NodeType.Attribute);
+ desc.setReference(true);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ Mapping target = (Mapping) object;
+ return target.getOnto();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ Mapping target = (Mapping) object;
+ target.setOnto((java.lang.Object) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- return _identity;
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new java.lang.Object();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setRequired(true);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _onto
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(1);
+ { // -- local scope
+ org.exolab.castor.xml.validators.IdRefValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.IdRefValidator();
+ fieldValidator.setValidator(typeValidator);
}
-
- /**
- * Method getJavaClass.
- *
- * @return the Java class represented by this descriptor.
- */
- public java.lang.Class getJavaClass(
- ) {
- return uk.ac.vamsas.objects.core.Mapping.class;
- }
-
- /**
- * Method getNameSpacePrefix.
- *
- * @return the namespace prefix to use when marshaling as XML.
- */
- public java.lang.String getNameSpacePrefix(
- ) {
- return _nsPrefix;
- }
-
- /**
- * Method getNameSpaceURI.
- *
- * @return the namespace URI used when marshaling and
- * unmarshaling as XML.
- */
- public java.lang.String getNameSpaceURI(
- ) {
- return _nsURI;
- }
-
- /**
- * Method getValidator.
- *
- * @return a specific validator for the class described by this
- * ClassDescriptor.
- */
- public org.exolab.castor.xml.TypeValidator getValidator(
- ) {
- return this;
- }
-
- /**
- * Method getXMLName.
- *
- * @return the XML Name for the Class being described.
- */
- public java.lang.String getXMLName(
- ) {
- return _xmlName;
- }
-
- /**
- * Method isElementDefinition.
- *
- * @return true if XML schema definition of this Class is that
- * of a global
- * element or element with anonymous type definition.
- */
- public boolean isElementDefinition(
- ) {
- return _elementDefinition;
+ desc.setValidator(fieldValidator);
+ // -- initialize element descriptors
+
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ * Method getAccessMode.
+ *
+ * @return the access mode specified for this class.
+ */
+ public org.exolab.castor.mapping.AccessMode getAccessMode() {
+ return null;
+ }
+
+ /**
+ * Method getIdentity.
+ *
+ * @return the identity field, null if this class has no identity.
+ */
+ public org.exolab.castor.mapping.FieldDescriptor getIdentity() {
+ if (_identity == null) {
+ return super.getIdentity();
}
+ return _identity;
+ }
+
+ /**
+ * Method getJavaClass.
+ *
+ * @return the Java class represented by this descriptor.
+ */
+ public java.lang.Class getJavaClass() {
+ return uk.ac.vamsas.objects.core.Mapping.class;
+ }
+
+ /**
+ * Method getNameSpacePrefix.
+ *
+ * @return the namespace prefix to use when marshaling as XML.
+ */
+ public java.lang.String getNameSpacePrefix() {
+ return _nsPrefix;
+ }
+
+ /**
+ * Method getNameSpaceURI.
+ *
+ * @return the namespace URI used when marshaling and unmarshaling as XML.
+ */
+ public java.lang.String getNameSpaceURI() {
+ return _nsURI;
+ }
+
+ /**
+ * Method getValidator.
+ *
+ * @return a specific validator for the class described by this
+ * ClassDescriptor.
+ */
+ public org.exolab.castor.xml.TypeValidator getValidator() {
+ return this;
+ }
+
+ /**
+ * Method getXMLName.
+ *
+ * @return the XML Name for the Class being described.
+ */
+ public java.lang.String getXMLName() {
+ return _xmlName;
+ }
+
+ /**
+ * Method isElementDefinition.
+ *
+ * @return true if XML schema definition of this Class is that of a global
+ * element or element with anonymous type definition.
+ */
+ public boolean isElementDefinition() {
+ return _elementDefinition;
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/descriptors/NewickDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/NewickDescriptor.java
index ba76c79..05a7425 100644
--- a/src/uk/ac/vamsas/objects/core/descriptors/NewickDescriptor.java
+++ b/src/uk/ac/vamsas/objects/core/descriptors/NewickDescriptor.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core.descriptors;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import uk.ac.vamsas.objects.core.Newick;
@@ -18,286 +32,281 @@ import uk.ac.vamsas.objects.core.Newick;
*
* @version $Revision$ $Date$
*/
-public class NewickDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl {
-
-
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
- * Field _elementDefinition.
- */
- private boolean _elementDefinition;
-
- /**
- * Field _nsPrefix.
- */
- private java.lang.String _nsPrefix;
-
- /**
- * Field _nsURI.
- */
- private java.lang.String _nsURI;
-
- /**
- * Field _xmlName.
- */
- private java.lang.String _xmlName;
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public NewickDescriptor() {
- super();
- _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
- _xmlName = "newick";
- _elementDefinition = true;
- org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
- org.exolab.castor.mapping.FieldHandler handler = null;
- org.exolab.castor.xml.FieldValidator fieldValidator = null;
- //-- _content
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_content", "PCDATA", org.exolab.castor.xml.NodeType.Text);
- desc.setImmutable(true);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- Newick target = (Newick) object;
- return target.getContent();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- Newick target = (Newick) object;
- target.setContent( (java.lang.String) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return null;
- }
- };
- desc.setHandler(handler);
- addFieldDescriptor(desc);
-
- //-- validation code for: _content
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { //-- local scope
- org.exolab.castor.xml.validators.StringValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.StringValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setWhiteSpace("preserve");
- }
- desc.setValidator(fieldValidator);
- //-- initialize attribute descriptors
-
- //-- _title
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_title", "title", org.exolab.castor.xml.NodeType.Attribute);
- desc.setImmutable(true);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- Newick target = (Newick) object;
- return target.getTitle();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- Newick target = (Newick) object;
- target.setTitle( (java.lang.String) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _title
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { //-- local scope
- org.exolab.castor.xml.validators.StringValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.StringValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setWhiteSpace("preserve");
- }
- desc.setValidator(fieldValidator);
- //-- _id
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_id", "id", org.exolab.castor.xml.NodeType.Attribute);
- super.setIdentity(desc);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- Newick target = (Newick) object;
- return target.getId();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- Newick target = (Newick) object;
- target.setId( (java.lang.String) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new java.lang.String();
- }
- };
- desc.setHandler(handler);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _id
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { //-- local scope
- org.exolab.castor.xml.validators.IdValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.IdValidator();
- fieldValidator.setValidator(typeValidator);
- }
- desc.setValidator(fieldValidator);
- //-- _modifiable
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_modifiable", "modifiable", org.exolab.castor.xml.NodeType.Attribute);
- desc.setImmutable(true);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- Newick target = (Newick) object;
- return target.getModifiable();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- Newick target = (Newick) object;
- target.setModifiable( (java.lang.String) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _modifiable
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { //-- local scope
- org.exolab.castor.xml.validators.StringValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.StringValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setWhiteSpace("preserve");
+public class NewickDescriptor extends
+ org.exolab.castor.xml.util.XMLClassDescriptorImpl {
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * Field _elementDefinition.
+ */
+ private boolean _elementDefinition;
+
+ /**
+ * Field _nsPrefix.
+ */
+ private java.lang.String _nsPrefix;
+
+ /**
+ * Field _nsURI.
+ */
+ private java.lang.String _nsURI;
+
+ /**
+ * Field _xmlName.
+ */
+ private java.lang.String _xmlName;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public NewickDescriptor() {
+ super();
+ _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
+ _xmlName = "newick";
+ _elementDefinition = true;
+ org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
+ org.exolab.castor.mapping.FieldHandler handler = null;
+ org.exolab.castor.xml.FieldValidator fieldValidator = null;
+ // -- _content
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.String.class, "_content", "PCDATA",
+ org.exolab.castor.xml.NodeType.Text);
+ desc.setImmutable(true);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ Newick target = (Newick) object;
+ return target.getContent();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ Newick target = (Newick) object;
+ target.setContent((java.lang.String) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
- //-- initialize element descriptors
-
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return null;
+ }
+ };
+ desc.setHandler(handler);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _content
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ { // -- local scope
+ org.exolab.castor.xml.validators.StringValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.StringValidator();
+ fieldValidator.setValidator(typeValidator);
+ typeValidator.setWhiteSpace("preserve");
}
+ desc.setValidator(fieldValidator);
+ // -- initialize attribute descriptors
+ // -- _title
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.String.class, "_title", "title",
+ org.exolab.castor.xml.NodeType.Attribute);
+ desc.setImmutable(true);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ Newick target = (Newick) object;
+ return target.getTitle();
+ }
- //-----------/
- //- Methods -/
- //-----------/
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ Newick target = (Newick) object;
+ target.setTitle((java.lang.String) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- /**
- * Method getAccessMode.
- *
- * @return the access mode specified for this class.
- */
- public org.exolab.castor.mapping.AccessMode getAccessMode(
- ) {
+ public java.lang.Object newInstance(java.lang.Object parent) {
return null;
- }
+ }
+ };
+ desc.setHandler(handler);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
- /**
- * Method getIdentity.
- *
- * @return the identity field, null if this class has no
- * identity.
- */
- public org.exolab.castor.mapping.FieldDescriptor getIdentity(
- ) {
- return super.getIdentity();
+ // -- validation code for: _title
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ { // -- local scope
+ org.exolab.castor.xml.validators.StringValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.StringValidator();
+ fieldValidator.setValidator(typeValidator);
+ typeValidator.setWhiteSpace("preserve");
}
+ desc.setValidator(fieldValidator);
+ // -- _id
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.String.class, "_id", "id",
+ org.exolab.castor.xml.NodeType.Attribute);
+ super.setIdentity(desc);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ Newick target = (Newick) object;
+ return target.getId();
+ }
- /**
- * Method getJavaClass.
- *
- * @return the Java class represented by this descriptor.
- */
- public java.lang.Class getJavaClass(
- ) {
- return uk.ac.vamsas.objects.core.Newick.class;
- }
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ Newick target = (Newick) object;
+ target.setId((java.lang.String) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- /**
- * Method getNameSpacePrefix.
- *
- * @return the namespace prefix to use when marshaling as XML.
- */
- public java.lang.String getNameSpacePrefix(
- ) {
- return _nsPrefix;
- }
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new java.lang.String();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
- /**
- * Method getNameSpaceURI.
- *
- * @return the namespace URI used when marshaling and
- * unmarshaling as XML.
- */
- public java.lang.String getNameSpaceURI(
- ) {
- return _nsURI;
+ // -- validation code for: _id
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ { // -- local scope
+ org.exolab.castor.xml.validators.IdValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.IdValidator();
+ fieldValidator.setValidator(typeValidator);
}
+ desc.setValidator(fieldValidator);
+ // -- _modifiable
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.String.class, "_modifiable", "modifiable",
+ org.exolab.castor.xml.NodeType.Attribute);
+ desc.setImmutable(true);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ Newick target = (Newick) object;
+ return target.getModifiable();
+ }
- /**
- * Method getValidator.
- *
- * @return a specific validator for the class described by this
- * ClassDescriptor.
- */
- public org.exolab.castor.xml.TypeValidator getValidator(
- ) {
- return this;
- }
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ Newick target = (Newick) object;
+ target.setModifiable((java.lang.String) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- /**
- * Method getXMLName.
- *
- * @return the XML Name for the Class being described.
- */
- public java.lang.String getXMLName(
- ) {
- return _xmlName;
- }
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return null;
+ }
+ };
+ desc.setHandler(handler);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
- /**
- * Method isElementDefinition.
- *
- * @return true if XML schema definition of this Class is that
- * of a global
- * element or element with anonymous type definition.
- */
- public boolean isElementDefinition(
- ) {
- return _elementDefinition;
+ // -- validation code for: _modifiable
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ { // -- local scope
+ org.exolab.castor.xml.validators.StringValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.StringValidator();
+ fieldValidator.setValidator(typeValidator);
+ typeValidator.setWhiteSpace("preserve");
}
+ desc.setValidator(fieldValidator);
+ // -- initialize element descriptors
+
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ * Method getAccessMode.
+ *
+ * @return the access mode specified for this class.
+ */
+ public org.exolab.castor.mapping.AccessMode getAccessMode() {
+ return null;
+ }
+
+ /**
+ * Method getIdentity.
+ *
+ * @return the identity field, null if this class has no identity.
+ */
+ public org.exolab.castor.mapping.FieldDescriptor getIdentity() {
+ return super.getIdentity();
+ }
+
+ /**
+ * Method getJavaClass.
+ *
+ * @return the Java class represented by this descriptor.
+ */
+ public java.lang.Class getJavaClass() {
+ return uk.ac.vamsas.objects.core.Newick.class;
+ }
+
+ /**
+ * Method getNameSpacePrefix.
+ *
+ * @return the namespace prefix to use when marshaling as XML.
+ */
+ public java.lang.String getNameSpacePrefix() {
+ return _nsPrefix;
+ }
+
+ /**
+ * Method getNameSpaceURI.
+ *
+ * @return the namespace URI used when marshaling and unmarshaling as XML.
+ */
+ public java.lang.String getNameSpaceURI() {
+ return _nsURI;
+ }
+
+ /**
+ * Method getValidator.
+ *
+ * @return a specific validator for the class described by this
+ * ClassDescriptor.
+ */
+ public org.exolab.castor.xml.TypeValidator getValidator() {
+ return this;
+ }
+
+ /**
+ * Method getXMLName.
+ *
+ * @return the XML Name for the Class being described.
+ */
+ public java.lang.String getXMLName() {
+ return _xmlName;
+ }
+
+ /**
+ * Method isElementDefinition.
+ *
+ * @return true if XML schema definition of this Class is that of a global
+ * element or element with anonymous type definition.
+ */
+ public boolean isElementDefinition() {
+ return _elementDefinition;
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/descriptors/NodeTypeDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/NodeTypeDescriptor.java
index 88f0791..69c0ae2 100644
--- a/src/uk/ac/vamsas/objects/core/descriptors/NodeTypeDescriptor.java
+++ b/src/uk/ac/vamsas/objects/core/descriptors/NodeTypeDescriptor.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core.descriptors;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import uk.ac.vamsas.objects.core.NodeType;
@@ -18,376 +32,379 @@ import uk.ac.vamsas.objects.core.NodeType;
*
* @version $Revision$ $Date$
*/
-public class NodeTypeDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl {
-
-
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
- * Field _elementDefinition.
- */
- private boolean _elementDefinition;
-
- /**
- * Field _nsPrefix.
- */
- private java.lang.String _nsPrefix;
-
- /**
- * Field _nsURI.
- */
- private java.lang.String _nsURI;
-
- /**
- * Field _xmlName.
- */
- private java.lang.String _xmlName;
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public NodeTypeDescriptor() {
- super();
- _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
- _xmlName = "nodeType";
- _elementDefinition = false;
-
- //-- set grouping compositor
- setCompositorAsSequence();
- org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
- org.exolab.castor.mapping.FieldHandler handler = null;
- org.exolab.castor.xml.FieldValidator fieldValidator = null;
- //-- initialize attribute descriptors
-
- //-- _id
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_id", "id", org.exolab.castor.xml.NodeType.Attribute);
- super.setIdentity(desc);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- NodeType target = (NodeType) object;
- return target.getId();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- NodeType target = (NodeType) object;
- target.setId( (java.lang.String) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new java.lang.String();
- }
- };
- desc.setHandler(handler);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _id
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { //-- local scope
- org.exolab.castor.xml.validators.IdValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.IdValidator();
- fieldValidator.setValidator(typeValidator);
- }
- desc.setValidator(fieldValidator);
- //-- _modifiable
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_modifiable", "modifiable", org.exolab.castor.xml.NodeType.Attribute);
- desc.setImmutable(true);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- NodeType target = (NodeType) object;
- return target.getModifiable();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- NodeType target = (NodeType) object;
- target.setModifiable( (java.lang.String) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _modifiable
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { //-- local scope
- org.exolab.castor.xml.validators.StringValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.StringValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setWhiteSpace("preserve");
- }
- desc.setValidator(fieldValidator);
- //-- initialize element descriptors
-
- //-- _name
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_name", "name", org.exolab.castor.xml.NodeType.Element);
- desc.setImmutable(true);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- NodeType target = (NodeType) object;
- return target.getName();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- NodeType target = (NodeType) object;
- target.setName( (java.lang.String) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _name
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { //-- local scope
- org.exolab.castor.xml.validators.StringValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.StringValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setWhiteSpace("preserve");
- }
- desc.setValidator(fieldValidator);
- //-- _description
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_description", "description", org.exolab.castor.xml.NodeType.Element);
- desc.setImmutable(true);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- NodeType target = (NodeType) object;
- return target.getDescription();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- NodeType target = (NodeType) object;
- target.setDescription( (java.lang.String) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _description
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { //-- local scope
- org.exolab.castor.xml.validators.StringValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.StringValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setWhiteSpace("preserve");
- }
- desc.setValidator(fieldValidator);
- //-- _vrefList
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Vref.class, "_vrefList", "vref", org.exolab.castor.xml.NodeType.Element);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- NodeType target = (NodeType) object;
- return target.getVref();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- NodeType target = (NodeType) object;
- target.addVref( (uk.ac.vamsas.objects.core.Vref) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException {
- try {
- NodeType target = (NodeType) object;
- target.removeAllVref();
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new uk.ac.vamsas.objects.core.Vref();
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
- desc.setMultivalued(true);
- addFieldDescriptor(desc);
-
- //-- validation code for: _vrefList
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(0);
- { //-- local scope
+public class NodeTypeDescriptor extends
+ org.exolab.castor.xml.util.XMLClassDescriptorImpl {
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * Field _elementDefinition.
+ */
+ private boolean _elementDefinition;
+
+ /**
+ * Field _nsPrefix.
+ */
+ private java.lang.String _nsPrefix;
+
+ /**
+ * Field _nsURI.
+ */
+ private java.lang.String _nsURI;
+
+ /**
+ * Field _xmlName.
+ */
+ private java.lang.String _xmlName;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public NodeTypeDescriptor() {
+ super();
+ _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
+ _xmlName = "nodeType";
+ _elementDefinition = false;
+
+ // -- set grouping compositor
+ setCompositorAsSequence();
+ org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
+ org.exolab.castor.mapping.FieldHandler handler = null;
+ org.exolab.castor.xml.FieldValidator fieldValidator = null;
+ // -- initialize attribute descriptors
+
+ // -- _id
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.String.class, "_id", "id",
+ org.exolab.castor.xml.NodeType.Attribute);
+ super.setIdentity(desc);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ NodeType target = (NodeType) object;
+ return target.getId();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ NodeType target = (NodeType) object;
+ target.setId((java.lang.String) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
- //-- _propertyList
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Property.class, "_propertyList", "property", org.exolab.castor.xml.NodeType.Element);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- NodeType target = (NodeType) object;
- return target.getProperty();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- NodeType target = (NodeType) object;
- target.addProperty( (uk.ac.vamsas.objects.core.Property) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException {
- try {
- NodeType target = (NodeType) object;
- target.removeAllProperty();
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new uk.ac.vamsas.objects.core.Property();
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
- desc.setMultivalued(true);
- addFieldDescriptor(desc);
-
- //-- validation code for: _propertyList
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(0);
- { //-- local scope
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new java.lang.String();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _id
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ { // -- local scope
+ org.exolab.castor.xml.validators.IdValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.IdValidator();
+ fieldValidator.setValidator(typeValidator);
+ }
+ desc.setValidator(fieldValidator);
+ // -- _modifiable
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.String.class, "_modifiable", "modifiable",
+ org.exolab.castor.xml.NodeType.Attribute);
+ desc.setImmutable(true);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ NodeType target = (NodeType) object;
+ return target.getModifiable();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ NodeType target = (NodeType) object;
+ target.setModifiable((java.lang.String) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return null;
+ }
+ };
+ desc.setHandler(handler);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _modifiable
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ { // -- local scope
+ org.exolab.castor.xml.validators.StringValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.StringValidator();
+ fieldValidator.setValidator(typeValidator);
+ typeValidator.setWhiteSpace("preserve");
}
+ desc.setValidator(fieldValidator);
+ // -- initialize element descriptors
+ // -- _name
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.String.class, "_name", "name",
+ org.exolab.castor.xml.NodeType.Element);
+ desc.setImmutable(true);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ NodeType target = (NodeType) object;
+ return target.getName();
+ }
- //-----------/
- //- Methods -/
- //-----------/
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ NodeType target = (NodeType) object;
+ target.setName((java.lang.String) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- /**
- * Method getAccessMode.
- *
- * @return the access mode specified for this class.
- */
- public org.exolab.castor.mapping.AccessMode getAccessMode(
- ) {
+ public java.lang.Object newInstance(java.lang.Object parent) {
return null;
- }
+ }
+ };
+ desc.setHandler(handler);
+ desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
- /**
- * Method getIdentity.
- *
- * @return the identity field, null if this class has no
- * identity.
- */
- public org.exolab.castor.mapping.FieldDescriptor getIdentity(
- ) {
- return super.getIdentity();
+ // -- validation code for: _name
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ { // -- local scope
+ org.exolab.castor.xml.validators.StringValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.StringValidator();
+ fieldValidator.setValidator(typeValidator);
+ typeValidator.setWhiteSpace("preserve");
}
+ desc.setValidator(fieldValidator);
+ // -- _description
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.String.class, "_description", "description",
+ org.exolab.castor.xml.NodeType.Element);
+ desc.setImmutable(true);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ NodeType target = (NodeType) object;
+ return target.getDescription();
+ }
- /**
- * Method getJavaClass.
- *
- * @return the Java class represented by this descriptor.
- */
- public java.lang.Class getJavaClass(
- ) {
- return uk.ac.vamsas.objects.core.NodeType.class;
- }
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ NodeType target = (NodeType) object;
+ target.setDescription((java.lang.String) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- /**
- * Method getNameSpacePrefix.
- *
- * @return the namespace prefix to use when marshaling as XML.
- */
- public java.lang.String getNameSpacePrefix(
- ) {
- return _nsPrefix;
- }
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return null;
+ }
+ };
+ desc.setHandler(handler);
+ desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
- /**
- * Method getNameSpaceURI.
- *
- * @return the namespace URI used when marshaling and
- * unmarshaling as XML.
- */
- public java.lang.String getNameSpaceURI(
- ) {
- return _nsURI;
+ // -- validation code for: _description
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ { // -- local scope
+ org.exolab.castor.xml.validators.StringValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.StringValidator();
+ fieldValidator.setValidator(typeValidator);
+ typeValidator.setWhiteSpace("preserve");
}
+ desc.setValidator(fieldValidator);
+ // -- _vrefList
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ uk.ac.vamsas.objects.core.Vref.class, "_vrefList", "vref",
+ org.exolab.castor.xml.NodeType.Element);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ NodeType target = (NodeType) object;
+ return target.getVref();
+ }
- /**
- * Method getValidator.
- *
- * @return a specific validator for the class described by this
- * ClassDescriptor.
- */
- public org.exolab.castor.xml.TypeValidator getValidator(
- ) {
- return this;
- }
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ NodeType target = (NodeType) object;
+ target.addVref((uk.ac.vamsas.objects.core.Vref) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
+
+ public void resetValue(Object object) throws IllegalStateException,
+ IllegalArgumentException {
+ try {
+ NodeType target = (NodeType) object;
+ target.removeAllVref();
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- /**
- * Method getXMLName.
- *
- * @return the XML Name for the Class being described.
- */
- public java.lang.String getXMLName(
- ) {
- return _xmlName;
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new uk.ac.vamsas.objects.core.Vref();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
+ desc.setMultivalued(true);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _vrefList
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(0);
+ { // -- local scope
}
+ desc.setValidator(fieldValidator);
+ // -- _propertyList
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ uk.ac.vamsas.objects.core.Property.class, "_propertyList", "property",
+ org.exolab.castor.xml.NodeType.Element);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ NodeType target = (NodeType) object;
+ return target.getProperty();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ NodeType target = (NodeType) object;
+ target.addProperty((uk.ac.vamsas.objects.core.Property) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- /**
- * Method isElementDefinition.
- *
- * @return true if XML schema definition of this Class is that
- * of a global
- * element or element with anonymous type definition.
- */
- public boolean isElementDefinition(
- ) {
- return _elementDefinition;
+ public void resetValue(Object object) throws IllegalStateException,
+ IllegalArgumentException {
+ try {
+ NodeType target = (NodeType) object;
+ target.removeAllProperty();
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new uk.ac.vamsas.objects.core.Property();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
+ desc.setMultivalued(true);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _propertyList
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(0);
+ { // -- local scope
}
+ desc.setValidator(fieldValidator);
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ * Method getAccessMode.
+ *
+ * @return the access mode specified for this class.
+ */
+ public org.exolab.castor.mapping.AccessMode getAccessMode() {
+ return null;
+ }
+
+ /**
+ * Method getIdentity.
+ *
+ * @return the identity field, null if this class has no identity.
+ */
+ public org.exolab.castor.mapping.FieldDescriptor getIdentity() {
+ return super.getIdentity();
+ }
+
+ /**
+ * Method getJavaClass.
+ *
+ * @return the Java class represented by this descriptor.
+ */
+ public java.lang.Class getJavaClass() {
+ return uk.ac.vamsas.objects.core.NodeType.class;
+ }
+
+ /**
+ * Method getNameSpacePrefix.
+ *
+ * @return the namespace prefix to use when marshaling as XML.
+ */
+ public java.lang.String getNameSpacePrefix() {
+ return _nsPrefix;
+ }
+
+ /**
+ * Method getNameSpaceURI.
+ *
+ * @return the namespace URI used when marshaling and unmarshaling as XML.
+ */
+ public java.lang.String getNameSpaceURI() {
+ return _nsURI;
+ }
+
+ /**
+ * Method getValidator.
+ *
+ * @return a specific validator for the class described by this
+ * ClassDescriptor.
+ */
+ public org.exolab.castor.xml.TypeValidator getValidator() {
+ return this;
+ }
+
+ /**
+ * Method getXMLName.
+ *
+ * @return the XML Name for the Class being described.
+ */
+ public java.lang.String getXMLName() {
+ return _xmlName;
+ }
+
+ /**
+ * Method isElementDefinition.
+ *
+ * @return true if XML schema definition of this Class is that of a global
+ * element or element with anonymous type definition.
+ */
+ public boolean isElementDefinition() {
+ return _elementDefinition;
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/descriptors/ParamDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/ParamDescriptor.java
index ce563d4..89211c6 100644
--- a/src/uk/ac/vamsas/objects/core/descriptors/ParamDescriptor.java
+++ b/src/uk/ac/vamsas/objects/core/descriptors/ParamDescriptor.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core.descriptors;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import uk.ac.vamsas.objects.core.Param;
@@ -18,254 +32,247 @@ import uk.ac.vamsas.objects.core.Param;
*
* @version $Revision$ $Date$
*/
-public class ParamDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl {
-
+public class ParamDescriptor extends
+ org.exolab.castor.xml.util.XMLClassDescriptorImpl {
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
- /**
- * Field _elementDefinition.
- */
- private boolean _elementDefinition;
+ /**
+ * Field _elementDefinition.
+ */
+ private boolean _elementDefinition;
- /**
- * Field _nsPrefix.
- */
- private java.lang.String _nsPrefix;
+ /**
+ * Field _nsPrefix.
+ */
+ private java.lang.String _nsPrefix;
- /**
- * Field _nsURI.
- */
- private java.lang.String _nsURI;
+ /**
+ * Field _nsURI.
+ */
+ private java.lang.String _nsURI;
- /**
- * Field _xmlName.
- */
- private java.lang.String _xmlName;
+ /**
+ * Field _xmlName.
+ */
+ private java.lang.String _xmlName;
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
- //----------------/
- //- Constructors -/
- //----------------/
+ public ParamDescriptor() {
+ super();
+ _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
+ _xmlName = "param";
+ _elementDefinition = true;
+ org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
+ org.exolab.castor.mapping.FieldHandler handler = null;
+ org.exolab.castor.xml.FieldValidator fieldValidator = null;
+ // -- _content
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.String.class, "_content", "PCDATA",
+ org.exolab.castor.xml.NodeType.Text);
+ desc.setImmutable(true);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ Param target = (Param) object;
+ return target.getContent();
+ }
- public ParamDescriptor() {
- super();
- _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
- _xmlName = "param";
- _elementDefinition = true;
- org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
- org.exolab.castor.mapping.FieldHandler handler = null;
- org.exolab.castor.xml.FieldValidator fieldValidator = null;
- //-- _content
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_content", "PCDATA", org.exolab.castor.xml.NodeType.Text);
- desc.setImmutable(true);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- Param target = (Param) object;
- return target.getContent();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- Param target = (Param) object;
- target.setContent( (java.lang.String) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return null;
- }
- };
- desc.setHandler(handler);
- addFieldDescriptor(desc);
-
- //-- validation code for: _content
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { //-- local scope
- org.exolab.castor.xml.validators.StringValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.StringValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setWhiteSpace("preserve");
- }
- desc.setValidator(fieldValidator);
- //-- initialize attribute descriptors
-
- //-- _name
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_name", "name", org.exolab.castor.xml.NodeType.Attribute);
- desc.setImmutable(true);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- Param target = (Param) object;
- return target.getName();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- Param target = (Param) object;
- target.setName( (java.lang.String) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setRequired(true);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _name
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(1);
- { //-- local scope
- org.exolab.castor.xml.validators.StringValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.StringValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setWhiteSpace("preserve");
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ Param target = (Param) object;
+ target.setContent((java.lang.String) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
- //-- _type
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_type", "type", org.exolab.castor.xml.NodeType.Attribute);
- desc.setImmutable(true);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- Param target = (Param) object;
- return target.getType();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- Param target = (Param) object;
- target.setType( (java.lang.String) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setRequired(true);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _type
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(1);
- { //-- local scope
- org.exolab.castor.xml.validators.StringValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.StringValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setWhiteSpace("preserve");
- }
- desc.setValidator(fieldValidator);
- //-- initialize element descriptors
-
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return null;
+ }
+ };
+ desc.setHandler(handler);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _content
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ { // -- local scope
+ org.exolab.castor.xml.validators.StringValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.StringValidator();
+ fieldValidator.setValidator(typeValidator);
+ typeValidator.setWhiteSpace("preserve");
}
+ desc.setValidator(fieldValidator);
+ // -- initialize attribute descriptors
+ // -- _name
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.String.class, "_name", "name",
+ org.exolab.castor.xml.NodeType.Attribute);
+ desc.setImmutable(true);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ Param target = (Param) object;
+ return target.getName();
+ }
- //-----------/
- //- Methods -/
- //-----------/
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ Param target = (Param) object;
+ target.setName((java.lang.String) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- /**
- * Method getAccessMode.
- *
- * @return the access mode specified for this class.
- */
- public org.exolab.castor.mapping.AccessMode getAccessMode(
- ) {
+ public java.lang.Object newInstance(java.lang.Object parent) {
return null;
- }
+ }
+ };
+ desc.setHandler(handler);
+ desc.setRequired(true);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
- /**
- * Method getIdentity.
- *
- * @return the identity field, null if this class has no
- * identity.
- */
- public org.exolab.castor.mapping.FieldDescriptor getIdentity(
- ) {
- return super.getIdentity();
+ // -- validation code for: _name
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(1);
+ { // -- local scope
+ org.exolab.castor.xml.validators.StringValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.StringValidator();
+ fieldValidator.setValidator(typeValidator);
+ typeValidator.setWhiteSpace("preserve");
}
+ desc.setValidator(fieldValidator);
+ // -- _type
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.String.class, "_type", "type",
+ org.exolab.castor.xml.NodeType.Attribute);
+ desc.setImmutable(true);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ Param target = (Param) object;
+ return target.getType();
+ }
- /**
- * Method getJavaClass.
- *
- * @return the Java class represented by this descriptor.
- */
- public java.lang.Class getJavaClass(
- ) {
- return uk.ac.vamsas.objects.core.Param.class;
- }
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ Param target = (Param) object;
+ target.setType((java.lang.String) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- /**
- * Method getNameSpacePrefix.
- *
- * @return the namespace prefix to use when marshaling as XML.
- */
- public java.lang.String getNameSpacePrefix(
- ) {
- return _nsPrefix;
- }
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return null;
+ }
+ };
+ desc.setHandler(handler);
+ desc.setRequired(true);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
- /**
- * Method getNameSpaceURI.
- *
- * @return the namespace URI used when marshaling and
- * unmarshaling as XML.
- */
- public java.lang.String getNameSpaceURI(
- ) {
- return _nsURI;
+ // -- validation code for: _type
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(1);
+ { // -- local scope
+ org.exolab.castor.xml.validators.StringValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.StringValidator();
+ fieldValidator.setValidator(typeValidator);
+ typeValidator.setWhiteSpace("preserve");
}
+ desc.setValidator(fieldValidator);
+ // -- initialize element descriptors
- /**
- * Method getValidator.
- *
- * @return a specific validator for the class described by this
- * ClassDescriptor.
- */
- public org.exolab.castor.xml.TypeValidator getValidator(
- ) {
- return this;
- }
+ }
- /**
- * Method getXMLName.
- *
- * @return the XML Name for the Class being described.
- */
- public java.lang.String getXMLName(
- ) {
- return _xmlName;
- }
+ // -----------/
+ // - Methods -/
+ // -----------/
- /**
- * Method isElementDefinition.
- *
- * @return true if XML schema definition of this Class is that
- * of a global
- * element or element with anonymous type definition.
- */
- public boolean isElementDefinition(
- ) {
- return _elementDefinition;
- }
+ /**
+ * Method getAccessMode.
+ *
+ * @return the access mode specified for this class.
+ */
+ public org.exolab.castor.mapping.AccessMode getAccessMode() {
+ return null;
+ }
+
+ /**
+ * Method getIdentity.
+ *
+ * @return the identity field, null if this class has no identity.
+ */
+ public org.exolab.castor.mapping.FieldDescriptor getIdentity() {
+ return super.getIdentity();
+ }
+
+ /**
+ * Method getJavaClass.
+ *
+ * @return the Java class represented by this descriptor.
+ */
+ public java.lang.Class getJavaClass() {
+ return uk.ac.vamsas.objects.core.Param.class;
+ }
+
+ /**
+ * Method getNameSpacePrefix.
+ *
+ * @return the namespace prefix to use when marshaling as XML.
+ */
+ public java.lang.String getNameSpacePrefix() {
+ return _nsPrefix;
+ }
+
+ /**
+ * Method getNameSpaceURI.
+ *
+ * @return the namespace URI used when marshaling and unmarshaling as XML.
+ */
+ public java.lang.String getNameSpaceURI() {
+ return _nsURI;
+ }
+
+ /**
+ * Method getValidator.
+ *
+ * @return a specific validator for the class described by this
+ * ClassDescriptor.
+ */
+ public org.exolab.castor.xml.TypeValidator getValidator() {
+ return this;
+ }
+
+ /**
+ * Method getXMLName.
+ *
+ * @return the XML Name for the Class being described.
+ */
+ public java.lang.String getXMLName() {
+ return _xmlName;
+ }
+
+ /**
+ * Method isElementDefinition.
+ *
+ * @return true if XML schema definition of this Class is that of a global
+ * element or element with anonymous type definition.
+ */
+ public boolean isElementDefinition() {
+ return _elementDefinition;
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/descriptors/PosDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/PosDescriptor.java
index 5c8c8d8..c7a3676 100644
--- a/src/uk/ac/vamsas/objects/core/descriptors/PosDescriptor.java
+++ b/src/uk/ac/vamsas/objects/core/descriptors/PosDescriptor.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core.descriptors;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import uk.ac.vamsas.objects.core.Pos;
@@ -18,183 +32,176 @@ import uk.ac.vamsas.objects.core.Pos;
*
* @version $Revision$ $Date$
*/
-public class PosDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl {
-
-
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
- * Field _elementDefinition.
- */
- private boolean _elementDefinition;
-
- /**
- * Field _nsPrefix.
- */
- private java.lang.String _nsPrefix;
-
- /**
- * Field _nsURI.
- */
- private java.lang.String _nsURI;
-
- /**
- * Field _xmlName.
- */
- private java.lang.String _xmlName;
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public PosDescriptor() {
- super();
- _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
- _xmlName = "pos";
- _elementDefinition = true;
- org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
- org.exolab.castor.mapping.FieldHandler handler = null;
- org.exolab.castor.xml.FieldValidator fieldValidator = null;
- //-- initialize attribute descriptors
-
- //-- _i
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_i", "i", org.exolab.castor.xml.NodeType.Attribute);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- Pos target = (Pos) object;
- if (!target.hasI()) { return null; }
- return new java.lang.Integer(target.getI());
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- Pos target = (Pos) object;
- // ignore null values for non optional primitives
- if (value == null) { return; }
-
- target.setI( ((java.lang.Integer) value).intValue());
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setRequired(true);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _i
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(1);
- { //-- local scope
- org.exolab.castor.xml.validators.IntValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.IntValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setMinInclusive(-2147483648);
- typeValidator.setMaxInclusive(2147483647);
+public class PosDescriptor extends
+ org.exolab.castor.xml.util.XMLClassDescriptorImpl {
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * Field _elementDefinition.
+ */
+ private boolean _elementDefinition;
+
+ /**
+ * Field _nsPrefix.
+ */
+ private java.lang.String _nsPrefix;
+
+ /**
+ * Field _nsURI.
+ */
+ private java.lang.String _nsURI;
+
+ /**
+ * Field _xmlName.
+ */
+ private java.lang.String _xmlName;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public PosDescriptor() {
+ super();
+ _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
+ _xmlName = "pos";
+ _elementDefinition = true;
+ org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
+ org.exolab.castor.mapping.FieldHandler handler = null;
+ org.exolab.castor.xml.FieldValidator fieldValidator = null;
+ // -- initialize attribute descriptors
+
+ // -- _i
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.Integer.TYPE, "_i", "i",
+ org.exolab.castor.xml.NodeType.Attribute);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ Pos target = (Pos) object;
+ if (!target.hasI()) {
+ return null;
}
- desc.setValidator(fieldValidator);
- //-- initialize element descriptors
-
- }
-
-
- //-----------/
- //- Methods -/
- //-----------/
+ return new java.lang.Integer(target.getI());
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ Pos target = (Pos) object;
+ // ignore null values for non optional primitives
+ if (value == null) {
+ return;
+ }
+
+ target.setI(((java.lang.Integer) value).intValue());
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- /**
- * Method getAccessMode.
- *
- * @return the access mode specified for this class.
- */
- public org.exolab.castor.mapping.AccessMode getAccessMode(
- ) {
+ public java.lang.Object newInstance(java.lang.Object parent) {
return null;
+ }
+ };
+ desc.setHandler(handler);
+ desc.setRequired(true);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _i
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(1);
+ { // -- local scope
+ org.exolab.castor.xml.validators.IntValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.IntValidator();
+ fieldValidator.setValidator(typeValidator);
+ typeValidator.setMinInclusive(-2147483648);
+ typeValidator.setMaxInclusive(2147483647);
}
-
- /**
- * Method getIdentity.
- *
- * @return the identity field, null if this class has no
- * identity.
- */
- public org.exolab.castor.mapping.FieldDescriptor getIdentity(
- ) {
- return super.getIdentity();
- }
-
- /**
- * Method getJavaClass.
- *
- * @return the Java class represented by this descriptor.
- */
- public java.lang.Class getJavaClass(
- ) {
- return uk.ac.vamsas.objects.core.Pos.class;
- }
-
- /**
- * Method getNameSpacePrefix.
- *
- * @return the namespace prefix to use when marshaling as XML.
- */
- public java.lang.String getNameSpacePrefix(
- ) {
- return _nsPrefix;
- }
-
- /**
- * Method getNameSpaceURI.
- *
- * @return the namespace URI used when marshaling and
- * unmarshaling as XML.
- */
- public java.lang.String getNameSpaceURI(
- ) {
- return _nsURI;
- }
-
- /**
- * Method getValidator.
- *
- * @return a specific validator for the class described by this
- * ClassDescriptor.
- */
- public org.exolab.castor.xml.TypeValidator getValidator(
- ) {
- return this;
- }
-
- /**
- * Method getXMLName.
- *
- * @return the XML Name for the Class being described.
- */
- public java.lang.String getXMLName(
- ) {
- return _xmlName;
- }
-
- /**
- * Method isElementDefinition.
- *
- * @return true if XML schema definition of this Class is that
- * of a global
- * element or element with anonymous type definition.
- */
- public boolean isElementDefinition(
- ) {
- return _elementDefinition;
- }
+ desc.setValidator(fieldValidator);
+ // -- initialize element descriptors
+
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ * Method getAccessMode.
+ *
+ * @return the access mode specified for this class.
+ */
+ public org.exolab.castor.mapping.AccessMode getAccessMode() {
+ return null;
+ }
+
+ /**
+ * Method getIdentity.
+ *
+ * @return the identity field, null if this class has no identity.
+ */
+ public org.exolab.castor.mapping.FieldDescriptor getIdentity() {
+ return super.getIdentity();
+ }
+
+ /**
+ * Method getJavaClass.
+ *
+ * @return the Java class represented by this descriptor.
+ */
+ public java.lang.Class getJavaClass() {
+ return uk.ac.vamsas.objects.core.Pos.class;
+ }
+
+ /**
+ * Method getNameSpacePrefix.
+ *
+ * @return the namespace prefix to use when marshaling as XML.
+ */
+ public java.lang.String getNameSpacePrefix() {
+ return _nsPrefix;
+ }
+
+ /**
+ * Method getNameSpaceURI.
+ *
+ * @return the namespace URI used when marshaling and unmarshaling as XML.
+ */
+ public java.lang.String getNameSpaceURI() {
+ return _nsURI;
+ }
+
+ /**
+ * Method getValidator.
+ *
+ * @return a specific validator for the class described by this
+ * ClassDescriptor.
+ */
+ public org.exolab.castor.xml.TypeValidator getValidator() {
+ return this;
+ }
+
+ /**
+ * Method getXMLName.
+ *
+ * @return the XML Name for the Class being described.
+ */
+ public java.lang.String getXMLName() {
+ return _xmlName;
+ }
+
+ /**
+ * Method isElementDefinition.
+ *
+ * @return true if XML schema definition of this Class is that of a global
+ * element or element with anonymous type definition.
+ */
+ public boolean isElementDefinition() {
+ return _elementDefinition;
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/descriptors/PropertyDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/PropertyDescriptor.java
index aaf5f97..8a92e0f 100644
--- a/src/uk/ac/vamsas/objects/core/descriptors/PropertyDescriptor.java
+++ b/src/uk/ac/vamsas/objects/core/descriptors/PropertyDescriptor.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core.descriptors;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import uk.ac.vamsas.objects.core.Property;
@@ -18,254 +32,247 @@ import uk.ac.vamsas.objects.core.Property;
*
* @version $Revision$ $Date$
*/
-public class PropertyDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl {
-
+public class PropertyDescriptor extends
+ org.exolab.castor.xml.util.XMLClassDescriptorImpl {
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
- /**
- * Field _elementDefinition.
- */
- private boolean _elementDefinition;
+ /**
+ * Field _elementDefinition.
+ */
+ private boolean _elementDefinition;
- /**
- * Field _nsPrefix.
- */
- private java.lang.String _nsPrefix;
+ /**
+ * Field _nsPrefix.
+ */
+ private java.lang.String _nsPrefix;
- /**
- * Field _nsURI.
- */
- private java.lang.String _nsURI;
+ /**
+ * Field _nsURI.
+ */
+ private java.lang.String _nsURI;
- /**
- * Field _xmlName.
- */
- private java.lang.String _xmlName;
+ /**
+ * Field _xmlName.
+ */
+ private java.lang.String _xmlName;
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
- //----------------/
- //- Constructors -/
- //----------------/
+ public PropertyDescriptor() {
+ super();
+ _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
+ _xmlName = "property";
+ _elementDefinition = true;
+ org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
+ org.exolab.castor.mapping.FieldHandler handler = null;
+ org.exolab.castor.xml.FieldValidator fieldValidator = null;
+ // -- _content
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.String.class, "_content", "PCDATA",
+ org.exolab.castor.xml.NodeType.Text);
+ desc.setImmutable(true);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ Property target = (Property) object;
+ return target.getContent();
+ }
- public PropertyDescriptor() {
- super();
- _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
- _xmlName = "property";
- _elementDefinition = true;
- org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
- org.exolab.castor.mapping.FieldHandler handler = null;
- org.exolab.castor.xml.FieldValidator fieldValidator = null;
- //-- _content
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_content", "PCDATA", org.exolab.castor.xml.NodeType.Text);
- desc.setImmutable(true);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- Property target = (Property) object;
- return target.getContent();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- Property target = (Property) object;
- target.setContent( (java.lang.String) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return null;
- }
- };
- desc.setHandler(handler);
- addFieldDescriptor(desc);
-
- //-- validation code for: _content
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { //-- local scope
- org.exolab.castor.xml.validators.StringValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.StringValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setWhiteSpace("preserve");
- }
- desc.setValidator(fieldValidator);
- //-- initialize attribute descriptors
-
- //-- _name
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_name", "name", org.exolab.castor.xml.NodeType.Attribute);
- desc.setImmutable(true);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- Property target = (Property) object;
- return target.getName();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- Property target = (Property) object;
- target.setName( (java.lang.String) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setRequired(true);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _name
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(1);
- { //-- local scope
- org.exolab.castor.xml.validators.StringValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.StringValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setWhiteSpace("preserve");
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ Property target = (Property) object;
+ target.setContent((java.lang.String) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
- //-- _type
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_type", "type", org.exolab.castor.xml.NodeType.Attribute);
- desc.setImmutable(true);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- Property target = (Property) object;
- return target.getType();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- Property target = (Property) object;
- target.setType( (java.lang.String) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setRequired(true);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _type
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(1);
- { //-- local scope
- org.exolab.castor.xml.validators.StringValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.StringValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setWhiteSpace("preserve");
- }
- desc.setValidator(fieldValidator);
- //-- initialize element descriptors
-
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return null;
+ }
+ };
+ desc.setHandler(handler);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _content
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ { // -- local scope
+ org.exolab.castor.xml.validators.StringValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.StringValidator();
+ fieldValidator.setValidator(typeValidator);
+ typeValidator.setWhiteSpace("preserve");
}
+ desc.setValidator(fieldValidator);
+ // -- initialize attribute descriptors
+ // -- _name
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.String.class, "_name", "name",
+ org.exolab.castor.xml.NodeType.Attribute);
+ desc.setImmutable(true);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ Property target = (Property) object;
+ return target.getName();
+ }
- //-----------/
- //- Methods -/
- //-----------/
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ Property target = (Property) object;
+ target.setName((java.lang.String) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- /**
- * Method getAccessMode.
- *
- * @return the access mode specified for this class.
- */
- public org.exolab.castor.mapping.AccessMode getAccessMode(
- ) {
+ public java.lang.Object newInstance(java.lang.Object parent) {
return null;
- }
+ }
+ };
+ desc.setHandler(handler);
+ desc.setRequired(true);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
- /**
- * Method getIdentity.
- *
- * @return the identity field, null if this class has no
- * identity.
- */
- public org.exolab.castor.mapping.FieldDescriptor getIdentity(
- ) {
- return super.getIdentity();
+ // -- validation code for: _name
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(1);
+ { // -- local scope
+ org.exolab.castor.xml.validators.StringValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.StringValidator();
+ fieldValidator.setValidator(typeValidator);
+ typeValidator.setWhiteSpace("preserve");
}
+ desc.setValidator(fieldValidator);
+ // -- _type
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.String.class, "_type", "type",
+ org.exolab.castor.xml.NodeType.Attribute);
+ desc.setImmutable(true);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ Property target = (Property) object;
+ return target.getType();
+ }
- /**
- * Method getJavaClass.
- *
- * @return the Java class represented by this descriptor.
- */
- public java.lang.Class getJavaClass(
- ) {
- return uk.ac.vamsas.objects.core.Property.class;
- }
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ Property target = (Property) object;
+ target.setType((java.lang.String) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- /**
- * Method getNameSpacePrefix.
- *
- * @return the namespace prefix to use when marshaling as XML.
- */
- public java.lang.String getNameSpacePrefix(
- ) {
- return _nsPrefix;
- }
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return null;
+ }
+ };
+ desc.setHandler(handler);
+ desc.setRequired(true);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
- /**
- * Method getNameSpaceURI.
- *
- * @return the namespace URI used when marshaling and
- * unmarshaling as XML.
- */
- public java.lang.String getNameSpaceURI(
- ) {
- return _nsURI;
+ // -- validation code for: _type
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(1);
+ { // -- local scope
+ org.exolab.castor.xml.validators.StringValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.StringValidator();
+ fieldValidator.setValidator(typeValidator);
+ typeValidator.setWhiteSpace("preserve");
}
+ desc.setValidator(fieldValidator);
+ // -- initialize element descriptors
- /**
- * Method getValidator.
- *
- * @return a specific validator for the class described by this
- * ClassDescriptor.
- */
- public org.exolab.castor.xml.TypeValidator getValidator(
- ) {
- return this;
- }
+ }
- /**
- * Method getXMLName.
- *
- * @return the XML Name for the Class being described.
- */
- public java.lang.String getXMLName(
- ) {
- return _xmlName;
- }
+ // -----------/
+ // - Methods -/
+ // -----------/
- /**
- * Method isElementDefinition.
- *
- * @return true if XML schema definition of this Class is that
- * of a global
- * element or element with anonymous type definition.
- */
- public boolean isElementDefinition(
- ) {
- return _elementDefinition;
- }
+ /**
+ * Method getAccessMode.
+ *
+ * @return the access mode specified for this class.
+ */
+ public org.exolab.castor.mapping.AccessMode getAccessMode() {
+ return null;
+ }
+
+ /**
+ * Method getIdentity.
+ *
+ * @return the identity field, null if this class has no identity.
+ */
+ public org.exolab.castor.mapping.FieldDescriptor getIdentity() {
+ return super.getIdentity();
+ }
+
+ /**
+ * Method getJavaClass.
+ *
+ * @return the Java class represented by this descriptor.
+ */
+ public java.lang.Class getJavaClass() {
+ return uk.ac.vamsas.objects.core.Property.class;
+ }
+
+ /**
+ * Method getNameSpacePrefix.
+ *
+ * @return the namespace prefix to use when marshaling as XML.
+ */
+ public java.lang.String getNameSpacePrefix() {
+ return _nsPrefix;
+ }
+
+ /**
+ * Method getNameSpaceURI.
+ *
+ * @return the namespace URI used when marshaling and unmarshaling as XML.
+ */
+ public java.lang.String getNameSpaceURI() {
+ return _nsURI;
+ }
+
+ /**
+ * Method getValidator.
+ *
+ * @return a specific validator for the class described by this
+ * ClassDescriptor.
+ */
+ public org.exolab.castor.xml.TypeValidator getValidator() {
+ return this;
+ }
+
+ /**
+ * Method getXMLName.
+ *
+ * @return the XML Name for the Class being described.
+ */
+ public java.lang.String getXMLName() {
+ return _xmlName;
+ }
+
+ /**
+ * Method isElementDefinition.
+ *
+ * @return true if XML schema definition of this Class is that of a global
+ * element or element with anonymous type definition.
+ */
+ public boolean isElementDefinition() {
+ return _elementDefinition;
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/descriptors/ProvenanceDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/ProvenanceDescriptor.java
index 3572880..91466d4 100644
--- a/src/uk/ac/vamsas/objects/core/descriptors/ProvenanceDescriptor.java
+++ b/src/uk/ac/vamsas/objects/core/descriptors/ProvenanceDescriptor.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core.descriptors;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import uk.ac.vamsas.objects.core.Provenance;
@@ -18,186 +32,177 @@ import uk.ac.vamsas.objects.core.Provenance;
*
* @version $Revision$ $Date$
*/
-public class ProvenanceDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl {
-
-
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
- * Field _elementDefinition.
- */
- private boolean _elementDefinition;
-
- /**
- * Field _nsPrefix.
- */
- private java.lang.String _nsPrefix;
-
- /**
- * Field _nsURI.
- */
- private java.lang.String _nsURI;
-
- /**
- * Field _xmlName.
- */
- private java.lang.String _xmlName;
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public ProvenanceDescriptor() {
- super();
- _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
- _xmlName = "Provenance";
- _elementDefinition = true;
-
- //-- set grouping compositor
- setCompositorAsSequence();
- org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
- org.exolab.castor.mapping.FieldHandler handler = null;
- org.exolab.castor.xml.FieldValidator fieldValidator = null;
- //-- initialize attribute descriptors
-
- //-- initialize element descriptors
-
- //-- _entryList
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Entry.class, "_entryList", "entry", org.exolab.castor.xml.NodeType.Element);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- Provenance target = (Provenance) object;
- return target.getEntry();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- Provenance target = (Provenance) object;
- target.addEntry( (uk.ac.vamsas.objects.core.Entry) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException {
- try {
- Provenance target = (Provenance) object;
- target.removeAllEntry();
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new uk.ac.vamsas.objects.core.Entry();
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
- desc.setRequired(true);
- desc.setMultivalued(true);
- addFieldDescriptor(desc);
-
- //-- validation code for: _entryList
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(1);
- { //-- local scope
+public class ProvenanceDescriptor extends
+ org.exolab.castor.xml.util.XMLClassDescriptorImpl {
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * Field _elementDefinition.
+ */
+ private boolean _elementDefinition;
+
+ /**
+ * Field _nsPrefix.
+ */
+ private java.lang.String _nsPrefix;
+
+ /**
+ * Field _nsURI.
+ */
+ private java.lang.String _nsURI;
+
+ /**
+ * Field _xmlName.
+ */
+ private java.lang.String _xmlName;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public ProvenanceDescriptor() {
+ super();
+ _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
+ _xmlName = "Provenance";
+ _elementDefinition = true;
+
+ // -- set grouping compositor
+ setCompositorAsSequence();
+ org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
+ org.exolab.castor.mapping.FieldHandler handler = null;
+ org.exolab.castor.xml.FieldValidator fieldValidator = null;
+ // -- initialize attribute descriptors
+
+ // -- initialize element descriptors
+
+ // -- _entryList
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ uk.ac.vamsas.objects.core.Entry.class, "_entryList", "entry",
+ org.exolab.castor.xml.NodeType.Element);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ Provenance target = (Provenance) object;
+ return target.getEntry();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ Provenance target = (Provenance) object;
+ target.addEntry((uk.ac.vamsas.objects.core.Entry) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
- }
-
-
- //-----------/
- //- Methods -/
- //-----------/
-
- /**
- * Method getAccessMode.
- *
- * @return the access mode specified for this class.
- */
- public org.exolab.castor.mapping.AccessMode getAccessMode(
- ) {
- return null;
- }
-
- /**
- * Method getIdentity.
- *
- * @return the identity field, null if this class has no
- * identity.
- */
- public org.exolab.castor.mapping.FieldDescriptor getIdentity(
- ) {
- return super.getIdentity();
- }
-
- /**
- * Method getJavaClass.
- *
- * @return the Java class represented by this descriptor.
- */
- public java.lang.Class getJavaClass(
- ) {
- return uk.ac.vamsas.objects.core.Provenance.class;
- }
-
- /**
- * Method getNameSpacePrefix.
- *
- * @return the namespace prefix to use when marshaling as XML.
- */
- public java.lang.String getNameSpacePrefix(
- ) {
- return _nsPrefix;
- }
-
- /**
- * Method getNameSpaceURI.
- *
- * @return the namespace URI used when marshaling and
- * unmarshaling as XML.
- */
- public java.lang.String getNameSpaceURI(
- ) {
- return _nsURI;
- }
-
- /**
- * Method getValidator.
- *
- * @return a specific validator for the class described by this
- * ClassDescriptor.
- */
- public org.exolab.castor.xml.TypeValidator getValidator(
- ) {
- return this;
- }
-
- /**
- * Method getXMLName.
- *
- * @return the XML Name for the Class being described.
- */
- public java.lang.String getXMLName(
- ) {
- return _xmlName;
- }
-
- /**
- * Method isElementDefinition.
- *
- * @return true if XML schema definition of this Class is that
- * of a global
- * element or element with anonymous type definition.
- */
- public boolean isElementDefinition(
- ) {
- return _elementDefinition;
+ }
+
+ public void resetValue(Object object) throws IllegalStateException,
+ IllegalArgumentException {
+ try {
+ Provenance target = (Provenance) object;
+ target.removeAllEntry();
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new uk.ac.vamsas.objects.core.Entry();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
+ desc.setRequired(true);
+ desc.setMultivalued(true);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _entryList
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(1);
+ { // -- local scope
}
+ desc.setValidator(fieldValidator);
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ * Method getAccessMode.
+ *
+ * @return the access mode specified for this class.
+ */
+ public org.exolab.castor.mapping.AccessMode getAccessMode() {
+ return null;
+ }
+
+ /**
+ * Method getIdentity.
+ *
+ * @return the identity field, null if this class has no identity.
+ */
+ public org.exolab.castor.mapping.FieldDescriptor getIdentity() {
+ return super.getIdentity();
+ }
+
+ /**
+ * Method getJavaClass.
+ *
+ * @return the Java class represented by this descriptor.
+ */
+ public java.lang.Class getJavaClass() {
+ return uk.ac.vamsas.objects.core.Provenance.class;
+ }
+
+ /**
+ * Method getNameSpacePrefix.
+ *
+ * @return the namespace prefix to use when marshaling as XML.
+ */
+ public java.lang.String getNameSpacePrefix() {
+ return _nsPrefix;
+ }
+
+ /**
+ * Method getNameSpaceURI.
+ *
+ * @return the namespace URI used when marshaling and unmarshaling as XML.
+ */
+ public java.lang.String getNameSpaceURI() {
+ return _nsURI;
+ }
+
+ /**
+ * Method getValidator.
+ *
+ * @return a specific validator for the class described by this
+ * ClassDescriptor.
+ */
+ public org.exolab.castor.xml.TypeValidator getValidator() {
+ return this;
+ }
+
+ /**
+ * Method getXMLName.
+ *
+ * @return the XML Name for the Class being described.
+ */
+ public java.lang.String getXMLName() {
+ return _xmlName;
+ }
+
+ /**
+ * Method isElementDefinition.
+ *
+ * @return true if XML schema definition of this Class is that of a global
+ * element or element with anonymous type definition.
+ */
+ public boolean isElementDefinition() {
+ return _elementDefinition;
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/descriptors/RangeAnnotationDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/RangeAnnotationDescriptor.java
index 6d3be6a..a70b904 100644
--- a/src/uk/ac/vamsas/objects/core/descriptors/RangeAnnotationDescriptor.java
+++ b/src/uk/ac/vamsas/objects/core/descriptors/RangeAnnotationDescriptor.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core.descriptors;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import uk.ac.vamsas.objects.core.RangeAnnotation;
@@ -18,575 +32,594 @@ import uk.ac.vamsas.objects.core.RangeAnnotation;
*
* @version $Revision$ $Date$
*/
-public class RangeAnnotationDescriptor extends uk.ac.vamsas.objects.core.descriptors.RangeTypeDescriptor {
-
-
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
- * Field _elementDefinition.
- */
- private boolean _elementDefinition;
-
- /**
- * Field _nsPrefix.
- */
- private java.lang.String _nsPrefix;
-
- /**
- * Field _nsURI.
- */
- private java.lang.String _nsURI;
-
- /**
- * Field _xmlName.
- */
- private java.lang.String _xmlName;
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public RangeAnnotationDescriptor() {
- super();
- setExtendsWithoutFlatten(new uk.ac.vamsas.objects.core.descriptors.RangeTypeDescriptor());
- _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
- _xmlName = "rangeAnnotation";
- _elementDefinition = false;
-
- //-- set grouping compositor
- setCompositorAsSequence();
- org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
- org.exolab.castor.mapping.FieldHandler handler = null;
- org.exolab.castor.xml.FieldValidator fieldValidator = null;
- //-- initialize attribute descriptors
-
- //-- _id
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_id", "id", org.exolab.castor.xml.NodeType.Attribute);
- super.setIdentity(desc);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- RangeAnnotation target = (RangeAnnotation) object;
- return target.getId();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- RangeAnnotation target = (RangeAnnotation) object;
- target.setId( (java.lang.String) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new java.lang.String();
- }
- };
- desc.setHandler(handler);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _id
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { //-- local scope
- org.exolab.castor.xml.validators.IdValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.IdValidator();
- fieldValidator.setValidator(typeValidator);
+public class RangeAnnotationDescriptor extends
+ uk.ac.vamsas.objects.core.descriptors.RangeTypeDescriptor {
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * Field _elementDefinition.
+ */
+ private boolean _elementDefinition;
+
+ /**
+ * Field _nsPrefix.
+ */
+ private java.lang.String _nsPrefix;
+
+ /**
+ * Field _nsURI.
+ */
+ private java.lang.String _nsURI;
+
+ /**
+ * Field _xmlName.
+ */
+ private java.lang.String _xmlName;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public RangeAnnotationDescriptor() {
+ super();
+ setExtendsWithoutFlatten(new uk.ac.vamsas.objects.core.descriptors.RangeTypeDescriptor());
+ _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
+ _xmlName = "rangeAnnotation";
+ _elementDefinition = false;
+
+ // -- set grouping compositor
+ setCompositorAsSequence();
+ org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
+ org.exolab.castor.mapping.FieldHandler handler = null;
+ org.exolab.castor.xml.FieldValidator fieldValidator = null;
+ // -- initialize attribute descriptors
+
+ // -- _id
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.String.class, "_id", "id",
+ org.exolab.castor.xml.NodeType.Attribute);
+ super.setIdentity(desc);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ RangeAnnotation target = (RangeAnnotation) object;
+ return target.getId();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ RangeAnnotation target = (RangeAnnotation) object;
+ target.setId((java.lang.String) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
- //-- _modifiable
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_modifiable", "modifiable", org.exolab.castor.xml.NodeType.Attribute);
- desc.setImmutable(true);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- RangeAnnotation target = (RangeAnnotation) object;
- return target.getModifiable();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- RangeAnnotation target = (RangeAnnotation) object;
- target.setModifiable( (java.lang.String) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _modifiable
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { //-- local scope
- org.exolab.castor.xml.validators.StringValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.StringValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setWhiteSpace("preserve");
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new java.lang.String();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _id
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ { // -- local scope
+ org.exolab.castor.xml.validators.IdValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.IdValidator();
+ fieldValidator.setValidator(typeValidator);
+ }
+ desc.setValidator(fieldValidator);
+ // -- _modifiable
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.String.class, "_modifiable", "modifiable",
+ org.exolab.castor.xml.NodeType.Attribute);
+ desc.setImmutable(true);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ RangeAnnotation target = (RangeAnnotation) object;
+ return target.getModifiable();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ RangeAnnotation target = (RangeAnnotation) object;
+ target.setModifiable((java.lang.String) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
- //-- _group
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_group", "group", org.exolab.castor.xml.NodeType.Attribute);
- desc.setImmutable(true);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- RangeAnnotation target = (RangeAnnotation) object;
- return target.getGroup();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- RangeAnnotation target = (RangeAnnotation) object;
- target.setGroup( (java.lang.String) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _group
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { //-- local scope
- org.exolab.castor.xml.validators.StringValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.StringValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setWhiteSpace("preserve");
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return null;
+ }
+ };
+ desc.setHandler(handler);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _modifiable
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ { // -- local scope
+ org.exolab.castor.xml.validators.StringValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.StringValidator();
+ fieldValidator.setValidator(typeValidator);
+ typeValidator.setWhiteSpace("preserve");
+ }
+ desc.setValidator(fieldValidator);
+ // -- _group
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.String.class, "_group", "group",
+ org.exolab.castor.xml.NodeType.Attribute);
+ desc.setImmutable(true);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ RangeAnnotation target = (RangeAnnotation) object;
+ return target.getGroup();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ RangeAnnotation target = (RangeAnnotation) object;
+ target.setGroup((java.lang.String) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
- //-- _type
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_type", "type", org.exolab.castor.xml.NodeType.Attribute);
- desc.setImmutable(true);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- RangeAnnotation target = (RangeAnnotation) object;
- return target.getType();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- RangeAnnotation target = (RangeAnnotation) object;
- target.setType( (java.lang.String) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setRequired(true);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _type
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(1);
- { //-- local scope
- org.exolab.castor.xml.validators.StringValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.StringValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setWhiteSpace("preserve");
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return null;
+ }
+ };
+ desc.setHandler(handler);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _group
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ { // -- local scope
+ org.exolab.castor.xml.validators.StringValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.StringValidator();
+ fieldValidator.setValidator(typeValidator);
+ typeValidator.setWhiteSpace("preserve");
+ }
+ desc.setValidator(fieldValidator);
+ // -- _type
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.String.class, "_type", "type",
+ org.exolab.castor.xml.NodeType.Attribute);
+ desc.setImmutable(true);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ RangeAnnotation target = (RangeAnnotation) object;
+ return target.getType();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ RangeAnnotation target = (RangeAnnotation) object;
+ target.setType((java.lang.String) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
- //-- initialize element descriptors
-
- //-- _label
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_label", "label", org.exolab.castor.xml.NodeType.Element);
- desc.setImmutable(true);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- RangeAnnotation target = (RangeAnnotation) object;
- return target.getLabel();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- RangeAnnotation target = (RangeAnnotation) object;
- target.setLabel( (java.lang.String) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _label
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { //-- local scope
- org.exolab.castor.xml.validators.StringValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.StringValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setWhiteSpace("preserve");
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return null;
+ }
+ };
+ desc.setHandler(handler);
+ desc.setRequired(true);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _type
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(1);
+ { // -- local scope
+ org.exolab.castor.xml.validators.StringValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.StringValidator();
+ fieldValidator.setValidator(typeValidator);
+ typeValidator.setWhiteSpace("preserve");
+ }
+ desc.setValidator(fieldValidator);
+ // -- initialize element descriptors
+
+ // -- _label
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.String.class, "_label", "label",
+ org.exolab.castor.xml.NodeType.Element);
+ desc.setImmutable(true);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ RangeAnnotation target = (RangeAnnotation) object;
+ return target.getLabel();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ RangeAnnotation target = (RangeAnnotation) object;
+ target.setLabel((java.lang.String) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
- //-- _description
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_description", "description", org.exolab.castor.xml.NodeType.Element);
- desc.setImmutable(true);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- RangeAnnotation target = (RangeAnnotation) object;
- return target.getDescription();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- RangeAnnotation target = (RangeAnnotation) object;
- target.setDescription( (java.lang.String) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _description
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { //-- local scope
- org.exolab.castor.xml.validators.StringValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.StringValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setWhiteSpace("preserve");
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return null;
+ }
+ };
+ desc.setHandler(handler);
+ desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _label
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ { // -- local scope
+ org.exolab.castor.xml.validators.StringValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.StringValidator();
+ fieldValidator.setValidator(typeValidator);
+ typeValidator.setWhiteSpace("preserve");
+ }
+ desc.setValidator(fieldValidator);
+ // -- _description
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.String.class, "_description", "description",
+ org.exolab.castor.xml.NodeType.Element);
+ desc.setImmutable(true);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ RangeAnnotation target = (RangeAnnotation) object;
+ return target.getDescription();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ RangeAnnotation target = (RangeAnnotation) object;
+ target.setDescription((java.lang.String) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
- //-- _status
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_status", "status", org.exolab.castor.xml.NodeType.Element);
- desc.setImmutable(true);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- RangeAnnotation target = (RangeAnnotation) object;
- return target.getStatus();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- RangeAnnotation target = (RangeAnnotation) object;
- target.setStatus( (java.lang.String) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _status
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { //-- local scope
- org.exolab.castor.xml.validators.StringValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.StringValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setWhiteSpace("preserve");
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return null;
+ }
+ };
+ desc.setHandler(handler);
+ desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _description
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ { // -- local scope
+ org.exolab.castor.xml.validators.StringValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.StringValidator();
+ fieldValidator.setValidator(typeValidator);
+ typeValidator.setWhiteSpace("preserve");
+ }
+ desc.setValidator(fieldValidator);
+ // -- _status
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.String.class, "_status", "status",
+ org.exolab.castor.xml.NodeType.Element);
+ desc.setImmutable(true);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ RangeAnnotation target = (RangeAnnotation) object;
+ return target.getStatus();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ RangeAnnotation target = (RangeAnnotation) object;
+ target.setStatus((java.lang.String) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
- //-- _annotationElementList
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.AnnotationElement.class, "_annotationElementList", "annotationElement", org.exolab.castor.xml.NodeType.Element);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- RangeAnnotation target = (RangeAnnotation) object;
- return target.getAnnotationElement();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- RangeAnnotation target = (RangeAnnotation) object;
- target.addAnnotationElement( (uk.ac.vamsas.objects.core.AnnotationElement) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException {
- try {
- RangeAnnotation target = (RangeAnnotation) object;
- target.removeAllAnnotationElement();
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new uk.ac.vamsas.objects.core.AnnotationElement();
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
- desc.setMultivalued(true);
- addFieldDescriptor(desc);
-
- //-- validation code for: _annotationElementList
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(0);
- { //-- local scope
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return null;
+ }
+ };
+ desc.setHandler(handler);
+ desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _status
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ { // -- local scope
+ org.exolab.castor.xml.validators.StringValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.StringValidator();
+ fieldValidator.setValidator(typeValidator);
+ typeValidator.setWhiteSpace("preserve");
+ }
+ desc.setValidator(fieldValidator);
+ // -- _annotationElementList
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ uk.ac.vamsas.objects.core.AnnotationElement.class,
+ "_annotationElementList", "annotationElement",
+ org.exolab.castor.xml.NodeType.Element);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ RangeAnnotation target = (RangeAnnotation) object;
+ return target.getAnnotationElement();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ RangeAnnotation target = (RangeAnnotation) object;
+ target
+ .addAnnotationElement((uk.ac.vamsas.objects.core.AnnotationElement) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
- //-- _scoreList
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Score.class, "_scoreList", "score", org.exolab.castor.xml.NodeType.Element);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- RangeAnnotation target = (RangeAnnotation) object;
- return target.getScore();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- RangeAnnotation target = (RangeAnnotation) object;
- target.addScore( (uk.ac.vamsas.objects.core.Score) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException {
- try {
- RangeAnnotation target = (RangeAnnotation) object;
- target.removeAllScore();
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new uk.ac.vamsas.objects.core.Score();
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
- desc.setMultivalued(true);
- addFieldDescriptor(desc);
-
- //-- validation code for: _scoreList
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(0);
- { //-- local scope
+ }
+
+ public void resetValue(Object object) throws IllegalStateException,
+ IllegalArgumentException {
+ try {
+ RangeAnnotation target = (RangeAnnotation) object;
+ target.removeAllAnnotationElement();
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
- //-- _linkList
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Link.class, "_linkList", "link", org.exolab.castor.xml.NodeType.Element);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- RangeAnnotation target = (RangeAnnotation) object;
- return target.getLink();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- RangeAnnotation target = (RangeAnnotation) object;
- target.addLink( (uk.ac.vamsas.objects.core.Link) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException {
- try {
- RangeAnnotation target = (RangeAnnotation) object;
- target.removeAllLink();
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new uk.ac.vamsas.objects.core.Link();
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
- desc.setMultivalued(true);
- addFieldDescriptor(desc);
-
- //-- validation code for: _linkList
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(0);
- { //-- local scope
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new uk.ac.vamsas.objects.core.AnnotationElement();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
+ desc.setMultivalued(true);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _annotationElementList
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(0);
+ { // -- local scope
+ }
+ desc.setValidator(fieldValidator);
+ // -- _scoreList
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ uk.ac.vamsas.objects.core.Score.class, "_scoreList", "score",
+ org.exolab.castor.xml.NodeType.Element);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ RangeAnnotation target = (RangeAnnotation) object;
+ return target.getScore();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ RangeAnnotation target = (RangeAnnotation) object;
+ target.addScore((uk.ac.vamsas.objects.core.Score) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
- //-- _propertyList
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Property.class, "_propertyList", "property", org.exolab.castor.xml.NodeType.Element);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- RangeAnnotation target = (RangeAnnotation) object;
- return target.getProperty();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- RangeAnnotation target = (RangeAnnotation) object;
- target.addProperty( (uk.ac.vamsas.objects.core.Property) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException {
- try {
- RangeAnnotation target = (RangeAnnotation) object;
- target.removeAllProperty();
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new uk.ac.vamsas.objects.core.Property();
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
- desc.setMultivalued(true);
- addFieldDescriptor(desc);
-
- //-- validation code for: _propertyList
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(0);
- { //-- local scope
+ }
+
+ public void resetValue(Object object) throws IllegalStateException,
+ IllegalArgumentException {
+ try {
+ RangeAnnotation target = (RangeAnnotation) object;
+ target.removeAllScore();
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new uk.ac.vamsas.objects.core.Score();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
+ desc.setMultivalued(true);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _scoreList
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(0);
+ { // -- local scope
}
+ desc.setValidator(fieldValidator);
+ // -- _linkList
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ uk.ac.vamsas.objects.core.Link.class, "_linkList", "link",
+ org.exolab.castor.xml.NodeType.Element);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ RangeAnnotation target = (RangeAnnotation) object;
+ return target.getLink();
+ }
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ RangeAnnotation target = (RangeAnnotation) object;
+ target.addLink((uk.ac.vamsas.objects.core.Link) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- //-----------/
- //- Methods -/
- //-----------/
+ public void resetValue(Object object) throws IllegalStateException,
+ IllegalArgumentException {
+ try {
+ RangeAnnotation target = (RangeAnnotation) object;
+ target.removeAllLink();
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- /**
- * Method getAccessMode.
- *
- * @return the access mode specified for this class.
- */
- public org.exolab.castor.mapping.AccessMode getAccessMode(
- ) {
- return null;
- }
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new uk.ac.vamsas.objects.core.Link();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
+ desc.setMultivalued(true);
+ addFieldDescriptor(desc);
- /**
- * Method getIdentity.
- *
- * @return the identity field, null if this class has no
- * identity.
- */
- public org.exolab.castor.mapping.FieldDescriptor getIdentity(
- ) {
- return super.getIdentity();
+ // -- validation code for: _linkList
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(0);
+ { // -- local scope
}
+ desc.setValidator(fieldValidator);
+ // -- _propertyList
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ uk.ac.vamsas.objects.core.Property.class, "_propertyList", "property",
+ org.exolab.castor.xml.NodeType.Element);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ RangeAnnotation target = (RangeAnnotation) object;
+ return target.getProperty();
+ }
- /**
- * Method getJavaClass.
- *
- * @return the Java class represented by this descriptor.
- */
- public java.lang.Class getJavaClass(
- ) {
- return uk.ac.vamsas.objects.core.RangeAnnotation.class;
- }
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ RangeAnnotation target = (RangeAnnotation) object;
+ target.addProperty((uk.ac.vamsas.objects.core.Property) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- /**
- * Method getNameSpacePrefix.
- *
- * @return the namespace prefix to use when marshaling as XML.
- */
- public java.lang.String getNameSpacePrefix(
- ) {
- return _nsPrefix;
- }
+ public void resetValue(Object object) throws IllegalStateException,
+ IllegalArgumentException {
+ try {
+ RangeAnnotation target = (RangeAnnotation) object;
+ target.removeAllProperty();
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- /**
- * Method getNameSpaceURI.
- *
- * @return the namespace URI used when marshaling and
- * unmarshaling as XML.
- */
- public java.lang.String getNameSpaceURI(
- ) {
- return _nsURI;
- }
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new uk.ac.vamsas.objects.core.Property();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
+ desc.setMultivalued(true);
+ addFieldDescriptor(desc);
- /**
- * Method getValidator.
- *
- * @return a specific validator for the class described by this
- * ClassDescriptor.
- */
- public org.exolab.castor.xml.TypeValidator getValidator(
- ) {
- return this;
+ // -- validation code for: _propertyList
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(0);
+ { // -- local scope
}
+ desc.setValidator(fieldValidator);
+ }
- /**
- * Method getXMLName.
- *
- * @return the XML Name for the Class being described.
- */
- public java.lang.String getXMLName(
- ) {
- return _xmlName;
- }
+ // -----------/
+ // - Methods -/
+ // -----------/
- /**
- * Method isElementDefinition.
- *
- * @return true if XML schema definition of this Class is that
- * of a global
- * element or element with anonymous type definition.
- */
- public boolean isElementDefinition(
- ) {
- return _elementDefinition;
- }
+ /**
+ * Method getAccessMode.
+ *
+ * @return the access mode specified for this class.
+ */
+ public org.exolab.castor.mapping.AccessMode getAccessMode() {
+ return null;
+ }
+
+ /**
+ * Method getIdentity.
+ *
+ * @return the identity field, null if this class has no identity.
+ */
+ public org.exolab.castor.mapping.FieldDescriptor getIdentity() {
+ return super.getIdentity();
+ }
+
+ /**
+ * Method getJavaClass.
+ *
+ * @return the Java class represented by this descriptor.
+ */
+ public java.lang.Class getJavaClass() {
+ return uk.ac.vamsas.objects.core.RangeAnnotation.class;
+ }
+
+ /**
+ * Method getNameSpacePrefix.
+ *
+ * @return the namespace prefix to use when marshaling as XML.
+ */
+ public java.lang.String getNameSpacePrefix() {
+ return _nsPrefix;
+ }
+
+ /**
+ * Method getNameSpaceURI.
+ *
+ * @return the namespace URI used when marshaling and unmarshaling as XML.
+ */
+ public java.lang.String getNameSpaceURI() {
+ return _nsURI;
+ }
+
+ /**
+ * Method getValidator.
+ *
+ * @return a specific validator for the class described by this
+ * ClassDescriptor.
+ */
+ public org.exolab.castor.xml.TypeValidator getValidator() {
+ return this;
+ }
+
+ /**
+ * Method getXMLName.
+ *
+ * @return the XML Name for the Class being described.
+ */
+ public java.lang.String getXMLName() {
+ return _xmlName;
+ }
+
+ /**
+ * Method isElementDefinition.
+ *
+ * @return true if XML schema definition of this Class is that of a global
+ * element or element with anonymous type definition.
+ */
+ public boolean isElementDefinition() {
+ return _elementDefinition;
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/descriptors/RangeDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/RangeDescriptor.java
index 3053d50..f196666 100644
--- a/src/uk/ac/vamsas/objects/core/descriptors/RangeDescriptor.java
+++ b/src/uk/ac/vamsas/objects/core/descriptors/RangeDescriptor.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core.descriptors;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import uk.ac.vamsas.objects.core.Range;
@@ -18,317 +32,320 @@ import uk.ac.vamsas.objects.core.Range;
*
* @version $Revision$ $Date$
*/
-public class RangeDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl {
-
-
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
- * Field _elementDefinition.
- */
- private boolean _elementDefinition;
-
- /**
- * Field _nsPrefix.
- */
- private java.lang.String _nsPrefix;
-
- /**
- * Field _nsURI.
- */
- private java.lang.String _nsURI;
-
- /**
- * Field _xmlName.
- */
- private java.lang.String _xmlName;
-
- /**
- * Field _identity.
- */
- private org.exolab.castor.xml.XMLFieldDescriptor _identity;
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public RangeDescriptor() {
- super();
- _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
- _xmlName = "range";
- _elementDefinition = true;
- org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
- org.exolab.castor.mapping.FieldHandler handler = null;
- org.exolab.castor.xml.FieldValidator fieldValidator = null;
- //-- initialize attribute descriptors
-
- //-- _seqAStart
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_seqAStart", "seqAStart", org.exolab.castor.xml.NodeType.Attribute);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- Range target = (Range) object;
- if (!target.hasSeqAStart()) { return null; }
- return new java.lang.Integer(target.getSeqAStart());
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- Range target = (Range) object;
- // if null, use delete method for optional primitives
- if (value == null) {
- target.deleteSeqAStart();
- return;
- }
- target.setSeqAStart( ((java.lang.Integer) value).intValue());
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _seqAStart
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { //-- local scope
- org.exolab.castor.xml.validators.IntValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.IntValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setMinInclusive(-2147483648);
- typeValidator.setMaxInclusive(2147483647);
+public class RangeDescriptor extends
+ org.exolab.castor.xml.util.XMLClassDescriptorImpl {
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * Field _elementDefinition.
+ */
+ private boolean _elementDefinition;
+
+ /**
+ * Field _nsPrefix.
+ */
+ private java.lang.String _nsPrefix;
+
+ /**
+ * Field _nsURI.
+ */
+ private java.lang.String _nsURI;
+
+ /**
+ * Field _xmlName.
+ */
+ private java.lang.String _xmlName;
+
+ /**
+ * Field _identity.
+ */
+ private org.exolab.castor.xml.XMLFieldDescriptor _identity;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public RangeDescriptor() {
+ super();
+ _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
+ _xmlName = "range";
+ _elementDefinition = true;
+ org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
+ org.exolab.castor.mapping.FieldHandler handler = null;
+ org.exolab.castor.xml.FieldValidator fieldValidator = null;
+ // -- initialize attribute descriptors
+
+ // -- _seqAStart
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.Integer.TYPE, "_seqAStart", "seqAStart",
+ org.exolab.castor.xml.NodeType.Attribute);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ Range target = (Range) object;
+ if (!target.hasSeqAStart()) {
+ return null;
}
- desc.setValidator(fieldValidator);
- //-- _seqAEnd
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_seqAEnd", "seqAEnd", org.exolab.castor.xml.NodeType.Attribute);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- Range target = (Range) object;
- if (!target.hasSeqAEnd()) { return null; }
- return new java.lang.Integer(target.getSeqAEnd());
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- Range target = (Range) object;
- // if null, use delete method for optional primitives
- if (value == null) {
- target.deleteSeqAEnd();
- return;
- }
- target.setSeqAEnd( ((java.lang.Integer) value).intValue());
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _seqAEnd
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { //-- local scope
- org.exolab.castor.xml.validators.IntValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.IntValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setMinInclusive(-2147483648);
- typeValidator.setMaxInclusive(2147483647);
+ return new java.lang.Integer(target.getSeqAStart());
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ Range target = (Range) object;
+ // if null, use delete method for optional primitives
+ if (value == null) {
+ target.deleteSeqAStart();
+ return;
+ }
+ target.setSeqAStart(((java.lang.Integer) value).intValue());
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
- //-- _seqBStart
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_seqBStart", "seqBStart", org.exolab.castor.xml.NodeType.Attribute);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- Range target = (Range) object;
- if (!target.hasSeqBStart()) { return null; }
- return new java.lang.Integer(target.getSeqBStart());
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- Range target = (Range) object;
- // if null, use delete method for optional primitives
- if (value == null) {
- target.deleteSeqBStart();
- return;
- }
- target.setSeqBStart( ((java.lang.Integer) value).intValue());
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _seqBStart
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { //-- local scope
- org.exolab.castor.xml.validators.IntValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.IntValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setMinInclusive(-2147483648);
- typeValidator.setMaxInclusive(2147483647);
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return null;
+ }
+ };
+ desc.setHandler(handler);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _seqAStart
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ { // -- local scope
+ org.exolab.castor.xml.validators.IntValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.IntValidator();
+ fieldValidator.setValidator(typeValidator);
+ typeValidator.setMinInclusive(-2147483648);
+ typeValidator.setMaxInclusive(2147483647);
+ }
+ desc.setValidator(fieldValidator);
+ // -- _seqAEnd
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.Integer.TYPE, "_seqAEnd", "seqAEnd",
+ org.exolab.castor.xml.NodeType.Attribute);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ Range target = (Range) object;
+ if (!target.hasSeqAEnd()) {
+ return null;
}
- desc.setValidator(fieldValidator);
- //-- _seqBEnd
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_seqBEnd", "seqBEnd", org.exolab.castor.xml.NodeType.Attribute);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- Range target = (Range) object;
- if (!target.hasSeqBEnd()) { return null; }
- return new java.lang.Integer(target.getSeqBEnd());
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- Range target = (Range) object;
- // if null, use delete method for optional primitives
- if (value == null) {
- target.deleteSeqBEnd();
- return;
- }
- target.setSeqBEnd( ((java.lang.Integer) value).intValue());
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _seqBEnd
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { //-- local scope
- org.exolab.castor.xml.validators.IntValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.IntValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setMinInclusive(-2147483648);
- typeValidator.setMaxInclusive(2147483647);
+ return new java.lang.Integer(target.getSeqAEnd());
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ Range target = (Range) object;
+ // if null, use delete method for optional primitives
+ if (value == null) {
+ target.deleteSeqAEnd();
+ return;
+ }
+ target.setSeqAEnd(((java.lang.Integer) value).intValue());
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
- //-- initialize element descriptors
-
- }
+ }
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return null;
+ }
+ };
+ desc.setHandler(handler);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _seqAEnd
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ { // -- local scope
+ org.exolab.castor.xml.validators.IntValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.IntValidator();
+ fieldValidator.setValidator(typeValidator);
+ typeValidator.setMinInclusive(-2147483648);
+ typeValidator.setMaxInclusive(2147483647);
+ }
+ desc.setValidator(fieldValidator);
+ // -- _seqBStart
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.Integer.TYPE, "_seqBStart", "seqBStart",
+ org.exolab.castor.xml.NodeType.Attribute);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ Range target = (Range) object;
+ if (!target.hasSeqBStart()) {
+ return null;
+ }
+ return new java.lang.Integer(target.getSeqBStart());
+ }
- //-----------/
- //- Methods -/
- //-----------/
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ Range target = (Range) object;
+ // if null, use delete method for optional primitives
+ if (value == null) {
+ target.deleteSeqBStart();
+ return;
+ }
+ target.setSeqBStart(((java.lang.Integer) value).intValue());
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- /**
- * Method getAccessMode.
- *
- * @return the access mode specified for this class.
- */
- public org.exolab.castor.mapping.AccessMode getAccessMode(
- ) {
+ public java.lang.Object newInstance(java.lang.Object parent) {
return null;
- }
+ }
+ };
+ desc.setHandler(handler);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
- /**
- * Method getIdentity.
- *
- * @return the identity field, null if this class has no
- * identity.
- */
- public org.exolab.castor.mapping.FieldDescriptor getIdentity(
- ) {
- return _identity;
+ // -- validation code for: _seqBStart
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ { // -- local scope
+ org.exolab.castor.xml.validators.IntValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.IntValidator();
+ fieldValidator.setValidator(typeValidator);
+ typeValidator.setMinInclusive(-2147483648);
+ typeValidator.setMaxInclusive(2147483647);
}
+ desc.setValidator(fieldValidator);
+ // -- _seqBEnd
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.Integer.TYPE, "_seqBEnd", "seqBEnd",
+ org.exolab.castor.xml.NodeType.Attribute);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ Range target = (Range) object;
+ if (!target.hasSeqBEnd()) {
+ return null;
+ }
+ return new java.lang.Integer(target.getSeqBEnd());
+ }
- /**
- * Method getJavaClass.
- *
- * @return the Java class represented by this descriptor.
- */
- public java.lang.Class getJavaClass(
- ) {
- return uk.ac.vamsas.objects.core.Range.class;
- }
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ Range target = (Range) object;
+ // if null, use delete method for optional primitives
+ if (value == null) {
+ target.deleteSeqBEnd();
+ return;
+ }
+ target.setSeqBEnd(((java.lang.Integer) value).intValue());
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- /**
- * Method getNameSpacePrefix.
- *
- * @return the namespace prefix to use when marshaling as XML.
- */
- public java.lang.String getNameSpacePrefix(
- ) {
- return _nsPrefix;
- }
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return null;
+ }
+ };
+ desc.setHandler(handler);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
- /**
- * Method getNameSpaceURI.
- *
- * @return the namespace URI used when marshaling and
- * unmarshaling as XML.
- */
- public java.lang.String getNameSpaceURI(
- ) {
- return _nsURI;
+ // -- validation code for: _seqBEnd
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ { // -- local scope
+ org.exolab.castor.xml.validators.IntValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.IntValidator();
+ fieldValidator.setValidator(typeValidator);
+ typeValidator.setMinInclusive(-2147483648);
+ typeValidator.setMaxInclusive(2147483647);
}
+ desc.setValidator(fieldValidator);
+ // -- initialize element descriptors
- /**
- * Method getValidator.
- *
- * @return a specific validator for the class described by this
- * ClassDescriptor.
- */
- public org.exolab.castor.xml.TypeValidator getValidator(
- ) {
- return this;
- }
+ }
- /**
- * Method getXMLName.
- *
- * @return the XML Name for the Class being described.
- */
- public java.lang.String getXMLName(
- ) {
- return _xmlName;
- }
+ // -----------/
+ // - Methods -/
+ // -----------/
- /**
- * Method isElementDefinition.
- *
- * @return true if XML schema definition of this Class is that
- * of a global
- * element or element with anonymous type definition.
- */
- public boolean isElementDefinition(
- ) {
- return _elementDefinition;
- }
+ /**
+ * Method getAccessMode.
+ *
+ * @return the access mode specified for this class.
+ */
+ public org.exolab.castor.mapping.AccessMode getAccessMode() {
+ return null;
+ }
+
+ /**
+ * Method getIdentity.
+ *
+ * @return the identity field, null if this class has no identity.
+ */
+ public org.exolab.castor.mapping.FieldDescriptor getIdentity() {
+ return _identity;
+ }
+
+ /**
+ * Method getJavaClass.
+ *
+ * @return the Java class represented by this descriptor.
+ */
+ public java.lang.Class getJavaClass() {
+ return uk.ac.vamsas.objects.core.Range.class;
+ }
+
+ /**
+ * Method getNameSpacePrefix.
+ *
+ * @return the namespace prefix to use when marshaling as XML.
+ */
+ public java.lang.String getNameSpacePrefix() {
+ return _nsPrefix;
+ }
+
+ /**
+ * Method getNameSpaceURI.
+ *
+ * @return the namespace URI used when marshaling and unmarshaling as XML.
+ */
+ public java.lang.String getNameSpaceURI() {
+ return _nsURI;
+ }
+
+ /**
+ * Method getValidator.
+ *
+ * @return a specific validator for the class described by this
+ * ClassDescriptor.
+ */
+ public org.exolab.castor.xml.TypeValidator getValidator() {
+ return this;
+ }
+
+ /**
+ * Method getXMLName.
+ *
+ * @return the XML Name for the Class being described.
+ */
+ public java.lang.String getXMLName() {
+ return _xmlName;
+ }
+
+ /**
+ * Method isElementDefinition.
+ *
+ * @return true if XML schema definition of this Class is that of a global
+ * element or element with anonymous type definition.
+ */
+ public boolean isElementDefinition() {
+ return _elementDefinition;
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/descriptors/RangeTypeDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/RangeTypeDescriptor.java
index 41f9da7..0fba2ca 100644
--- a/src/uk/ac/vamsas/objects/core/descriptors/RangeTypeDescriptor.java
+++ b/src/uk/ac/vamsas/objects/core/descriptors/RangeTypeDescriptor.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core.descriptors;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import uk.ac.vamsas.objects.core.RangeType;
@@ -18,229 +32,224 @@ import uk.ac.vamsas.objects.core.RangeType;
*
* @version $Revision$ $Date$
*/
-public class RangeTypeDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl {
-
-
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
- * Field _elementDefinition.
- */
- private boolean _elementDefinition;
-
- /**
- * Field _nsPrefix.
- */
- private java.lang.String _nsPrefix;
-
- /**
- * Field _nsURI.
- */
- private java.lang.String _nsURI;
-
- /**
- * Field _xmlName.
- */
- private java.lang.String _xmlName;
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public RangeTypeDescriptor() {
- super();
- _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
- _xmlName = "rangeType";
- _elementDefinition = false;
-
- //-- set grouping compositor
- setCompositorAsChoice();
- org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
- org.exolab.castor.mapping.FieldHandler handler = null;
- org.exolab.castor.xml.FieldValidator fieldValidator = null;
- //-- initialize attribute descriptors
-
- //-- initialize element descriptors
-
- //-- _posList
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Pos.class, "_posList", "pos", org.exolab.castor.xml.NodeType.Element);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- RangeType target = (RangeType) object;
- return target.getPos();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- RangeType target = (RangeType) object;
- target.addPos( (uk.ac.vamsas.objects.core.Pos) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException {
- try {
- RangeType target = (RangeType) object;
- target.removeAllPos();
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new uk.ac.vamsas.objects.core.Pos();
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
- desc.setRequired(true);
- desc.setMultivalued(true);
- addFieldDescriptor(desc);
-
- //-- validation code for: _posList
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(1);
- { //-- local scope
+public class RangeTypeDescriptor extends
+ org.exolab.castor.xml.util.XMLClassDescriptorImpl {
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * Field _elementDefinition.
+ */
+ private boolean _elementDefinition;
+
+ /**
+ * Field _nsPrefix.
+ */
+ private java.lang.String _nsPrefix;
+
+ /**
+ * Field _nsURI.
+ */
+ private java.lang.String _nsURI;
+
+ /**
+ * Field _xmlName.
+ */
+ private java.lang.String _xmlName;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public RangeTypeDescriptor() {
+ super();
+ _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
+ _xmlName = "rangeType";
+ _elementDefinition = false;
+
+ // -- set grouping compositor
+ setCompositorAsChoice();
+ org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
+ org.exolab.castor.mapping.FieldHandler handler = null;
+ org.exolab.castor.xml.FieldValidator fieldValidator = null;
+ // -- initialize attribute descriptors
+
+ // -- initialize element descriptors
+
+ // -- _posList
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ uk.ac.vamsas.objects.core.Pos.class, "_posList", "pos",
+ org.exolab.castor.xml.NodeType.Element);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ RangeType target = (RangeType) object;
+ return target.getPos();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ RangeType target = (RangeType) object;
+ target.addPos((uk.ac.vamsas.objects.core.Pos) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
- //-- _segList
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Seg.class, "_segList", "seg", org.exolab.castor.xml.NodeType.Element);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- RangeType target = (RangeType) object;
- return target.getSeg();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- RangeType target = (RangeType) object;
- target.addSeg( (uk.ac.vamsas.objects.core.Seg) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException {
- try {
- RangeType target = (RangeType) object;
- target.removeAllSeg();
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new uk.ac.vamsas.objects.core.Seg();
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
- desc.setRequired(true);
- desc.setMultivalued(true);
- addFieldDescriptor(desc);
-
- //-- validation code for: _segList
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(1);
- { //-- local scope
+ }
+
+ public void resetValue(Object object) throws IllegalStateException,
+ IllegalArgumentException {
+ try {
+ RangeType target = (RangeType) object;
+ target.removeAllPos();
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
- }
-
-
- //-----------/
- //- Methods -/
- //-----------/
-
- /**
- * Method getAccessMode.
- *
- * @return the access mode specified for this class.
- */
- public org.exolab.castor.mapping.AccessMode getAccessMode(
- ) {
- return null;
- }
-
- /**
- * Method getIdentity.
- *
- * @return the identity field, null if this class has no
- * identity.
- */
- public org.exolab.castor.mapping.FieldDescriptor getIdentity(
- ) {
- return super.getIdentity();
- }
-
- /**
- * Method getJavaClass.
- *
- * @return the Java class represented by this descriptor.
- */
- public java.lang.Class getJavaClass(
- ) {
- return uk.ac.vamsas.objects.core.RangeType.class;
- }
-
- /**
- * Method getNameSpacePrefix.
- *
- * @return the namespace prefix to use when marshaling as XML.
- */
- public java.lang.String getNameSpacePrefix(
- ) {
- return _nsPrefix;
- }
-
- /**
- * Method getNameSpaceURI.
- *
- * @return the namespace URI used when marshaling and
- * unmarshaling as XML.
- */
- public java.lang.String getNameSpaceURI(
- ) {
- return _nsURI;
- }
-
- /**
- * Method getValidator.
- *
- * @return a specific validator for the class described by this
- * ClassDescriptor.
- */
- public org.exolab.castor.xml.TypeValidator getValidator(
- ) {
- return this;
- }
-
- /**
- * Method getXMLName.
- *
- * @return the XML Name for the Class being described.
- */
- public java.lang.String getXMLName(
- ) {
- return _xmlName;
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new uk.ac.vamsas.objects.core.Pos();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
+ desc.setRequired(true);
+ desc.setMultivalued(true);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _posList
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(1);
+ { // -- local scope
}
-
- /**
- * Method isElementDefinition.
- *
- * @return true if XML schema definition of this Class is that
- * of a global
- * element or element with anonymous type definition.
- */
- public boolean isElementDefinition(
- ) {
- return _elementDefinition;
+ desc.setValidator(fieldValidator);
+ // -- _segList
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ uk.ac.vamsas.objects.core.Seg.class, "_segList", "seg",
+ org.exolab.castor.xml.NodeType.Element);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ RangeType target = (RangeType) object;
+ return target.getSeg();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ RangeType target = (RangeType) object;
+ target.addSeg((uk.ac.vamsas.objects.core.Seg) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
+
+ public void resetValue(Object object) throws IllegalStateException,
+ IllegalArgumentException {
+ try {
+ RangeType target = (RangeType) object;
+ target.removeAllSeg();
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new uk.ac.vamsas.objects.core.Seg();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
+ desc.setRequired(true);
+ desc.setMultivalued(true);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _segList
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(1);
+ { // -- local scope
}
+ desc.setValidator(fieldValidator);
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ * Method getAccessMode.
+ *
+ * @return the access mode specified for this class.
+ */
+ public org.exolab.castor.mapping.AccessMode getAccessMode() {
+ return null;
+ }
+
+ /**
+ * Method getIdentity.
+ *
+ * @return the identity field, null if this class has no identity.
+ */
+ public org.exolab.castor.mapping.FieldDescriptor getIdentity() {
+ return super.getIdentity();
+ }
+
+ /**
+ * Method getJavaClass.
+ *
+ * @return the Java class represented by this descriptor.
+ */
+ public java.lang.Class getJavaClass() {
+ return uk.ac.vamsas.objects.core.RangeType.class;
+ }
+
+ /**
+ * Method getNameSpacePrefix.
+ *
+ * @return the namespace prefix to use when marshaling as XML.
+ */
+ public java.lang.String getNameSpacePrefix() {
+ return _nsPrefix;
+ }
+
+ /**
+ * Method getNameSpaceURI.
+ *
+ * @return the namespace URI used when marshaling and unmarshaling as XML.
+ */
+ public java.lang.String getNameSpaceURI() {
+ return _nsURI;
+ }
+
+ /**
+ * Method getValidator.
+ *
+ * @return a specific validator for the class described by this
+ * ClassDescriptor.
+ */
+ public org.exolab.castor.xml.TypeValidator getValidator() {
+ return this;
+ }
+
+ /**
+ * Method getXMLName.
+ *
+ * @return the XML Name for the Class being described.
+ */
+ public java.lang.String getXMLName() {
+ return _xmlName;
+ }
+
+ /**
+ * Method isElementDefinition.
+ *
+ * @return true if XML schema definition of this Class is that of a global
+ * element or element with anonymous type definition.
+ */
+ public boolean isElementDefinition() {
+ return _elementDefinition;
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/descriptors/ReferenceTypeDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/ReferenceTypeDescriptor.java
index 2a7a4b2..7c20d00 100644
--- a/src/uk/ac/vamsas/objects/core/descriptors/ReferenceTypeDescriptor.java
+++ b/src/uk/ac/vamsas/objects/core/descriptors/ReferenceTypeDescriptor.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core.descriptors;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import uk.ac.vamsas.objects.core.ReferenceType;
@@ -18,258 +32,253 @@ import uk.ac.vamsas.objects.core.ReferenceType;
*
* @version $Revision$ $Date$
*/
-public class ReferenceTypeDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl {
-
-
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
- * Field _elementDefinition.
- */
- private boolean _elementDefinition;
-
- /**
- * Field _nsPrefix.
- */
- private java.lang.String _nsPrefix;
-
- /**
- * Field _nsURI.
- */
- private java.lang.String _nsURI;
-
- /**
- * Field _xmlName.
- */
- private java.lang.String _xmlName;
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public ReferenceTypeDescriptor() {
- super();
- _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
- _xmlName = "referenceType";
- _elementDefinition = false;
- org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
- org.exolab.castor.mapping.FieldHandler handler = null;
- org.exolab.castor.xml.FieldValidator fieldValidator = null;
- //-- _content
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_content", "PCDATA", org.exolab.castor.xml.NodeType.Text);
- desc.setImmutable(true);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- ReferenceType target = (ReferenceType) object;
- return target.getContent();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- ReferenceType target = (ReferenceType) object;
- target.setContent( (java.lang.String) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return null;
- }
- };
- desc.setHandler(handler);
- addFieldDescriptor(desc);
-
- //-- validation code for: _content
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { //-- local scope
- org.exolab.castor.xml.validators.StringValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.StringValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setWhiteSpace("preserve");
- }
- desc.setValidator(fieldValidator);
- //-- initialize attribute descriptors
-
- //-- _id
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_id", "id", org.exolab.castor.xml.NodeType.Attribute);
- super.setIdentity(desc);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- ReferenceType target = (ReferenceType) object;
- return target.getId();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- ReferenceType target = (ReferenceType) object;
- target.setId( (java.lang.String) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new java.lang.String();
- }
- };
- desc.setHandler(handler);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _id
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { //-- local scope
- org.exolab.castor.xml.validators.IdValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.IdValidator();
- fieldValidator.setValidator(typeValidator);
- }
- desc.setValidator(fieldValidator);
- //-- _refs
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Object.class, "_refs", "refs", org.exolab.castor.xml.NodeType.Attribute);
- desc.setReference(true);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- ReferenceType target = (ReferenceType) object;
- return target.getRefs();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- ReferenceType target = (ReferenceType) object;
- target.addRefs( (java.lang.Object) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException {
- try {
- ReferenceType target = (ReferenceType) object;
- target.removeAllRefs();
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new java.lang.Object();
- }
- };
- desc.setMultivalued(true);
- desc.setHandler(handler);
- desc.setMultivalued(true);
- addFieldDescriptor(desc);
-
- //-- validation code for: _refs
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(0);
- { //-- local scope
- org.exolab.castor.xml.validators.IdRefsValidator typeValidator = new org.exolab.castor.xml.validators.IdRefsValidator();
- fieldValidator.setValidator(typeValidator);
- desc.setValidator(fieldValidator);
- }
- desc.setValidator(fieldValidator);
- //-- initialize element descriptors
-
- }
+public class ReferenceTypeDescriptor extends
+ org.exolab.castor.xml.util.XMLClassDescriptorImpl {
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
- //-----------/
- //- Methods -/
- //-----------/
+ /**
+ * Field _elementDefinition.
+ */
+ private boolean _elementDefinition;
- /**
- * Method getAccessMode.
- *
- * @return the access mode specified for this class.
- */
- public org.exolab.castor.mapping.AccessMode getAccessMode(
- ) {
+ /**
+ * Field _nsPrefix.
+ */
+ private java.lang.String _nsPrefix;
+
+ /**
+ * Field _nsURI.
+ */
+ private java.lang.String _nsURI;
+
+ /**
+ * Field _xmlName.
+ */
+ private java.lang.String _xmlName;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public ReferenceTypeDescriptor() {
+ super();
+ _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
+ _xmlName = "referenceType";
+ _elementDefinition = false;
+ org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
+ org.exolab.castor.mapping.FieldHandler handler = null;
+ org.exolab.castor.xml.FieldValidator fieldValidator = null;
+ // -- _content
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.String.class, "_content", "PCDATA",
+ org.exolab.castor.xml.NodeType.Text);
+ desc.setImmutable(true);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ ReferenceType target = (ReferenceType) object;
+ return target.getContent();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ ReferenceType target = (ReferenceType) object;
+ target.setContent((java.lang.String) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
return null;
- }
+ }
+ };
+ desc.setHandler(handler);
+ addFieldDescriptor(desc);
- /**
- * Method getIdentity.
- *
- * @return the identity field, null if this class has no
- * identity.
- */
- public org.exolab.castor.mapping.FieldDescriptor getIdentity(
- ) {
- return super.getIdentity();
+ // -- validation code for: _content
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ { // -- local scope
+ org.exolab.castor.xml.validators.StringValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.StringValidator();
+ fieldValidator.setValidator(typeValidator);
+ typeValidator.setWhiteSpace("preserve");
}
+ desc.setValidator(fieldValidator);
+ // -- initialize attribute descriptors
- /**
- * Method getJavaClass.
- *
- * @return the Java class represented by this descriptor.
- */
- public java.lang.Class getJavaClass(
- ) {
- return uk.ac.vamsas.objects.core.ReferenceType.class;
- }
+ // -- _id
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.String.class, "_id", "id",
+ org.exolab.castor.xml.NodeType.Attribute);
+ super.setIdentity(desc);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ ReferenceType target = (ReferenceType) object;
+ return target.getId();
+ }
- /**
- * Method getNameSpacePrefix.
- *
- * @return the namespace prefix to use when marshaling as XML.
- */
- public java.lang.String getNameSpacePrefix(
- ) {
- return _nsPrefix;
- }
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ ReferenceType target = (ReferenceType) object;
+ target.setId((java.lang.String) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- /**
- * Method getNameSpaceURI.
- *
- * @return the namespace URI used when marshaling and
- * unmarshaling as XML.
- */
- public java.lang.String getNameSpaceURI(
- ) {
- return _nsURI;
- }
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new java.lang.String();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
- /**
- * Method getValidator.
- *
- * @return a specific validator for the class described by this
- * ClassDescriptor.
- */
- public org.exolab.castor.xml.TypeValidator getValidator(
- ) {
- return this;
+ // -- validation code for: _id
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ { // -- local scope
+ org.exolab.castor.xml.validators.IdValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.IdValidator();
+ fieldValidator.setValidator(typeValidator);
}
+ desc.setValidator(fieldValidator);
+ // -- _refs
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.Object.class, "_refs", "refs",
+ org.exolab.castor.xml.NodeType.Attribute);
+ desc.setReference(true);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ ReferenceType target = (ReferenceType) object;
+ return target.getRefs();
+ }
- /**
- * Method getXMLName.
- *
- * @return the XML Name for the Class being described.
- */
- public java.lang.String getXMLName(
- ) {
- return _xmlName;
- }
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ ReferenceType target = (ReferenceType) object;
+ target.addRefs((java.lang.Object) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- /**
- * Method isElementDefinition.
- *
- * @return true if XML schema definition of this Class is that
- * of a global
- * element or element with anonymous type definition.
- */
- public boolean isElementDefinition(
- ) {
- return _elementDefinition;
+ public void resetValue(Object object) throws IllegalStateException,
+ IllegalArgumentException {
+ try {
+ ReferenceType target = (ReferenceType) object;
+ target.removeAllRefs();
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new java.lang.Object();
+ }
+ };
+ desc.setMultivalued(true);
+ desc.setHandler(handler);
+ desc.setMultivalued(true);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _refs
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(0);
+ { // -- local scope
+ org.exolab.castor.xml.validators.IdRefsValidator typeValidator = new org.exolab.castor.xml.validators.IdRefsValidator();
+ fieldValidator.setValidator(typeValidator);
+ desc.setValidator(fieldValidator);
}
+ desc.setValidator(fieldValidator);
+ // -- initialize element descriptors
+
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ * Method getAccessMode.
+ *
+ * @return the access mode specified for this class.
+ */
+ public org.exolab.castor.mapping.AccessMode getAccessMode() {
+ return null;
+ }
+
+ /**
+ * Method getIdentity.
+ *
+ * @return the identity field, null if this class has no identity.
+ */
+ public org.exolab.castor.mapping.FieldDescriptor getIdentity() {
+ return super.getIdentity();
+ }
+
+ /**
+ * Method getJavaClass.
+ *
+ * @return the Java class represented by this descriptor.
+ */
+ public java.lang.Class getJavaClass() {
+ return uk.ac.vamsas.objects.core.ReferenceType.class;
+ }
+
+ /**
+ * Method getNameSpacePrefix.
+ *
+ * @return the namespace prefix to use when marshaling as XML.
+ */
+ public java.lang.String getNameSpacePrefix() {
+ return _nsPrefix;
+ }
+
+ /**
+ * Method getNameSpaceURI.
+ *
+ * @return the namespace URI used when marshaling and unmarshaling as XML.
+ */
+ public java.lang.String getNameSpaceURI() {
+ return _nsURI;
+ }
+
+ /**
+ * Method getValidator.
+ *
+ * @return a specific validator for the class described by this
+ * ClassDescriptor.
+ */
+ public org.exolab.castor.xml.TypeValidator getValidator() {
+ return this;
+ }
+
+ /**
+ * Method getXMLName.
+ *
+ * @return the XML Name for the Class being described.
+ */
+ public java.lang.String getXMLName() {
+ return _xmlName;
+ }
+
+ /**
+ * Method isElementDefinition.
+ *
+ * @return true if XML schema definition of this Class is that of a global
+ * element or element with anonymous type definition.
+ */
+ public boolean isElementDefinition() {
+ return _elementDefinition;
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/descriptors/ScoreDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/ScoreDescriptor.java
index 06fac17..549384a 100644
--- a/src/uk/ac/vamsas/objects/core/descriptors/ScoreDescriptor.java
+++ b/src/uk/ac/vamsas/objects/core/descriptors/ScoreDescriptor.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core.descriptors;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import uk.ac.vamsas.objects.core.Score;
@@ -18,219 +32,212 @@ import uk.ac.vamsas.objects.core.Score;
*
* @version $Revision$ $Date$
*/
-public class ScoreDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl {
-
-
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
- * Field _elementDefinition.
- */
- private boolean _elementDefinition;
-
- /**
- * Field _nsPrefix.
- */
- private java.lang.String _nsPrefix;
-
- /**
- * Field _nsURI.
- */
- private java.lang.String _nsURI;
-
- /**
- * Field _xmlName.
- */
- private java.lang.String _xmlName;
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public ScoreDescriptor() {
- super();
- _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
- _xmlName = "score";
- _elementDefinition = true;
- org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
- org.exolab.castor.mapping.FieldHandler handler = null;
- org.exolab.castor.xml.FieldValidator fieldValidator = null;
- //-- _content
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Float.TYPE, "_content", "PCDATA", org.exolab.castor.xml.NodeType.Text);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- Score target = (Score) object;
- if (!target.hasContent()) { return null; }
- return new java.lang.Float(target.getContent());
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- Score target = (Score) object;
- // if null, use delete method for optional primitives
- if (value == null) {
- target.deleteContent();
- return;
- }
- target.setContent( ((java.lang.Float) value).floatValue());
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return null;
- }
- };
- desc.setHandler(handler);
- addFieldDescriptor(desc);
-
- //-- validation code for: _content
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { //-- local scope
- org.exolab.castor.xml.validators.FloatValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.FloatValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setMinInclusive((float) -3.4028235E38);
- typeValidator.setMaxInclusive((float) 3.4028235E38);
+public class ScoreDescriptor extends
+ org.exolab.castor.xml.util.XMLClassDescriptorImpl {
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * Field _elementDefinition.
+ */
+ private boolean _elementDefinition;
+
+ /**
+ * Field _nsPrefix.
+ */
+ private java.lang.String _nsPrefix;
+
+ /**
+ * Field _nsURI.
+ */
+ private java.lang.String _nsURI;
+
+ /**
+ * Field _xmlName.
+ */
+ private java.lang.String _xmlName;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public ScoreDescriptor() {
+ super();
+ _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
+ _xmlName = "score";
+ _elementDefinition = true;
+ org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
+ org.exolab.castor.mapping.FieldHandler handler = null;
+ org.exolab.castor.xml.FieldValidator fieldValidator = null;
+ // -- _content
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.Float.TYPE, "_content", "PCDATA",
+ org.exolab.castor.xml.NodeType.Text);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ Score target = (Score) object;
+ if (!target.hasContent()) {
+ return null;
}
- desc.setValidator(fieldValidator);
- //-- initialize attribute descriptors
-
- //-- _name
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_name", "name", org.exolab.castor.xml.NodeType.Attribute);
- desc.setImmutable(true);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- Score target = (Score) object;
- return target.getName();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- Score target = (Score) object;
- target.setName( (java.lang.String) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _name
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { //-- local scope
- org.exolab.castor.xml.validators.StringValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.StringValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setWhiteSpace("preserve");
+ return new java.lang.Float(target.getContent());
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ Score target = (Score) object;
+ // if null, use delete method for optional primitives
+ if (value == null) {
+ target.deleteContent();
+ return;
+ }
+ target.setContent(((java.lang.Float) value).floatValue());
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
- //-- initialize element descriptors
-
- }
+ }
-
- //-----------/
- //- Methods -/
- //-----------/
-
- /**
- * Method getAccessMode.
- *
- * @return the access mode specified for this class.
- */
- public org.exolab.castor.mapping.AccessMode getAccessMode(
- ) {
+ public java.lang.Object newInstance(java.lang.Object parent) {
return null;
+ }
+ };
+ desc.setHandler(handler);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _content
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ { // -- local scope
+ org.exolab.castor.xml.validators.FloatValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.FloatValidator();
+ fieldValidator.setValidator(typeValidator);
+ typeValidator.setMinInclusive((float) -3.4028235E38);
+ typeValidator.setMaxInclusive((float) 3.4028235E38);
}
+ desc.setValidator(fieldValidator);
+ // -- initialize attribute descriptors
+
+ // -- _name
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.String.class, "_name", "name",
+ org.exolab.castor.xml.NodeType.Attribute);
+ desc.setImmutable(true);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ Score target = (Score) object;
+ return target.getName();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ Score target = (Score) object;
+ target.setName((java.lang.String) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- /**
- * Method getIdentity.
- *
- * @return the identity field, null if this class has no
- * identity.
- */
- public org.exolab.castor.mapping.FieldDescriptor getIdentity(
- ) {
- return super.getIdentity();
- }
-
- /**
- * Method getJavaClass.
- *
- * @return the Java class represented by this descriptor.
- */
- public java.lang.Class getJavaClass(
- ) {
- return uk.ac.vamsas.objects.core.Score.class;
- }
-
- /**
- * Method getNameSpacePrefix.
- *
- * @return the namespace prefix to use when marshaling as XML.
- */
- public java.lang.String getNameSpacePrefix(
- ) {
- return _nsPrefix;
- }
-
- /**
- * Method getNameSpaceURI.
- *
- * @return the namespace URI used when marshaling and
- * unmarshaling as XML.
- */
- public java.lang.String getNameSpaceURI(
- ) {
- return _nsURI;
- }
-
- /**
- * Method getValidator.
- *
- * @return a specific validator for the class described by this
- * ClassDescriptor.
- */
- public org.exolab.castor.xml.TypeValidator getValidator(
- ) {
- return this;
- }
-
- /**
- * Method getXMLName.
- *
- * @return the XML Name for the Class being described.
- */
- public java.lang.String getXMLName(
- ) {
- return _xmlName;
- }
-
- /**
- * Method isElementDefinition.
- *
- * @return true if XML schema definition of this Class is that
- * of a global
- * element or element with anonymous type definition.
- */
- public boolean isElementDefinition(
- ) {
- return _elementDefinition;
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return null;
+ }
+ };
+ desc.setHandler(handler);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _name
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ { // -- local scope
+ org.exolab.castor.xml.validators.StringValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.StringValidator();
+ fieldValidator.setValidator(typeValidator);
+ typeValidator.setWhiteSpace("preserve");
}
+ desc.setValidator(fieldValidator);
+ // -- initialize element descriptors
+
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ * Method getAccessMode.
+ *
+ * @return the access mode specified for this class.
+ */
+ public org.exolab.castor.mapping.AccessMode getAccessMode() {
+ return null;
+ }
+
+ /**
+ * Method getIdentity.
+ *
+ * @return the identity field, null if this class has no identity.
+ */
+ public org.exolab.castor.mapping.FieldDescriptor getIdentity() {
+ return super.getIdentity();
+ }
+
+ /**
+ * Method getJavaClass.
+ *
+ * @return the Java class represented by this descriptor.
+ */
+ public java.lang.Class getJavaClass() {
+ return uk.ac.vamsas.objects.core.Score.class;
+ }
+
+ /**
+ * Method getNameSpacePrefix.
+ *
+ * @return the namespace prefix to use when marshaling as XML.
+ */
+ public java.lang.String getNameSpacePrefix() {
+ return _nsPrefix;
+ }
+
+ /**
+ * Method getNameSpaceURI.
+ *
+ * @return the namespace URI used when marshaling and unmarshaling as XML.
+ */
+ public java.lang.String getNameSpaceURI() {
+ return _nsURI;
+ }
+
+ /**
+ * Method getValidator.
+ *
+ * @return a specific validator for the class described by this
+ * ClassDescriptor.
+ */
+ public org.exolab.castor.xml.TypeValidator getValidator() {
+ return this;
+ }
+
+ /**
+ * Method getXMLName.
+ *
+ * @return the XML Name for the Class being described.
+ */
+ public java.lang.String getXMLName() {
+ return _xmlName;
+ }
+
+ /**
+ * Method isElementDefinition.
+ *
+ * @return true if XML schema definition of this Class is that of a global
+ * element or element with anonymous type definition.
+ */
+ public boolean isElementDefinition() {
+ return _elementDefinition;
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/descriptors/SegDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/SegDescriptor.java
index c489fff..6aa64fd 100644
--- a/src/uk/ac/vamsas/objects/core/descriptors/SegDescriptor.java
+++ b/src/uk/ac/vamsas/objects/core/descriptors/SegDescriptor.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core.descriptors;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import uk.ac.vamsas.objects.core.Seg;
@@ -18,267 +32,273 @@ import uk.ac.vamsas.objects.core.Seg;
*
* @version $Revision$ $Date$
*/
-public class SegDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl {
-
-
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
- * Field _elementDefinition.
- */
- private boolean _elementDefinition;
-
- /**
- * Field _nsPrefix.
- */
- private java.lang.String _nsPrefix;
-
- /**
- * Field _nsURI.
- */
- private java.lang.String _nsURI;
-
- /**
- * Field _xmlName.
- */
- private java.lang.String _xmlName;
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public SegDescriptor() {
- super();
- _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
- _xmlName = "seg";
- _elementDefinition = true;
- org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
- org.exolab.castor.mapping.FieldHandler handler = null;
- org.exolab.castor.xml.FieldValidator fieldValidator = null;
- //-- initialize attribute descriptors
-
- //-- _start
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_start", "start", org.exolab.castor.xml.NodeType.Attribute);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- Seg target = (Seg) object;
- if (!target.hasStart()) { return null; }
- return new java.lang.Integer(target.getStart());
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- Seg target = (Seg) object;
- // ignore null values for non optional primitives
- if (value == null) { return; }
-
- target.setStart( ((java.lang.Integer) value).intValue());
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setRequired(true);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _start
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(1);
- { //-- local scope
- org.exolab.castor.xml.validators.IntValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.IntValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setMinInclusive(-2147483648);
- typeValidator.setMaxInclusive(2147483647);
- }
- desc.setValidator(fieldValidator);
- //-- _end
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_end", "end", org.exolab.castor.xml.NodeType.Attribute);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- Seg target = (Seg) object;
- if (!target.hasEnd()) { return null; }
- return new java.lang.Integer(target.getEnd());
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- Seg target = (Seg) object;
- // ignore null values for non optional primitives
- if (value == null) { return; }
-
- target.setEnd( ((java.lang.Integer) value).intValue());
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setRequired(true);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _end
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(1);
- { //-- local scope
- org.exolab.castor.xml.validators.IntValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.IntValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setMinInclusive(-2147483648);
- typeValidator.setMaxInclusive(2147483647);
+public class SegDescriptor extends
+ org.exolab.castor.xml.util.XMLClassDescriptorImpl {
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * Field _elementDefinition.
+ */
+ private boolean _elementDefinition;
+
+ /**
+ * Field _nsPrefix.
+ */
+ private java.lang.String _nsPrefix;
+
+ /**
+ * Field _nsURI.
+ */
+ private java.lang.String _nsURI;
+
+ /**
+ * Field _xmlName.
+ */
+ private java.lang.String _xmlName;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public SegDescriptor() {
+ super();
+ _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
+ _xmlName = "seg";
+ _elementDefinition = true;
+ org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
+ org.exolab.castor.mapping.FieldHandler handler = null;
+ org.exolab.castor.xml.FieldValidator fieldValidator = null;
+ // -- initialize attribute descriptors
+
+ // -- _start
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.Integer.TYPE, "_start", "start",
+ org.exolab.castor.xml.NodeType.Attribute);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ Seg target = (Seg) object;
+ if (!target.hasStart()) {
+ return null;
}
- desc.setValidator(fieldValidator);
- //-- _inclusive
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_inclusive", "inclusive", org.exolab.castor.xml.NodeType.Attribute);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- Seg target = (Seg) object;
- if (!target.hasInclusive()) { return null; }
- return (target.getInclusive() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE);
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- Seg target = (Seg) object;
- // ignore null values for non optional primitives
- if (value == null) { return; }
-
- target.setInclusive( ((java.lang.Boolean) value).booleanValue());
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setRequired(true);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _inclusive
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(1);
- { //-- local scope
- org.exolab.castor.xml.validators.BooleanValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
- fieldValidator.setValidator(typeValidator);
+ return new java.lang.Integer(target.getStart());
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ Seg target = (Seg) object;
+ // ignore null values for non optional primitives
+ if (value == null) {
+ return;
+ }
+
+ target.setStart(((java.lang.Integer) value).intValue());
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
- //-- initialize element descriptors
-
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return null;
+ }
+ };
+ desc.setHandler(handler);
+ desc.setRequired(true);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _start
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(1);
+ { // -- local scope
+ org.exolab.castor.xml.validators.IntValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.IntValidator();
+ fieldValidator.setValidator(typeValidator);
+ typeValidator.setMinInclusive(-2147483648);
+ typeValidator.setMaxInclusive(2147483647);
}
+ desc.setValidator(fieldValidator);
+ // -- _end
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.Integer.TYPE, "_end", "end",
+ org.exolab.castor.xml.NodeType.Attribute);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ Seg target = (Seg) object;
+ if (!target.hasEnd()) {
+ return null;
+ }
+ return new java.lang.Integer(target.getEnd());
+ }
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ Seg target = (Seg) object;
+ // ignore null values for non optional primitives
+ if (value == null) {
+ return;
+ }
- //-----------/
- //- Methods -/
- //-----------/
+ target.setEnd(((java.lang.Integer) value).intValue());
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- /**
- * Method getAccessMode.
- *
- * @return the access mode specified for this class.
- */
- public org.exolab.castor.mapping.AccessMode getAccessMode(
- ) {
+ public java.lang.Object newInstance(java.lang.Object parent) {
return null;
- }
+ }
+ };
+ desc.setHandler(handler);
+ desc.setRequired(true);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
- /**
- * Method getIdentity.
- *
- * @return the identity field, null if this class has no
- * identity.
- */
- public org.exolab.castor.mapping.FieldDescriptor getIdentity(
- ) {
- return super.getIdentity();
+ // -- validation code for: _end
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(1);
+ { // -- local scope
+ org.exolab.castor.xml.validators.IntValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.IntValidator();
+ fieldValidator.setValidator(typeValidator);
+ typeValidator.setMinInclusive(-2147483648);
+ typeValidator.setMaxInclusive(2147483647);
}
+ desc.setValidator(fieldValidator);
+ // -- _inclusive
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.Boolean.TYPE, "_inclusive", "inclusive",
+ org.exolab.castor.xml.NodeType.Attribute);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ Seg target = (Seg) object;
+ if (!target.hasInclusive()) {
+ return null;
+ }
+ return (target.getInclusive() ? java.lang.Boolean.TRUE
+ : java.lang.Boolean.FALSE);
+ }
- /**
- * Method getJavaClass.
- *
- * @return the Java class represented by this descriptor.
- */
- public java.lang.Class getJavaClass(
- ) {
- return uk.ac.vamsas.objects.core.Seg.class;
- }
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ Seg target = (Seg) object;
+ // ignore null values for non optional primitives
+ if (value == null) {
+ return;
+ }
- /**
- * Method getNameSpacePrefix.
- *
- * @return the namespace prefix to use when marshaling as XML.
- */
- public java.lang.String getNameSpacePrefix(
- ) {
- return _nsPrefix;
- }
+ target.setInclusive(((java.lang.Boolean) value).booleanValue());
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- /**
- * Method getNameSpaceURI.
- *
- * @return the namespace URI used when marshaling and
- * unmarshaling as XML.
- */
- public java.lang.String getNameSpaceURI(
- ) {
- return _nsURI;
- }
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return null;
+ }
+ };
+ desc.setHandler(handler);
+ desc.setRequired(true);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
- /**
- * Method getValidator.
- *
- * @return a specific validator for the class described by this
- * ClassDescriptor.
- */
- public org.exolab.castor.xml.TypeValidator getValidator(
- ) {
- return this;
+ // -- validation code for: _inclusive
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(1);
+ { // -- local scope
+ org.exolab.castor.xml.validators.BooleanValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
+ fieldValidator.setValidator(typeValidator);
}
+ desc.setValidator(fieldValidator);
+ // -- initialize element descriptors
- /**
- * Method getXMLName.
- *
- * @return the XML Name for the Class being described.
- */
- public java.lang.String getXMLName(
- ) {
- return _xmlName;
- }
+ }
- /**
- * Method isElementDefinition.
- *
- * @return true if XML schema definition of this Class is that
- * of a global
- * element or element with anonymous type definition.
- */
- public boolean isElementDefinition(
- ) {
- return _elementDefinition;
- }
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ * Method getAccessMode.
+ *
+ * @return the access mode specified for this class.
+ */
+ public org.exolab.castor.mapping.AccessMode getAccessMode() {
+ return null;
+ }
+
+ /**
+ * Method getIdentity.
+ *
+ * @return the identity field, null if this class has no identity.
+ */
+ public org.exolab.castor.mapping.FieldDescriptor getIdentity() {
+ return super.getIdentity();
+ }
+
+ /**
+ * Method getJavaClass.
+ *
+ * @return the Java class represented by this descriptor.
+ */
+ public java.lang.Class getJavaClass() {
+ return uk.ac.vamsas.objects.core.Seg.class;
+ }
+
+ /**
+ * Method getNameSpacePrefix.
+ *
+ * @return the namespace prefix to use when marshaling as XML.
+ */
+ public java.lang.String getNameSpacePrefix() {
+ return _nsPrefix;
+ }
+
+ /**
+ * Method getNameSpaceURI.
+ *
+ * @return the namespace URI used when marshaling and unmarshaling as XML.
+ */
+ public java.lang.String getNameSpaceURI() {
+ return _nsURI;
+ }
+
+ /**
+ * Method getValidator.
+ *
+ * @return a specific validator for the class described by this
+ * ClassDescriptor.
+ */
+ public org.exolab.castor.xml.TypeValidator getValidator() {
+ return this;
+ }
+
+ /**
+ * Method getXMLName.
+ *
+ * @return the XML Name for the Class being described.
+ */
+ public java.lang.String getXMLName() {
+ return _xmlName;
+ }
+
+ /**
+ * Method isElementDefinition.
+ *
+ * @return true if XML schema definition of this Class is that of a global
+ * element or element with anonymous type definition.
+ */
+ public boolean isElementDefinition() {
+ return _elementDefinition;
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/descriptors/SequenceDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/SequenceDescriptor.java
index d18b8c1..d67e4e8 100644
--- a/src/uk/ac/vamsas/objects/core/descriptors/SequenceDescriptor.java
+++ b/src/uk/ac/vamsas/objects/core/descriptors/SequenceDescriptor.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core.descriptors;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import uk.ac.vamsas.objects.core.Sequence;
@@ -18,303 +32,302 @@ import uk.ac.vamsas.objects.core.Sequence;
*
* @version $Revision$ $Date$
*/
-public class SequenceDescriptor extends uk.ac.vamsas.objects.core.descriptors.SequenceTypeDescriptor {
-
-
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
- * Field _elementDefinition.
- */
- private boolean _elementDefinition;
-
- /**
- * Field _nsPrefix.
- */
- private java.lang.String _nsPrefix;
-
- /**
- * Field _nsURI.
- */
- private java.lang.String _nsURI;
-
- /**
- * Field _xmlName.
- */
- private java.lang.String _xmlName;
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public SequenceDescriptor() {
- super();
- setExtendsWithoutFlatten(new uk.ac.vamsas.objects.core.descriptors.SequenceTypeDescriptor());
- _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
- _xmlName = "Sequence";
- _elementDefinition = true;
-
- //-- set grouping compositor
- setCompositorAsSequence();
- org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
- org.exolab.castor.mapping.FieldHandler handler = null;
- org.exolab.castor.xml.FieldValidator fieldValidator = null;
- //-- initialize attribute descriptors
-
- //-- _id
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_id", "id", org.exolab.castor.xml.NodeType.Attribute);
- super.setIdentity(desc);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- Sequence target = (Sequence) object;
- return target.getId();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- Sequence target = (Sequence) object;
- target.setId( (java.lang.String) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new java.lang.String();
- }
- };
- desc.setHandler(handler);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _id
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { //-- local scope
- org.exolab.castor.xml.validators.IdValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.IdValidator();
- fieldValidator.setValidator(typeValidator);
+public class SequenceDescriptor extends
+ uk.ac.vamsas.objects.core.descriptors.SequenceTypeDescriptor {
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * Field _elementDefinition.
+ */
+ private boolean _elementDefinition;
+
+ /**
+ * Field _nsPrefix.
+ */
+ private java.lang.String _nsPrefix;
+
+ /**
+ * Field _nsURI.
+ */
+ private java.lang.String _nsURI;
+
+ /**
+ * Field _xmlName.
+ */
+ private java.lang.String _xmlName;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public SequenceDescriptor() {
+ super();
+ setExtendsWithoutFlatten(new uk.ac.vamsas.objects.core.descriptors.SequenceTypeDescriptor());
+ _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
+ _xmlName = "Sequence";
+ _elementDefinition = true;
+
+ // -- set grouping compositor
+ setCompositorAsSequence();
+ org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
+ org.exolab.castor.mapping.FieldHandler handler = null;
+ org.exolab.castor.xml.FieldValidator fieldValidator = null;
+ // -- initialize attribute descriptors
+
+ // -- _id
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.String.class, "_id", "id",
+ org.exolab.castor.xml.NodeType.Attribute);
+ super.setIdentity(desc);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ Sequence target = (Sequence) object;
+ return target.getId();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ Sequence target = (Sequence) object;
+ target.setId((java.lang.String) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
- //-- _dictionary
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_dictionary", "dictionary", org.exolab.castor.xml.NodeType.Attribute);
- desc.setImmutable(true);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- Sequence target = (Sequence) object;
- return target.getDictionary();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- Sequence target = (Sequence) object;
- target.setDictionary( (java.lang.String) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setRequired(true);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _dictionary
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(1);
- { //-- local scope
- org.exolab.castor.xml.validators.StringValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.StringValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setWhiteSpace("preserve");
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new java.lang.String();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _id
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ { // -- local scope
+ org.exolab.castor.xml.validators.IdValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.IdValidator();
+ fieldValidator.setValidator(typeValidator);
+ }
+ desc.setValidator(fieldValidator);
+ // -- _dictionary
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.String.class, "_dictionary", "dictionary",
+ org.exolab.castor.xml.NodeType.Attribute);
+ desc.setImmutable(true);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ Sequence target = (Sequence) object;
+ return target.getDictionary();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ Sequence target = (Sequence) object;
+ target.setDictionary((java.lang.String) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
- //-- initialize element descriptors
-
- //-- _dbRefList
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.DbRef.class, "_dbRefList", "dbRef", org.exolab.castor.xml.NodeType.Element);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- Sequence target = (Sequence) object;
- return target.getDbRef();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- Sequence target = (Sequence) object;
- target.addDbRef( (uk.ac.vamsas.objects.core.DbRef) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException {
- try {
- Sequence target = (Sequence) object;
- target.removeAllDbRef();
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new uk.ac.vamsas.objects.core.DbRef();
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
- desc.setMultivalued(true);
- addFieldDescriptor(desc);
-
- //-- validation code for: _dbRefList
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(0);
- { //-- local scope
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return null;
+ }
+ };
+ desc.setHandler(handler);
+ desc.setRequired(true);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _dictionary
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(1);
+ { // -- local scope
+ org.exolab.castor.xml.validators.StringValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.StringValidator();
+ fieldValidator.setValidator(typeValidator);
+ typeValidator.setWhiteSpace("preserve");
+ }
+ desc.setValidator(fieldValidator);
+ // -- initialize element descriptors
+
+ // -- _dbRefList
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ uk.ac.vamsas.objects.core.DbRef.class, "_dbRefList", "dbRef",
+ org.exolab.castor.xml.NodeType.Element);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ Sequence target = (Sequence) object;
+ return target.getDbRef();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ Sequence target = (Sequence) object;
+ target.addDbRef((uk.ac.vamsas.objects.core.DbRef) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
- //-- _vxrefList
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Vxref.class, "_vxrefList", "vxref", org.exolab.castor.xml.NodeType.Element);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- Sequence target = (Sequence) object;
- return target.getVxref();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- Sequence target = (Sequence) object;
- target.addVxref( (uk.ac.vamsas.objects.core.Vxref) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException {
- try {
- Sequence target = (Sequence) object;
- target.removeAllVxref();
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new uk.ac.vamsas.objects.core.Vxref();
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
- desc.setMultivalued(true);
- addFieldDescriptor(desc);
-
- //-- validation code for: _vxrefList
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(0);
- { //-- local scope
+ }
+
+ public void resetValue(Object object) throws IllegalStateException,
+ IllegalArgumentException {
+ try {
+ Sequence target = (Sequence) object;
+ target.removeAllDbRef();
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new uk.ac.vamsas.objects.core.DbRef();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
+ desc.setMultivalued(true);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _dbRefList
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(0);
+ { // -- local scope
}
+ desc.setValidator(fieldValidator);
+ // -- _vxrefList
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ uk.ac.vamsas.objects.core.Vxref.class, "_vxrefList", "vxref",
+ org.exolab.castor.xml.NodeType.Element);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ Sequence target = (Sequence) object;
+ return target.getVxref();
+ }
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ Sequence target = (Sequence) object;
+ target.addVxref((uk.ac.vamsas.objects.core.Vxref) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- //-----------/
- //- Methods -/
- //-----------/
+ public void resetValue(Object object) throws IllegalStateException,
+ IllegalArgumentException {
+ try {
+ Sequence target = (Sequence) object;
+ target.removeAllVxref();
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- /**
- * Method getAccessMode.
- *
- * @return the access mode specified for this class.
- */
- public org.exolab.castor.mapping.AccessMode getAccessMode(
- ) {
- return null;
- }
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new uk.ac.vamsas.objects.core.Vxref();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
+ desc.setMultivalued(true);
+ addFieldDescriptor(desc);
- /**
- * Method getIdentity.
- *
- * @return the identity field, null if this class has no
- * identity.
- */
- public org.exolab.castor.mapping.FieldDescriptor getIdentity(
- ) {
- return super.getIdentity();
+ // -- validation code for: _vxrefList
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(0);
+ { // -- local scope
}
+ desc.setValidator(fieldValidator);
+ }
- /**
- * Method getJavaClass.
- *
- * @return the Java class represented by this descriptor.
- */
- public java.lang.Class getJavaClass(
- ) {
- return uk.ac.vamsas.objects.core.Sequence.class;
- }
+ // -----------/
+ // - Methods -/
+ // -----------/
- /**
- * Method getNameSpacePrefix.
- *
- * @return the namespace prefix to use when marshaling as XML.
- */
- public java.lang.String getNameSpacePrefix(
- ) {
- return _nsPrefix;
- }
+ /**
+ * Method getAccessMode.
+ *
+ * @return the access mode specified for this class.
+ */
+ public org.exolab.castor.mapping.AccessMode getAccessMode() {
+ return null;
+ }
- /**
- * Method getNameSpaceURI.
- *
- * @return the namespace URI used when marshaling and
- * unmarshaling as XML.
- */
- public java.lang.String getNameSpaceURI(
- ) {
- return _nsURI;
- }
+ /**
+ * Method getIdentity.
+ *
+ * @return the identity field, null if this class has no identity.
+ */
+ public org.exolab.castor.mapping.FieldDescriptor getIdentity() {
+ return super.getIdentity();
+ }
- /**
- * Method getValidator.
- *
- * @return a specific validator for the class described by this
- * ClassDescriptor.
- */
- public org.exolab.castor.xml.TypeValidator getValidator(
- ) {
- return this;
- }
+ /**
+ * Method getJavaClass.
+ *
+ * @return the Java class represented by this descriptor.
+ */
+ public java.lang.Class getJavaClass() {
+ return uk.ac.vamsas.objects.core.Sequence.class;
+ }
- /**
- * Method getXMLName.
- *
- * @return the XML Name for the Class being described.
- */
- public java.lang.String getXMLName(
- ) {
- return _xmlName;
- }
+ /**
+ * Method getNameSpacePrefix.
+ *
+ * @return the namespace prefix to use when marshaling as XML.
+ */
+ public java.lang.String getNameSpacePrefix() {
+ return _nsPrefix;
+ }
- /**
- * Method isElementDefinition.
- *
- * @return true if XML schema definition of this Class is that
- * of a global
- * element or element with anonymous type definition.
- */
- public boolean isElementDefinition(
- ) {
- return _elementDefinition;
- }
+ /**
+ * Method getNameSpaceURI.
+ *
+ * @return the namespace URI used when marshaling and unmarshaling as XML.
+ */
+ public java.lang.String getNameSpaceURI() {
+ return _nsURI;
+ }
+
+ /**
+ * Method getValidator.
+ *
+ * @return a specific validator for the class described by this
+ * ClassDescriptor.
+ */
+ public org.exolab.castor.xml.TypeValidator getValidator() {
+ return this;
+ }
+
+ /**
+ * Method getXMLName.
+ *
+ * @return the XML Name for the Class being described.
+ */
+ public java.lang.String getXMLName() {
+ return _xmlName;
+ }
+
+ /**
+ * Method isElementDefinition.
+ *
+ * @return true if XML schema definition of this Class is that of a global
+ * element or element with anonymous type definition.
+ */
+ public boolean isElementDefinition() {
+ return _elementDefinition;
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/descriptors/SequenceMappingDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/SequenceMappingDescriptor.java
index 396515e..e5faaad 100644
--- a/src/uk/ac/vamsas/objects/core/descriptors/SequenceMappingDescriptor.java
+++ b/src/uk/ac/vamsas/objects/core/descriptors/SequenceMappingDescriptor.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core.descriptors;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import uk.ac.vamsas.objects.core.SequenceMapping;
@@ -18,291 +32,286 @@ import uk.ac.vamsas.objects.core.SequenceMapping;
*
* @version $Revision$ $Date$
*/
-public class SequenceMappingDescriptor extends uk.ac.vamsas.objects.core.descriptors.MapTypeDescriptor {
-
-
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
- * Field _elementDefinition.
- */
- private boolean _elementDefinition;
-
- /**
- * Field _nsPrefix.
- */
- private java.lang.String _nsPrefix;
-
- /**
- * Field _nsURI.
- */
- private java.lang.String _nsURI;
-
- /**
- * Field _xmlName.
- */
- private java.lang.String _xmlName;
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public SequenceMappingDescriptor() {
- super();
- setExtendsWithoutFlatten(new uk.ac.vamsas.objects.core.descriptors.MapTypeDescriptor());
- _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
- _xmlName = "sequenceMapping";
- _elementDefinition = true;
-
- //-- set grouping compositor
- setCompositorAsSequence();
- org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
- org.exolab.castor.mapping.FieldHandler handler = null;
- org.exolab.castor.xml.FieldValidator fieldValidator = null;
- //-- initialize attribute descriptors
-
- //-- _loc
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Object.class, "_loc", "loc", org.exolab.castor.xml.NodeType.Attribute);
- desc.setReference(true);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- SequenceMapping target = (SequenceMapping) object;
- return target.getLoc();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- SequenceMapping target = (SequenceMapping) object;
- target.setLoc( (java.lang.Object) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new java.lang.Object();
- }
- };
- desc.setHandler(handler);
- desc.setRequired(true);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _loc
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(1);
- { //-- local scope
- org.exolab.castor.xml.validators.IdRefValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.IdRefValidator();
- fieldValidator.setValidator(typeValidator);
- }
- desc.setValidator(fieldValidator);
- //-- _map
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Object.class, "_map", "map", org.exolab.castor.xml.NodeType.Attribute);
- desc.setReference(true);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- SequenceMapping target = (SequenceMapping) object;
- return target.getMap();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- SequenceMapping target = (SequenceMapping) object;
- target.setMap( (java.lang.Object) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new java.lang.Object();
- }
- };
- desc.setHandler(handler);
- desc.setRequired(true);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _map
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(1);
- { //-- local scope
- org.exolab.castor.xml.validators.IdRefValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.IdRefValidator();
- fieldValidator.setValidator(typeValidator);
- }
- desc.setValidator(fieldValidator);
- //-- _id
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_id", "id", org.exolab.castor.xml.NodeType.Attribute);
- super.setIdentity(desc);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- SequenceMapping target = (SequenceMapping) object;
- return target.getId();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- SequenceMapping target = (SequenceMapping) object;
- target.setId( (java.lang.String) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new java.lang.String();
- }
- };
- desc.setHandler(handler);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _id
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { //-- local scope
- org.exolab.castor.xml.validators.IdValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.IdValidator();
- fieldValidator.setValidator(typeValidator);
- }
- desc.setValidator(fieldValidator);
- //-- initialize element descriptors
-
- //-- _provenance
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Provenance.class, "_provenance", "Provenance", org.exolab.castor.xml.NodeType.Element);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- SequenceMapping target = (SequenceMapping) object;
- return target.getProvenance();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- SequenceMapping target = (SequenceMapping) object;
- target.setProvenance( (uk.ac.vamsas.objects.core.Provenance) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new uk.ac.vamsas.objects.core.Provenance();
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
- desc.setRequired(true);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _provenance
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(1);
- { //-- local scope
+public class SequenceMappingDescriptor extends
+ uk.ac.vamsas.objects.core.descriptors.MapTypeDescriptor {
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * Field _elementDefinition.
+ */
+ private boolean _elementDefinition;
+
+ /**
+ * Field _nsPrefix.
+ */
+ private java.lang.String _nsPrefix;
+
+ /**
+ * Field _nsURI.
+ */
+ private java.lang.String _nsURI;
+
+ /**
+ * Field _xmlName.
+ */
+ private java.lang.String _xmlName;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public SequenceMappingDescriptor() {
+ super();
+ setExtendsWithoutFlatten(new uk.ac.vamsas.objects.core.descriptors.MapTypeDescriptor());
+ _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
+ _xmlName = "sequenceMapping";
+ _elementDefinition = true;
+
+ // -- set grouping compositor
+ setCompositorAsSequence();
+ org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
+ org.exolab.castor.mapping.FieldHandler handler = null;
+ org.exolab.castor.xml.FieldValidator fieldValidator = null;
+ // -- initialize attribute descriptors
+
+ // -- _loc
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.Object.class, "_loc", "loc",
+ org.exolab.castor.xml.NodeType.Attribute);
+ desc.setReference(true);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ SequenceMapping target = (SequenceMapping) object;
+ return target.getLoc();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ SequenceMapping target = (SequenceMapping) object;
+ target.setLoc((java.lang.Object) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new java.lang.Object();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setRequired(true);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _loc
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(1);
+ { // -- local scope
+ org.exolab.castor.xml.validators.IdRefValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.IdRefValidator();
+ fieldValidator.setValidator(typeValidator);
}
+ desc.setValidator(fieldValidator);
+ // -- _map
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.Object.class, "_map", "map",
+ org.exolab.castor.xml.NodeType.Attribute);
+ desc.setReference(true);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ SequenceMapping target = (SequenceMapping) object;
+ return target.getMap();
+ }
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ SequenceMapping target = (SequenceMapping) object;
+ target.setMap((java.lang.Object) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- //-----------/
- //- Methods -/
- //-----------/
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new java.lang.Object();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setRequired(true);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
- /**
- * Method getAccessMode.
- *
- * @return the access mode specified for this class.
- */
- public org.exolab.castor.mapping.AccessMode getAccessMode(
- ) {
- return null;
+ // -- validation code for: _map
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(1);
+ { // -- local scope
+ org.exolab.castor.xml.validators.IdRefValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.IdRefValidator();
+ fieldValidator.setValidator(typeValidator);
}
+ desc.setValidator(fieldValidator);
+ // -- _id
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.String.class, "_id", "id",
+ org.exolab.castor.xml.NodeType.Attribute);
+ super.setIdentity(desc);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ SequenceMapping target = (SequenceMapping) object;
+ return target.getId();
+ }
- /**
- * Method getIdentity.
- *
- * @return the identity field, null if this class has no
- * identity.
- */
- public org.exolab.castor.mapping.FieldDescriptor getIdentity(
- ) {
- return super.getIdentity();
- }
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ SequenceMapping target = (SequenceMapping) object;
+ target.setId((java.lang.String) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- /**
- * Method getJavaClass.
- *
- * @return the Java class represented by this descriptor.
- */
- public java.lang.Class getJavaClass(
- ) {
- return uk.ac.vamsas.objects.core.SequenceMapping.class;
- }
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new java.lang.String();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
- /**
- * Method getNameSpacePrefix.
- *
- * @return the namespace prefix to use when marshaling as XML.
- */
- public java.lang.String getNameSpacePrefix(
- ) {
- return _nsPrefix;
+ // -- validation code for: _id
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ { // -- local scope
+ org.exolab.castor.xml.validators.IdValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.IdValidator();
+ fieldValidator.setValidator(typeValidator);
}
+ desc.setValidator(fieldValidator);
+ // -- initialize element descriptors
- /**
- * Method getNameSpaceURI.
- *
- * @return the namespace URI used when marshaling and
- * unmarshaling as XML.
- */
- public java.lang.String getNameSpaceURI(
- ) {
- return _nsURI;
- }
+ // -- _provenance
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ uk.ac.vamsas.objects.core.Provenance.class, "_provenance",
+ "Provenance", org.exolab.castor.xml.NodeType.Element);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ SequenceMapping target = (SequenceMapping) object;
+ return target.getProvenance();
+ }
- /**
- * Method getValidator.
- *
- * @return a specific validator for the class described by this
- * ClassDescriptor.
- */
- public org.exolab.castor.xml.TypeValidator getValidator(
- ) {
- return this;
- }
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ SequenceMapping target = (SequenceMapping) object;
+ target.setProvenance((uk.ac.vamsas.objects.core.Provenance) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- /**
- * Method getXMLName.
- *
- * @return the XML Name for the Class being described.
- */
- public java.lang.String getXMLName(
- ) {
- return _xmlName;
- }
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new uk.ac.vamsas.objects.core.Provenance();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
+ desc.setRequired(true);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
- /**
- * Method isElementDefinition.
- *
- * @return true if XML schema definition of this Class is that
- * of a global
- * element or element with anonymous type definition.
- */
- public boolean isElementDefinition(
- ) {
- return _elementDefinition;
+ // -- validation code for: _provenance
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(1);
+ { // -- local scope
}
+ desc.setValidator(fieldValidator);
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ * Method getAccessMode.
+ *
+ * @return the access mode specified for this class.
+ */
+ public org.exolab.castor.mapping.AccessMode getAccessMode() {
+ return null;
+ }
+
+ /**
+ * Method getIdentity.
+ *
+ * @return the identity field, null if this class has no identity.
+ */
+ public org.exolab.castor.mapping.FieldDescriptor getIdentity() {
+ return super.getIdentity();
+ }
+
+ /**
+ * Method getJavaClass.
+ *
+ * @return the Java class represented by this descriptor.
+ */
+ public java.lang.Class getJavaClass() {
+ return uk.ac.vamsas.objects.core.SequenceMapping.class;
+ }
+
+ /**
+ * Method getNameSpacePrefix.
+ *
+ * @return the namespace prefix to use when marshaling as XML.
+ */
+ public java.lang.String getNameSpacePrefix() {
+ return _nsPrefix;
+ }
+
+ /**
+ * Method getNameSpaceURI.
+ *
+ * @return the namespace URI used when marshaling and unmarshaling as XML.
+ */
+ public java.lang.String getNameSpaceURI() {
+ return _nsURI;
+ }
+
+ /**
+ * Method getValidator.
+ *
+ * @return a specific validator for the class described by this
+ * ClassDescriptor.
+ */
+ public org.exolab.castor.xml.TypeValidator getValidator() {
+ return this;
+ }
+
+ /**
+ * Method getXMLName.
+ *
+ * @return the XML Name for the Class being described.
+ */
+ public java.lang.String getXMLName() {
+ return _xmlName;
+ }
+
+ /**
+ * Method isElementDefinition.
+ *
+ * @return true if XML schema definition of this Class is that of a global
+ * element or element with anonymous type definition.
+ */
+ public boolean isElementDefinition() {
+ return _elementDefinition;
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/descriptors/SequenceTypeDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/SequenceTypeDescriptor.java
index 7b059e6..607e999 100644
--- a/src/uk/ac/vamsas/objects/core/descriptors/SequenceTypeDescriptor.java
+++ b/src/uk/ac/vamsas/objects/core/descriptors/SequenceTypeDescriptor.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core.descriptors;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import uk.ac.vamsas.objects.core.SequenceType;
@@ -18,385 +32,394 @@ import uk.ac.vamsas.objects.core.SequenceType;
*
* @version $Revision$ $Date$
*/
-public class SequenceTypeDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl {
-
-
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
- * Field _elementDefinition.
- */
- private boolean _elementDefinition;
-
- /**
- * Field _nsPrefix.
- */
- private java.lang.String _nsPrefix;
-
- /**
- * Field _nsURI.
- */
- private java.lang.String _nsURI;
-
- /**
- * Field _xmlName.
- */
- private java.lang.String _xmlName;
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public SequenceTypeDescriptor() {
- super();
- _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
- _xmlName = "SequenceType";
- _elementDefinition = false;
-
- //-- set grouping compositor
- setCompositorAsSequence();
- org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
- org.exolab.castor.mapping.FieldHandler handler = null;
- org.exolab.castor.xml.FieldValidator fieldValidator = null;
- //-- initialize attribute descriptors
-
- //-- _start
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Long.TYPE, "_start", "start", org.exolab.castor.xml.NodeType.Attribute);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- SequenceType target = (SequenceType) object;
- if (!target.hasStart()) { return null; }
- return new java.lang.Long(target.getStart());
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- SequenceType target = (SequenceType) object;
- // ignore null values for non optional primitives
- if (value == null) { return; }
-
- target.setStart( ((java.lang.Long) value).longValue());
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setRequired(true);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _start
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(1);
- { //-- local scope
- org.exolab.castor.xml.validators.LongValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.LongValidator();
- fieldValidator.setValidator(typeValidator);
- }
- desc.setValidator(fieldValidator);
- //-- _end
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Long.TYPE, "_end", "end", org.exolab.castor.xml.NodeType.Attribute);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- SequenceType target = (SequenceType) object;
- if (!target.hasEnd()) { return null; }
- return new java.lang.Long(target.getEnd());
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- SequenceType target = (SequenceType) object;
- // ignore null values for non optional primitives
- if (value == null) { return; }
-
- target.setEnd( ((java.lang.Long) value).longValue());
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setRequired(true);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _end
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(1);
- { //-- local scope
- org.exolab.castor.xml.validators.LongValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.LongValidator();
- fieldValidator.setValidator(typeValidator);
- }
- desc.setValidator(fieldValidator);
- //-- initialize element descriptors
-
- //-- _sequence
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_sequence", "sequence", org.exolab.castor.xml.NodeType.Element);
- desc.setImmutable(true);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- SequenceType target = (SequenceType) object;
- return target.getSequence();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- SequenceType target = (SequenceType) object;
- target.setSequence( (java.lang.String) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
- desc.setRequired(true);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _sequence
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(1);
- { //-- local scope
- org.exolab.castor.xml.validators.StringValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.StringValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setWhiteSpace("preserve");
+public class SequenceTypeDescriptor extends
+ org.exolab.castor.xml.util.XMLClassDescriptorImpl {
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * Field _elementDefinition.
+ */
+ private boolean _elementDefinition;
+
+ /**
+ * Field _nsPrefix.
+ */
+ private java.lang.String _nsPrefix;
+
+ /**
+ * Field _nsURI.
+ */
+ private java.lang.String _nsURI;
+
+ /**
+ * Field _xmlName.
+ */
+ private java.lang.String _xmlName;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public SequenceTypeDescriptor() {
+ super();
+ _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
+ _xmlName = "SequenceType";
+ _elementDefinition = false;
+
+ // -- set grouping compositor
+ setCompositorAsSequence();
+ org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
+ org.exolab.castor.mapping.FieldHandler handler = null;
+ org.exolab.castor.xml.FieldValidator fieldValidator = null;
+ // -- initialize attribute descriptors
+
+ // -- _start
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.Long.TYPE, "_start", "start",
+ org.exolab.castor.xml.NodeType.Attribute);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ SequenceType target = (SequenceType) object;
+ if (!target.hasStart()) {
+ return null;
}
- desc.setValidator(fieldValidator);
- //-- _name
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_name", "name", org.exolab.castor.xml.NodeType.Element);
- desc.setImmutable(true);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- SequenceType target = (SequenceType) object;
- return target.getName();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- SequenceType target = (SequenceType) object;
- target.setName( (java.lang.String) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
- desc.setRequired(true);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _name
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(1);
- { //-- local scope
- org.exolab.castor.xml.validators.StringValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.StringValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setWhiteSpace("preserve");
+ return new java.lang.Long(target.getStart());
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ SequenceType target = (SequenceType) object;
+ // ignore null values for non optional primitives
+ if (value == null) {
+ return;
+ }
+
+ target.setStart(((java.lang.Long) value).longValue());
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
- //-- _description
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_description", "description", org.exolab.castor.xml.NodeType.Element);
- desc.setImmutable(true);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- SequenceType target = (SequenceType) object;
- return target.getDescription();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- SequenceType target = (SequenceType) object;
- target.setDescription( (java.lang.String) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _description
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { //-- local scope
- org.exolab.castor.xml.validators.StringValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.StringValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setWhiteSpace("preserve");
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return null;
+ }
+ };
+ desc.setHandler(handler);
+ desc.setRequired(true);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _start
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(1);
+ { // -- local scope
+ org.exolab.castor.xml.validators.LongValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.LongValidator();
+ fieldValidator.setValidator(typeValidator);
+ }
+ desc.setValidator(fieldValidator);
+ // -- _end
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.Long.TYPE, "_end", "end",
+ org.exolab.castor.xml.NodeType.Attribute);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ SequenceType target = (SequenceType) object;
+ if (!target.hasEnd()) {
+ return null;
}
- desc.setValidator(fieldValidator);
- //-- _propertyList
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Property.class, "_propertyList", "property", org.exolab.castor.xml.NodeType.Element);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- SequenceType target = (SequenceType) object;
- return target.getProperty();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- SequenceType target = (SequenceType) object;
- target.addProperty( (uk.ac.vamsas.objects.core.Property) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException {
- try {
- SequenceType target = (SequenceType) object;
- target.removeAllProperty();
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new uk.ac.vamsas.objects.core.Property();
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
- desc.setMultivalued(true);
- addFieldDescriptor(desc);
-
- //-- validation code for: _propertyList
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(0);
- { //-- local scope
+ return new java.lang.Long(target.getEnd());
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ SequenceType target = (SequenceType) object;
+ // ignore null values for non optional primitives
+ if (value == null) {
+ return;
+ }
+
+ target.setEnd(((java.lang.Long) value).longValue());
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return null;
+ }
+ };
+ desc.setHandler(handler);
+ desc.setRequired(true);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _end
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(1);
+ { // -- local scope
+ org.exolab.castor.xml.validators.LongValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.LongValidator();
+ fieldValidator.setValidator(typeValidator);
}
+ desc.setValidator(fieldValidator);
+ // -- initialize element descriptors
+ // -- _sequence
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.String.class, "_sequence", "sequence",
+ org.exolab.castor.xml.NodeType.Element);
+ desc.setImmutable(true);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ SequenceType target = (SequenceType) object;
+ return target.getSequence();
+ }
- //-----------/
- //- Methods -/
- //-----------/
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ SequenceType target = (SequenceType) object;
+ target.setSequence((java.lang.String) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- /**
- * Method getAccessMode.
- *
- * @return the access mode specified for this class.
- */
- public org.exolab.castor.mapping.AccessMode getAccessMode(
- ) {
+ public java.lang.Object newInstance(java.lang.Object parent) {
return null;
- }
+ }
+ };
+ desc.setHandler(handler);
+ desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
+ desc.setRequired(true);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
- /**
- * Method getIdentity.
- *
- * @return the identity field, null if this class has no
- * identity.
- */
- public org.exolab.castor.mapping.FieldDescriptor getIdentity(
- ) {
- return super.getIdentity();
+ // -- validation code for: _sequence
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(1);
+ { // -- local scope
+ org.exolab.castor.xml.validators.StringValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.StringValidator();
+ fieldValidator.setValidator(typeValidator);
+ typeValidator.setWhiteSpace("preserve");
}
+ desc.setValidator(fieldValidator);
+ // -- _name
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.String.class, "_name", "name",
+ org.exolab.castor.xml.NodeType.Element);
+ desc.setImmutable(true);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ SequenceType target = (SequenceType) object;
+ return target.getName();
+ }
- /**
- * Method getJavaClass.
- *
- * @return the Java class represented by this descriptor.
- */
- public java.lang.Class getJavaClass(
- ) {
- return uk.ac.vamsas.objects.core.SequenceType.class;
- }
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ SequenceType target = (SequenceType) object;
+ target.setName((java.lang.String) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- /**
- * Method getNameSpacePrefix.
- *
- * @return the namespace prefix to use when marshaling as XML.
- */
- public java.lang.String getNameSpacePrefix(
- ) {
- return _nsPrefix;
- }
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return null;
+ }
+ };
+ desc.setHandler(handler);
+ desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
+ desc.setRequired(true);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
- /**
- * Method getNameSpaceURI.
- *
- * @return the namespace URI used when marshaling and
- * unmarshaling as XML.
- */
- public java.lang.String getNameSpaceURI(
- ) {
- return _nsURI;
+ // -- validation code for: _name
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(1);
+ { // -- local scope
+ org.exolab.castor.xml.validators.StringValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.StringValidator();
+ fieldValidator.setValidator(typeValidator);
+ typeValidator.setWhiteSpace("preserve");
}
+ desc.setValidator(fieldValidator);
+ // -- _description
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.String.class, "_description", "description",
+ org.exolab.castor.xml.NodeType.Element);
+ desc.setImmutable(true);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ SequenceType target = (SequenceType) object;
+ return target.getDescription();
+ }
- /**
- * Method getValidator.
- *
- * @return a specific validator for the class described by this
- * ClassDescriptor.
- */
- public org.exolab.castor.xml.TypeValidator getValidator(
- ) {
- return this;
- }
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ SequenceType target = (SequenceType) object;
+ target.setDescription((java.lang.String) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return null;
+ }
+ };
+ desc.setHandler(handler);
+ desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
- /**
- * Method getXMLName.
- *
- * @return the XML Name for the Class being described.
- */
- public java.lang.String getXMLName(
- ) {
- return _xmlName;
+ // -- validation code for: _description
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ { // -- local scope
+ org.exolab.castor.xml.validators.StringValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.StringValidator();
+ fieldValidator.setValidator(typeValidator);
+ typeValidator.setWhiteSpace("preserve");
}
+ desc.setValidator(fieldValidator);
+ // -- _propertyList
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ uk.ac.vamsas.objects.core.Property.class, "_propertyList", "property",
+ org.exolab.castor.xml.NodeType.Element);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ SequenceType target = (SequenceType) object;
+ return target.getProperty();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ SequenceType target = (SequenceType) object;
+ target.addProperty((uk.ac.vamsas.objects.core.Property) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- /**
- * Method isElementDefinition.
- *
- * @return true if XML schema definition of this Class is that
- * of a global
- * element or element with anonymous type definition.
- */
- public boolean isElementDefinition(
- ) {
- return _elementDefinition;
+ public void resetValue(Object object) throws IllegalStateException,
+ IllegalArgumentException {
+ try {
+ SequenceType target = (SequenceType) object;
+ target.removeAllProperty();
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new uk.ac.vamsas.objects.core.Property();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
+ desc.setMultivalued(true);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _propertyList
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(0);
+ { // -- local scope
}
+ desc.setValidator(fieldValidator);
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ * Method getAccessMode.
+ *
+ * @return the access mode specified for this class.
+ */
+ public org.exolab.castor.mapping.AccessMode getAccessMode() {
+ return null;
+ }
+
+ /**
+ * Method getIdentity.
+ *
+ * @return the identity field, null if this class has no identity.
+ */
+ public org.exolab.castor.mapping.FieldDescriptor getIdentity() {
+ return super.getIdentity();
+ }
+
+ /**
+ * Method getJavaClass.
+ *
+ * @return the Java class represented by this descriptor.
+ */
+ public java.lang.Class getJavaClass() {
+ return uk.ac.vamsas.objects.core.SequenceType.class;
+ }
+
+ /**
+ * Method getNameSpacePrefix.
+ *
+ * @return the namespace prefix to use when marshaling as XML.
+ */
+ public java.lang.String getNameSpacePrefix() {
+ return _nsPrefix;
+ }
+
+ /**
+ * Method getNameSpaceURI.
+ *
+ * @return the namespace URI used when marshaling and unmarshaling as XML.
+ */
+ public java.lang.String getNameSpaceURI() {
+ return _nsURI;
+ }
+
+ /**
+ * Method getValidator.
+ *
+ * @return a specific validator for the class described by this
+ * ClassDescriptor.
+ */
+ public org.exolab.castor.xml.TypeValidator getValidator() {
+ return this;
+ }
+
+ /**
+ * Method getXMLName.
+ *
+ * @return the XML Name for the Class being described.
+ */
+ public java.lang.String getXMLName() {
+ return _xmlName;
+ }
+
+ /**
+ * Method isElementDefinition.
+ *
+ * @return true if XML schema definition of this Class is that of a global
+ * element or element with anonymous type definition.
+ */
+ public boolean isElementDefinition() {
+ return _elementDefinition;
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/descriptors/TreeDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/TreeDescriptor.java
index 19f0b42..8a8907a 100644
--- a/src/uk/ac/vamsas/objects/core/descriptors/TreeDescriptor.java
+++ b/src/uk/ac/vamsas/objects/core/descriptors/TreeDescriptor.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core.descriptors;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import uk.ac.vamsas.objects.core.Tree;
@@ -18,416 +32,423 @@ import uk.ac.vamsas.objects.core.Tree;
*
* @version $Revision$ $Date$
*/
-public class TreeDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl {
-
-
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
- * Field _elementDefinition.
- */
- private boolean _elementDefinition;
-
- /**
- * Field _nsPrefix.
- */
- private java.lang.String _nsPrefix;
-
- /**
- * Field _nsURI.
- */
- private java.lang.String _nsURI;
-
- /**
- * Field _xmlName.
- */
- private java.lang.String _xmlName;
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public TreeDescriptor() {
- super();
- _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
- _xmlName = "Tree";
- _elementDefinition = true;
-
- //-- set grouping compositor
- setCompositorAsSequence();
- org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
- org.exolab.castor.mapping.FieldHandler handler = null;
- org.exolab.castor.xml.FieldValidator fieldValidator = null;
- //-- initialize attribute descriptors
-
- //-- _id
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_id", "id", org.exolab.castor.xml.NodeType.Attribute);
- super.setIdentity(desc);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- Tree target = (Tree) object;
- return target.getId();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- Tree target = (Tree) object;
- target.setId( (java.lang.String) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new java.lang.String();
- }
- };
- desc.setHandler(handler);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _id
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { //-- local scope
- org.exolab.castor.xml.validators.IdValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.IdValidator();
- fieldValidator.setValidator(typeValidator);
+public class TreeDescriptor extends
+ org.exolab.castor.xml.util.XMLClassDescriptorImpl {
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * Field _elementDefinition.
+ */
+ private boolean _elementDefinition;
+
+ /**
+ * Field _nsPrefix.
+ */
+ private java.lang.String _nsPrefix;
+
+ /**
+ * Field _nsURI.
+ */
+ private java.lang.String _nsURI;
+
+ /**
+ * Field _xmlName.
+ */
+ private java.lang.String _xmlName;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public TreeDescriptor() {
+ super();
+ _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
+ _xmlName = "Tree";
+ _elementDefinition = true;
+
+ // -- set grouping compositor
+ setCompositorAsSequence();
+ org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
+ org.exolab.castor.mapping.FieldHandler handler = null;
+ org.exolab.castor.xml.FieldValidator fieldValidator = null;
+ // -- initialize attribute descriptors
+
+ // -- _id
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.String.class, "_id", "id",
+ org.exolab.castor.xml.NodeType.Attribute);
+ super.setIdentity(desc);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ Tree target = (Tree) object;
+ return target.getId();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ Tree target = (Tree) object;
+ target.setId((java.lang.String) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
- //-- _modifiable
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_modifiable", "modifiable", org.exolab.castor.xml.NodeType.Attribute);
- desc.setImmutable(true);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- Tree target = (Tree) object;
- return target.getModifiable();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- Tree target = (Tree) object;
- target.setModifiable( (java.lang.String) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _modifiable
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { //-- local scope
- org.exolab.castor.xml.validators.StringValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.StringValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setWhiteSpace("preserve");
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new java.lang.String();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _id
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ { // -- local scope
+ org.exolab.castor.xml.validators.IdValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.IdValidator();
+ fieldValidator.setValidator(typeValidator);
+ }
+ desc.setValidator(fieldValidator);
+ // -- _modifiable
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.String.class, "_modifiable", "modifiable",
+ org.exolab.castor.xml.NodeType.Attribute);
+ desc.setImmutable(true);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ Tree target = (Tree) object;
+ return target.getModifiable();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ Tree target = (Tree) object;
+ target.setModifiable((java.lang.String) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
- //-- initialize element descriptors
-
- //-- _title
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_title", "title", org.exolab.castor.xml.NodeType.Element);
- desc.setImmutable(true);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- Tree target = (Tree) object;
- return target.getTitle();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- Tree target = (Tree) object;
- target.setTitle( (java.lang.String) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _title
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { //-- local scope
- org.exolab.castor.xml.validators.StringValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.StringValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setWhiteSpace("preserve");
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return null;
+ }
+ };
+ desc.setHandler(handler);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _modifiable
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ { // -- local scope
+ org.exolab.castor.xml.validators.StringValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.StringValidator();
+ fieldValidator.setValidator(typeValidator);
+ typeValidator.setWhiteSpace("preserve");
+ }
+ desc.setValidator(fieldValidator);
+ // -- initialize element descriptors
+
+ // -- _title
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.String.class, "_title", "title",
+ org.exolab.castor.xml.NodeType.Element);
+ desc.setImmutable(true);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ Tree target = (Tree) object;
+ return target.getTitle();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ Tree target = (Tree) object;
+ target.setTitle((java.lang.String) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
- //-- _newickList
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Newick.class, "_newickList", "newick", org.exolab.castor.xml.NodeType.Element);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- Tree target = (Tree) object;
- return target.getNewick();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- Tree target = (Tree) object;
- target.addNewick( (uk.ac.vamsas.objects.core.Newick) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException {
- try {
- Tree target = (Tree) object;
- target.removeAllNewick();
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new uk.ac.vamsas.objects.core.Newick();
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
- desc.setRequired(true);
- desc.setMultivalued(true);
- addFieldDescriptor(desc);
-
- //-- validation code for: _newickList
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(1);
- { //-- local scope
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return null;
+ }
+ };
+ desc.setHandler(handler);
+ desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _title
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ { // -- local scope
+ org.exolab.castor.xml.validators.StringValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.StringValidator();
+ fieldValidator.setValidator(typeValidator);
+ typeValidator.setWhiteSpace("preserve");
+ }
+ desc.setValidator(fieldValidator);
+ // -- _newickList
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ uk.ac.vamsas.objects.core.Newick.class, "_newickList", "newick",
+ org.exolab.castor.xml.NodeType.Element);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ Tree target = (Tree) object;
+ return target.getNewick();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ Tree target = (Tree) object;
+ target.addNewick((uk.ac.vamsas.objects.core.Newick) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
- //-- _treenodeList
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Treenode.class, "_treenodeList", "treenode", org.exolab.castor.xml.NodeType.Element);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- Tree target = (Tree) object;
- return target.getTreenode();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- Tree target = (Tree) object;
- target.addTreenode( (uk.ac.vamsas.objects.core.Treenode) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException {
- try {
- Tree target = (Tree) object;
- target.removeAllTreenode();
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new uk.ac.vamsas.objects.core.Treenode();
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
- desc.setMultivalued(true);
- addFieldDescriptor(desc);
-
- //-- validation code for: _treenodeList
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(0);
- { //-- local scope
+ }
+
+ public void resetValue(Object object) throws IllegalStateException,
+ IllegalArgumentException {
+ try {
+ Tree target = (Tree) object;
+ target.removeAllNewick();
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
- //-- _propertyList
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Property.class, "_propertyList", "property", org.exolab.castor.xml.NodeType.Element);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- Tree target = (Tree) object;
- return target.getProperty();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- Tree target = (Tree) object;
- target.addProperty( (uk.ac.vamsas.objects.core.Property) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException {
- try {
- Tree target = (Tree) object;
- target.removeAllProperty();
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new uk.ac.vamsas.objects.core.Property();
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
- desc.setMultivalued(true);
- addFieldDescriptor(desc);
-
- //-- validation code for: _propertyList
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(0);
- { //-- local scope
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new uk.ac.vamsas.objects.core.Newick();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
+ desc.setRequired(true);
+ desc.setMultivalued(true);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _newickList
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(1);
+ { // -- local scope
+ }
+ desc.setValidator(fieldValidator);
+ // -- _treenodeList
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ uk.ac.vamsas.objects.core.Treenode.class, "_treenodeList", "treenode",
+ org.exolab.castor.xml.NodeType.Element);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ Tree target = (Tree) object;
+ return target.getTreenode();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ Tree target = (Tree) object;
+ target.addTreenode((uk.ac.vamsas.objects.core.Treenode) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
- //-- _provenance
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Provenance.class, "_provenance", "Provenance", org.exolab.castor.xml.NodeType.Element);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- Tree target = (Tree) object;
- return target.getProvenance();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- Tree target = (Tree) object;
- target.setProvenance( (uk.ac.vamsas.objects.core.Provenance) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new uk.ac.vamsas.objects.core.Provenance();
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
- desc.setRequired(true);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _provenance
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(1);
- { //-- local scope
+ }
+
+ public void resetValue(Object object) throws IllegalStateException,
+ IllegalArgumentException {
+ try {
+ Tree target = (Tree) object;
+ target.removeAllTreenode();
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new uk.ac.vamsas.objects.core.Treenode();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
+ desc.setMultivalued(true);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _treenodeList
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(0);
+ { // -- local scope
}
+ desc.setValidator(fieldValidator);
+ // -- _propertyList
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ uk.ac.vamsas.objects.core.Property.class, "_propertyList", "property",
+ org.exolab.castor.xml.NodeType.Element);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ Tree target = (Tree) object;
+ return target.getProperty();
+ }
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ Tree target = (Tree) object;
+ target.addProperty((uk.ac.vamsas.objects.core.Property) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- //-----------/
- //- Methods -/
- //-----------/
+ public void resetValue(Object object) throws IllegalStateException,
+ IllegalArgumentException {
+ try {
+ Tree target = (Tree) object;
+ target.removeAllProperty();
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- /**
- * Method getAccessMode.
- *
- * @return the access mode specified for this class.
- */
- public org.exolab.castor.mapping.AccessMode getAccessMode(
- ) {
- return null;
- }
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new uk.ac.vamsas.objects.core.Property();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
+ desc.setMultivalued(true);
+ addFieldDescriptor(desc);
- /**
- * Method getIdentity.
- *
- * @return the identity field, null if this class has no
- * identity.
- */
- public org.exolab.castor.mapping.FieldDescriptor getIdentity(
- ) {
- return super.getIdentity();
+ // -- validation code for: _propertyList
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(0);
+ { // -- local scope
}
+ desc.setValidator(fieldValidator);
+ // -- _provenance
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ uk.ac.vamsas.objects.core.Provenance.class, "_provenance",
+ "Provenance", org.exolab.castor.xml.NodeType.Element);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ Tree target = (Tree) object;
+ return target.getProvenance();
+ }
- /**
- * Method getJavaClass.
- *
- * @return the Java class represented by this descriptor.
- */
- public java.lang.Class getJavaClass(
- ) {
- return uk.ac.vamsas.objects.core.Tree.class;
- }
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ Tree target = (Tree) object;
+ target.setProvenance((uk.ac.vamsas.objects.core.Provenance) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- /**
- * Method getNameSpacePrefix.
- *
- * @return the namespace prefix to use when marshaling as XML.
- */
- public java.lang.String getNameSpacePrefix(
- ) {
- return _nsPrefix;
- }
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new uk.ac.vamsas.objects.core.Provenance();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
+ desc.setRequired(true);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
- /**
- * Method getNameSpaceURI.
- *
- * @return the namespace URI used when marshaling and
- * unmarshaling as XML.
- */
- public java.lang.String getNameSpaceURI(
- ) {
- return _nsURI;
+ // -- validation code for: _provenance
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(1);
+ { // -- local scope
}
+ desc.setValidator(fieldValidator);
+ }
- /**
- * Method getValidator.
- *
- * @return a specific validator for the class described by this
- * ClassDescriptor.
- */
- public org.exolab.castor.xml.TypeValidator getValidator(
- ) {
- return this;
- }
+ // -----------/
+ // - Methods -/
+ // -----------/
- /**
- * Method getXMLName.
- *
- * @return the XML Name for the Class being described.
- */
- public java.lang.String getXMLName(
- ) {
- return _xmlName;
- }
+ /**
+ * Method getAccessMode.
+ *
+ * @return the access mode specified for this class.
+ */
+ public org.exolab.castor.mapping.AccessMode getAccessMode() {
+ return null;
+ }
- /**
- * Method isElementDefinition.
- *
- * @return true if XML schema definition of this Class is that
- * of a global
- * element or element with anonymous type definition.
- */
- public boolean isElementDefinition(
- ) {
- return _elementDefinition;
- }
+ /**
+ * Method getIdentity.
+ *
+ * @return the identity field, null if this class has no identity.
+ */
+ public org.exolab.castor.mapping.FieldDescriptor getIdentity() {
+ return super.getIdentity();
+ }
+
+ /**
+ * Method getJavaClass.
+ *
+ * @return the Java class represented by this descriptor.
+ */
+ public java.lang.Class getJavaClass() {
+ return uk.ac.vamsas.objects.core.Tree.class;
+ }
+
+ /**
+ * Method getNameSpacePrefix.
+ *
+ * @return the namespace prefix to use when marshaling as XML.
+ */
+ public java.lang.String getNameSpacePrefix() {
+ return _nsPrefix;
+ }
+
+ /**
+ * Method getNameSpaceURI.
+ *
+ * @return the namespace URI used when marshaling and unmarshaling as XML.
+ */
+ public java.lang.String getNameSpaceURI() {
+ return _nsURI;
+ }
+
+ /**
+ * Method getValidator.
+ *
+ * @return a specific validator for the class described by this
+ * ClassDescriptor.
+ */
+ public org.exolab.castor.xml.TypeValidator getValidator() {
+ return this;
+ }
+
+ /**
+ * Method getXMLName.
+ *
+ * @return the XML Name for the Class being described.
+ */
+ public java.lang.String getXMLName() {
+ return _xmlName;
+ }
+
+ /**
+ * Method isElementDefinition.
+ *
+ * @return true if XML schema definition of this Class is that of a global
+ * element or element with anonymous type definition.
+ */
+ public boolean isElementDefinition() {
+ return _elementDefinition;
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/descriptors/TreenodeDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/TreenodeDescriptor.java
index 4108527..8e16388 100644
--- a/src/uk/ac/vamsas/objects/core/descriptors/TreenodeDescriptor.java
+++ b/src/uk/ac/vamsas/objects/core/descriptors/TreenodeDescriptor.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core.descriptors;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import uk.ac.vamsas.objects.core.Treenode;
@@ -18,224 +32,217 @@ import uk.ac.vamsas.objects.core.Treenode;
*
* @version $Revision$ $Date$
*/
-public class TreenodeDescriptor extends uk.ac.vamsas.objects.core.descriptors.NodeTypeDescriptor {
-
-
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
- * Field _elementDefinition.
- */
- private boolean _elementDefinition;
-
- /**
- * Field _nsPrefix.
- */
- private java.lang.String _nsPrefix;
-
- /**
- * Field _nsURI.
- */
- private java.lang.String _nsURI;
-
- /**
- * Field _xmlName.
- */
- private java.lang.String _xmlName;
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public TreenodeDescriptor() {
- super();
- setExtendsWithoutFlatten(new uk.ac.vamsas.objects.core.descriptors.NodeTypeDescriptor());
- _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
- _xmlName = "treenode";
- _elementDefinition = true;
- org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
- org.exolab.castor.mapping.FieldHandler handler = null;
- org.exolab.castor.xml.FieldValidator fieldValidator = null;
- //-- initialize attribute descriptors
-
- //-- _treeId
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Object.class, "_treeId", "treeId", org.exolab.castor.xml.NodeType.Attribute);
- desc.setReference(true);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- Treenode target = (Treenode) object;
- return target.getTreeId();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- Treenode target = (Treenode) object;
- target.addTreeId( (java.lang.Object) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException {
- try {
- Treenode target = (Treenode) object;
- target.removeAllTreeId();
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new java.lang.Object();
- }
- };
- desc.setMultivalued(true);
- desc.setHandler(handler);
- desc.setMultivalued(true);
- addFieldDescriptor(desc);
-
- //-- validation code for: _treeId
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(0);
- { //-- local scope
- org.exolab.castor.xml.validators.IdRefsValidator typeValidator = new org.exolab.castor.xml.validators.IdRefsValidator();
- fieldValidator.setValidator(typeValidator);
- desc.setValidator(fieldValidator);
+public class TreenodeDescriptor extends
+ uk.ac.vamsas.objects.core.descriptors.NodeTypeDescriptor {
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * Field _elementDefinition.
+ */
+ private boolean _elementDefinition;
+
+ /**
+ * Field _nsPrefix.
+ */
+ private java.lang.String _nsPrefix;
+
+ /**
+ * Field _nsURI.
+ */
+ private java.lang.String _nsURI;
+
+ /**
+ * Field _xmlName.
+ */
+ private java.lang.String _xmlName;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public TreenodeDescriptor() {
+ super();
+ setExtendsWithoutFlatten(new uk.ac.vamsas.objects.core.descriptors.NodeTypeDescriptor());
+ _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
+ _xmlName = "treenode";
+ _elementDefinition = true;
+ org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
+ org.exolab.castor.mapping.FieldHandler handler = null;
+ org.exolab.castor.xml.FieldValidator fieldValidator = null;
+ // -- initialize attribute descriptors
+
+ // -- _treeId
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.Object.class, "_treeId", "treeId",
+ org.exolab.castor.xml.NodeType.Attribute);
+ desc.setReference(true);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ Treenode target = (Treenode) object;
+ return target.getTreeId();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ Treenode target = (Treenode) object;
+ target.addTreeId((java.lang.Object) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
- //-- _nodespec
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_nodespec", "nodespec", org.exolab.castor.xml.NodeType.Attribute);
- desc.setImmutable(true);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- Treenode target = (Treenode) object;
- return target.getNodespec();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- Treenode target = (Treenode) object;
- target.setNodespec( (java.lang.String) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _nodespec
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { //-- local scope
- org.exolab.castor.xml.validators.StringValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.StringValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setWhiteSpace("preserve");
+ }
+
+ public void resetValue(Object object) throws IllegalStateException,
+ IllegalArgumentException {
+ try {
+ Treenode target = (Treenode) object;
+ target.removeAllTreeId();
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
- //-- initialize element descriptors
-
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new java.lang.Object();
+ }
+ };
+ desc.setMultivalued(true);
+ desc.setHandler(handler);
+ desc.setMultivalued(true);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _treeId
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(0);
+ { // -- local scope
+ org.exolab.castor.xml.validators.IdRefsValidator typeValidator = new org.exolab.castor.xml.validators.IdRefsValidator();
+ fieldValidator.setValidator(typeValidator);
+ desc.setValidator(fieldValidator);
}
+ desc.setValidator(fieldValidator);
+ // -- _nodespec
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.String.class, "_nodespec", "nodespec",
+ org.exolab.castor.xml.NodeType.Attribute);
+ desc.setImmutable(true);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ Treenode target = (Treenode) object;
+ return target.getNodespec();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ Treenode target = (Treenode) object;
+ target.setNodespec((java.lang.String) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
-
- //-----------/
- //- Methods -/
- //-----------/
-
- /**
- * Method getAccessMode.
- *
- * @return the access mode specified for this class.
- */
- public org.exolab.castor.mapping.AccessMode getAccessMode(
- ) {
+ public java.lang.Object newInstance(java.lang.Object parent) {
return null;
+ }
+ };
+ desc.setHandler(handler);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _nodespec
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ { // -- local scope
+ org.exolab.castor.xml.validators.StringValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.StringValidator();
+ fieldValidator.setValidator(typeValidator);
+ typeValidator.setWhiteSpace("preserve");
}
-
- /**
- * Method getIdentity.
- *
- * @return the identity field, null if this class has no
- * identity.
- */
- public org.exolab.castor.mapping.FieldDescriptor getIdentity(
- ) {
- return super.getIdentity();
- }
-
- /**
- * Method getJavaClass.
- *
- * @return the Java class represented by this descriptor.
- */
- public java.lang.Class getJavaClass(
- ) {
- return uk.ac.vamsas.objects.core.Treenode.class;
- }
-
- /**
- * Method getNameSpacePrefix.
- *
- * @return the namespace prefix to use when marshaling as XML.
- */
- public java.lang.String getNameSpacePrefix(
- ) {
- return _nsPrefix;
- }
-
- /**
- * Method getNameSpaceURI.
- *
- * @return the namespace URI used when marshaling and
- * unmarshaling as XML.
- */
- public java.lang.String getNameSpaceURI(
- ) {
- return _nsURI;
- }
-
- /**
- * Method getValidator.
- *
- * @return a specific validator for the class described by this
- * ClassDescriptor.
- */
- public org.exolab.castor.xml.TypeValidator getValidator(
- ) {
- return this;
- }
-
- /**
- * Method getXMLName.
- *
- * @return the XML Name for the Class being described.
- */
- public java.lang.String getXMLName(
- ) {
- return _xmlName;
- }
-
- /**
- * Method isElementDefinition.
- *
- * @return true if XML schema definition of this Class is that
- * of a global
- * element or element with anonymous type definition.
- */
- public boolean isElementDefinition(
- ) {
- return _elementDefinition;
- }
+ desc.setValidator(fieldValidator);
+ // -- initialize element descriptors
+
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ * Method getAccessMode.
+ *
+ * @return the access mode specified for this class.
+ */
+ public org.exolab.castor.mapping.AccessMode getAccessMode() {
+ return null;
+ }
+
+ /**
+ * Method getIdentity.
+ *
+ * @return the identity field, null if this class has no identity.
+ */
+ public org.exolab.castor.mapping.FieldDescriptor getIdentity() {
+ return super.getIdentity();
+ }
+
+ /**
+ * Method getJavaClass.
+ *
+ * @return the Java class represented by this descriptor.
+ */
+ public java.lang.Class getJavaClass() {
+ return uk.ac.vamsas.objects.core.Treenode.class;
+ }
+
+ /**
+ * Method getNameSpacePrefix.
+ *
+ * @return the namespace prefix to use when marshaling as XML.
+ */
+ public java.lang.String getNameSpacePrefix() {
+ return _nsPrefix;
+ }
+
+ /**
+ * Method getNameSpaceURI.
+ *
+ * @return the namespace URI used when marshaling and unmarshaling as XML.
+ */
+ public java.lang.String getNameSpaceURI() {
+ return _nsURI;
+ }
+
+ /**
+ * Method getValidator.
+ *
+ * @return a specific validator for the class described by this
+ * ClassDescriptor.
+ */
+ public org.exolab.castor.xml.TypeValidator getValidator() {
+ return this;
+ }
+
+ /**
+ * Method getXMLName.
+ *
+ * @return the XML Name for the Class being described.
+ */
+ public java.lang.String getXMLName() {
+ return _xmlName;
+ }
+
+ /**
+ * Method isElementDefinition.
+ *
+ * @return true if XML schema definition of this Class is that of a global
+ * element or element with anonymous type definition.
+ */
+ public boolean isElementDefinition() {
+ return _elementDefinition;
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/descriptors/UserDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/UserDescriptor.java
index 8a6e724..4d5a95d 100644
--- a/src/uk/ac/vamsas/objects/core/descriptors/UserDescriptor.java
+++ b/src/uk/ac/vamsas/objects/core/descriptors/UserDescriptor.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core.descriptors;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import uk.ac.vamsas.objects.core.User;
@@ -18,219 +32,210 @@ import uk.ac.vamsas.objects.core.User;
*
* @version $Revision$ $Date$
*/
-public class UserDescriptor extends uk.ac.vamsas.objects.core.descriptors.AppDataDescriptor {
-
-
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
- * Field _elementDefinition.
- */
- private boolean _elementDefinition;
-
- /**
- * Field _nsPrefix.
- */
- private java.lang.String _nsPrefix;
-
- /**
- * Field _nsURI.
- */
- private java.lang.String _nsURI;
-
- /**
- * Field _xmlName.
- */
- private java.lang.String _xmlName;
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public UserDescriptor() {
- super();
- setExtendsWithoutFlatten(new uk.ac.vamsas.objects.core.descriptors.AppDataDescriptor());
- _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
- _xmlName = "User";
- _elementDefinition = true;
- org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
- org.exolab.castor.mapping.FieldHandler handler = null;
- org.exolab.castor.xml.FieldValidator fieldValidator = null;
- //-- initialize attribute descriptors
-
- //-- _fullname
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_fullname", "fullname", org.exolab.castor.xml.NodeType.Attribute);
- desc.setImmutable(true);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- User target = (User) object;
- return target.getFullname();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- User target = (User) object;
- target.setFullname( (java.lang.String) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setRequired(true);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _fullname
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(1);
- { //-- local scope
- org.exolab.castor.xml.validators.StringValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.StringValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setWhiteSpace("preserve");
- }
- desc.setValidator(fieldValidator);
- //-- _organization
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_organization", "organization", org.exolab.castor.xml.NodeType.Attribute);
- desc.setImmutable(true);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- User target = (User) object;
- return target.getOrganization();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- User target = (User) object;
- target.setOrganization( (java.lang.String) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setRequired(true);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _organization
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(1);
- { //-- local scope
- org.exolab.castor.xml.validators.StringValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.StringValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setWhiteSpace("preserve");
+public class UserDescriptor extends
+ uk.ac.vamsas.objects.core.descriptors.AppDataDescriptor {
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * Field _elementDefinition.
+ */
+ private boolean _elementDefinition;
+
+ /**
+ * Field _nsPrefix.
+ */
+ private java.lang.String _nsPrefix;
+
+ /**
+ * Field _nsURI.
+ */
+ private java.lang.String _nsURI;
+
+ /**
+ * Field _xmlName.
+ */
+ private java.lang.String _xmlName;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public UserDescriptor() {
+ super();
+ setExtendsWithoutFlatten(new uk.ac.vamsas.objects.core.descriptors.AppDataDescriptor());
+ _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
+ _xmlName = "User";
+ _elementDefinition = true;
+ org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
+ org.exolab.castor.mapping.FieldHandler handler = null;
+ org.exolab.castor.xml.FieldValidator fieldValidator = null;
+ // -- initialize attribute descriptors
+
+ // -- _fullname
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.String.class, "_fullname", "fullname",
+ org.exolab.castor.xml.NodeType.Attribute);
+ desc.setImmutable(true);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ User target = (User) object;
+ return target.getFullname();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ User target = (User) object;
+ target.setFullname((java.lang.String) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
- //-- initialize element descriptors
-
- }
-
-
- //-----------/
- //- Methods -/
- //-----------/
+ }
- /**
- * Method getAccessMode.
- *
- * @return the access mode specified for this class.
- */
- public org.exolab.castor.mapping.AccessMode getAccessMode(
- ) {
+ public java.lang.Object newInstance(java.lang.Object parent) {
return null;
+ }
+ };
+ desc.setHandler(handler);
+ desc.setRequired(true);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _fullname
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(1);
+ { // -- local scope
+ org.exolab.castor.xml.validators.StringValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.StringValidator();
+ fieldValidator.setValidator(typeValidator);
+ typeValidator.setWhiteSpace("preserve");
}
+ desc.setValidator(fieldValidator);
+ // -- _organization
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.String.class, "_organization", "organization",
+ org.exolab.castor.xml.NodeType.Attribute);
+ desc.setImmutable(true);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ User target = (User) object;
+ return target.getOrganization();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ User target = (User) object;
+ target.setOrganization((java.lang.String) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- /**
- * Method getIdentity.
- *
- * @return the identity field, null if this class has no
- * identity.
- */
- public org.exolab.castor.mapping.FieldDescriptor getIdentity(
- ) {
- return super.getIdentity();
- }
-
- /**
- * Method getJavaClass.
- *
- * @return the Java class represented by this descriptor.
- */
- public java.lang.Class getJavaClass(
- ) {
- return uk.ac.vamsas.objects.core.User.class;
- }
-
- /**
- * Method getNameSpacePrefix.
- *
- * @return the namespace prefix to use when marshaling as XML.
- */
- public java.lang.String getNameSpacePrefix(
- ) {
- return _nsPrefix;
- }
-
- /**
- * Method getNameSpaceURI.
- *
- * @return the namespace URI used when marshaling and
- * unmarshaling as XML.
- */
- public java.lang.String getNameSpaceURI(
- ) {
- return _nsURI;
- }
-
- /**
- * Method getValidator.
- *
- * @return a specific validator for the class described by this
- * ClassDescriptor.
- */
- public org.exolab.castor.xml.TypeValidator getValidator(
- ) {
- return this;
- }
-
- /**
- * Method getXMLName.
- *
- * @return the XML Name for the Class being described.
- */
- public java.lang.String getXMLName(
- ) {
- return _xmlName;
- }
-
- /**
- * Method isElementDefinition.
- *
- * @return true if XML schema definition of this Class is that
- * of a global
- * element or element with anonymous type definition.
- */
- public boolean isElementDefinition(
- ) {
- return _elementDefinition;
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return null;
+ }
+ };
+ desc.setHandler(handler);
+ desc.setRequired(true);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _organization
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(1);
+ { // -- local scope
+ org.exolab.castor.xml.validators.StringValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.StringValidator();
+ fieldValidator.setValidator(typeValidator);
+ typeValidator.setWhiteSpace("preserve");
}
+ desc.setValidator(fieldValidator);
+ // -- initialize element descriptors
+
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ * Method getAccessMode.
+ *
+ * @return the access mode specified for this class.
+ */
+ public org.exolab.castor.mapping.AccessMode getAccessMode() {
+ return null;
+ }
+
+ /**
+ * Method getIdentity.
+ *
+ * @return the identity field, null if this class has no identity.
+ */
+ public org.exolab.castor.mapping.FieldDescriptor getIdentity() {
+ return super.getIdentity();
+ }
+
+ /**
+ * Method getJavaClass.
+ *
+ * @return the Java class represented by this descriptor.
+ */
+ public java.lang.Class getJavaClass() {
+ return uk.ac.vamsas.objects.core.User.class;
+ }
+
+ /**
+ * Method getNameSpacePrefix.
+ *
+ * @return the namespace prefix to use when marshaling as XML.
+ */
+ public java.lang.String getNameSpacePrefix() {
+ return _nsPrefix;
+ }
+
+ /**
+ * Method getNameSpaceURI.
+ *
+ * @return the namespace URI used when marshaling and unmarshaling as XML.
+ */
+ public java.lang.String getNameSpaceURI() {
+ return _nsURI;
+ }
+
+ /**
+ * Method getValidator.
+ *
+ * @return a specific validator for the class described by this
+ * ClassDescriptor.
+ */
+ public org.exolab.castor.xml.TypeValidator getValidator() {
+ return this;
+ }
+
+ /**
+ * Method getXMLName.
+ *
+ * @return the XML Name for the Class being described.
+ */
+ public java.lang.String getXMLName() {
+ return _xmlName;
+ }
+
+ /**
+ * Method isElementDefinition.
+ *
+ * @return true if XML schema definition of this Class is that of a global
+ * element or element with anonymous type definition.
+ */
+ public boolean isElementDefinition() {
+ return _elementDefinition;
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/descriptors/VAMSASDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/VAMSASDescriptor.java
index b999ff4..3402057 100644
--- a/src/uk/ac/vamsas/objects/core/descriptors/VAMSASDescriptor.java
+++ b/src/uk/ac/vamsas/objects/core/descriptors/VAMSASDescriptor.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core.descriptors;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import uk.ac.vamsas.objects.core.VAMSAS;
@@ -18,300 +32,299 @@ import uk.ac.vamsas.objects.core.VAMSAS;
*
* @version $Revision$ $Date$
*/
-public class VAMSASDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl {
-
-
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
- * Field _elementDefinition.
- */
- private boolean _elementDefinition;
-
- /**
- * Field _nsPrefix.
- */
- private java.lang.String _nsPrefix;
-
- /**
- * Field _nsURI.
- */
- private java.lang.String _nsURI;
-
- /**
- * Field _xmlName.
- */
- private java.lang.String _xmlName;
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public VAMSASDescriptor() {
- super();
- _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
- _xmlName = "VAMSAS";
- _elementDefinition = true;
-
- //-- set grouping compositor
- setCompositorAsSequence();
- org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
- org.exolab.castor.mapping.FieldHandler handler = null;
- org.exolab.castor.xml.FieldValidator fieldValidator = null;
- //-- initialize attribute descriptors
-
- //-- _id
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_id", "id", org.exolab.castor.xml.NodeType.Attribute);
- super.setIdentity(desc);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- VAMSAS target = (VAMSAS) object;
- return target.getId();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- VAMSAS target = (VAMSAS) object;
- target.setId( (java.lang.String) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new java.lang.String();
- }
- };
- desc.setHandler(handler);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _id
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { //-- local scope
- org.exolab.castor.xml.validators.IdValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.IdValidator();
- fieldValidator.setValidator(typeValidator);
+public class VAMSASDescriptor extends
+ org.exolab.castor.xml.util.XMLClassDescriptorImpl {
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * Field _elementDefinition.
+ */
+ private boolean _elementDefinition;
+
+ /**
+ * Field _nsPrefix.
+ */
+ private java.lang.String _nsPrefix;
+
+ /**
+ * Field _nsURI.
+ */
+ private java.lang.String _nsURI;
+
+ /**
+ * Field _xmlName.
+ */
+ private java.lang.String _xmlName;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public VAMSASDescriptor() {
+ super();
+ _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
+ _xmlName = "VAMSAS";
+ _elementDefinition = true;
+
+ // -- set grouping compositor
+ setCompositorAsSequence();
+ org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
+ org.exolab.castor.mapping.FieldHandler handler = null;
+ org.exolab.castor.xml.FieldValidator fieldValidator = null;
+ // -- initialize attribute descriptors
+
+ // -- _id
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.String.class, "_id", "id",
+ org.exolab.castor.xml.NodeType.Attribute);
+ super.setIdentity(desc);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ VAMSAS target = (VAMSAS) object;
+ return target.getId();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ VAMSAS target = (VAMSAS) object;
+ target.setId((java.lang.String) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
- //-- _modifiable
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_modifiable", "modifiable", org.exolab.castor.xml.NodeType.Attribute);
- desc.setImmutable(true);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- VAMSAS target = (VAMSAS) object;
- return target.getModifiable();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- VAMSAS target = (VAMSAS) object;
- target.setModifiable( (java.lang.String) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _modifiable
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { //-- local scope
- org.exolab.castor.xml.validators.StringValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.StringValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setWhiteSpace("preserve");
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new java.lang.String();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _id
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ { // -- local scope
+ org.exolab.castor.xml.validators.IdValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.IdValidator();
+ fieldValidator.setValidator(typeValidator);
+ }
+ desc.setValidator(fieldValidator);
+ // -- _modifiable
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.String.class, "_modifiable", "modifiable",
+ org.exolab.castor.xml.NodeType.Attribute);
+ desc.setImmutable(true);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ VAMSAS target = (VAMSAS) object;
+ return target.getModifiable();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ VAMSAS target = (VAMSAS) object;
+ target.setModifiable((java.lang.String) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
- //-- initialize element descriptors
-
- //-- _treeList
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Tree.class, "_treeList", "Tree", org.exolab.castor.xml.NodeType.Element);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- VAMSAS target = (VAMSAS) object;
- return target.getTree();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- VAMSAS target = (VAMSAS) object;
- target.addTree( (uk.ac.vamsas.objects.core.Tree) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException {
- try {
- VAMSAS target = (VAMSAS) object;
- target.removeAllTree();
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new uk.ac.vamsas.objects.core.Tree();
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
- desc.setMultivalued(true);
- addFieldDescriptor(desc);
-
- //-- validation code for: _treeList
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(0);
- { //-- local scope
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return null;
+ }
+ };
+ desc.setHandler(handler);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _modifiable
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ { // -- local scope
+ org.exolab.castor.xml.validators.StringValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.StringValidator();
+ fieldValidator.setValidator(typeValidator);
+ typeValidator.setWhiteSpace("preserve");
+ }
+ desc.setValidator(fieldValidator);
+ // -- initialize element descriptors
+
+ // -- _treeList
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ uk.ac.vamsas.objects.core.Tree.class, "_treeList", "Tree",
+ org.exolab.castor.xml.NodeType.Element);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ VAMSAS target = (VAMSAS) object;
+ return target.getTree();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ VAMSAS target = (VAMSAS) object;
+ target.addTree((uk.ac.vamsas.objects.core.Tree) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
- //-- _dataSetList
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.DataSet.class, "_dataSetList", "DataSet", org.exolab.castor.xml.NodeType.Element);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- VAMSAS target = (VAMSAS) object;
- return target.getDataSet();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- VAMSAS target = (VAMSAS) object;
- target.addDataSet( (uk.ac.vamsas.objects.core.DataSet) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException {
- try {
- VAMSAS target = (VAMSAS) object;
- target.removeAllDataSet();
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new uk.ac.vamsas.objects.core.DataSet();
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
- desc.setMultivalued(true);
- addFieldDescriptor(desc);
-
- //-- validation code for: _dataSetList
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(0);
- { //-- local scope
+ }
+
+ public void resetValue(Object object) throws IllegalStateException,
+ IllegalArgumentException {
+ try {
+ VAMSAS target = (VAMSAS) object;
+ target.removeAllTree();
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new uk.ac.vamsas.objects.core.Tree();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
+ desc.setMultivalued(true);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _treeList
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(0);
+ { // -- local scope
}
+ desc.setValidator(fieldValidator);
+ // -- _dataSetList
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ uk.ac.vamsas.objects.core.DataSet.class, "_dataSetList", "DataSet",
+ org.exolab.castor.xml.NodeType.Element);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ VAMSAS target = (VAMSAS) object;
+ return target.getDataSet();
+ }
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ VAMSAS target = (VAMSAS) object;
+ target.addDataSet((uk.ac.vamsas.objects.core.DataSet) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- //-----------/
- //- Methods -/
- //-----------/
+ public void resetValue(Object object) throws IllegalStateException,
+ IllegalArgumentException {
+ try {
+ VAMSAS target = (VAMSAS) object;
+ target.removeAllDataSet();
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- /**
- * Method getAccessMode.
- *
- * @return the access mode specified for this class.
- */
- public org.exolab.castor.mapping.AccessMode getAccessMode(
- ) {
- return null;
- }
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new uk.ac.vamsas.objects.core.DataSet();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
+ desc.setMultivalued(true);
+ addFieldDescriptor(desc);
- /**
- * Method getIdentity.
- *
- * @return the identity field, null if this class has no
- * identity.
- */
- public org.exolab.castor.mapping.FieldDescriptor getIdentity(
- ) {
- return super.getIdentity();
+ // -- validation code for: _dataSetList
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(0);
+ { // -- local scope
}
+ desc.setValidator(fieldValidator);
+ }
- /**
- * Method getJavaClass.
- *
- * @return the Java class represented by this descriptor.
- */
- public java.lang.Class getJavaClass(
- ) {
- return uk.ac.vamsas.objects.core.VAMSAS.class;
- }
+ // -----------/
+ // - Methods -/
+ // -----------/
- /**
- * Method getNameSpacePrefix.
- *
- * @return the namespace prefix to use when marshaling as XML.
- */
- public java.lang.String getNameSpacePrefix(
- ) {
- return _nsPrefix;
- }
+ /**
+ * Method getAccessMode.
+ *
+ * @return the access mode specified for this class.
+ */
+ public org.exolab.castor.mapping.AccessMode getAccessMode() {
+ return null;
+ }
- /**
- * Method getNameSpaceURI.
- *
- * @return the namespace URI used when marshaling and
- * unmarshaling as XML.
- */
- public java.lang.String getNameSpaceURI(
- ) {
- return _nsURI;
- }
+ /**
+ * Method getIdentity.
+ *
+ * @return the identity field, null if this class has no identity.
+ */
+ public org.exolab.castor.mapping.FieldDescriptor getIdentity() {
+ return super.getIdentity();
+ }
- /**
- * Method getValidator.
- *
- * @return a specific validator for the class described by this
- * ClassDescriptor.
- */
- public org.exolab.castor.xml.TypeValidator getValidator(
- ) {
- return this;
- }
+ /**
+ * Method getJavaClass.
+ *
+ * @return the Java class represented by this descriptor.
+ */
+ public java.lang.Class getJavaClass() {
+ return uk.ac.vamsas.objects.core.VAMSAS.class;
+ }
- /**
- * Method getXMLName.
- *
- * @return the XML Name for the Class being described.
- */
- public java.lang.String getXMLName(
- ) {
- return _xmlName;
- }
+ /**
+ * Method getNameSpacePrefix.
+ *
+ * @return the namespace prefix to use when marshaling as XML.
+ */
+ public java.lang.String getNameSpacePrefix() {
+ return _nsPrefix;
+ }
- /**
- * Method isElementDefinition.
- *
- * @return true if XML schema definition of this Class is that
- * of a global
- * element or element with anonymous type definition.
- */
- public boolean isElementDefinition(
- ) {
- return _elementDefinition;
- }
+ /**
+ * Method getNameSpaceURI.
+ *
+ * @return the namespace URI used when marshaling and unmarshaling as XML.
+ */
+ public java.lang.String getNameSpaceURI() {
+ return _nsURI;
+ }
+
+ /**
+ * Method getValidator.
+ *
+ * @return a specific validator for the class described by this
+ * ClassDescriptor.
+ */
+ public org.exolab.castor.xml.TypeValidator getValidator() {
+ return this;
+ }
+
+ /**
+ * Method getXMLName.
+ *
+ * @return the XML Name for the Class being described.
+ */
+ public java.lang.String getXMLName() {
+ return _xmlName;
+ }
+
+ /**
+ * Method isElementDefinition.
+ *
+ * @return true if XML schema definition of this Class is that of a global
+ * element or element with anonymous type definition.
+ */
+ public boolean isElementDefinition() {
+ return _elementDefinition;
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/descriptors/VamsasDocumentDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/VamsasDocumentDescriptor.java
index 9c7a594..a7bf199 100644
--- a/src/uk/ac/vamsas/objects/core/descriptors/VamsasDocumentDescriptor.java
+++ b/src/uk/ac/vamsas/objects/core/descriptors/VamsasDocumentDescriptor.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core.descriptors;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import uk.ac.vamsas.objects.core.VamsasDocument;
@@ -18,376 +32,383 @@ import uk.ac.vamsas.objects.core.VamsasDocument;
*
* @version $Revision$ $Date$
*/
-public class VamsasDocumentDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl {
-
-
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
- * Field _elementDefinition.
- */
- private boolean _elementDefinition;
-
- /**
- * Field _nsPrefix.
- */
- private java.lang.String _nsPrefix;
-
- /**
- * Field _nsURI.
- */
- private java.lang.String _nsURI;
-
- /**
- * Field _xmlName.
- */
- private java.lang.String _xmlName;
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public VamsasDocumentDescriptor() {
- super();
- _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasDocument";
- _xmlName = "VamsasDocument";
- _elementDefinition = true;
-
- //-- set grouping compositor
- setCompositorAsSequence();
- org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
- org.exolab.castor.mapping.FieldHandler handler = null;
- org.exolab.castor.xml.FieldValidator fieldValidator = null;
- //-- initialize attribute descriptors
-
- //-- initialize element descriptors
-
- //-- _version
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_version", "Version", org.exolab.castor.xml.NodeType.Element);
- desc.setImmutable(true);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- VamsasDocument target = (VamsasDocument) object;
- return target.getVersion();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- VamsasDocument target = (VamsasDocument) object;
- target.setVersion( (java.lang.String) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasDocument");
- desc.setRequired(true);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _version
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(1);
- { //-- local scope
- org.exolab.castor.xml.validators.StringValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.StringValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setWhiteSpace("preserve");
- }
- desc.setValidator(fieldValidator);
- //-- _lockFile
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.LockFile.class, "_lockFile", "LockFile", org.exolab.castor.xml.NodeType.Element);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- VamsasDocument target = (VamsasDocument) object;
- return target.getLockFile();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- VamsasDocument target = (VamsasDocument) object;
- target.setLockFile( (uk.ac.vamsas.objects.core.LockFile) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new uk.ac.vamsas.objects.core.LockFile();
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasDocument");
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _lockFile
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { //-- local scope
+public class VamsasDocumentDescriptor extends
+ org.exolab.castor.xml.util.XMLClassDescriptorImpl {
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * Field _elementDefinition.
+ */
+ private boolean _elementDefinition;
+
+ /**
+ * Field _nsPrefix.
+ */
+ private java.lang.String _nsPrefix;
+
+ /**
+ * Field _nsURI.
+ */
+ private java.lang.String _nsURI;
+
+ /**
+ * Field _xmlName.
+ */
+ private java.lang.String _xmlName;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public VamsasDocumentDescriptor() {
+ super();
+ _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasDocument";
+ _xmlName = "VamsasDocument";
+ _elementDefinition = true;
+
+ // -- set grouping compositor
+ setCompositorAsSequence();
+ org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
+ org.exolab.castor.mapping.FieldHandler handler = null;
+ org.exolab.castor.xml.FieldValidator fieldValidator = null;
+ // -- initialize attribute descriptors
+
+ // -- initialize element descriptors
+
+ // -- _version
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.String.class, "_version", "Version",
+ org.exolab.castor.xml.NodeType.Element);
+ desc.setImmutable(true);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ VamsasDocument target = (VamsasDocument) object;
+ return target.getVersion();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ VamsasDocument target = (VamsasDocument) object;
+ target.setVersion((java.lang.String) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
- //-- _provenance
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Provenance.class, "_provenance", "Provenance", org.exolab.castor.xml.NodeType.Element);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- VamsasDocument target = (VamsasDocument) object;
- return target.getProvenance();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- VamsasDocument target = (VamsasDocument) object;
- target.setProvenance( (uk.ac.vamsas.objects.core.Provenance) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new uk.ac.vamsas.objects.core.Provenance();
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _provenance
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { //-- local scope
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return null;
+ }
+ };
+ desc.setHandler(handler);
+ desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasDocument");
+ desc.setRequired(true);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _version
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(1);
+ { // -- local scope
+ org.exolab.castor.xml.validators.StringValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.StringValidator();
+ fieldValidator.setValidator(typeValidator);
+ typeValidator.setWhiteSpace("preserve");
+ }
+ desc.setValidator(fieldValidator);
+ // -- _lockFile
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ uk.ac.vamsas.objects.core.LockFile.class, "_lockFile", "LockFile",
+ org.exolab.castor.xml.NodeType.Element);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ VamsasDocument target = (VamsasDocument) object;
+ return target.getLockFile();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ VamsasDocument target = (VamsasDocument) object;
+ target.setLockFile((uk.ac.vamsas.objects.core.LockFile) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
- //-- _VAMSASList
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.VAMSAS.class, "_VAMSASList", "VAMSAS", org.exolab.castor.xml.NodeType.Element);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- VamsasDocument target = (VamsasDocument) object;
- return target.getVAMSAS();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- VamsasDocument target = (VamsasDocument) object;
- target.addVAMSAS( (uk.ac.vamsas.objects.core.VAMSAS) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException {
- try {
- VamsasDocument target = (VamsasDocument) object;
- target.removeAllVAMSAS();
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new uk.ac.vamsas.objects.core.VAMSAS();
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
- desc.setRequired(true);
- desc.setMultivalued(true);
- addFieldDescriptor(desc);
-
- //-- validation code for: _VAMSASList
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(1);
- { //-- local scope
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new uk.ac.vamsas.objects.core.LockFile();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasDocument");
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _lockFile
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ { // -- local scope
+ }
+ desc.setValidator(fieldValidator);
+ // -- _provenance
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ uk.ac.vamsas.objects.core.Provenance.class, "_provenance",
+ "Provenance", org.exolab.castor.xml.NodeType.Element);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ VamsasDocument target = (VamsasDocument) object;
+ return target.getProvenance();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ VamsasDocument target = (VamsasDocument) object;
+ target.setProvenance((uk.ac.vamsas.objects.core.Provenance) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
- //-- _applicationDataList
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.ApplicationData.class, "_applicationDataList", "ApplicationData", org.exolab.castor.xml.NodeType.Element);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- VamsasDocument target = (VamsasDocument) object;
- return target.getApplicationData();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- VamsasDocument target = (VamsasDocument) object;
- target.addApplicationData( (uk.ac.vamsas.objects.core.ApplicationData) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException {
- try {
- VamsasDocument target = (VamsasDocument) object;
- target.removeAllApplicationData();
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new uk.ac.vamsas.objects.core.ApplicationData();
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
- desc.setMultivalued(true);
- addFieldDescriptor(desc);
-
- //-- validation code for: _applicationDataList
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(0);
- { //-- local scope
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new uk.ac.vamsas.objects.core.Provenance();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _provenance
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ { // -- local scope
+ }
+ desc.setValidator(fieldValidator);
+ // -- _VAMSASList
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ uk.ac.vamsas.objects.core.VAMSAS.class, "_VAMSASList", "VAMSAS",
+ org.exolab.castor.xml.NodeType.Element);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ VamsasDocument target = (VamsasDocument) object;
+ return target.getVAMSAS();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ VamsasDocument target = (VamsasDocument) object;
+ target.addVAMSAS((uk.ac.vamsas.objects.core.VAMSAS) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
- //-- _attachmentList
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Attachment.class, "_attachmentList", "Attachment", org.exolab.castor.xml.NodeType.Element);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- VamsasDocument target = (VamsasDocument) object;
- return target.getAttachment();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- VamsasDocument target = (VamsasDocument) object;
- target.addAttachment( (uk.ac.vamsas.objects.core.Attachment) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException {
- try {
- VamsasDocument target = (VamsasDocument) object;
- target.removeAllAttachment();
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new uk.ac.vamsas.objects.core.Attachment();
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
- desc.setMultivalued(true);
- addFieldDescriptor(desc);
-
- //-- validation code for: _attachmentList
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(0);
- { //-- local scope
+ }
+
+ public void resetValue(Object object) throws IllegalStateException,
+ IllegalArgumentException {
+ try {
+ VamsasDocument target = (VamsasDocument) object;
+ target.removeAllVAMSAS();
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new uk.ac.vamsas.objects.core.VAMSAS();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
+ desc.setRequired(true);
+ desc.setMultivalued(true);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _VAMSASList
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(1);
+ { // -- local scope
}
+ desc.setValidator(fieldValidator);
+ // -- _applicationDataList
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ uk.ac.vamsas.objects.core.ApplicationData.class,
+ "_applicationDataList", "ApplicationData",
+ org.exolab.castor.xml.NodeType.Element);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ VamsasDocument target = (VamsasDocument) object;
+ return target.getApplicationData();
+ }
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ VamsasDocument target = (VamsasDocument) object;
+ target
+ .addApplicationData((uk.ac.vamsas.objects.core.ApplicationData) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- //-----------/
- //- Methods -/
- //-----------/
+ public void resetValue(Object object) throws IllegalStateException,
+ IllegalArgumentException {
+ try {
+ VamsasDocument target = (VamsasDocument) object;
+ target.removeAllApplicationData();
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- /**
- * Method getAccessMode.
- *
- * @return the access mode specified for this class.
- */
- public org.exolab.castor.mapping.AccessMode getAccessMode(
- ) {
- return null;
- }
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new uk.ac.vamsas.objects.core.ApplicationData();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
+ desc.setMultivalued(true);
+ addFieldDescriptor(desc);
- /**
- * Method getIdentity.
- *
- * @return the identity field, null if this class has no
- * identity.
- */
- public org.exolab.castor.mapping.FieldDescriptor getIdentity(
- ) {
- return super.getIdentity();
+ // -- validation code for: _applicationDataList
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(0);
+ { // -- local scope
}
+ desc.setValidator(fieldValidator);
+ // -- _attachmentList
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ uk.ac.vamsas.objects.core.Attachment.class, "_attachmentList",
+ "Attachment", org.exolab.castor.xml.NodeType.Element);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException {
+ VamsasDocument target = (VamsasDocument) object;
+ return target.getAttachment();
+ }
- /**
- * Method getJavaClass.
- *
- * @return the Java class represented by this descriptor.
- */
- public java.lang.Class getJavaClass(
- ) {
- return uk.ac.vamsas.objects.core.VamsasDocument.class;
- }
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ try {
+ VamsasDocument target = (VamsasDocument) object;
+ target.addAttachment((uk.ac.vamsas.objects.core.Attachment) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- /**
- * Method getNameSpacePrefix.
- *
- * @return the namespace prefix to use when marshaling as XML.
- */
- public java.lang.String getNameSpacePrefix(
- ) {
- return _nsPrefix;
- }
+ public void resetValue(Object object) throws IllegalStateException,
+ IllegalArgumentException {
+ try {
+ VamsasDocument target = (VamsasDocument) object;
+ target.removeAllAttachment();
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- /**
- * Method getNameSpaceURI.
- *
- * @return the namespace URI used when marshaling and
- * unmarshaling as XML.
- */
- public java.lang.String getNameSpaceURI(
- ) {
- return _nsURI;
- }
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new uk.ac.vamsas.objects.core.Attachment();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
+ desc.setMultivalued(true);
+ addFieldDescriptor(desc);
- /**
- * Method getValidator.
- *
- * @return a specific validator for the class described by this
- * ClassDescriptor.
- */
- public org.exolab.castor.xml.TypeValidator getValidator(
- ) {
- return this;
+ // -- validation code for: _attachmentList
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(0);
+ { // -- local scope
}
+ desc.setValidator(fieldValidator);
+ }
- /**
- * Method getXMLName.
- *
- * @return the XML Name for the Class being described.
- */
- public java.lang.String getXMLName(
- ) {
- return _xmlName;
- }
+ // -----------/
+ // - Methods -/
+ // -----------/
- /**
- * Method isElementDefinition.
- *
- * @return true if XML schema definition of this Class is that
- * of a global
- * element or element with anonymous type definition.
- */
- public boolean isElementDefinition(
- ) {
- return _elementDefinition;
- }
+ /**
+ * Method getAccessMode.
+ *
+ * @return the access mode specified for this class.
+ */
+ public org.exolab.castor.mapping.AccessMode getAccessMode() {
+ return null;
+ }
+
+ /**
+ * Method getIdentity.
+ *
+ * @return the identity field, null if this class has no identity.
+ */
+ public org.exolab.castor.mapping.FieldDescriptor getIdentity() {
+ return super.getIdentity();
+ }
+
+ /**
+ * Method getJavaClass.
+ *
+ * @return the Java class represented by this descriptor.
+ */
+ public java.lang.Class getJavaClass() {
+ return uk.ac.vamsas.objects.core.VamsasDocument.class;
+ }
+
+ /**
+ * Method getNameSpacePrefix.
+ *
+ * @return the namespace prefix to use when marshaling as XML.
+ */
+ public java.lang.String getNameSpacePrefix() {
+ return _nsPrefix;
+ }
+
+ /**
+ * Method getNameSpaceURI.
+ *
+ * @return the namespace URI used when marshaling and unmarshaling as XML.
+ */
+ public java.lang.String getNameSpaceURI() {
+ return _nsURI;
+ }
+
+ /**
+ * Method getValidator.
+ *
+ * @return a specific validator for the class described by this
+ * ClassDescriptor.
+ */
+ public org.exolab.castor.xml.TypeValidator getValidator() {
+ return this;
+ }
+
+ /**
+ * Method getXMLName.
+ *
+ * @return the XML Name for the Class being described.
+ */
+ public java.lang.String getXMLName() {
+ return _xmlName;
+ }
+
+ /**
+ * Method isElementDefinition.
+ *
+ * @return true if XML schema definition of this Class is that of a global
+ * element or element with anonymous type definition.
+ */
+ public boolean isElementDefinition() {
+ return _elementDefinition;
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/descriptors/VrefDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/VrefDescriptor.java
index aaf2f6d..cd06385 100644
--- a/src/uk/ac/vamsas/objects/core/descriptors/VrefDescriptor.java
+++ b/src/uk/ac/vamsas/objects/core/descriptors/VrefDescriptor.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core.descriptors;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import uk.ac.vamsas.objects.core.Vref;
@@ -18,134 +32,121 @@ import uk.ac.vamsas.objects.core.Vref;
*
* @version $Revision$ $Date$
*/
-public class VrefDescriptor extends uk.ac.vamsas.objects.core.descriptors.ReferenceTypeDescriptor {
-
-
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
- * Field _elementDefinition.
- */
- private boolean _elementDefinition;
-
- /**
- * Field _nsPrefix.
- */
- private java.lang.String _nsPrefix;
-
- /**
- * Field _nsURI.
- */
- private java.lang.String _nsURI;
-
- /**
- * Field _xmlName.
- */
- private java.lang.String _xmlName;
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public VrefDescriptor() {
- super();
- setExtendsWithoutFlatten(new uk.ac.vamsas.objects.core.descriptors.ReferenceTypeDescriptor());
- _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
- _xmlName = "vref";
- _elementDefinition = true;
- }
-
-
- //-----------/
- //- Methods -/
- //-----------/
-
- /**
- * Method getAccessMode.
- *
- * @return the access mode specified for this class.
- */
- public org.exolab.castor.mapping.AccessMode getAccessMode(
- ) {
- return null;
- }
-
- /**
- * Method getIdentity.
- *
- * @return the identity field, null if this class has no
- * identity.
- */
- public org.exolab.castor.mapping.FieldDescriptor getIdentity(
- ) {
- return super.getIdentity();
- }
-
- /**
- * Method getJavaClass.
- *
- * @return the Java class represented by this descriptor.
- */
- public java.lang.Class getJavaClass(
- ) {
- return uk.ac.vamsas.objects.core.Vref.class;
- }
-
- /**
- * Method getNameSpacePrefix.
- *
- * @return the namespace prefix to use when marshaling as XML.
- */
- public java.lang.String getNameSpacePrefix(
- ) {
- return _nsPrefix;
- }
-
- /**
- * Method getNameSpaceURI.
- *
- * @return the namespace URI used when marshaling and
- * unmarshaling as XML.
- */
- public java.lang.String getNameSpaceURI(
- ) {
- return _nsURI;
- }
-
- /**
- * Method getValidator.
- *
- * @return a specific validator for the class described by this
- * ClassDescriptor.
- */
- public org.exolab.castor.xml.TypeValidator getValidator(
- ) {
- return this;
- }
-
- /**
- * Method getXMLName.
- *
- * @return the XML Name for the Class being described.
- */
- public java.lang.String getXMLName(
- ) {
- return _xmlName;
- }
-
- /**
- * Method isElementDefinition.
- *
- * @return true if XML schema definition of this Class is that
- * of a global
- * element or element with anonymous type definition.
- */
- public boolean isElementDefinition(
- ) {
- return _elementDefinition;
- }
+public class VrefDescriptor extends
+ uk.ac.vamsas.objects.core.descriptors.ReferenceTypeDescriptor {
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * Field _elementDefinition.
+ */
+ private boolean _elementDefinition;
+
+ /**
+ * Field _nsPrefix.
+ */
+ private java.lang.String _nsPrefix;
+
+ /**
+ * Field _nsURI.
+ */
+ private java.lang.String _nsURI;
+
+ /**
+ * Field _xmlName.
+ */
+ private java.lang.String _xmlName;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public VrefDescriptor() {
+ super();
+ setExtendsWithoutFlatten(new uk.ac.vamsas.objects.core.descriptors.ReferenceTypeDescriptor());
+ _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
+ _xmlName = "vref";
+ _elementDefinition = true;
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ * Method getAccessMode.
+ *
+ * @return the access mode specified for this class.
+ */
+ public org.exolab.castor.mapping.AccessMode getAccessMode() {
+ return null;
+ }
+
+ /**
+ * Method getIdentity.
+ *
+ * @return the identity field, null if this class has no identity.
+ */
+ public org.exolab.castor.mapping.FieldDescriptor getIdentity() {
+ return super.getIdentity();
+ }
+
+ /**
+ * Method getJavaClass.
+ *
+ * @return the Java class represented by this descriptor.
+ */
+ public java.lang.Class getJavaClass() {
+ return uk.ac.vamsas.objects.core.Vref.class;
+ }
+
+ /**
+ * Method getNameSpacePrefix.
+ *
+ * @return the namespace prefix to use when marshaling as XML.
+ */
+ public java.lang.String getNameSpacePrefix() {
+ return _nsPrefix;
+ }
+
+ /**
+ * Method getNameSpaceURI.
+ *
+ * @return the namespace URI used when marshaling and unmarshaling as XML.
+ */
+ public java.lang.String getNameSpaceURI() {
+ return _nsURI;
+ }
+
+ /**
+ * Method getValidator.
+ *
+ * @return a specific validator for the class described by this
+ * ClassDescriptor.
+ */
+ public org.exolab.castor.xml.TypeValidator getValidator() {
+ return this;
+ }
+
+ /**
+ * Method getXMLName.
+ *
+ * @return the XML Name for the Class being described.
+ */
+ public java.lang.String getXMLName() {
+ return _xmlName;
+ }
+
+ /**
+ * Method isElementDefinition.
+ *
+ * @return true if XML schema definition of this Class is that of a global
+ * element or element with anonymous type definition.
+ */
+ public boolean isElementDefinition() {
+ return _elementDefinition;
+ }
}
diff --git a/src/uk/ac/vamsas/objects/core/descriptors/VxrefDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/VxrefDescriptor.java
index 86ddb3e..78fa9c1 100644
--- a/src/uk/ac/vamsas/objects/core/descriptors/VxrefDescriptor.java
+++ b/src/uk/ac/vamsas/objects/core/descriptors/VxrefDescriptor.java
@@ -1,14 +1,28 @@
/*
- * This class was automatically generated with
- * Castor 1.1, using an XML
- * Schema.
- * $Id$
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.objects.core.descriptors;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import uk.ac.vamsas.objects.core.Vxref;
@@ -18,134 +32,121 @@ import uk.ac.vamsas.objects.core.Vxref;
*
* @version $Revision$ $Date$
*/
-public class VxrefDescriptor extends uk.ac.vamsas.objects.core.descriptors.ReferenceTypeDescriptor {
-
-
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
- * Field _elementDefinition.
- */
- private boolean _elementDefinition;
-
- /**
- * Field _nsPrefix.
- */
- private java.lang.String _nsPrefix;
-
- /**
- * Field _nsURI.
- */
- private java.lang.String _nsURI;
-
- /**
- * Field _xmlName.
- */
- private java.lang.String _xmlName;
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public VxrefDescriptor() {
- super();
- setExtendsWithoutFlatten(new uk.ac.vamsas.objects.core.descriptors.ReferenceTypeDescriptor());
- _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
- _xmlName = "vxref";
- _elementDefinition = true;
- }
-
-
- //-----------/
- //- Methods -/
- //-----------/
-
- /**
- * Method getAccessMode.
- *
- * @return the access mode specified for this class.
- */
- public org.exolab.castor.mapping.AccessMode getAccessMode(
- ) {
- return null;
- }
-
- /**
- * Method getIdentity.
- *
- * @return the identity field, null if this class has no
- * identity.
- */
- public org.exolab.castor.mapping.FieldDescriptor getIdentity(
- ) {
- return super.getIdentity();
- }
-
- /**
- * Method getJavaClass.
- *
- * @return the Java class represented by this descriptor.
- */
- public java.lang.Class getJavaClass(
- ) {
- return uk.ac.vamsas.objects.core.Vxref.class;
- }
-
- /**
- * Method getNameSpacePrefix.
- *
- * @return the namespace prefix to use when marshaling as XML.
- */
- public java.lang.String getNameSpacePrefix(
- ) {
- return _nsPrefix;
- }
-
- /**
- * Method getNameSpaceURI.
- *
- * @return the namespace URI used when marshaling and
- * unmarshaling as XML.
- */
- public java.lang.String getNameSpaceURI(
- ) {
- return _nsURI;
- }
-
- /**
- * Method getValidator.
- *
- * @return a specific validator for the class described by this
- * ClassDescriptor.
- */
- public org.exolab.castor.xml.TypeValidator getValidator(
- ) {
- return this;
- }
-
- /**
- * Method getXMLName.
- *
- * @return the XML Name for the Class being described.
- */
- public java.lang.String getXMLName(
- ) {
- return _xmlName;
- }
-
- /**
- * Method isElementDefinition.
- *
- * @return true if XML schema definition of this Class is that
- * of a global
- * element or element with anonymous type definition.
- */
- public boolean isElementDefinition(
- ) {
- return _elementDefinition;
- }
+public class VxrefDescriptor extends
+ uk.ac.vamsas.objects.core.descriptors.ReferenceTypeDescriptor {
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * Field _elementDefinition.
+ */
+ private boolean _elementDefinition;
+
+ /**
+ * Field _nsPrefix.
+ */
+ private java.lang.String _nsPrefix;
+
+ /**
+ * Field _nsURI.
+ */
+ private java.lang.String _nsURI;
+
+ /**
+ * Field _xmlName.
+ */
+ private java.lang.String _xmlName;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public VxrefDescriptor() {
+ super();
+ setExtendsWithoutFlatten(new uk.ac.vamsas.objects.core.descriptors.ReferenceTypeDescriptor());
+ _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
+ _xmlName = "vxref";
+ _elementDefinition = true;
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ * Method getAccessMode.
+ *
+ * @return the access mode specified for this class.
+ */
+ public org.exolab.castor.mapping.AccessMode getAccessMode() {
+ return null;
+ }
+
+ /**
+ * Method getIdentity.
+ *
+ * @return the identity field, null if this class has no identity.
+ */
+ public org.exolab.castor.mapping.FieldDescriptor getIdentity() {
+ return super.getIdentity();
+ }
+
+ /**
+ * Method getJavaClass.
+ *
+ * @return the Java class represented by this descriptor.
+ */
+ public java.lang.Class getJavaClass() {
+ return uk.ac.vamsas.objects.core.Vxref.class;
+ }
+
+ /**
+ * Method getNameSpacePrefix.
+ *
+ * @return the namespace prefix to use when marshaling as XML.
+ */
+ public java.lang.String getNameSpacePrefix() {
+ return _nsPrefix;
+ }
+
+ /**
+ * Method getNameSpaceURI.
+ *
+ * @return the namespace URI used when marshaling and unmarshaling as XML.
+ */
+ public java.lang.String getNameSpaceURI() {
+ return _nsURI;
+ }
+
+ /**
+ * Method getValidator.
+ *
+ * @return a specific validator for the class described by this
+ * ClassDescriptor.
+ */
+ public org.exolab.castor.xml.TypeValidator getValidator() {
+ return this;
+ }
+
+ /**
+ * Method getXMLName.
+ *
+ * @return the XML Name for the Class being described.
+ */
+ public java.lang.String getXMLName() {
+ return _xmlName;
+ }
+
+ /**
+ * Method isElementDefinition.
+ *
+ * @return true if XML schema definition of this Class is that of a global
+ * element or element with anonymous type definition.
+ */
+ public boolean isElementDefinition() {
+ return _elementDefinition;
+ }
}
diff --git a/src/uk/ac/vamsas/objects/utils/AppDataReference.java b/src/uk/ac/vamsas/objects/utils/AppDataReference.java
index 058f9e6..efdf0c4 100644
--- a/src/uk/ac/vamsas/objects/utils/AppDataReference.java
+++ b/src/uk/ac/vamsas/objects/utils/AppDataReference.java
@@ -1,160 +1,208 @@
-/**
- *
- */
-package uk.ac.vamsas.objects.utils;
-import java.util.Vector;
-
-
-import uk.ac.vamsas.client.ClientHandle;
-import uk.ac.vamsas.client.UserHandle;
-import uk.ac.vamsas.client.simpleclient.VamsasArchive;
-import uk.ac.vamsas.client.simpleclient.VamsasArchiveReader;
-import uk.ac.vamsas.objects.core.*;
-/**
- * Form, accessors and validation for ApplicationData references in
- * vamsas document.
- * TODO: LATER:extend XML Schema to properly validate against the same forms required by this class
- * TODO: VAMSAS: URNS for appDatas are supposed to be unique, aren't they ?
- */
-public class AppDataReference {
- /**
- * search interface for collecting particular types of AppDatas in a vamsas document
- * @author jimp
- *
- */
- interface IAppDSearch {
- /**
- * process the appData Vobject d
- * @param d
- * @return true if appData should be collected
- */
- public boolean process(AppData d);
- }
- /**
- * collect all appData reference strings in a vamsas document
- * @param doc
- * @return vector of String objects
- */
- static public Vector getAppDataReferences(VamsasDocument doc) {
- if ((doc!=null) && (doc.getApplicationDataCount()>0)) {
- Vector apdrefs = new Vector();
- ApplicationData[] appdatas = doc.getApplicationData();
- for (int q=0; q0)
- return apdrefs;
- }
- return null;
- }
- /**
- * General search through the set of AppData objects for a particular profile of Client and User handle.
- * @param doc
- * @param test interface implemented by the filter selecting particular AppDatas.
- * @param cascade if true only User objects for ApplicationData objects that test.process returned true will be tested.
- * @return set of uk.ac.vamsas.objects.core.AppData objects for which test.process returned true
- */
- static public Vector searchAppDatas(VamsasDocument doc, IAppDSearch test, boolean cascade) {
- if ((doc!=null) && (doc.getApplicationDataCount()>0)) {
- Vector apdrefs = new Vector();
- ApplicationData[] appdatas = doc.getApplicationData();
- for (int q=0; q0)
- return apdrefs;
- }
- return null;
- }
- static public boolean equals(User p, UserHandle u) {
- if (p.getFullname().equals(u.getFullName())
- && p.getOrganization().equals(u.getOrganization()))
- return true;
- return false;
- }
- /**
- * returns true if Name matches in c and p, and Urn's match (or c.getUrn()==null) and Version's match (or c.getVersion()==null)
- * @param p
- * @param c
- * @return match of p on template c.
- */
- static public boolean equals(ApplicationData p, ClientHandle c) {
- if (
- //((c.getClientUrn()==null) || p.getUrn().equals(c.getClientUrn()))
- //&&
- (p.getName().equals(c.getClientName()))
- &&
- ((c.getVersion()==null) || (p.getVersion().equals(c.getVersion())))
- )
- return true;
- return false;
- }
- /**
- * Searches document appData structure for particular combinations of client and user data
- * @param doc the data
- * @param user template user data to match against
- * @see AppDataReference.equals(uk.ac.vamsas.objects.core.User, uk.ac.vamsas.client.UserHandle)
- * @param app
- * @see AppDataReference.equals(uk.ac.vamsas.objects.core.ApplicationData, uk.ac.vamsas.client.ClientHandle)
- * @return set of matching client app datas for this client and user combination
- */
- static public Vector getUserandApplicationsData(VamsasDocument doc, UserHandle user, ClientHandle app) {
- if (doc==null) {
- return null;
- }
- final UserHandle u = user;
- final ClientHandle c = app;
-
- IAppDSearch match = new IAppDSearch() {
- public boolean process(AppData p) {
- if (p instanceof User) {
- if (AppDataReference.equals((User) p, u))
- return true;
- } else
- if (p instanceof ApplicationData) {
- if (AppDataReference.equals((ApplicationData) p, c))
- return true;
- }
- return false;
- }
- };
-
- return searchAppDatas(doc, match, true); // only return AppDatas belonging to appdata app.
- }
- /**
- * safely creates a new appData reference
- * @param dest destination document Vobject
- * @param entry base application reference to make unique
- */
- public static String uniqueAppDataReference(VamsasDocument dest,String base) {
- String urn = base.replace('/','_').replace('\\','_').replace(':', '_').replace('.', '_');
- int v = 1;
- for (int i=0, j=dest.getApplicationDataCount(); i.
+ */
+package uk.ac.vamsas.objects.utils;
+
+import java.util.Vector;
+
+import uk.ac.vamsas.client.ClientHandle;
+import uk.ac.vamsas.client.UserHandle;
+import uk.ac.vamsas.client.simpleclient.VamsasArchive;
+import uk.ac.vamsas.client.simpleclient.VamsasArchiveReader;
+import uk.ac.vamsas.objects.core.*;
+
+/**
+ * Form, accessors and validation for ApplicationData references in vamsas
+ * document. TODO: LATER:extend XML Schema to properly validate against the same
+ * forms required by this class TODO: VAMSAS: URNS for appDatas are supposed to
+ * be unique, aren't they ?
+ */
+public class AppDataReference {
+ /**
+ * search interface for collecting particular types of AppDatas in a vamsas
+ * document
+ *
+ * @author jimp
+ *
+ */
+ interface IAppDSearch {
+ /**
+ * process the appData Vobject d
+ *
+ * @param d
+ * @return true if appData should be collected
+ */
+ public boolean process(AppData d);
+ }
+
+ /**
+ * collect all appData reference strings in a vamsas document
+ *
+ * @param doc
+ * @return vector of String objects
+ */
+ static public Vector getAppDataReferences(VamsasDocument doc) {
+ if ((doc != null) && (doc.getApplicationDataCount() > 0)) {
+ Vector apdrefs = new Vector();
+ ApplicationData[] appdatas = doc.getApplicationData();
+ for (int q = 0; q < appdatas.length; q++) {
+ String refstring = appdatas[q].getDataReference();
+ if (refstring != null)
+ apdrefs.add(refstring);
+ User users[] = appdatas[q].getUser();
+
+ if (users != null)
+ for (int u = 0; u < users.length; u++) {
+ refstring = users[u].getDataReference();
+ if (refstring != null)
+ apdrefs.add(new String(refstring)); // avoid referencing.
+ }
+ }
+ if (apdrefs.size() > 0)
+ return apdrefs;
+ }
+ return null;
+ }
+
+ /**
+ * General search through the set of AppData objects for a particular profile
+ * of Client and User handle.
+ *
+ * @param doc
+ * @param test
+ * interface implemented by the filter selecting particular AppDatas.
+ * @param cascade
+ * if true only User objects for ApplicationData objects that
+ * test.process returned true will be tested.
+ * @return set of uk.ac.vamsas.objects.core.AppData objects for which
+ * test.process returned true
+ */
+ static public Vector searchAppDatas(VamsasDocument doc, IAppDSearch test,
+ boolean cascade) {
+ if ((doc != null) && (doc.getApplicationDataCount() > 0)) {
+ Vector apdrefs = new Vector();
+ ApplicationData[] appdatas = doc.getApplicationData();
+ for (int q = 0; q < appdatas.length; q++) {
+ boolean t;
+ if (t = test.process(appdatas[q]))
+ apdrefs.add(appdatas[q]);
+ if (t || cascade) {
+ User users[] = appdatas[q].getUser();
+ if (users != null)
+ for (int u = 0; u < users.length; u++)
+ if (test.process(users[u]))
+ apdrefs.add(users[u]);
+ }
+ }
+ if (apdrefs.size() > 0)
+ return apdrefs;
+ }
+ return null;
+ }
+
+ static public boolean equals(User p, UserHandle u) {
+ if (p.getFullname().equals(u.getFullName())
+ && p.getOrganization().equals(u.getOrganization()))
+ return true;
+ return false;
+ }
+
+ /**
+ * returns true if Name matches in c and p, and Urn's match (or
+ * c.getUrn()==null) and Version's match (or c.getVersion()==null)
+ *
+ * @param p
+ * @param c
+ * @return match of p on template c.
+ */
+ static public boolean equals(ApplicationData p, ClientHandle c) {
+ if (
+ // ((c.getClientUrn()==null) || p.getUrn().equals(c.getClientUrn()))
+ // &&
+ (p.getName().equals(c.getClientName()))
+ && ((c.getVersion() == null) || (p.getVersion().equals(c.getVersion()))))
+ return true;
+ return false;
+ }
+
+ /**
+ * Searches document appData structure for particular combinations of client
+ * and user data
+ *
+ * @param doc
+ * the data
+ * @param user
+ * template user data to match against
+ * @see AppDataReference.equals(uk.ac.vamsas.objects.core.User,
+ * uk.ac.vamsas.client.UserHandle)
+ * @param app
+ * @see AppDataReference.equals(uk.ac.vamsas.objects.core.ApplicationData,
+ * uk.ac.vamsas.client.ClientHandle)
+ * @return set of matching client app datas for this client and user
+ * combination
+ */
+ static public Vector getUserandApplicationsData(VamsasDocument doc,
+ UserHandle user, ClientHandle app) {
+ if (doc == null) {
+ return null;
+ }
+ final UserHandle u = user;
+ final ClientHandle c = app;
+
+ IAppDSearch match = new IAppDSearch() {
+ public boolean process(AppData p) {
+ if (p instanceof User) {
+ if (AppDataReference.equals((User) p, u))
+ return true;
+ } else if (p instanceof ApplicationData) {
+ if (AppDataReference.equals((ApplicationData) p, c))
+ return true;
+ }
+ return false;
+ }
+ };
+
+ return searchAppDatas(doc, match, true); // only return AppDatas belonging
+ // to appdata app.
+ }
+
+ /**
+ * safely creates a new appData reference
+ *
+ * @param dest
+ * destination document Vobject
+ * @param entry
+ * base application reference to make unique
+ */
+ public static String uniqueAppDataReference(VamsasDocument dest, String base) {
+ String urn = base.replace('/', '_').replace('\\', '_').replace(':', '_')
+ .replace('.', '_');
+ int v = 1;
+ for (int i = 0, j = dest.getApplicationDataCount(); i < j; i++) {
+ ApplicationData o = dest.getApplicationData()[i];
+ // ensure new urn is really unique
+ while (o.getDataReference() != null && o.getDataReference().equals(urn)) {
+ urn = base + "_" + v++;
+ }
+ }
+ return urn;
+ }
+}
diff --git a/src/uk/ac/vamsas/objects/utils/DocumentStuff.java b/src/uk/ac/vamsas/objects/utils/DocumentStuff.java
index 01df061..14d764d 100644
--- a/src/uk/ac/vamsas/objects/utils/DocumentStuff.java
+++ b/src/uk/ac/vamsas/objects/utils/DocumentStuff.java
@@ -1,35 +1,57 @@
-package uk.ac.vamsas.objects.utils;
-
-
-import uk.ac.vamsas.objects.core.*;
-import uk.ac.vamsas.objects.utils.document.VersionEntries;
-
-/**
- * various vamsas-client independent helpers
- * for creating and manipulating the vamsasDocument Vobject
- * @author jimp
- *
- */
-public class DocumentStuff {
- public static VamsasDocument newVamsasDocument(VAMSAS root[], String version) {
- return newVamsasDocument(root, ProvenanceStuff.newProvenance(
- "AUTO:org.vamsas.DocumentStuff.newVamsasDocument",
- "Vamsas Document created"),
- version);
- }
- public static VamsasDocument newVamsasDocument(VAMSAS root[]) {
- return newVamsasDocument(root, ProvenanceStuff.newProvenance(
- "AUTO:org.vamsas.DocumentStuff.newVamsasDocument",
- "Vamsas Document created"),
- VersionEntries.latestVersion());
- }
- public static VamsasDocument newVamsasDocument(VAMSAS root[], Provenance p, String version) {
- VamsasDocument doc = new VamsasDocument();
- for (int r=0; r.
+ */
+package uk.ac.vamsas.objects.utils;
+
+import uk.ac.vamsas.objects.core.*;
+import uk.ac.vamsas.objects.utils.document.VersionEntries;
+
+/**
+ * various vamsas-client independent helpers for creating and manipulating the
+ * vamsasDocument Vobject
+ *
+ * @author jimp
+ *
+ */
+public class DocumentStuff {
+ public static VamsasDocument newVamsasDocument(VAMSAS root[], String version) {
+ return newVamsasDocument(root, ProvenanceStuff.newProvenance(
+ "AUTO:org.vamsas.DocumentStuff.newVamsasDocument",
+ "Vamsas Document created"), version);
+ }
+
+ public static VamsasDocument newVamsasDocument(VAMSAS root[]) {
+ return newVamsasDocument(root, ProvenanceStuff.newProvenance(
+ "AUTO:org.vamsas.DocumentStuff.newVamsasDocument",
+ "Vamsas Document created"), VersionEntries.latestVersion());
+ }
+
+ public static VamsasDocument newVamsasDocument(VAMSAS root[], Provenance p,
+ String version) {
+ VamsasDocument doc = new VamsasDocument();
+ for (int r = 0; r < root.length; r++) {
+ doc.addVAMSAS(root[r]);
+ }
+ doc.setProvenance(p);
+ doc.setVersion(version);
+ return doc;
+ }
+}
diff --git a/src/uk/ac/vamsas/objects/utils/Format.java b/src/uk/ac/vamsas/objects/utils/Format.java
index b4bd722..f67f698 100644
--- a/src/uk/ac/vamsas/objects/utils/Format.java
+++ b/src/uk/ac/vamsas/objects/utils/Format.java
@@ -1,24 +1,24 @@
/*
- * Cay S. Horstmann & Gary Cornell, Core Java
- * Published By Sun Microsystems Press/Prentice-Hall
- * Copyright (C) 1997 Sun Microsystems Inc.
- * All Rights Reserved.
- *
- * Permission to use, copy, modify, and distribute this
- * software and its documentation for NON-COMMERCIAL purposes
- * and without fee is hereby granted provided that this
- * copyright notice appears in all copies.
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
*
- * THE AUTHORS AND PUBLISHER MAKE NO REPRESENTATIONS OR
- * WARRANTIES ABOUT THE SUITABILITY OF THE SOFTWARE, EITHER
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE, OR NON-INFRINGEMENT. THE AUTHORS
- * AND PUBLISHER SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED
- * BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
- * THIS SOFTWARE OR ITS DERIVATIVES.
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
/**
* A class for formatting numbers that follows printf conventions.
* Also implements C-like atoi and atof functions
@@ -30,7 +30,8 @@ package uk.ac.vamsas.objects.utils;
import java.io.*;
-public class Format { /**
+public class Format {
+/**
* Formats the number following printf conventions.
* Main limitation: Can only handle one format parameter at a time
* Use multiple Format objects to format more than one number
@@ -154,62 +155,81 @@ public class Format { /**
}
/**
- * prints a formatted number following printf conventions
- * @param s a PrintStream
- * @param fmt the format string
- * @param x the double to print
- */
+ * prints a formatted number following printf conventions
+ *
+ * @param s
+ * a PrintStream
+ * @param fmt
+ * the format string
+ * @param x
+ * the double to print
+ */
public static void print(java.io.PrintStream s, String fmt, double x) {
s.print(new Format(fmt).form(x));
}
/**
- * prints a formatted number following printf conventions
- * @param s a PrintStream
- * @param fmt the format string
- * @param x the long to print
- */
+ * prints a formatted number following printf conventions
+ *
+ * @param s
+ * a PrintStream
+ * @param fmt
+ * the format string
+ * @param x
+ * the long to print
+ */
public static void print(java.io.PrintStream s, String fmt, long x) {
s.print(new Format(fmt).form(x));
}
/**
- * prints a formatted number following printf conventions
- * @param s a PrintStream
- * @param fmt the format string
- * @param x the character to
- */
+ * prints a formatted number following printf conventions
+ *
+ * @param s
+ * a PrintStream
+ * @param fmt
+ * the format string
+ * @param x
+ * the character to
+ */
public static void print(java.io.PrintStream s, String fmt, char x) {
s.print(new Format(fmt).form(x));
}
/**
- * prints a formatted number following printf conventions
- * @param s a PrintStream, fmt the format string
- * @param x a string that represents the digits to print
- */
+ * prints a formatted number following printf conventions
+ *
+ * @param s
+ * a PrintStream, fmt the format string
+ * @param x
+ * a string that represents the digits to print
+ */
public static void print(java.io.PrintStream s, String fmt, String x) {
s.print(new Format(fmt).form(x));
}
/**
- * Converts a string of digits (decimal, octal or hex) to an integer
- * @param s a string
- * @return the numeric value of the prefix of s representing a base 10 integer
- */
+ * Converts a string of digits (decimal, octal or hex) to an integer
+ *
+ * @param s
+ * a string
+ * @return the numeric value of the prefix of s representing a base 10 integer
+ */
public static int atoi(String s) {
- return (int)atol(s);
+ return (int) atol(s);
}
/**
- * Converts a string of digits (decimal, octal or hex) to a long integer
- * @param s a string
- * @return the numeric value of the prefix of s representing a base 10 integer
- */
+ * Converts a string of digits (decimal, octal or hex) to a long integer
+ *
+ * @param s
+ * a string
+ * @return the numeric value of the prefix of s representing a base 10 integer
+ */
public static long atol(String s) {
int i = 0;
@@ -217,7 +237,8 @@ public class Format { /**
while (i < s.length() && Character.isWhitespace(s.charAt(i)))
i++;
if (i < s.length() && s.charAt(i) == '0') {
- if (i + 1 < s.length() && (s.charAt(i + 1) == 'x' || s.charAt(i + 1) == 'X'))
+ if (i + 1 < s.length()
+ && (s.charAt(i + 1) == 'x' || s.charAt(i + 1) == 'X'))
return parseLong(s.substring(i + 2), 16);
else
return parseLong(s, 8);
@@ -243,9 +264,9 @@ public class Format { /**
if ('0' <= ch && ch < '0' + base)
r = r * base + ch - '0';
else if ('A' <= ch && ch < 'A' + base - 10)
- r = r * base + ch - 'A' + 10 ;
+ r = r * base + ch - 'A' + 10;
else if ('a' <= ch && ch < 'a' + base - 10)
- r = r * base + ch - 'a' + 10 ;
+ r = r * base + ch - 'a' + 10;
else
return r * sign;
i++;
@@ -254,9 +275,11 @@ public class Format { /**
}
/**
- * Converts a string of digits to an double
- * @param s a string
- */
+ * Converts a string of digits to an double
+ *
+ * @param s
+ * a string
+ */
public static double atof(String s) {
int i = 0;
@@ -289,7 +312,7 @@ public class Format { /**
else
return sign * r;
} else if (ch == 'e' || ch == 'E') {
- long e = (int)parseLong(s.substring(i + 1), 10);
+ long e = (int) parseLong(s.substring(i + 1), 10);
return sign * r * Math.pow(10, e);
} else
return sign * r;
@@ -299,11 +322,14 @@ public class Format { /**
}
/**
- * Formats a double into a string (like sprintf in C)
- * @param x the number to format
- * @return the formatted string
- * @exception IllegalArgumentException if bad argument
- */
+ * Formats a double into a string (like sprintf in C)
+ *
+ * @param x
+ * the number to format
+ * @return the formatted string
+ * @exception IllegalArgumentException
+ * if bad argument
+ */
public String form(double x) {
String r;
@@ -325,10 +351,12 @@ public class Format { /**
}
/**
- * Formats a long integer into a string (like sprintf in C)
- * @param x the number to format
- * @return the formatted string
- */
+ * Formats a long integer into a string (like sprintf in C)
+ *
+ * @param x
+ * the number to format
+ * @return the formatted string
+ */
public String form(long x) {
String r;
@@ -354,10 +382,12 @@ public class Format { /**
}
/**
- * Formats a character into a string (like sprintf in C)
- * @param x the value to format
- * @return the formatted string
- */
+ * Formats a character into a string (like sprintf in C)
+ *
+ * @param x
+ * the value to format
+ * @return the formatted string
+ */
public String form(char c) {
if (fmt != 'c')
@@ -368,10 +398,12 @@ public class Format { /**
}
/**
- * Formats a string into a larger string (like sprintf in C)
- * @param x the value to format
- * @return the formatted string
- */
+ * Formats a string into a larger string (like sprintf in C)
+ *
+ * @param x
+ * the value to format
+ * @return the formatted string
+ */
public String form(String s) {
if (fmt != 's')
@@ -381,10 +413,9 @@ public class Format { /**
return pad(s);
}
-
/**
- * a test stub for the format class
- */
+ * a test stub for the format class
+ */
public static void main(String[] a) {
double x = 1.23456789012;
@@ -471,7 +502,7 @@ public class Format { /**
return "0";
String r = "";
while (x != 0) {
- r = d.charAt((int)(x & m)) + r;
+ r = d.charAt((int) (x & m)) + r;
x = x >>> n;
}
return r;
@@ -506,23 +537,22 @@ public class Format { /**
if (leading_zeroes)
w = width;
else if ((fmt == 'd' || fmt == 'i' || fmt == 'x' || fmt == 'X' || fmt == 'o')
- && precision > 0)
+ && precision > 0)
w = precision;
return p + repeat('0', w - p.length() - r.length()) + r;
}
private String fixed_format(double d) {
- boolean removeTrailing
- = (fmt == 'G' || fmt == 'g') && !alternate;
+ boolean removeTrailing = (fmt == 'G' || fmt == 'g') && !alternate;
// remove trailing zeroes and decimal point
if (d > 0x7FFFFFFFFFFFFFFFL)
return exp_format(d);
if (precision == 0)
- return (long)(d + 0.5) + (removeTrailing ? "" : ".");
+ return (long) (d + 0.5) + (removeTrailing ? "" : ".");
- long whole = (long)d;
+ long whole = (long) d;
double fr = d - whole; // fractional part
if (fr >= 1 || fr < 0)
return exp_format(d);
@@ -595,18 +625,22 @@ public class Format { /**
}
private int width;
+
private int precision;
+
private String pre;
+
private String post;
+
private boolean leading_zeroes;
+
private boolean show_plus;
+
private boolean alternate;
+
private boolean show_space;
+
private boolean left_align;
+
private char fmt; // one of cdeEfgGiosxXos
}
-
-
-
-
-
diff --git a/src/uk/ac/vamsas/objects/utils/GlyphDictionary.java b/src/uk/ac/vamsas/objects/utils/GlyphDictionary.java
index a49f4be..02a128e 100644
--- a/src/uk/ac/vamsas/objects/utils/GlyphDictionary.java
+++ b/src/uk/ac/vamsas/objects/utils/GlyphDictionary.java
@@ -1,23 +1,47 @@
+/*
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
+ */
package uk.ac.vamsas.objects.utils;
/**
- * dict attribute values for glyph symbol sets found in uk.ac.vamsas.objects.core.AnnotationElement
- * TODO: add validators and multilength symbols.
+ * dict attribute values for glyph symbol sets found in
+ * uk.ac.vamsas.objects.core.AnnotationElement TODO: add validators and
+ * multilength symbols.
+ *
* @author JimP
- *
+ *
*/
public class GlyphDictionary {
/**
* standard H, E, or C three state secondary structure assignment.
*/
- static final public String PROTEIN_SS_3STATE="aasecstr_3"; // HE, blank or C
+ static final public String PROTEIN_SS_3STATE = "aasecstr_3"; // HE, blank or C
+
/**
* default glyph type attribute indicates a UTF8 character
*/
- static final public String DEFAULT="utf8";
+ static final public String DEFAULT = "utf8";
+
/**
- * kyte and doolittle hydrophobicity
- * TODO: specify this glyph set.
+ * kyte and doolittle hydrophobicity TODO: specify this glyph set.
*/
- static final public String PROTEIN_HD_HYDRO="kd_hydrophobicity";
+ static final public String PROTEIN_HD_HYDRO = "kd_hydrophobicity";
}
diff --git a/src/uk/ac/vamsas/objects/utils/MapList.java b/src/uk/ac/vamsas/objects/utils/MapList.java
index 5052c94..30970e7 100644
--- a/src/uk/ac/vamsas/objects/utils/MapList.java
+++ b/src/uk/ac/vamsas/objects/utils/MapList.java
@@ -1,810 +1,743 @@
-/*
- * This code was originated from
- * Jalview - A Sequence Alignment Editor and Viewer
- * Copyright (C) 2007 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
- */
-package uk.ac.vamsas.objects.utils;
-
-import java.util.*;
-
-/**
- * MapList
- * Simple way of bijectively mapping a non-contiguous linear range to another non-contiguous linear range
- * Use at your own risk!
- * TODO: efficient implementation of private posMap method
- * TODO: test/ensure that sense of from and to ratio start position is conserved (codon start position recovery)
- * TODO: optimize to use int[][] arrays rather than vectors.
- */
-public class MapList
-{
- /* (non-Javadoc)
- * @see java.lang.Object#equals(java.lang.Object)
- */
- public boolean equals(MapList obj) {
- if (obj==this)
- return true;
- if (obj!=null && obj.fromRatio==fromRatio && obj.toRatio==toRatio
- && obj.fromShifts!=null && obj.toShifts!=null) {
- int i,iSize=fromShifts.size(),j,jSize=obj.fromShifts.size();
- if (iSize!=jSize)
- return false;
- for (i=0,iSize=fromShifts.size(),j=0, jSize=obj.fromShifts.size(); ipos)
- limits[0]=pos;
- if (limits[1]=ivSize)
- {
- return null;
- }
- int[] intv=(int[]) intVals.elementAt(iv++);
- int from=intv[0],to=intv[1];
- if (from > to)
- {
- from = intv[1];
- to=intv[0];
- }
- while (ivto)
- {
- to=intv[0];
- }
- if (intv[1]>to)
- {
- to=intv[1];
- }
- }
- int tF=0,tT=0;
- int mp[][] = new int[to-from+2][];
- for (int i = 0; i < mp.length; i++)
- {
- int[] m = shift(i+from,intVals,ratio,toIntVals, toRatio);
- if (m != null)
- {
- if (i == 0)
- {
- tF=tT=m[0];
- }
- else
- {
- if (m[0] < tF)
- {
- tF=m[0];
- }
- if (m[0] > tT)
- {
- tT=m[0];
- }
- }
- }
- mp[i] = m;
- }
- int[][] map = new int[][]
- {
- new int[]
- {
- from, to, tF, tT}, new int[to - from + 2]};
-
- map[0][2] = tF;
- map[0][3] = tT;
-
- for (int i = 0; i < mp.length; i++)
- {
- if (mp[i] != null)
- {
- map[1][i] = mp[i][0]-tF;
- }
- else
- {
- map[1][i] = -1; // indicates an out of range mapping
- }
- }
- return map;
- }
- /**
- * addShift
- * @param pos start position for shift (in original reference frame)
- * @param shift length of shift
- *
- public void addShift(int pos, int shift)
- {
- int sidx = 0;
- int[] rshift=null;
- while (sidx= intv[0] && pos <= intv[1])
- {
- return new int[]
- {
- count + pos - intv[0] + 1, +1};
- }
- else
- {
- count+=intv[1]-intv[0]+1;
- }
- }
- else
- {
- if (pos >= intv[1] && pos <= intv[0])
- {
- return new int[]
- {
- count + intv[0] - pos + 1, -1};
- }
- else
- {
- count+=intv[0]-intv[1]+1;
- }
- }
- }
- return null;
- }
- /**
- * count out pos positions into a series of intervals and return the position
- * @param intVals
- * @param pos
- * @return position pos in interval set
- */
- private int[] countToPos(Vector intVals, int pos)
- {
- int count = 0, diff = 0, iv=0,ivSize=intVals.size(), intv[] =
- {
- 0, 0};
- while (iv= 0)
- {
- if (pos <= count + 1 + diff)
- {
- return new int[]
- {
- pos - count - 1 + intv[0], +1};
- }
- else
- {
- count+=1+diff;
- }
- }
- else
- {
- if (pos <= count + 1 - diff)
- {
- return new int[]
- {
- intv[0] - (pos - count - 1), -1};
- }
- else
- {
- count+=1-diff;
- }
- }
- }
- return null;//(diff<0) ? (intv[1]-1) : (intv[0]+1);
- }
- /**
- * find series of intervals mapping from start-end in the From map.
- * @param start position in to map
- * @param end position in to map
- * @return series of ranges in from map
- */
- public int[] locateInFrom(int start, int end) {
- // inefficient implementation
- int fromStart[] = shiftTo(start);
- int fromEnd[] = shiftTo(end); // needs to be inclusive of end of symbol position
- if (fromStart==null || fromEnd==null)
- return null;
- int iv[] = getIntervals(fromShifts, fromStart, fromEnd,fromRatio);
- return iv;
- }
-
- /**
- * find series of intervals mapping from start-end in the to map.
- * @param start position in from map
- * @param end position in from map
- * @return series of ranges in to map
- */
- public int[] locateInTo(int start, int end) {
- // inefficient implementation
- int toStart[] = shiftFrom(start);
- int toEnd[] = shiftFrom(end);
- if (toStart==null || toEnd==null)
- return null;
- int iv[] = getIntervals(toShifts, toStart, toEnd, toRatio);
- return iv;
- }
- /**
- * like shift - except returns the intervals in the given vector of shifts which were spanned
- * in traversing fromStart to fromEnd
- * @param fromShifts2
- * @param fromStart
- * @param fromEnd
- * @param fromRatio2
- * @return series of from,to intervals from from first position of starting region to final position of ending region inclusive
- */
- private int[] getIntervals(Vector fromShifts2, int[] fromStart, int[] fromEnd, int fromRatio2)
- {
- int startpos,endpos;
- startpos = fromStart[0]; // first position in fromStart
- endpos = fromEnd[0]+fromEnd[2]*(fromRatio2-1); // last position in fromEnd
- int intv=0,intvSize= fromShifts2.size();
- int iv[],i=0,fs=-1,fe=-1; // containing intervals
- while (intv=iv[0] && startpos<=iv[1]) {
- fs = i;
- }
- if (fe==-1 && endpos>=iv[0] && endpos<=iv[1]) {
- fe = i;
- }
- } else {
- if (fs==-1 && startpos<=iv[0] && startpos>=iv[1]) {
- fs = i;
- }
- if (fe==-1 && endpos<=iv[0] && endpos>=iv[1]) {
- fe = i;
- }
- }
- i++;
- }
- if (fs==fe && fe==-1)
- return null;
- Vector ranges=new Vector();
- if (fs<=fe) {
- intv = fs;
- i=fs;
- // truncate initial interval
- iv = (int[]) fromShifts2.elementAt(intv++);
- iv = new int[] { iv[0], iv[1]};// clone
- if (i==fs)
- iv[0] = startpos;
- while (i!=fe) {
- ranges.addElement(iv); // add initial range
- iv = (int[]) fromShifts2.elementAt(intv++); // get next interval
- iv = new int[] { iv[0], iv[1]};// clone
- i++;
- }
- if (i==fe)
- iv[1] = endpos;
- ranges.addElement(iv); // add only - or final range
- } else {
- // walk from end of interval.
- i=fromShifts2.size()-1;
- while (i>fs) {
- i--;
- }
- iv = (int[]) fromShifts2.elementAt(i);
- iv = new int[] { iv[1], iv[0]};// reverse and clone
- // truncate initial interval
- if (i==fs)
- {
- iv[0] = startpos;
- }
- while (--i!=fe) { // fix apparent logic bug when fe==-1
- ranges.addElement(iv); // add (truncated) reversed interval
- iv = (int[]) fromShifts2.elementAt(i);
- iv = new int[] { iv[1], iv[0] }; // reverse and clone
- }
- if (i==fe) {
- // interval is already reversed
- iv[1] = endpos;
- }
- ranges.addElement(iv); // add only - or final range
- }
- // create array of start end intervals.
- int[] range = null;
- if (ranges!=null && ranges.size()>0)
- {
- range = new int[ranges.size()*2];
- intv = 0;
- intvSize=ranges.size();
- i=0;
- while (intv" + toofrom[0]);
- }
- System.out.println("ShiftTo(" + too[0] + ")==" + toofrom[0] + " % " +
- toofrom[1]+" ("+toofrom[2]+")");
- }
- else
- {
- System.out.println("ShiftTo(" + too[0] + ")==" +
- "NaN! - not Bijective Mapping!");
- }
- }
- }
- int mmap[][] = ml.makeFromMap();
- System.out.println("FromMap : (" + mmap[0][0] + " " + mmap[0][1] + " " +
- mmap[0][2] + " " + mmap[0][3] + " ");
- for (int i = 1; i <= mmap[1].length; i++)
- {
- if (mmap[1][i - 1] == -1)
- {
- System.out.print(i+"=XXX");
-
- }
- else
- {
- System.out.print(i+"="+(mmap[0][2]+mmap[1][i-1]));
- }
- if (i % 20==0)
- {
- System.out.print("\n");
- }
- else
- {
- System.out.print(",");
- }
- }
- //test range function
- System.out.print("\nTest locateInFrom\n");
- {
- int f=mmap[0][2],t=mmap[0][3];
- while (f<=t) {
- System.out.println("Range "+f+" to "+t);
- int rng[] = ml.locateInFrom(f,t);
- if (rng!=null)
- {
- for (int i=0; i.
+ */
+package uk.ac.vamsas.objects.utils;
+
+import java.util.*;
+
+/**
+ * MapList Simple way of bijectively mapping a non-contiguous linear range to
+ * another non-contiguous linear range Use at your own risk! TODO: efficient
+ * implementation of private posMap method TODO: test/ensure that sense of from
+ * and to ratio start position is conserved (codon start position recovery)
+ * TODO: optimize to use int[][] arrays rather than vectors.
+ */
+public class MapList {
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ public boolean equals(MapList obj) {
+ if (obj == this)
+ return true;
+ if (obj != null && obj.fromRatio == fromRatio && obj.toRatio == toRatio
+ && obj.fromShifts != null && obj.toShifts != null) {
+ int i, iSize = fromShifts.size(), j, jSize = obj.fromShifts.size();
+ if (iSize != jSize)
+ return false;
+ for (i = 0, iSize = fromShifts.size(), j = 0, jSize = obj.fromShifts
+ .size(); i < iSize;) {
+ int[] mi = (int[]) fromShifts.elementAt(i++);
+ int[] mj = (int[]) obj.fromShifts.elementAt(j++);
+ if (mi[0] != mj[0] || mi[1] != mj[1])
+ return false;
+ }
+ iSize = toShifts.size();
+ jSize = obj.toShifts.size();
+ if (iSize != jSize)
+ return false;
+ for (i = 0, j = 0; i < iSize;) {
+ int[] mi = (int[]) toShifts.elementAt(i++);
+ int[] mj = (int[]) obj.toShifts.elementAt(j++);
+ if (mi[0] != mj[0] || mi[1] != mj[1])
+ return false;
+ }
+ return true;
+ }
+ return false;
+ }
+
+ public Vector fromShifts;
+
+ public Vector toShifts;
+
+ int fromRatio; // number of steps in fromShifts to one toRatio unit
+
+ int toRatio; // number of steps in toShifts to one fromRatio
+
+ /**
+ *
+ * @return series of intervals mapped in from
+ */
+ public int[] getFromRanges() {
+ return getRanges(fromShifts);
+ }
+
+ public int[] getToRanges() {
+ return getRanges(toShifts);
+ }
+
+ private int[] getRanges(Vector shifts) {
+ int[] rnges = new int[2 * shifts.size()];
+ Enumeration e = shifts.elements();
+ int i = 0;
+ while (e.hasMoreElements()) {
+ int r[] = (int[]) e.nextElement();
+ rnges[i++] = r[0];
+ rnges[i++] = r[1];
+ }
+ return rnges;
+ }
+
+ /**
+ * lowest and highest value in the from Map
+ */
+ int[] fromRange = null;
+
+ /**
+ * lowest and highest value in the to Map
+ */
+ int[] toRange = null;
+
+ /**
+ *
+ * @return length of mapped phrase in from
+ */
+ public int getFromRatio() {
+ return fromRatio;
+ }
+
+ /**
+ *
+ * @return length of mapped phrase in to
+ */
+ public int getToRatio() {
+ return toRatio;
+ }
+
+ public int getFromLowest() {
+ return fromRange[0];
+ }
+
+ public int getFromHighest() {
+ return fromRange[1];
+ }
+
+ public int getToLowest() {
+ return toRange[0];
+ }
+
+ public int getToHighest() {
+ return toRange[1];
+ }
+
+ private void ensureRange(int[] limits, int pos) {
+ if (limits[0] > pos)
+ limits[0] = pos;
+ if (limits[1] < pos)
+ limits[1] = pos;
+ }
+
+ public MapList(int from[], int to[], int fromRatio, int toRatio) {
+ fromRange = new int[] { from[0], from[1] };
+ toRange = new int[] { to[0], to[1] };
+
+ fromShifts = new Vector();
+ for (int i = 0; i < from.length; i += 2) {
+ ensureRange(fromRange, from[i]);
+ ensureRange(fromRange, from[i + 1]);
+
+ fromShifts.addElement(new int[] { from[i], from[i + 1] });
+ }
+ toShifts = new Vector();
+ for (int i = 0; i < to.length; i += 2) {
+ ensureRange(toRange, to[i]);
+ ensureRange(toRange, to[i + 1]);
+ toShifts.addElement(new int[] { to[i], to[i + 1] });
+ }
+ this.fromRatio = fromRatio;
+ this.toRatio = toRatio;
+ }
+
+ public MapList(MapList map) {
+ this.fromRange = new int[] { map.fromRange[0], map.fromRange[1] };
+ this.toRange = new int[] { map.toRange[0], map.toRange[1] };
+ this.fromRatio = map.fromRatio;
+ this.toRatio = map.toRatio;
+ if (map.fromShifts != null) {
+ this.fromShifts = new Vector();
+ Enumeration e = map.fromShifts.elements();
+ while (e.hasMoreElements()) {
+ int[] el = (int[]) e.nextElement();
+ fromShifts.addElement(new int[] { el[0], el[1] });
+ }
+ }
+ if (map.toShifts != null) {
+ this.toShifts = new Vector();
+ Enumeration e = map.toShifts.elements();
+ while (e.hasMoreElements()) {
+ int[] el = (int[]) e.nextElement();
+ toShifts.addElement(new int[] { el[0], el[1] });
+ }
+ }
+ }
+
+ /**
+ * get all mapped positions from 'from' to 'to'
+ *
+ * @return int[][] { int[] { fromStart, fromFinish, toStart, toFinish }, int
+ * [fromFinish-fromStart+2] { toStart..toFinish mappings}}
+ */
+ public int[][] makeFromMap() {
+ return posMap(fromShifts, fromRatio, toShifts, toRatio);
+ }
+
+ /**
+ * get all mapped positions from 'to' to 'from'
+ *
+ * @return int[to position]=position mapped in from
+ */
+ public int[][] makeToMap() {
+ return posMap(toShifts, toRatio, fromShifts, fromRatio);
+ }
+
+ /**
+ * construct an int map for intervals in intVals
+ *
+ * @param intVals
+ * @return int[] { from, to pos in range }, int[range.to-range.from+1]
+ * returning mapped position
+ */
+ private int[][] posMap(Vector intVals, int ratio, Vector toIntVals,
+ int toRatio) {
+ int iv = 0, ivSize = intVals.size();
+ if (iv >= ivSize) {
+ return null;
+ }
+ int[] intv = (int[]) intVals.elementAt(iv++);
+ int from = intv[0], to = intv[1];
+ if (from > to) {
+ from = intv[1];
+ to = intv[0];
+ }
+ while (iv < ivSize) {
+ intv = (int[]) intVals.elementAt(iv++);
+ if (intv[0] < from) {
+ from = intv[0];
+ }
+ if (intv[1] < from) {
+ from = intv[1];
+ }
+ if (intv[0] > to) {
+ to = intv[0];
+ }
+ if (intv[1] > to) {
+ to = intv[1];
+ }
+ }
+ int tF = 0, tT = 0;
+ int mp[][] = new int[to - from + 2][];
+ for (int i = 0; i < mp.length; i++) {
+ int[] m = shift(i + from, intVals, ratio, toIntVals, toRatio);
+ if (m != null) {
+ if (i == 0) {
+ tF = tT = m[0];
+ } else {
+ if (m[0] < tF) {
+ tF = m[0];
+ }
+ if (m[0] > tT) {
+ tT = m[0];
+ }
+ }
+ }
+ mp[i] = m;
+ }
+ int[][] map = new int[][] { new int[] { from, to, tF, tT },
+ new int[to - from + 2] };
+
+ map[0][2] = tF;
+ map[0][3] = tT;
+
+ for (int i = 0; i < mp.length; i++) {
+ if (mp[i] != null) {
+ map[1][i] = mp[i][0] - tF;
+ } else {
+ map[1][i] = -1; // indicates an out of range mapping
+ }
+ }
+ return map;
+ }
+
+ /**
+ * addShift
+ *
+ * @param pos
+ * start position for shift (in original reference frame)
+ * @param shift
+ * length of shift
+ *
+ * public void addShift(int pos, int shift) { int sidx = 0; int[]
+ * rshift=null; while (sidx= intv[0] && pos <= intv[1]) {
+ return new int[] { count + pos - intv[0] + 1, +1 };
+ } else {
+ count += intv[1] - intv[0] + 1;
+ }
+ } else {
+ if (pos >= intv[1] && pos <= intv[0]) {
+ return new int[] { count + intv[0] - pos + 1, -1 };
+ } else {
+ count += intv[0] - intv[1] + 1;
+ }
+ }
+ }
+ return null;
+ }
+
+ /**
+ * count out pos positions into a series of intervals and return the position
+ *
+ * @param intVals
+ * @param pos
+ * @return position pos in interval set
+ */
+ private int[] countToPos(Vector intVals, int pos) {
+ int count = 0, diff = 0, iv = 0, ivSize = intVals.size(), intv[] = { 0, 0 };
+ while (iv < ivSize) {
+ intv = (int[]) intVals.elementAt(iv++);
+ diff = intv[1] - intv[0];
+ if (diff >= 0) {
+ if (pos <= count + 1 + diff) {
+ return new int[] { pos - count - 1 + intv[0], +1 };
+ } else {
+ count += 1 + diff;
+ }
+ } else {
+ if (pos <= count + 1 - diff) {
+ return new int[] { intv[0] - (pos - count - 1), -1 };
+ } else {
+ count += 1 - diff;
+ }
+ }
+ }
+ return null;// (diff<0) ? (intv[1]-1) : (intv[0]+1);
+ }
+
+ /**
+ * find series of intervals mapping from start-end in the From map.
+ *
+ * @param start
+ * position in to map
+ * @param end
+ * position in to map
+ * @return series of ranges in from map
+ */
+ public int[] locateInFrom(int start, int end) {
+ // inefficient implementation
+ int fromStart[] = shiftTo(start);
+ int fromEnd[] = shiftTo(end); // needs to be inclusive of end of symbol
+ // position
+ if (fromStart == null || fromEnd == null)
+ return null;
+ int iv[] = getIntervals(fromShifts, fromStart, fromEnd, fromRatio);
+ return iv;
+ }
+
+ /**
+ * find series of intervals mapping from start-end in the to map.
+ *
+ * @param start
+ * position in from map
+ * @param end
+ * position in from map
+ * @return series of ranges in to map
+ */
+ public int[] locateInTo(int start, int end) {
+ // inefficient implementation
+ int toStart[] = shiftFrom(start);
+ int toEnd[] = shiftFrom(end);
+ if (toStart == null || toEnd == null)
+ return null;
+ int iv[] = getIntervals(toShifts, toStart, toEnd, toRatio);
+ return iv;
+ }
+
+ /**
+ * like shift - except returns the intervals in the given vector of shifts
+ * which were spanned in traversing fromStart to fromEnd
+ *
+ * @param fromShifts2
+ * @param fromStart
+ * @param fromEnd
+ * @param fromRatio2
+ * @return series of from,to intervals from from first position of starting
+ * region to final position of ending region inclusive
+ */
+ private int[] getIntervals(Vector fromShifts2, int[] fromStart,
+ int[] fromEnd, int fromRatio2) {
+ int startpos, endpos;
+ startpos = fromStart[0]; // first position in fromStart
+ endpos = fromEnd[0] + fromEnd[2] * (fromRatio2 - 1); // last position in
+ // fromEnd
+ int intv = 0, intvSize = fromShifts2.size();
+ int iv[], i = 0, fs = -1, fe = -1; // containing intervals
+ while (intv < intvSize && (fs == -1 || fe == -1)) {
+ iv = (int[]) fromShifts2.elementAt(intv++);
+ if (iv[0] <= iv[1]) {
+ if (fs == -1 && startpos >= iv[0] && startpos <= iv[1]) {
+ fs = i;
+ }
+ if (fe == -1 && endpos >= iv[0] && endpos <= iv[1]) {
+ fe = i;
+ }
+ } else {
+ if (fs == -1 && startpos <= iv[0] && startpos >= iv[1]) {
+ fs = i;
+ }
+ if (fe == -1 && endpos <= iv[0] && endpos >= iv[1]) {
+ fe = i;
+ }
+ }
+ i++;
+ }
+ if (fs == fe && fe == -1)
+ return null;
+ Vector ranges = new Vector();
+ if (fs <= fe) {
+ intv = fs;
+ i = fs;
+ // truncate initial interval
+ iv = (int[]) fromShifts2.elementAt(intv++);
+ iv = new int[] { iv[0], iv[1] };// clone
+ if (i == fs)
+ iv[0] = startpos;
+ while (i != fe) {
+ ranges.addElement(iv); // add initial range
+ iv = (int[]) fromShifts2.elementAt(intv++); // get next interval
+ iv = new int[] { iv[0], iv[1] };// clone
+ i++;
+ }
+ if (i == fe)
+ iv[1] = endpos;
+ ranges.addElement(iv); // add only - or final range
+ } else {
+ // walk from end of interval.
+ i = fromShifts2.size() - 1;
+ while (i > fs) {
+ i--;
+ }
+ iv = (int[]) fromShifts2.elementAt(i);
+ iv = new int[] { iv[1], iv[0] };// reverse and clone
+ // truncate initial interval
+ if (i == fs) {
+ iv[0] = startpos;
+ }
+ while (--i != fe) { // fix apparent logic bug when fe==-1
+ ranges.addElement(iv); // add (truncated) reversed interval
+ iv = (int[]) fromShifts2.elementAt(i);
+ iv = new int[] { iv[1], iv[0] }; // reverse and clone
+ }
+ if (i == fe) {
+ // interval is already reversed
+ iv[1] = endpos;
+ }
+ ranges.addElement(iv); // add only - or final range
+ }
+ // create array of start end intervals.
+ int[] range = null;
+ if (ranges != null && ranges.size() > 0) {
+ range = new int[ranges.size() * 2];
+ intv = 0;
+ intvSize = ranges.size();
+ i = 0;
+ while (intv < intvSize) {
+ iv = (int[]) ranges.elementAt(intv);
+ range[i++] = iv[0];
+ range[i++] = iv[1];
+ ranges.setElementAt(null, intv++); // remove
+ }
+ }
+ return range;
+ }
+
+ /**
+ * get the 'initial' position of mpos in To
+ *
+ * @param mpos
+ * position in from
+ * @return position of first word in to reference frame
+ */
+ public int getToPosition(int mpos) {
+ int[] mp = shiftTo(mpos);
+ if (mp != null) {
+ return mp[0];
+ }
+ return mpos;
+ }
+
+ /**
+ * get range of positions in To frame for the mpos word in From
+ *
+ * @param mpos
+ * position in From
+ * @return null or int[] first position in To for mpos, last position in to
+ * for Mpos
+ */
+ public int[] getToWord(int mpos) {
+ int[] mp = shiftTo(mpos);
+ if (mp != null) {
+ return new int[] { mp[0], mp[0] + mp[2] * (getFromRatio() - 1) };
+ }
+ return null;
+ }
+
+ /**
+ * get From position in the associated reference frame for position pos in the
+ * associated sequence.
+ *
+ * @param pos
+ * @return
+ */
+ public int getMappedPosition(int pos) {
+ int[] mp = shiftFrom(pos);
+ if (mp != null) {
+ return mp[0];
+ }
+ return pos;
+ }
+
+ public int[] getMappedWord(int pos) {
+ int[] mp = shiftFrom(pos);
+ if (mp != null) {
+ return new int[] { mp[0], mp[0] + mp[2] * (getToRatio() - 1) };
+ }
+ return null;
+ }
+
+ /**
+ * test routine. not incremental.
+ *
+ * @param ml
+ * @param fromS
+ * @param fromE
+ */
+ public static void testMap(MapList ml, int fromS, int fromE) {
+ for (int from = 1; from <= 25; from++) {
+ int[] too = ml.shiftFrom(from);
+ System.out.print("ShiftFrom(" + from + ")==");
+ if (too == null) {
+ System.out.print("NaN\n");
+ } else {
+ System.out.print(too[0] + " % " + too[1] + " (" + too[2] + ")");
+ System.out.print("\t+--+\t");
+ int[] toofrom = ml.shiftTo(too[0]);
+ if (toofrom != null) {
+ if (toofrom[0] != from) {
+ System.err.println("Mapping not reflexive:" + from + " " + too[0]
+ + "->" + toofrom[0]);
+ }
+ System.out.println("ShiftTo(" + too[0] + ")==" + toofrom[0] + " % "
+ + toofrom[1] + " (" + toofrom[2] + ")");
+ } else {
+ System.out.println("ShiftTo(" + too[0] + ")=="
+ + "NaN! - not Bijective Mapping!");
+ }
+ }
+ }
+ int mmap[][] = ml.makeFromMap();
+ System.out.println("FromMap : (" + mmap[0][0] + " " + mmap[0][1] + " "
+ + mmap[0][2] + " " + mmap[0][3] + " ");
+ for (int i = 1; i <= mmap[1].length; i++) {
+ if (mmap[1][i - 1] == -1) {
+ System.out.print(i + "=XXX");
+
+ } else {
+ System.out.print(i + "=" + (mmap[0][2] + mmap[1][i - 1]));
+ }
+ if (i % 20 == 0) {
+ System.out.print("\n");
+ } else {
+ System.out.print(",");
+ }
+ }
+ // test range function
+ System.out.print("\nTest locateInFrom\n");
+ {
+ int f = mmap[0][2], t = mmap[0][3];
+ while (f <= t) {
+ System.out.println("Range " + f + " to " + t);
+ int rng[] = ml.locateInFrom(f, t);
+ if (rng != null) {
+ for (int i = 0; i < rng.length; i++) {
+ System.out.print(rng[i] + ((i % 2 == 0) ? "," : ";"));
+ }
+ } else {
+ System.out.println("No range!");
+ }
+ System.out.print("\nReversed\n");
+ rng = ml.locateInFrom(t, f);
+ if (rng != null) {
+ for (int i = 0; i < rng.length; i++) {
+ System.out.print(rng[i] + ((i % 2 == 0) ? "," : ";"));
+ }
+ } else {
+ System.out.println("No range!");
+ }
+ System.out.print("\n");
+ f++;
+ t--;
+ }
+ }
+ System.out.print("\n");
+ mmap = ml.makeToMap();
+ System.out.println("ToMap : (" + mmap[0][0] + " " + mmap[0][1] + " "
+ + mmap[0][2] + " " + mmap[0][3] + " ");
+ for (int i = 1; i <= mmap[1].length; i++) {
+ if (mmap[1][i - 1] == -1) {
+ System.out.print(i + "=XXX");
+
+ } else {
+ System.out.print(i + "=" + (mmap[0][2] + mmap[1][i - 1]));
+ }
+ if (i % 20 == 0) {
+ System.out.print("\n");
+ } else {
+ System.out.print(",");
+ }
+ }
+ System.out.print("\n");
+ // test range function
+ System.out.print("\nTest locateInTo\n");
+ {
+ int f = mmap[0][2], t = mmap[0][3];
+ while (f <= t) {
+ System.out.println("Range " + f + " to " + t);
+ int rng[] = ml.locateInTo(f, t);
+ if (rng != null) {
+ for (int i = 0; i < rng.length; i++) {
+ System.out.print(rng[i] + ((i % 2 == 0) ? "," : ";"));
+ }
+ } else {
+ System.out.println("No range!");
+ }
+ System.out.print("\nReversed\n");
+ rng = ml.locateInTo(t, f);
+ if (rng != null) {
+ for (int i = 0; i < rng.length; i++) {
+ System.out.print(rng[i] + ((i % 2 == 0) ? "," : ";"));
+ }
+ } else {
+ System.out.println("No range!");
+ }
+ f++;
+ t--;
+ System.out.print("\n");
+ }
+ }
+
+ }
+
+ public static void main(String argv[]) {
+ MapList ml = new MapList(new int[] { 1, 5, 10, 15, 25, 20 }, new int[] {
+ 51, 1 }, 1, 3);
+ MapList ml1 = new MapList(new int[] { 1, 3, 17, 4 }, new int[] { 51, 1 },
+ 1, 3);
+ MapList ml2 = new MapList(new int[] { 1, 60 }, new int[] { 1, 20 }, 3, 1);
+ // test internal consistency
+ int to[] = new int[51];
+ MapList.testMap(ml, 1, 60);
+ /*
+ * for (int from=1; from<=51; from++) { int[] too=ml.shiftTo(from); int[]
+ * toofrom=ml.shiftFrom(too[0]);
+ * System.out.println("ShiftFrom("+from+")=="+too
+ * [0]+" % "+too[1]+"\t+-+\tShiftTo("
+ * +too[0]+")=="+toofrom[0]+" % "+toofrom[1]); }
+ */
+ System.out.print("Success?\n"); // if we get here - something must be
+ // working!
+ }
+
+ /**
+ *
+ * @return a MapList whose From range is this maplist's To Range, and vice
+ * versa
+ */
+ public MapList getInverse() {
+ return new MapList(getToRanges(), getFromRanges(), getToRatio(),
+ getFromRatio());
+ }
+}
diff --git a/src/uk/ac/vamsas/objects/utils/Mapping.java b/src/uk/ac/vamsas/objects/utils/Mapping.java
index b592c8c..5f987ae 100644
--- a/src/uk/ac/vamsas/objects/utils/Mapping.java
+++ b/src/uk/ac/vamsas/objects/utils/Mapping.java
@@ -1,386 +1,360 @@
-package uk.ac.vamsas.objects.utils;
-/*
- * This code was originated from
- * Jalview - A Sequence Alignment Editor and Viewer
- * Copyright (C) 2007 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-import java.util.Vector;
-
-public class Mapping
-{
- /**
- * Contains the start-end pairs mapping from the associated sequence to the
- * sequence in the database coordinate system it also takes care of step
- * difference between coordinate systems
- */
- MapList map = null;
-
- /**
- * The seuqence that map maps the associated seuqence to (if any).
- SequenceI to = null;
- */
- public Mapping(MapList map)
- {
- super();
- this.map = map;
- }
-
-/* public Mapping(SequenceI to, MapList map)
- {
- this(map);
- this.to = to;
- }
-*/
- /**
- * create a new mapping from
- *
- * (in Jalview) param to was
- * the destination sequence being mapped
- * @param local
- * int[] {start,end,start,end} series on associated sequence
- * @param mapped
- * int[] {start,end,...} ranges on the reference frame being mapped
- * to
- * @param i
- * step size on associated sequence
- * @param j
- * step size on mapped frame
- */
- public Mapping(//SequenceI to,
- int[] local, int[] mapped, int i, int j)
- {
- this(new MapList(local, mapped, i, j));
- }
-
- /**
- * create a duplicate (and independent) mapping object with the same reference
- * to any SequenceI being mapped to.
- *
- * @param map2
- */
- public Mapping(Mapping map2)
- {
- if (map2 != this && map2 != null)
- {
- if (map2.map != null)
- {
- map = new MapList(map2.map);
- }
- }
- }
-
- /**
- * @return the map
- */
- public MapList getMap()
- {
- return map;
- }
-
- /**
- * @param map
- * the map to set
- */
- public void setMap(MapList map)
- {
- this.map = map;
- }
-
- /**
- * Equals that compares both the to references and MapList mappings.
- *
- * @param other
- * @return
- */
- public boolean equals(Mapping other)
- {
- if (other == null)
- return false;
- if (other == this)
- return true;
- if ((map != null && other.map == null)
- || (map == null && other.map != null))
- return false;
- if (map.equals(other.map))
- return true;
- return false;
- }
-
- /**
- * get the 'initial' position in the associated sequence for a position in the
- * mapped reference frame
- *
- * @param mpos
- * @return
- */
- public int getPosition(int mpos)
- {
- if (map != null)
- {
- int[] mp = map.shiftTo(mpos);
- if (mp != null)
- {
- return mp[0];
- }
- }
- return mpos;
- }
-
- /**
- * gets boundary in direction of mapping
- *
- * @param position
- * in mapped reference frame
- * @return int{start, end} positions in associated sequence (in direction of
- * mapped word)
- */
- public int[] getWord(int mpos)
- {
- if (map != null)
- {
- return map.getToWord(mpos);
- }
- return null;
- }
-
- /**
- * width of mapped unit in associated sequence
- *
- */
- public int getWidth()
- {
- if (map != null)
- {
- return map.getFromRatio();
- }
- return 1;
- }
-
- /**
- * width of unit in mapped reference frame
- *
- * @return
- */
- public int getMappedWidth()
- {
- if (map != null)
- {
- return map.getToRatio();
- }
- return 1;
- }
-
- /**
- * get mapped position in the associated reference frame for position pos in
- * the associated sequence.
- *
- * @param pos
- * @return
- */
- public int getMappedPosition(int pos)
- {
- if (map != null)
- {
- int[] mp = map.shiftFrom(pos);
- if (mp != null)
- {
- return mp[0];
- }
- }
- return pos;
- }
-
- public int[] getMappedWord(int pos)
- {
- if (map != null)
- {
- int[] mp = map.shiftFrom(pos);
- if (mp != null)
- {
- return new int[]
- { mp[0], mp[0] + mp[2] * (map.getToRatio() - 1) };
- }
- }
- return null;
- }
-
- /**
- * locates the region of feature f in the associated (local) sequence's reference
- * frame
- *
- * @param f
- * @return int[] { start1, end1, ... starti, endi } for the corresponding interval in local reference frame
- */
- public int[] locateFeature(int begin, int end)
- {
- if (true)
- { // f.getBegin()!=f.getEnd()) {
- if (map != null)
- {
- int[] frange = map.locateInFrom(begin, end); //f.getBegin(), f.getEnd());
- /* left in as an example as to how this is used in Jalview
- * SequenceFeature[] vf = new SequenceFeature[frange.length / 2];
- for (int i = 0, v = 0; i < frange.length; i += 2, v++)
- {
- vf[v] = new SequenceFeature(f);
- vf[v].setBegin(frange[i]);
- vf[v].setEnd(frange[i + 1]);
- if (frange.length > 2)
- vf[v].setDescription(f.getDescription() + "\nPart " + v);
- }
- */
- return frange;
- }
- }
- // give up and just return the interval unchanged - this might not be the correct behaviour
- return new int[] { begin, end };
- }
-
- /**
- * return a series of contigs on the associated sequence corresponding to the
- * from,to interval on the mapped reference frame
- *
- * @param from
- * @param to
- * @return int[] { from_i, to_i for i=1 to n contiguous regions in the
- * associated sequence}
- */
- public int[] locateRange(int from, int to)
- {
- if (map != null)
- {
- if (from <= to)
- {
- from = (map.getToLowest() < from) ? from : map.getToLowest();
- to = (map.getToHighest() > to) ? to : map.getToHighest();
- if (from > to)
- return null;
- }
- else
- {
- from = (map.getToHighest() > from) ? from : map.getToHighest();
- to = (map.getToLowest() < to) ? to : map.getToLowest();
- if (from < to)
- return null;
- }
- return map.locateInFrom(from, to);
- }
- return new int[]
- { from, to };
- }
-
- /**
- * return a series of mapped contigs mapped from a range on the associated
- * sequence
- *
- * @param from
- * @param to
- * @return
- */
- public int[] locateMappedRange(int from, int to)
- {
- if (map != null)
- {
-
- if (from <= to)
- {
- from = (map.getFromLowest() < from) ? from : map.getFromLowest();
- to = (map.getFromHighest() > to) ? to : map.getFromHighest();
- if (from > to)
- return null;
- }
- else
- {
- from = (map.getFromHighest() > from) ? from : map.getFromHighest();
- to = (map.getFromLowest() < to) ? to : map.getFromLowest();
- if (from < to)
- return null;
- }
- return map.locateInTo(from, to);
- }
- return new int[]
- { from, to };
- }
-
- /**
- * return a new mapping object with a maplist modifed to only map the visible
- * regions defined by viscontigs.
- *
- * @param viscontigs
- * @return
- */
- public Mapping intersectVisContigs(int[] viscontigs)
- {
- Mapping copy = new Mapping(this);
- if (map != null)
- {
- Vector toRange = new Vector();
- Vector fromRange = new Vector();
- for (int vc = 0; vc < viscontigs.length; vc += 2)
- {
- // find a mapped range in this visible region
- int[] mpr = locateMappedRange(1+viscontigs[vc], viscontigs[vc + 1]-1);
- if (mpr != null)
- {
- for (int m = 0; m < mpr.length; m += 2)
- {
- toRange.addElement(new int[]
- { mpr[m], mpr[m + 1] });
- int[] xpos = locateRange(mpr[m], mpr[m + 1]);
- for (int x = 0; x < xpos.length; x += 2)
- {
- fromRange.addElement(new int[]
- { xpos[x], xpos[x + 1] });
- }
- }
- }
- }
- int[] from = new int[fromRange.size()*2];
- int[] to = new int[toRange.size()*2];
- int[] r;
- for (int f=0,fSize=fromRange.size(); f Protein exon map and a range of visContigs
- */
- MapList fk = new MapList(new int[] { 1,6,8,13,15,23}, new int[] { 1,7}, 3, 1);
- Mapping m = new Mapping(fk);
- Mapping m_1 = m.intersectVisContigs(new int[] {fk.getFromLowest(), fk.getFromHighest()});
- Mapping m_2 = m.intersectVisContigs(new int[] {1,7,11,20});
- System.out.println(""+m_1.map.getFromRanges());
- // this test was for debugging purposes only - it should run without exceptions, but the
- // integrity of the mapping was checked using an interactive debugger rather than programmatically.
- }
-}
+/*
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
+ */
+package uk.ac.vamsas.objects.utils;
+
+/*
+ * This code was originated from
+ * Jalview - A Sequence Alignment Editor and Viewer
+ * Copyright (C) 2007 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+import java.util.Vector;
+
+public class Mapping {
+ /**
+ * Contains the start-end pairs mapping from the associated sequence to the
+ * sequence in the database coordinate system it also takes care of step
+ * difference between coordinate systems
+ */
+ MapList map = null;
+
+ /**
+ * The seuqence that map maps the associated seuqence to (if any). SequenceI
+ * to = null;
+ */
+ public Mapping(MapList map) {
+ super();
+ this.map = map;
+ }
+
+ /*
+ * public Mapping(SequenceI to, MapList map) { this(map); this.to = to; }
+ */
+ /**
+ * create a new mapping from
+ *
+ * (in Jalview) param to was the destination sequence being mapped
+ *
+ * @param local
+ * int[] {start,end,start,end} series on associated sequence
+ * @param mapped
+ * int[] {start,end,...} ranges on the reference frame being mapped
+ * to
+ * @param i
+ * step size on associated sequence
+ * @param j
+ * step size on mapped frame
+ */
+ public Mapping(// SequenceI to,
+ int[] local, int[] mapped, int i, int j) {
+ this(new MapList(local, mapped, i, j));
+ }
+
+ /**
+ * create a duplicate (and independent) mapping object with the same reference
+ * to any SequenceI being mapped to.
+ *
+ * @param map2
+ */
+ public Mapping(Mapping map2) {
+ if (map2 != this && map2 != null) {
+ if (map2.map != null) {
+ map = new MapList(map2.map);
+ }
+ }
+ }
+
+ /**
+ * @return the map
+ */
+ public MapList getMap() {
+ return map;
+ }
+
+ /**
+ * @param map
+ * the map to set
+ */
+ public void setMap(MapList map) {
+ this.map = map;
+ }
+
+ /**
+ * Equals that compares both the to references and MapList mappings.
+ *
+ * @param other
+ * @return
+ */
+ public boolean equals(Mapping other) {
+ if (other == null)
+ return false;
+ if (other == this)
+ return true;
+ if ((map != null && other.map == null)
+ || (map == null && other.map != null))
+ return false;
+ if (map.equals(other.map))
+ return true;
+ return false;
+ }
+
+ /**
+ * get the 'initial' position in the associated sequence for a position in the
+ * mapped reference frame
+ *
+ * @param mpos
+ * @return
+ */
+ public int getPosition(int mpos) {
+ if (map != null) {
+ int[] mp = map.shiftTo(mpos);
+ if (mp != null) {
+ return mp[0];
+ }
+ }
+ return mpos;
+ }
+
+ /**
+ * gets boundary in direction of mapping
+ *
+ * @param position
+ * in mapped reference frame
+ * @return int{start, end} positions in associated sequence (in direction of
+ * mapped word)
+ */
+ public int[] getWord(int mpos) {
+ if (map != null) {
+ return map.getToWord(mpos);
+ }
+ return null;
+ }
+
+ /**
+ * width of mapped unit in associated sequence
+ *
+ */
+ public int getWidth() {
+ if (map != null) {
+ return map.getFromRatio();
+ }
+ return 1;
+ }
+
+ /**
+ * width of unit in mapped reference frame
+ *
+ * @return
+ */
+ public int getMappedWidth() {
+ if (map != null) {
+ return map.getToRatio();
+ }
+ return 1;
+ }
+
+ /**
+ * get mapped position in the associated reference frame for position pos in
+ * the associated sequence.
+ *
+ * @param pos
+ * @return
+ */
+ public int getMappedPosition(int pos) {
+ if (map != null) {
+ int[] mp = map.shiftFrom(pos);
+ if (mp != null) {
+ return mp[0];
+ }
+ }
+ return pos;
+ }
+
+ public int[] getMappedWord(int pos) {
+ if (map != null) {
+ int[] mp = map.shiftFrom(pos);
+ if (mp != null) {
+ return new int[] { mp[0], mp[0] + mp[2] * (map.getToRatio() - 1) };
+ }
+ }
+ return null;
+ }
+
+ /**
+ * locates the region of feature f in the associated (local) sequence's
+ * reference frame
+ *
+ * @param f
+ * @return int[] { start1, end1, ... starti, endi } for the corresponding
+ * interval in local reference frame
+ */
+ public int[] locateFeature(int begin, int end) {
+ if (true) { // f.getBegin()!=f.getEnd()) {
+ if (map != null) {
+ int[] frange = map.locateInFrom(begin, end); // f.getBegin(),
+ // f.getEnd());
+ /*
+ * left in as an example as to how this is used in Jalview
+ * SequenceFeature[] vf = new SequenceFeature[frange.length / 2]; for
+ * (int i = 0, v = 0; i < frange.length; i += 2, v++) { vf[v] = new
+ * SequenceFeature(f); vf[v].setBegin(frange[i]); vf[v].setEnd(frange[i
+ * + 1]); if (frange.length > 2) vf[v].setDescription(f.getDescription()
+ * + "\nPart " + v); }
+ */
+ return frange;
+ }
+ }
+ // give up and just return the interval unchanged - this might not be the
+ // correct behaviour
+ return new int[] { begin, end };
+ }
+
+ /**
+ * return a series of contigs on the associated sequence corresponding to the
+ * from,to interval on the mapped reference frame
+ *
+ * @param from
+ * @param to
+ * @return int[] { from_i, to_i for i=1 to n contiguous regions in the
+ * associated sequence}
+ */
+ public int[] locateRange(int from, int to) {
+ if (map != null) {
+ if (from <= to) {
+ from = (map.getToLowest() < from) ? from : map.getToLowest();
+ to = (map.getToHighest() > to) ? to : map.getToHighest();
+ if (from > to)
+ return null;
+ } else {
+ from = (map.getToHighest() > from) ? from : map.getToHighest();
+ to = (map.getToLowest() < to) ? to : map.getToLowest();
+ if (from < to)
+ return null;
+ }
+ return map.locateInFrom(from, to);
+ }
+ return new int[] { from, to };
+ }
+
+ /**
+ * return a series of mapped contigs mapped from a range on the associated
+ * sequence
+ *
+ * @param from
+ * @param to
+ * @return
+ */
+ public int[] locateMappedRange(int from, int to) {
+ if (map != null) {
+
+ if (from <= to) {
+ from = (map.getFromLowest() < from) ? from : map.getFromLowest();
+ to = (map.getFromHighest() > to) ? to : map.getFromHighest();
+ if (from > to)
+ return null;
+ } else {
+ from = (map.getFromHighest() > from) ? from : map.getFromHighest();
+ to = (map.getFromLowest() < to) ? to : map.getFromLowest();
+ if (from < to)
+ return null;
+ }
+ return map.locateInTo(from, to);
+ }
+ return new int[] { from, to };
+ }
+
+ /**
+ * return a new mapping object with a maplist modifed to only map the visible
+ * regions defined by viscontigs.
+ *
+ * @param viscontigs
+ * @return
+ */
+ public Mapping intersectVisContigs(int[] viscontigs) {
+ Mapping copy = new Mapping(this);
+ if (map != null) {
+ Vector toRange = new Vector();
+ Vector fromRange = new Vector();
+ for (int vc = 0; vc < viscontigs.length; vc += 2) {
+ // find a mapped range in this visible region
+ int[] mpr = locateMappedRange(1 + viscontigs[vc],
+ viscontigs[vc + 1] - 1);
+ if (mpr != null) {
+ for (int m = 0; m < mpr.length; m += 2) {
+ toRange.addElement(new int[] { mpr[m], mpr[m + 1] });
+ int[] xpos = locateRange(mpr[m], mpr[m + 1]);
+ for (int x = 0; x < xpos.length; x += 2) {
+ fromRange.addElement(new int[] { xpos[x], xpos[x + 1] });
+ }
+ }
+ }
+ }
+ int[] from = new int[fromRange.size() * 2];
+ int[] to = new int[toRange.size() * 2];
+ int[] r;
+ for (int f = 0, fSize = fromRange.size(); f < fSize; f++) {
+ r = (int[]) fromRange.elementAt(f);
+ from[f * 2] = r[0];
+ from[f * 2 + 1] = r[1];
+ }
+ for (int f = 0, fSize = toRange.size(); f < fSize; f++) {
+ r = (int[]) toRange.elementAt(f);
+ to[f * 2] = r[0];
+ to[f * 2 + 1] = r[1];
+ }
+ copy.setMap(new MapList(from, to, map.getFromRatio(), map.getToRatio()));
+ }
+ return copy;
+ }
+
+ public static void main(String[] args) {
+ /**
+ * trite test of the intersectVisContigs method for a simple DNA -> Protein
+ * exon map and a range of visContigs
+ */
+ MapList fk = new MapList(new int[] { 1, 6, 8, 13, 15, 23 }, new int[] { 1,
+ 7 }, 3, 1);
+ Mapping m = new Mapping(fk);
+ Mapping m_1 = m.intersectVisContigs(new int[] { fk.getFromLowest(),
+ fk.getFromHighest() });
+ Mapping m_2 = m.intersectVisContigs(new int[] { 1, 7, 11, 20 });
+ System.out.println("" + m_1.map.getFromRanges());
+ // this test was for debugging purposes only - it should run without
+ // exceptions, but the
+ // integrity of the mapping was checked using an interactive debugger rather
+ // than programmatically.
+ }
+}
diff --git a/src/uk/ac/vamsas/objects/utils/Properties.java b/src/uk/ac/vamsas/objects/utils/Properties.java
index 4d5c874..039096e 100644
--- a/src/uk/ac/vamsas/objects/utils/Properties.java
+++ b/src/uk/ac/vamsas/objects/utils/Properties.java
@@ -1,3 +1,24 @@
+/*
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
+ */
package uk.ac.vamsas.objects.utils;
import java.util.Enumeration;
@@ -6,152 +27,150 @@ import java.util.Vector;
import uk.ac.vamsas.objects.core.Property;
public class Properties {
- public static Property newProperty(String name, String type, String content)
- {
+ public static Property newProperty(String name, String type, String content) {
Property vProperty = new Property();
vProperty.setName(name);
- if (type != null)
- {
+ if (type != null) {
vProperty.setType(type);
- }
- else
- {
+ } else {
vProperty.setType(STRINGTYPE);
}
vProperty.setContent(content);
return vProperty;
}
- final public static String STRINGTYPE="string";
- final public static String FLOATTYPE="float";
- final public static String INTEGERTYPE="integer";
- final public static String BOOLEANTYPE="boolean";
+
+ final public static String STRINGTYPE = "string";
+
+ final public static String FLOATTYPE = "float";
+
+ final public static String INTEGERTYPE = "integer";
+
+ final public static String BOOLEANTYPE = "boolean";
+
/**
- * add newprop to properties, or update the value of an existing property with the same exact name and type.
- * Note - this routine will stop after encounting the first occurance of a Property with the same name and type, no others will be affected.
+ * add newprop to properties, or update the value of an existing property with
+ * the same exact name and type. Note - this routine will stop after
+ * encounting the first occurance of a Property with the same name and type,
+ * no others will be affected.
+ *
* @param properties
- * @param newprop
- * @return true if property was added or its value updated. false if no change was made.
+ * @param newprop
+ * @return true if property was added or its value updated. false if no change
+ * was made.
*/
- public static boolean addOrReplace(Vector properties, Property newprop)
- {
- if (properties.size()>0)
- {
+ public static boolean addOrReplace(Vector properties, Property newprop) {
+ if (properties.size() > 0) {
Enumeration en = properties.elements();
- while (en.hasMoreElements())
- {
+ while (en.hasMoreElements()) {
Object el = en.nextElement();
- if (el instanceof Property)
- {
+ if (el instanceof Property) {
Property prop = (Property) el;
- if (prop.getName().equals(newprop.getName()) &&
- prop.getType().equals(newprop.getType()))
- {
- if (prop.getContent().equals(newprop.getContent()))
- {
+ if (prop.getName().equals(newprop.getName())
+ && prop.getType().equals(newprop.getType())) {
+ if (prop.getContent().equals(newprop.getContent())) {
return false;
- } else {
+ } else {
prop.setContent(newprop.getContent());
return true;
}
}
} else {
- throw new Error("Implementation Error: properties must be a Vector of uk.ac.vamsas.objects.core.Property objects only.");
+ throw new Error(
+ "Implementation Error: properties must be a Vector of uk.ac.vamsas.objects.core.Property objects only.");
}
}
- }
+ }
properties.addElement(newprop);
return true;
}
+
/**
- * validate property p against the known type strings and try to parse the content string accordingly
+ * validate property p against the known type strings and try to parse the
+ * content string accordingly
+ *
* @param p
- * @return true if the content parses as the given type (if it is known)
- * TODO: decide if an isValidType method is also necessary.
+ * @return true if the content parses as the given type (if it is known) TODO:
+ * decide if an isValidType method is also necessary.
*/
- public static boolean isValid(Property p)
- {
- if (p.getType().equalsIgnoreCase(STRINGTYPE))
- {
+ public static boolean isValid(Property p) {
+ if (p.getType().equalsIgnoreCase(STRINGTYPE)) {
return true;
- } else
- if (p.getType().equalsIgnoreCase(BOOLEANTYPE))
- {
- try {
- Boolean bool = new Boolean(p.getContent());
- return true;
- } catch (Exception e)
- {
- return false;
- }
- } else
- if (p.getType().equalsIgnoreCase(FLOATTYPE))
- {
- try {
- Float fv = new Float(p.getContent());
- return true;
- } catch (Exception e)
- {
- return false;
- }
+ } else if (p.getType().equalsIgnoreCase(BOOLEANTYPE)) {
+ try {
+ Boolean bool = new Boolean(p.getContent());
+ return true;
+ } catch (Exception e) {
+ return false;
}
- else
- if( p.getType().equalsIgnoreCase(INTEGERTYPE))
- {
-
- try {
- Integer fv = new Integer(p.getContent());
- return true;
- } catch (Exception e)
- {
- return false;
- }
- }
+ } else if (p.getType().equalsIgnoreCase(FLOATTYPE)) {
+ try {
+ Float fv = new Float(p.getContent());
+ return true;
+ } catch (Exception e) {
+ return false;
+ }
+ } else if (p.getType().equalsIgnoreCase(INTEGERTYPE)) {
+
+ try {
+ Integer fv = new Integer(p.getContent());
+ return true;
+ } catch (Exception e) {
+ return false;
+ }
+ }
return false;
}
+
/**
- * String content test
+ * String content test
+ *
* @param p
- * @return true if the property is a string
+ * @return true if the property is a string
*/
- public static boolean isString(Property p)
- {
+ public static boolean isString(Property p) {
return isType(p, STRINGTYPE);
}
+
/**
- * Float content test
+ * Float content test
+ *
* @param p
- * @return true if the property is a string
+ * @return true if the property is a string
*/
- public static boolean isFloat(Property p)
- {
+ public static boolean isFloat(Property p) {
return isType(p, FLOATTYPE);
}
+
/**
- * Integer content test
+ * Integer content test
+ *
* @param p
- * @return true if the property is a string
+ * @return true if the property is a string
*/
- public static boolean isInteger(Property p)
- {
+ public static boolean isInteger(Property p) {
return isType(p, INTEGERTYPE);
}
+
/**
- * Boolean content test
+ * Boolean content test
+ *
* @param p
- * @return true if the property is a string
+ * @return true if the property is a string
*/
- public static boolean isBoolean(Property p)
- {
+ public static boolean isBoolean(Property p) {
return isType(p, BOOLEANTYPE);
}
+
/**
*
- * @param p the property to test for type
- * @param typeString one of the string constants in this class
+ * @param p
+ * the property to test for type
+ * @param typeString
+ * one of the string constants in this class
* @return true if p is of type 'typeString'
*/
public static boolean isType(Property p, String typeString) {
- return (p==null) ? false : (p.getType().toLowerCase().equals(typeString));
+ return (p == null) ? false : (p.getType().toLowerCase().equals(typeString));
}
-
+
}
diff --git a/src/uk/ac/vamsas/objects/utils/ProvenanceStuff.java b/src/uk/ac/vamsas/objects/utils/ProvenanceStuff.java
index 3c675dc..d6a7d6d 100644
--- a/src/uk/ac/vamsas/objects/utils/ProvenanceStuff.java
+++ b/src/uk/ac/vamsas/objects/utils/ProvenanceStuff.java
@@ -1,46 +1,72 @@
-package uk.ac.vamsas.objects.utils;
-
-import java.util.Date;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import uk.ac.vamsas.objects.core.Entry;
-import uk.ac.vamsas.objects.core.Provenance;
-
-public class ProvenanceStuff {
-
- /**
- * stuff for making and doing things with provenance objects.
- */
- static Log log = LogFactory.getLog(ProvenanceStuff.class);
-
- /**
- * @param app TODO
- * @param action
- * text for action entry
- * @return new Provenance entry for ArchiveWriter created docs.
- * TODO: Verify and move to SimpleClient class for provenance handling
- */
- public static Entry newProvenanceEntry(String app, String user, String action) {
- log.debug("Adding ProvenanceEntry("+user+","+action+")");
- Entry e = new Entry();
- e.setApp(app);
- e.setAction(action);
- e.setUser(user);
- e.setDate(new Date());
- return e;
- }
- public static Provenance newProvenance(Entry entry) {
- Provenance list = new Provenance();
- list.addEntry(entry);
- return list;
- }
- public static Provenance newProvenance(String user, String action) {
- return newProvenance(ProvenanceStuff.newProvenanceEntry("vamsasApp:ExampleVamsasClient/alpha", user, action));
- }
- public static Provenance newProvenance(String app, String user, String action) {
- return newProvenance(ProvenanceStuff.newProvenanceEntry(app, user, action));
- }
-
-}
+/*
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
+ */
+package uk.ac.vamsas.objects.utils;
+
+import java.util.Date;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import uk.ac.vamsas.objects.core.Entry;
+import uk.ac.vamsas.objects.core.Provenance;
+
+public class ProvenanceStuff {
+
+ /**
+ * stuff for making and doing things with provenance objects.
+ */
+ static Log log = LogFactory.getLog(ProvenanceStuff.class);
+
+ /**
+ * @param app
+ * TODO
+ * @param action
+ * text for action entry
+ * @return new Provenance entry for ArchiveWriter created docs. TODO: Verify
+ * and move to SimpleClient class for provenance handling
+ */
+ public static Entry newProvenanceEntry(String app, String user, String action) {
+ log.debug("Adding ProvenanceEntry(" + user + "," + action + ")");
+ Entry e = new Entry();
+ e.setApp(app);
+ e.setAction(action);
+ e.setUser(user);
+ e.setDate(new Date());
+ return e;
+ }
+
+ public static Provenance newProvenance(Entry entry) {
+ Provenance list = new Provenance();
+ list.addEntry(entry);
+ return list;
+ }
+
+ public static Provenance newProvenance(String user, String action) {
+ return newProvenance(ProvenanceStuff.newProvenanceEntry(
+ "vamsasApp:ExampleVamsasClient/alpha", user, action));
+ }
+
+ public static Provenance newProvenance(String app, String user, String action) {
+ return newProvenance(ProvenanceStuff.newProvenanceEntry(app, user, action));
+ }
+
+}
diff --git a/src/uk/ac/vamsas/objects/utils/Range.java b/src/uk/ac/vamsas/objects/utils/Range.java
index 74ace8e..8e4c314 100644
--- a/src/uk/ac/vamsas/objects/utils/Range.java
+++ b/src/uk/ac/vamsas/objects/utils/Range.java
@@ -1,3 +1,24 @@
+/*
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
+ */
package uk.ac.vamsas.objects.utils;
import java.util.Vector;
@@ -9,90 +30,80 @@ import uk.ac.vamsas.objects.core.RangeType;
import uk.ac.vamsas.objects.core.Seg;
/**
- * Utilities for working with RangeType and MapType objects.
- * Derived from bitter experience.
+ * Utilities for working with RangeType and MapType objects. Derived from bitter
+ * experience.
+ *
* @author JimP
- *
+ *
*/
public class Range {
- static org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory.getFactory().getLog(Range.class);
+ static org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory
+ .getFactory().getLog(Range.class);
/**
* get start 0 && dseta.getPosCount() > 0)
- {
- throw new Error("Invalid vamsas RangeType - cannot resolve both lists of Pos and Seg from choice!");
+ if (dseta.getSegCount() > 0 && dseta.getPosCount() > 0) {
+ throw new Error(
+ "Invalid vamsas RangeType - cannot resolve both lists of Pos and Seg from choice!");
}
- if (dseta.getSegCount() > 0)
- {
+ if (dseta.getSegCount() > 0) {
se = getSegRange(dseta.getSeg(0), true);
- for (int s = 1, sSize = dseta.getSegCount(); s < sSize; s++)
- {
+ for (int s = 1, sSize = dseta.getSegCount(); s < sSize; s++) {
int nse[] = getSegRange(dseta.getSeg(s), true);
- if (se[0] > nse[0])
- {
+ if (se[0] > nse[0]) {
se[0] = nse[0];
}
- if (se[1] < nse[1])
- {
+ if (se[1] < nse[1]) {
se[1] = nse[1];
}
}
}
- if (dseta.getPosCount() > 0)
- {
- // could do a polarity for pos range too. and pass back indication of discontinuities.
+ if (dseta.getPosCount() > 0) {
+ // could do a polarity for pos range too. and pass back indication of
+ // discontinuities.
int pos = dseta.getPos(0).getI();
- se = new int[]
- {
- pos, pos};
- for (int p = 0, pSize = dseta.getPosCount(); p < pSize; p++)
- {
+ se = new int[] { pos, pos };
+ for (int p = 0, pSize = dseta.getPosCount(); p < pSize; p++) {
pos = dseta.getPos(p).getI();
- if (se[0] > pos)
- {
+ if (se[0] > pos) {
se[0] = pos;
}
- if (se[1] < pos)
- {
+ if (se[1] < pos) {
se[1] = pos;
}
}
@@ -103,49 +114,41 @@ public class Range {
}
/**
- * map from a rangeType's internal frame to the referenced object's coordinate frame.
+ * map from a rangeType's internal frame to the referenced object's coordinate
+ * frame.
+ *
* @param dseta
* @return int [] { ref(pos)...} for all pos in rangeType's frame.
*/
- public static int[] getMapping(RangeType dseta)
- {
+ public static int[] getMapping(RangeType dseta) {
Vector posList = new Vector();
- if (dseta != null)
- {
+ if (dseta != null) {
int[] se = null;
- if (dseta.getSegCount() > 0 && dseta.getPosCount() > 0)
- {
- throw new Error("Invalid vamsas RangeType - cannot resolve both lists of Pos and Seg from choice!");
+ if (dseta.getSegCount() > 0 && dseta.getPosCount() > 0) {
+ throw new Error(
+ "Invalid vamsas RangeType - cannot resolve both lists of Pos and Seg from choice!");
}
- if (dseta.getSegCount() > 0)
- {
- for (int s = 0, sSize = dseta.getSegCount(); s < sSize; s++)
- {
+ if (dseta.getSegCount() > 0) {
+ for (int s = 0, sSize = dseta.getSegCount(); s < sSize; s++) {
se = getSegRange(dseta.getSeg(s), false);
int se_end = se[1 - se[2]] + (se[2] == 0 ? 1 : -1);
- for (int p = se[se[2]]; p != se_end; p += se[2] == 0 ? 1 : -1)
- {
+ for (int p = se[se[2]]; p != se_end; p += se[2] == 0 ? 1 : -1) {
posList.add(new Integer(p));
}
}
- }
- else if (dseta.getPosCount() > 0)
- {
+ } else if (dseta.getPosCount() > 0) {
int pos = dseta.getPos(0).getI();
- for (int p = 0, pSize = dseta.getPosCount(); p < pSize; p++)
- {
+ for (int p = 0, pSize = dseta.getPosCount(); p < pSize; p++) {
pos = dseta.getPos(p).getI();
posList.add(new Integer(pos));
}
}
}
- if (posList != null && posList.size() > 0)
- {
+ if (posList != null && posList.size() > 0) {
int[] range = new int[posList.size()];
- for (int i = 0; i < range.length; i++)
- {
- range[i] = ( (Integer) posList.elementAt(i)).intValue();
+ for (int i = 0; i < range.length; i++) {
+ range[i] = ((Integer) posList.elementAt(i)).intValue();
}
posList.clear();
return range;
@@ -153,61 +156,52 @@ public class Range {
return null;
}
- public static int[] getIntervals(RangeType range)
- {
- int[] intervals=null;
+ public static int[] getIntervals(RangeType range) {
+ int[] intervals = null;
Vector posList = new Vector();
- if (range != null)
- {
+ if (range != null) {
int[] se = null;
- if (range.getSegCount() > 0 && range.getPosCount() > 0)
- {
- throw new Error("Invalid vamsas RangeType - cannot resolve both lists of Pos and Seg from choice!");
-}
- if (range.getSegCount() > 0)
- {
- for (int s = 0, sSize = range.getSegCount(); s < sSize; s++)
- {
+ if (range.getSegCount() > 0 && range.getPosCount() > 0) {
+ throw new Error(
+ "Invalid vamsas RangeType - cannot resolve both lists of Pos and Seg from choice!");
+ }
+ if (range.getSegCount() > 0) {
+ for (int s = 0, sSize = range.getSegCount(); s < sSize; s++) {
se = getSegRange(range.getSeg(s), false);
posList.addElement(new Integer(se[0]));
posList.addElement(new Integer(se[1]));
}
- }
- else if (range.getPosCount() > 0)
- {
+ } else if (range.getPosCount() > 0) {
int pos = range.getPos(0).getI();
- for (int p = 0, pSize = range.getPosCount(); p < pSize; p++)
- {
+ for (int p = 0, pSize = range.getPosCount(); p < pSize; p++) {
pos = range.getPos(p).getI();
posList.add(new Integer(pos));
posList.add(new Integer(pos));
}
}
}
- if (posList != null && posList.size() > 0)
- {
- intervals=new int[posList.size()];
+ if (posList != null && posList.size() > 0) {
+ intervals = new int[posList.size()];
java.util.Enumeration e = posList.elements();
- int i=0;
- while (e.hasMoreElements())
- {
- intervals[i++] = ((Integer)e.nextElement()).intValue();
+ int i = 0;
+ while (e.hasMoreElements()) {
+ intervals[i++] = ((Integer) e.nextElement()).intValue();
}
}
return intervals;
}
+
/**
* initialise a range type object from a set of start/end inclusive intervals
+ *
* @param mrt
* @param range
*/
- public static void initRangeType(RangeType mrt, int[] range)
- {
- for (int i=0; i "+map.toString())));
+ public static MapList parsemapType(MapType map) {
+ if (!map.getLocal().hasUnit() || !map.getMapped().hasUnit()) {
+ if (log.isDebugEnabled()) {
+ log.debug("using default mapping length of 1:1 for map "
+ + (map.isRegistered() ? map.getVorbaId().toString()
+ : (" " + map.toString())));
}
}
- return parsemapType(map, 1, 1);
+ return parsemapType(map, 1, 1);
}
/**
* initialise a MapType object from a MapList object.
+ *
* @param maprange
* @param ml
* @param setUnits
*/
- public static void initMapType(MapType maprange, MapList ml, boolean setUnits)
- {
+ public static void initMapType(MapType maprange, MapList ml, boolean setUnits) {
initMapType(maprange, ml, setUnits, false);
}
+
/**
*
* @param maprange
* @param ml
* @param setUnits
- * @param reverse - reverse MapList mapping for Local and Mapped ranges and units
+ * @param reverse
+ * - reverse MapList mapping for Local and Mapped ranges and units
*/
- public static void initMapType(MapType maprange, MapList ml, boolean setUnits, boolean reverse)
- {
+ public static void initMapType(MapType maprange, MapList ml,
+ boolean setUnits, boolean reverse) {
maprange.setLocal(new Local());
maprange.setMapped(new Mapped());
- if (!reverse)
- {
+ if (!reverse) {
initRangeType(maprange.getLocal(), ml.getFromRanges());
initRangeType(maprange.getMapped(), ml.getToRanges());
- } else {
- initRangeType(maprange.getLocal(), ml.getToRanges());
- initRangeType(maprange.getMapped(), ml.getFromRanges());
- }
- if (setUnits)
- {
- if (!reverse)
- {
+ } else {
+ initRangeType(maprange.getLocal(), ml.getToRanges());
+ initRangeType(maprange.getMapped(), ml.getFromRanges());
+ }
+ if (setUnits) {
+ if (!reverse) {
maprange.getLocal().setUnit(ml.getFromRatio());
maprange.getMapped().setUnit(ml.getToRatio());
} else {
@@ -291,4 +286,4 @@ public class Range {
}
}
-}
\ No newline at end of file
+}
diff --git a/src/uk/ac/vamsas/objects/utils/Seq.java b/src/uk/ac/vamsas/objects/utils/Seq.java
index 7c82d82..538d658 100644
--- a/src/uk/ac/vamsas/objects/utils/Seq.java
+++ b/src/uk/ac/vamsas/objects/utils/Seq.java
@@ -1,131 +1,162 @@
-/*
- * Created on 17-May-2005
- *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-package uk.ac.vamsas.objects.utils;
-
-import java.io.BufferedWriter;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.util.regex.Pattern;
-
-import uk.ac.vamsas.objects.core.AlignmentSequence;
-import uk.ac.vamsas.objects.core.Sequence;
-import uk.ac.vamsas.objects.core.SequenceType;
-
-/**
- * @author jimp
- *
- * TODO To change the template for this generated type comment go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-public class Seq {
-
- public static void write_PirSeq(OutputStream os, SequenceType seq, int wid) throws IOException {
- BufferedWriter pir_out = new BufferedWriter(new OutputStreamWriter(os));
- pir_out.write(">P1;"+seq.getName()+"\n");
- int width = (wid<1) ? 80 : wid;
- for (int j=0,k=seq.getSequence().length(); j"+seq.getName()+"\n");
- fasta_out.write(seq.getSequence()+"\n");
- fasta_out.flush();
- }
-
- public static void write_FastaSeq(OutputStream os, SequenceType seq, int wid) throws IOException {
- BufferedWriter fasta_out = new BufferedWriter(new OutputStreamWriter(os));
- fasta_out.write(">"+seq.getName()+"\n");
- int width = (wid<1) ? 80 : wid;
- for (int j=0,k=seq.getSequence().length(); jend on Sequence Vobject
- if ((start-end)!=Sequence.length())
- seq.setEnd(end+Sequence.length());
- }
- return seq;
- }
- public static AlignmentSequence newAlignmentSequence(String name, String alSequence, Sequence refseq, long start, long end) {
- if (refseq!=null) {
- AlignmentSequence asq = new AlignmentSequence();
- asq.setName(name);
- asq.setSequence(alSequence);
- asq.setRefid(refseq);
- if (end>refseq.getEnd() || end0
- || !q.getDictionary().equals(SymbolDictionary.STANDARD_AA))
- return false;
- return valid_aadictionary_string(q.getSequence(), SymbolDictionary.STANDARD_AA);
- }
-
- // follow references
- if (s instanceof AlignmentSequence) {
- Object w = (((AlignmentSequence) s).getRefid());
- if (w!=null && w!=s && w instanceof SequenceType)
- return is_valid_aa_seq((SequenceType) w)
- && valid_aadictionary_string(((AlignmentSequence) s).getSequence(), SymbolDictionary.STANDARD_AA);
- }
-
- return false;
- }
-}
+/*
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
+ */
+package uk.ac.vamsas.objects.utils;
+
+import java.io.BufferedWriter;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.util.regex.Pattern;
+
+import uk.ac.vamsas.objects.core.AlignmentSequence;
+import uk.ac.vamsas.objects.core.Sequence;
+import uk.ac.vamsas.objects.core.SequenceType;
+
+/**
+ * @author jimp
+ *
+ * TODO To change the template for this generated type comment go to
+ * Window - Preferences - Java - Code Style - Code Templates
+ */
+public class Seq {
+
+ public static void write_PirSeq(OutputStream os, SequenceType seq, int wid)
+ throws IOException {
+ BufferedWriter pir_out = new BufferedWriter(new OutputStreamWriter(os));
+ pir_out.write(">P1;" + seq.getName() + "\n");
+ int width = (wid < 1) ? 80 : wid;
+ for (int j = 0, k = seq.getSequence().length(); j < k; j += width)
+ if (j + width < k)
+ pir_out.write(seq.getSequence().substring(j, j + width) + "\n");
+ else
+ pir_out.write(seq.getSequence().substring(j) + "\n");
+ pir_out.flush();
+ }
+
+ public static void write_FastaSeq(OutputStream os, SequenceType seq)
+ throws IOException {
+ BufferedWriter fasta_out = new BufferedWriter(new OutputStreamWriter(os));
+ fasta_out.write(">" + seq.getName() + "\n");
+ fasta_out.write(seq.getSequence() + "\n");
+ fasta_out.flush();
+ }
+
+ public static void write_FastaSeq(OutputStream os, SequenceType seq, int wid)
+ throws IOException {
+ BufferedWriter fasta_out = new BufferedWriter(new OutputStreamWriter(os));
+ fasta_out.write(">" + seq.getName() + "\n");
+ int width = (wid < 1) ? 80 : wid;
+ for (int j = 0, k = seq.getSequence().length(); j < k; j += width)
+ if (j + width < k)
+ fasta_out.write(seq.getSequence().substring(j, j + width) + "\n");
+ else
+ fasta_out.write(seq.getSequence().substring(j) + "\n");
+ fasta_out.flush();
+ }
+
+ /**
+ *validate a SequenceType Vobject as an info:iubmb.org/aminoacid SequenceType
+ * This version resolves references to Sequence objects from AlignmentSequence
+ * TODO: Define info: urn for dictionary string (could also be regex of valid
+ * characters!)
+ *
+ * @param s
+ * @param dict
+ * TODO
+ * @return true if a valid amino acid sequence Vobject
+ */
+ private static boolean valid_aadictionary_string(String s, String dict) {
+ if (s == null)
+ return false;
+ // validate against dictionary
+ // TODO generalise to resolve dictionary against info: urn for dictionary
+ // type
+ Pattern aa_repl = Pattern.compile("[ARNDCQEGHILKMFPSTWYVUX]+",
+ Pattern.CASE_INSENSITIVE);
+ String remnants = aa_repl.matcher(s).replaceAll("");
+ return !remnants.matches("//S+");
+ }
+
+ public static Sequence newSequence(String Name, String Sequence,
+ String Dictionary, int start, int end) {
+ // TODO: make hierarchy reflecting the SeqType Vobject.
+ Sequence seq = new Sequence();
+ seq.setDictionary(Dictionary);
+ seq.setName(Name);
+ seq.setSequence(Sequence);
+ seq.setStart(start);
+ if (start <= end) {
+ if ((end - start) != Sequence.length())
+ seq.setEnd(start + Sequence.length());
+ } else {
+ // reverse topology mapping. TODO: VAMSAS: decide if allowed to do
+ // start>end on Sequence Vobject
+ if ((start - end) != Sequence.length())
+ seq.setEnd(end + Sequence.length());
+ }
+ return seq;
+ }
+
+ public static AlignmentSequence newAlignmentSequence(String name,
+ String alSequence, Sequence refseq, long start, long end) {
+ if (refseq != null) {
+ AlignmentSequence asq = new AlignmentSequence();
+ asq.setName(name);
+ asq.setSequence(alSequence);
+ asq.setRefid(refseq);
+ if (end > refseq.getEnd() || end < start || end == -1)
+ end = refseq.getEnd();
+ asq.setEnd(end);
+ if (start < refseq.getStart())
+ start = refseq.getStart();
+ asq.setStart(start);
+ return asq;
+ }
+ return null;
+ }
+
+ public static boolean is_valid_aa_seq(SequenceType s) {
+ Sequence q;
+ boolean validref = false;
+ if (s instanceof Sequence) {
+ q = (Sequence) s;
+ if (q.getDictionary() != null
+
+ && q.getDictionary().length() > 0
+ || !q.getDictionary().equals(SymbolDictionary.STANDARD_AA))
+ return false;
+ return valid_aadictionary_string(q.getSequence(),
+ SymbolDictionary.STANDARD_AA);
+ }
+
+ // follow references
+ if (s instanceof AlignmentSequence) {
+ Object w = (((AlignmentSequence) s).getRefid());
+ if (w != null && w != s && w instanceof SequenceType)
+ return is_valid_aa_seq((SequenceType) w)
+ && valid_aadictionary_string(((AlignmentSequence) s).getSequence(),
+ SymbolDictionary.STANDARD_AA);
+ }
+
+ return false;
+ }
+}
diff --git a/src/uk/ac/vamsas/objects/utils/SeqAln.java b/src/uk/ac/vamsas/objects/utils/SeqAln.java
index e9f49bd..92e8068 100644
--- a/src/uk/ac/vamsas/objects/utils/SeqAln.java
+++ b/src/uk/ac/vamsas/objects/utils/SeqAln.java
@@ -1,238 +1,261 @@
-/*
- * Created on 17-May-2005
- *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-package uk.ac.vamsas.objects.utils;
-
-import java.io.BufferedOutputStream;
-import java.io.BufferedReader;
-import java.io.BufferedWriter;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.Hashtable;
-import java.util.StringTokenizer;
-import java.util.Vector;
-import java.util.regex.Pattern;
-
-import uk.ac.vamsas.objects.core.*;
-
-/**
- * @author jimp
- *
- * TODO To change the template for this generated type comment go to Window -
- * Preferences - Java - Code Style - Code Templates
- */
-public class SeqAln extends uk.ac.vamsas.objects.core.Alignment {
-
- public static Sequence[] ReadClustalFile(InputStream os) throws Exception {
- System.err.println("NOT FULLY IMPLEMENTED!"); // TODO: Finish adapting this method
- Pattern nonGap = Pattern.compile("[A-Z*0-9]", Pattern.CASE_INSENSITIVE);
- String gapchars = "";
- char gapchar = '-';
-
- int i = 0;
- boolean flag = false;
-
- Vector headers = new Vector();
- Hashtable seqhash = new Hashtable();
- Sequence[] seqs = null;
- int noSeqs = 0;
- String line;
-
- try {
- BufferedReader ins = new BufferedReader(new InputStreamReader(os));
- while ((line = ins.readLine()) != null) {
- if (line.indexOf(" ") != 0) {
- java.util.StringTokenizer str = new StringTokenizer(line, " ");
- String id = "";
-
- if (str.hasMoreTokens()) {
- id = str.nextToken();
- if (id.equals("CLUSTAL")) {
- flag = true;
- } else {
- if (flag) {
- StringBuffer tempseq;
- if (seqhash.containsKey(id)) {
- tempseq = (StringBuffer) seqhash.get(id);
- } else {
- tempseq = new StringBuffer();
- seqhash.put(id, tempseq);
- }
-
- if (!(headers.contains(id))) {
- headers.addElement(id);
- }
-
- tempseq.append(str.nextToken());
- }
- }
- }
- }
- }
-
- } catch (IOException e) {
- throw (new Exception("Exception parsing clustal file ", e));
- }
-
- if (flag) {
- noSeqs = headers.size();
-
- // Add sequences to the hash
- seqs = new Sequence[headers.size()];
- for (i = 0; i < headers.size(); i++) {
- if (seqhash.get(headers.elementAt(i)) != null) {
- // TODO: develop automatic dictionary typing for sequences
- Sequence newSeq = Seq.newSequence(headers.elementAt(i).toString(),
- seqhash.get(headers.elementAt(i).toString()).toString(),
- SymbolDictionary.STANDARD_AA,0,0);
-
- seqs[i] = newSeq;
-
- } else {
- throw (new Exception("Bizarreness! Can't find sequence for "
- + headers.elementAt(i)));
- }
- }
- }
- return seqs;
- }
-
- public static void WriteClustalWAlignment(java.io.OutputStream os,
- Alignment seqAl) throws IOException {
- System.err.println("NOT FULLY IMPLEMENTED!"); // TODO: Finish adapting this method
- AlignmentSequence[] s = seqAl.getAlignmentSequence();
-
- java.io.BufferedWriter out = new BufferedWriter(
- new java.io.OutputStreamWriter(os));
-
- out.write("CLUSTAL\n\n");
-
- int max = 0;
- int maxid = 0;
-
- int i = 0;
-
- while (i < s.length && s[i] != null) {
- String tmp = s[i].getId();
-
- if (s[i].getSequence().length() > max) {
- max = s[i].getSequence().length();
- }
- if (tmp.length() > maxid) {
- maxid = tmp.length();
- }
- i++;
- }
-
- if (maxid < 15) {
- maxid = 15;
- }
- maxid++;
- int len = 60;
- int nochunks = max / len + 1;
-
- for (i = 0; i < nochunks; i++) {
- int j = 0;
- while (j < s.length && s[j] != null) {
- out.write(new Format("%-" + maxid + "s").form(s[j].getId() + " "));
- int start = i * len;
- int end = start + len;
-
- if (end < s[j].getSequence().length() && start < s[j].getSequence().length()) {
- out.write(s[j].getSequence().substring(start, end) + "\n");
- } else {
- if (start < s[j].getSequence().length()) {
- out.write(s[j].getSequence().substring(start) + "\n");
- }
- }
- j++;
- }
- out.write("\n");
-
- }
- }
- /**
- * manufacture an alignment/dataset from an array of sequences
- * @param origin
- * @param seqs
- * @return
- * @throws Exception
- */
- public static Alignment make_Alignment(Entry origin,
- Sequence[] seqs) throws Exception {
- System.err.println("NOT FULLY IMPLEMENTED!"); // TODO: Finish adapting this method
- Alignment al = new Alignment();
- al.setProvenance(ProvenanceStuff.newProvenance(origin));
-
- Pattern nonGap = Pattern.compile("[A-Z*0-9]", Pattern.CASE_INSENSITIVE);
- boolean gapsset = false;
- char gapchar = '-';
- int seqLength = 0;
-
- for (int i = 0, nseq = seqs.length; i < nseq; i++) {
- String seq = seqs[i].getSequence();
- String gaps = nonGap.matcher(seq).replaceAll("");
- if (seqLength == 0) {
- seqLength = seq.length();
- } else if (seqLength != seq.length())
- throw (new Exception(i + "th Sequence (>" + seqs[i].getId()
- + ") is not aligned.\n"));// TODO: move this to assertions part of
- // Alignment
-
- // common check for any sequence...
- if (gaps != null && gaps.length() > 0) {
- if (!gapsset)
- gapchar = gaps.charAt(0);
- for (int c = 0, gc = gaps.length(); c < gc; c++) {
- if (gapchar != gaps.charAt(c)) {
- throw (new IOException("Inconsistent gap characters in sequence "
- + i + ": '" + seq + "'"));
- }
- }
- }
- AlignmentSequence sq = new AlignmentSequence();
- // TODO: use as basis of default AlignSequence(Sequence) constructor.
- sq.setSequence(seq);
- sq.setName(seqs[i].getId());
- sq.setRefid(seqs[i].getVorbaId());
- sq.setStart(seqs[i].getStart());
- sq.setEnd(seqs[i].getEnd());
- al.addAlignmentSequence(sq);
- }
- al.setGapChar(String.valueOf(gapchar));
- return al;
- }
-
- public static Alignment read_FastaAlignment(InputStream os, Entry entry)
- throws Exception {
- Sequence[] seqs;
- System.err.println("NOT FULLY IMPLEMENTED!"); // TODO: Finish adapting this method
- try {
- seqs = SeqSet.read_SeqFasta(os);
- if (seqs == null)
- throw (new Exception("Empty alignment stream!\n"));
- } catch (Exception e) {
- throw new Exception("Invalid fasta alignment\n", e);
- }
-
- return make_Alignment(entry, seqs);
- }
-
- public static Alignment read_ClustalAlignment(InputStream os, Entry entry)
- throws Exception {
- Sequence[] seqs;
- try {
- seqs = SeqAln.ReadClustalFile(os);
- if (seqs == null)
- throw (new Exception("Empty alignment stream!\n"));
- } catch (Exception e) {
- throw new Exception("Invalid fasta alignment\n", e);
- }
- System.err.println("NOT FULLY IMPLEMENTED!"); // TODO: Finish adapting this method
- return make_Alignment(entry, seqs);
- }
-}
+/*
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
+ */
+package uk.ac.vamsas.objects.utils;
+
+import java.io.BufferedOutputStream;
+import java.io.BufferedReader;
+import java.io.BufferedWriter;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.Hashtable;
+import java.util.StringTokenizer;
+import java.util.Vector;
+import java.util.regex.Pattern;
+
+import uk.ac.vamsas.objects.core.*;
+
+/**
+ * @author jimp
+ *
+ * TODO To change the template for this generated type comment go to
+ * Window - Preferences - Java - Code Style - Code Templates
+ */
+public class SeqAln extends uk.ac.vamsas.objects.core.Alignment {
+
+ public static Sequence[] ReadClustalFile(InputStream os) throws Exception {
+ System.err.println("NOT FULLY IMPLEMENTED!"); // TODO: Finish adapting this
+ // method
+ Pattern nonGap = Pattern.compile("[A-Z*0-9]", Pattern.CASE_INSENSITIVE);
+ String gapchars = "";
+ char gapchar = '-';
+
+ int i = 0;
+ boolean flag = false;
+
+ Vector headers = new Vector();
+ Hashtable seqhash = new Hashtable();
+ Sequence[] seqs = null;
+ int noSeqs = 0;
+ String line;
+
+ try {
+ BufferedReader ins = new BufferedReader(new InputStreamReader(os));
+ while ((line = ins.readLine()) != null) {
+ if (line.indexOf(" ") != 0) {
+ java.util.StringTokenizer str = new StringTokenizer(line, " ");
+ String id = "";
+
+ if (str.hasMoreTokens()) {
+ id = str.nextToken();
+ if (id.equals("CLUSTAL")) {
+ flag = true;
+ } else {
+ if (flag) {
+ StringBuffer tempseq;
+ if (seqhash.containsKey(id)) {
+ tempseq = (StringBuffer) seqhash.get(id);
+ } else {
+ tempseq = new StringBuffer();
+ seqhash.put(id, tempseq);
+ }
+
+ if (!(headers.contains(id))) {
+ headers.addElement(id);
+ }
+
+ tempseq.append(str.nextToken());
+ }
+ }
+ }
+ }
+ }
+
+ } catch (IOException e) {
+ throw (new Exception("Exception parsing clustal file ", e));
+ }
+
+ if (flag) {
+ noSeqs = headers.size();
+
+ // Add sequences to the hash
+ seqs = new Sequence[headers.size()];
+ for (i = 0; i < headers.size(); i++) {
+ if (seqhash.get(headers.elementAt(i)) != null) {
+ // TODO: develop automatic dictionary typing for sequences
+ Sequence newSeq = Seq.newSequence(headers.elementAt(i).toString(),
+ seqhash.get(headers.elementAt(i).toString()).toString(),
+ SymbolDictionary.STANDARD_AA, 0, 0);
+
+ seqs[i] = newSeq;
+
+ } else {
+ throw (new Exception("Bizarreness! Can't find sequence for "
+ + headers.elementAt(i)));
+ }
+ }
+ }
+ return seqs;
+ }
+
+ public static void WriteClustalWAlignment(java.io.OutputStream os,
+ Alignment seqAl) throws IOException {
+ System.err.println("NOT FULLY IMPLEMENTED!"); // TODO: Finish adapting this
+ // method
+ AlignmentSequence[] s = seqAl.getAlignmentSequence();
+
+ java.io.BufferedWriter out = new BufferedWriter(
+ new java.io.OutputStreamWriter(os));
+
+ out.write("CLUSTAL\n\n");
+
+ int max = 0;
+ int maxid = 0;
+
+ int i = 0;
+
+ while (i < s.length && s[i] != null) {
+ String tmp = s[i].getId();
+
+ if (s[i].getSequence().length() > max) {
+ max = s[i].getSequence().length();
+ }
+ if (tmp.length() > maxid) {
+ maxid = tmp.length();
+ }
+ i++;
+ }
+
+ if (maxid < 15) {
+ maxid = 15;
+ }
+ maxid++;
+ int len = 60;
+ int nochunks = max / len + 1;
+
+ for (i = 0; i < nochunks; i++) {
+ int j = 0;
+ while (j < s.length && s[j] != null) {
+ out.write(new Format("%-" + maxid + "s").form(s[j].getId() + " "));
+ int start = i * len;
+ int end = start + len;
+
+ if (end < s[j].getSequence().length()
+ && start < s[j].getSequence().length()) {
+ out.write(s[j].getSequence().substring(start, end) + "\n");
+ } else {
+ if (start < s[j].getSequence().length()) {
+ out.write(s[j].getSequence().substring(start) + "\n");
+ }
+ }
+ j++;
+ }
+ out.write("\n");
+
+ }
+ }
+
+ /**
+ * manufacture an alignment/dataset from an array of sequences
+ *
+ * @param origin
+ * @param seqs
+ * @return
+ * @throws Exception
+ */
+ public static Alignment make_Alignment(Entry origin, Sequence[] seqs)
+ throws Exception {
+ System.err.println("NOT FULLY IMPLEMENTED!"); // TODO: Finish adapting this
+ // method
+ Alignment al = new Alignment();
+ al.setProvenance(ProvenanceStuff.newProvenance(origin));
+
+ Pattern nonGap = Pattern.compile("[A-Z*0-9]", Pattern.CASE_INSENSITIVE);
+ boolean gapsset = false;
+ char gapchar = '-';
+ int seqLength = 0;
+
+ for (int i = 0, nseq = seqs.length; i < nseq; i++) {
+ String seq = seqs[i].getSequence();
+ String gaps = nonGap.matcher(seq).replaceAll("");
+ if (seqLength == 0) {
+ seqLength = seq.length();
+ } else if (seqLength != seq.length())
+ throw (new Exception(i + "th Sequence (>" + seqs[i].getId()
+ + ") is not aligned.\n"));// TODO: move this to assertions part of
+ // Alignment
+
+ // common check for any sequence...
+ if (gaps != null && gaps.length() > 0) {
+ if (!gapsset)
+ gapchar = gaps.charAt(0);
+ for (int c = 0, gc = gaps.length(); c < gc; c++) {
+ if (gapchar != gaps.charAt(c)) {
+ throw (new IOException("Inconsistent gap characters in sequence "
+ + i + ": '" + seq + "'"));
+ }
+ }
+ }
+ AlignmentSequence sq = new AlignmentSequence();
+ // TODO: use as basis of default AlignSequence(Sequence) constructor.
+ sq.setSequence(seq);
+ sq.setName(seqs[i].getId());
+ sq.setRefid(seqs[i].getVorbaId());
+ sq.setStart(seqs[i].getStart());
+ sq.setEnd(seqs[i].getEnd());
+ al.addAlignmentSequence(sq);
+ }
+ al.setGapChar(String.valueOf(gapchar));
+ return al;
+ }
+
+ public static Alignment read_FastaAlignment(InputStream os, Entry entry)
+ throws Exception {
+ Sequence[] seqs;
+ System.err.println("NOT FULLY IMPLEMENTED!"); // TODO: Finish adapting this
+ // method
+ try {
+ seqs = SeqSet.read_SeqFasta(os);
+ if (seqs == null)
+ throw (new Exception("Empty alignment stream!\n"));
+ } catch (Exception e) {
+ throw new Exception("Invalid fasta alignment\n", e);
+ }
+
+ return make_Alignment(entry, seqs);
+ }
+
+ public static Alignment read_ClustalAlignment(InputStream os, Entry entry)
+ throws Exception {
+ Sequence[] seqs;
+ try {
+ seqs = SeqAln.ReadClustalFile(os);
+ if (seqs == null)
+ throw (new Exception("Empty alignment stream!\n"));
+ } catch (Exception e) {
+ throw new Exception("Invalid fasta alignment\n", e);
+ }
+ System.err.println("NOT FULLY IMPLEMENTED!"); // TODO: Finish adapting this
+ // method
+ return make_Alignment(entry, seqs);
+ }
+}
diff --git a/src/uk/ac/vamsas/objects/utils/SeqSet.java b/src/uk/ac/vamsas/objects/utils/SeqSet.java
index e75bd54..b6f48ad 100644
--- a/src/uk/ac/vamsas/objects/utils/SeqSet.java
+++ b/src/uk/ac/vamsas/objects/utils/SeqSet.java
@@ -1,138 +1,166 @@
-/*
- * Created on 17-May-2005
- * Slurped into VamsasClient object set on 12th Jan 2006
- *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-package uk.ac.vamsas.objects.utils;
-
-import java.io.BufferedReader;
-import java.io.BufferedWriter;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.util.Hashtable;
-import java.util.Vector;
-import java.util.regex.Pattern;
-
-import uk.ac.vamsas.objects.core.*;
-
-/**
- * @author jimp
- *
- * TODO To change the template for this generated type comment go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-public class SeqSet {
-
- public static void write_Fasta(OutputStream os, SequenceType[] seqs) throws IOException {
- write_Fasta(os, seqs, 80);
- }
-
- public static void write_Fasta(OutputStream os, SequenceType[] seqs, boolean width80) throws IOException {
- write_Fasta(os, seqs, (width80) ? 80 : 0);
- }
-
- public static void write_Fasta(OutputStream os, SequenceType[] seqs, int width) throws IOException {
- int i, nseq = seqs.length;
- BufferedWriter fasta_out = new BufferedWriter(new OutputStreamWriter(os));
- System.err.println("NOT FULLY IMPLEMENTED!"); // TODO: Finish adapting this method
- for (i=0; i"+seqs[i].getName()+"\n");
- if (width<=0) {
- fasta_out.write(seqs[i].getSequence()+"\n");
- } else {
- // TODO: adapt to SymbolDictionary labelwidths
- String tempseq = seqs[i].getSequence();
- int j=0, k=tempseq.length();
- while (j=width) {
- fasta_out.write(tempseq, j, width);
- } else {
- fasta_out.write(tempseq, j, d);
- }
- fasta_out.write("\n");
- j+=width;
- }
- }
- }
- fasta_out.flush();
- }
- /**
- * TODO: introduce a dictionary parameter for qualified sequence symbols
- * Reads a sequence set from a stream - will only read prescribed amino acid
- * symbols.
- * @param os
- * @return
- * @throws IOException
- */
- public static Sequence[] read_SeqFasta(InputStream os) throws IOException {
- Vector seqs = new Vector();
- int nseq = 0;
- BufferedReader infasta = new BufferedReader(new InputStreamReader(os));
- System.err.println("NOT FULLY IMPLEMENTED!"); // TODO: Finish adapting this method
- // TODO: decide on return type - SequenceType is a partly complete vamsas Vobject - either for a dataset or alignment sequence
- // so could go in either!
- String line;
- Sequence seq = null;
- Pattern aaMatch = Pattern.compile("[ARNDCQEGHILKMFPSTUWYV]", Pattern.CASE_INSENSITIVE);
- String sname = "", seqstr=null;
- do {
- line = infasta.readLine();
- if (line==null || line.startsWith(">")) {
- if (seqstr!=null)
- seqs.add((Object) Seq.newSequence(sname.substring(1), seqstr, SymbolDictionary.STANDARD_AA, 0,0));
- sname = line; // remove >
- seqstr="";
- } else {
- String subseq = Pattern.compile("//s+").matcher(line).replaceAll("");
- seqstr += subseq;
- }
- } while (line!=null);
- nseq = seqs.size();
- if (nseq>0) {
- // TODO:POSS: should really return a sequence if there's only one in the file.
- Sequence[] seqset = new Sequence[nseq];
- for (int i=0; i.
+ */
+package uk.ac.vamsas.objects.utils;
+
+import java.io.BufferedReader;
+import java.io.BufferedWriter;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.util.Hashtable;
+import java.util.Vector;
+import java.util.regex.Pattern;
+
+import uk.ac.vamsas.objects.core.*;
+
+/**
+ * @author jimp
+ *
+ * TODO To change the template for this generated type comment go to
+ * Window - Preferences - Java - Code Style - Code Templates
+ */
+public class SeqSet {
+
+ public static void write_Fasta(OutputStream os, SequenceType[] seqs)
+ throws IOException {
+ write_Fasta(os, seqs, 80);
+ }
+
+ public static void write_Fasta(OutputStream os, SequenceType[] seqs,
+ boolean width80) throws IOException {
+ write_Fasta(os, seqs, (width80) ? 80 : 0);
+ }
+
+ public static void write_Fasta(OutputStream os, SequenceType[] seqs, int width)
+ throws IOException {
+ int i, nseq = seqs.length;
+ BufferedWriter fasta_out = new BufferedWriter(new OutputStreamWriter(os));
+ System.err.println("NOT FULLY IMPLEMENTED!"); // TODO: Finish adapting this
+ // method
+ for (i = 0; i < nseq; i++) {
+ fasta_out.write(">" + seqs[i].getName() + "\n");
+ if (width <= 0) {
+ fasta_out.write(seqs[i].getSequence() + "\n");
+ } else {
+ // TODO: adapt to SymbolDictionary labelwidths
+ String tempseq = seqs[i].getSequence();
+ int j = 0, k = tempseq.length();
+ while (j < k) {
+ int d = k - j;
+ if (d >= width) {
+ fasta_out.write(tempseq, j, width);
+ } else {
+ fasta_out.write(tempseq, j, d);
+ }
+ fasta_out.write("\n");
+ j += width;
+ }
+ }
+ }
+ fasta_out.flush();
+ }
+
+ /**
+ * TODO: introduce a dictionary parameter for qualified sequence symbols Reads
+ * a sequence set from a stream - will only read prescribed amino acid
+ * symbols.
+ *
+ * @param os
+ * @return
+ * @throws IOException
+ */
+ public static Sequence[] read_SeqFasta(InputStream os) throws IOException {
+ Vector seqs = new Vector();
+ int nseq = 0;
+ BufferedReader infasta = new BufferedReader(new InputStreamReader(os));
+ System.err.println("NOT FULLY IMPLEMENTED!"); // TODO: Finish adapting this
+ // method
+ // TODO: decide on return type - SequenceType is a partly complete vamsas
+ // Vobject - either for a dataset or alignment sequence
+ // so could go in either!
+ String line;
+ Sequence seq = null;
+ Pattern aaMatch = Pattern.compile("[ARNDCQEGHILKMFPSTUWYV]",
+ Pattern.CASE_INSENSITIVE);
+ String sname = "", seqstr = null;
+ do {
+ line = infasta.readLine();
+ if (line == null || line.startsWith(">")) {
+ if (seqstr != null)
+ seqs.add((Object) Seq.newSequence(sname.substring(1), seqstr,
+ SymbolDictionary.STANDARD_AA, 0, 0));
+ sname = line; // remove >
+ seqstr = "";
+ } else {
+ String subseq = Pattern.compile("//s+").matcher(line).replaceAll("");
+ seqstr += subseq;
+ }
+ } while (line != null);
+ nseq = seqs.size();
+ if (nseq > 0) {
+ // TODO:POSS: should really return a sequence if there's only one in the
+ // file.
+ Sequence[] seqset = new Sequence[nseq];
+ for (int i = 0; i < nseq; i++) {
+ seqset[i] = (Sequence) seqs.elementAt(i);
+ }
+ return seqset;
+ }
+
+ return null;
+ }
+
+ public static Hashtable uniquify(SequenceType[] sequences) {
+ System.err.println("NOT FULLY IMPLEMENTED!"); // TODO: Finish adapting this
+ // method
+ // TODO: do we need this with vamsas sequences ?
+ // Generate a safely named sequence set and a hash to recover the sequence
+ // names
+ Hashtable map = new Hashtable();
+ for (int i = 0; i < sequences.length; i++) {
+ String safename = new String("Sequence" + i);
+ map.put(safename, sequences[i].getName());
+ sequences[i].setName(safename);
+ }
+ return map;
+ }
+
+ public static boolean deuniquify(Hashtable map, SequenceType[] sequences) {
+ System.err.println("NOT FULLY IMPLEMENTED!"); // TODO: Finish adapting this
+ // method
+ // TODO: do we need this with vamsas sequences ?
+ // recover unsafe sequence names for a sequence set
+ boolean allfound = true;
+ for (int i = 0; i < sequences.length; i++) {
+ if (map.containsKey(sequences[i].getName())) {
+ String unsafename = (String) map.get(sequences[i].getName());
+ sequences[i].setName(unsafename);
+ } else {
+ allfound = false;
+ }
+ }
+ return allfound;
+ }
+
+}
diff --git a/src/uk/ac/vamsas/objects/utils/SymbolDictionary.java b/src/uk/ac/vamsas/objects/utils/SymbolDictionary.java
index b8ac66f..6cd81a8 100644
--- a/src/uk/ac/vamsas/objects/utils/SymbolDictionary.java
+++ b/src/uk/ac/vamsas/objects/utils/SymbolDictionary.java
@@ -1,19 +1,50 @@
-package uk.ac.vamsas.objects.utils;
-
-public class SymbolDictionary {
- /**
- * defines standard names and properties for vamsas sequence dictionaries
- */
- static final public String STANDARD_AA="info:iubmb.org/aminoacids"; // strict 1 letter code
- static final public String STANDARD_NA="info:iubmb.org/nucleosides";// strict 1 letter code (do not allow arbitrary rare nucleosides)
- /**
- * TODO: Vamsas Dictionary properties interface
- * an interface for dictionary provides :
- * validation for a string
- * symbolwidth (or symbol next/previous)
- * mappings to certain other dictionaries (one2three, etc)
- * gap-character test
- *
- */
-
-}
+/*
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
+ */
+package uk.ac.vamsas.objects.utils;
+
+public class SymbolDictionary {
+ /**
+ * defines standard names and properties for vamsas sequence dictionaries
+ */
+ static final public String STANDARD_AA = "info:iubmb.org/aminoacids"; // strict
+ // 1
+ // letter
+ // code
+
+ static final public String STANDARD_NA = "info:iubmb.org/nucleosides";// strict
+ // 1
+ // letter
+ // code
+ // (do
+ // not
+ // allow
+ // arbitrary
+ // rare
+ // nucleosides)
+ /**
+ * TODO: Vamsas Dictionary properties interface an interface for dictionary
+ * provides : validation for a string symbolwidth (or symbol next/previous)
+ * mappings to certain other dictionaries (one2three, etc) gap-character test
+ *
+ */
+
+}
diff --git a/src/uk/ac/vamsas/objects/utils/Trees.java b/src/uk/ac/vamsas/objects/utils/Trees.java
index 718d8fa..dbea136 100644
--- a/src/uk/ac/vamsas/objects/utils/Trees.java
+++ b/src/uk/ac/vamsas/objects/utils/Trees.java
@@ -1,3 +1,24 @@
+/*
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
+ */
package uk.ac.vamsas.objects.utils;
import java.io.IOException;
@@ -8,12 +29,13 @@ import uk.ac.vamsas.objects.utils.trees.NewickFile;
public class Trees {
/**
- * TODO: implement
- * helper functions based on NewickFile tree parser
+ * TODO: implement helper functions based on NewickFile tree parser
*
- * 1. create a newickfile object from a newick string.
- * 2. let user map a vamsas object to each node by setting that node's ((SequenceNode)node).setElement(VorbaId)
- * 3. generate Tree object with newickString as a newick string, and added treenodes to record mapping to vorba ids
+ * 1. create a newickfile object from a newick string. 2. let user map a
+ * vamsas object to each node by setting that node's
+ * ((SequenceNode)node).setElement(VorbaId) 3. generate Tree object with
+ * newickString as a newick string, and added treenodes to record mapping to
+ * vorba ids
*/
-
+
}
diff --git a/src/uk/ac/vamsas/objects/utils/document/VersionEntries.java b/src/uk/ac/vamsas/objects/utils/document/VersionEntries.java
index 7972347..b8bd785 100644
--- a/src/uk/ac/vamsas/objects/utils/document/VersionEntries.java
+++ b/src/uk/ac/vamsas/objects/utils/document/VersionEntries.java
@@ -1,49 +1,73 @@
-/**
- *
- */
-package uk.ac.vamsas.objects.utils.document;
-
-import java.util.Hashtable;
-
-/**
- * enumerates versions for the VamsasDocument.Version string
- * provides version comparison methods
- * TODO: LATER: associate schema versions with these strings
- */
-public class VersionEntries {
- public static final String ALPHA_VERSION="alpha";
- public static final String BETA_VERSION="beta";
- protected static Hashtable versions;
- static {
- versions = new Hashtable();
- // integers represent version hierarchy - 0 precedes 1
- versions.put(ALPHA_VERSION, new Integer(0));
- versions.put(BETA_VERSION, new Integer(1));
- }
- // TODO: LATER: decide on best pattern for enumeration classes (ie - need an ordered list of versions, and validator, plus explicit enum-strings)
- public static boolean isVersion(String vstring) {
- return versions.containsKey(vstring);
- }
- /**
- * returns 0 if levels are equivalent,
- * 1 if higher is valid and higher,
- * 2 if lower is valid and higher
- * -1 if both levels are invalid
- * @param higher
- * @param lower
- * @return
- */
- public static int compare(String higher, String lower) {
- int v_1 = versions.containsKey(higher) ? ((Integer) versions.get(higher)).intValue() : -1;
- int v_2 = versions.containsKey(lower) ? ((Integer) versions.get(lower)).intValue() : -1;
- int comp = v_1.
+ */
+package uk.ac.vamsas.objects.utils.document;
+
+import java.util.Hashtable;
+
+/**
+ * enumerates versions for the VamsasDocument.Version string provides version
+ * comparison methods TODO: LATER: associate schema versions with these strings
+ */
+public class VersionEntries {
+ public static final String ALPHA_VERSION = "alpha";
+
+ public static final String BETA_VERSION = "beta";
+
+ protected static Hashtable versions;
+ static {
+ versions = new Hashtable();
+ // integers represent version hierarchy - 0 precedes 1
+ versions.put(ALPHA_VERSION, new Integer(0));
+ versions.put(BETA_VERSION, new Integer(1));
+ }
+
+ // TODO: LATER: decide on best pattern for enumeration classes (ie - need an
+ // ordered list of versions, and validator, plus explicit enum-strings)
+ public static boolean isVersion(String vstring) {
+ return versions.containsKey(vstring);
+ }
+
+ /**
+ * returns 0 if levels are equivalent, 1 if higher is valid and higher, 2 if
+ * lower is valid and higher -1 if both levels are invalid
+ *
+ * @param higher
+ * @param lower
+ * @return
+ */
+ public static int compare(String higher, String lower) {
+ int v_1 = versions.containsKey(higher) ? ((Integer) versions.get(higher))
+ .intValue() : -1;
+ int v_2 = versions.containsKey(lower) ? ((Integer) versions.get(lower))
+ .intValue() : -1;
+ int comp = v_1 < v_2 ? 2 : v_1 == v_2 ? 0 : 1;
+ return (comp == 0) ? (v_1 != -1 ? 0 : -1) : comp;
+ }
+
+ /**
+ * @return the latest version that this vamsas library supports
+ */
+ public static String latestVersion() {
+ return BETA_VERSION;
+ }
+
+}
diff --git a/src/uk/ac/vamsas/objects/utils/trees/BinaryNode.java b/src/uk/ac/vamsas/objects/utils/trees/BinaryNode.java
index bc41783..5cf8664 100644
--- a/src/uk/ac/vamsas/objects/utils/trees/BinaryNode.java
+++ b/src/uk/ac/vamsas/objects/utils/trees/BinaryNode.java
@@ -1,5 +1,23 @@
-/**
+/*
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
*
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
package uk.ac.vamsas.objects.utils.trees;
@@ -18,7 +36,7 @@ public class BinaryNode {
BinaryNode parent;
/** bootstrap is non-negative integer */
- public int bootstrap=-1;
+ public int bootstrap = -1;
/**
* Creates a new BinaryNode object.
@@ -140,10 +158,10 @@ public class BinaryNode {
}
/**
- * attaches FIRST and SECOND node arguments as the LEFT and RIGHT children
- * of this node (removing any old references) a null parameter DOES NOT mean
- * that the pointer to the corresponding child node is set to NULL - you
- * should use setChild(null), or detach() for this.
+ * attaches FIRST and SECOND node arguments as the LEFT and RIGHT children of
+ * this node (removing any old references) a null parameter DOES NOT mean that
+ * the pointer to the corresponding child node is set to NULL - you should use
+ * setChild(null), or detach() for this.
*
*/
public void SetChildren(BinaryNode leftchild, BinaryNode rightchild) {
@@ -253,26 +271,20 @@ public class BinaryNode {
}
/**
*
- * @return unquoted string of form VorbaId|v|node name string
- public String getNewickNodeName() {
- if (element!=null || name!=null)
- {
- return ((element!=null) ? element.getVorbaId().getId()+"|v|" : "")
- + ((name == null) ? "" : name);
- }
- return "";
- }
-
- * note we probably don't need this now
-
- * public boolean parseNodeNameString(uk.ac.vamsas.client.ClientDocument binder)
- {
-
- if (element==null && name!=null && name.indexOf("|v|")>-1)
- {
- element = binder.getObject(null).getVorbaId(); // TODO: fix THIS ! name.substring(0, name.indexOf("|v")));
-
- }
- return false;
- }*/
-}
\ No newline at end of file
+ * @return unquoted string of form VorbaId|v|node name string public String
+ * getNewickNodeName() { if (element!=null || name!=null) { return
+ * ((element!=null) ? element.getVorbaId().getId()+"|v|" : "") +
+ * ((name == null) ? "" : name); } return ""; }
+ *
+ * note we probably don't need this now
+ *
+ * public boolean
+ * parseNodeNameString(uk.ac.vamsas.client.ClientDocument binder) {
+ *
+ * if (element==null && name!=null && name.indexOf("|v|")>-1) {
+ * element = binder.getObject(null).getVorbaId(); // TODO: fix THIS !
+ * name.substring(0, name.indexOf("|v")));
+ *
+ * } return false; }
+ */
+}
diff --git a/src/uk/ac/vamsas/objects/utils/trees/NewickFile.java b/src/uk/ac/vamsas/objects/utils/trees/NewickFile.java
index d6f5f57..d38c99a 100644
--- a/src/uk/ac/vamsas/objects/utils/trees/NewickFile.java
+++ b/src/uk/ac/vamsas/objects/utils/trees/NewickFile.java
@@ -1,24 +1,24 @@
/*
- * originally from
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
*
- * Jalview - A Sequence Alignment Editor and Viewer
- * Copyright (C) 2007 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
// NewickFile.java
// Tree I/O
// http://evolution.genetics.washington.edu/phylip/newick_doc.html
@@ -222,9 +222,9 @@ public class NewickFile {
}
/**
- * call this to convert the newick string into a binary node linked tree
- * Note: this is automatically called by the constructors, so you normally
- * wouldn't need to use this.
+ * call this to convert the newick string into a binary node linked tree Note:
+ * this is automatically called by the constructors, so you normally wouldn't
+ * need to use this.
*
* @throws IOException
* if the newick string cannot be parsed.
@@ -271,9 +271,9 @@ public class NewickFile {
Matcher mjsyms = majorsyms.matcher(nf);
char schar;
- int nextcp=0;
+ int nextcp = 0;
int ncp = cp;
- while (mjsyms.find(cp) && (Error == null)) {
+ while (mjsyms.find(cp) && (Error == null)) {
int fcp = mjsyms.start();
switch (schar = nf.charAt(fcp)) {
@@ -339,29 +339,32 @@ public class NewickFile {
"Wayward semicolon (depth=" + d + ")", 7, fcp, nf);
}
- // Skip Comment or structured/extended NH format info
+ // Skip Comment or structured/extended NH format info
if (schar == '[') {
- if ((nextcp=nf.indexOf(']', fcp)) > -1) {
+ if ((nextcp = nf.indexOf(']', fcp)) > -1) {
// verified that comment is properly terminated.
// now skip the comment field
nextcp++;
- break; // go and search for the next node separator, leaving ncp at beginning of node info
+ break; // go and search for the next node separator, leaving ncp at
+ // beginning of node info
} else {
Error = ErrorStringrange(Error, "Unterminated comment", 3, fcp, nf);
nextcp = 0;
break;
}
}
-
- // Parse simpler field strings from substring between ncp and node separator
+
+ // Parse simpler field strings from substring between ncp and node
+ // separator
String fstring = nf.substring(ncp, fcp);
// extract any comments from the nodeinfo.
- while (fstring.indexOf(']')>-1)
- {
- int cstart=fstring.indexOf('[');
- int cend=fstring.indexOf(']');
- String comment = fstring.substring(cstart+1,cend); // TODO: put this somewhere ?
- fstring = fstring.substring(0, cstart)+fstring.substring(cend+1);
+ while (fstring.indexOf(']') > -1) {
+ int cstart = fstring.indexOf('[');
+ int cend = fstring.indexOf(']');
+ String comment = fstring.substring(cstart + 1, cend); // TODO: put
+ // this
+ // somewhere ?
+ fstring = fstring.substring(0, cstart) + fstring.substring(cend + 1);
}
Matcher uqnodename = Pattern.compile("^([^' :;\\](),]+).*").matcher(
fstring);
@@ -384,14 +387,12 @@ public class NewickFile {
Matcher nbootstrap = Pattern.compile("\\s*([+0-9]+)\\s*:.*").matcher(
fstring);
- if (nbootstrap.matches())
- {
- if (nodename!=null && nbootstrap.group(1).equals(nodename))
- {
- nodename=null; // empty nodename - only bootstrap value
+ if (nbootstrap.matches()) {
+ if (nodename != null && nbootstrap.group(1).equals(nodename)) {
+ nodename = null; // empty nodename - only bootstrap value
}
- if ((nodename==null || nodename.length()==0) || nbootstrap.start(1)>=uqnodename.end(1))
- {
+ if ((nodename == null || nodename.length() == 0)
+ || nbootstrap.start(1) >= uqnodename.end(1)) {
try {
bootstrap = (new Integer(nbootstrap.group(1))).intValue();
HasBootstrap = true;
@@ -401,7 +402,7 @@ public class NewickFile {
}
}
}
-
+
Matcher ndist = Pattern.compile(".*:([-0-9Ee.+]+)").matcher(fstring);
boolean nodehasdistance = false;
@@ -515,7 +516,8 @@ public class NewickFile {
public uk.ac.vamsas.objects.core.Treenode[] matchTreeNodeNames(
String[] names, Vobject[] boundObjects) {
// todo!
- // also - need to reconstruct a names object id mapping (or BInaryNode) mapping for the parsed tree file
+ // also - need to reconstruct a names object id mapping (or BInaryNode)
+ // mapping for the parsed tree file
return null;
}
@@ -641,7 +643,7 @@ public class NewickFile {
private String nodeName(String name) {
if (NodeSafeName[0].matcher(name).find()) {
return QuoteChar + NodeSafeName[1].matcher(name).replaceAll("''")
- + QuoteChar; // quite
+ + QuoteChar; // quite
} else {
return NodeSafeName[2].matcher(name).replaceAll("_"); // whitespace
}
@@ -656,10 +658,12 @@ public class NewickFile {
* @return DOCUMENT ME!
*/
private String printNodeField(SequenceNode c) {
- return //c.getNewickNodeName()
+ return // c.getNewickNodeName()
((c.getName() == null) ? "" : nodeName(c.getName()))
- + ((HasBootstrap) ? ((c.getBootstrap() > -1) ? (((c.getName()==null) ? " " : "") + c.getBootstrap())
- : "") : "") + ((HasDistances) ? (":" + c.dist) : "");
+ + ((HasBootstrap) ? ((c.getBootstrap() > -1) ? (((c.getName() == null) ? " "
+ : "") + c.getBootstrap())
+ : "")
+ : "") + ((HasDistances) ? (":" + c.dist) : "");
}
/**
@@ -673,9 +677,10 @@ public class NewickFile {
private String printRootField(SequenceNode root) {
return (printRootInfo) ? (((root.getName() == null) ? "" : nodeName(root
.getName()))
- + ((HasBootstrap) ? ((root.getBootstrap() > -1) ? ((root.getName()!=null ? " " : "") + root
- .getBootstrap()) : "") : "") + ((RootHasDistance) ? (":" + root.dist)
- : ""))
+ + ((HasBootstrap) ? ((root.getBootstrap() > -1) ? ((root.getName() != null ? " "
+ : "") + root.getBootstrap())
+ : "")
+ : "") + ((RootHasDistance) ? (":" + root.dist) : ""))
: "";
}
@@ -790,10 +795,12 @@ public class NewickFile {
/**
* Search for leaf nodes.
- *
- * @param node root node to search from
- * @param leaves Vector of leaves to add leaf node objects too.
- *
+ *
+ * @param node
+ * root node to search from
+ * @param leaves
+ * Vector of leaves to add leaf node objects too.
+ *
* @return Vector of leaf nodes on binary tree
*/
public Vector findLeaves(SequenceNode node, Vector leaves) {
@@ -801,16 +808,17 @@ public class NewickFile {
return leaves;
}
- if ((node.left() == null) && (node.right() == null)) // Interior node detection
+ if ((node.left() == null) && (node.right() == null)) // Interior node
+ // detection
{
leaves.addElement(node);
return leaves;
} else {
- /* TODO: Identify internal nodes... if (node.isSequenceLabel())
- {
- leaves.addElement(node);
- }*/
+ /*
+ * TODO: Identify internal nodes... if (node.isSequenceLabel()) {
+ * leaves.addElement(node); }
+ */
findLeaves((SequenceNode) node.left(), leaves);
findLeaves((SequenceNode) node.right(), leaves);
}
@@ -819,7 +827,9 @@ public class NewickFile {
}
/**
- * make tree node vector from a newick tree structure with associated vamsas objects
+ * make tree node vector from a newick tree structure with associated vamsas
+ * objects
+ *
* @param ntree
* @return Treenode definitions for nodes with associated objects
*/
@@ -828,8 +838,10 @@ public class NewickFile {
}
/**
- * make treenode vector for a parsed tree with/out leaf node associations
- * @param ignoreplaceholders if true means only associated nodes are returned
+ * make treenode vector for a parsed tree with/out leaf node associations
+ *
+ * @param ignoreplaceholders
+ * if true means only associated nodes are returned
* @return treenode vector for associated or all leaves
*/
public Treenode[] makeTreeNodes(boolean ignoreplaceholders) {
@@ -915,11 +927,14 @@ public class NewickFile {
}
/**
- *
- * re-decorate the newick node representation with the VorbaId of an object mapped by its corresponding TreeNode.
- * Note: this only takes the first object in the first set of references.
+ *
+ * re-decorate the newick node representation with the VorbaId of an object
+ * mapped by its corresponding TreeNode. Note: this only takes the first
+ * object in the first set of references.
+ *
* @param tn
- * @return vector of mappings { treenode, SequenceNode, Vobject for VorbaId on sequence node }
+ * @return vector of mappings { treenode, SequenceNode, Vobject for VorbaId on
+ * sequence node }
*/
public Vector attachTreeMap(Treenode[] tn) {
if (root != null || tn == null)
diff --git a/src/uk/ac/vamsas/objects/utils/trees/SequenceNode.java b/src/uk/ac/vamsas/objects/utils/trees/SequenceNode.java
index 9f2a05d..88cf944 100644
--- a/src/uk/ac/vamsas/objects/utils/trees/SequenceNode.java
+++ b/src/uk/ac/vamsas/objects/utils/trees/SequenceNode.java
@@ -1,5 +1,23 @@
-/**
+/*
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
*
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
package uk.ac.vamsas.objects.utils.trees;
@@ -65,8 +83,7 @@ public class SequenceNode extends BinaryNode {
/**
* @param dummy
- * true if node is created for the representation of polytomous
- * trees
+ * true if node is created for the representation of polytomous trees
*/
public boolean isDummy() {
return dummy;
@@ -120,4 +137,4 @@ public class SequenceNode extends BinaryNode {
return c;
}
-}
\ No newline at end of file
+}
diff --git a/src/uk/ac/vamsas/test/ExampleApplication.java b/src/uk/ac/vamsas/test/ExampleApplication.java
index 2fb20a3..6ebfcec 100644
--- a/src/uk/ac/vamsas/test/ExampleApplication.java
+++ b/src/uk/ac/vamsas/test/ExampleApplication.java
@@ -1,3 +1,24 @@
+/*
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
+ */
package uk.ac.vamsas.test;
import uk.ac.vamsas.client.*;
@@ -378,16 +399,19 @@ public class ExampleApplication {
}
public String Usage = "ExampleApplication :/n [-arena ][-session ] [+]\n"
- + " is one of :\n\tsave,new,watch\n"+
- "-arena and -session are not yet supported"; // TODO for release
+ + " is one of :\n\tsave,new,watch\n"
+ + "-arena and -session are not yet supported"; // TODO for release
String sess = null;
String importFile = null;
String outputFile = null;
- boolean newSession=false;
- boolean imported=false;
+
+ boolean newSession = false;
+
+ boolean imported = false;
+
private boolean parseArgs(String args[]) {
if (args.length == 0) {
return false;
@@ -396,14 +420,15 @@ public class ExampleApplication {
boolean parsed = false;
while (!parsed && cpos < args.length) {
// TODO: note importDocument not yet supported.
- //if (args[cpos].toLowerCase().equals("load") && cpos + 1 < args.length) {
- // importFile = args[cpos + 1];
- // cpos += 2;
- // continue;
- //}
+ // if (args[cpos].toLowerCase().equals("load") && cpos + 1 < args.length)
+ // {
+ // importFile = args[cpos + 1];
+ // cpos += 2;
+ // continue;
+ // }
if (args[cpos].toLowerCase().equals("new") && cpos + 1 < args.length) {
importFile = args[cpos + 1];
- newSession=true;
+ newSession = true;
cpos += 2;
continue;
}
@@ -465,9 +490,9 @@ public class ExampleApplication {
// get an Iclient with session data
app = new ClientHandle("uk.ac.vamsas.test.ExampleApplication", "0.1");
user = new UserHandle("arnolduser", "deathsdoor");
- if (sess!=null && importFile!=null)
- {
- System.err.println("Import of an existing document into an existing session is not fully supported yet.");
+ if (sess != null && importFile != null) {
+ System.err
+ .println("Import of an existing document into an existing session is not fully supported yet.");
System.exit(3);
}
try {
@@ -475,32 +500,32 @@ public class ExampleApplication {
System.out.println("Connecting to " + sess);
vorbaclient = clientfactory.getIClient(app, user, sess);
} else {
- if (newSession)
- {
- if (importFile==null)
- {
+ if (newSession) {
+ if (importFile == null) {
System.out.println("Connecting to a new VAMSAS Session.");
vorbaclient = clientfactory.getNewSessionIClient(app, user);
} else {
- System.out.println("Connecting to a new VAMSAS Session to share data in existing document:"+importFile);
+ System.out
+ .println("Connecting to a new VAMSAS Session to share data in existing document:"
+ + importFile);
File vfile = new File(importFile);
- vorbaclient = clientfactory.openAsNewSessionIClient(app, user, vfile);
- System.out.println("Succesfully imported document into new session.");
+ vorbaclient = clientfactory.openAsNewSessionIClient(app, user,
+ vfile);
+ System.out
+ .println("Succesfully imported document into new session.");
imported = true;
- importFile=null;
+ importFile = null;
}
} else {
- vorbaclient = clientfactory.getIClient(app, user);
+ vorbaclient = clientfactory.getIClient(app, user);
}
}
- }
- catch (InvalidSessionDocumentException e) {
- System.err.println("Failed to create a session to share "+importFile);
+ } catch (InvalidSessionDocumentException e) {
+ System.err.println("Failed to create a session to share " + importFile);
System.err.println("Sorry it didn't work out. This is what went wrong:");
e.printStackTrace(System.err);
System.exit(3);
- }
- catch (NoDefaultSessionException e) {
+ } catch (NoDefaultSessionException e) {
System.err
.println("There appear to be several sessions to choose from :");
String[] sessions = clientfactory.getCurrentSessions();
@@ -522,7 +547,7 @@ public class ExampleApplication {
File vfile = new File(importFile);
try {
vorbaclient.importDocument(vfile);
- imported=true;
+ imported = true;
} catch (Exception e) {
System.err.println("Failed to import file " + importFile);
System.err.println("Exception received was " + e);
@@ -544,11 +569,11 @@ public class ExampleApplication {
// get document data
try {
IClientDocument cdoc = vorbaclient.getClientDocument();
- if (imported)
- {
- if (cdoc.getVamsasRoots()==null || cdoc.getVamsasRoots()[0].getDataSetCount()<1)
- {
- System.err.println("Imported an Empty vamsas document. Is this correct ?");
+ if (imported) {
+ if (cdoc.getVamsasRoots() == null
+ || cdoc.getVamsasRoots()[0].getDataSetCount() < 1) {
+ System.err
+ .println("Imported an Empty vamsas document. Is this correct ?");
}
}
processVamsasDocument(cdoc);
@@ -598,7 +623,8 @@ public class ExampleApplication {
}
try {
Thread.sleep(200);
- } catch (Exception e){}
+ } catch (Exception e) {
+ }
}
} else {
if (System.currentTimeMillis() > shutdown) {
diff --git a/src/uk/ac/vamsas/test/objects/Core.java b/src/uk/ac/vamsas/test/objects/Core.java
index 58eccea..6dce168 100644
--- a/src/uk/ac/vamsas/test/objects/Core.java
+++ b/src/uk/ac/vamsas/test/objects/Core.java
@@ -1,82 +1,121 @@
-/**
- *
- */
-package uk.ac.vamsas.test.objects;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import uk.ac.vamsas.objects.core.*;
-import uk.ac.vamsas.objects.utils.*;
-import uk.ac.vamsas.objects.utils.document.*;
-import uk.ac.vamsas.test.simpleclient.ArchiveReports;
-
-/**
- * @author jim
- * test XSD-Java binding classes in uk.ac.vamsas.objects.core
- */
-public class Core {
- static Log log = LogFactory.getLog(Core.class);
-
- /**
- *
- * complete any automatically completable entries in the dataset
- * @param ds
- */
- public static String user = "uk.ac.vamsas.test.objects.Core";
-
- public static void complete(DataSet ds) {
- Sequence[] q = ds.getSequence();
- for (int i=0,j=q.length; i.
+ */
+package uk.ac.vamsas.test.objects;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import uk.ac.vamsas.objects.core.*;
+import uk.ac.vamsas.objects.utils.*;
+import uk.ac.vamsas.objects.utils.document.*;
+import uk.ac.vamsas.test.simpleclient.ArchiveReports;
+
+/**
+ * @author jim test XSD-Java binding classes in uk.ac.vamsas.objects.core
+ */
+public class Core {
+ static Log log = LogFactory.getLog(Core.class);
+
+ /**
+ *
+ * complete any automatically completable entries in the dataset
+ *
+ * @param ds
+ */
+ public static String user = "uk.ac.vamsas.test.objects.Core";
+
+ public static void complete(DataSet ds) {
+ Sequence[] q = ds.getSequence();
+ for (int i = 0, j = q.length; i < j; i++) {
+ q[i].setStart(i + 1);
+ q[i].setEnd(q[i].getSequence().length() + i + 1);
+ }
+ }
+
+ public static VAMSAS getDemoVamsas() {
+ VAMSAS v = new VAMSAS();
+ DataSet ds = new DataSet();
+ ds.addSequence(Seq.newSequence("Dummy1", "ASDFLEQ",
+ SymbolDictionary.STANDARD_AA, 5, 11));
+ ds.addSequence(Seq.newSequence("Dummy2", "ASFLEQ",
+ SymbolDictionary.STANDARD_AA, 5, 10));
+ ds.addSequence(Seq.newSequence("Dummy3", "ADFEQ",
+ SymbolDictionary.STANDARD_AA, 3, 7));
+ ds.setProvenance(ProvenanceStuff.newProvenance(user,
+ "constructed some dummy sequences"));
+ complete(ds);
+ v.addDataSet(ds);
+ Alignment al = new Alignment();
+ al.setProvenance(ProvenanceStuff.newProvenance(user,
+ "Created dummy alignment"));
+ // rely on newAlignmentSequence to set start/end correctly
+ al.addAlignmentSequence(Seq.newAlignmentSequence("Aligned1", "ASDFLEQ", ds
+ .getSequence(0), -1, -1));
+ al.addAlignmentSequence(Seq.newAlignmentSequence("Aligned2", "AS-FLEQ", ds
+ .getSequence(1), -1, -1));
+ al.addAlignmentSequence(Seq.newAlignmentSequence("Aligned3", "A-DF-EQ", ds
+ .getSequence(2), -1, -1));
+ al.setGapChar("-");
+ ds.addAlignment(al);
+ // TODO: create annotations
+ // TODO: create tree
+ return v;
+ }
+
+ /**
+ * @param args
+ */
+ public static void main(String[] args) {
+
+ /**
+ * test constants and controlled vocab utils
+ */
+ System.out.println("VersionEntries.compare(invalid, ALPHA) returned "
+ + VersionEntries.compare("invalid", VersionEntries.ALPHA_VERSION));
+ System.out.println("VersionEntries.compare(ALPHA, invalid) returned "
+ + VersionEntries.compare(VersionEntries.ALPHA_VERSION, "invalid"));
+ System.out.println("VersionEntries.compare(BETA, ALPHA) returned "
+ + VersionEntries.compare(VersionEntries.BETA_VERSION,
+ VersionEntries.ALPHA_VERSION));
+ System.out.println("VersionEntries.compare(ALPHA, BETA) returned "
+ + VersionEntries.compare(VersionEntries.ALPHA_VERSION,
+ VersionEntries.BETA_VERSION));
+ System.out.println("VersionEntries.compare(ALPHA, ALPHA) returned "
+ + VersionEntries.compare(VersionEntries.ALPHA_VERSION,
+ VersionEntries.ALPHA_VERSION));
+ System.out.println("VersionEntries.compare(invalid, invalid) returned "
+ + VersionEntries.compare("invalid", "invalid"));
+ System.out.println("VersionEntries.latestVersion()="
+ + VersionEntries.latestVersion() + ", dict_aa="
+ + SymbolDictionary.STANDARD_AA + ", dict_na="
+ + SymbolDictionary.STANDARD_NA);
+ /**
+ * Test utils and autogenerated Vobject interfaces
+ */
+
+ VamsasDocument doc = DocumentStuff.newVamsasDocument(
+ new VAMSAS[] { getDemoVamsas() }, ProvenanceStuff.newProvenance(
+ "org.vamsas.objects.test.Core", "Created demo vamsasDocument"),
+ VersionEntries.latestVersion());
+ ArchiveReports.reportDocument(doc, null, true, System.out);
+ }
+}
diff --git a/src/uk/ac/vamsas/test/simpleclient/ArchiveClient.java b/src/uk/ac/vamsas/test/simpleclient/ArchiveClient.java
index 9044e0d..fa3c700 100644
--- a/src/uk/ac/vamsas/test/simpleclient/ArchiveClient.java
+++ b/src/uk/ac/vamsas/test/simpleclient/ArchiveClient.java
@@ -1,294 +1,367 @@
-/**
- *
- */
-package uk.ac.vamsas.test.simpleclient;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.Date;
-import java.util.Hashtable;
-import java.util.Vector;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.exolab.castor.xml.MarshalException;
-import org.exolab.castor.xml.ValidationException;
-
-import uk.ac.vamsas.client.AppDataOutputStream;
-import uk.ac.vamsas.client.ClientHandle;
-import uk.ac.vamsas.client.IVorbaIdFactory;
-import uk.ac.vamsas.client.SessionHandle;
-import uk.ac.vamsas.client.UserHandle;
-import uk.ac.vamsas.client.Vobject;
-import uk.ac.vamsas.client.VorbaId;
-import uk.ac.vamsas.client.simpleclient.FileWatcher;
-import uk.ac.vamsas.client.simpleclient.IdFactory;
-import uk.ac.vamsas.client.simpleclient.SessionFile;
-import uk.ac.vamsas.client.simpleclient.SimpleDocBinding;
-import uk.ac.vamsas.client.simpleclient.SimpleDocument;
-import uk.ac.vamsas.client.simpleclient.VamsasArchive;
-import uk.ac.vamsas.client.simpleclient.VamsasArchiveReader;
-import uk.ac.vamsas.client.simpleclient.VamsasFile;
-import uk.ac.vamsas.objects.core.AppData;
-import uk.ac.vamsas.objects.core.ApplicationData;
-import uk.ac.vamsas.objects.core.User;
-import uk.ac.vamsas.objects.core.VamsasDocument;
-import uk.ac.vamsas.objects.utils.AppDataReference;
-import uk.ac.vamsas.objects.utils.DocumentStuff;
-import uk.ac.vamsas.objects.utils.ProvenanceStuff;
-import uk.ac.vamsas.objects.utils.SeqSet;
-import uk.ac.vamsas.objects.utils.document.VersionEntries;
-import uk.ac.vamsas.test.objects.Core;
-
-/**
- * @author jimp
- * test the VamsasFile routines for watching, reading and updating a vamsas document jar file.
- * simple document access base class.
- */
-public class ArchiveClient extends IdFactory {
-
- private Log log = LogFactory.getLog(ArchiveClient.class);
- // protected UserHandle user=null;
- // protected ClientHandle me = new ClientHandle("ArchiveClient","0.01");
- VamsasFile vsess;
-
- /**
- * @param user
- * @param vsess
- */
- public ArchiveClient(UserHandle user, VamsasFile vsess) {
- super(new SessionHandle("vamsasfile://"+vsess.getVamsasFile()), new ClientHandle("ArchiveClient","0.01"), user);
- this.vsess = vsess;
- valid();
- }
- private void _openVsess(File vsess) {
- try {
- this.vsess = new VamsasFile(vsess);
- }
- catch (Exception e) {
- log.error("Couldn't open session for file "+vsess,e);
- this.vsess = null;
- }
- }
- public ArchiveClient(String username, String organization, File vsess) {
- super(new SessionHandle("vamsasfile://"+vsess), new ClientHandle("ArchiveClient","0.01"), new UserHandle(username, organization));
- _openVsess(vsess);
- valid();
- }
- public ArchiveClient(String username, String organization, String clientName, String clientVersion, File vsess) {
- super(new SessionHandle("vamsasfile://"+vsess), new ClientHandle(clientName, clientVersion), new UserHandle(username, organization));
- _openVsess(vsess);
- valid();
- }
- public void valid() {
- if (vsess==null)
- throw new Error("ArchiveClient instance is invalid!.");
- }
- /**
- * set this to false if watch loop should end immediately
- */
- protected boolean watchForChange=true;
- public static int WATCH_SLEEP=300;
- /**
- * watch the document file for updates.
- * @param time - length of time to watch for.
- * @return read only IO interface for session document.
- */
- public ClientDoc watch(long time) {
- valid();
- vsess.unLock(); // doh.
- FileWatcher watcher = new FileWatcher(vsess.getVamsasFile());
- // watcher.setState();
- watchForChange=true;
- long endtime=System.currentTimeMillis()+time;
- try {
- uk.ac.vamsas.client.simpleclient.Lock doclock;
- do {
- doclock=watcher.getChangedState();
- if (doclock==null)
- Thread.sleep(WATCH_SLEEP);
- } while (watchForChange && doclock==null && (time==0 || endtime>System.currentTimeMillis())); // tuning.
- if (doclock==null)
- return null;
- else {
- return getUpdateable(vsess.getLock(doclock));
- /*VamsasArchiveReader varc = new VamsasArchiveReader(vsess.getVamsasFile());
- return _getReadonly(varc);*/
- }
- } catch (Exception e) {
- log.error("Whilst watching file "+vsess.getVamsasFile(), e);
- }
- return null;
- }
-
- // from ClientDocument.getClientAppdata
- private AppData[] getAppData(VamsasDocument doc) {
- // TODO: codefest - not yet tested or merged in to SimpleClient
- if (doc==null) {
- log.debug("extractAppData called for null document object");
- return null;
- }
- AppData appsGlobal=null, usersData=null;
- Vector apldataset = AppDataReference.getUserandApplicationsData(
- doc, this.getUserHandle(), this.getClientHandle());
- if (apldataset!=null) {
- if (apldataset.size()>0) {
- AppData clientdat = (AppData) apldataset.get(0);
- if (clientdat instanceof ApplicationData) {
- appsGlobal = (ApplicationData) clientdat;
- if (apldataset.size()>1) {
- clientdat = (AppData) apldataset.get(1);
- if (clientdat instanceof User) {
- usersData = (User) clientdat;
- }
- if (apldataset.size()>2)
- log.info("Ignoring additional ("+(apldataset.size()-2)+") AppDatas returned by document appdata query.");
- }
- } else {
- log.warn("Unexpected entry in AppDataReference query: id="+clientdat.getVorbaId()+" type="+clientdat.getClass().getName());
- }
- apldataset.removeAllElements(); // destroy references.
- }
- }
- return new AppData[] { appsGlobal, usersData};
- }
-
- protected ClientDoc _getReadonly(VamsasArchiveReader vreader) throws IOException, ValidationException, MarshalException {
- valid();
- if (vreader!=null) {
- SimpleDocBinding docb = new SimpleDocBinding();
- docb.setVorba(this);
- VamsasDocument d;
- d = docb.getVamsasDocument(vreader);
-
- if (d!=null) {
- ClientDoc creader = new ClientDoc(d, null, vreader, getClientHandle().getClientUrn(), getProvenanceUser(), getVorbaIdHash());
- return creader;
- }
- }
- return null;
- }
- /**
- * from SimpleClient
- * @return user field for a provenance entry
- */
- protected String getProvenanceUser() {
- return new String(getUserHandle().getFullName()+" ["+getClientHandle().getClientUrn()+"]");
- }
-
- public ClientDoc getUpdateable() {
- return getUpdateable(null);
- }
- public ClientDoc getUpdateable(uk.ac.vamsas.client.simpleclient.Lock lock) {
- getVorbaIdHash().clear();
- valid();
- try {
- // patiently wait for a lock on the document.
- long tries=5000;
- while (lock==null && ((lock=vsess.getLock())==null || !lock.isLocked()) && --tries>0) {
-// Thread.sleep(1);
- log.debug("Trying to get a document lock for the "+tries+"'th time.");
- }
- VamsasArchive varc = new VamsasArchive(vsess, true, false); // read archive, write as vamsasDocument, don't erase original contents.
- varc.setVorba(this);
- VamsasDocument d = varc.getVamsasDocument(getProvenanceUser(), "Created new document.", VersionEntries.latestVersion()); // VAMSAS: provenance user and client combined
-
- if (d==null) {
- log.warn("Backing out from opening a VamsasArchive writable IO session");
- varc.cancelArchive();
- return null;
- }
- ClientDoc cdoc = new ClientDoc(d, varc, varc.getOriginalArchiveReader(), getClientHandle().getClientUrn(), getProvenanceUser(), getVorbaIdHash());
- return cdoc;
- // do appHandle?
- } catch (Exception e) {
- log.error("Failed to get Updateable version of "+vsess.getVamsasFile(), e);
- }
- return null;
- }
- /**
- * trust client to not do anything stupid to the document roots which will now be written to the archive.
- * @param cdoc
- * @return true if write was a success.
- */
- public boolean doUpdate(ClientDoc cdoc) {
- valid();
- if (cdoc==null) {
- log.warn("Invalid ClientDoc passed to uk.ac.vamsas.test.simpleclient.doUpdate()");
- return false;
- }
- if (cdoc.iohandler==null) {
- log.warn("Read only ClientDoc object passed to uk.ac.vamsas.test.simpleclient.doUpdate()");
- return false;
- }
- if (cdoc.iohandler.getVorba()!=this) {
- log.error("Mismatch between ClientDoc instances and ArchiveClient instances!");
- return false;
- }
- try {
- // do any appDatas first.
- if (cdoc.iohandler.transferRemainingAppDatas())
- log.debug("Remaining appdatas were transfered.");
- cdoc.updateDocumentRoots();
- cdoc.iohandler.putVamsasDocument(cdoc.doc);
- cdoc.iohandler.closeArchive();
- this.extantids.clear();// we forget our ids after we close the document.
- cdoc.iohandler=null;
- cdoc = null;
- vsess.unLock();
- } catch (Exception e) {
- log.warn("While updating archive in "+vsess.getVamsasFile(),e);
- return false;
- }
- return true;
- }
- /**
- * @param args
- */
- public static void usage() {
- throw new Error("Usage: Username Organization VamsasFile [command,args]*");
- }
- public static void main(String[] args) {
- // really simple.
- if (args.length<3)
- usage();
-
- ArchiveClient client = new ArchiveClient(args[0],args[1], new File(args[2]));
- ClientDoc cdoc=null;
- // sanity test.
- try {
- cdoc = client.getUpdateable();
- // ArchiveReports.reportDocument(cdoc.doc, cdoc.getReader(), true, System.out);
- System.out.println("Report Roots :");
- ArchiveReports.rootReport(cdoc.getVamsasRoots(), true, System.out);
- cdoc.addVamsasRoot(Core.getDemoVamsas());
- System.out.println("Doing update.");
- client.doUpdate(cdoc);
- cdoc.closeDoc();
- cdoc = null;
- int u=5;
- while (--u>0) {
- System.out.println("Watch for more... ("+u+" left)");
- ClientDoc ucdoc = client.watch(0000);
- if (ucdoc!=null) {
- System.out.println("****\nUpdate detected at "+new Date());
- ArchiveReports.reportDocument(ucdoc.doc, ucdoc.getReader(), true, System.out);
- ucdoc.closeDoc();
- ucdoc=null;
- } else {
- System.out.println("!!!! Null document update detected at "+new Date());
- }
- }
- }
- catch (Exception e) {
- client.log.error("Broken!", e);
- }
- System.out.println("Finished at "+new Date());
- }
- public uk.ac.vamsas.client.Vobject getObject(VorbaId id) {
- Hashtable idhash = this.getVorbaIdHash();
- if (idhash!=null && idhash.containsKey(id))
- return (Vobject) idhash.get(id);
- return null;
- }
-}
+/*
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
+ */
+package uk.ac.vamsas.test.simpleclient;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Date;
+import java.util.Hashtable;
+import java.util.Vector;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.exolab.castor.xml.MarshalException;
+import org.exolab.castor.xml.ValidationException;
+
+import uk.ac.vamsas.client.AppDataOutputStream;
+import uk.ac.vamsas.client.ClientHandle;
+import uk.ac.vamsas.client.IVorbaIdFactory;
+import uk.ac.vamsas.client.SessionHandle;
+import uk.ac.vamsas.client.UserHandle;
+import uk.ac.vamsas.client.Vobject;
+import uk.ac.vamsas.client.VorbaId;
+import uk.ac.vamsas.client.simpleclient.FileWatcher;
+import uk.ac.vamsas.client.simpleclient.IdFactory;
+import uk.ac.vamsas.client.simpleclient.SessionFile;
+import uk.ac.vamsas.client.simpleclient.SimpleDocBinding;
+import uk.ac.vamsas.client.simpleclient.SimpleDocument;
+import uk.ac.vamsas.client.simpleclient.VamsasArchive;
+import uk.ac.vamsas.client.simpleclient.VamsasArchiveReader;
+import uk.ac.vamsas.client.simpleclient.VamsasFile;
+import uk.ac.vamsas.objects.core.AppData;
+import uk.ac.vamsas.objects.core.ApplicationData;
+import uk.ac.vamsas.objects.core.User;
+import uk.ac.vamsas.objects.core.VamsasDocument;
+import uk.ac.vamsas.objects.utils.AppDataReference;
+import uk.ac.vamsas.objects.utils.DocumentStuff;
+import uk.ac.vamsas.objects.utils.ProvenanceStuff;
+import uk.ac.vamsas.objects.utils.SeqSet;
+import uk.ac.vamsas.objects.utils.document.VersionEntries;
+import uk.ac.vamsas.test.objects.Core;
+
+/**
+ * @author jimp test the VamsasFile routines for watching, reading and updating
+ * a vamsas document jar file. simple document access base class.
+ */
+public class ArchiveClient extends IdFactory {
+
+ private Log log = LogFactory.getLog(ArchiveClient.class);
+
+ // protected UserHandle user=null;
+ // protected ClientHandle me = new ClientHandle("ArchiveClient","0.01");
+ VamsasFile vsess;
+
+ /**
+ * @param user
+ * @param vsess
+ */
+ public ArchiveClient(UserHandle user, VamsasFile vsess) {
+ super(new SessionHandle("vamsasfile://" + vsess.getVamsasFile()),
+ new ClientHandle("ArchiveClient", "0.01"), user);
+ this.vsess = vsess;
+ valid();
+ }
+
+ private void _openVsess(File vsess) {
+ try {
+ this.vsess = new VamsasFile(vsess);
+ } catch (Exception e) {
+ log.error("Couldn't open session for file " + vsess, e);
+ this.vsess = null;
+ }
+ }
+
+ public ArchiveClient(String username, String organization, File vsess) {
+ super(new SessionHandle("vamsasfile://" + vsess), new ClientHandle(
+ "ArchiveClient", "0.01"), new UserHandle(username, organization));
+ _openVsess(vsess);
+ valid();
+ }
+
+ public ArchiveClient(String username, String organization, String clientName,
+ String clientVersion, File vsess) {
+ super(new SessionHandle("vamsasfile://" + vsess), new ClientHandle(
+ clientName, clientVersion), new UserHandle(username, organization));
+ _openVsess(vsess);
+ valid();
+ }
+
+ public void valid() {
+ if (vsess == null)
+ throw new Error("ArchiveClient instance is invalid!.");
+ }
+
+ /**
+ * set this to false if watch loop should end immediately
+ */
+ protected boolean watchForChange = true;
+
+ public static int WATCH_SLEEP = 300;
+
+ /**
+ * watch the document file for updates.
+ *
+ * @param time
+ * - length of time to watch for.
+ * @return read only IO interface for session document.
+ */
+ public ClientDoc watch(long time) {
+ valid();
+ vsess.unLock(); // doh.
+ FileWatcher watcher = new FileWatcher(vsess.getVamsasFile());
+ // watcher.setState();
+ watchForChange = true;
+ long endtime = System.currentTimeMillis() + time;
+ try {
+ uk.ac.vamsas.client.simpleclient.Lock doclock;
+ do {
+ doclock = watcher.getChangedState();
+ if (doclock == null)
+ Thread.sleep(WATCH_SLEEP);
+ } while (watchForChange && doclock == null
+ && (time == 0 || endtime > System.currentTimeMillis())); // tuning.
+ if (doclock == null)
+ return null;
+ else {
+ return getUpdateable(vsess.getLock(doclock));
+ /*
+ * VamsasArchiveReader varc = new
+ * VamsasArchiveReader(vsess.getVamsasFile()); return
+ * _getReadonly(varc);
+ */
+ }
+ } catch (Exception e) {
+ log.error("Whilst watching file " + vsess.getVamsasFile(), e);
+ }
+ return null;
+ }
+
+ // from ClientDocument.getClientAppdata
+ private AppData[] getAppData(VamsasDocument doc) {
+ // TODO: codefest - not yet tested or merged in to SimpleClient
+ if (doc == null) {
+ log.debug("extractAppData called for null document object");
+ return null;
+ }
+ AppData appsGlobal = null, usersData = null;
+ Vector apldataset = AppDataReference.getUserandApplicationsData(doc, this
+ .getUserHandle(), this.getClientHandle());
+ if (apldataset != null) {
+ if (apldataset.size() > 0) {
+ AppData clientdat = (AppData) apldataset.get(0);
+ if (clientdat instanceof ApplicationData) {
+ appsGlobal = (ApplicationData) clientdat;
+ if (apldataset.size() > 1) {
+ clientdat = (AppData) apldataset.get(1);
+ if (clientdat instanceof User) {
+ usersData = (User) clientdat;
+ }
+ if (apldataset.size() > 2)
+ log.info("Ignoring additional (" + (apldataset.size() - 2)
+ + ") AppDatas returned by document appdata query.");
+ }
+ } else {
+ log.warn("Unexpected entry in AppDataReference query: id="
+ + clientdat.getVorbaId() + " type="
+ + clientdat.getClass().getName());
+ }
+ apldataset.removeAllElements(); // destroy references.
+ }
+ }
+ return new AppData[] { appsGlobal, usersData };
+ }
+
+ protected ClientDoc _getReadonly(VamsasArchiveReader vreader)
+ throws IOException, ValidationException, MarshalException {
+ valid();
+ if (vreader != null) {
+ SimpleDocBinding docb = new SimpleDocBinding();
+ docb.setVorba(this);
+ VamsasDocument d;
+ d = docb.getVamsasDocument(vreader);
+
+ if (d != null) {
+ ClientDoc creader = new ClientDoc(d, null, vreader, getClientHandle()
+ .getClientUrn(), getProvenanceUser(), getVorbaIdHash());
+ return creader;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * from SimpleClient
+ *
+ * @return user field for a provenance entry
+ */
+ protected String getProvenanceUser() {
+ return new String(getUserHandle().getFullName() + " ["
+ + getClientHandle().getClientUrn() + "]");
+ }
+
+ public ClientDoc getUpdateable() {
+ return getUpdateable(null);
+ }
+
+ public ClientDoc getUpdateable(uk.ac.vamsas.client.simpleclient.Lock lock) {
+ getVorbaIdHash().clear();
+ valid();
+ try {
+ // patiently wait for a lock on the document.
+ long tries = 5000;
+ while (lock == null
+ && ((lock = vsess.getLock()) == null || !lock.isLocked())
+ && --tries > 0) {
+ // Thread.sleep(1);
+ log.debug("Trying to get a document lock for the " + tries
+ + "'th time.");
+ }
+ VamsasArchive varc = new VamsasArchive(vsess, true, false); // read
+ // archive,
+ // write as
+ // vamsasDocument,
+ // don't erase
+ // original
+ // contents.
+ varc.setVorba(this);
+ VamsasDocument d = varc.getVamsasDocument(getProvenanceUser(),
+ "Created new document.", VersionEntries.latestVersion()); // VAMSAS:
+ // provenance
+ // user and
+ // client
+ // combined
+
+ if (d == null) {
+ log
+ .warn("Backing out from opening a VamsasArchive writable IO session");
+ varc.cancelArchive();
+ return null;
+ }
+ ClientDoc cdoc = new ClientDoc(d, varc, varc.getOriginalArchiveReader(),
+ getClientHandle().getClientUrn(), getProvenanceUser(),
+ getVorbaIdHash());
+ return cdoc;
+ // do appHandle?
+ } catch (Exception e) {
+ log.error("Failed to get Updateable version of " + vsess.getVamsasFile(),
+ e);
+ }
+ return null;
+ }
+
+ /**
+ * trust client to not do anything stupid to the document roots which will now
+ * be written to the archive.
+ *
+ * @param cdoc
+ * @return true if write was a success.
+ */
+ public boolean doUpdate(ClientDoc cdoc) {
+ valid();
+ if (cdoc == null) {
+ log
+ .warn("Invalid ClientDoc passed to uk.ac.vamsas.test.simpleclient.doUpdate()");
+ return false;
+ }
+ if (cdoc.iohandler == null) {
+ log
+ .warn("Read only ClientDoc object passed to uk.ac.vamsas.test.simpleclient.doUpdate()");
+ return false;
+ }
+ if (cdoc.iohandler.getVorba() != this) {
+ log
+ .error("Mismatch between ClientDoc instances and ArchiveClient instances!");
+ return false;
+ }
+ try {
+ // do any appDatas first.
+ if (cdoc.iohandler.transferRemainingAppDatas())
+ log.debug("Remaining appdatas were transfered.");
+ cdoc.updateDocumentRoots();
+ cdoc.iohandler.putVamsasDocument(cdoc.doc);
+ cdoc.iohandler.closeArchive();
+ this.extantids.clear();// we forget our ids after we close the document.
+ cdoc.iohandler = null;
+ cdoc = null;
+ vsess.unLock();
+ } catch (Exception e) {
+ log.warn("While updating archive in " + vsess.getVamsasFile(), e);
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * @param args
+ */
+ public static void usage() {
+ throw new Error("Usage: Username Organization VamsasFile [command,args]*");
+ }
+
+ public static void main(String[] args) {
+ // really simple.
+ if (args.length < 3)
+ usage();
+
+ ArchiveClient client = new ArchiveClient(args[0], args[1],
+ new File(args[2]));
+ ClientDoc cdoc = null;
+ // sanity test.
+ try {
+ cdoc = client.getUpdateable();
+ // ArchiveReports.reportDocument(cdoc.doc, cdoc.getReader(), true,
+ // System.out);
+ System.out.println("Report Roots :");
+ ArchiveReports.rootReport(cdoc.getVamsasRoots(), true, System.out);
+ cdoc.addVamsasRoot(Core.getDemoVamsas());
+ System.out.println("Doing update.");
+ client.doUpdate(cdoc);
+ cdoc.closeDoc();
+ cdoc = null;
+ int u = 5;
+ while (--u > 0) {
+ System.out.println("Watch for more... (" + u + " left)");
+ ClientDoc ucdoc = client.watch(0000);
+ if (ucdoc != null) {
+ System.out.println("****\nUpdate detected at " + new Date());
+ ArchiveReports.reportDocument(ucdoc.doc, ucdoc.getReader(), true,
+ System.out);
+ ucdoc.closeDoc();
+ ucdoc = null;
+ } else {
+ System.out.println("!!!! Null document update detected at "
+ + new Date());
+ }
+ }
+ } catch (Exception e) {
+ client.log.error("Broken!", e);
+ }
+ System.out.println("Finished at " + new Date());
+ }
+
+ public uk.ac.vamsas.client.Vobject getObject(VorbaId id) {
+ Hashtable idhash = this.getVorbaIdHash();
+ if (idhash != null && idhash.containsKey(id))
+ return (Vobject) idhash.get(id);
+ return null;
+ }
+}
diff --git a/src/uk/ac/vamsas/test/simpleclient/ArchiveReader.java b/src/uk/ac/vamsas/test/simpleclient/ArchiveReader.java
index 68e6ff4..a00be72 100644
--- a/src/uk/ac/vamsas/test/simpleclient/ArchiveReader.java
+++ b/src/uk/ac/vamsas/test/simpleclient/ArchiveReader.java
@@ -1,51 +1,74 @@
-package uk.ac.vamsas.test.simpleclient;
-
-import java.io.BufferedInputStream;
-import java.io.File;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-
-
-import uk.ac.vamsas.client.simpleclient.VamsasArchiveReader;
-import uk.ac.vamsas.objects.core.VAMSAS;
-import uk.ac.vamsas.objects.core.VamsasDocument;
-
-public class ArchiveReader {
- /**
- * tests VamsasArchiveReader archive reader on a vamsas jar file
- * @param args
- */
- public static void main(String args[]) {
-
- try {
- File av = new File(args[0]);
- VamsasArchiveReader var = new VamsasArchiveReader(av);
- VAMSAS roots[]=null;
- if (var.isValid()) {
- InputStreamReader vdoc = new InputStreamReader(var.getVamsasDocumentStream());
- VamsasDocument doc = VamsasDocument.unmarshal(vdoc);
- if (ArchiveReports.reportDocument(doc, var, true, System.out)) {
- roots = doc.getVAMSAS();
- }
- } else {
- InputStream vxmlis = var.getVamsasXmlStream();
-
- if (vxmlis!=null) { // Might be an old vamsas file.
- BufferedInputStream ixml = new BufferedInputStream(var.getVamsasXmlStream());
- InputStreamReader vxml = new InputStreamReader(ixml);
- VAMSAS root;
- // unmarshal seems to always close the stream (should check this)
- if ((root = VAMSAS.unmarshal(vxml))!=null) {
- System.out.println("Read a root.");
- roots = new VAMSAS[1];
- roots[0] = root;
- }
- }
- }
- if (!ArchiveReports.rootReport(roots, true, System.out))
- System.err.print(args[0]+" is not a valid vamsas archive.");
- } catch (Exception e) {
- e.printStackTrace(System.err);
- }
- }
-}
+/*
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
+ */
+package uk.ac.vamsas.test.simpleclient;
+
+import java.io.BufferedInputStream;
+import java.io.File;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+
+import uk.ac.vamsas.client.simpleclient.VamsasArchiveReader;
+import uk.ac.vamsas.objects.core.VAMSAS;
+import uk.ac.vamsas.objects.core.VamsasDocument;
+
+public class ArchiveReader {
+ /**
+ * tests VamsasArchiveReader archive reader on a vamsas jar file
+ *
+ * @param args
+ */
+ public static void main(String args[]) {
+
+ try {
+ File av = new File(args[0]);
+ VamsasArchiveReader var = new VamsasArchiveReader(av);
+ VAMSAS roots[] = null;
+ if (var.isValid()) {
+ InputStreamReader vdoc = new InputStreamReader(var
+ .getVamsasDocumentStream());
+ VamsasDocument doc = VamsasDocument.unmarshal(vdoc);
+ if (ArchiveReports.reportDocument(doc, var, true, System.out)) {
+ roots = doc.getVAMSAS();
+ }
+ } else {
+ InputStream vxmlis = var.getVamsasXmlStream();
+
+ if (vxmlis != null) { // Might be an old vamsas file.
+ BufferedInputStream ixml = new BufferedInputStream(var
+ .getVamsasXmlStream());
+ InputStreamReader vxml = new InputStreamReader(ixml);
+ VAMSAS root;
+ // unmarshal seems to always close the stream (should check this)
+ if ((root = VAMSAS.unmarshal(vxml)) != null) {
+ System.out.println("Read a root.");
+ roots = new VAMSAS[1];
+ roots[0] = root;
+ }
+ }
+ }
+ if (!ArchiveReports.rootReport(roots, true, System.out))
+ System.err.print(args[0] + " is not a valid vamsas archive.");
+ } catch (Exception e) {
+ e.printStackTrace(System.err);
+ }
+ }
+}
diff --git a/src/uk/ac/vamsas/test/simpleclient/ArchiveReports.java b/src/uk/ac/vamsas/test/simpleclient/ArchiveReports.java
index 766d6a2..83989af 100644
--- a/src/uk/ac/vamsas/test/simpleclient/ArchiveReports.java
+++ b/src/uk/ac/vamsas/test/simpleclient/ArchiveReports.java
@@ -1,214 +1,268 @@
-package uk.ac.vamsas.test.simpleclient;
-
-import java.io.InputStream;
-import java.io.PrintStream;
-import java.io.PrintWriter;
-
-
-import uk.ac.vamsas.client.ClientDocument;
-import uk.ac.vamsas.client.Vobject;
-import uk.ac.vamsas.client.simpleclient.VamsasArchiveReader;
-import uk.ac.vamsas.objects.core.Alignment;
-import uk.ac.vamsas.objects.core.AppData;
-import uk.ac.vamsas.objects.core.ApplicationData;
-import uk.ac.vamsas.objects.core.DataSet;
-import uk.ac.vamsas.objects.core.Entry;
-import uk.ac.vamsas.objects.core.Instance;
-import uk.ac.vamsas.objects.core.Provenance;
-import uk.ac.vamsas.objects.core.Tree;
-import uk.ac.vamsas.objects.core.User;
-import uk.ac.vamsas.objects.core.VAMSAS;
-import uk.ac.vamsas.objects.core.VamsasDocument;
-/**
- * this class contains static methods for writing info to stdout about a vamsas document
- * Methods have a 'cascade' switch to indicate if sub-objects should have info printed on them.
- * Methods return true or false - indicating if the Vobject was valid or not
- * TODO: LATER: propagate true/false return so that an invalid vamsas Vobject invalidates the whole document
- * @author jimp
- *
- */
-public class ArchiveReports {
- /**
- * print an informative summary on a VamsasDocument
- * @param outstr TODO
- * @param document - the document itself
- * @param archive - document source archive for resolving any appData refs
- * @return
- */
- public static boolean reportProvenance(Provenance p, PrintStream outstr) {
- if (p==null) {
- outstr.println("No Provenance");
- return false;
- }
- Entry[] pe = p.getEntry();
- for (int i=0; i1) {
- outstr.print("a reference ("+appData+")");
- InputStream jstrm;
- if ((jstrm=archive.getAppdataStream(appData))!=null)
- outstr.println(" which resolves to a JarEntry.");
- else {
- outstr.println(" which does not resolve to a JarEntry.");
- outstr.println("Unresolved appdata reference '"+appData+"'");
- }
- } else {
- nulldata=true;
- }
- } else {
- if (appD.getData()==null)
- nulldata &= true;
- else
- outstr.println("an embedded chunk of "+appD.getData().length+" bytes.");
- }
- if (nulldata)
- outstr.println("Null AppData reference/data chunk.");
- }
- return true;
- }
-
- public static boolean appDataReport(ApplicationData appD, VamsasArchiveReader archive, boolean cascade, PrintStream outstr) {
- if (appD!=null) {
- // Report on root appData
- appDataEntryReport(appD, archive, cascade, outstr);
- if (appD.getInstanceCount()>0) {
- Instance inst[] = appD.getInstance();
- for (int i=0,j=inst.hashCode(); i0) {
- User users[] = appD.getUser();
- for (int i=0,j=users.length; i0 && cascade)
- rootReport(document.getVAMSAS(), true, outstr);
- if (document.getApplicationDataCount()>0) {
- outstr.print("There are "+document.getApplicationDataCount()+" ApplicationData references.\n");
- ApplicationData appd[] = document.getApplicationData();
- for (int i=0,j=appd.length; i")
- +") contains "+(ds=r.getDataSetCount())+" DataSets, "
- + (tr=r.getTreeCount())+" Global trees\n");
- outputVobjectState(r, outstr);
- if (cascade) {
- for (int j=0; j0) {
- for (int i=0; i.
+ */
+package uk.ac.vamsas.test.simpleclient;
+
+import java.io.InputStream;
+import java.io.PrintStream;
+import java.io.PrintWriter;
+
+import uk.ac.vamsas.client.ClientDocument;
+import uk.ac.vamsas.client.Vobject;
+import uk.ac.vamsas.client.simpleclient.VamsasArchiveReader;
+import uk.ac.vamsas.objects.core.Alignment;
+import uk.ac.vamsas.objects.core.AppData;
+import uk.ac.vamsas.objects.core.ApplicationData;
+import uk.ac.vamsas.objects.core.DataSet;
+import uk.ac.vamsas.objects.core.Entry;
+import uk.ac.vamsas.objects.core.Instance;
+import uk.ac.vamsas.objects.core.Provenance;
+import uk.ac.vamsas.objects.core.Tree;
+import uk.ac.vamsas.objects.core.User;
+import uk.ac.vamsas.objects.core.VAMSAS;
+import uk.ac.vamsas.objects.core.VamsasDocument;
+
+/**
+ * this class contains static methods for writing info to stdout about a vamsas
+ * document Methods have a 'cascade' switch to indicate if sub-objects should
+ * have info printed on them. Methods return true or false - indicating if the
+ * Vobject was valid or not TODO: LATER: propagate true/false return so that an
+ * invalid vamsas Vobject invalidates the whole document
+ *
+ * @author jimp
+ *
+ */
+public class ArchiveReports {
+ /**
+ * print an informative summary on a VamsasDocument
+ *
+ * @param outstr
+ * TODO
+ * @param document
+ * - the document itself
+ * @param archive
+ * - document source archive for resolving any appData refs
+ * @return
+ */
+ public static boolean reportProvenance(Provenance p, PrintStream outstr) {
+ if (p == null) {
+ outstr.println("No Provenance");
+ return false;
+ }
+ Entry[] pe = p.getEntry();
+ for (int i = 0; i < pe.length; i++) {
+ outstr.print(pe[i].getDate() + "\t'" + pe[i].getUser() + "'\t"
+ + pe[i].getApp() + "\t'" + pe[i].getAction() + "' ");
+ outputVobjectState(pe[i], outstr);
+ }
+ return true;
+ }
+
+ public static boolean appDataEntryReport(AppData appD,
+ VamsasArchiveReader archive, boolean cascade, PrintStream outstr) {
+ if (appD != null) {
+ boolean nulldata = false;
+ if (appD.getDataReference() != null) {
+ String appData = appD.getDataReference();
+ if (appData == null) {
+ outstr.println("Empty DataReference - not valid ?");
+ } else if (appData.length() > 1) {
+ outstr.print("a reference (" + appData + ")");
+ InputStream jstrm;
+ if ((jstrm = archive.getAppdataStream(appData)) != null)
+ outstr.println(" which resolves to a JarEntry.");
+ else {
+ outstr.println(" which does not resolve to a JarEntry.");
+ outstr.println("Unresolved appdata reference '" + appData + "'");
+ }
+ } else {
+ nulldata = true;
+ }
+ } else {
+ if (appD.getData() == null)
+ nulldata &= true;
+ else
+ outstr.println("an embedded chunk of " + appD.getData().length
+ + " bytes.");
+ }
+ if (nulldata)
+ outstr.println("Null AppData reference/data chunk.");
+ }
+ return true;
+ }
+
+ public static boolean appDataReport(ApplicationData appD,
+ VamsasArchiveReader archive, boolean cascade, PrintStream outstr) {
+ if (appD != null) {
+ // Report on root appData
+ appDataEntryReport(appD, archive, cascade, outstr);
+ if (appD.getInstanceCount() > 0) {
+ Instance inst[] = appD.getInstance();
+ for (int i = 0, j = inst.hashCode(); i < j; i++) {
+ outstr.println("Data for App Instance URN: '" + inst[i].getUrn());
+ appDataEntryReport(inst[i], archive, cascade, outstr);
+ }
+ }
+ if (appD.getUserCount() > 0) {
+ User users[] = appD.getUser();
+ for (int i = 0, j = users.length; i < j; i++) {
+ outstr.println("Data for User '" + users[i].getFullname() + "' of '"
+ + users[i].getOrganization() + "'");
+ appDataEntryReport(users[i], archive, cascade, outstr);
+ }
+ }
+ }
+
+ return true;
+ }
+
+ public static boolean reportDocument(VamsasDocument document,
+ VamsasArchiveReader archive, boolean cascade, PrintStream outstr) {
+ if (document != null) {
+ outstr.println("Vamsas Document version '" + document.getVersion() + "'");
+ reportProvenance(document.getProvenance(), outstr);
+ outstr.print("Document contains " + document.getVAMSASCount()
+ + " VAMSAS Elements and " + document.getApplicationDataCount()
+ + " Application data elements.\n");
+ if (document.getVAMSASCount() > 0 && cascade)
+ rootReport(document.getVAMSAS(), true, outstr);
+ if (document.getApplicationDataCount() > 0) {
+ outstr.print("There are " + document.getApplicationDataCount()
+ + " ApplicationData references.\n");
+ ApplicationData appd[] = document.getApplicationData();
+ for (int i = 0, j = appd.length; i < j; i++) {
+ outstr.print("Application " + i + ": '" + appd[i].getName()
+ + "'\nVersion '" + appd[i].getVersion() + "'\n");
+ outstr.print("AppData is :");
+ appDataReport(appd[i], archive, cascade, outstr);
+ }
+
+ }
+ return true;
+ } else {
+ outstr.println("Document Object is null");
+ }
+ return false;
+ }
+
+ /**
+ * summarises all the datasets in a vamsas document.
+ *
+ * @param roots
+ * @param cascade
+ * TODO
+ * @param outstr
+ * TODO
+ * @return
+ */
+ public static boolean rootReport(VAMSAS[] roots, boolean cascade,
+ PrintStream outstr) {
+ if (roots != null) {
+ for (int i = 0; i < roots.length; i++) {
+ VAMSAS r = roots[i];
+ int ds, tr;
+ outstr.print("Vamsas Root " + i + " (id="
+ + ((r.getId() != null) ? r.getId() : "") + ") contains "
+ + (ds = r.getDataSetCount()) + " DataSets, "
+ + (tr = r.getTreeCount()) + " Global trees\n");
+ outputVobjectState(r, outstr);
+ if (cascade) {
+ for (int j = 0; j < ds; j++) {
+ outstr.println("Dataset " + j);
+ cascade = datasetReport(r.getDataSet(j), true, outstr) && cascade;
+ }
+ for (int j = 0; j < tr; j++) {
+ outstr.println("Global tree " + j);
+ cascade = treeReport(r.getTree(j), true, outstr) && cascade;
+ }
+ }
+ }
+ return true;
+ }
+ return false;
+ }
+
+ public static void outputVobjectState(Vobject v, PrintStream outstr) {
+ outstr.print(" (Object is: ");
+ boolean comma = false;
+ if (v.is__stored_in_document()) {
+ outstr.print(" stored");
+ comma = true;
+ }
+ if (v.isNewInDocument()) {
+ if (comma)
+ outstr.print(",");
+ comma = true;
+ outstr.print(" new in document");
+ }
+ if (v.isUpdated()) {
+ if (comma)
+ outstr.print(",");
+ comma = true;
+ outstr.print(" updated since last read");
+ }
+ outstr.println(")");
+ }
+
+ public static boolean datasetReport(DataSet ds, boolean cascade,
+ PrintStream outstr) {
+ if (cascade)
+ reportProvenance(ds.getProvenance(), outstr);
+ outputVobjectState(ds, outstr);
+ outstr.println("Dataset contains : " + ds.getSequenceCount()
+ + " sequences, " + ds.getAlignmentCount() + " alignments and "
+ + ds.getTreeCount() + " trees.");
+ if (cascade)
+ alignmentReport(ds.getAlignment(), true, outstr);
+ return true;
+ }
+
+ public static boolean alignmentReport(Alignment[] al, boolean cascade,
+ PrintStream outstr) {
+ boolean val = true;
+ if (al != null && al.length > 0) {
+ for (int i = 0; i < al.length; i++) {
+ outstr.println("Alignment "
+ + i
+ + (al[i].isRegistered() ? " (" + al[i].getVorbaId() + ")"
+ : " (unregistered)"));
+ outputVobjectState(al[i], outstr);
+ if (cascade)
+ reportProvenance(al[i].getProvenance(), outstr);
+ outstr.println("Involves " + al[i].getAlignmentSequenceCount()
+ + " sequences, has " + al[i].getAlignmentAnnotationCount()
+ + " annotations and " + al[i].getTreeCount() + " trees.");
+ if (cascade) {
+ for (int t = 0; t < al[i].getTreeCount(); t++)
+ treeReport(al[i].getTree(t), true, outstr);
+ }
+ }
+ }
+ return val;
+ }
+
+ public static boolean treeReport(Tree t, boolean cascade, PrintStream outstr) {
+ outstr.print("Tree: '" + t.getTitle() + "' ");
+ outputVobjectState(t, outstr);
+ return !cascade || reportProvenance(t.getProvenance(), outstr);
+ }
+
+}
diff --git a/src/uk/ac/vamsas/test/simpleclient/ArchiveStreamReader.java b/src/uk/ac/vamsas/test/simpleclient/ArchiveStreamReader.java
index d3fe14f..ff96afc 100644
--- a/src/uk/ac/vamsas/test/simpleclient/ArchiveStreamReader.java
+++ b/src/uk/ac/vamsas/test/simpleclient/ArchiveStreamReader.java
@@ -1,53 +1,77 @@
-package uk.ac.vamsas.test.simpleclient;
-
-import java.io.BufferedInputStream;
-import java.io.File;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-
-
-import uk.ac.vamsas.client.simpleclient.SessionFile;
-import uk.ac.vamsas.client.simpleclient.VamsasArchiveReader;
-import uk.ac.vamsas.client.simpleclient.VamsasFile;
-import uk.ac.vamsas.objects.core.VAMSAS;
-import uk.ac.vamsas.objects.core.VamsasDocument;
-
-public class ArchiveStreamReader {
- /**
- * tests VamsasArchiveReader archive reader on a vamsas jar file opened as a stream
- * @param args
- */
- public static void main(String args[]) {
-
- try {
- VamsasFile av = new VamsasFile(new File(args[0]));
- VamsasArchiveReader var = new VamsasArchiveReader(av.getLock());
- VAMSAS roots[]=null;
- if (var.isValid()) {
- InputStreamReader vdoc = new InputStreamReader(var.getVamsasDocumentStream());
- VamsasDocument doc = VamsasDocument.unmarshal(vdoc);
- if (ArchiveReports.reportDocument(doc, var, true, System.out)) {
- roots = doc.getVAMSAS();
- }
- } else {
- InputStream vxmlis = var.getVamsasXmlStream();
-
- if (vxmlis!=null) { // Might be an old vamsas file.
- BufferedInputStream ixml = new BufferedInputStream(var.getVamsasXmlStream());
- InputStreamReader vxml = new InputStreamReader(ixml);
- VAMSAS root;
- // unmarshal seems to always close the stream (should check this)
- if ((root = VAMSAS.unmarshal(vxml))!=null) {
- System.out.println("Read a root.");
- roots = new VAMSAS[1];
- roots[0] = root;
- }
- }
- }
- if (!ArchiveReports.rootReport(roots, true, System.out))
- System.err.print(args[0]+" is not a valid vamsas archive.");
- } catch (Exception e) {
- e.printStackTrace(System.err);
- }
- }
-}
+/*
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
+ */
+package uk.ac.vamsas.test.simpleclient;
+
+import java.io.BufferedInputStream;
+import java.io.File;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+
+import uk.ac.vamsas.client.simpleclient.SessionFile;
+import uk.ac.vamsas.client.simpleclient.VamsasArchiveReader;
+import uk.ac.vamsas.client.simpleclient.VamsasFile;
+import uk.ac.vamsas.objects.core.VAMSAS;
+import uk.ac.vamsas.objects.core.VamsasDocument;
+
+public class ArchiveStreamReader {
+ /**
+ * tests VamsasArchiveReader archive reader on a vamsas jar file opened as a
+ * stream
+ *
+ * @param args
+ */
+ public static void main(String args[]) {
+
+ try {
+ VamsasFile av = new VamsasFile(new File(args[0]));
+ VamsasArchiveReader var = new VamsasArchiveReader(av.getLock());
+ VAMSAS roots[] = null;
+ if (var.isValid()) {
+ InputStreamReader vdoc = new InputStreamReader(var
+ .getVamsasDocumentStream());
+ VamsasDocument doc = VamsasDocument.unmarshal(vdoc);
+ if (ArchiveReports.reportDocument(doc, var, true, System.out)) {
+ roots = doc.getVAMSAS();
+ }
+ } else {
+ InputStream vxmlis = var.getVamsasXmlStream();
+
+ if (vxmlis != null) { // Might be an old vamsas file.
+ BufferedInputStream ixml = new BufferedInputStream(var
+ .getVamsasXmlStream());
+ InputStreamReader vxml = new InputStreamReader(ixml);
+ VAMSAS root;
+ // unmarshal seems to always close the stream (should check this)
+ if ((root = VAMSAS.unmarshal(vxml)) != null) {
+ System.out.println("Read a root.");
+ roots = new VAMSAS[1];
+ roots[0] = root;
+ }
+ }
+ }
+ if (!ArchiveReports.rootReport(roots, true, System.out))
+ System.err.print(args[0] + " is not a valid vamsas archive.");
+ } catch (Exception e) {
+ e.printStackTrace(System.err);
+ }
+ }
+}
diff --git a/src/uk/ac/vamsas/test/simpleclient/ArchiveWatcher.java b/src/uk/ac/vamsas/test/simpleclient/ArchiveWatcher.java
index d784a8e..e0d2f9f 100644
--- a/src/uk/ac/vamsas/test/simpleclient/ArchiveWatcher.java
+++ b/src/uk/ac/vamsas/test/simpleclient/ArchiveWatcher.java
@@ -1,106 +1,140 @@
-package uk.ac.vamsas.test.simpleclient;
-
-import java.io.File;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import uk.ac.vamsas.client.ClientHandle;
-import uk.ac.vamsas.client.simpleclient.FileWatcher;
-import uk.ac.vamsas.client.simpleclient.Lock;
-import uk.ac.vamsas.client.simpleclient.SimpleDocument;
-import uk.ac.vamsas.client.simpleclient.VamsasArchiveReader;
-import uk.ac.vamsas.client.simpleclient.VamsasFile;
-import uk.ac.vamsas.objects.core.VamsasDocument;
-/**
- * demo of archive watching process - should mimic the clientsfileTest watcher/monitor process.
- * @author jimp
- *
- */
-public class ArchiveWatcher {
- private static Log log = LogFactory.getLog(ArchiveWatcher.class);
- private static CommandProcessor cproc=new CommandProcessor();
- static {
- cproc.addCommand("new", 0, "no args");
- cproc.addCommand("delete", 0, "no args");
- cproc.addCommand("watch", 0, "no args");
- cproc.addCommand("file", 1, "Need vamsas archive as argument.");
- }
-
- public static void main(String[] args) {
- try {
-
- if (args!=null && args.length>0) {
- File archive = new File(args[0]);
- log.info("Watching file "+args[0]);
- int argc=1;
- while (argc < args.length) {
- // vars needed for operations
- ClientHandle ch;
- int com = cproc.getCommand(args, argc);
- argc++;
- switch (com) {
- case 0:
- // new
- log.info("Doing locked deletion and new-file creation.");
- {
- if (!archive.exists())
- archive.createNewFile();
- VamsasFile sf = new VamsasFile(archive);
- Lock l = sf.getLock();
- archive.delete();
- archive.createNewFile();
- sf.unLock();
- }
- break;
- case 1:
- // delete
- log.info("Deleting "+archive+" without locking it first.");
- archive.delete();
- break;
- case 2:
- // watch
- log.info("Endlessly Watching file "+archive);
- /* if (!archive.exists())
- archive.createNewFile();
- */ // watch the new file... - taken straight from ClientsFileTest
- FileWatcher w = new FileWatcher(archive);
- while (true) {
- // get watcher's lock to ensure state change is fixed for retrieval
- Lock chlock = w.getChangedState();
- if (chlock != null) {
- log.info("Got lock on "+archive+(archive.exists() ? " exists l="+archive.length() : "(non existant)"));
- if (archive.length()>0) {
- VamsasArchiveReader vreader = new VamsasArchiveReader(archive);
- SimpleDocument sdoc = new SimpleDocument("testing vamsas watcher");
- try {
- VamsasDocument d = sdoc.getVamsasDocument(vreader);
- if (d!=null) {
- ArchiveReports.reportDocument(d, vreader, false, System.out);
- }
- System.out.println("Update at "+System.currentTimeMillis()+"\n\n********************************************************\n");
- } catch (Exception e) {
- log.error("Unmarshalling failed.",e);
- }
- vreader.close();
- w.setState();
- }
- }
- }
- // break;
- case 3: // set file
- archive = new File(args[argc++]);
- break;
- case 4:
- break;
- default:
- log.warn("Unknown command + "+args[argc++]);
- }
- }
- }
- } catch (Exception e) {
- log.error(e);
- }
-
- }
-}
+/*
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
+ */
+package uk.ac.vamsas.test.simpleclient;
+
+import java.io.File;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import uk.ac.vamsas.client.ClientHandle;
+import uk.ac.vamsas.client.simpleclient.FileWatcher;
+import uk.ac.vamsas.client.simpleclient.Lock;
+import uk.ac.vamsas.client.simpleclient.SimpleDocument;
+import uk.ac.vamsas.client.simpleclient.VamsasArchiveReader;
+import uk.ac.vamsas.client.simpleclient.VamsasFile;
+import uk.ac.vamsas.objects.core.VamsasDocument;
+
+/**
+ * demo of archive watching process - should mimic the clientsfileTest
+ * watcher/monitor process.
+ *
+ * @author jimp
+ *
+ */
+public class ArchiveWatcher {
+ private static Log log = LogFactory.getLog(ArchiveWatcher.class);
+
+ private static CommandProcessor cproc = new CommandProcessor();
+ static {
+ cproc.addCommand("new", 0, "no args");
+ cproc.addCommand("delete", 0, "no args");
+ cproc.addCommand("watch", 0, "no args");
+ cproc.addCommand("file", 1, "Need vamsas archive as argument.");
+ }
+
+ public static void main(String[] args) {
+ try {
+
+ if (args != null && args.length > 0) {
+ File archive = new File(args[0]);
+ log.info("Watching file " + args[0]);
+ int argc = 1;
+ while (argc < args.length) {
+ // vars needed for operations
+ ClientHandle ch;
+ int com = cproc.getCommand(args, argc);
+ argc++;
+ switch (com) {
+ case 0:
+ // new
+ log.info("Doing locked deletion and new-file creation.");
+ {
+ if (!archive.exists())
+ archive.createNewFile();
+ VamsasFile sf = new VamsasFile(archive);
+ Lock l = sf.getLock();
+ archive.delete();
+ archive.createNewFile();
+ sf.unLock();
+ }
+ break;
+ case 1:
+ // delete
+ log.info("Deleting " + archive + " without locking it first.");
+ archive.delete();
+ break;
+ case 2:
+ // watch
+ log.info("Endlessly Watching file " + archive);
+ /*
+ * if (!archive.exists()) archive.createNewFile();
+ */// watch the new file... - taken straight from ClientsFileTest
+ FileWatcher w = new FileWatcher(archive);
+ while (true) {
+ // get watcher's lock to ensure state change is fixed for
+ // retrieval
+ Lock chlock = w.getChangedState();
+ if (chlock != null) {
+ log.info("Got lock on "
+ + archive
+ + (archive.exists() ? " exists l=" + archive.length()
+ : "(non existant)"));
+ if (archive.length() > 0) {
+ VamsasArchiveReader vreader = new VamsasArchiveReader(archive);
+ SimpleDocument sdoc = new SimpleDocument(
+ "testing vamsas watcher");
+ try {
+ VamsasDocument d = sdoc.getVamsasDocument(vreader);
+ if (d != null) {
+ ArchiveReports.reportDocument(d, vreader, false,
+ System.out);
+ }
+ System.out
+ .println("Update at "
+ + System.currentTimeMillis()
+ + "\n\n********************************************************\n");
+ } catch (Exception e) {
+ log.error("Unmarshalling failed.", e);
+ }
+ vreader.close();
+ w.setState();
+ }
+ }
+ }
+ // break;
+ case 3: // set file
+ archive = new File(args[argc++]);
+ break;
+ case 4:
+ break;
+ default:
+ log.warn("Unknown command + " + args[argc++]);
+ }
+ }
+ }
+ } catch (Exception e) {
+ log.error(e);
+ }
+
+ }
+}
diff --git a/src/uk/ac/vamsas/test/simpleclient/ArchiveWriter.java b/src/uk/ac/vamsas/test/simpleclient/ArchiveWriter.java
index f156b74..de56816 100644
--- a/src/uk/ac/vamsas/test/simpleclient/ArchiveWriter.java
+++ b/src/uk/ac/vamsas/test/simpleclient/ArchiveWriter.java
@@ -1,180 +1,234 @@
-package uk.ac.vamsas.test.simpleclient;
-
-import java.io.File;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.PrintWriter;
-import java.text.DateFormat;
-import java.util.Date;
-import java.util.Hashtable;
-import java.util.Vector;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import uk.ac.vamsas.objects.core.Alignment;
-import uk.ac.vamsas.objects.core.ApplicationData;
-import uk.ac.vamsas.objects.core.Entry;
-import uk.ac.vamsas.objects.core.Instance;
-import uk.ac.vamsas.objects.core.Provenance;
-import uk.ac.vamsas.objects.core.VAMSAS;
-import uk.ac.vamsas.objects.core.VamsasDocument;
-import uk.ac.vamsas.objects.utils.ProvenanceStuff;
-import uk.ac.vamsas.client.simpleclient.VamsasArchive;
-import uk.ac.vamsas.client.simpleclient.VamsasArchiveReader;
-
-public class ArchiveWriter {
-
- /**
- * Test program for writing archive files.
- * form is ArchiveWriter new/modified argive command list
- */
-
- static Log log = LogFactory.getLog(ArchiveWriter.class);
-
- private static void mergeVecs(Object[] destvec, Object[] svec1, Object[] svec2) {
- int i;
- for (i=0; i0) {
- ApplicationData[] newdat = new ApplicationData[source.getApplicationDataCount()+dest.getApplicationDataCount()];
- ApplicationData[] sappd = source.getApplicationData();
- // check refs and update/modify if necessary
- for (int i=0; i [(commands)]");
- return;
- }
- File newarch = new File(argv[0]);
- int argpos = 0;
- try {
- // test fully fledged doc construction
- VamsasArchive varc = new VamsasArchive(newarch, true);
- VamsasDocument docroot;
- docroot = new VamsasDocument();
- docroot.setProvenance(ProvenanceStuff.newProvenance("ArchiveWriter", "user", "Created new Vamsas Document"));
- while (++argpos.
+ */
+package uk.ac.vamsas.test.simpleclient;
+
+import java.io.File;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.PrintWriter;
+import java.text.DateFormat;
+import java.util.Date;
+import java.util.Hashtable;
+import java.util.Vector;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import uk.ac.vamsas.objects.core.Alignment;
+import uk.ac.vamsas.objects.core.ApplicationData;
+import uk.ac.vamsas.objects.core.Entry;
+import uk.ac.vamsas.objects.core.Instance;
+import uk.ac.vamsas.objects.core.Provenance;
+import uk.ac.vamsas.objects.core.VAMSAS;
+import uk.ac.vamsas.objects.core.VamsasDocument;
+import uk.ac.vamsas.objects.utils.ProvenanceStuff;
+import uk.ac.vamsas.client.simpleclient.VamsasArchive;
+import uk.ac.vamsas.client.simpleclient.VamsasArchiveReader;
+
+public class ArchiveWriter {
+
+ /**
+ * Test program for writing archive files. form is ArchiveWriter new/modified
+ * argive command list
+ */
+
+ static Log log = LogFactory.getLog(ArchiveWriter.class);
+
+ private static void mergeVecs(Object[] destvec, Object[] svec1, Object[] svec2) {
+ int i;
+ for (i = 0; i < svec1.length; i++)
+ destvec[i] = svec1[i];
+ for (int j = 0; j < svec2.length; i++, j++)
+ destvec[i] = svec2[j];
+ }
+
+ // Merge appDataReferences require transfer of jar entries, perhaps with a
+ // renaming of the entry.
+ // Merge appDatas require eventually unique URNS
+ // TODO: merging global appdata from different documents where same app has
+ // written them causes conflict
+
+ public static Hashtable hashOfAppDatas(Hashtable ht, Instance[] appdatas) {
+ if (ht == null)
+ ht = new Hashtable();
+ for (int i = 0, j = appdatas.length; i < j; i++) {
+ if (!ht.containsKey(appdatas[i].getUrn())) {
+ Hashtable aphash = new Hashtable();
+ ht.put(appdatas[i].getUrn(), aphash);
+ aphash.put(appdatas[i], appdatas[i].getDataReference());
+ } else {
+ // ensure urns and references are unique
+
+ }
+
+ }
+ return ht;
+ }
+
+ /**
+ * safely copies an appData from one archive to another.
+ *
+ * @param darc
+ * destination archive
+ * @param dest
+ * destination document Vobject
+ * @param sarc
+ * source archive reader
+ * @param entry
+ * application data to be copied from source archive
+ */
+ public static void addAppDataEntry(VamsasArchive darc, VamsasDocument dest,
+ VamsasArchiveReader sarc, ApplicationData entry) {
+ // TODO: fix instances
+ // check uniqueness of instance's[] entry.urn amongst
+ // dest.ApplicationData[].getInstances[].urn
+ // check uniqueness of entry.user[].urn amongst
+ // dest.ApplicationData[].user[].urn
+ // check uniqueness of entry.user
+ // entry.getAppDataChoice().getData() or getDataReference is unique
+ ApplicationData newo = new ApplicationData();
+ for (int i = 0, j = dest.getApplicationDataCount(); i < j; i++) {
+ ApplicationData o = dest.getApplicationData()[i];
+ // ensure new urn is really unique
+ // String urn = entry.getUrn();
+ int v = 1;
+ // while (o.getUrn().equals(urn)) {
+ // urn = entry.getUrn()+v++;
+ // }
+ // uniqueness of urn
+ // check each user ApplicationData
+ // uniqueness (again)
+ // copy over valid objects
+ //
+ }
+ }
+
+ /**
+ * Copy new datasets and appdatas from one vamsas document to another.
+ *
+ * @param darc
+ * @param dest
+ * @param sarc
+ * @param source
+ * @return true if merge was successful.
+ */
+ public static boolean mergeDocs(VamsasArchive darc, VamsasDocument dest,
+ VamsasArchiveReader sarc, VamsasDocument source) {
+ log.debug("mergeDocs entered.");
+ // search for appDatas in cdoc
+ VAMSAS[] newr = new VAMSAS[dest.getVAMSASCount() + source.getVAMSASCount()];
+ mergeVecs(newr, dest.getVAMSAS(), source.getVAMSAS());
+ dest.setVAMSAS(newr);
+ /**
+ * TODO: LATER: should verify that all ids really are unique in newly merged
+ * document. If not then what ? investigate possibility of having an id
+ * translation between appDatas and the core document - the mapping is
+ * stored when an external application performs a merge, but when the owning
+ * Application accesses the Vobject, the vorba_id is updated to the new one
+ * when it writes its references in to its appdata again
+ */
+ if (source.getApplicationDataCount() > 0) {
+ ApplicationData[] newdat = new ApplicationData[source
+ .getApplicationDataCount()
+ + dest.getApplicationDataCount()];
+ ApplicationData[] sappd = source.getApplicationData();
+ // check refs and update/modify if necessary
+ for (int i = 0; i < sappd.length; i++) {
+ addAppDataEntry(darc, dest, sarc, sappd[i]);
+ }
+
+ }
+
+ return true; // success
+ }
+
+ private static CommandProcessor cproc;
+ static {
+ cproc.addCommand("new", 0, "no args");
+ cproc.addCommand("add", 1,
+ "Need another vamsas document archive filename as argument.");
+ cproc.addCommand("repair", 0, "no args");
+ cproc.addCommand("list", 0, "no args");
+ cproc.addCommand("monitor", 0, "no args");
+ }
+
+ public static void main(String argv[]) {
+ /**
+ * TODO: switches for setting user identities for writing to vamsas document
+ */
+ if (argv.length < 1) {
+ log.fatal("Usage : [(commands)]");
+ return;
+ }
+ File newarch = new File(argv[0]);
+ int argpos = 0;
+ try {
+ // test fully fledged doc construction
+ VamsasArchive varc = new VamsasArchive(newarch, true);
+ VamsasDocument docroot;
+ docroot = new VamsasDocument();
+ docroot.setProvenance(ProvenanceStuff.newProvenance("ArchiveWriter",
+ "user", "Created new Vamsas Document"));
+ while (++argpos < argv.length) {
+ File archive = new File(argv[argpos]);
+ InputStream istream;
+ if (archive.exists()) {
+ VamsasArchiveReader vdoc = new VamsasArchiveReader(archive);
+ if (vdoc.isValid()) {
+ istream = vdoc.getVamsasDocumentStream();
+ if (istream != null) {
+ VamsasDocument cdocroot = VamsasDocument
+ .unmarshal(new InputStreamReader(istream));
+ if (cdocroot != null)
+ mergeDocs(varc, docroot, vdoc, cdocroot);
+ } else
+ log
+ .warn("Unexpectedly null document stream from existing document "
+ + archive);
+ } else {
+ // updating an oldformat stream ?
+ if ((istream = vdoc.getVamsasXmlStream()) != null) {
+ // make a new vamsas document from the vamsas.xml entry
+ VAMSAS root = VAMSAS.unmarshal(new InputStreamReader(istream)); // TODO:
+ // verify
+ // only
+ // one
+ // VAMSAS
+ // element
+ // per
+ // vamsas.xml
+ // entry.
+ docroot.getProvenance().addEntry(
+ ProvenanceStuff.newProvenanceEntry("ArchiveWriter", "user",
+ "added vamsas.xml from " + argv[argpos - 1]));
+ docroot.addVAMSAS(root);
+ }
+ }
+ } else {
+ // Begin a new vamsas document
+ PrintWriter docwriter = varc.getDocumentOutputStream();
+ }
+ }
+ } catch (Exception e) {
+ log.error("Whilst manipulating " + argv[0], e);
+ }
+ }
+}
diff --git a/src/uk/ac/vamsas/test/simpleclient/ClientDoc.java b/src/uk/ac/vamsas/test/simpleclient/ClientDoc.java
index 990d58a..0772cb3 100644
--- a/src/uk/ac/vamsas/test/simpleclient/ClientDoc.java
+++ b/src/uk/ac/vamsas/test/simpleclient/ClientDoc.java
@@ -1,356 +1,434 @@
-package uk.ac.vamsas.test.simpleclient;
-
-import java.util.Hashtable;
-import java.util.Vector;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import uk.ac.vamsas.client.IClientAppdata;
-import uk.ac.vamsas.client.Vobject;
-import uk.ac.vamsas.client.VorbaId;
-import uk.ac.vamsas.client.simpleclient.ClientDocument;
-import uk.ac.vamsas.client.simpleclient.VamsasArchive;
-import uk.ac.vamsas.client.simpleclient.VamsasArchiveReader;
-import uk.ac.vamsas.objects.core.Entry;
-import uk.ac.vamsas.objects.core.VAMSAS;
-import uk.ac.vamsas.objects.core.VamsasDocument;
-import uk.ac.vamsas.objects.utils.ProvenanceStuff;
-
-// simple holder to pass to client.
-public class ClientDoc extends uk.ac.vamsas.client.ClientDocument {
- /* (non-Javadoc)
- * @see uk.ac.vamsas.client.IClientDocument#getClientAppdata()
- */
- public IClientAppdata getClientAppdata() {
- throw new Error("Appdata access is not implemented in the test.simpleclient.ClientDoc instance."); // TODO Auto-generated method stub
- }
- protected boolean isModified=false;
- private Log log = LogFactory.getLog(ClientDoc.class);
- protected VamsasDocument doc;
- public uk.ac.vamsas.objects.core.VAMSAS[] _VamsasRoots;
- protected VamsasArchive iohandler=null;
- protected VamsasArchiveReader reader=null;
- private String user=null;
- private String app=null;
-
- /**
- * @param doc
- * @param iohandler
- * @param reader
- * @param app
- * @param user
- */
- public ClientDoc(VamsasDocument doc, VamsasArchive iohandler, VamsasArchiveReader reader, String app, String user, Hashtable objrefs) {
- super(objrefs, (iohandler!=null) ? iohandler.getVorba() : null);
- this.doc = doc;
- this.iohandler = iohandler;
- this.reader = reader;
- this.app = app;
- this.user = user;
- this.objrefs = objrefs;
- _VamsasRoots = doc.getVAMSAS();
- }
- // AppDataOutputStream appd;
- //AppDataOutputStream userd;
- /* (non-Javadoc)
- * @see java.lang.Object#finalize()
- */
- protected Entry getProvenanceEntry(String action) {
- // VAMSAS: modify schema to allow referencing of user field (plus other issues, ClientUrn field, machine readable action, input parameters, additional data generated notes
- Entry prov = ProvenanceStuff.newProvenanceEntry(app, user, action);
- return prov;
- }
- public VAMSAS[] getVamsasRoots() {
- if (doc==null) {
- log.debug("Null document for getVamsasRoots(), returning null");
- return null;
- }
- if (iohandler==null) {
- // LATER: decide on read-only status of ClientDocument object
- log.warn("getVamsasRoots() called on possibly read-only document.");
- }
- if (_VamsasRoots!=null)
- return _VamsasRoots;
- VAMSAS[] roots = doc.getVAMSAS();
- if (roots == null) {
- // Make a new one to return to client to get filled.
- _VamsasRoots = new VAMSAS[] { new VAMSAS() };
- // Do provenance now. just in case.
- doc.getProvenance().addEntry(getProvenanceEntry("Created new document root [id="+_VamsasRoots[0].getId()+"]"));
- doc.addVAMSAS(_VamsasRoots[0]);
- } else {
- _VamsasRoots = new VAMSAS[roots.length];
- for (int r=0;r-1) {
- if (isValidUpdate(newr[k], original[i])) {
- modified=true;
- rts.add(newr[k]);
- newr[k]=null;
- } else {
- // LATER: try harder to merge ducument roots.
- log.warn("Couldn't merge new VAMSAS root "+newr[k].getId());
- newr[k] = null; // LATER: this means we ignore mangled roots. NOT GOOD
- }
- } else {
- // add in order.
- rts.add(original[i]);
- }
- }
- // add remaining (new) roots
- for (int i=0,j=newr.length; i.
+ */
+package uk.ac.vamsas.test.simpleclient;
+
+import java.util.Hashtable;
+import java.util.Vector;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import uk.ac.vamsas.client.IClientAppdata;
+import uk.ac.vamsas.client.Vobject;
+import uk.ac.vamsas.client.VorbaId;
+import uk.ac.vamsas.client.simpleclient.ClientDocument;
+import uk.ac.vamsas.client.simpleclient.VamsasArchive;
+import uk.ac.vamsas.client.simpleclient.VamsasArchiveReader;
+import uk.ac.vamsas.objects.core.Entry;
+import uk.ac.vamsas.objects.core.VAMSAS;
+import uk.ac.vamsas.objects.core.VamsasDocument;
+import uk.ac.vamsas.objects.utils.ProvenanceStuff;
+
+// simple holder to pass to client.
+public class ClientDoc extends uk.ac.vamsas.client.ClientDocument {
+ /*
+ * (non-Javadoc)
+ *
+ * @see uk.ac.vamsas.client.IClientDocument#getClientAppdata()
+ */
+ public IClientAppdata getClientAppdata() {
+ throw new Error(
+ "Appdata access is not implemented in the test.simpleclient.ClientDoc instance."); // TODO
+ // Auto-generated
+ // method
+ // stub
+ }
+
+ protected boolean isModified = false;
+
+ private Log log = LogFactory.getLog(ClientDoc.class);
+
+ protected VamsasDocument doc;
+
+ public uk.ac.vamsas.objects.core.VAMSAS[] _VamsasRoots;
+
+ protected VamsasArchive iohandler = null;
+
+ protected VamsasArchiveReader reader = null;
+
+ private String user = null;
+
+ private String app = null;
+
+ /**
+ * @param doc
+ * @param iohandler
+ * @param reader
+ * @param app
+ * @param user
+ */
+ public ClientDoc(VamsasDocument doc, VamsasArchive iohandler,
+ VamsasArchiveReader reader, String app, String user, Hashtable objrefs) {
+ super(objrefs, (iohandler != null) ? iohandler.getVorba() : null);
+ this.doc = doc;
+ this.iohandler = iohandler;
+ this.reader = reader;
+ this.app = app;
+ this.user = user;
+ this.objrefs = objrefs;
+ _VamsasRoots = doc.getVAMSAS();
+ }
+
+ // AppDataOutputStream appd;
+ // AppDataOutputStream userd;
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.Object#finalize()
+ */
+ protected Entry getProvenanceEntry(String action) {
+ // VAMSAS: modify schema to allow referencing of user field (plus other
+ // issues, ClientUrn field, machine readable action, input parameters,
+ // additional data generated notes
+ Entry prov = ProvenanceStuff.newProvenanceEntry(app, user, action);
+ return prov;
+ }
+
+ public VAMSAS[] getVamsasRoots() {
+ if (doc == null) {
+ log.debug("Null document for getVamsasRoots(), returning null");
+ return null;
+ }
+ if (iohandler == null) {
+ // LATER: decide on read-only status of ClientDocument object
+ log.warn("getVamsasRoots() called on possibly read-only document.");
+ }
+ if (_VamsasRoots != null)
+ return _VamsasRoots;
+ VAMSAS[] roots = doc.getVAMSAS();
+ if (roots == null) {
+ // Make a new one to return to client to get filled.
+ _VamsasRoots = new VAMSAS[] { new VAMSAS() };
+ // Do provenance now. just in case.
+ doc.getProvenance().addEntry(
+ getProvenanceEntry("Created new document root [id="
+ + _VamsasRoots[0].getId() + "]"));
+ doc.addVAMSAS(_VamsasRoots[0]);
+ } else {
+ _VamsasRoots = new VAMSAS[roots.length];
+ for (int r = 0; r < roots.length; r++)
+ _VamsasRoots[r] = roots[r];
+ }
+ return _VamsasRoots;
+ }
+
+ private int _contains(VAMSAS root, VAMSAS[] docRoots) {
+ if (root == null)
+ return -1;
+ if (docRoots == null || docRoots.length == 0)
+ return -1;
+ VorbaId r_id = root.getVorbaId();
+ for (int i = 0, j = docRoots.length; i < j; i++) {
+ VorbaId n_id = null;
+ if (docRoots[i] == root
+ || (docRoots[i] != null && (n_id = docRoots[i].getVorbaId()) != null && n_id
+ .equals(r_id)))
+ return i;
+ }
+ return -1;
+ }
+
+ /**
+ * verify that newr version is really an intact version of the
+ *
+ * @param newVersion
+ * (may be modified)
+ * @param oldVersion
+ * @return true if newVersion is a valid root that preserves original
+ * references
+ */
+ private boolean isValidUpdate(VAMSAS newVersion, final VAMSAS oldVersion) {
+ // ideal - this cascades down the two structures, ensuring that all ID'd
+ // objects in one are present in the other.
+ if (oldVersion == newVersion) {
+ // may be a virgin root element.
+ if (!newVersion.isRegistered())
+ iohandler.getVorba().makeVorbaId(newVersion);
+ // Should retrieve original version and compare - unless local hashes can
+ // be used to determine if resultSet has been truncated.
+ // just do internal validation for moment.
+ if (newVersion.isValid())
+ return true;
+ return false;
+ } else {
+ // redundant ? if (oldVersion.is__stored_in_document())
+ if (!newVersion.isRegistered())
+ iohandler.getVorba().makeVorbaId(newVersion);
+ if (newVersion.isValid())
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * /** merge old and new root vectors
+ *
+ * @param newr
+ * This array may be written to
+ * @param original
+ * @param the
+ * client document (usually this) which this root set belongs to.
+ * @return merged vector of vamsas roots
+ */
+ private VAMSAS[] _combineRoots(VAMSAS[] newr, final VAMSAS[] original,
+ ClientDoc modflag) {
+ Vector rts = new Vector();
+ boolean modified = false;
+ for (int i = 0, j = original.length; i < j; i++) {
+ int k = _contains(original[i], newr);
+ if (k > -1) {
+ if (isValidUpdate(newr[k], original[i])) {
+ modified = true;
+ rts.add(newr[k]);
+ newr[k] = null;
+ } else {
+ // LATER: try harder to merge ducument roots.
+ log.warn("Couldn't merge new VAMSAS root " + newr[k].getId());
+ newr[k] = null; // LATER: this means we ignore mangled roots. NOT GOOD
+ }
+ } else {
+ // add in order.
+ rts.add(original[i]);
+ }
+ }
+ // add remaining (new) roots
+ for (int i = 0, j = newr.length; i < j; i++) {
+ if (newr[i] != null) {
+ rts.add(newr[i]);
+ modified = true;
+ }
+ }
+ newr = new VAMSAS[rts.size()];
+ for (int i = 0, j = rts.size(); i < j; i++)
+ newr[i] = (VAMSAS) rts.get(i);
+ if (modflag != null)
+ modflag.isModified = modified;
+ return newr;
+ }
+
+ /**
+ * update the document with new roots. LATER: decide: this affects the next
+ * call to getVamsasRoots()
+ *
+ * @see org.vamsas.IClientDocument.setVamsasRoots
+ */
+ public void setVamsasRoots(VAMSAS[] newroots) {
+ if (doc == null) {
+ log.debug("setVamsasRoots called on null document.");
+ return;
+ }
+ VAMSAS[] newr;
+ if (newroots == null) {
+ log.debug("setVamsasRoots(null) - do nothing.");
+ return;
+ }
+ // are we dealing with same array ?
+ if (_VamsasRoots != newroots) {
+ // merge roots into local version.
+ newr = new VAMSAS[newroots.length];
+ for (int i = 0; i < newr.length; i++)
+ newr[i] = newroots[i];
+ newr = _combineRoots(newr, _VamsasRoots, this);
+ } else {
+ newr = new VAMSAS[_VamsasRoots.length];
+ for (int i = 0; i < newr.length; i++)
+ newr[i] = _VamsasRoots[i];
+ }
+ // actually compare with document root set for final combination (to ensure
+ // nothing is lost)
+ _VamsasRoots = _combineRoots(newr, doc.getVAMSAS(), this);
+ }
+
+ /*
+ * (non-Javadoc) LATER: decide: this affects the next call to getVamsasRoots()
+ *
+ * @see
+ * uk.ac.vamsas.client.IClientDocument#addVamsasRoot(uk.ac.vamsas.objects.
+ * core.VAMSAS)
+ */
+ public void addVamsasRoot(VAMSAS newroot) {
+ if (doc == null) {
+ log.debug("addVamsasRoots called on null document.");
+ return;
+ }
+ VAMSAS[] newroots = _combineRoots(new VAMSAS[] { newroot }, _VamsasRoots,
+ this);
+ _VamsasRoots = newroots;
+ }
+
+ public VamsasArchiveReader getReader() {
+ return reader;
+ }
+
+ private void _finalize() {
+ log.debug("finalizing clientDoc");
+ if (doc != null) {
+ doc = null;
+ }
+ if (_VamsasRoots != null) {
+ for (int i = 0; i < _VamsasRoots.length; i++)
+ _VamsasRoots[i] = null;
+ _VamsasRoots = null;
+
+ }
+
+ if (reader != null) {
+ log.debug("Closing and removing reader reference");
+ reader.close();
+ reader = null;
+ }
+ if (iohandler != null) {
+ log.debug("Removing ioHandler reference.");
+ iohandler.cancelArchive();
+ iohandler = null;
+ }
+ }
+
+ protected void finalize() throws Throwable {
+ _finalize();
+ super.finalize();
+ }
+
+ private java.util.Hashtable objrefs = null;
+
+ public VorbaId[] registerObjects(Vobject[] unregistered) {
+ if (doc == null) {
+ log.warn("registerObjects[] called on null document.");
+ return null;
+ }
+ if (objrefs == null) {
+ log.warn("registerObjects[] called for null objrefs hasharray.");
+ return null;
+ }
+ if (unregistered != null) {
+ VorbaId ids[] = new VorbaId[unregistered.length];
+ for (int i = 0, k = unregistered.length; i < k; i++)
+ if (unregistered[i] != null) {
+ log.warn("Null Vobject passed to registerObject[] at position " + i);
+ return null;
+ } else {
+ ids[i] = registerObject(unregistered[i]);
+ }
+ log.debug("Registered " + unregistered.length + " objects - total of "
+ + objrefs.size() + " ids.");
+ return ids;
+ }
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * uk.ac.vamsas.client.IClientDocument#registerObject(uk.ac.vamsas.client.
+ * Vobject)
+ */
+ public VorbaId registerObject(Vobject unregistered) {
+ if (doc == null) {
+ log.warn("registerObjects called on null document.");
+ return null;
+ }
+ if (objrefs == null) {
+ log.warn("registerObjects called for null objrefs hasharray.");
+ return null;
+ }
+ if (iohandler == null) {
+ log.warn("registerObjects called for read only document.");
+ return null;
+ }
+
+ if (unregistered != null) {
+ VorbaId id = this._registerObject(unregistered);
+ log.debug("Registered object - total of " + objrefs.size() + " ids.");
+ return id;
+ }
+ log.warn("Null Vobject passed to registerObject.");
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * uk.ac.vamsas.client.IClientDocument#getObject(uk.ac.vamsas.client.VorbaId)
+ */
+ public Vobject getObject(VorbaId id) {
+ if (objrefs == null) {
+ log.debug("getObject called on null objrefs list.");
+ return null;
+ }
+ if (objrefs.containsKey(id.getId()))
+ return (Vobject) objrefs.get(id.getId());
+ log.debug("Returning null Vobject reference for id " + id.getId());
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * uk.ac.vamsas.client.IClientDocument#getObjects(uk.ac.vamsas.client.VorbaId
+ * [])
+ */
+ public Vobject[] getObjects(VorbaId[] ids) {
+ if (objrefs == null) {
+ log.debug("getObject[] called on null objrefs list.");
+ return null;
+ }
+ Vobject[] vo = new Vobject[ids.length];
+ for (int i = 0, j = ids.length; i < j; i++)
+ if (objrefs.containsKey(ids[i]))
+ vo[i] = (Vobject) objrefs.get(ids[i]);
+ else
+ log.debug("Returning null Vobject reference for id " + ids[i].getId());
+ return vo;
+ }
+
+ protected void updateDocumentRoots() {
+ if (doc == null) {
+ log
+ .error("updateDocumentRoots called on null document. Probably an implementation error.");
+ return;
+ }
+ if (isModified) {
+ if (_VamsasRoots != null) {
+ doc.setVAMSAS(_VamsasRoots);
+ _VamsasRoots = null;
+ }
+ }
+ }
+
+ /**
+ * tell vamsas client to close the document and reset the object. Once closed,
+ * nothing can be done with the object.
+ *
+ */
+ public void closeDoc() {
+ if (doc != null) {
+ log.debug("Closing open document.");
+ _finalize();
+ } else {
+ log.warn("Ignoring closeDoc on invalid document.");
+ }
+ }
+
+}
diff --git a/src/uk/ac/vamsas/test/simpleclient/ClientsFileTest.java b/src/uk/ac/vamsas/test/simpleclient/ClientsFileTest.java
index 9d76bfb..edbd855 100644
--- a/src/uk/ac/vamsas/test/simpleclient/ClientsFileTest.java
+++ b/src/uk/ac/vamsas/test/simpleclient/ClientsFileTest.java
@@ -1,311 +1,268 @@
-package uk.ac.vamsas.test.simpleclient;
-
-import java.io.File;
-import java.util.Iterator;
-import java.util.Vector;
-
-
-import uk.ac.vamsas.client.ClientHandle;
-import uk.ac.vamsas.client.simpleclient.ClientsFile;
-import uk.ac.vamsas.client.simpleclient.FileWatcher;
-import uk.ac.vamsas.client.simpleclient.Lock;
-
-public class ClientsFileTest {
- private static CommandProcessor cproc;
-
- private static Vector commands;
- static {
- cproc = new CommandProcessor();
- ClientsFileTest.commands = new Vector();
- ClientsFileTest.commands.add(new String("add"));
- cproc.addCommand("add", 2, "for the Client's 'Name' and 'Version'");
- ClientsFileTest.commands.add(new String("remove"));
- cproc.addCommand("remove", 3, "for the Client's 'Name', Version and URN");
- ClientsFileTest.commands.add(new String("list"));
- cproc.addCommand("list", 0, "no args needed");
- ClientsFileTest.commands.add(new String("clear"));
- cproc.addCommand("clear", 0, "no args needed");
- ClientsFileTest.commands.add(new String("watch"));
- cproc.addCommand("watch", 0, "no args needed");
- ClientsFileTest.commands.add(new String("monitor"));
- cproc.addCommand("monitor", 2, "for the Client's 'Name' and 'Version'");
- }
-
- private static void complainArgs(int argl, int argpos, String cmd,
- int argneed, String msg) {
- if (argl - argpos < argneed)
- throw new Error(cmd + " needs " + argneed + " arguments : " + msg);
- }
-
- public static void main(String[] args) {
- java.io.File cf = new java.io.File(args[0]);
- System.out.println("Connecting to clientFile " + args[0]);
- ClientsFile cfhand;
- try {
- cfhand = new ClientsFile(cf);
- } catch (Exception e) {
- e.printStackTrace(System.err);
- return;
- }
- int argc = 1;
- while (argc < args.length) {
- // vars needed for operations
- ClientHandle ch;
- int com = cproc.getCommand(args, argc);
- argc++;
- switch (com) {
- case 0:
- // Add
- int pos = cfhand.addClient(ch = new ClientHandle(args[argc],
- args[argc + 1]));
- argc += 2;
- if (pos != 0)
- System.out.println("Client added at " + pos + " as urn:"
- + ch.getClientUrn());
- else
- System.out.println("Client was not added.");
- break;
- case 1:
- // remove
- ch = new ClientHandle(args[argc], args[argc + 1]);
- ch.setClientUrn(args[argc + 2]);
- argc += 3;
- cfhand.removeClient(ch, null);
- System.out.println("Client removed (apparently)");
- break;
- case 2:
- // list
- ClientHandle[] chlist = cfhand.retrieveClientList();
- if (chlist != null) {
- for (int chi = 0, che = chlist.length; chi < che; chi++) {
- System.out.println("Client " + chi + " ("
- + chlist[chi].getClientName() + " " + chlist[chi].getVersion()
- + " " + chlist[chi].getClientUrn() + ")");
- }
- } else {
- System.out.println("Client list is empty.");
- }
- break;
- case 3:
- // clear
- //cfhand.get = null;
- //cf.delete();
- try {
-
- cfhand.clearList();
-
- } catch (Exception e) {
- System.err.println("Failed on new empty clientfile creation!");
- e.printStackTrace(System.err);
- }
- break;
- case 4:
- // watch
- FileWatcher w = new FileWatcher(cf);
- while (cf.exists()) {
- // get watcher's lock to ensure state change is fixed for retrieval
- Lock chlock = w.getChangedState();
- if (chlock != null) {
- ClientHandle[] cl = cfhand.retrieveClientList(chlock);
- System.out.println("-- Watching " + cf.getName());
- //while (w.hasChanged())
- // ;
- if (cl != null) {
- for (int chi = 0, che = cl.length; chi < che; chi++) {
- System.out.println("Client " + chi + " ("
- + cl[chi].getClientName() + " " + cl[chi].getVersion()
- + " " + cl[chi].getClientUrn() + ")");
- }
- } else {
- System.out.println("Client list is empty.");
- }
- }
-
- }
- break;
- case 5:
- // monitor
- int clpos = cfhand.addClient(ch = new ClientHandle(args[argc],
- args[argc + 1]));
- argc += 2;
- if (clpos != 0)
- System.out.println("Monitor Client added at " + clpos + " as urn:"
- + ch.getClientUrn());
- else {
- System.err.println("Monitor Client was not added.");
- break;
- }
- FileWatcher mon = new FileWatcher(cf);
- while (cf.exists()) {
- // get watcher's lock to ensure state change is fixed for retrieval
- Lock chlock = mon.getChangedState();
- if (chlock != null) {
- ClientHandle[] cl = cfhand.retrieveClientList(chlock);
- System.out.println("-- Monitor " + cf.getName());
- //while (w.hasChanged())
- // ;
- int newpos = -1;
- if (cl != null) {
- for (int chi = 0, che = cl.length; chi < che; chi++) {
- if (ch.equals(cl[chi]))
- newpos = chi + 1;
- }
- }
- if (newpos == -1) {
- // add self again to cleared list.
- newpos = cfhand.addClient(ch);
- mon.setState();
- if (newpos == 0) {
- System.err
- .println("Monitor client could not be re-added to list.");
- break;
- }
- }
- if (newpos != clpos) {
- System.out.println("Monitor client moved from " + clpos + " to "
- + newpos);
- clpos = newpos;
- }
- }
- }
- break;
- default:
- if (com == -1) {
- System.err
- .println("Unknown command : " + args[argc++] + "*Ignored!*");
- } else
- System.err.println("Command " + args[argc++]
- + " *Ignored!* - its not implemented.");
- }
-
- for (int j = 0; j < 900000; j++) {
- Integer i = Integer.getInteger("1");
- Integer q = i;
- }
- }
-
- }
-
- /* Iterator coms = commands.iterator();
- int com=-1;
- while ((coms!=null) && coms.hasNext()) {
- com++;
- if (args[argc].toLowerCase().equals((String) coms.next())) {
- System.out.println("Doing "+args[argc]);
- ClientHandle ch;
- argc++;
- switch (com) {
- case 0:
- // Add
- ClientsFileTest.complainArgs(args.length, argc, "add", 2, "for the Client's 'Name' and 'Version'");
- int pos = cfhand.addClient(ch=new ClientHandle(args[argc],args[argc+1]));
- argc+=2;
- if (pos!=0)
- System.out.println("Client added at "+pos+" as urn:"+ch.getClientUrn());
- else
- System.out.println("Client was not added.");
- break;
- case 1:
- // remove
- ClientsFileTest.complainArgs(args.length, argc, "remove", 3, "for the Client's 'Name', Version and URN");
- ch=new ClientHandle(args[argc], args[argc+1]);
- ch.setClientUrn(args[argc+2]);
- argc+=3;
- cfhand.removeClient(ch, null);
- System.out.println("Client removed (apparently)");
- break;
- case 2:
- // list
- ClientHandle[] chlist = cfhand.retrieveClientList();
- if (chlist!=null) {
- for (int chi=0,che=chlist.length; chi.
+ */
+package uk.ac.vamsas.test.simpleclient;
+
+import java.io.File;
+import java.util.Iterator;
+import java.util.Vector;
+
+import uk.ac.vamsas.client.ClientHandle;
+import uk.ac.vamsas.client.simpleclient.ClientsFile;
+import uk.ac.vamsas.client.simpleclient.FileWatcher;
+import uk.ac.vamsas.client.simpleclient.Lock;
+
+public class ClientsFileTest {
+ private static CommandProcessor cproc;
+
+ private static Vector commands;
+ static {
+ cproc = new CommandProcessor();
+ ClientsFileTest.commands = new Vector();
+ ClientsFileTest.commands.add(new String("add"));
+ cproc.addCommand("add", 2, "for the Client's 'Name' and 'Version'");
+ ClientsFileTest.commands.add(new String("remove"));
+ cproc.addCommand("remove", 3, "for the Client's 'Name', Version and URN");
+ ClientsFileTest.commands.add(new String("list"));
+ cproc.addCommand("list", 0, "no args needed");
+ ClientsFileTest.commands.add(new String("clear"));
+ cproc.addCommand("clear", 0, "no args needed");
+ ClientsFileTest.commands.add(new String("watch"));
+ cproc.addCommand("watch", 0, "no args needed");
+ ClientsFileTest.commands.add(new String("monitor"));
+ cproc.addCommand("monitor", 2, "for the Client's 'Name' and 'Version'");
+ }
+
+ private static void complainArgs(int argl, int argpos, String cmd,
+ int argneed, String msg) {
+ if (argl - argpos < argneed)
+ throw new Error(cmd + " needs " + argneed + " arguments : " + msg);
+ }
+
+ public static void main(String[] args) {
+ java.io.File cf = new java.io.File(args[0]);
+ System.out.println("Connecting to clientFile " + args[0]);
+ ClientsFile cfhand;
+ try {
+ cfhand = new ClientsFile(cf);
+ } catch (Exception e) {
+ e.printStackTrace(System.err);
+ return;
+ }
+ int argc = 1;
+ while (argc < args.length) {
+ // vars needed for operations
+ ClientHandle ch;
+ int com = cproc.getCommand(args, argc);
+ argc++;
+ switch (com) {
+ case 0:
+ // Add
+ int pos = cfhand.addClient(ch = new ClientHandle(args[argc],
+ args[argc + 1]));
+ argc += 2;
+ if (pos != 0)
+ System.out.println("Client added at " + pos + " as urn:"
+ + ch.getClientUrn());
+ else
+ System.out.println("Client was not added.");
+ break;
+ case 1:
+ // remove
+ ch = new ClientHandle(args[argc], args[argc + 1]);
+ ch.setClientUrn(args[argc + 2]);
+ argc += 3;
+ cfhand.removeClient(ch, null);
+ System.out.println("Client removed (apparently)");
+ break;
+ case 2:
+ // list
+ ClientHandle[] chlist = cfhand.retrieveClientList();
+ if (chlist != null) {
+ for (int chi = 0, che = chlist.length; chi < che; chi++) {
+ System.out.println("Client " + chi + " ("
+ + chlist[chi].getClientName() + " " + chlist[chi].getVersion()
+ + " " + chlist[chi].getClientUrn() + ")");
+ }
+ } else {
+ System.out.println("Client list is empty.");
+ }
+ break;
+ case 3:
+ // clear
+ // cfhand.get = null;
+ // cf.delete();
+ try {
+
+ cfhand.clearList();
+
+ } catch (Exception e) {
+ System.err.println("Failed on new empty clientfile creation!");
+ e.printStackTrace(System.err);
+ }
+ break;
+ case 4:
+ // watch
+ FileWatcher w = new FileWatcher(cf);
+ while (cf.exists()) {
+ // get watcher's lock to ensure state change is fixed for retrieval
+ Lock chlock = w.getChangedState();
+ if (chlock != null) {
+ ClientHandle[] cl = cfhand.retrieveClientList(chlock);
+ System.out.println("-- Watching " + cf.getName());
+ // while (w.hasChanged())
+ // ;
+ if (cl != null) {
+ for (int chi = 0, che = cl.length; chi < che; chi++) {
+ System.out.println("Client " + chi + " ("
+ + cl[chi].getClientName() + " " + cl[chi].getVersion()
+ + " " + cl[chi].getClientUrn() + ")");
+ }
+ } else {
+ System.out.println("Client list is empty.");
+ }
+ }
+
+ }
+ break;
+ case 5:
+ // monitor
+ int clpos = cfhand.addClient(ch = new ClientHandle(args[argc],
+ args[argc + 1]));
+ argc += 2;
+ if (clpos != 0)
+ System.out.println("Monitor Client added at " + clpos + " as urn:"
+ + ch.getClientUrn());
+ else {
+ System.err.println("Monitor Client was not added.");
+ break;
+ }
+ FileWatcher mon = new FileWatcher(cf);
+ while (cf.exists()) {
+ // get watcher's lock to ensure state change is fixed for retrieval
+ Lock chlock = mon.getChangedState();
+ if (chlock != null) {
+ ClientHandle[] cl = cfhand.retrieveClientList(chlock);
+ System.out.println("-- Monitor " + cf.getName());
+ // while (w.hasChanged())
+ // ;
+ int newpos = -1;
+ if (cl != null) {
+ for (int chi = 0, che = cl.length; chi < che; chi++) {
+ if (ch.equals(cl[chi]))
+ newpos = chi + 1;
+ }
+ }
+ if (newpos == -1) {
+ // add self again to cleared list.
+ newpos = cfhand.addClient(ch);
+ mon.setState();
+ if (newpos == 0) {
+ System.err
+ .println("Monitor client could not be re-added to list.");
+ break;
+ }
+ }
+ if (newpos != clpos) {
+ System.out.println("Monitor client moved from " + clpos + " to "
+ + newpos);
+ clpos = newpos;
+ }
+ }
+ }
+ break;
+ default:
+ if (com == -1) {
+ System.err
+ .println("Unknown command : " + args[argc++] + "*Ignored!*");
+ } else
+ System.err.println("Command " + args[argc++]
+ + " *Ignored!* - its not implemented.");
+ }
+
+ for (int j = 0; j < 900000; j++) {
+ Integer i = Integer.getInteger("1");
+ Integer q = i;
+ }
+ }
+
+ }
+
+ /*
+ * Iterator coms = commands.iterator(); int com=-1; while ((coms!=null) &&
+ * coms.hasNext()) { com++; if (args[argc].toLowerCase().equals((String)
+ * coms.next())) { System.out.println("Doing "+args[argc]); ClientHandle ch;
+ * argc++; switch (com) { case 0: // Add
+ * ClientsFileTest.complainArgs(args.length, argc, "add", 2,
+ * "for the Client's 'Name' and 'Version'"); int pos = cfhand.addClient(ch=new
+ * ClientHandle(args[argc],args[argc+1])); argc+=2; if (pos!=0)
+ * System.out.println("Client added at "+pos+" as urn:"+ch.getClientUrn());
+ * else System.out.println("Client was not added."); break; case 1: // remove
+ * ClientsFileTest.complainArgs(args.length, argc, "remove", 3,
+ * "for the Client's 'Name', Version and URN"); ch=new
+ * ClientHandle(args[argc], args[argc+1]); ch.setClientUrn(args[argc+2]);
+ * argc+=3; cfhand.removeClient(ch, null);
+ * System.out.println("Client removed (apparently)"); break; case 2: // list
+ * ClientHandle[] chlist = cfhand.retrieveClientList(); if (chlist!=null) {
+ * for (int chi=0,che=chlist.length; chi2)
- complainArgs(args.length, argc+1, comnext);
- return com;
- }
- }
- return -1;
-
- }
-}
+/*
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
+ */
+package uk.ac.vamsas.test.simpleclient;
+
+import java.util.Iterator;
+import java.util.Vector;
+
+public class CommandProcessor {
+ /**
+ * this is not getOPT!!!! - processes a *series* of space separated commands -
+ * some of which take arguments.
+ */
+ private Vector commands;
+
+ /*
+ * static { ClientsFileTest.commands=new Vector();
+ * ClientsFileTest.commands.add(new String("add"));
+ * ClientsFileTest.commands.add(new String("remove"));
+ * ClientsFileTest.commands.add(new String("list"));
+ * ClientsFileTest.commands.add(new String("clear"));
+ * ClientsFileTest.commands.add(new String("watch"));
+ * ClientsFileTest.commands.add(new String("monitor")); }
+ */
+
+ public int addCommand(String cmd, int argneed, String complainString) {
+ int cnum = 0;
+ if (commands == null)
+ commands = new Vector();
+ else
+ cnum = commands.size();
+ Vector cv = new Vector();
+ cv.add(new String(cmd));
+ cv.add(new Integer(argneed));
+ cv.add(new String(complainString));
+ commands.add(cv);
+ return cnum;
+ }
+
+ /**
+ * Integer argl, Integer argpos, String cmd, Integer argneed, String msg in
+ * vector
+ */
+ public void complainArgs(int argl, int argpos, Vector ca) {
+ int argneed = ((Integer) ca.get(1)).intValue();
+ if (argl - argpos < argneed)
+ throw new Error(((String) ca.get(0)) + " at position " + argpos
+ + " needs " + argneed + " arguments : " + (String) ca.get(2));
+ }
+
+ /**
+ * find and verify a command
+ *
+ * @param args
+ * argstring
+ * @param argpos
+ * position to check for command
+ * @return matching command or -1
+ */
+ public int getCommand(String[] args, int argpos) {
+ Iterator coms = commands.iterator();
+ int com = -1, argc;
+ argc = argpos;
+ while ((coms != null) && coms.hasNext()) {
+ com++;
+ Vector comnext = (Vector) coms.next();
+ if (args[argc].toLowerCase().equals((String) comnext.get(0))) {
+ if (comnext.size() > 2)
+ complainArgs(args.length, argc + 1, comnext);
+ return com;
+ }
+ }
+ return -1;
+
+ }
+}
diff --git a/src/uk/ac/vamsas/test/simpleclient/TestSessionURN.java b/src/uk/ac/vamsas/test/simpleclient/TestSessionURN.java
index e0759e2..b7434d3 100644
--- a/src/uk/ac/vamsas/test/simpleclient/TestSessionURN.java
+++ b/src/uk/ac/vamsas/test/simpleclient/TestSessionURN.java
@@ -1,29 +1,49 @@
-package uk.ac.vamsas.test.simpleclient;
-
-import java.io.File;
-
-import uk.ac.vamsas.client.simpleclient.SessionUrn;
-
-/**
- * Tests simple client sessionURN creation
- *
- *
- */
-public class TestSessionURN {
-
- public static void main (String [] arg) throws Exception
- {
- String file = null;
- if (arg == null || arg.length ==0)
- file = ".";
- else
- file = arg[0];
-
- File f = new File (file);
- SessionUrn urn = new SessionUrn(f);
- System.out.println("urn "+urn.getSessionUrn());
- System.out.println("urn file "+ urn.asFile().getAbsolutePath());
- System.out.println("urn file exists?"+ urn.asFile().exists());
- }
-
-}
+/*
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
+ */
+package uk.ac.vamsas.test.simpleclient;
+
+import java.io.File;
+
+import uk.ac.vamsas.client.simpleclient.SessionUrn;
+
+/**
+ * Tests simple client sessionURN creation
+ *
+ *
+ */
+public class TestSessionURN {
+
+ public static void main(String[] arg) throws Exception {
+ String file = null;
+ if (arg == null || arg.length == 0)
+ file = ".";
+ else
+ file = arg[0];
+
+ File f = new File(file);
+ SessionUrn urn = new SessionUrn(f);
+ System.out.println("urn " + urn.getSessionUrn());
+ System.out.println("urn file " + urn.asFile().getAbsolutePath());
+ System.out.println("urn file exists?" + urn.asFile().exists());
+ }
+
+}
diff --git a/src/uk/ac/vamsas/test/simpleclient/VamsasArchive.java b/src/uk/ac/vamsas/test/simpleclient/VamsasArchive.java
index 175c2bc..fe83f66 100644
--- a/src/uk/ac/vamsas/test/simpleclient/VamsasArchive.java
+++ b/src/uk/ac/vamsas/test/simpleclient/VamsasArchive.java
@@ -1,239 +1,273 @@
-package uk.ac.vamsas.test.simpleclient;
-
-import java.io.File;
-import java.io.ObjectOutputStream;
-import java.io.RandomAccessFile;
-import java.util.jar.JarFile;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import uk.ac.vamsas.client.simpleclient.Lock;
-import uk.ac.vamsas.client.simpleclient.SessionFile;
-import uk.ac.vamsas.client.simpleclient.SimpleDocument;
-import uk.ac.vamsas.client.simpleclient.VamsasArchiveReader;
-import uk.ac.vamsas.client.simpleclient.VamsasFile;
-import uk.ac.vamsas.objects.core.ApplicationData;
-import uk.ac.vamsas.objects.core.User;
-import uk.ac.vamsas.objects.core.VAMSAS;
-import uk.ac.vamsas.objects.core.VamsasDocument;
-import uk.ac.vamsas.test.objects.Core;
-
-public class VamsasArchive {
- /**
- * test the org.vamsas.simpleclient.vamsasArchive class
- */
- static Log log = LogFactory.getLog(VamsasArchive.class);
- public static ApplicationData makeDemoAppdata(uk.ac.vamsas.client.simpleclient.VamsasArchive va, String apname, String userName, String userOrg) {
- if (va==null)
- return null;
- VamsasArchiveReader vread=null;
- try {
- vread = va.getOriginalArchiveReader();
- }
- catch (Exception e) {
- log.error("Failed to get original archive reader!",e);
- return null;
- }
- ApplicationData appdata = new ApplicationData();
- appdata.setName("uk.ac.vamsas.test.simpleclient.VamsasArchive");
- appdata.setData(new String("this is some test data.").getBytes());
- User apuser = new User();
- apuser.setFullname(userName);
- apuser.setOrganization(userOrg);
- String appdata_ref = "vamsas:"+apname+"/"+apuser.getOrganization()+"/"+apuser.getFullname();
- SimpleDocument sdoc = new SimpleDocument("test.simpleclient.VamsasArchive");
- if (vread!=null) {
- VamsasDocument orignalnew;
- try {
- orignalnew = sdoc.getVamsasDocument(vread);
- log.info("*** Dump follows ***");
-
- ArchiveReports.reportDocument(orignalnew, vread, false, System.out);
- log.info("*** Dump precedes ***");
- } catch (Exception e) {
- log.info("makeDemoAppdata: Problems accessing original document");
- }
-
- log.info("Reading (and avoiding references to) original data");
- if (vread.getAppdataStream(appdata_ref)!=null) {
- // transfer over
- try {
- va.transferAppDataEntry(appdata_ref);
- } catch (Exception e) {
- log.warn("Exception when transferring appdata reference : "+appdata_ref, e);
- }
- int i=0;
- while (vread.getAppdataStream(appdata_ref+"/"+Integer.toString(++i))!=null) {
- try {
- // copy over another duplicate.
- va.transferAppDataEntry(appdata_ref+"/"+Integer.toString(i));
- } catch (Exception e) {
- log.warn("Exception when transferring appdata reference : "+appdata_ref, e);
- }
- }
- // this one must be unique!
- appdata_ref+="/"+Integer.toString(i);
- }
- }
-
- log.info("Adding new data stuff.");
- log.info("Writing an apdata reference using AppDataStream interface.");
- apuser.setDataReference(appdata_ref);
- appdata.addUser(apuser);
- appdata.setVersion("noggin");
- //TODO: write instance appdata appdata.setUrn("program:/the.nog/");
- try {
- ObjectOutputStream ost = new ObjectOutputStream(va.getAppDataStream(appdata_ref));
- ost.writeObject(appdata);
- ost.close();
- } catch (Exception e) {
- log.warn("Couldn't write appdata reference "+appdata_ref);
- }
- return appdata;
- }
- public static void main(String args[]) {
-
- try {
- File av;
- if (args.length>0)
- av = new File(args[0]);
- else
- av = new File("test/vamsas.zip");
- try {
- RandomAccessFile raf = new RandomAccessFile(av, "r");
- raf.readByte();
- raf.close();
- } catch (Exception f)
- {
- log.info("Couldn't random access file archive "+av, f);
- }
- try {
- JarFile jf = new JarFile(av, true, JarFile.OPEN_READ);
- if (jf.getEntry("vamsasDocument.xml")!=null)
- {
- log.info("Valid archive (sun) "+av);
- }
- jf.close();
- } catch (Exception f)
- {
- log.warn("Couldn't access jar archive with sun jartools: "+av, f);
- }
- try {
- org.apache.tools.zip.ZipFile jf = new org.apache.tools.zip.ZipFile(av);
- if (jf.getEntry("vamsasDocument.xml")!=null)
- {
- log.info("Valid archive (apache) "+av);
- }
- jf.close();
- } catch (Exception f)
- {
- log.warn("Couldn't access jar archive with apache ziptool: "+av,f);
- }
-
- log.info("Opening archive "+av);
- uk.ac.vamsas.client.simpleclient.VamsasArchive varchive = new uk.ac.vamsas.client.simpleclient.VamsasArchive(av, true);
-
- VAMSAS[] roots = (VAMSAS[]) varchive.getOriginalRoots();
-
- if (roots!=null) {
- log.info("Report on Original roots in archive:");
- ArchiveReports.rootReport(roots, true, System.out);
- }
- log.info("Getting current vamsas document.");
- VamsasDocument doc = varchive.getVamsasDocument();
- ArchiveReports.reportDocument(doc, varchive.getOriginalArchiveReader(), true, System.out); // not modified document so references will still be valid
- // do some stuff
- log.info("Retrieving backup");
- File backup = varchive.backupFile();
- if (backup==null)
- log.info(av+" is a New Archive.");
- else
- log.info(av+" has been backed up as "+backup);
- File newf=new File(av.getAbsolutePath()+"_new.zip");
- VamsasFile sfile = new VamsasFile(newf);
- /* if (newf.exists()) {
- int q=1;
- do {
- newf=new File(av.getAbsolutePath()+"_"+q+++"_new.zip");
- }
- while (newf.exists());
- } */
- if (newf.exists()) {
- log.info("Removing existing "+newf);
- newf.delete();
- }
-
- log.info("Now writing new Archive into "+newf.getAbsolutePath());
- uk.ac.vamsas.client.simpleclient.VamsasArchive va=null;
- { // hold lock over deletion and write of new archive.
- //Lock wlock = sfile.getLock();
- //newf.delete(); // clear out old file.
- sfile.getLock();
- va = new uk.ac.vamsas.client.simpleclient.VamsasArchive(newf, true, true, sfile);
- // open another and...
- ApplicationData appdata = makeDemoAppdata(va,
- "uk.ac.vamsas.test.simpleclient.VamsasArchive", "arnold Bugger esq", "disOrganised");
- log.info("Preparing to write new document.");
- doc.addApplicationData(appdata);
- doc.addVAMSAS(Core.getDemoVamsas());
- va.putVamsasDocument(doc); // gets stream and puts it.
- va.closeArchive();
- sfile.unLock();
- }
- log.info("Dump of new vamsas document :");
- log.info("Testing update: ");
- {
- Lock lock=sfile.getLock();
- if (lock==null)
- while ((lock=sfile.getLock())==null) {
- log.info("Waiting for lock.");
- Thread.sleep(100);
- }
- VamsasArchiveReader vreader = new VamsasArchiveReader(sfile.getVamsasFile());// lock); // cannot do new JarFile on a locked file. // newf);
- SimpleDocument sdoc = new SimpleDocument("testing new vamsas write");
- ArchiveReports.reportDocument(sdoc.getVamsasDocument(vreader), vreader, true, System.out);
- sfile.unLock();
- }
- // backup.delete(); // tidy up
-
- log.info("Now Cancelling write to original archive "+av);
- if (varchive.cancelArchive())
- log.info("Successfully cancelled.");
- else
- log.info("Didn't cancel.");
- long t=System.currentTimeMillis()+200; while (t>System.currentTimeMillis());
- log.info("Now testing archive update.");
- va = new uk.ac.vamsas.client.simpleclient.VamsasArchive(newf, false, true, sfile);
- doc = va.getVamsasDocument();
- doc.addVAMSAS(Core.getDemoVamsas());
- doc.addApplicationData(makeDemoAppdata(va,
- "uk.ac.vamsas.test.simpleclient.VamsasArchive", "another old Bugger esq", "rescinded"));
- if (va.transferRemainingAppDatas())
- log.info("Remain appdatas were transferred.");
- else
- log.warn("No appdatas were transferred. This is wrong.");
- va.putVamsasDocument(doc);
- va.closeArchive();
- sfile.unLock();
- log.info("Testing update: ");
- {
- Lock lock=sfile.getLock();
- if (lock==null)
- while ((lock=sfile.getLock())==null)
- log.info("Waiting for lock.");
- // VamsasArchiveReader vreader = new VamsasArchiveReader(lock);
- VamsasArchiveReader vreader = new VamsasArchiveReader(newf);
-
- SimpleDocument sdoc = new SimpleDocument("testing vamsas update");
- VamsasDocument finaldoc = sdoc.getVamsasDocument(vreader);
- if (finaldoc!=null)
- ArchiveReports.reportDocument(finaldoc, vreader, true, System.out);
- else
- log.error("Null Document Read from "+newf);
- }
- } catch (Exception e) {
- e.printStackTrace(System.err);
- }
- }
-}
+/*
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
+ */
+package uk.ac.vamsas.test.simpleclient;
+
+import java.io.File;
+import java.io.ObjectOutputStream;
+import java.io.RandomAccessFile;
+import java.util.jar.JarFile;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import uk.ac.vamsas.client.simpleclient.Lock;
+import uk.ac.vamsas.client.simpleclient.SessionFile;
+import uk.ac.vamsas.client.simpleclient.SimpleDocument;
+import uk.ac.vamsas.client.simpleclient.VamsasArchiveReader;
+import uk.ac.vamsas.client.simpleclient.VamsasFile;
+import uk.ac.vamsas.objects.core.ApplicationData;
+import uk.ac.vamsas.objects.core.User;
+import uk.ac.vamsas.objects.core.VAMSAS;
+import uk.ac.vamsas.objects.core.VamsasDocument;
+import uk.ac.vamsas.test.objects.Core;
+
+public class VamsasArchive {
+ /**
+ * test the org.vamsas.simpleclient.vamsasArchive class
+ */
+ static Log log = LogFactory.getLog(VamsasArchive.class);
+
+ public static ApplicationData makeDemoAppdata(
+ uk.ac.vamsas.client.simpleclient.VamsasArchive va, String apname,
+ String userName, String userOrg) {
+ if (va == null)
+ return null;
+ VamsasArchiveReader vread = null;
+ try {
+ vread = va.getOriginalArchiveReader();
+ } catch (Exception e) {
+ log.error("Failed to get original archive reader!", e);
+ return null;
+ }
+ ApplicationData appdata = new ApplicationData();
+ appdata.setName("uk.ac.vamsas.test.simpleclient.VamsasArchive");
+ appdata.setData(new String("this is some test data.").getBytes());
+ User apuser = new User();
+ apuser.setFullname(userName);
+ apuser.setOrganization(userOrg);
+ String appdata_ref = "vamsas:" + apname + "/" + apuser.getOrganization()
+ + "/" + apuser.getFullname();
+ SimpleDocument sdoc = new SimpleDocument("test.simpleclient.VamsasArchive");
+ if (vread != null) {
+ VamsasDocument orignalnew;
+ try {
+ orignalnew = sdoc.getVamsasDocument(vread);
+ log.info("*** Dump follows ***");
+
+ ArchiveReports.reportDocument(orignalnew, vread, false, System.out);
+ log.info("*** Dump precedes ***");
+ } catch (Exception e) {
+ log.info("makeDemoAppdata: Problems accessing original document");
+ }
+
+ log.info("Reading (and avoiding references to) original data");
+ if (vread.getAppdataStream(appdata_ref) != null) {
+ // transfer over
+ try {
+ va.transferAppDataEntry(appdata_ref);
+ } catch (Exception e) {
+ log.warn("Exception when transferring appdata reference : "
+ + appdata_ref, e);
+ }
+ int i = 0;
+ while (vread
+ .getAppdataStream(appdata_ref + "/" + Integer.toString(++i)) != null) {
+ try {
+ // copy over another duplicate.
+ va.transferAppDataEntry(appdata_ref + "/" + Integer.toString(i));
+ } catch (Exception e) {
+ log.warn("Exception when transferring appdata reference : "
+ + appdata_ref, e);
+ }
+ }
+ // this one must be unique!
+ appdata_ref += "/" + Integer.toString(i);
+ }
+ }
+
+ log.info("Adding new data stuff.");
+ log.info("Writing an apdata reference using AppDataStream interface.");
+ apuser.setDataReference(appdata_ref);
+ appdata.addUser(apuser);
+ appdata.setVersion("noggin");
+ // TODO: write instance appdata appdata.setUrn("program:/the.nog/");
+ try {
+ ObjectOutputStream ost = new ObjectOutputStream(va
+ .getAppDataStream(appdata_ref));
+ ost.writeObject(appdata);
+ ost.close();
+ } catch (Exception e) {
+ log.warn("Couldn't write appdata reference " + appdata_ref);
+ }
+ return appdata;
+ }
+
+ public static void main(String args[]) {
+
+ try {
+ File av;
+ if (args.length > 0)
+ av = new File(args[0]);
+ else
+ av = new File("test/vamsas.zip");
+ try {
+ RandomAccessFile raf = new RandomAccessFile(av, "r");
+ raf.readByte();
+ raf.close();
+ } catch (Exception f) {
+ log.info("Couldn't random access file archive " + av, f);
+ }
+ try {
+ JarFile jf = new JarFile(av, true, JarFile.OPEN_READ);
+ if (jf.getEntry("vamsasDocument.xml") != null) {
+ log.info("Valid archive (sun) " + av);
+ }
+ jf.close();
+ } catch (Exception f) {
+ log.warn("Couldn't access jar archive with sun jartools: " + av, f);
+ }
+ try {
+ org.apache.tools.zip.ZipFile jf = new org.apache.tools.zip.ZipFile(av);
+ if (jf.getEntry("vamsasDocument.xml") != null) {
+ log.info("Valid archive (apache) " + av);
+ }
+ jf.close();
+ } catch (Exception f) {
+ log.warn("Couldn't access jar archive with apache ziptool: " + av, f);
+ }
+
+ log.info("Opening archive " + av);
+ uk.ac.vamsas.client.simpleclient.VamsasArchive varchive = new uk.ac.vamsas.client.simpleclient.VamsasArchive(
+ av, true);
+
+ VAMSAS[] roots = (VAMSAS[]) varchive.getOriginalRoots();
+
+ if (roots != null) {
+ log.info("Report on Original roots in archive:");
+ ArchiveReports.rootReport(roots, true, System.out);
+ }
+ log.info("Getting current vamsas document.");
+ VamsasDocument doc = varchive.getVamsasDocument();
+ ArchiveReports.reportDocument(doc, varchive.getOriginalArchiveReader(),
+ true, System.out); // not modified document so references will still
+ // be valid
+ // do some stuff
+ log.info("Retrieving backup");
+ File backup = varchive.backupFile();
+ if (backup == null)
+ log.info(av + " is a New Archive.");
+ else
+ log.info(av + " has been backed up as " + backup);
+ File newf = new File(av.getAbsolutePath() + "_new.zip");
+ VamsasFile sfile = new VamsasFile(newf);
+ /*
+ * if (newf.exists()) { int q=1; do { newf=new
+ * File(av.getAbsolutePath()+"_"+q+++"_new.zip"); } while (newf.exists());
+ * }
+ */
+ if (newf.exists()) {
+ log.info("Removing existing " + newf);
+ newf.delete();
+ }
+
+ log.info("Now writing new Archive into " + newf.getAbsolutePath());
+ uk.ac.vamsas.client.simpleclient.VamsasArchive va = null;
+ { // hold lock over deletion and write of new archive.
+ // Lock wlock = sfile.getLock();
+ // newf.delete(); // clear out old file.
+ sfile.getLock();
+ va = new uk.ac.vamsas.client.simpleclient.VamsasArchive(newf, true,
+ true, sfile);
+ // open another and...
+ ApplicationData appdata = makeDemoAppdata(va,
+ "uk.ac.vamsas.test.simpleclient.VamsasArchive",
+ "arnold Bugger esq", "disOrganised");
+ log.info("Preparing to write new document.");
+ doc.addApplicationData(appdata);
+ doc.addVAMSAS(Core.getDemoVamsas());
+ va.putVamsasDocument(doc); // gets stream and puts it.
+ va.closeArchive();
+ sfile.unLock();
+ }
+ log.info("Dump of new vamsas document :");
+ log.info("Testing update: ");
+ {
+ Lock lock = sfile.getLock();
+ if (lock == null)
+ while ((lock = sfile.getLock()) == null) {
+ log.info("Waiting for lock.");
+ Thread.sleep(100);
+ }
+ VamsasArchiveReader vreader = new VamsasArchiveReader(sfile
+ .getVamsasFile());// lock); // cannot do new JarFile on a locked
+ // file. // newf);
+ SimpleDocument sdoc = new SimpleDocument("testing new vamsas write");
+ ArchiveReports.reportDocument(sdoc.getVamsasDocument(vreader), vreader,
+ true, System.out);
+ sfile.unLock();
+ }
+ // backup.delete(); // tidy up
+
+ log.info("Now Cancelling write to original archive " + av);
+ if (varchive.cancelArchive())
+ log.info("Successfully cancelled.");
+ else
+ log.info("Didn't cancel.");
+ long t = System.currentTimeMillis() + 200;
+ while (t > System.currentTimeMillis())
+ ;
+ log.info("Now testing archive update.");
+ va = new uk.ac.vamsas.client.simpleclient.VamsasArchive(newf, false,
+ true, sfile);
+ doc = va.getVamsasDocument();
+ doc.addVAMSAS(Core.getDemoVamsas());
+ doc.addApplicationData(makeDemoAppdata(va,
+ "uk.ac.vamsas.test.simpleclient.VamsasArchive",
+ "another old Bugger esq", "rescinded"));
+ if (va.transferRemainingAppDatas())
+ log.info("Remain appdatas were transferred.");
+ else
+ log.warn("No appdatas were transferred. This is wrong.");
+ va.putVamsasDocument(doc);
+ va.closeArchive();
+ sfile.unLock();
+ log.info("Testing update: ");
+ {
+ Lock lock = sfile.getLock();
+ if (lock == null)
+ while ((lock = sfile.getLock()) == null)
+ log.info("Waiting for lock.");
+ // VamsasArchiveReader vreader = new VamsasArchiveReader(lock);
+ VamsasArchiveReader vreader = new VamsasArchiveReader(newf);
+
+ SimpleDocument sdoc = new SimpleDocument("testing vamsas update");
+ VamsasDocument finaldoc = sdoc.getVamsasDocument(vreader);
+ if (finaldoc != null)
+ ArchiveReports.reportDocument(finaldoc, vreader, true, System.out);
+ else
+ log.error("Null Document Read from " + newf);
+ }
+ } catch (Exception e) {
+ e.printStackTrace(System.err);
+ }
+ }
+}
diff --git a/src/uk/ac/vamsas/test/simpleclient/ZipTest.java b/src/uk/ac/vamsas/test/simpleclient/ZipTest.java
index a860e0e..847d8fb 100644
--- a/src/uk/ac/vamsas/test/simpleclient/ZipTest.java
+++ b/src/uk/ac/vamsas/test/simpleclient/ZipTest.java
@@ -1,48 +1,68 @@
+/*
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
+ */
package uk.ac.vamsas.test.simpleclient;
import java.io.File;
import java.util.jar.JarFile;
+
/**
- * really simple test to see if we can open an archive and test for the existence of
- * an entry called vamssDocument.xml.
+ * really simple test to see if we can open an archive and test for the
+ * existence of an entry called vamssDocument.xml.
*
- * 'Pathological' archives fail this test (due to things like funny characters or lots of '.' in the entry name.
+ * 'Pathological' archives fail this test (due to things like funny characters
+ * or lots of '.' in the entry name.
*
* @author JimP
- *
+ *
*/
public class ZipTest {
/**
- * @param args single filename as an argument to open as a Jar file.
+ * @param args
+ * single filename as an argument to open as a Jar file.
*/
public static void main(String[] args) {
File av = new File(args[0]);
- boolean jfailed=false;
+ boolean jfailed = false;
try {
JarFile jf = new JarFile(av, false, JarFile.OPEN_READ);
- if (jf.getEntry("vamsasDocument.xml")!=null)
- {
- System.out.println("Valid archive "+av);
+ if (jf.getEntry("vamsasDocument.xml") != null) {
+ System.out.println("Valid archive " + av);
}
jf.close();
return;
- } catch (Exception f)
- {
- System.out.println("Couldn't access jar archive "+av);
+ } catch (Exception f) {
+ System.out.println("Couldn't access jar archive " + av);
f.printStackTrace(System.out);
}
try {
System.out.println("Trying the Apache Zip Package:");
org.apache.tools.zip.ZipFile jf = new org.apache.tools.zip.ZipFile(av);
- if (jf.getEntry("vamsasDocument.xml")!=null)
- {
- System.out.println("Valid archive "+av);
+ if (jf.getEntry("vamsasDocument.xml") != null) {
+ System.out.println("Valid archive " + av);
}
jf.close();
- } catch (Exception f)
- {
- System.out.println("Couldn't access jar archive "+av);
+ } catch (Exception f) {
+ System.out.println("Couldn't access jar archive " + av);
f.printStackTrace(System.out);
}
}
diff --git a/src/uk/ac/vamsas/test/simpleclient/simpleapp/VamsasClient.java b/src/uk/ac/vamsas/test/simpleclient/simpleapp/VamsasClient.java
index d4b9ec0..67db315 100644
--- a/src/uk/ac/vamsas/test/simpleclient/simpleapp/VamsasClient.java
+++ b/src/uk/ac/vamsas/test/simpleclient/simpleapp/VamsasClient.java
@@ -1,187 +1,243 @@
-/**
- *
- */
-package uk.ac.vamsas.test.simpleclient.simpleapp;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.OutputStreamWriter;
-import java.io.PrintWriter;
-import java.util.Hashtable;
-import java.util.IdentityHashMap;
-import java.util.Vector;
-import java.util.jar.JarOutputStream;
-
-import javax.swing.JInternalFrame;
-
-
-import uk.ac.vamsas.client.UserHandle;
-import uk.ac.vamsas.client.simpleclient.FileWatcher;
-import uk.ac.vamsas.client.simpleclient.VamsasArchive;
-import uk.ac.vamsas.client.simpleclient.VamsasFile;
-import uk.ac.vamsas.objects.core.Entry;
-import uk.ac.vamsas.objects.core.VamsasDocument;
-import uk.ac.vamsas.test.simpleclient.ArchiveClient;
-import uk.ac.vamsas.test.simpleclient.ClientDoc;
-
-/**
- * @author jimp
- *
- */
-public class VamsasClient extends ArchiveClient {
- org.apache.commons.logging.Log log=org.apache.commons.logging.LogFactory.getLog(VamsasClient.class);
- /**
- * create a new vamsas client session from the archive at sessionPath.
- * @param sessionPath
- */
- public VamsasClient(File sessionPath) {
- super(System.getProperty("user.name"),System.getProperty("host.name"), "SimpleVamsasClientApp","0.1",
- sessionPath);
- }
- /**
- * Called by gui to read anything from the vamsas session into the apps datamodel
- * after it has started up.
- *
- */
- public void initial_update() {
- log.info("Jalview loading the Vamsas Session.");
- // load in the vamsas archive for the first time
- ClientDoc cdoc = this.getUpdateable();
- updateJalview(cdoc);
- // TODO: flush any new VorbaIds to the document : updateVamsasClient may actually generate new Vamsas Document data in the form of vamsas element ids - these should be written back to the document.
- //doUpdate(cdoc); // JBPNote: this should flush new VorbaIds but I've not tested it yet.
- cdoc.closeDoc();
- // then tell app to update its display based on the datamodel changes.
- }
- VamsasClientWatcher watcher=null;
- /**
- * Called by app when internal datamodel should exported (syncrhonised outwards) to vamsas document
- *
- */
- public void push_update() {
-
- watchForChange=false; // this makes any watch(long) loops return.
- // we should also wait arount for this.WATCH_SLEEP to really make sure the watcher thread has stopped.
- try {
- Thread.sleep(WATCH_SLEEP);
- } catch (Exception e) {
-
- };
-
- ClientDoc cdoc = getUpdateable();
- updateVamsasDocument(cdoc);
- doUpdate(cdoc);
- cdoc.closeDoc();
- cdoc=null;
- watchForChange=true;
- startWatcher();
- }
- public void end_session() {
- watchForChange=false; // this makes any watch(long) loops return.
- // we should also wait arount for this.WATCH_SLEEP to really make sure the watcher thread has stopped.
- try {
- Thread.sleep(WATCH_SLEEP);
- } catch (Exception e) {
-
- };
-
- // stop any update/watcher thread.
- log.info("VamsasClientApplication disconnecting from the Vamsas Session.");
- }
- public void updateJalview(ClientDoc cdoc) {
- ensureVamsasBindings();
- VamsasDatastore vds = new VamsasDatastore(cdoc, vobj2jv, jv2vobj, baseProvEntry());
- vds.updateToJalview();
- }
- private void ensureVamsasBindings() {
- if (jv2vobj==null) {
- jv2vobj = new IdentityHashMap();
- vobj2jv = new Hashtable();
- }
- }
- /**
- * App's object binding to VorbaIds
- */
- IdentityHashMap jv2vobj = null;
- Hashtable vobj2jv = null;
- /**
- * called with a vamsas document which will be updated with new data from the app
- * @param doc
- */
- public void updateVamsasDocument(ClientDoc doc) {
- ensureVamsasBindings();
- VamsasDatastore vds = new VamsasDatastore(doc, vobj2jv, jv2vobj, baseProvEntry());
- // wander through frames
- vds.storeVAMSAS(new Object()); // Object is the apps datamodel ;)
- }
- /**
- *
- * @return a base provenance entry used by the VamsasDatastore object to get attributes from. this isn't particularly elegant either.
- */
- private Entry baseProvEntry() {
- uk.ac.vamsas.objects.core.Entry pentry = new uk.ac.vamsas.objects.core.Entry();
- pentry.setUser(this.getProvenanceUser());
- pentry.setApp(this.getClientHandle().getClientName());
- pentry.setDate(new java.util.Date());
- pentry.setAction("created");
- return pentry;
- }
- protected class VamsasClientWatcher extends Thread implements Runnable {
- /* (non-Javadoc)
- * @see java.lang.Thread#run()
- */
- VamsasClient client=null;
- VamsasClientWatcher(VamsasClient client) {
- this.client = client;
- }
- boolean running=false;
- public void run() {
- running=true;
- while (client.watchForChange) {
- ClientDoc docio = client.watch(0);
- if (docio!=null) {
- // VamsasClient GUI bits should be disabled whilst an update is in progress so the user doesn't screw anything up.
- client.disableGui(true);
- log.debug("Updating VamsasClient app from changed vamsas document.");
- client.updateJalview(docio);
- log.debug("Finished updating from document change.");
- docio.closeDoc();
- docio=null;
- client.disableGui(false);
- }
- }
- running=false;
-
- }
-
- }
- /**
- * @param args
- */
- public static void main(String[] args) {
- // TODO Auto-generated method stub
-
- }
- /**
- * disable (if b is true) or enable (if b is true) the VamsasClient's vamsas session gui bits whilst a document change is being updated to the app.
- * @param b
- */
- public void disableGui(boolean b) {
- // in jalview, we turn off the VAMSAS Session menu : Desktop.instance.setVamsasUpdate(b);
- }
- /**
- * spawn a new thread to start the VamsasClientWatcher.
- *
- */
- public void startWatcher() {
- if (watcher==null)
- watcher=new VamsasClientWatcher(this);
- Thread thr = new Thread() {
- public void run() {
- watcher.start();
- }
- };
- thr.start();
- }
-
-}
+/*
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
+ */
+package uk.ac.vamsas.test.simpleclient.simpleapp;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.OutputStreamWriter;
+import java.io.PrintWriter;
+import java.util.Hashtable;
+import java.util.IdentityHashMap;
+import java.util.Vector;
+import java.util.jar.JarOutputStream;
+
+import javax.swing.JInternalFrame;
+
+import uk.ac.vamsas.client.UserHandle;
+import uk.ac.vamsas.client.simpleclient.FileWatcher;
+import uk.ac.vamsas.client.simpleclient.VamsasArchive;
+import uk.ac.vamsas.client.simpleclient.VamsasFile;
+import uk.ac.vamsas.objects.core.Entry;
+import uk.ac.vamsas.objects.core.VamsasDocument;
+import uk.ac.vamsas.test.simpleclient.ArchiveClient;
+import uk.ac.vamsas.test.simpleclient.ClientDoc;
+
+/**
+ * @author jimp
+ *
+ */
+public class VamsasClient extends ArchiveClient {
+ org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory
+ .getLog(VamsasClient.class);
+
+ /**
+ * create a new vamsas client session from the archive at sessionPath.
+ *
+ * @param sessionPath
+ */
+ public VamsasClient(File sessionPath) {
+ super(System.getProperty("user.name"), System.getProperty("host.name"),
+ "SimpleVamsasClientApp", "0.1", sessionPath);
+ }
+
+ /**
+ * Called by gui to read anything from the vamsas session into the apps
+ * datamodel after it has started up.
+ *
+ */
+ public void initial_update() {
+ log.info("Jalview loading the Vamsas Session.");
+ // load in the vamsas archive for the first time
+ ClientDoc cdoc = this.getUpdateable();
+ updateJalview(cdoc);
+ // TODO: flush any new VorbaIds to the document : updateVamsasClient may
+ // actually generate new Vamsas Document data in the form of vamsas element
+ // ids - these should be written back to the document.
+ // doUpdate(cdoc); // JBPNote: this should flush new VorbaIds but I've not
+ // tested it yet.
+ cdoc.closeDoc();
+ // then tell app to update its display based on the datamodel changes.
+ }
+
+ VamsasClientWatcher watcher = null;
+
+ /**
+ * Called by app when internal datamodel should exported (syncrhonised
+ * outwards) to vamsas document
+ *
+ */
+ public void push_update() {
+
+ watchForChange = false; // this makes any watch(long) loops return.
+ // we should also wait arount for this.WATCH_SLEEP to really make sure the
+ // watcher thread has stopped.
+ try {
+ Thread.sleep(WATCH_SLEEP);
+ } catch (Exception e) {
+
+ }
+ ;
+
+ ClientDoc cdoc = getUpdateable();
+ updateVamsasDocument(cdoc);
+ doUpdate(cdoc);
+ cdoc.closeDoc();
+ cdoc = null;
+ watchForChange = true;
+ startWatcher();
+ }
+
+ public void end_session() {
+ watchForChange = false; // this makes any watch(long) loops return.
+ // we should also wait arount for this.WATCH_SLEEP to really make sure the
+ // watcher thread has stopped.
+ try {
+ Thread.sleep(WATCH_SLEEP);
+ } catch (Exception e) {
+
+ }
+ ;
+
+ // stop any update/watcher thread.
+ log.info("VamsasClientApplication disconnecting from the Vamsas Session.");
+ }
+
+ public void updateJalview(ClientDoc cdoc) {
+ ensureVamsasBindings();
+ VamsasDatastore vds = new VamsasDatastore(cdoc, vobj2jv, jv2vobj,
+ baseProvEntry());
+ vds.updateToJalview();
+ }
+
+ private void ensureVamsasBindings() {
+ if (jv2vobj == null) {
+ jv2vobj = new IdentityHashMap();
+ vobj2jv = new Hashtable();
+ }
+ }
+
+ /**
+ * App's object binding to VorbaIds
+ */
+ IdentityHashMap jv2vobj = null;
+
+ Hashtable vobj2jv = null;
+
+ /**
+ * called with a vamsas document which will be updated with new data from the
+ * app
+ *
+ * @param doc
+ */
+ public void updateVamsasDocument(ClientDoc doc) {
+ ensureVamsasBindings();
+ VamsasDatastore vds = new VamsasDatastore(doc, vobj2jv, jv2vobj,
+ baseProvEntry());
+ // wander through frames
+ vds.storeVAMSAS(new Object()); // Object is the apps datamodel ;)
+ }
+
+ /**
+ *
+ * @return a base provenance entry used by the VamsasDatastore object to get
+ * attributes from. this isn't particularly elegant either.
+ */
+ private Entry baseProvEntry() {
+ uk.ac.vamsas.objects.core.Entry pentry = new uk.ac.vamsas.objects.core.Entry();
+ pentry.setUser(this.getProvenanceUser());
+ pentry.setApp(this.getClientHandle().getClientName());
+ pentry.setDate(new java.util.Date());
+ pentry.setAction("created");
+ return pentry;
+ }
+
+ protected class VamsasClientWatcher extends Thread implements Runnable {
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.Thread#run()
+ */
+ VamsasClient client = null;
+
+ VamsasClientWatcher(VamsasClient client) {
+ this.client = client;
+ }
+
+ boolean running = false;
+
+ public void run() {
+ running = true;
+ while (client.watchForChange) {
+ ClientDoc docio = client.watch(0);
+ if (docio != null) {
+ // VamsasClient GUI bits should be disabled whilst an update is in
+ // progress so the user doesn't screw anything up.
+ client.disableGui(true);
+ log.debug("Updating VamsasClient app from changed vamsas document.");
+ client.updateJalview(docio);
+ log.debug("Finished updating from document change.");
+ docio.closeDoc();
+ docio = null;
+ client.disableGui(false);
+ }
+ }
+ running = false;
+
+ }
+
+ }
+
+ /**
+ * @param args
+ */
+ public static void main(String[] args) {
+ // TODO Auto-generated method stub
+
+ }
+
+ /**
+ * disable (if b is true) or enable (if b is true) the VamsasClient's vamsas
+ * session gui bits whilst a document change is being updated to the app.
+ *
+ * @param b
+ */
+ public void disableGui(boolean b) {
+ // in jalview, we turn off the VAMSAS Session menu :
+ // Desktop.instance.setVamsasUpdate(b);
+ }
+
+ /**
+ * spawn a new thread to start the VamsasClientWatcher.
+ *
+ */
+ public void startWatcher() {
+ if (watcher == null)
+ watcher = new VamsasClientWatcher(this);
+ Thread thr = new Thread() {
+ public void run() {
+ watcher.start();
+ }
+ };
+ thr.start();
+ }
+
+}
diff --git a/src/uk/ac/vamsas/test/simpleclient/simpleapp/VamsasDatastore.java b/src/uk/ac/vamsas/test/simpleclient/simpleapp/VamsasDatastore.java
index aecf14f..c14598c 100644
--- a/src/uk/ac/vamsas/test/simpleclient/simpleapp/VamsasDatastore.java
+++ b/src/uk/ac/vamsas/test/simpleclient/simpleapp/VamsasDatastore.java
@@ -1,26 +1,26 @@
/*
- * VamsasClientSimpleApp - A framework for interoparable Sequence analysis
- * Copyright (C) 2006 VAMSAS
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
+ * This file is part of the Vamsas Client version 0.1.
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
+ * Andrew Waterhouse and Dominik Lindner.
+ *
+ * Earlier versions have also been incorporated into Jalview version 2.4
+ * since 2008, and TOPALi version 2 since 2007.
+ *
+ * The Vamsas Client is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Vamsas Client is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the Vamsas Client. If not, see .
*/
-
package uk.ac.vamsas.test.simpleclient.simpleapp;
-
-
import java.io.*;
import java.util.HashMap;
import java.util.HashSet;
@@ -46,9 +46,10 @@ import uk.ac.vamsas.test.simpleclient.ClientDoc;
*/
public class VamsasDatastore {
- org.apache.commons.logging.Log log=org.apache.commons.logging.LogFactory.getLog(VamsasDatastore.class);
- Entry provEntry = null;
+ org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory
+ .getLog(VamsasDatastore.class);
+ Entry provEntry = null;
org.exolab.castor.types.Date date = new org.exolab.castor.types.Date(
new java.util.Date());
@@ -61,7 +62,7 @@ public class VamsasDatastore {
public VamsasDatastore(ClientDoc cdoc, Hashtable vobj2jv,
IdentityHashMap jv2vobj, Entry provEntry) {
- this.cdoc = cdoc;
+ this.cdoc = cdoc;
this.vobj2jv = vobj2jv;
this.jv2vobj = jv2vobj;
this.provEntry = provEntry;
@@ -80,8 +81,6 @@ public class VamsasDatastore {
*
* marshaller.setMapping(map); marshaller.marshal(af); } catch (Exception e) {
* e.printStackTrace(); } }
- *
- *
*/
/**
* @return the Vobject bound to Jalview datamodel object
@@ -99,11 +98,9 @@ public class VamsasDatastore {
*/
protected Object getvObj2jv(uk.ac.vamsas.client.Vobject vobj) {
VorbaId id = vobj.getVorbaId();
- if (id == null)
- {
+ if (id == null) {
id = cdoc.registerObject(vobj);
- log
- .debug("Registering new object and returning null for getvObj2jv");
+ log.debug("Registering new object and returning null for getvObj2jv");
return null;
}
if (vobj2jv.containsKey(vobj.getVorbaId()))
@@ -113,18 +110,17 @@ public class VamsasDatastore {
protected void bindjvvobj(Object jvobj, uk.ac.vamsas.client.Vobject vobj) {
VorbaId id = vobj.getVorbaId();
- if (id == null)
- {
+ if (id == null) {
id = cdoc.registerObject(vobj);
- if (id==null || vobj.getVorbaId()==null)
- log.error("Failed to get id for "+(vobj.isRegisterable() ? "registerable" : "unregisterable") +" object "+vobj);
+ if (id == null || vobj.getVorbaId() == null)
+ log.error("Failed to get id for "
+ + (vobj.isRegisterable() ? "registerable" : "unregisterable")
+ + " object " + vobj);
}
- if (vobj2jv.containsKey(vobj.getVorbaId()) || jv2vobj.containsKey(jvobj))
- {
- log.error("Duplicate object binding! "+vobj+" id " +vobj.getVorbaId().getId()+" to "+jvobj);
- }
- else
- {
+ if (vobj2jv.containsKey(vobj.getVorbaId()) || jv2vobj.containsKey(jvobj)) {
+ log.error("Duplicate object binding! " + vobj + " id "
+ + vobj.getVorbaId().getId() + " to " + jvobj);
+ } else {
vobj2jv.put(vobj.getVorbaId(), jvobj);// JBPNote - better implementing a
// hybrid invertible hash.
jv2vobj.put(jvobj, vobj.getVorbaId());
@@ -140,8 +136,7 @@ public class VamsasDatastore {
boolean nw = false;
VAMSAS root = null; // will be resolved based on Dataset Parent.
DataSet dataset = (DataSet) getjv2vObj(fromAppsDatamodel);
- if (dataset == null)
- {
+ if (dataset == null) {
root = cdoc.getVamsasRoots()[0]; // default vamsas root for modifying.
dataset = new DataSet();
root.addDataSet(dataset);
@@ -156,9 +151,9 @@ public class VamsasDatastore {
}
private Property newProperty(String name, String type, String content) {
- Property vProperty=new Property();
+ Property vProperty = new Property();
vProperty.setName(name);
- if (type!=null)
+ if (type != null)
vProperty.setType(type);
vProperty.setContent(content);
return vProperty;
@@ -167,10 +162,12 @@ public class VamsasDatastore {
/**
* get start0 && dseta.getPosCount()>0)
- throw new Error("Invalid vamsas RangeType - cannot resolve both lists of Pos and Seg from choice!");
- if (dseta.getSegCount() > 0)
- {
- se = getSegRange(dseta.getSeg(0),true);
- for (int s = 1, sSize = dseta.getSegCount(); s < sSize; s++)
- {
+ if (dseta.getSegCount() > 0 && dseta.getPosCount() > 0)
+ throw new Error(
+ "Invalid vamsas RangeType - cannot resolve both lists of Pos and Seg from choice!");
+ if (dseta.getSegCount() > 0) {
+ se = getSegRange(dseta.getSeg(0), true);
+ for (int s = 1, sSize = dseta.getSegCount(); s < sSize; s++) {
int nse[] = getSegRange(dseta.getSeg(s), true);
if (se[0] > nse[0])
se[0] = nse[0];
@@ -239,13 +235,12 @@ public class VamsasDatastore {
se[1] = nse[1];
}
}
- if (dseta.getPosCount() > 0)
- {
- // could do a polarity for pos range too. and pass back indication of discontinuities.
+ if (dseta.getPosCount() > 0) {
+ // could do a polarity for pos range too. and pass back indication of
+ // discontinuities.
int pos = dseta.getPos(0).getI();
se = new int[] { pos, pos };
- for (int p = 0, pSize = dseta.getPosCount(); p < pSize; p++)
- {
+ for (int p = 0, pSize = dseta.getPosCount(); p < pSize; p++) {
pos = dseta.getPos(p).getI();
if (se[0] > pos)
se[0] = pos;
@@ -257,53 +252,52 @@ public class VamsasDatastore {
}
return null;
}
+
/**
- * map from a rangeType's internal frame to the referenced object's coordinate frame.
+ * map from a rangeType's internal frame to the referenced object's coordinate
+ * frame.
+ *
* @param dseta
* @return int [] { ref(pos)...} for all pos in rangeType's frame.
*/
private int[] getMapping(RangeType dseta) {
- Vector posList=new Vector();
- if (dseta != null)
- {
+ Vector posList = new Vector();
+ if (dseta != null) {
int[] se = null;
- if (dseta.getSegCount()>0 && dseta.getPosCount()>0)
- throw new Error("Invalid vamsas RangeType - cannot resolve both lists of Pos and Seg from choice!");
- if (dseta.getSegCount() > 0)
- {
- for (int s = 0, sSize = dseta.getSegCount(); s < sSize; s++)
- {
+ if (dseta.getSegCount() > 0 && dseta.getPosCount() > 0)
+ throw new Error(
+ "Invalid vamsas RangeType - cannot resolve both lists of Pos and Seg from choice!");
+ if (dseta.getSegCount() > 0) {
+ for (int s = 0, sSize = dseta.getSegCount(); s < sSize; s++) {
se = getSegRange(dseta.getSeg(s), false);
- int se_end=se[1-se[2]]+(se[2]==0 ? 1 : -1);
- for (int p=se[se[2]]; p!=se_end; p+=se[2]==0 ? 1 : -1 ) {
+ int se_end = se[1 - se[2]] + (se[2] == 0 ? 1 : -1);
+ for (int p = se[se[2]]; p != se_end; p += se[2] == 0 ? 1 : -1) {
posList.add(new Integer(p));
}
}
- }
- else if (dseta.getPosCount() > 0)
- {
+ } else if (dseta.getPosCount() > 0) {
int pos = dseta.getPos(0).getI();
- for (int p = 0, pSize = dseta.getPosCount(); p < pSize; p++)
- {
+ for (int p = 0, pSize = dseta.getPosCount(); p < pSize; p++) {
pos = dseta.getPos(p).getI();
posList.add(new Integer(pos));
}
}
}
- if (posList!=null && posList.size()>0) {
- int[] range=new int[posList.size()];
- for (int i=0; i 0) {
+ int[] range = new int[posList.size()];
+ for (int i = 0; i < range.length; i++)
+ range[i] = ((Integer) posList.elementAt(i)).intValue();
posList.clear();
return range;
}
return null;
}
+
/**
*
- * @return default initial provenance list for a VamsasDatastore created vamsas
- * object.
+ * @return default initial provenance list for a VamsasDatastore created
+ * vamsas object.
*/
Provenance dummyProvenance() {
return dummyProvenance(null);