add hasSpatialLayers()
This commit is contained in:
parent
c4af58c1e1
commit
1098365d62
|
@ -4,9 +4,15 @@ import java.io.Serializable;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Class SectionView.
|
||||||
|
*
|
||||||
|
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
|
||||||
|
*
|
||||||
|
* Nov 11, 2022
|
||||||
|
*/
|
||||||
public class SectionView implements Serializable, CheckEmpty {
|
public class SectionView implements Serializable, CheckEmpty {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
@ -16,41 +22,64 @@ public class SectionView implements Serializable, CheckEmpty {
|
||||||
|
|
||||||
private List<SubDocumentView> listSubDocuments;
|
private List<SubDocumentView> listSubDocuments;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Instantiates a new section view.
|
||||||
|
*/
|
||||||
public SectionView() {
|
public SectionView() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if is empty.
|
||||||
|
*
|
||||||
|
* @return true, if is empty
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean isEmpty(){
|
public boolean isEmpty() {
|
||||||
if (listSubDocuments == null)
|
if (listSubDocuments == null)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
for (SubDocumentView subDocumentView : listSubDocuments) {
|
for (SubDocumentView subDocumentView : listSubDocuments) {
|
||||||
boolean isEmpty = subDocumentView.isEmpty();
|
boolean isEmpty = subDocumentView.isEmpty();
|
||||||
if(isEmpty)
|
if (isEmpty)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasSpatialLayers(){
|
/**
|
||||||
|
* Checks for spatial layers.
|
||||||
|
*
|
||||||
|
* @return true, if successful
|
||||||
|
*/
|
||||||
|
public boolean hasSpatialLayers() {
|
||||||
if (listSubDocuments == null)
|
if (listSubDocuments == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
for (SubDocumentView subDocumentView : listSubDocuments) {
|
for (SubDocumentView subDocumentView : listSubDocuments) {
|
||||||
boolean hasLayers = subDocumentView.getListLayers()!=null && subDocumentView.getListLayers().size()>0;
|
boolean hasLayers = subDocumentView.getListLayers() != null && subDocumentView.getListLayers().size() > 0;
|
||||||
if(hasLayers)
|
if (hasLayers)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the section title.
|
||||||
|
*
|
||||||
|
* @return the section title
|
||||||
|
*/
|
||||||
public String getSectionTitle() {
|
public String getSectionTitle() {
|
||||||
return sectionTitle;
|
return sectionTitle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adds the sub document.
|
||||||
|
*
|
||||||
|
* @param subDocumentView the sub document view
|
||||||
|
*/
|
||||||
public void addSubDocument(SubDocumentView subDocumentView) {
|
public void addSubDocument(SubDocumentView subDocumentView) {
|
||||||
|
|
||||||
if (listSubDocuments == null)
|
if (listSubDocuments == null)
|
||||||
|
@ -59,18 +88,33 @@ public class SectionView implements Serializable, CheckEmpty {
|
||||||
listSubDocuments.add(subDocumentView);
|
listSubDocuments.add(subDocumentView);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the list sub documents.
|
||||||
|
*
|
||||||
|
* @return the list sub documents
|
||||||
|
*/
|
||||||
public List<SubDocumentView> getListSubDocuments() {
|
public List<SubDocumentView> getListSubDocuments() {
|
||||||
|
|
||||||
if(listSubDocuments == null)
|
if (listSubDocuments == null)
|
||||||
listSubDocuments = new ArrayList<SubDocumentView>();
|
listSubDocuments = new ArrayList<SubDocumentView>();
|
||||||
|
|
||||||
return listSubDocuments;
|
return listSubDocuments;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the section title.
|
||||||
|
*
|
||||||
|
* @param sectionTitle the new section title
|
||||||
|
*/
|
||||||
public void setSectionTitle(String sectionTitle) {
|
public void setSectionTitle(String sectionTitle) {
|
||||||
this.sectionTitle = sectionTitle;
|
this.sectionTitle = sectionTitle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* To string.
|
||||||
|
*
|
||||||
|
* @return the string
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
StringBuilder builder = new StringBuilder();
|
StringBuilder builder = new StringBuilder();
|
||||||
|
|
Loading…
Reference in New Issue