Package org.gephi.data.attributes.type

Examples of org.gephi.data.attributes.type.DynamicInteger


        System.out.println();
    }

    @Test
    public void testRemoveOverlapping1() {
        DynamicInteger instance = new DynamicInteger();
        instance = new DynamicInteger(instance, new Interval<Integer>(2002, Double.POSITIVE_INFINITY, 1));
        instance = new DynamicInteger(instance, new Interval<Integer>(2003, Double.POSITIVE_INFINITY, 2));
        instance = new DynamicInteger(instance, new Interval<Integer>(2004, Double.POSITIVE_INFINITY, 3));

        DynamicInteger result = (DynamicInteger) DynamicUtilities.removeOverlapping(instance);
        List<Interval<Integer>> intervalsResult = result.getIntervals(Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY);
        assertEquals(new Interval<Integer>(2002, 2003, false, true, 1), intervalsResult.get(0));
        assertEquals(new Interval<Integer>(2003, 2004, false, true, 2), intervalsResult.get(1));
        assertEquals(new Interval<Integer>(2004, Double.POSITIVE_INFINITY, false, false, 3), intervalsResult.get(2));
    }
View Full Code Here


        assertEquals(new Interval<Integer>(2004, Double.POSITIVE_INFINITY, false, false, 3), intervalsResult.get(2));
    }

    @Test
    public void testRemoveOverlapping2() {
        DynamicInteger instance = new DynamicInteger();
        instance = new DynamicInteger(instance, new Interval<Integer>(Double.NEGATIVE_INFINITY, 2002, 1));
        instance = new DynamicInteger(instance, new Interval<Integer>(Double.NEGATIVE_INFINITY, 2003, 2));
        instance = new DynamicInteger(instance, new Interval<Integer>(Double.NEGATIVE_INFINITY, 2004, 3));

        DynamicInteger result = (DynamicInteger) DynamicUtilities.removeOverlapping(instance);
        List<Interval<Integer>> intervalsResult = result.getIntervals(Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY);
        assertEquals(new Interval<Integer>(Double.NEGATIVE_INFINITY, 2002, false, false, 1), intervalsResult.get(0));
        assertEquals(new Interval<Integer>(2002, 2003, true, false, 2), intervalsResult.get(1));
        assertEquals(new Interval<Integer>(2003, 2004, true, false, 3), intervalsResult.get(2));
    }
View Full Code Here

        assertEquals(new Interval<Integer>(2003, 2004, true, false, 3), intervalsResult.get(2));
    }

    @Test
    public void testRemoveOverlapping3() {
        DynamicInteger instance = new DynamicInteger();
        instance = new DynamicInteger(instance, new Interval<Integer>(Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, 1));
        instance = new DynamicInteger(instance, new Interval<Integer>(2002, 2003, 2));

        DynamicInteger result = (DynamicInteger) DynamicUtilities.removeOverlapping(instance);
        List<Interval<Integer>> intervalsResult = result.getIntervals(Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY);
        assertEquals(new Interval<Integer>(Double.NEGATIVE_INFINITY, 2002, false, true, 1), intervalsResult.get(0));
        assertEquals(new Interval<Integer>(2002, 2003, false, false, 2), intervalsResult.get(1));
        assertEquals(new Interval<Integer>(2003, Double.POSITIVE_INFINITY, true, false, 1), intervalsResult.get(2));
    }
View Full Code Here

                    for (Interval interval : out) {
                        lout.add(new Interval<Integer>(interval.getLow(), interval.getHigh(),
                                interval.isLowExcluded(), interval.isHighExcluded(), (Integer) interval.getValue()));
                    }
                }
                return new DynamicInteger((DynamicInteger) source, lin, lout);
            }
            case DYNAMIC_LONG: {
                ArrayList<Interval<Long>> lin = null;
                if (in != null) {
                    lin = new ArrayList<Interval<Long>>();
View Full Code Here

        List<Interval> intervalList = new ArrayList<Interval>();
        intervalList.add(new Interval(1.0, 2.0));
        intervalList.add(new Interval(3.0, 4.0));
        n2.getNodeData().getAttributes().setValue(nodeTimeCol.getIndex(), new TimeInterval(intervalList));

        DynamicInteger dynamicInteger = new DynamicInteger(new Interval(4., 10., 100));
        e1.getEdgeData().getAttributes().setValue(edgeCol1.getIndex(), dynamicInteger);

        List<Interval<String>> stringIntervalList = new ArrayList<Interval<String>>();
        stringIntervalList.add(new Interval<String>(Double.NEGATIVE_INFINITY,1.,"a"));
        stringIntervalList.add(new Interval<String>(2.,3.,"b"));
View Full Code Here

TOP

Related Classes of org.gephi.data.attributes.type.DynamicInteger

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.