Search in sources :

Example 1 with DocPartDataImpl

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;
}
Also used : TableMetadata(com.torodb.d2r.model.TableMetadata) DocPartDataImpl(com.torodb.d2r.model.DocPartDataImpl)

Example 2 with DocPartDataImpl

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;
}
Also used : DocPartData(com.torodb.core.d2r.DocPartData) ArrayList(java.util.ArrayList) DocPartDataImpl(com.torodb.d2r.model.DocPartDataImpl)

Example 3 with DocPartDataImpl

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;
}
Also used : PathInfo(com.torodb.d2r.model.PathStack.PathInfo) DocPartDataImpl(com.torodb.d2r.model.DocPartDataImpl)

Aggregations

DocPartDataImpl (com.torodb.d2r.model.DocPartDataImpl)3 DocPartData (com.torodb.core.d2r.DocPartData)1 PathInfo (com.torodb.d2r.model.PathStack.PathInfo)1 TableMetadata (com.torodb.d2r.model.TableMetadata)1 ArrayList (java.util.ArrayList)1