1 2 23 24 package net.fenyo.gnetwatch.targets; 25 26 import net.fenyo.gnetwatch.*; 27 import net.fenyo.gnetwatch.GUI.GUI; 28 import net.fenyo.gnetwatch.GUI.VisualElement; 29 import net.fenyo.gnetwatch.actions.ActionPing; 30 import net.fenyo.gnetwatch.data.EventReachable; 31 32 import org.apache.commons.logging.Log; 33 import org.apache.commons.logging.LogFactory; 34 35 40 41 public class TargetGroup extends Target { 42 private static Log log = LogFactory.getLog(TargetGroup.class); 43 44 private String group_name; 46 52 public TargetGroup(final String name, final String group_name) throws AlgorithmException { 54 super(name); 55 this.group_name = group_name; 56 setItem(group_name); 57 } 58 59 64 protected String getGroupName() { 65 return group_name; 66 } 67 68 73 public boolean canManageThisChild(final VisualElement visual_element) { 74 if (Target.class.isInstance(visual_element)) return true; 75 return false; 76 } 77 78 83 public boolean equals(final Object o) { 85 if (this == o) return true; 86 if ((o == null) || (o.getClass() != getClass())) return false; 87 final TargetGroup target = (TargetGroup) o; 88 return getGroupName().equals(target.getGroupName()); 89 } 90 91 96 public int hashCode() { 98 return getGroupName().hashCode(); 99 } 100 } 101 | Popular Tags |