java.security
final class: IntersectingDomainCombiner [javadoc |
source]
java.lang.Object
java.security.IntersectingDomainCombiner
All Implemented Interfaces:
DomainCombiner
A trivial implementation of
DomainCombiner that produces the
intersection of the supplied
ProtectionDomain objects.
| Field Summary |
|---|
| static final IntersectingDomainCombiner | SINGLETON | |
| Method from java.security.IntersectingDomainCombiner Summary: |
|---|
|
combine |
| Methods from java.lang.Object: |
|---|
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method from java.security.IntersectingDomainCombiner Detail: |
public ProtectionDomain[] combine(ProtectionDomain[] currentDomains,
ProtectionDomain[] assignedDomains) {
HashSet newDomains = new HashSet ();
for (int i = 0; i < currentDomains.length; i++)
{
if (currentDomains[i] == null)
continue;
for (int j = 0; j < assignedDomains.length; j++)
{
if (currentDomains[i].equals (assignedDomains[j]))
newDomains.add (currentDomains[i]);
}
}
return (ProtectionDomain[])
newDomains.toArray(new ProtectionDomain[newDomains.size()]);
}
|