Home | History | Annotate | Download | only in rssreader
      1 /*
      2  * Copyright (C) 2007 The Android Open Source Project
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 
     17 package com.example.android.rssreader;
     18 
     19 /**
     20  * Simple struct class to hold the data for one rss item --
     21  * title, link, description.
     22  */
     23 public class RssItem  {
     24     private CharSequence mTitle;
     25     private CharSequence mLink;
     26     private CharSequence mDescription;
     27 
     28     public RssItem() {
     29         mTitle = "";
     30         mLink = "";
     31         mDescription = "";
     32     }
     33 
     34     public RssItem(CharSequence title, CharSequence link, CharSequence description) {
     35         mTitle = title;
     36         mLink = link;
     37         mDescription = description;
     38     }
     39 
     40     public CharSequence getDescription() {
     41         return mDescription;
     42     }
     43 
     44     public void setDescription(CharSequence description) {
     45         mDescription = description;
     46     }
     47 
     48     public CharSequence getLink() {
     49         return mLink;
     50     }
     51 
     52     public void setLink(CharSequence link) {
     53         mLink = link;
     54     }
     55 
     56     public CharSequence getTitle() {
     57         return mTitle;
     58     }
     59 
     60     public void setTitle(CharSequence title) {
     61         mTitle = title;
     62     }
     63 
     64 // If we made this class Parcelable, the code would look like...
     65 
     66 //    public void writeToParcel(Parcel parcel) {
     67 //        parcel.writeString(mTitle.toString());
     68 //        parcel.writeString(mLink.toString());
     69 //        parcel.writeString(mDescription.toString());
     70 //    }
     71 //
     72 //
     73 //    public static Object createFromParcel(Parcel parcel) {
     74 //        return new RssItem(
     75 //                parcel.readString(),
     76 //                parcel.readString(),
     77 //                parcel.readString());
     78 //    }
     79 }
     80 
     81