protected void checkTimeRepresentationInterval() { if (!getTimeRepresentation().equals(TimeRepresentation.INTERVAL)) { throw new RuntimeException("Can't use intervals as the configuration is set to " + getTimeRepresentation()); } }
/** * Creates new form WizardVisualPanel2 */ public WizardVisualPanel2(final AbstractImporterSpreadsheet importer, final WizardPanel2 wizard2) { initComponents(); this.importer = importer; this.wizard2 = wizard2; timeRepresentationComboBox = new JComboBox(); for (TimeRepresentation value : TimeRepresentation.values()) { timeRepresentationComboBox.addItem(new TimeRepresentationWrapper(value)); } timeRepresentationComboBox.setSelectedItem(new TimeRepresentationWrapper(importer.getTimeRepresentation())); timeRepresentationComboBox.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { importer.setTimeRepresentation(getSelectedTimeRepresentation()); reloadSettings(); } }); }
@Override public int hashCode() { int hash = 7; hash = 19 * hash + (this.nodeIdType != null ? this.nodeIdType.hashCode() : 0); hash = 19 * hash + (this.edgeIdType != null ? this.edgeIdType.hashCode() : 0); hash = 19 * hash + (this.edgeLabelType != null ? this.edgeLabelType.hashCode() : 0); hash = 19 * hash + (this.edgeWeightType != null ? this.edgeWeightType.hashCode() : 0); hash = 19 * hash + (this.timeRepresentation != null ? this.timeRepresentation.hashCode() : 0); hash = 19 * hash + (this.edgeWeightColumn != null ? this.edgeWeightColumn.hashCode() : 0); return hash; }
TimeRepresentation b = (TimeRepresentation) obj; out.write(TIME_REPRESENTATION); serializeString(out, b.name()); } else if (obj instanceof TimestampMap) { TimestampMap b = (TimestampMap) obj;
break; case TIME_REPRESENTATION: ret = TimeRepresentation.valueOf(deserializeString(is)); break; case TIMESTAMP_MAP:
TimeRepresentation b = (TimeRepresentation) obj; out.write(TIME_REPRESENTATION); serializeString(out, b.name()); } else if (obj instanceof TimestampMap) { TimestampMap b = (TimestampMap) obj;
break; case TIME_REPRESENTATION: ret = TimeRepresentation.valueOf(deserializeString(is)); break; case TIMESTAMP_MAP:
protected void checkTimeRepresentationTimestamp() { if (!getTimeRepresentation().equals(TimeRepresentation.TIMESTAMP)) { throw new RuntimeException("Can't use timestamps as the configuration is set to " + getTimeRepresentation()); } }
for (TimeRepresentation tr : TimeRepresentation.values()) { timeRepresentationComboBox.addItem(new TimeRepresentationWrapper(tr));
@Override public int hashCode() { int hash = 7; hash = 19 * hash + (this.nodeIdType != null ? this.nodeIdType.hashCode() : 0); hash = 19 * hash + (this.edgeIdType != null ? this.edgeIdType.hashCode() : 0); hash = 19 * hash + (this.edgeLabelType != null ? this.edgeLabelType.hashCode() : 0); hash = 19 * hash + (this.edgeWeightType != null ? this.edgeWeightType.hashCode() : 0); hash = 19 * hash + (this.timeRepresentation != null ? this.timeRepresentation.hashCode() : 0); hash = 19 * hash + (this.edgeWeightColumn != null ? this.edgeWeightColumn.hashCode() : 0); return hash; }
protected void checkTimeRepresentationInterval() { if (!getTimeRepresentation().equals(TimeRepresentation.INTERVAL)) { throw new RuntimeException("Can't use intervals as the configuration is set to " + getTimeRepresentation()); } }
protected void checkTimeRepresentationTimestamp() { if (!getTimeRepresentation().equals(TimeRepresentation.TIMESTAMP)) { throw new RuntimeException("Can't use timestamps as the configuration is set to " + getTimeRepresentation()); } }
.equals(other.timeRepresentation))) { return false;
.equals(other.timeRepresentation))) { return false;
private boolean checkTimerepresentationIsInterval() { if (!container.getTimeRepresentation().equals(TimeRepresentation.INTERVAL)) { report.logIssue(new Issue(NbBundle.getMessage(ImporterGEXF.class, "importerGEXF_error_timerepresentation_intervalerror"), Issue.Level.SEVERE)); return false; } return true; }
private boolean checkTimerepresentationIsTimestamp() { if (!container.getTimeRepresentation().equals(TimeRepresentation.TIMESTAMP)) { report.logIssue(new Issue(NbBundle.getMessage(ImporterGEXF.class, "importerGEXF_error_timerepresentation_timestamperror"), Issue.Level.SEVERE)); return false; } return true; }
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()); } }
@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); } } }
@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); } } }