boolean addPrinEntry(PolicyEntry pe,PolicyParser.PrincipalEntry newPrin,int index){
  PolicyParser.GrantEntry grantEntry=pe.getGrantEntry();
  if (grantEntry.contains(newPrin) == true)   return false;
  LinkedList<PolicyParser.PrincipalEntry> prinList=grantEntry.principals;
  if (index != -1)   prinList.set(index,newPrin);
 else   prinList.add(newPrin);
  modified=true;
  return true;
}

boolean addPrinEntry ( PolicyEntry pe , PolicyParser . PrincipalEntry newPrin , int index ) { PolicyParser . GrantEntry grantEntry = pe . getGrantEntry ( ) ; if ( grantEntry . contains ( newPrin ) == true ) return false ; LinkedList < PolicyParser . PrincipalEntry > prinList = grantEntry . principals ; if ( index != - 1 ) prinList . set ( index , newPrin ) ; else prinList . add ( newPrin ) ; modified = true ; return true ; }
add a principal entry to an existing policyentry at the specified index . a principal entry consists of a class , and name . if the principal already exists , it is not added again .
