protected void refreshDynamic(ElementIterable<? extends Element> iterable) { double minN = Double.POSITIVE_INFINITY; double maxN = Double.NEGATIVE_INFINITY; for (Element el : iterable) { TimeMap timeMap = (TimeMap) el.getAttribute(column); if (timeMap != null) { double numMin = ((Number) timeMap.get(graph.getView().getTimeInterval(), Estimator.MIN)).doubleValue(); double numMax = ((Number) timeMap.get(graph.getView().getTimeInterval(), Estimator.MAX)).doubleValue(); if (numMin < minN) { minN = numMin; } if (numMax > maxN) { maxN = numMax; } } } min = minN; max = maxN; }
@Override public Object getValue(Element element, Graph gr) { if (graph != null) { TimeMap val = (TimeMap) element.getAttribute(column); if (val != null) { return val.get(gr.getView().getTimeInterval(), Estimator.FIRST); } return null; } return element.getAttribute(column); }
@Override protected void refresh() { if (graph.getEdgeCount() > 0) { double minV = Double.MAX_VALUE; double maxV = Double.MIN_VALUE; for (Edge e : graph.getEdges()) { if (e.hasDynamicWeight()) { TimeMap timeMap = (TimeMap) e.getAttribute("weight"); if (timeMap != null) { Double numMin = (Double) timeMap.get(graph.getView().getTimeInterval(), Estimator.MIN); Double numMax = (Double) timeMap.get(graph.getView().getTimeInterval(), Estimator.MAX); minV = Math.min(numMin, minV); maxV = Math.max(numMax, maxV); } } else { minV = Math.min(e.getWeight(), minV); maxV = Math.max(e.getWeight(), maxV); } } min = minV; max = maxV; } } }
bounds = graphModel.getTimeBounds(); } else { bounds = currentView.getTimeInterval();
@Override public double getWeight(GraphView view) { synchronized (this) { Object value = attributes[GraphStoreConfiguration.EDGE_WEIGHT_INDEX]; if (value instanceof TimeMap) { Interval interval = view.getTimeInterval(); checkViewExist((GraphView) view); TimeMap dynamicValue = (TimeMap) value; Estimator estimator = getColumnStore().getColumnByIndex(GraphStoreConfiguration.EDGE_WEIGHT_INDEX) .getEstimator(); if (estimator == null) { estimator = GraphStoreConfiguration.DEFAULT_ESTIMATOR; } Double doubleVal = (Double) dynamicValue.get(interval, estimator); return doubleVal != null ? doubleVal : DEFAULT_DYNAMIC_EDGE_WEIGHT_WHEN_MISSING; } else if (value == null) { return DEFAULT_DYNAMIC_EDGE_WEIGHT_WHEN_MISSING; } else { // Must be double return (Double) value; } } }
@Override public double getWeight(GraphView view) { synchronized (this) { Object value = attributes[GraphStoreConfiguration.EDGE_WEIGHT_INDEX]; if (value instanceof TimeMap) { Interval interval = view.getTimeInterval(); checkViewExist((GraphView) view); TimeMap dynamicValue = (TimeMap) value; Estimator estimator = getColumnStore().getColumnByIndex(GraphStoreConfiguration.EDGE_WEIGHT_INDEX) .getEstimator(); if (estimator == null) { estimator = GraphStoreConfiguration.DEFAULT_ESTIMATOR; } Double doubleVal = (Double) dynamicValue.get(interval, estimator); return doubleVal != null ? doubleVal : DEFAULT_DYNAMIC_EDGE_WEIGHT_WHEN_MISSING; } else if (value == null) { return DEFAULT_DYNAMIC_EDGE_WEIGHT_WHEN_MISSING; } else { // Must be double return (Double) value; } } }
@Override public Object getAttribute(Column column, GraphView view) { checkColumn(column); if (!column.isDynamic()) { return getAttribute(column); } else { Interval interval = view.getTimeInterval(); checkViewExist((GraphView) view); int index = column.getIndex(); synchronized (this) { TimeMap dynamicValue = null; if (index < attributes.length) { dynamicValue = (TimeMap) attributes[index]; } if (dynamicValue != null && !dynamicValue.isEmpty()) { Estimator estimator = column.getEstimator(); if (estimator == null) { estimator = GraphStoreConfiguration.DEFAULT_ESTIMATOR; } return dynamicValue.get(interval, estimator); } } } return null; }
@Override public Object getAttribute(Column column, GraphView view) { checkColumn(column); if (!column.isDynamic()) { return getAttribute(column); } else { Interval interval = view.getTimeInterval(); checkViewExist((GraphView) view); int index = column.getIndex(); synchronized (this) { TimeMap dynamicValue = null; if (index < attributes.length) { dynamicValue = (TimeMap) attributes[index]; } if (dynamicValue != null && !dynamicValue.isEmpty()) { Estimator estimator = column.getEstimator(); if (estimator == null) { estimator = GraphStoreConfiguration.DEFAULT_ESTIMATOR; } return dynamicValue.get(interval, estimator); } } } return null; }
graph.readLock(); boolean isDynamicWeight = graphModel.getEdgeTable().getColumn("weight").isDynamic(); Interval interval = graph.getView().getTimeInterval();
bounds = graphModel.getTimeBounds(); } else { bounds = currentView.getTimeInterval();
graph.readLock(); boolean isDynamicWeight = graphModel.getEdgeTable().getColumn("weight").isDynamic(); Interval interval = graph.getView().getTimeInterval();
graph.readLock(); boolean isDynamicWeight = graphModel.getEdgeTable().getColumn("weight").isDynamic(); Interval interval = graph.getView().getTimeInterval();