org.apache.turbine.util.security
Class SecuritySet

java.lang.Object
  extended byorg.apache.turbine.util.security.SecuritySet
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
GroupSet, PermissionSet, RoleSet

public abstract class SecuritySet
extends java.lang.Object
implements java.io.Serializable

This class represents a set of Security Entities. It makes it easy to build a UI. It wraps a TreeSet object to enforce that only relevant methods are available. TreeSet's contain only unique Objects (no duplicates).

Version:
$Id: SecuritySet.java 534527 2007-05-02 16:10:59Z tv $
Author:
John D. McNally, Brett McLaughlin, Marco Knüttel, Henning P. Schmiedehausen
See Also:
Serialized Form

Field Summary
protected  java.util.Map idMap
          Map for "id" -> "security object"
protected  java.util.Map nameMap
          Map for "name" -> "security object"
 
Constructor Summary
SecuritySet()
          Constructs an empty Set
 
Method Summary
 void clear()
          Removes all Objects from this Set.
 boolean contains(java.lang.String groupName)
          Deprecated. Use containsName(groupName) instead.
 boolean containsId(int id)
          Searches if an Object with a given Id is in the Set
 boolean containsName(java.lang.String name)
          Searches if an Object with a given name is in the Set
 java.util.Iterator elements()
          Deprecated. Use iterator() instead.
 java.util.Set getIds()
          Returns a set of Id values in this Object.
 java.util.Set getNames()
          Returns a set of Names in this Object.
 java.util.Set getSet()
          Returns a set of security objects in this object.
 java.util.Iterator iterator()
          Returns an Iterator for Objects in this Set.
 int size()
          Returns size (cardinality) of this set.
 java.lang.String toString()
          list of role names in this set
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

nameMap

protected java.util.Map nameMap
Map for "name" -> "security object"


idMap

protected java.util.Map idMap
Map for "id" -> "security object"

Constructor Detail

SecuritySet

public SecuritySet()
Constructs an empty Set

Method Detail

getSet

public java.util.Set getSet()
Returns a set of security objects in this object.

Returns:
A Set Object

getNames

public java.util.Set getNames()
Returns a set of Names in this Object.

Returns:
The Set of Names in this Object, backed by the actual data.

getIds

public java.util.Set getIds()
Returns a set of Id values in this Object.

Returns:
The Set of Ids in this Object, backed by the actual data.

clear

public void clear()
Removes all Objects from this Set.


contains

public boolean contains(java.lang.String groupName)
Deprecated. Use containsName(groupName) instead.

Searches if an Object with a given name is in the Set

Returns:
True if argument matched an Object in this Set; false if no match.

containsName

public boolean containsName(java.lang.String name)
Searches if an Object with a given name is in the Set

Returns:
True if argument matched an Object in this Set; false if no match.

containsId

public boolean containsId(int id)
Searches if an Object with a given Id is in the Set

Parameters:
id - Id of the Security Object.
Returns:
True if argument matched an Object in this Set; false if no match.

iterator

public java.util.Iterator iterator()
Returns an Iterator for Objects in this Set.

Returns:
An iterator for the Set

elements

public java.util.Iterator elements()
Deprecated. Use iterator() instead.


size

public int size()
Returns size (cardinality) of this set.

Returns:
The cardinality of this Set.

toString

public java.lang.String toString()
list of role names in this set

Returns:
The string representation of this Set.


Copyright © 2000-2008 Apache Software Foundation. All Rights Reserved.