001: /*
002: * GeoTools - OpenSource mapping toolkit
003: * http://geotools.org
004: * (C) 2004-2006, Geotools Project Managment Committee (PMC)
005: *
006: * This library is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU Lesser General Public
008: * License as published by the Free Software Foundation; either
009: * version 2.1 of the License, or (at your option) any later version.
010: *
011: * This library is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * Lesser General Public License for more details.
015: */
016: package org.geotools.data.ows;
017:
018: import java.util.List;
019:
020: import org.opengis.layer.Style;
021: import org.opengis.layer.StyleSheetURL;
022: import org.opengis.layer.StyleURL;
023: import org.opengis.util.InternationalString;
024:
025: /**
026: *
027: * @author Richard Gould
028: *
029: */
030: public class StyleImpl implements Style {
031:
032: private String name;
033: private InternationalString title;
034: private InternationalString _abstract;
035: private List legendURLs;
036: private StyleSheetURL styleSheetURL;
037: private StyleURL styleURL;
038: private List featureStyles;
039: private List graphicStyles;
040:
041: public StyleImpl() {
042:
043: }
044:
045: public StyleImpl(String name) {
046: this .name = name;
047: }
048:
049: public InternationalString getAbstract() {
050: return _abstract;
051: }
052:
053: public void setAbstract(InternationalString _abstract) {
054: this ._abstract = _abstract;
055: }
056:
057: public List getFeatureStyles() {
058: return featureStyles;
059: }
060:
061: public void setFeatureStyles(List featureStyles) {
062: this .featureStyles = featureStyles;
063: }
064:
065: public List getGraphicStyles() {
066: return graphicStyles;
067: }
068:
069: public void setGraphicStyles(List graphicStyles) {
070: this .graphicStyles = graphicStyles;
071: }
072:
073: public List getLegendURLs() {
074: return legendURLs;
075: }
076:
077: public void setLegendURLs(List legendURLs) {
078: this .legendURLs = legendURLs;
079: }
080:
081: public String getName() {
082: return name;
083: }
084:
085: public void setName(String name) {
086: this .name = name;
087: }
088:
089: public StyleSheetURL getStyleSheetURL() {
090: return styleSheetURL;
091: }
092:
093: public void setStyleSheetURL(StyleSheetURL styleSheetURL) {
094: this .styleSheetURL = styleSheetURL;
095: }
096:
097: public StyleURL getStyleURL() {
098: return styleURL;
099: }
100:
101: public void setStyleURL(StyleURL styleURL) {
102: this .styleURL = styleURL;
103: }
104:
105: public InternationalString getTitle() {
106: return title;
107: }
108:
109: public void setTitle(InternationalString title) {
110: this .title = title;
111: }
112:
113: public int hashCode() {
114: final int PRIME = 31;
115: int result = 1;
116: result = PRIME * result
117: + ((name == null) ? 0 : name.hashCode());
118: return result;
119: }
120:
121: /**
122: * Because the style's name is declared as unique identifier in the
123: * interface javadocs, we will use that as our equals comparison.
124: *
125: * So if two Styles have the same name, they are considered equal.
126: *
127: */
128: public boolean equals(Object obj) {
129: if (this == obj)
130: return true;
131: if (obj == null)
132: return false;
133: if (getClass() != obj.getClass())
134: return false;
135: final StyleImpl other = (StyleImpl) obj;
136: if (name == null) {
137: if (other.name != null)
138: return false;
139: } else if (!name.equals(other.name))
140: return false;
141: return true;
142: }
143:
144: }
|