// // ------ // // SAVOT Sample // // Author: André Schaaff // Address: Centre de Donnees astronomiques de Strasbourg // 11 rue de l'Universite // 67000 STRASBOURG // FRANCE // Email: schaaff@astro.u-strasbg.fr, question@simbad.u-strasbg.fr // // ------- // // In accordance with the international conventions about intellectual // property rights this software and associated documentation files // (the "Software") is protected. The rightholder authorizes : // the reproduction and representation as a private copy or for educational // and research purposes outside any lucrative use, // subject to the following conditions: // // The above copyright notice shall be included. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON INFRINGEMENT, // LOSS OF DATA, LOSS OF PROFIT, LOSS OF BARGAIN OR IMPOSSIBILITY // TO USE SUCH SOFWARE. IN NO EVENT SHALL THE RIGHTHOLDER BE LIABLE // FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH // THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // // For any other exploitation contact the rightholder. // // ----------- // // Conformement aux conventions internationales relatives aux droits de // propriete intellectuelle ce logiciel et sa documentation sont proteges. // Le titulaire des droits autorise : // la reproduction et la representation a titre de copie privee ou des fins // d'enseignement et de recherche et en dehors de toute utilisation lucrative. // Cette autorisation est faite sous les conditions suivantes : // // La mention du copyright portee ci-dessus devra etre clairement indiquee. // // LE LOGICIEL EST LIVRE "EN L'ETAT", SANS GARANTIE D'AUCUNE SORTE. // LE TITULAIRE DES DROITS NE SAURAIT, EN AUCUN CAS ETRE TENU CONTRACTUELLEMENT // OU DELICTUELLEMENT POUR RESPONSABLE DES DOMMAGES DIRECTS OU INDIRECTS // (Y COMPRIS ET A TITRE PUREMENT ILLUSTRATIF ET NON LIMITATIF, // LA PRIVATION DE JOUISSANCE DU LOGICIEL, LA PERTE DE DONNEES, // LE MANQUE A GAGNER OU AUGMENTATION DE COUTS ET DEPENSES, LES PERTES // D'EXPLOITATION,LES PERTES DE MARCHES OU TOUTES ACTIONS EN CONTREFACON) // POUVANT RESULTER DE L'UTILISATION, DE LA MAUVAISE UTILISATION // OU DE L'IMPOSSIBILITE D'UTILISER LE LOGICIEL, ALORS MEME // QU'IL AURAIT ETE AVISE DE LA POSSIBILITE DE SURVENANCE DE TELS DOMMAGES. // // Pour toute autre utilisation contactez le titulaire des droits. // import java.io.*; import cds.savot.model.*; import cds.savot.pull.*; /** *
A sample designed to show the sequential usage of the pull parser
* @author Andre Schaaff * @version 2.1.3 Copyright CDS 2002-2004 */ public class PullSeqSample { /** * * @param source * @param target * @param type */ public PullSeqSample(String source, String target, int type) { TRSet tr = null; try { // begin the parsing SavotPullParser sb = new SavotPullParser(source, type); // get the next resource of the VOTable file SavotResource currentResource = sb.getNextResource(); // while a resource is available while (currentResource != null) { System.out.println("-----------------------------------------------------"); System.out.println("RESOURCE" + " (" + currentResource.getName() + ")" + " BEGIN"); // for each table of this resource for (int i = 0; i < currentResource.getTableCount(); i++) { tr = currentResource.getTRSet(i); System.out.println("Desc : " + currentResource.getDescription()); if (tr != null) { System.out.println("Number of items in TRset (= number of