Coverage report

  %line %branch
org.apache.jetspeed.security.impl.PrincipalsSet
0% 
0% 

 1  
 /*
 2  
 * Licensed to the Apache Software Foundation (ASF) under one or more
 3  
 * contributor license agreements.  See the NOTICE file distributed with
 4  
 * this work for additional information regarding copyright ownership.
 5  
 * The ASF licenses this file to You under the Apache License, Version 2.0
 6  
 * (the "License"); you may not use this file except in compliance with
 7  
 * the License.  You may obtain a copy of the License at
 8  
 *
 9  
 *     http://www.apache.org/licenses/LICENSE-2.0
 10  
 *
 11  
 * Unless required by applicable law or agreed to in writing, software
 12  
 * distributed under the License is distributed on an "AS IS" BASIS,
 13  
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 14  
 * See the License for the specific language governing permissions and
 15  
 * limitations under the License.
 16  
 */
 17  
 package org.apache.jetspeed.security.impl;
 18  
 
 19  
 import java.util.Collection;
 20  
 import java.util.HashSet;
 21  
 import java.util.Iterator;
 22  
 import java.util.LinkedList;
 23  
 import java.util.List;
 24  
 import java.util.Set;
 25  
 
 26  
 
 27  
 /**
 28  
  * PrincipalsSet - provides an ordered 'set' of principals required
 29  
  * for some profiling rules that are dependent on order of insert.
 30  
  * 
 31  
  * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
 32  
  * @version $Id: $
 33  
  */
 34  
 
 35  
 public class PrincipalsSet implements Set
 36  
 {
 37  0
     List principals = new LinkedList();
 38  0
     Set set = new HashSet();
 39  
 
 40  
     public PrincipalsSet()
 41  0
     {}
 42  
     
 43  
     /* (non-Javadoc)
 44  
      * @see java.util.Collection#size()
 45  
      */
 46  
     public int size()
 47  
     {
 48  0
         return principals.size();
 49  
     }
 50  
 
 51  
     /* (non-Javadoc)
 52  
      * @see java.util.Collection#clear()
 53  
      */
 54  
     public void clear()
 55  
     {
 56  0
         set.clear();
 57  0
         principals.clear();
 58  0
     }
 59  
 
 60  
     /* (non-Javadoc)
 61  
      * @see java.util.Collection#isEmpty()
 62  
      */
 63  
     public boolean isEmpty()
 64  
     {
 65  0
         return principals.isEmpty();
 66  
     }
 67  
 
 68  
     /* (non-Javadoc)
 69  
      * @see java.util.Collection#toArray()
 70  
      */
 71  
     public Object[] toArray()
 72  
     {
 73  0
         return principals.toArray();
 74  
     }
 75  
 
 76  
     /* (non-Javadoc)
 77  
      * @see java.util.Collection#add(java.lang.Object)
 78  
      */
 79  
     public boolean add(Object o)
 80  
     {
 81  0
         if (set.add(o))
 82  
         {
 83  0
             principals.add(o);
 84  0
             return true;
 85  
         }
 86  0
         return false;
 87  
     }
 88  
 
 89  
     /* (non-Javadoc)
 90  
      * @see java.util.Collection#contains(java.lang.Object)
 91  
      */
 92  
     public boolean contains(Object o)
 93  
     {
 94  0
         return set.contains(o);
 95  
     }
 96  
 
 97  
     /* (non-Javadoc)
 98  
      * @see java.util.Collection#remove(java.lang.Object)
 99  
      */
 100  
     public boolean remove(Object o)
 101  
     {
 102  0
         set.remove(o);
 103  0
         return principals.remove(o);
 104  
     }
 105  
 
 106  
     /* (non-Javadoc)
 107  
      * @see java.util.Collection#addAll(java.util.Collection)
 108  
      */
 109  
     public boolean addAll(Collection c)
 110  
     {
 111  0
         set.addAll(c);
 112  0
         return principals.addAll(c);
 113  
     }
 114  
 
 115  
     /* (non-Javadoc)
 116  
      * @see java.util.Collection#containsAll(java.util.Collection)
 117  
      */
 118  
     public boolean containsAll(Collection c)
 119  
     {
 120  0
         return set.containsAll(c);
 121  
     }
 122  
 
 123  
     /* (non-Javadoc)
 124  
      * @see java.util.Collection#removeAll(java.util.Collection)
 125  
      */
 126  
     public boolean removeAll(Collection c)
 127  
     {
 128  0
         set.removeAll(c);
 129  0
         return principals.removeAll(c);
 130  
     }
 131  
 
 132  
     /* (non-Javadoc)
 133  
      * @see java.util.Collection#retainAll(java.util.Collection)
 134  
      */
 135  
     public boolean retainAll(Collection c)
 136  
     {
 137  0
         set.retainAll(c);
 138  0
         return principals.retainAll(c);
 139  
     }
 140  
 
 141  
     /* (non-Javadoc)
 142  
      * @see java.util.Collection#iterator()
 143  
      */
 144  
     public Iterator iterator()
 145  
     {
 146  0
         return principals.iterator();
 147  
     }
 148  
 
 149  
     /* (non-Javadoc)
 150  
      * @see java.util.Collection#toArray(java.lang.Object[])
 151  
      */
 152  
     public Object[] toArray(Object[] a)
 153  
     {
 154  0
         return principals.toArray(a);
 155  
     }
 156  
 
 157  
 }

This report is generated by jcoverage, Maven and Maven JCoverage Plugin.