FileDocCategorySizeDatePackage
GroupImpl.javaAPI DocJava SE 6 API3209Tue Jun 10 00:22:04 BST 2008com.sun.jmx.snmp.IPAcl

GroupImpl

public class GroupImpl extends PrincipalImpl implements java.security.acl.Group, Serializable
This class is used to represent a subnet mask (a group of hosts matching the same IP mask).
version
4.10 11/17/05
author
Sun Microsystems, Inc

Fields Summary
Constructors Summary
public GroupImpl()
Constructs an empty group.

exception
UnknownHostException Not implemented

  
public GroupImpl(String mask)
Constructs a group using the specified subnet mask.

param
mask The subnet mask to use to build the group.
exception
UnknownHostException if the subnet mask cann't be built.

	super(mask);
  
Methods Summary
public booleanaddMember(java.security.Principal p)
Adds the specified member to the group.

param
p the principal to add to this group.
return
true if the member was successfully added, false if the principal was already a member.

	// we don't need to add members because the ip address is a 
	// subnet mask 
	return true;	
    
public booleanequals(java.lang.Object p)
Compares this group to the specified object. Returns true if the object passed in matches the group represented.

param
p the object to compare with.
return
true if the object passed in matches the subnet mask, false otherwise.

	if (p instanceof PrincipalImpl || p instanceof GroupImpl){
	  if ((super.hashCode() & p.hashCode()) == p.hashCode()) return true;
	  else return false;
	} else {
	  return false;
	}
  
public inthashCode()

	return super.hashCode();	
  
public booleanisMember(java.security.Principal p)
Returns true if the passed principal is a member of the group.

param
p the principal whose membership is to be checked.
return
true if the principal is a member of this group, false otherwise.

	if ((p.hashCode() & super.hashCode()) == p.hashCode()) return true;
	else return false;
  
public java.util.Enumerationmembers()
Returns an enumeration which contains the subnet mask.

return
an enumeration which contains the subnet mask.

	Vector v = new Vector(1);
	v.addElement(this);
	return v.elements();
  
public booleanremoveMember(java.security.Principal p)
Removes the specified member from the group. (Not implemented)

param
p the principal to remove from this group.
return
allways return true.

	return true;
  
public java.lang.StringtoString()
Prints a string representation of this group.

return
a string representation of this group.

	return ("GroupImpl :"+super.getAddress().toString());