@Override public boolean equals(Object obj) { if (super.equals(obj)) { return true; } if (obj == null || !(obj instanceof SegmentationCandidate)) { return false; } SegmentationCandidate segmantationCandidate = (SegmentationCandidate) obj; return (segmantationCandidate.segmentation.getSegments().equals(this.segmentation.getSegments()) && segmantationCandidate.segmentation.getBaseCube().equals(this.segmentation.getBaseCube())); }
@Override public boolean equals(Object obj) { if (super.equals(obj)) { return true; } if (obj == null || !(obj instanceof SegmentationCandidate)) { return false; } SegmentationCandidate segmantationCandidate = (SegmentationCandidate) obj; return (segmantationCandidate.segmentation.getSegments().equals(this.segmentation.getSegments()) && segmantationCandidate.segmentation.getBaseCube().equals(this.segmentation.getBaseCube())); }
public List<Segmentation> getAllSegmentations(CubeInterface cube) throws LensException { String cubeName = null; if (cube != null) { if (cube instanceof DerivedCube) { cube = ((DerivedCube) cube).getParent(); } cubeName = cube.getName(); } List<Segmentation> cubeSegs = new ArrayList<>(); for (Segmentation seg : getAllSegmentations()) { if (cubeName == null || seg.getBaseCube().equalsIgnoreCase(cubeName)) { cubeSegs.add(seg); } } return cubeSegs; }
public List<Segmentation> getAllSegmentations(CubeInterface cube) throws LensException { String cubeName = null; if (cube != null) { if (cube instanceof DerivedCube) { cube = ((DerivedCube) cube).getParent(); } cubeName = cube.getName(); } List<Segmentation> cubeSegs = new ArrayList<>(); for (Segmentation seg : getAllSegmentations()) { if (cubeName == null || seg.getBaseCube().equalsIgnoreCase(cubeName)) { cubeSegs.add(seg); } } return cubeSegs; }
public static XSegmentation xsegmentationFromSegmentation(Segmentation cSeg) { XSegmentation seg = XCF.createXSegmentation(); seg.setName(cSeg.getName()); seg.setProperties(new XProperties()); seg.setSegements(new XSegments()); seg.setWeight(cSeg.weight()); seg.setCubeName(cSeg.getBaseCube()); if (xPropertiesFromMap(cSeg.getProperties()) != null) { seg.getProperties().getProperty().addAll(xPropertiesFromMap(cSeg.getProperties())); } seg.getSegements().getSegment(). addAll(xSegmentsFromSegments(cSeg.getSegments())); return seg; }
public static XSegmentation xsegmentationFromSegmentation(Segmentation cSeg) { XSegmentation seg = XCF.createXSegmentation(); seg.setName(cSeg.getName()); seg.setProperties(new XProperties()); seg.setSegements(new XSegments()); seg.setWeight(cSeg.weight()); seg.setCubeName(cSeg.getBaseCube()); if (xPropertiesFromMap(cSeg.getProperties()) != null) { seg.getProperties().getProperty().addAll(xPropertiesFromMap(cSeg.getProperties())); } seg.getSegements().getSegment(). addAll(xSegmentsFromSegments(cSeg.getSegments())); return seg; }
assertEquals(client.getSegmentation(segmentName).getBaseCube(), "segCubeAltered"); assertEquals(client.getSegmentation(segmentName).weight(), 100.0);