]>
git.argeo.org Git - gpl/argeo-suite.git/blob - org.argeo.suite.core/src/org/argeo/suite/core/SuiteTerm.java
1 package org
.argeo
.suite
.core
;
3 import java
.util
.ArrayList
;
6 import org
.argeo
.entity
.Term
;
9 * A single term. Helper to optimise {@link SuiteTermsManager} implementation.
11 class SuiteTerm
implements Term
{
12 private final String name
;
13 private final String relativePath
;
14 private final SuiteTypology typology
;
15 private final String id
;
17 private final SuiteTerm parentTerm
;
18 private final List
<SuiteTerm
> subTerms
= new ArrayList
<>();
20 SuiteTerm(SuiteTypology typology
, String relativePath
, SuiteTerm parentTerm
) {
21 this.typology
= typology
;
22 this.parentTerm
= parentTerm
;
23 this.relativePath
= relativePath
;
24 int index
= relativePath
.lastIndexOf('/');
26 this.name
= relativePath
.substring(index
+ 1);
28 this.name
= relativePath
;
30 id
= typology
.getName() + '/' + relativePath
;
34 public String
getId() {
39 public String
getName() {
43 public String
getRelativePath() {
48 public SuiteTypology
getTypology() {
53 public List
<SuiteTerm
> getSubTerms() {
58 public SuiteTerm
getParentTerm() {