Statistics
| Revision:

svn-gvsig-desktop / trunk / libraries / libjni-mrsid / src / es / gva / cit / jmrsid / LTIMetadataDatabase.java @ 837

History | View | Annotate | Download (2.1 KB)

1
/**********************************************************************
2
 * $Id: LTIMetadataDatabase.java 720 2004-12-28 16:18:01Z igbrotru $
3
 *
4
 * Name:     LTIMetadataDatabase.java
5
 * Project:  JMRSID. Interface java to mrsid (Lizardtech).
6
 * Purpose:   
7
 * Author:   Nacho Brodin, brodin_ign@gva.es
8
 *
9
 **********************************************************************/
10
/*Copyright (C) 2004  Nacho Brodin <brodin_ign@gva.es>
11

12
 This program is free software; you can redistribute it and/or
13
 modify it under the terms of the GNU General Public License
14
 as published by the Free Software Foundation; either version 2
15
 of the License, or (at your option) any later version.
16

17
 This program is distributed in the hope that it will be useful,
18
 but WITHOUT ANY WARRANTY; without even the implied warranty of
19
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20
 GNU General Public License for more details.
21

22
 You should have received a copy of the GNU General Public License
23
 along with this program; if not, write to the Free Software
24
 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
25
 */
26

    
27
package es.gva.cit.jmrsid;
28

    
29

    
30

    
31
/**
32
 * @author Nacho Brodin <brodin_ign@gva.es>.<BR> Equipo de desarrollo gvSIG.<BR> http://www.gvsig.gva.es
33
 * @version 0.0
34
 * @link http://www.gvsig.gva.es
35
 */
36

    
37
public class LTIMetadataDatabase extends JNIBase{
38
        
39
        private native long getDataByIndexNat(long cPtr, int i);
40
                
41
        public LTIMetadataDatabase(long cPtr){
42
                
43
                super.cPtr=cPtr;
44
        }
45
        
46
                
47
        /**
48
         * 
49
         */
50
        
51
        public int getIndexCount()throws MrSIDException{
52
                
53
                String msg1="Error en getIndexCount. No se ha obtenido un puntero valido a LTIMetadataDatabase";
54
                String msg2="La llamada nativa a getIndexCount ha devuelto un c?digo de error";
55
                return baseSimpleFunction(0,msg1,msg2);
56
                
57
        }
58
        
59
        /**
60
         * 
61
         */
62
        
63
        public LTIMetadataRecord getDataByIndex(int i)throws MrSIDException{
64
                
65
                if(cPtr <= 0)
66
                         throw new MrSIDException("Error en getDataByIndex. La referencia al objeto no es valida.");
67

    
68
                LTIMetadataRecord metadata=new LTIMetadataRecord(getDataByIndexNat(cPtr,i));
69
                                
70
                if(metadata==null)
71
                         throw new MrSIDException("Objeto LTIMetadataRecord nulo");
72
                 else return metadata;
73
                
74
        }
75
        
76
        
77
}