01: /*
02: * uDig - User Friendly Desktop Internet GIS client
03: * http://udig.refractions.net
04: * (C) 2004, Refractions Research Inc.
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation;
09: * version 2.1 of the License.
10: *
11: * This library is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Lesser General Public License for more details.
15: *
16: */
17: package net.refractions.udig.catalog;
18:
19: import java.net.URL;
20:
21: /**
22: * Represents a bean style metadata accessor for metadata about a catalog. This may be the result of
23: * a request to a metadata service. All methods within an implementation of this interface should
24: * NOT block. Much of this is based on Dublin Core and the RDF application profile.
25: *
26: * @author David Zwiers, Refractions Research
27: * @since 0.6
28: */
29: public class ICatalogInfo {
30: protected String title, description;
31: protected URL source;
32: protected String[] keywords;
33:
34: protected ICatalogInfo() {
35: // for sub-classes
36: }
37:
38: public ICatalogInfo(String title, String description, URL source,
39: String[] keywords) {
40: this .title = title;
41: this .description = description;
42: this .source = source;
43: int i = 0;
44: if (keywords != null) {
45: i = keywords.length;
46: String[] k = new String[i];
47: System.arraycopy(keywords, 0, k, 0, k.length);
48: this .keywords = k;
49: }
50: }
51:
52: /**
53: * returns the catalog title May Not Block.
54: *
55: * @return
56: */
57: public String getTitle() {
58: return title;
59: }
60:
61: /**
62: * returns the keywords assocaited with this catalog May Not Block. Maps to Dublin Core's
63: * Subject element
64: *
65: * @return
66: */
67: public String[] getKeywords() { // aka Subject
68: int i = 0;
69: if (keywords != null)
70: i = keywords.length;
71: String[] k = new String[i];
72: if (keywords != null)
73: System.arraycopy(keywords, 0, k, 0, k.length);
74: return k;
75: }
76:
77: /**
78: * returns the catalog description.
79: *
80: * @return
81: */
82: public String getDescription() {
83: return description;
84: }
85:
86: /**
87: * Returns the catalog source. May Not Block. Maps to the Dublin Core Server Element
88: *
89: * @return
90: */
91: public URL getSource() { // aka server
92: return source;
93: }
94: }
|