-
Notifications
You must be signed in to change notification settings - Fork 5
/
Doc.java
40 lines (30 loc) · 1.21 KB
/
Doc.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package org.genericsystem.cv.model;
import java.util.List;
import org.genericsystem.api.core.Snapshot;
import org.genericsystem.api.core.annotations.Components;
import org.genericsystem.api.core.annotations.InstanceClass;
import org.genericsystem.api.core.annotations.SystemGeneric;
import org.genericsystem.common.Generic;
import org.genericsystem.cv.model.Doc.DocInstance;
import org.genericsystem.cv.model.DocClass.DocClassInstance;
import org.genericsystem.cv.model.ZoneGeneric.ZoneInstance;
@SystemGeneric
@Components(DocClass.class)
@InstanceClass(DocInstance.class)
public class Doc implements Generic {
public static class DocInstance implements Generic {
public DocClassInstance getDocClass() {
return (DocClassInstance) this.getBaseComponent();
}
public List<ZoneInstance> getZones() {
Snapshot<ZoneInstance> shot = (Snapshot) getBaseComponent().getHolders(getRoot().find(ZoneGeneric.class));
return shot.toList();
}
}
public DocInstance addDoc(String name, DocClassInstance docClassInstance) {
return (DocInstance) setInstance(name, docClassInstance);
}
public DocInstance getDoc(String name, DocClassInstance docClassInstance) {
return (DocInstance) getInstance(name, docClassInstance);
}
}