1 package org.catacomb.numeric.data;
2
3 import java.lang.reflect.Field;
4
5 import org.catacomb.interlish.content.BasicTouchTime;
6 import org.catacomb.interlish.structure.TreeNode;
7
8 public abstract class StackSlice implements TreeNode {
9
10 BlockStack blockStack;
11
12 String fieldName;
13 String unit;
14 String title;
15 Field field;
16
17
18 BasicTouchTime cacheTime;
19
20
21 public StackSlice(BlockStack bs, String fnm, Field f, String u, String t) {
22 blockStack = bs;
23 fieldName = fnm;
24 field = f;
25 unit = u;
26 title = t;
27 cacheTime = new BasicTouchTime();
28 }
29
30
31 public String getName() {
32 return fieldName;
33 }
34
35 public String getLabel() {
36 return title;
37 }
38
39 public String toString() {
40
41
42 return fieldName;
43 }
44
45
46 public String getUnit() {
47 return unit;
48 }
49
50 public String getTitle() {
51 return title;
52 }
53
54
55 public int getNPoint() {
56 return blockStack.getSize();
57 }
58
59
60 boolean upToDate() {
61 return cacheTime.isAfter(blockStack.getChangeTime());
62 }
63
64
65 public void clear() {
66 cacheTime.now();
67 clearCache();
68 }
69
70
71 abstract void clearCache();
72
73
74 int getSize() {
75 return (blockStack.getSize());
76 }
77
78
79
80
81 public Object getParent() {
82 return blockStack;
83 }
84
85
86
87
88
89
90
91 }