Skip to content

Commit

Permalink
KNOWAGE-8098
Browse files Browse the repository at this point in the history
  • Loading branch information
davide-zerbetto authored Sep 20, 2023
2 parents 777faa5 + a0fda59 commit 305f9d7
Show file tree
Hide file tree
Showing 11 changed files with 57 additions and 74 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ public class Node implements Cloneable, Comparable<Node> {
public static final String CROSSTAB_NODE_COLUMN_ROOT = "rootC";
public static final String CROSSTAB_NODE_ROW_ROOT = "rootR";

private String value;// the value of the node
private String description;// the value of the node
private final String value;// the value of the node
private final String description;// the value of the node
private CellType cellType;// the value of the node
private List<Node> childs;// list of childs
private int leafPosition = -1;// position of the leafs in the tree.. If this is the right most leaf the value is 0 and so on
Expand All @@ -50,13 +50,13 @@ public class Node implements Cloneable, Comparable<Node> {
public Node(String value) {
this.value = value;
this.description = value;
childs = new ArrayList<Node>();
childs = new ArrayList<>();
}

public Node(String value, String description) {
this.value = value;
this.description = description;
childs = new ArrayList<Node>();
childs = new ArrayList<>();
}

public String getValue() {
Expand Down Expand Up @@ -93,7 +93,7 @@ public boolean isChild(Node child) {

/**
* Get the number of leafs in the tree
*
*
* @return
*/
public int getLeafsNumber() {
Expand All @@ -110,7 +110,7 @@ public int getLeafsNumber() {

/**
* Serialize the node and the subtree
*
*
* @return
* @throws JSONException
*/
Expand Down Expand Up @@ -168,12 +168,12 @@ public void setLeafPositionsForCF(List<Integer> leafPositionsForCF) {

/**
* return the list of nodes of the passed level
*
*
* @param level
* @return
*/
public List<Node> getLevel(int level) {
List<Node> nodes = new ArrayList<Node>();
List<Node> nodes = new ArrayList<>();
if (level == 0) {
nodes.add(this);
} else {
Expand All @@ -189,7 +189,7 @@ public List<Node> getLevel(int level) {

/**
* Returns the depth level of the node: root is depth 0, its children are depth 1 and so on...
*
*
* @return the depth level of the node: root is depth 0, its children are depth 1 and so on...
*/
public int getDistanceFromRoot() {
Expand All @@ -203,7 +203,7 @@ public int getDistanceFromRoot() {
/**
* Returns the level distance between the node and its leaves (it is assumed that the tree is balanced, therefore every leaf has the same distance to this
* node). If the node is a leaf, 0 is returned.
*
*
* @return the level distance between the node and its leaves (it is assumed that the tree is balanced, therefore every leaf has the same distance to this
* node). If the node is a leaf, 0 is returned.
*/
Expand All @@ -217,11 +217,11 @@ public int getDistanceFromLeaves() {

/**
* Return the list of leafs of the subtree with this node as radix
*
*
* @return
*/
public List<Node> getLeafs() {
List<Node> list = new ArrayList<Node>();
List<Node> list = new ArrayList<>();
if (childs.size() == 0) {
list.add(this);
} else {
Expand Down Expand Up @@ -279,7 +279,7 @@ public int getRightMostLeafPositionCF() {
* Clone only the value and the children
*/
@Override
public Node clone() {
public final Node clone() {
Node n = new Node(value, description);
if (childs.size() > 0) {
for (int j = 0; j < childs.size(); j++) {
Expand Down Expand Up @@ -307,7 +307,7 @@ public String toString() {

/**
* For test
*
*
* @param height
* @param branch
*/
Expand Down Expand Up @@ -360,7 +360,7 @@ public void setCellType(CellType cellType) {

/*
* (non-Javadoc)
*
*
* @see java.lang.Comparable#compareTo(java.lang.Object) order always for value
*/
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,15 @@ public Node(String value) {
this.value = value;
this.description = value;
measure = false;
children = new ArrayList<Node>();
children = new ArrayList<>();
jsonObject = null;
}

public Node(String value, String description) {
this.value = value;
this.description = description;
measure = false;
children = new ArrayList<Node>();
children = new ArrayList<>();
jsonObject = null;
}

Expand All @@ -83,7 +83,7 @@ public Node(String columnName, String value, String description) {
this.value = value;
this.description = description;
measure = false;
children = new ArrayList<Node>();
children = new ArrayList<>();
jsonObject = null;
}

Expand All @@ -92,7 +92,7 @@ public Node(String columnName, String value, String description, boolean measure
this.value = value;
this.description = description;
this.measure = measure;
children = new ArrayList<Node>();
children = new ArrayList<>();
jsonObject = null;
}

Expand All @@ -101,7 +101,7 @@ public Node(String columnName, String value, String description, JSONObject json
this.value = value;
this.description = description;
this.measure = false;
children = new ArrayList<Node>();
children = new ArrayList<>();
this.jsonObject = jsonObject;
}

Expand Down Expand Up @@ -266,7 +266,7 @@ public void setLeafPositionsForCF(List<Integer> leafPositionsForCF) {
* @return
*/
public List<Node> getLevel(int level) {
List<Node> nodes = new ArrayList<Node>();
List<Node> nodes = new ArrayList<>();
if (level == 0) {
nodes.add(this);
} else {
Expand Down Expand Up @@ -342,7 +342,7 @@ public int getDistanceFromLeaves() {
* @return
*/
public List<Node> getLeafs() {
List<Node> list = new ArrayList<Node>();
List<Node> list = new ArrayList<>();
if (children.size() == 0) {
list.add(this);
} else {
Expand Down Expand Up @@ -400,7 +400,7 @@ public int getRightMostLeafPositionCF() {
* Clone only the value and the children
*/
@Override
public Node clone() {
public final Node clone() {
Node n = new Node(columnName, value, description, measure);
if (children.size() > 0) {
for (int j = 0; j < children.size(); j++) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ public void setFunctionalities(List functionalities) {
@JsonProperty(value = "functionalities")
public List getFunctionalitiesNames() throws EMFUserError {
ILowFunctionalityDAO functionalitiesDao = DAOFactory.getLowFunctionalityDAO();
List<String> list = new ArrayList<String>();
List<String> list = new ArrayList<>();

for (Integer functionalityID : (List<Integer>) functionalities) {
list.add(functionalitiesDao.loadLowFunctionalityByID(functionalityID, false).getPath());
Expand Down Expand Up @@ -815,7 +815,7 @@ public void setLockedByUser(String lockedByUser) {
* Clone the object.. NOTE: it does not clone the id property
*/
@Override
public BIObject clone() {
public final BIObject clone() {
BIObject clone = new BIObject();
clone.setEngine(this.engine);
clone.setDataSourceId(dataSourceId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ public String getName() {
/**
* Sets the name.
*
* @param name
* the new name
* @param name the new name
*/
public void setName(String name) {
this.name = name;
Expand All @@ -76,8 +75,7 @@ public Integer getProg() {
/**
* Sets the prog.
*
* @param prog
* the new prog
* @param prog the new prog
*/
public void setProg(Integer prog) {
this.prog = prog;
Expand All @@ -95,8 +93,7 @@ public Date getCreationDate() {
/**
* Sets the creation date.
*
* @param creationDate
* the new creation date
* @param creationDate the new creation date
*/
public void setCreationDate(Date creationDate) {
this.creationDate = creationDate;
Expand All @@ -114,8 +111,7 @@ public Boolean getActive() {
/**
* Sets the active.
*
* @param activeP
* the new active
* @param activeP the new active
*/
public void setActive(Boolean activeP) {
this.active = activeP;
Expand All @@ -133,8 +129,7 @@ public Integer getId() {
/**
* Sets the id.
*
* @param id
* the new id
* @param id the new id
*/
public void setId(Integer id) {
this.id = id;
Expand All @@ -152,8 +147,7 @@ public Integer getBiobjId() {
/**
* Sets the biobj id.
*
* @param biobjId
* the new biobj id
* @param biobjId the new biobj id
*/
public void setBiobjId(Integer biobjId) {
this.biobjId = biobjId;
Expand All @@ -171,8 +165,7 @@ public Integer getBinId() {
/**
* Sets the bin id.
*
* @param binId
* the new bin id
* @param binId the new bin id
*/
public void setBinId(Integer binId) {
this.binId = binId;
Expand All @@ -183,10 +176,8 @@ public void setBinId(Integer binId) {
*
* @return The binary content of this instance; if it is null, it tries to load it from database if binary content identifier is available
*
* @throws EMFUserError
* if some errors while reading from db occurs
* @throws EMFInternalError
* if some errors while reading from db occurs
* @throws EMFUserError if some errors while reading from db occurs
* @throws EMFInternalError if some errors while reading from db occurs
*/
public byte[] getContent() throws HibernateException {
if (content == null) {
Expand All @@ -209,8 +200,7 @@ public byte[] getContent() throws HibernateException {
/**
* Sets the content.
*
* @param content
* the new content
* @param content the new content
*/
public void setContent(byte[] content) {
this.content = content;
Expand All @@ -228,8 +218,7 @@ public String getDimension() {
/**
* Sets the dimension.
*
* @param dimension
* the new dimension
* @param dimension the new dimension
*/
public void setDimension(String dimension) {
this.dimension = dimension;
Expand All @@ -247,8 +236,7 @@ public String getCreationUser() {
/**
* Sets the creation user.
*
* @param creationUser
* the new creation user
* @param creationUser the new creation user
*/
public void setCreationUser(String creationUser) {
this.creationUser = creationUser;
Expand All @@ -258,7 +246,7 @@ public void setCreationUser(String creationUser) {
* Clone the object.. NOTE: it does not clone the id property
*/
@Override
public ObjTemplate clone() {
public final ObjTemplate clone() {
ObjTemplate clone = new ObjTemplate();
clone.setBiobjId(biobjId);
clone.setBinId(binId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import java.util.Date;

// TODO: remove the old class it.eng.spagobi.kpi.bo.config.KpiValue
public class KpiValue implements Cloneable {
public final class KpiValue implements Cloneable {

private int id;
private int kpiId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import java.util.Date;

public class KpiValueExecLog implements Cloneable {
public final class KpiValueExecLog implements Cloneable {

private int id;
private int schedulerId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,12 @@ public class Field implements IField, Cloneable {
Object description = null;

public Field() {
super();
}

/**
* @param value
*/
public Field(Object value) {
super();
this.value = value;
}

Expand All @@ -41,7 +39,6 @@ public Field(Object value) {
* @param description
*/
public Field(Object value, Object description) {
super();
this.value = value;
this.description = description;
}
Expand Down Expand Up @@ -98,7 +95,7 @@ public boolean equals(Object obj) {
}

@Override
public Field clone() throws CloneNotSupportedException {
public final Field clone() throws CloneNotSupportedException {
return (Field) super.clone();
}

Expand Down
Loading

0 comments on commit 305f9d7

Please sign in to comment.