[Cherbot-commit] SF.net SVN: cherbot: [93] trunk/src/net/sf/cherbot
Status: Alpha
Brought to you by:
christianhujer
|
From: <chr...@us...> - 2007-06-24 17:26:04
|
Revision: 93
http://svn.sourceforge.net/cherbot/?rev=93&view=rev
Author: christianhujer
Date: 2007-06-24 10:25:57 -0700 (Sun, 24 Jun 2007)
Log Message:
-----------
Turned Channel into an interface. The class Channel now is AbstractChannel.
Modified Paths:
--------------
trunk/src/net/sf/cherbot/IRCConnection.java
Added Paths:
-----------
trunk/src/net/sf/cherbot/AbstractChannel.java
trunk/src/net/sf/cherbot/Channel.java
Removed Paths:
-------------
trunk/src/net/sf/cherbot/Channel.java
Copied: trunk/src/net/sf/cherbot/AbstractChannel.java (from rev 90, trunk/src/net/sf/cherbot/Channel.java)
===================================================================
--- trunk/src/net/sf/cherbot/AbstractChannel.java (rev 0)
+++ trunk/src/net/sf/cherbot/AbstractChannel.java 2007-06-24 17:25:57 UTC (rev 93)
@@ -0,0 +1,33 @@
+/*
+ * Copyright © 2007, Christian Hujer and the CherBot developers. All Rights Reserved.
+ * License: GNU General Public License v2.0 or newer.
+ * See file COPYING in the root directory of this project.
+ */
+
+package net.sf.cherbot;
+
+import org.jetbrains.annotations.Nullable;
+
+/** Abstract base implementation of {@link Channel}.
+ * @author <a href="mailto:ch...@ri...">Christian Hujer</a>
+ */
+public abstract class AbstractChannel implements Channel {
+
+ /** The name of this channel.
+ * Maybe <code>null</code> if it's the default / no channel.
+ */
+ @Nullable private String channelName;
+
+ /** Creates a Channel.
+ * @param channelName name of this channel.
+ */
+ protected AbstractChannel(@Nullable final String channelName) {
+ this.channelName = channelName;
+ }
+
+ /** {@inheritDoc} */
+ @Nullable public String getChannelName() {
+ return channelName;
+ }
+
+} // class Channel
Property changes on: trunk/src/net/sf/cherbot/AbstractChannel.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ LF
Deleted: trunk/src/net/sf/cherbot/Channel.java
===================================================================
--- trunk/src/net/sf/cherbot/Channel.java 2007-06-24 17:10:25 UTC (rev 92)
+++ trunk/src/net/sf/cherbot/Channel.java 2007-06-24 17:25:57 UTC (rev 93)
@@ -1,42 +0,0 @@
-/*
- * Copyright © 2007, Christian Hujer and the CherBot developers. All Rights Reserved.
- * License: GNU General Public License v2.0 or newer.
- * See file COPYING in the root directory of this project.
- */
-
-package net.sf.cherbot;
-
-import org.jetbrains.annotations.Nullable;
-import org.jetbrains.annotations.NotNull;
-
-/** A Channel uniquely identifies a protocol (type) / server / channel combination.
- * @author <a href="mailto:ch...@ri...">Christian Hujer</a>
- */
-public abstract class Channel {
-
- /** The name of this channel.
- * Maybe <code>null</code> if it's the default / no channel.
- */
- @Nullable private String channelName;
-
- /** Creates a Channel.
- * @param channelName name of this channel.
- */
- protected Channel(@Nullable final String channelName) {
- this.channelName = channelName;
- }
-
- /** Sends a message to this channel.
- * @param msg Message to send
- */
- public abstract void send(@NotNull String msg);
-
- /** Returns the name of this channel.
- * Maybe <code>null</code> if it's the default / no channel.
- * @return The channel of this channel or <code>null</code> if default / no channel.
- */
- @Nullable public String getChannelName() {
- return channelName;
- }
-
-} // class Channel
Added: trunk/src/net/sf/cherbot/Channel.java
===================================================================
--- trunk/src/net/sf/cherbot/Channel.java (rev 0)
+++ trunk/src/net/sf/cherbot/Channel.java 2007-06-24 17:25:57 UTC (rev 93)
@@ -0,0 +1,28 @@
+/*
+ * Copyright © 2007, Christian Hujer and the CherBot developers. All Rights Reserved.
+ * License: GNU General Public License v2.0 or newer.
+ * See file COPYING in the root directory of this project.
+ */
+
+package net.sf.cherbot;
+
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/** A Channel uniquely identifies a protocol (type) / server / channel combination.
+ * @author <a href="mailto:ch...@ri...">Christian Hujer</a>
+ */
+public interface Channel {
+
+ /** Sends a message to this channel.
+ * @param msg Message to send
+ */
+ void send(@NotNull String msg);
+
+ /** Returns the name of this channel.
+ * Maybe <code>null</code> if it's the default / no channel.
+ * @return The channel of this channel or <code>null</code> if default / no channel.
+ */
+ @Nullable String getChannelName();
+
+} // interface Channel
Property changes on: trunk/src/net/sf/cherbot/Channel.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ LF
Modified: trunk/src/net/sf/cherbot/IRCConnection.java
===================================================================
--- trunk/src/net/sf/cherbot/IRCConnection.java 2007-06-24 17:10:25 UTC (rev 92)
+++ trunk/src/net/sf/cherbot/IRCConnection.java 2007-06-24 17:25:57 UTC (rev 93)
@@ -210,7 +210,7 @@
* This can be used for both, real channels (whith channel names starting with '#') and direct communication channels with nicks.
* @author <a href="mailto:ch...@ri...">Christian Hujer</a>
*/
- private class IRCChannel extends Channel {
+ private class IRCChannel extends AbstractChannel {
/** Creates an IRCChannel.
* @param channelName name of this channel.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|