private void copyAttributes(TableImpl sourceTable, TableImpl destTable, Element element, Element elementCopy) { TimeRepresentation tr = sourceTable.store.configuration.getTimeRepresentation(); for (Column col : sourceTable.toArray()) { if (!col.isProperty()) { Column colCopy = destTable.getColumn(col.getId()); if (col.isDynamic() && tr.equals(TimeRepresentation.TIMESTAMP)) { for (Map.Entry<Double, Object> entry : element.getAttributes(col)) { Double key = entry.getKey(); Object value = entry.getValue(); elementCopy.setAttribute(colCopy, value, key); } } else if (col.isDynamic() && tr.equals(TimeRepresentation.INTERVAL)) { for (Map.Entry<Interval, Object> entry : element.getAttributes(col)) { Interval key = entry.getKey(); Object value = entry.getValue(); elementCopy.setAttribute(colCopy, value, key); } } else { Object attribute = element.getAttribute(col); elementCopy.setAttribute(colCopy, attribute); } } } }
private void copyAttributes(TableImpl sourceTable, TableImpl destTable, Element element, Element elementCopy) { TimeRepresentation tr = sourceTable.store.configuration.getTimeRepresentation(); for (Column col : sourceTable.toArray()) { if (!col.isProperty()) { Column colCopy = destTable.getColumn(col.getId()); if (col.isDynamic() && tr.equals(TimeRepresentation.TIMESTAMP)) { for (Map.Entry<Double, Object> entry : element.getAttributes(col)) { Double key = entry.getKey(); Object value = entry.getValue(); elementCopy.setAttribute(colCopy, value, key); } } else if (col.isDynamic() && tr.equals(TimeRepresentation.INTERVAL)) { for (Map.Entry<Interval, Object> entry : element.getAttributes(col)) { Interval key = entry.getKey(); Object value = entry.getValue(); elementCopy.setAttribute(colCopy, value, key); } } else { Object attribute = element.getAttribute(col); elementCopy.setAttribute(colCopy, attribute); } } } }
@Override protected void refresh() { if (index != null && index.isSortable(column)) { min = index.getMinValue(column); max = index.getMaxValue(column); } else { ElementIterable<? extends Element> iterable = AttributeUtils.isNodeColumn(column) ? graph.getNodes() : graph.getEdges(); if (column.isDynamic()) { refreshDynamic(iterable); } else { refreshNotIndexed(iterable); } } }
@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; }
boolean isDynamicWeight = graphModel.getEdgeTable().getColumn("weight").isDynamic(); Interval interval = graph.getView().getTimeInterval();
private boolean isRanking(Graph graph, Column column) { if (column.isDynamic() && column.isNumber()) { ElementIterable<? extends Element> iterable = AttributeUtils.isNodeColumn(column) ? graph.getNodes() : graph.getEdges(); for (Element el : iterable) { if (el.getAttribute(column, graph.getView()) != null) { iterable.doBreak(); return true; } } } else if (!column.isDynamic() && !column.isArray() && column.isIndexed() && column.isNumber()) { Index index; if (AttributeUtils.isNodeColumn(column)) { index = localScale ? graphModel.getNodeIndex(graph.getView()) : graphModel.getNodeIndex(); } else { index = localScale ? graphModel.getEdgeIndex(graph.getView()) : graphModel.getEdgeIndex(); } if (index.countValues(column) > 0) { return true; } } return false; }
if (column.isDynamic() && isValid()) { TimeIndexStore timeIndexStore = getTimeIndexStore(); if (timeIndexStore != null) {
if (column.isDynamic() && isValid()) { TimeIndexStore timeIndexStore = getTimeIndexStore(); if (timeIndexStore != null) {
private boolean isPartition(Graph graph, Column column) { if (column.isDynamic()) { if (!column.isNumber()) { return true;
boolean isDynamicWeight = graphModel.getEdgeTable().getColumn("weight").isDynamic(); Interval interval = graph.getView().getTimeInterval();
this.graph = graphModel.getGraphVisible(); graph.readLock(); boolean isDynamicWeight = graphModel.getEdgeTable().getColumn("weight").isDynamic(); Interval interval = graph.getView().getTimeInterval();