Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package org.bouncycastle.jce.provider;
  
  import java.util.HashSet;
  import java.util.Iterator;
  import java.util.List;
  import java.util.Set;
  
 public class PKIXPolicyNode
     implements PolicyNode
 {
     protected List       children;
     protected int        depth;
     protected Set        expectedPolicies;
     protected PolicyNode parent;
     protected Set        policyQualifiers;
     protected String     validPolicy;
     protected boolean    critical;
     
     /*  
      *  
      *  CONSTRUCTORS
      *  
      */ 
     
     public PKIXPolicyNode(
         List       _children,
         int        _depth,
         Set        _expectedPolicies,
         PolicyNode _parent,
         Set        _policyQualifiers,
         String     _validPolicy,
         boolean    _critical)
     {
                  = _children;
                     = _depth;
          = _expectedPolicies;
                    = _parent;
          = _policyQualifiers;
               = _validPolicy;
                  = _critical;
     }
     
     public void addChild(
         PKIXPolicyNode _child)
     {
         .add(_child);
         _child.setParent(this);
     }
     
     public Iterator getChildren()
     {
         return .iterator();
     }
     
     public int getDepth()
     {
         return ;
     }
     
     public Set getExpectedPolicies()
     {
         return ;
     }
     
     public PolicyNode getParent()
     {
         return ;
     }
     
     public Set getPolicyQualifiers()
     {
         return ;
     }
     
     public String getValidPolicy()
     {
         return ;
     }
     
     public boolean hasChildren()
     {
         return !.isEmpty();
     }
     
     public boolean isCritical()
     {
         return ;
     }
     
     public void removeChild(PKIXPolicyNode _child)
     {
         .remove(_child);
     }
     
     public void setCritical(boolean _critical)
     {
          = _critical;
    }
    
    public void setParent(PKIXPolicyNode _parent)
    {
         = _parent;
    }
    
    public String toString()
    {
        return toString("");
    }
    
    public String toString(String _indent)
    {
        StringBuffer _buf = new StringBuffer();
        _buf.append(_indent);
        _buf.append();
        _buf.append(" {\n");
        
        for(int i = 0; i < .size(); i++)
        {
            _buf.append(((PKIXPolicyNode).get(i)).toString(_indent + "    "));
        }
        
        _buf.append(_indent);
        _buf.append("}\n");
        return _buf.toString();
    }
    
    public Object clone()
    {
        return copy();
    }
    
    public PKIXPolicyNode copy()
    {
        Set     _expectedPolicies = new HashSet();
        Iterator _iter = .iterator();
        while (_iter.hasNext())
        {
            _expectedPolicies.add(new String((String)_iter.next()));
        }
        
        Set     _policyQualifiers = new HashSet();
        _iter = .iterator();
        while (_iter.hasNext())
        {
            _policyQualifiers.add(new String((String)_iter.next()));
        }
        
        PKIXPolicyNode _node = new PKIXPolicyNode(new ArrayList(),
                                                  ,
                                                  _expectedPolicies,
                                                  null,
                                                  _policyQualifiers,
                                                  new String(),
                                                  );
        
        _iter = .iterator();
        while (_iter.hasNext())
        {
            PKIXPolicyNode _child = ((PKIXPolicyNode)_iter.next()).copy();
            _child.setParent(_node);
            _node.addChild(_child);
        }
        
        return _node;
    }
    public void setExpectedPolicies(Set expectedPolicies)
    {
        this. = expectedPolicies;
    }
New to GrepCode? Check out our FAQ X