oop - Java - sharing static methods across classes -
i've got 3 classes meant simulate mips32 pipeline registers. pretty this.
class idex { public static map<string, integer> write; public static map<string, integer> read; static { map<string, integer> tempmap = new hashmap<string, integer>(); tempmap.put("incrpc", 0); tempmap.put("readreg1value", 0); tempmap.put("readreg2value", 0); tempmap.put("seoffset", 0); tempmap.put("writereg_20_16", 0); tempmap.put("writereg_15_11", 0); tempmap.put("function", 0); read = new hashmap<string, integer>(tempmap); write = new hashmap<string, integer>(tempmap); } }
i have utility methods copying data hashmaps , formatting/printing them.
how can share these methods across register classes? in general, possible share methods between classes work on respective static variables?
Comments
Post a Comment