diff options
author | snowleo <schneeleo@gmail.com> | 2011-10-12 05:00:36 +0200 |
---|---|---|
committer | snowleo <schneeleo@gmail.com> | 2011-10-12 05:00:36 +0200 |
commit | 93128712506bb0d4d422553b0480195cfd2cc9b3 (patch) | |
tree | b43500e52a607ceca0781062ac17570fdf1d4ab7 /EssentialsUpdate/src/f00f/net/irc/martyr/modes/GenericMode.java | |
parent | 860d446d28776ec842fa53e8e08538d4e093d6e9 (diff) | |
download | Essentials-93128712506bb0d4d422553b0480195cfd2cc9b3.tar Essentials-93128712506bb0d4d422553b0480195cfd2cc9b3.tar.gz Essentials-93128712506bb0d4d422553b0480195cfd2cc9b3.tar.lz Essentials-93128712506bb0d4d422553b0480195cfd2cc9b3.tar.xz Essentials-93128712506bb0d4d422553b0480195cfd2cc9b3.zip |
Replacing martyr with Pircbot 1.5
Diffstat (limited to 'EssentialsUpdate/src/f00f/net/irc/martyr/modes/GenericMode.java')
-rw-r--r-- | EssentialsUpdate/src/f00f/net/irc/martyr/modes/GenericMode.java | 77 |
1 files changed, 0 insertions, 77 deletions
diff --git a/EssentialsUpdate/src/f00f/net/irc/martyr/modes/GenericMode.java b/EssentialsUpdate/src/f00f/net/irc/martyr/modes/GenericMode.java deleted file mode 100644 index e1dad6045..000000000 --- a/EssentialsUpdate/src/f00f/net/irc/martyr/modes/GenericMode.java +++ /dev/null @@ -1,77 +0,0 @@ -package f00f.net.irc.martyr.modes; - -import f00f.net.irc.martyr.Mode; - -/** - * GenericNode uses the character to specify the hash code. Thus, two - * mode types are the same, in a hash table, even if they have - * different parameters or positive/negative values. - */ -public abstract class GenericMode implements Mode -{ - private String str; - private Mode.Sign sign = Mode.Sign.NOSIGN; - - public void setParam( String str ) - { - this.str = str; - } - - public String getParam() - { - return str; - } - - public void setSign( Mode.Sign sign ) - { - this.sign = sign; - } - - public Mode.Sign getSign() - { - return sign; - } - - public String toString() - { - String pString = " "; - if( sign != Mode.Sign.NOSIGN ) - pString += ( sign == Mode.Sign.POSITIVE ? "+" : "-" ); - String className = this.getClass().getName(); - className = className.substring( className.indexOf('$')+1 ); - - String result = className + pString + getChar(); - if( requiresParam() ) - { - result += " " + getParam(); - } - - return result; - } - - public boolean equals( Object o ) - { - if( o instanceof Mode ) - { - Mode oMode = (Mode)o; - - if( oMode.getParam() == null || this.getParam() == null ) - return oMode.getChar() == this.getChar(); - - if( oMode.getParam() == null && this.getParam() != null ) - return false; - if( oMode.getParam() == null && this.getParam() == null ) - return oMode.getChar() == this.getChar(); - - return oMode.getChar() == this.getChar() && - oMode.getParam().equals(this.getParam()); - } - return false; - } - - public int hashCode() - { - return (int)getChar(); - } -} - |