Revision 20374 trunk/libraries/libjni-mrsid/src/main/java/es/gva/cit/jmrsid/LTIMetadataRecord.java

View differences:

LTIMetadataRecord.java
82 82
	 * Destructor 
83 83
	 */
84 84
	protected void finalize(){
85
		if(cPtr > 0)
85
		if(cPtr != 0)
86 86
			FreeLTIMetadataRecordNat(cPtr);
87 87
	}
88 88
	
......
103 103
	 */
104 104
	public String getTagName()throws MrSIDException{
105 105
		
106
		if(cPtr <= 0)
106
		if(cPtr == 0)
107 107
		 	throw new MrSIDException("Error en getTagName. La referencia al objeto no es valida.");
108 108

  
109 109
		String tagname = getTagNameNat(cPtr);
110 110
				
111
		if(tagname==null)
111
		if(tagname == null)
112 112
		 	throw new MrSIDException("No se ha devuelto un nombre de tag valido");
113
		 else return tagname;
113
		
114
		return tagname;
114 115
	}
115 116
	
116 117
	/**
......
120 121
	 */
121 122
	public boolean isScalar()throws MrSIDException{
122 123
		
123
		if(cPtr <= 0)
124
		if (cPtr == 0)
124 125
		 	throw new MrSIDException("Error en getTagName. La referencia al objeto no es valida.");
126
		
125 127
		int res = isScalarNat(cPtr);
126 128
		
127
		if(res==1)return true;
129
		if (res == 1)return true;
128 130
		else return false;
129
		
131
	
130 132
	}
131 133
	
132 134
	/**
......
135 137
	 * @return true si es vector y false si no lo es
136 138
	 */
137 139
	public boolean isVector()throws MrSIDException{
138
		if(cPtr <= 0)
140
		if(cPtr == 0)
139 141
		 	throw new MrSIDException("Error en isVector. La referencia al objeto no es valida.");
140 142

  
141 143
		int res = isVectorNat(cPtr);
......
151 153
	 * @return true si es array y false si no lo es
152 154
	 */
153 155
	public boolean isArray()throws MrSIDException{
154
		if(cPtr <= 0)
156
		if(cPtr == 0)
155 157
		 	throw new MrSIDException("Error en getTagName. La referencia al objeto no es valida.");
156 158

  
157 159
		int res = isArrayNat(cPtr);
......
182 184
	 * 
183 185
	 */
184 186
	public int getDataType()throws MrSIDException{
185
		if(cPtr <= 0)
187
		if(cPtr == 0)
186 188
		 	throw new MrSIDException("Error en getDataType. La referencia al objeto no es valida.");
187 189
		
188 190
		int res = getDataTypeNat(cPtr);
189 191
		
190
		if(res<0)
192
		if(res < 0)
191 193
			throw new MrSIDException("Error en getDataType. No se ha obtenido un tipo de datos valido");
192
		else return res;
194
		
195
		return res;
193 196
	}
194 197
	
195 198
	/**
......
202 205
		
203 206
		String datos=null;
204 207
		
205
		if(cPtr <= 0)
208
		if(cPtr == 0)
206 209
		 	throw new MrSIDException("Error en getScalarData. La referencia al objeto no es valida.");
207 210
		
208 211
		datos = getScalarDataNat(cPtr);
......
217 220
	 * @return vector de strings con los valores del metadato
218 221
	 */
219 222
	public String[] getVectorData()throws MrSIDException{
220
		if(cPtr <= 0)
223
		if(cPtr == 0)
221 224
		 	throw new MrSIDException("Error en getVectorData. La referencia al objeto no es valida.");
222 225
		
223 226
		StringArray res = getVectorDataNat(cPtr);
224 227
		
225
		if(res!=null)return res.array;
228
		if(res != null)return res.array;
226 229
		else return null;
227 230
	}
228 231
	
......
233 236
	 * @return vector de strings con los valores del metadato
234 237
	 */
235 238
	public String[] getArrayData()throws MrSIDException{
236
		if(cPtr <= 0)
239
		if(cPtr == 0)
237 240
		 	throw new MrSIDException("Error en getArrayData. La referencia al objeto no es valida.");
238 241

  
239 242
		StringArray res = getArrayDataNat(cPtr);
240 243
		
241
		if(res!=null)return res.array;
244
		if(res != null)return res.array;
242 245
		else return null;
243 246
	}
244 247
	
......
250 253
	
251 254
	public int getNumDims()throws MrSIDException{
252 255
		
253
		if(cPtr <= 0)
256
		if(cPtr == 0)
254 257
		 	throw new MrSIDException("Error en getNumDims. La referencia al objeto no es valida.");
255 258
		
256 259
		int res = getNumDimsNat(cPtr);
......
268 271
	 */
269 272
	 public int[] getDims()throws MrSIDException{
270 273
	 	
271
	 	if(cPtr <= 0)
274
	 	if(cPtr == 0)
272 275
		 	throw new MrSIDException("Error en getDims. La referencia al objeto no es valida.");
273 276
	 	
274 277
	 	int[] res =  getDimsNat(cPtr);

Also available in: Unified diff