public Embedder2D(DistancedPoints p) { this.points = p; tableLastUpdated = points.getLastUpdateTime(); savedPoints = new ArrayList<String>(); for (int i = 0; i < points.getCount(); i++) savedPoints.add(points.getPointId(i)); xy = new Vector2D[points.getCount()]; for (int i = 0; i < points.getCount(); i++) xy[i] = new Vector2D(0, 0); maxX = 0; maxY = 0; minX = 0; minY = 0; }
private void updateStructure(long u) { tableLastUpdated = u; ArrayList<String> newPoints = new ArrayList<String>(); for (int i = 0; i < points.getCount(); i++) newPoints.add(points.getPointId(i)); Vector2D[] newxy = new Vector2D[newPoints.size()]; for (int i = 0; i < newxy.length; i++) { int index = savedPoints.indexOf(newPoints.get(i)); if (index >= 0 && index < savedPoints.size()) newxy[i] = xy[index]; else newxy[i] = new Vector2D(); } xy = newxy; savedPoints = newPoints; }