|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| LinkListVo | Line # 31 | 26 | 15 | 100% |
1.0
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||
| (12) | |||
| Result | |||
|
1.0
|
org.qedeq.kernel.test.AbstractValueObjectTest.testAll
org.qedeq.kernel.test.AbstractValueObjectTest.testAll
|
1 PASS | |
|
1.0
|
org.qedeq.kernel.test.AbstractValueObjectTest.testAll
org.qedeq.kernel.test.AbstractValueObjectTest.testAll
|
1 PASS | |
|
0.15686275
|
org.qedeq.kernel.bo.service.ModuleConstantsExistenceCheckerTest.testModuleConstancsExistenceChecker_08
org.qedeq.kernel.bo.service.ModuleConstantsExistenceCheckerTest.testModuleConstancsExistenceChecker_08
|
1 PASS | |
|
0.15686275
|
org.qedeq.kernel.bo.service.ModuleConstantsExistenceCheckerTest.testModuleConstancsExistenceChecker_06
org.qedeq.kernel.bo.service.ModuleConstantsExistenceCheckerTest.testModuleConstancsExistenceChecker_06
|
1 PASS | |
|
0.15686275
|
org.qedeq.kernel.bo.module.VisitorContextTest.testContext
org.qedeq.kernel.bo.module.VisitorContextTest.testContext
|
1 PASS | |
|
0.15686275
|
org.qedeq.kernel.bo.latex.GenerateLatexTest.testGeneration
org.qedeq.kernel.bo.latex.GenerateLatexTest.testGeneration
|
1 PASS | |
|
0.15686275
|
org.qedeq.kernel.xml.dao.GenerateXmlTest.testGeneration
org.qedeq.kernel.xml.dao.GenerateXmlTest.testGeneration
|
1 PASS | |
|
0.15686275
|
org.qedeq.kernel.bo.latex.ExtendedGenerateLatexTest.testGeneration
org.qedeq.kernel.bo.latex.ExtendedGenerateLatexTest.testGeneration
|
1 PASS | |
|
0.15686275
|
org.qedeq.kernel.bo.service.QedeqBoFactoryTest.testCreateStringQedeq5
org.qedeq.kernel.bo.service.QedeqBoFactoryTest.testCreateStringQedeq5
|
1 PASS | |
|
0.15686275
|
org.qedeq.kernel.bo.service.ModuleConstantsExistenceCheckerTest.testModuleConstancsExistenceChecker_07
org.qedeq.kernel.bo.service.ModuleConstantsExistenceCheckerTest.testModuleConstancsExistenceChecker_07
|
1 PASS | |
|
0.15686275
|
org.qedeq.kernel.bo.service.ModuleConstantsExistenceCheckerTest.testModuleConstancsExistenceChecker_05
org.qedeq.kernel.bo.service.ModuleConstantsExistenceCheckerTest.testModuleConstancsExistenceChecker_05
|
1 PASS | |
|
0.15686275
|
org.qedeq.kernel.bo.latex.GenerateLatexTest.testGeneration
org.qedeq.kernel.bo.latex.GenerateLatexTest.testGeneration
|
1 PASS | |
| 1 | /* This file is part of the project "Hilbert II" - http://www.qedeq.org | |
| 2 | * | |
| 3 | * Copyright 2000-2010, Michael Meyling <mime@qedeq.org>. | |
| 4 | * | |
| 5 | * "Hilbert II" is free software; you can redistribute | |
| 6 | * it and/or modify it under the terms of the GNU General Public | |
| 7 | * License as published by the Free Software Foundation; either | |
| 8 | * version 2 of the License, or (at your option) any later version. | |
| 9 | * | |
| 10 | * This program is distributed in the hope that it will be useful, | |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 13 | * GNU General Public License for more details. | |
| 14 | */ | |
| 15 | ||
| 16 | package org.qedeq.kernel.dto.module; | |
| 17 | ||
| 18 | import java.util.ArrayList; | |
| 19 | import java.util.List; | |
| 20 | ||
| 21 | import org.qedeq.base.utility.EqualsUtility; | |
| 22 | import org.qedeq.kernel.base.module.LinkList; | |
| 23 | ||
| 24 | ||
| 25 | /** | |
| 26 | * List of links. A link is just a string that identifies something. | |
| 27 | * | |
| 28 | * @version $Revision: 1.6 $ | |
| 29 | * @author Michael Meyling | |
| 30 | */ | |
| 31 | public class LinkListVo implements LinkList { | |
| 32 | ||
| 33 | /** Contains all list elements. */ | |
| 34 | private final List list; | |
| 35 | ||
| 36 | /** | |
| 37 | * Constructs an empty list of links. | |
| 38 | */ | |
| 39 | 69 |
public LinkListVo() { |
| 40 | 69 | this.list = new ArrayList(); |
| 41 | ||
| 42 | } | |
| 43 | ||
| 44 | /** | |
| 45 | * Add link to list. | |
| 46 | * | |
| 47 | * @param id Identifier to add. | |
| 48 | */ | |
| 49 | 61 |
public final void add(final String id) { |
| 50 | 61 | list.add(id); |
| 51 | } | |
| 52 | ||
| 53 | 601 |
public final int size() { |
| 54 | 601 | return list.size(); |
| 55 | } | |
| 56 | ||
| 57 | 581 |
public final String get(final int index) { |
| 58 | 581 | return (String) list.get(index); |
| 59 | } | |
| 60 | ||
| 61 | 62 |
public boolean equals(final Object obj) { |
| 62 | 62 | if (!(obj instanceof LinkListVo)) { |
| 63 | 7 | return false; |
| 64 | } | |
| 65 | 55 | final LinkListVo otherList = (LinkListVo) obj; |
| 66 | 55 | if (size() != otherList.size()) { |
| 67 | 11 | return false; |
| 68 | } | |
| 69 | 114 | for (int i = 0; i < size(); i++) { |
| 70 | 74 | if (!EqualsUtility.equals(get(i), otherList.get(i))) { |
| 71 | 4 | return false; |
| 72 | } | |
| 73 | } | |
| 74 | 40 | return true; |
| 75 | } | |
| 76 | ||
| 77 | 60 |
public int hashCode() { |
| 78 | 60 | int hash = 0; |
| 79 | 166 | for (int i = 0; i < size(); i++) { |
| 80 | 106 | hash = hash ^ (i + 1); |
| 81 | 106 | if (get(i) != null) { |
| 82 | 104 | hash = hash ^ get(i).hashCode(); |
| 83 | } | |
| 84 | } | |
| 85 | 60 | return hash; |
| 86 | } | |
| 87 | ||
| 88 | 46 |
public String toString() { |
| 89 | 46 | final StringBuffer buffer = new StringBuffer("List of links:\n"); |
| 90 | 137 | for (int i = 0; i < size(); i++) { |
| 91 | 91 | if (i != 0) { |
| 92 | 48 | buffer.append("\n"); |
| 93 | } | |
| 94 | 91 | buffer.append((i + 1) + ":\n"); |
| 95 | 91 | buffer.append(get(i) != null ? get(i) : null); |
| 96 | } | |
| 97 | 46 | return buffer.toString(); |
| 98 | } | |
| 99 | ||
| 100 | } | |
|
||||||||||