001: /*
002: * Copyright 2004 Sun Microsystems, Inc.
003: *
004: * Licensed under the Apache License, Version 2.0 (the "License");
005: * you may not use this file except in compliance with the License.
006: * You may obtain a copy of the License at
007: *
008: * http://www.apache.org/licenses/LICENSE-2.0
009: *
010: * Unless required by applicable law or agreed to in writing, software
011: * distributed under the License is distributed on an "AS IS" BASIS,
012: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013: * See the License for the specific language governing permissions and
014: * limitations under the License.
015: *
016: */
017: package com.sun.syndication.feed.rss;
018:
019: import com.sun.syndication.feed.impl.ObjectBean;
020:
021: import java.io.Serializable;
022:
023: /**
024: * Bean for images of RSS feeds.
025: * <p>
026: * @author Alejandro Abdelnur
027: *
028: */
029: public class Image implements Cloneable, Serializable {
030: private ObjectBean _objBean;
031: private String _title;
032: private String _url;
033: private String _link;
034: private int _width = -1;
035: private int _height = -1;
036: private String _description;
037:
038: /**
039: * Default constructor. All properties are set to <b>null</b>.
040: * <p>
041: *
042: */
043: public Image() {
044: _objBean = new ObjectBean(this .getClass(), this );
045: }
046:
047: /**
048: * Creates a deep 'bean' clone of the object.
049: * <p>
050: * @return a clone of the object.
051: * @throws CloneNotSupportedException thrown if an element of the object cannot be cloned.
052: *
053: */
054: public Object clone() throws CloneNotSupportedException {
055: return _objBean.clone();
056: }
057:
058: /**
059: * Indicates whether some other object is "equal to" this one as defined by the Object equals() method.
060: * <p>
061: * @param other he reference object with which to compare.
062: * @return <b>true</b> if 'this' object is equal to the 'other' object.
063: *
064: */
065: public boolean equals(Object other) {
066: return _objBean.equals(other);
067: }
068:
069: /**
070: * Returns a hashcode value for the object.
071: * <p>
072: * It follows the contract defined by the Object hashCode() method.
073: * <p>
074: * @return the hashcode of the bean object.
075: *
076: */
077: public int hashCode() {
078: return _objBean.hashCode();
079: }
080:
081: /**
082: * Returns the String representation for the object.
083: * <p>
084: * @return String representation for the object.
085: *
086: */
087: public String toString() {
088: return _objBean.toString();
089: }
090:
091: /**
092: * Returns the image title.
093: * <p>
094: * @return the image title, <b>null</b> if none.
095: *
096: */
097: public String getTitle() {
098: return _title;
099: }
100:
101: /**
102: * Sets the image title.
103: * <p>
104: * @param title the image title to set, <b>null</b> if none.
105: *
106: */
107: public void setTitle(String title) {
108: _title = title;
109: }
110:
111: /**
112: * Returns the image URL.
113: * <p>
114: * @return the image URL, <b>null</b> if none.
115: *
116: */
117: public String getUrl() {
118: return _url;
119: }
120:
121: /**
122: * Sets the image URL.
123: * <p>
124: * @param url the image URL to set, <b>null</b> if none.
125: *
126: */
127: public void setUrl(String url) {
128: _url = url;
129: }
130:
131: /**
132: * Returns the image link.
133: * <p>
134: * @return the image link, <b>null</b> if none.
135: *
136: */
137: public String getLink() {
138: return _link;
139: }
140:
141: /**
142: * Sets the image link.
143: * <p>
144: * @param link the image link to set, <b>null</b> if none.
145: *
146: */
147: public void setLink(String link) {
148: _link = link;
149: }
150:
151: /**
152: * Returns the image width.
153: * <p>
154: * @return the image width, <b>null</b> if none.
155: *
156: */
157: public int getWidth() {
158: return _width;
159: }
160:
161: /**
162: * Sets the image width.
163: * <p>
164: * @param width the image width to set, <b>null</b> if none.
165: *
166: */
167: public void setWidth(int width) {
168: _width = width;
169: }
170:
171: /**
172: * Returns the image height.
173: * <p>
174: * @return the image height, <b>null</b> if none.
175: *
176: */
177: public int getHeight() {
178: return _height;
179: }
180:
181: /**
182: * Sets the image height.
183: * <p>
184: * @param height the image height to set, <b>null</b> if none.
185: *
186: */
187: public void setHeight(int height) {
188: _height = height;
189: }
190:
191: /**
192: * Returns the image description.
193: * <p>
194: * @return the image description, <b>null</b> if none.
195: *
196: */
197: public String getDescription() {
198: return _description;
199: }
200:
201: /**
202: * Sets the image description.
203: * <p>
204: * @param description the image description to set, <b>null</b> if none.
205: *
206: */
207: public void setDescription(String description) {
208: _description = description;
209: }
210:
211: }
|