001: /**********************************************************************************
002:
003: Feedzeo!
004: A free and open source RSS/Atom/RDF feed aggregator
005:
006: Copyright (C) 2005-2006 Anand Rao (anandrao@users.sourceforge.net)
007:
008: This library is free software; you can redistribute it and/or
009: modify it under the terms of the GNU Lesser General Public
010: License as published by the Free Software Foundation; either
011: version 2.1 of the License, or (at your option) any later version.
012:
013: This library is distributed in the hope that it will be useful,
014: but WITHOUT ANY WARRANTY; without even the implied warranty of
015: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
016: Lesser General Public License for more details.
017:
018: You should have received a copy of the GNU Lesser General Public
019: License along with this library; if not, write to the Free Software
020: Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
021:
022: ************************************************************************************/package data;
023:
024: import java.net.*;
025: import java.util.*;
026:
027: import util.DateUtil;
028:
029: /**
030: *
031: * @author Anand Rao
032: */
033: public class ItemData {
034:
035: private String ItemCreator;
036: private Date CreationDate;
037: private String Title;
038: private String Description;
039: private URL Link;
040:
041: /** Creates a new instance of ItemData */
042: public ItemData() {
043: }
044:
045: public String getCreator() {
046: return ItemCreator;
047: }
048:
049: public String getTitle() {
050: return Title;
051: }
052:
053: public String getDescription() {
054: return Description;
055: }
056:
057: public Date getCreationDate() {
058: return CreationDate;
059: }
060:
061: public URL getLink() {
062: return Link;
063: }
064:
065: public void setCreator(String Creator) {
066: this .ItemCreator = Creator;
067: }
068:
069: public void setTitle(String Title) {
070: this .Title = Title;
071: }
072:
073: public void setDescription(String Description) {
074: this .Description = Description;
075: }
076:
077: public void setCreationDate(Date CreationDate) {
078: this .CreationDate = CreationDate;
079: }
080:
081: public void setLink(URL Link) {
082: this .Link = Link;
083: }
084:
085: public String getData(String type) {
086: if (type.equalsIgnoreCase(DataElement.NEWS_TITLE_ELEM))
087: if (Title != null)
088: return Title;
089: else
090: return "";
091: if (type.equalsIgnoreCase(DataElement.NEWS_DESC_ELEM))
092: if (Description != null)
093: return Description;
094: else
095: return "";
096: if (type.equalsIgnoreCase(DataElement.NEWS_LINK_ELEM))
097: if (Link != null)
098: return Link.toString();
099: else
100: return "";
101: if (type.equalsIgnoreCase(DataElement.NEWS_DATE_ELEM))
102: if (CreationDate != null)
103: return DateUtil.getMonthDayYearStr(CreationDate); //CreationDate.toString();
104: else
105: return "";
106: return "";
107: //todo
108: }
109: }
|