KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > de > nava > informa > core > ChannelFormat


1 //
2
// Informa -- RSS Library for Java
3
// Copyright (c) 2002 by Niko Schmuck
4
//
5
// Niko Schmuck
6
// http://sourceforge.net/projects/informa
7
// mailto:niko_schmuck@users.sourceforge.net
8
//
9
// This library is free software.
10
//
11
// You may redistribute it and/or modify it under the terms of the GNU
12
// Lesser General Public License as published by the Free Software Foundation.
13
//
14
// Version 2.1 of the license should be included with this distribution in
15
// the file LICENSE. If the license is not included with this distribution,
16
// you may find a copy at the FSF web site at 'www.gnu.org' or 'www.fsf.org',
17
// or you may write to the Free Software Foundation, 675 Mass Ave, Cambridge,
18
// MA 02139 USA.
19
//
20
// This library is distributed in the hope that it will be useful,
21
// but WITHOUT ANY WARRANTY; without even the implied waranty of
22
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23
// Lesser General Public License for more details.
24
//
25

26 // $Id: ChannelFormat.java,v 1.8 2004/05/13 22:55:16 niko_schmuck Exp $
27

28 package de.nava.informa.core;
29
30 import java.io.Serializable JavaDoc;
31
32 /**
33  * Holds constants to describe which syntax is used by a channel
34  * description.</p>
35  *
36  * @author Niko Schmuck (niko@nava.de)
37  */

38 public class ChannelFormat implements Serializable JavaDoc {
39
40   private String JavaDoc formatSpec;
41
42   private ChannelFormat(String JavaDoc formatSpec) {
43     this.formatSpec = formatSpec;
44   }
45
46   public String JavaDoc toString() {
47     return formatSpec;
48   }
49
50   public boolean equals(Object JavaDoc obj) {
51     if (!(obj instanceof ChannelFormat)) {
52       return false;
53     }
54     ChannelFormat cf = (ChannelFormat) obj;
55     return cf.formatSpec.equals(formatSpec);
56   }
57
58   public int hashCode() {
59     return formatSpec.hashCode();
60   }
61
62   /** Convenient null value to make code more robust */
63   public static final ChannelFormat UNKNOWN_CHANNEL_FORMAT =
64           new ChannelFormat("Unknown");
65
66   /** Syntax according to RSS 0.9 specification. */
67   public static final ChannelFormat RSS_0_90 = new ChannelFormat("RSS 0.90");
68
69   /** Syntax according to RSS 0.91 specification. */
70   public static final ChannelFormat RSS_0_91 = new ChannelFormat("RSS 0.91");
71
72   /** Syntax according to RSS 0.92 specification. */
73   public static final ChannelFormat RSS_0_92 = new ChannelFormat("RSS 0.92");
74
75   /** Syntax according to RSS 0.93 specification. */
76   public static final ChannelFormat RSS_0_93 = new ChannelFormat("RSS 0.93");
77
78   /** Syntax according to RSS 0.94 specification. */
79   public static final ChannelFormat RSS_0_94 = new ChannelFormat("RSS 0.94");
80
81   /** Syntax according to RSS 1.0 specification. */
82   public static final ChannelFormat RSS_1_0 = new ChannelFormat("RSS 1.0");
83
84   /** Syntax according to RSS 2.0 specification. */
85   public static final ChannelFormat RSS_2_0 = new ChannelFormat("RSS 2.0");
86
87   
88   /** Syntax according to the Atom 0.1 specification. */
89   public static final ChannelFormat ATOM_0_1 = new ChannelFormat("Atom 0.1");
90
91   /** Syntax according to the Atom 0.2 specification. */
92   public static final ChannelFormat ATOM_0_2 = new ChannelFormat("Atom 0.2");
93
94   /** Syntax according to the Atom 0.3 specification. */
95   public static final ChannelFormat ATOM_0_3 = new ChannelFormat("Atom 0.3");
96
97 }
98
Popular Tags