Statistics
| Revision:

root / org.gvsig.geotools.proj / trunk / org.gvsig.geotools.proj / org.gvsig.geotools.proj.catalog.impl / src / main / java / org / gvsig / geotools / proj / catalog / utils / IdentifiedObjectUtils.java @ 824

History | View | Annotate | Download (709 Bytes)

1
package org.gvsig.geotools.proj.catalog.utils;
2

    
3
import java.util.Collection;
4

    
5
import org.opengis.metadata.Identifier;
6
import org.opengis.referencing.IdentifiedObject;
7
import org.opengis.referencing.ReferenceIdentifier;
8

    
9
public class IdentifiedObjectUtils {
10

    
11
        public static String getIdentifier(IdentifiedObject object) {
12
                if (object==null) {
13
                        return null;
14
                }
15
                for (ReferenceIdentifier id: object.getIdentifiers()) {
16
                        // return the first one we find
17
                        return id.toString();
18
                }
19
                return null;
20
        }
21
        
22
        public static String getIdentifier(Collection<? extends Identifier> identifiers) {
23
                for (Identifier id: identifiers) {
24
                        // return the first one we find
25
                        return id.getCode();
26
                }
27
                return null;
28
        }
29
}