Code example for Collection

Methods: isEmptysizetoArray

0
     * referenced directly, but copied. 
     */ 
    public PolicyEntry(CodeSource cs, Collection<? extends Principal> prs,
            Collection<? extends Permission> permissions) {
        this.cs = (cs != null) ? normalizeCodeSource(cs) : null;
        this.principals = (prs == null || prs.isEmpty()) ? null
                : (Principal[]) prs.toArray(new Principal[prs.size()]);
        this.permissions = (permissions == null || permissions.isEmpty()) ? null
                : Collections.unmodifiableCollection(permissions);
    } 
 
    /** 
     * Checks if passed CodeSource matches this PolicyEntry. Null CodeSource of 
     * PolicyEntry implies any CodeSource; non-null CodeSource forwards to its 
     * imply() method. 
     */ 
    public boolean impliesCodeSource(CodeSource codeSource) {
        if (cs == null) {
            return true; 
        }