Indicates whether this permissions collection implies a specific
{@code permission}.
if (permission instanceof FilePermission) {
FilePermission fp = (FilePermission) permission;
int matchedMask = 0;
int i = 0;
while (i < permissions.size()
&& ((matchedMask & fp.mask) != fp.mask)) {
// Cast will not fail since we added it
matchedMask |= ((FilePermission) permissions.elementAt(i))
.impliesMask(permission);
i++;
}
return ((matchedMask & fp.mask) == fp.mask);
}
return false;