use of com.torodb.d2r.model.DocPartDataImpl in project torodb by torodb.
the class DocPartDataCollection method findDocPartData.
public DocPartDataImpl findDocPartData(PathInfo path) {
DocPartDataImpl docPartData = docPartDataMap.get(path);
if (docPartData == null) {
TableMetadata metadata = new TableMetadata(collectionMetaInfo, path.getTableRef());
DocPartDataImpl parentDocPartData = findParent(path);
docPartData = new DocPartDataImpl(metadata, parentDocPartData);
docPartDataMap.put(path, docPartData);
docPartDataList.add(docPartData);
}
return docPartData;
}
use of com.torodb.d2r.model.DocPartDataImpl in project torodb by torodb.
the class DocPartDataCollection method orderedDocPartData.
@Override
public Iterable<DocPartData> orderedDocPartData() {
List<DocPartData> all = new ArrayList<>();
for (DocPartDataImpl table : docPartDataList) {
if (table.getParentDocPartRow() == null) {
all.add(table);
addChilds(table, all);
return all;
}
}
return all;
}
use of com.torodb.d2r.model.DocPartDataImpl in project torodb by torodb.
the class DocPartDataCollection method findParent.
private DocPartDataImpl findParent(PathInfo path) {
PathInfo it = path.getParent();
while (it != null) {
DocPartDataImpl tableInfo = docPartDataMap.get(it);
if (tableInfo != null) {
return tableInfo;
}
it = it.getParent();
}
return null;
}
Aggregations