add more data caching code

This commit is contained in:
2022-02-23 08:13:06 -06:00
parent 3ccee9891b
commit f904cf6672

View File

@@ -1,6 +1,11 @@
//main class. Only job is to choose which interface to use, and hold graph data in memory
//main class. For choosing interface type and caching file data
public class BiGpairSEQ {
private static CellSample cellSampleInMemory = null;
private static String cellFilename = null;
private static Plate plateInMemory = null;
private static String plateFilename = null;
private static GraphWithMapData graphInMemory = null;
private static String graphFilename = null;
@@ -15,18 +20,55 @@ public class BiGpairSEQ {
}
}
public static GraphWithMapData getGraph() {
public static CellSample getCellSampleInMemory() {
return cellSampleInMemory;
}
public static void setCellSampleInMemory(CellSample cellSampleInMemory) {
BiGpairSEQ.cellSampleInMemory = cellSampleInMemory;
}
public static String getCellFilename() {
return cellFilename;
}
public static void setCellFilename(String cellFilename) {
BiGpairSEQ.cellFilename = cellFilename;
}
public static Plate getPlateInMemory() {
return plateInMemory;
}
public static void setPlateInMemory(Plate plateInMemory) {
BiGpairSEQ.plateInMemory = plateInMemory;
}
public static void clearPlate() {
plateInMemory = null;
System.gc();
}
public static String getPlateFilename() {
return plateFilename;
}
public static void setPlateFilename(String plateFilename) {
BiGpairSEQ.plateFilename = plateFilename;
}
public static GraphWithMapData getGraphInMemory() {
return graphInMemory;
}
public static void setGraph(GraphWithMapData g) {
public static void setGraphInMemory(GraphWithMapData g) {
if (graphInMemory != null) {
clearGraph();
clearGraphInMemory();
}
graphInMemory = g;
}
public static void clearGraph() {
public static void clearGraphInMemory() {
graphInMemory = null;
System.gc();
}