[gephi-dev] Can one merge two DynamicInteger instances in a third one?

Sébastien Heymann sebastien.heymann at gephi.org
Fri Dec 3 13:06:34 CET 2010


Okay, thanks!

Seb

2010/12/3 Cezary Bartosiak <cezary.bartosiak at gmail.com>

> Well, there is no any merge method now. But you can create new
> DynamicInteger that will contain intervals from the first variable and the
> second one. You can do this this way:
>
> // di1 - the first variable
>> // di2 - the second variable
>>
>> // 1st way:
>>
>> DynamicInteger di3 = new DynamicInteger(di1,
>> di2.getIntervals(Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY));
>>
>> // endpoints are included by default, but you can use
>> getIntervals(Interval interval),
>> // which lets you specify if endpoints should be included or excluded
>>
>> // 2nd way:
>>
>> DynamicInteger di3 =
>> (DynamicInteger)DynamicUtilities.createDynamicObject(
>
>    AttributeType.DYNAMIC_INT,
>
>    di1,
>
>    di2.getIntervals(Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY)
>> );
>>
>
> PS. I'll be offline til Monday.
>
> On 3 December 2010 11:02, Sébastien Heymann <sebastien.heymann at gephi.org>wrote:
>
>> Hello @dev,
>>
>> I don't find a proper method to merge two DynamicInteger objects. My use
>> case:
>>
>> I execute a dynamic statistic for a particular time window, and I get a
>> DynamicInteger object containing my results.
>> Then I execute it again but on the next time window, so I get another
>> DynamicInteger object.
>>
>> I want to merge the two results in a single object. How is it possible:
>> - if there is no time overlap?
>> - if there is time overlap?
>>
>> Thanks,
>> Seb
>>
>> _______________________________________________
>> gephi-dev mailing list
>> gephi-dev at lists.gephi.org
>> http://gephi.org/mailman/listinfo/gephi-dev
>>
>>
>
> _______________________________________________
> gephi-dev mailing list
> gephi-dev at lists.gephi.org
> http://gephi.org/mailman/listinfo/gephi-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://gephi.org/pipermail/gephi-dev/attachments/20101203/11427818/attachment.html>


More information about the gephi-dev mailing list