net.fenyo.gnetwatch.targets
Class TargetIPv4Subnet

java.lang.Object
  extended by net.fenyo.gnetwatch.GUI.VisualElement
      extended by net.fenyo.gnetwatch.targets.Target
          extended by net.fenyo.gnetwatch.targets.TargetIPv4Subnet

public class TargetIPv4Subnet
extends Target

TargetIPv4Subnet implements an IPv4 subnet defined by a subnet address and a subnet mask.

Version:
$Id: TargetIPv4Subnet.java,v 1.13 2008/04/15 23:58:17 fenyo Exp $
Author:
Alexandre Fenyo

Field Summary
private static Log log
           
private  java.net.Inet4Address netmask
           
private  java.net.Inet4Address network
           
 
Fields inherited from class net.fenyo.gnetwatch.targets.Target
eventLists
 
Constructor Summary
TargetIPv4Subnet()
           
TargetIPv4Subnet(java.lang.String name, java.net.Inet4Address network, java.net.Inet4Address netmask)
          Constructor.
 
Method Summary
 boolean canManageThisChild(VisualElement visual_element)
          Checks that the parameter can be attached to this target.
 boolean equals(java.lang.Object o)
          Compares two targets.
protected  java.net.Inet4Address getNetmask()
          Returns the netmask of this subnet.
protected  java.net.Inet4Address getNetwork()
          Returns the network address of this subnet.
 int hashCode()
          Returns the hashcode for this target.
 void initialize(GUI gui)
          Initializes this target.
 void setNetmask(java.net.Inet4Address netmask)
           
 void setNetwork(java.net.Inet4Address network)
           
 
Methods inherited from class net.fenyo.gnetwatch.targets.Target
addEvent, addTarget, canAddTarget, disposed, getEventLists, getEvents, getLastEvent, getName, mergeEvents, registerComponent, setEventLists, setName, unregisterComponent
 
Methods inherited from class net.fenyo.gnetwatch.GUI.VisualElement
addParent, contains, duplicateTreeItemOnce, expandTreeItems, getAllParents, getChildren, getDescription, getGUI, getId, getItem, getParents, getProgress, getSubElements, getSubElements, getTreeItems, getType, informSelected, isDisposed, isThisOurTreeItem, removeVisualElements, selected, setChildren, setDescription, setGUI, setId, setImage, setImageExec, setImageFolder, setImageHost, setImageHost6, setImageHost6SNMP, setImageHostSNMP, setImageInterface, setImageMultiRow, setImageNetwork, setImageOscillo, setImageQueue, setImageWatch, setItem, setParent, setParent, setProgress, setType, unselected
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static Log log

network

private java.net.Inet4Address network

netmask

private java.net.Inet4Address netmask
Constructor Detail

TargetIPv4Subnet

public TargetIPv4Subnet(java.lang.String name,
                        java.net.Inet4Address network,
                        java.net.Inet4Address netmask)
                 throws AlgorithmException
Constructor.

Parameters:
name - target name.
network - network address.
netmask - netmask value.
Throws:
AlgorithmException - exception.

TargetIPv4Subnet

public TargetIPv4Subnet()
                 throws AlgorithmException
Throws:
AlgorithmException
Method Detail

initialize

public void initialize(GUI gui)
Initializes this target.

Overrides:
initialize in class VisualElement
Parameters:
gui - current GUI instance.

getNetwork

protected java.net.Inet4Address getNetwork()
Returns the network address of this subnet.

Parameters:
none. -
Returns:
Inet4Address network address.

setNetwork

public void setNetwork(java.net.Inet4Address network)

getNetmask

protected java.net.Inet4Address getNetmask()
Returns the netmask of this subnet.

Parameters:
none. -
Returns:
Inet4Address netmask.

setNetmask

public void setNetmask(java.net.Inet4Address netmask)

canManageThisChild

public boolean canManageThisChild(VisualElement visual_element)
Checks that the parameter can be attached to this target.

Overrides:
canManageThisChild in class VisualElement
Parameters:
visual_element - parameter to check.
Returns:
true if the parameter can be attached to this target.

equals

public boolean equals(java.lang.Object o)
Compares two targets.

Overrides:
equals in class Target
Parameters:
o - target to compare to.
Returns:
true if the targets are equal.

hashCode

public int hashCode()
Returns the hashcode for this target.

Overrides:
hashCode in class Target
Parameters:
none. -
Returns:
int hashcode.