Clover coverage report - PLT Utilities Test Coverage (plt-20120304-r5436)
Coverage timestamp: Sat Mar 3 2012 22:01:56 CST
file stats: LOC: 119   Methods: 13
NCLOC: 67   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
Octet.java 0% 0% 0% 0%
coverage
 1    /*BEGIN_COPYRIGHT_BLOCK*
 2   
 3    PLT Utilities BSD License
 4   
 5    Copyright (c) 2007-2010 JavaPLT group at Rice University
 6    All rights reserved.
 7   
 8    Developed by: Java Programming Languages Team
 9    Rice University
 10    http://www.cs.rice.edu/~javaplt/
 11   
 12    Redistribution and use in source and binary forms, with or without modification, are permitted
 13    provided that the following conditions are met:
 14   
 15    - Redistributions of source code must retain the above copyright notice, this list of conditions
 16    and the following disclaimer.
 17    - Redistributions in binary form must reproduce the above copyright notice, this list of
 18    conditions and the following disclaimer in the documentation and/or other materials provided
 19    with the distribution.
 20    - Neither the name of the JavaPLT group, Rice University, nor the names of the library's
 21    contributors may be used to endorse or promote products derived from this software without
 22    specific prior written permission.
 23   
 24    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
 25    IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
 26    FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND
 27    CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 28    DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 29    DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
 30    IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
 31    OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 32   
 33    *END_COPYRIGHT_BLOCK*/
 34   
 35    package edu.rice.cs.plt.tuple;
 36   
 37    /**
 38    * An arbitrary 8-tuple of objects; overrides {@link #toString()}, {@link #equals(Object)},
 39    * and {@link #hashCode()}.
 40    */
 41    public class Octet<T1, T2, T3, T4, T5, T6, T7, T8> extends Tuple {
 42   
 43    protected final T1 _first;
 44    protected final T2 _second;
 45    protected final T3 _third;
 46    protected final T4 _fourth;
 47    protected final T5 _fifth;
 48    protected final T6 _sixth;
 49    protected final T7 _seventh;
 50    protected final T8 _eighth;
 51   
 52  0 public Octet(T1 first, T2 second, T3 third, T4 fourth, T5 fifth, T6 sixth, T7 seventh, T8 eighth) {
 53  0 _first = first;
 54  0 _second = second;
 55  0 _third = third;
 56  0 _fourth = fourth;
 57  0 _fifth = fifth;
 58  0 _sixth = sixth;
 59  0 _seventh = seventh;
 60  0 _eighth = eighth;
 61    }
 62   
 63  0 public T1 first() { return _first; }
 64  0 public T2 second() { return _second; }
 65  0 public T3 third() { return _third; }
 66  0 public T4 fourth() { return _fourth; }
 67  0 public T5 fifth() { return _fifth; }
 68  0 public T6 sixth() { return _sixth; }
 69  0 public T7 seventh() { return _seventh; }
 70  0 public T8 eighth() { return _eighth; }
 71   
 72  0 public String toString() {
 73  0 return "(" + _first + ", " + _second + ", " + _third + ", " + _fourth + ", " + _fifth + ", " +
 74    _sixth + ", " + _seventh + ", " + _eighth + ")";
 75    }
 76   
 77    /**
 78    * @return {@code true} iff {@code this} is of the same class as {@code o}, and each
 79    * corresponding element is equal (according to {@code equals})
 80    */
 81  0 public boolean equals(Object o) {
 82  0 if (this == o) { return true; }
 83  0 else if (o == null || !getClass().equals(o.getClass())) { return false; }
 84    else {
 85  0 Octet<?, ?, ?, ?, ?, ?, ?, ?> cast = (Octet<?, ?, ?, ?, ?, ?, ?, ?>) o;
 86  0 return
 87  0 (_first == null ? cast._first == null : _first.equals(cast._first)) &&
 88  0 (_second == null ? cast._second == null : _second.equals(cast._second)) &&
 89  0 (_third == null ? cast._third == null : _third.equals(cast._third)) &&
 90  0 (_fourth == null ? cast._fourth == null : _fourth.equals(cast._fourth)) &&
 91  0 (_fifth == null ? cast._fifth == null : _fifth.equals(cast._fifth)) &&
 92  0 (_sixth == null ? cast._sixth == null : _sixth.equals(cast._sixth)) &&
 93  0 (_seventh == null ? cast._seventh == null : _seventh.equals(cast._seventh)) &&
 94  0 (_eighth == null ? cast._eighth == null : _eighth.equals(cast._eighth));
 95    }
 96    }
 97   
 98  0 protected int generateHashCode() {
 99  0 return
 100  0 (_first == null ? 0 : _first.hashCode()) ^
 101  0 (_second == null ? 0 : _second.hashCode() << 1) ^
 102  0 (_third == null ? 0 : _third.hashCode() << 2) ^
 103  0 (_fourth == null ? 0 : _fourth.hashCode() << 3) ^
 104  0 (_fifth == null ? 0 : _fifth.hashCode() << 4) ^
 105  0 (_sixth == null ? 0 : _sixth.hashCode() << 5) ^
 106  0 (_seventh == null ? 0 : _seventh.hashCode() << 6) ^
 107  0 (_eighth == null ? 0 : _eighth.hashCode() << 7) ^
 108    getClass().hashCode();
 109    }
 110   
 111    /** Call the constructor (allows the type arguments to be inferred) */
 112  0 public static <T1, T2, T3, T4, T5, T6, T7, T8>
 113    Octet<T1, T2, T3, T4, T5, T6, T7, T8> make(T1 first, T2 second, T3 third, T4 fourth, T5 fifth,
 114    T6 sixth, T7 seventh, T8 eighth) {
 115  0 return new Octet<T1, T2, T3, T4, T5, T6, T7, T8>(first, second, third, fourth, fifth, sixth,
 116    seventh, eighth);
 117    }
 118   
 119    }