BrightSide Workbench Full Report + Source Code
GenericMatching.java
Go to the documentation of this file.
1 /*
2  * TurrĂ³ i Cutiller Foundation. License notice.
3  * Copyright (C) 2020 Lluis TurrĂ³ Cutiller <http://www.turro.org/>
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU Affero General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (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 Affero General Public License for more details.
14  *
15  * You should have received a copy of the GNU Affero General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 package org.turro.matching;
20 
21 import org.turro.path.Path;
22 
27 public class GenericMatching implements IMatching {
28 
29  private String entityPath;
30  private String relatedPath;
31  private String concept;
32  private double matching;
33 
34  public GenericMatching(String entityPath, String relatedPath, String concept, double matching) {
35  this.entityPath = entityPath;
36  this.relatedPath = relatedPath;
37  this.concept = concept;
38  this.matching = matching;
39  }
40 
41  public GenericMatching(String entityPath, String relatedPath, String concept, long matching) {
42  this.entityPath = entityPath;
43  this.relatedPath = relatedPath;
44  this.concept = concept;
45  this.matching = matching;
46  }
47 
48  @Override
49  public String getEntityPath() {
50  return entityPath;
51  }
52 
53  @Override
54  public String getRelatedPath() {
55  return relatedPath;
56  }
57 
58  @Override
59  public String getConcept() {
60  return concept;
61  }
62 
63  @Override
64  public double getMatching() {
65  return matching;
66  }
67 
68  @Override
69  public void setEntityPath(String entityPath) {
70  this.entityPath = entityPath;
71  }
72 
73  @Override
74  public void setRelatedPath(String relatedPath) {
75  this.relatedPath = relatedPath;
76  }
77 
78  @Override
79  public void setConcept(String concept) {
80  this.concept = concept;
81  }
82 
83  @Override
84  public void setMatching(double matching) {
85  this.matching = matching;
86  }
87 
88  public IMatching copyTo(IMatching matchingEntity) {
89  Path path = new Path(entityPath);
90  matchingEntity.setEntityPath(path.getTill(2));
91  path = new Path(relatedPath);
92  matchingEntity.setRelatedPath(path.getTill(2));
93  matchingEntity.setConcept(concept);
94  matchingEntity.setMatching(matching);
95  return matchingEntity;
96  }
97 
98 }
IMatching copyTo(IMatching matchingEntity)
void setRelatedPath(String relatedPath)
GenericMatching(String entityPath, String relatedPath, String concept, double matching)
void setEntityPath(String entityPath)
GenericMatching(String entityPath, String relatedPath, String concept, long matching)
void setRelatedPath(String relatedPath)
void setConcept(String concept)
void setMatching(double value)
void setEntityPath(String entityPath)