Clover coverage report - [ini4j]
Coverage timestamp: Sze nov. 30 2005 08:31:05 CET
file stats: LOC: 77   Methods: 8
NCLOC: 48   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
StrictPreferences.java 75% 92,9% 100% 92,3%
coverage coverage
 1    /*
 2    * Copyright 2005 [ini4j] Development Team
 3    *
 4    * Licensed under the Apache License, Version 2.0 (the "License");
 5    * you may not use this file except in compliance with the License.
 6    * You may obtain a copy of the License at
 7    *
 8    * http://www.apache.org/licenses/LICENSE-2.0
 9    *
 10    * Unless required by applicable law or agreed to in writing, software
 11    * distributed under the License is distributed on an "AS IS" BASIS,
 12    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 13    * See the License for the specific language governing permissions and
 14    * limitations under the License.
 15    */
 16   
 17    package org.ini4j.addon;
 18   
 19    import java.util.NoSuchElementException;
 20    import java.util.prefs.Preferences;
 21   
 22    public class StrictPreferences extends PreferencesWrapper
 23    {
 24  1 public StrictPreferences(Preferences peer)
 25    {
 26  1 super(peer);
 27    }
 28   
 29  7 public String get(String key) throws NoSuchElementException
 30    {
 31  7 String value = get(key, null);
 32   
 33  7 if ( value == null )
 34    {
 35  6 throw new NoSuchElementException();
 36    }
 37   
 38  1 return value;
 39    }
 40   
 41  1 public int getInt(String key) throws NoSuchElementException
 42    {
 43  1 return Integer.parseInt(get(key));
 44    }
 45   
 46  1 public long getLong(String key) throws NoSuchElementException
 47    {
 48  1 return Long.parseLong(get(key));
 49    }
 50   
 51  1 public boolean getBoolean(String key) throws NoSuchElementException
 52    {
 53  1 return Boolean.valueOf(get(key));
 54    }
 55   
 56  1 public float getFloat(String key) throws NoSuchElementException
 57    {
 58  1 return Float.parseFloat(get(key));
 59    }
 60   
 61  1 public double getDouble(String key) throws NoSuchElementException
 62    {
 63  1 return Double.parseDouble(get(key));
 64    }
 65   
 66  1 public byte[] getByteArray(String key) throws NoSuchElementException
 67    {
 68  1 byte[] value = getByteArray(key, null);
 69   
 70  1 if ( value == null )
 71    {
 72  1 throw new NoSuchElementException();
 73    }
 74   
 75  0 return value;
 76    }
 77    }