Gephi Toolkit Javadoc

org.gephi.dynamic
Class DynamicUtilities

java.lang.Object
  extended by org.gephi.dynamic.DynamicUtilities

public final class DynamicUtilities
extends java.lang.Object

Contains only static, and toolkit functions, like type conversion for the needs of dynamic stuff.

Author:
Cezary Bartosiak

Constructor Summary
DynamicUtilities()
           
 
Method Summary
static DynamicType createDynamicObject(AttributeType type, DynamicType source)
          Returns a deep copy of source.
static DynamicType createDynamicObject(AttributeType type, DynamicType source, Interval in)
          Returns a deep copy of source that contains a given Interval in.
static DynamicType createDynamicObject(AttributeType type, DynamicType source, Interval in, Interval out)
          Returns a deep copy of source that contains a given Interval in.
static DynamicType createDynamicObject(AttributeType type, DynamicType source, java.util.List<Interval> in)
          Returns a deep copy of source with additional intervals given by List<Interval> in.
static DynamicType createDynamicObject(AttributeType type, DynamicType source, java.util.List<Interval> in, java.util.List<Interval> out)
          Returns a deep copy of source with additional intervals given by List<Interval> in.
static DynamicType createDynamicObject(AttributeType type, Interval in)
          Returns a new DynamicType instance that contains a given Interval in.
static DynamicType createDynamicObject(AttributeType type, java.util.List<Interval> in)
          Returns a new DynamicType instance with intervals given by List<Interval> in.
static Interval createInterval(DynamicType dynamicType, double low, double high, boolean lopen, boolean ropen, java.lang.Object value)
           
static DynamicType fitToInterval(DynamicType source, double low, double high)
          It checks intervals of the source and make it fit to the given interval [low, high], possibly removing intervals out of the window and changing low or high of intervals to fit.
static DynamicType fitToInterval(DynamicType source, Interval interval)
          It checks intervals of the source and make it fit to the given interval, possibly removing intervals out of the window and changing low or high of intervals to fit.
static java.util.Date getDateFromDouble(double d)
          Used for get a date from the low-level double
static double getDoubleFromDate(java.util.Date date)
          Used for import (parses XML date strings).
static double getDoubleFromXMLDateString(java.lang.String str)
          Used for import (parses XML date strings).
static java.lang.Object getDynamicValue(java.lang.Object value, double low, double high)
           
static int getEdgeCount(Graph graph, Interval timeInterval)
           
static int getNodeCount(Graph graph, Interval timeInterval)
           
static TimeInterval getVisibleInterval(DynamicModel dynamicModel)
          Returns the visible time interval of dynamicModel if it is not [-inf, +inf].
static java.lang.String getXMLDateStringFromDouble(double d)
          Used for export (writes XML date strings).
static DynamicType removeOverlapping(DynamicType dynamicType)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DynamicUtilities

public DynamicUtilities()
Method Detail

getDoubleFromXMLDateString

public static double getDoubleFromXMLDateString(java.lang.String str)
Used for import (parses XML date strings).

Parameters:
str - a string to parse from
Returns:
date as a double.
Throws:
java.lang.IllegalArgumentException - if str is not a valid XMLGregorianCalendar.
java.lang.NullPointerException - if str is null.

getDoubleFromDate

public static double getDoubleFromDate(java.util.Date date)
Used for import (parses XML date strings).

Parameters:
str - a string to parse from
Returns:
date as a double.
Throws:
java.lang.IllegalArgumentException - if str is not a valid XMLGregorianCalendar.
java.lang.NullPointerException - if str is null.

getDateFromDouble

public static java.util.Date getDateFromDouble(double d)
Used for get a date from the low-level double

Parameters:
d - a double to convert from
Returns:
an date instance
Throws:
java.lang.IllegalArgumentException - if d is infinite.

getXMLDateStringFromDouble

public static java.lang.String getXMLDateStringFromDouble(double d)
Used for export (writes XML date strings).

Parameters:
d - a double to convert from
Returns:
an XML date string.
Throws:
java.lang.IllegalArgumentException - if d is infinite.

createDynamicObject

public static DynamicType createDynamicObject(AttributeType type,
                                              Interval in)
Returns a new DynamicType instance that contains a given Interval in.

Parameters:
in - interval to add (could be null)
Returns:
a new DynamicType instance that contains a given Interval in.

createDynamicObject

public static DynamicType createDynamicObject(AttributeType type,
                                              java.util.List<Interval> in)
Returns a new DynamicType instance with intervals given by List<Interval> in.

Parameters:
in - intervals to add (could be null)
Returns:
a new DynamicType instance with intervals given by List<Interval> in.

createDynamicObject

public static DynamicType createDynamicObject(AttributeType type,
                                              DynamicType source)
Returns a deep copy of source.

Parameters:
source - an object to copy from (could be null, then completely new instance is created)
Returns:
a deep copy of source.

createDynamicObject

public static DynamicType createDynamicObject(AttributeType type,
                                              DynamicType source,
                                              Interval in)
Returns a deep copy of source that contains a given Interval in.

Parameters:
source - an object to copy from (could be null, then completely new instance is created)
in - interval to add (could be null)
Returns:
a deep copy of source that contains a given Interval in.

createDynamicObject

public static DynamicType createDynamicObject(AttributeType type,
                                              DynamicType source,
                                              Interval in,
                                              Interval out)
Returns a deep copy of source that contains a given Interval in. Before add it removes from the newly created object all intervals that overlap with a given Interval out.

Parameters:
source - an object to copy from (could be null, then completely new instance is created)
in - interval to add (could be null)
out - interval to remove (could be null)
Returns:
a deep copy of source that contains a given Interval in. Before add it removes from the newly created object all intervals that overlap with a given Interval out.

createDynamicObject

public static DynamicType createDynamicObject(AttributeType type,
                                              DynamicType source,
                                              java.util.List<Interval> in)
Returns a deep copy of source with additional intervals given by List<Interval> in.

Parameters:
source - an object to copy from (could be null, then completely new instance is created)
in - intervals to add (could be null)
Returns:
a deep copy of source with additional intervals given by List<Interval> in.

createDynamicObject

public static DynamicType createDynamicObject(AttributeType type,
                                              DynamicType source,
                                              java.util.List<Interval> in,
                                              java.util.List<Interval> out)
Returns a deep copy of source with additional intervals given by List<Interval> in. Before add it removes from the newly created object all intervals that overlap with intervals given by List<Interval> out.

It can return null if type is not dynamic.

Parameters:
source - an object to copy from (could be null, then completely new instance is created)
in - intervals to add (could be null)
out - intervals to remove (could be null)
Returns:
a deep copy of source with additional intervals given by List<Interval> in. Before add it removes from the newly created object all intervals that overlap with intervals given by List<Interval> out. It can return null if type is not dynamic.

fitToInterval

public static DynamicType fitToInterval(DynamicType source,
                                        Interval interval)
It checks intervals of the source and make it fit to the given interval, possibly removing intervals out of the window and changing low or high of intervals to fit.

Parameters:
source - a DynamicType to be performed
interval - a given interval
Returns:
a fitted DynamicType instance.
Throws:
java.lang.NullPointerException - if source is null.

fitToInterval

public static DynamicType fitToInterval(DynamicType source,
                                        double low,
                                        double high)
It checks intervals of the source and make it fit to the given interval [low, high], possibly removing intervals out of the window and changing low or high of intervals to fit.

Parameters:
source - a DynamicType to be performed
low - the left endpoint
high - the right endpoint
Returns:
a fitted DynamicType instance.
Throws:
java.lang.NullPointerException - if source is null.
java.lang.IllegalArgumentException - if low > high.

getVisibleInterval

public static TimeInterval getVisibleInterval(DynamicModel dynamicModel)
Returns the visible time interval of dynamicModel if it is not [-inf, +inf]. Returns null in other cases.

Parameters:
dynamicModel - the dynamic model
Returns:
the valid visible interval, or null.

getDynamicValue

public static java.lang.Object getDynamicValue(java.lang.Object value,
                                               double low,
                                               double high)

removeOverlapping

public static DynamicType removeOverlapping(DynamicType dynamicType)

createInterval

public static Interval createInterval(DynamicType dynamicType,
                                      double low,
                                      double high,
                                      boolean lopen,
                                      boolean ropen,
                                      java.lang.Object value)

getNodeCount

public static int getNodeCount(Graph graph,
                               Interval timeInterval)

getEdgeCount

public static int getEdgeCount(Graph graph,
                               Interval timeInterval)

Gephi Toolkit Javadoc