TimeRepresentation getTimeRepresentation() { if (graphStore != null) { return graphStore.configuration.getTimeRepresentation(); } return GraphStoreConfiguration.DEFAULT_TIME_REPRESENTATION; } }
TimeRepresentation getTimeRepresentation() { if (graphStore != null) { return graphStore.configuration.getTimeRepresentation(); } return GraphStoreConfiguration.DEFAULT_TIME_REPRESENTATION; } }
public DynamicRangeFilter(GraphModel graphModel) { this.timeRepresentation = graphModel.getConfiguration().getTimeRepresentation(); }
@Override public boolean canExecute() { TimeRepresentation timeRepresentation = Lookup.getDefault().lookup(GraphController.class).getGraphModel().getConfiguration().getTimeRepresentation(); if (timeRepresentation != TimeRepresentation.INTERVAL) { return false; } return columns.length == 1 || columns.length == 2; }
private void checkValidConfiguration(Configuration config) { Class edgeWeightType = config.getEdgeWeightType(); if (edgeWeightType.equals(Double.class)) { return;// Double is always allowed } switch (config.getTimeRepresentation()) { case INTERVAL: if (!edgeWeightType.equals(IntervalDoubleMap.class)) { throw new IllegalArgumentException( "Edge weight type should be Double or IntervalDoubleMap for INTERVAL TimeRepresentation"); } break; case TIMESTAMP: if (!edgeWeightType.equals(TimestampDoubleMap.class)) { throw new IllegalArgumentException( "Edge weight type should be Double or TimestampDoubleMap for TIMESTAMP TimeRepresentation"); } break; } } }
private void checkValidConfiguration(Configuration config) { Class edgeWeightType = config.getEdgeWeightType(); if (edgeWeightType.equals(Double.class)) { return;// Double is always allowed } switch (config.getTimeRepresentation()) { case INTERVAL: if (!edgeWeightType.equals(IntervalDoubleMap.class)) { throw new IllegalArgumentException( "Edge weight type should be Double or IntervalDoubleMap for INTERVAL TimeRepresentation"); } break; case TIMESTAMP: if (!edgeWeightType.equals(TimestampDoubleMap.class)) { throw new IllegalArgumentException( "Edge weight type should be Double or TimestampDoubleMap for TIMESTAMP TimeRepresentation"); } break; } } }
@Override public AttributeColumnsManipulatorUI getUI(Table table, Column column) { TimeRepresentation timeRepresentation = Lookup.getDefault().lookup(GraphController.class).getGraphModel().getConfiguration().getTimeRepresentation(); if (timeRepresentation == TimeRepresentation.INTERVAL) { return new ConvertColumnToDynamicUI(); } else { return new ConvertColumnToDynamicTimestampsUI(); } }
@Override public void execute(GraphModel graphModel) { this.graphModel = graphModel; this.isDirected = graphModel.isDirected(); this.averages = new HashMap<>(); //Attributes cols if (!averageOnly) { TimeRepresentation tr = graphModel.getConfiguration().getTimeRepresentation(); Table nodeTable = graphModel.getNodeTable(); dynamicCoefficientColumn = nodeTable.getColumn(DYNAMIC_CLUSTERING_COEFFICIENT); if (dynamicCoefficientColumn == null) { dynamicCoefficientColumn = nodeTable.addColumn(DYNAMIC_CLUSTERING_COEFFICIENT, NbBundle.getMessage(DynamicClusteringCoefficient.class, "DynamicClusteringCoefficient.nodecolumn.ClusteringCoefficient"), tr.equals(TimeRepresentation.INTERVAL) ? IntervalDoubleMap.class : TimestampDoubleMap.class, null); } } }
private void copyEdgeWeight(EdgeImpl edge, Edge edgeCopy) { if (edge.hasDynamicWeight()) { TimeRepresentation tr = edge.graphStore.configuration.getTimeRepresentation(); if (tr.equals(TimeRepresentation.INTERVAL)) { for (Map.Entry<Interval, Double> entry : edge.getWeights()) { edgeCopy.setWeight(entry.getValue(), entry.getKey()); } } else if (tr.equals(TimeRepresentation.TIMESTAMP)) { for (Map.Entry<Double, Double> entry : edge.getWeights()) { edgeCopy.setWeight(entry.getValue(), entry.getKey()); } } } else { edgeCopy.setWeight(edge.getWeight()); } }
private void copyEdgeWeight(EdgeImpl edge, Edge edgeCopy) { if (edge.hasDynamicWeight()) { TimeRepresentation tr = edge.graphStore.configuration.getTimeRepresentation(); if (tr.equals(TimeRepresentation.INTERVAL)) { for (Map.Entry<Interval, Double> entry : edge.getWeights()) { edgeCopy.setWeight(entry.getValue(), entry.getKey()); } } else if (tr.equals(TimeRepresentation.TIMESTAMP)) { for (Map.Entry<Double, Double> entry : edge.getWeights()) { edgeCopy.setWeight(entry.getValue(), entry.getKey()); } } } else { edgeCopy.setWeight(edge.getWeight()); } }
public TimeStore(GraphStore store, GraphLock graphLock, boolean indexed) { lock = graphLock; graphStore = store; TimeRepresentation timeRepresentation = GraphStoreConfiguration.DEFAULT_TIME_REPRESENTATION; if (store != null) { timeRepresentation = store.configuration.getTimeRepresentation(); } if (timeRepresentation.equals(TimeRepresentation.INTERVAL)) { nodeIndexStore = new IntervalIndexStore<Node>(Node.class, lock, indexed); edgeIndexStore = new IntervalIndexStore<Edge>(Edge.class, lock, indexed); } else { nodeIndexStore = new TimestampIndexStore<Node>(Node.class, lock, indexed); edgeIndexStore = new TimestampIndexStore<Edge>(Edge.class, lock, indexed); } }
public TimeStore(GraphStore store, GraphLock graphLock, boolean indexed) { lock = graphLock; graphStore = store; TimeRepresentation timeRepresentation = GraphStoreConfiguration.DEFAULT_TIME_REPRESENTATION; if (store != null) { timeRepresentation = store.configuration.getTimeRepresentation(); } if (timeRepresentation.equals(TimeRepresentation.INTERVAL)) { nodeIndexStore = new IntervalIndexStore<Node>(Node.class, lock, indexed); edgeIndexStore = new IntervalIndexStore<Edge>(Edge.class, lock, indexed); } else { nodeIndexStore = new TimestampIndexStore<Node>(Node.class, lock, indexed); edgeIndexStore = new TimestampIndexStore<Edge>(Edge.class, lock, indexed); } }
@Override public void execute(GraphModel graphModel) { this.graphModel = graphModel; this.isDirected = graphModel.isDirected(); this.averages = new HashMap<>(); //Attributes cols if (!averageOnly) { TimeRepresentation tr = graphModel.getConfiguration().getTimeRepresentation(); Table nodeTable = graphModel.getNodeTable(); dynamicInDegreeColumn = nodeTable.getColumn(DYNAMIC_INDEGREE); dynamicOutDegreeColumn = nodeTable.getColumn(DYNAMIC_OUTDEGREE); dynamicDegreeColumn = nodeTable.getColumn(DYNAMIC_DEGREE); if (isDirected) { if (dynamicInDegreeColumn == null) { dynamicInDegreeColumn = nodeTable.addColumn(DYNAMIC_INDEGREE, NbBundle.getMessage(DynamicDegree.class, "DynamicDegree.nodecolumn.InDegree"), tr.equals(TimeRepresentation.INTERVAL) ? IntervalIntegerMap.class : TimestampIntegerMap.class, null); } if (dynamicOutDegreeColumn == null) { dynamicOutDegreeColumn = nodeTable.addColumn(DYNAMIC_OUTDEGREE, NbBundle.getMessage(DynamicDegree.class, "DynamicDegree.nodecolumn.OutDegree"), tr.equals(TimeRepresentation.INTERVAL) ? IntervalIntegerMap.class : TimestampIntegerMap.class, null); } } if (dynamicDegreeColumn == null) { dynamicDegreeColumn = nodeTable.addColumn(DYNAMIC_DEGREE, NbBundle.getMessage(DynamicDegree.class, "DynamicDegree.nodecolumn.Degree"), tr.equals(TimeRepresentation.INTERVAL) ? IntervalIntegerMap.class : TimestampIntegerMap.class, null); } } }
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); } } } }
protected void resetConfiguration() { if (graphStore != null) { if (graphStore.configuration.getTimeRepresentation().equals(TimeRepresentation.INTERVAL)) { nodeIndexStore = new IntervalIndexStore<Node>(Node.class, lock, nodeIndexStore.hasIndex()); edgeIndexStore = new IntervalIndexStore<Edge>(Edge.class, lock, edgeIndexStore.hasIndex()); } else { nodeIndexStore = new TimestampIndexStore<Node>(Node.class, lock, nodeIndexStore.hasIndex()); edgeIndexStore = new TimestampIndexStore<Edge>(Edge.class, lock, edgeIndexStore.hasIndex()); } } }
protected void resetConfiguration() { if (graphStore != null) { if (graphStore.configuration.getTimeRepresentation().equals(TimeRepresentation.INTERVAL)) { nodeIndexStore = new IntervalIndexStore<Node>(Node.class, lock, nodeIndexStore.hasIndex()); edgeIndexStore = new IntervalIndexStore<Edge>(Edge.class, lock, edgeIndexStore.hasIndex()); } else { nodeIndexStore = new TimestampIndexStore<Node>(Node.class, lock, nodeIndexStore.hasIndex()); edgeIndexStore = new TimestampIndexStore<Edge>(Edge.class, lock, edgeIndexStore.hasIndex()); } } }
private void serializeConfiguration(final DataOutput out) throws IOException { Configuration config = model.store.configuration; serialize(out, config.getNodeIdType()); serialize(out, config.getEdgeIdType()); serialize(out, config.getEdgeLabelType()); serialize(out, config.getEdgeWeightType()); serialize(out, config.getTimeRepresentation()); serialize(out, config.getEdgeWeightColumn()); }
private void serializeConfiguration(final DataOutput out) throws IOException { Configuration config = model.store.configuration; serialize(out, config.getNodeIdType()); serialize(out, config.getEdgeIdType()); serialize(out, config.getEdgeLabelType()); serialize(out, config.getEdgeWeightType()); serialize(out, config.getTimeRepresentation()); serialize(out, config.getEdgeWeightColumn()); }
graph = graphModel.getUndirectedGraph(window); TimeRepresentation tr = graphModel.getConfiguration().getTimeRepresentation();