irssibot.user
Class Host

java.lang.Object
  |
  +--irssibot.user.Host

public class Host
extends java.lang.Object

Represent a nick!ident@host combination, or simply a 'hostmask'.

Version:
$Name: $ $Revision: 1.6 $
Author:
Matti Dahlbom

Field Summary
private  java.lang.String host
           
private  java.lang.String ident
           
private  boolean isMask
           
private  java.lang.String nick
           
private  java.lang.String originalIdent
           
private  boolean starnameHost
           
private  boolean wellformed
           
 
Constructor Summary
Host(java.lang.String hostString)
           
 
Method Summary
 boolean equals(Host other)
          Compare this Host to another.
 java.lang.String getHost()
           
 java.lang.String getIdent()
           
 java.lang.String getNick()
           
 boolean isStarnameHost()
          checks wildcard presence in host
 boolean isWellformed()
           
 boolean matches(Host mask)
          compare this Host to a mask
 void setHost(java.lang.String host)
           
 void setNick(java.lang.String nick)
           
 java.lang.String toString()
          returns a string representation of the Host as nick!ident@host
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

nick

private java.lang.String nick

ident

private java.lang.String ident

originalIdent

private java.lang.String originalIdent

host

private java.lang.String host

starnameHost

private boolean starnameHost

isMask

private boolean isMask

wellformed

private boolean wellformed
Constructor Detail

Host

public Host(java.lang.String hostString)
Method Detail

getNick

public java.lang.String getNick()

getIdent

public java.lang.String getIdent()

getHost

public java.lang.String getHost()

isWellformed

public boolean isWellformed()

setNick

public void setNick(java.lang.String nick)

setHost

public void setHost(java.lang.String host)

isStarnameHost

public boolean isStarnameHost()
checks wildcard presence in host

Returns:
  • true if wildcards in host -part
  • false if not

toString

public java.lang.String toString()
returns a string representation of the Host as nick!ident@host

Overrides:
toString in class java.lang.Object
Returns:
host as string

equals

public boolean equals(Host other)
Compare this Host to another. The two hosts must match exactly (incasesensitive).

Returns:
    true if equal
      false if not

matches

public boolean matches(Host mask)
compare this Host to a mask

Parameters:
mask - mask to compare against
Returns:
    true if match
      false if no match or this Host is a mask


IrssiBot (c) 2000-2002 Matti Dahlbom