Gephi Toolkit Javadoc

org.gephi.data.attributes.type
Class TimeInterval

java.lang.Object
  extended by org.gephi.data.attributes.type.DynamicType<java.lang.Double[]>
      extended by org.gephi.data.attributes.type.TimeInterval

public final class TimeInterval
extends DynamicType<java.lang.Double[]>

Complex type for specifying time interval. An, interval is two double with low inferior or equal to high. Thus intervals can have got included or excluded bounds.

Author:
Mathieu Bastian, Cezary Bartosiak

Field Summary
 
Fields inherited from class org.gephi.data.attributes.type.DynamicType
intervalTree
 
Constructor Summary
TimeInterval()
          Constructs a new DynamicType instance with no intervals.
TimeInterval(double low, double high)
          Constructs a new DynamicType instance that contains a given interval [low, high].
TimeInterval(double low, double high, boolean lopen, boolean ropen)
          Constructs a new DynamicType instance that contains a given interval.
TimeInterval(java.util.List<Interval> in)
          Constructs a new DynamicType instance with intervals given by List<Interval> in.
TimeInterval(TimeInterval source)
          Constructs a deep copy of source.
TimeInterval(TimeInterval source, double low, double high)
          Constructs a deep copy of source that contains a given interval [low, high].
TimeInterval(TimeInterval source, double low, double high, boolean lopen, boolean ropen)
          Constructs a deep copy of source that contains a given interval.
TimeInterval(TimeInterval source, double alow, double ahigh, boolean alopen, boolean aropen, double rlow, double rhigh, boolean blopen, boolean bropen)
          Constructs a deep copy of source that contains a given interval [alow, ahigh].
TimeInterval(TimeInterval source, double alow, double ahigh, double rlow, double rhigh)
          Constructs a deep copy of source that contains a given interval [alow, ahigh].
TimeInterval(TimeInterval source, java.util.List<Interval> in)
          Constructs a deep copy of source with additional intervals given by List<Interval> in.
TimeInterval(TimeInterval source, java.util.List<Interval> in, java.util.List<Interval> out)
          Constructs a deep copy of source with additional intervals given by List<Interval> in.
 
Method Summary
 java.lang.Class getUnderlyingType()
          Returns the underlying type T.
 java.lang.Double[] getValue(Interval interval, Estimator estimator)
          Returns the estimated value of a set of values whose time intervals overlap with a given time interval.
 java.util.List<java.lang.Double[]> getValues(Interval interval)
          Returns a list of values whose time intervals overlap with a given time interval.
 java.lang.String toString()
          Returns a string representation of this instance in a format <[low, high], ..., [low, high]>.
 java.lang.String toString(boolean timesAsDoubles)
          Creates a string representation of all the intervals with their values.
 java.lang.String toStringTimesAsDates()
          Returns a string representation of this instance in a format <[low, high], ..., [low, high]>.
 
Methods inherited from class org.gephi.data.attributes.type.DynamicType
equals, getHigh, getIntervals, getIntervals, getIntervals, getLow, getValue, getValue, getValue, getValue, getValue, getValues, getValues, hashCode, isHighExcluded, isInRange, isInRange, isLowExcluded
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TimeInterval

public TimeInterval()
Constructs a new DynamicType instance with no intervals.


TimeInterval

public TimeInterval(double low,
                    double high,
                    boolean lopen,
                    boolean ropen)
Constructs a new DynamicType instance that contains a given interval.

Parameters:
low - the left endpoint
high - the right endpoint
lopen - indicates if the left endpoint is excluded (true in this case)
ropen - indicates if the right endpoint is excluded (true in this case)

TimeInterval

public TimeInterval(double low,
                    double high)
Constructs a new DynamicType instance that contains a given interval [low, high].

Parameters:
low - the left endpoint
high - the right endpoint

TimeInterval

public TimeInterval(java.util.List<Interval> in)
Constructs a new DynamicType instance with intervals given by List<Interval> in.

Parameters:
in - intervals to add (could be null)

TimeInterval

public TimeInterval(TimeInterval source)
Constructs a deep copy of source.

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

TimeInterval

public TimeInterval(TimeInterval source,
                    double low,
                    double high,
                    boolean lopen,
                    boolean ropen)
Constructs a deep copy of source that contains a given interval.

Parameters:
source - an object to copy from (could be null, then completely new instance is created)
low - the left endpoint
high - the right endpoint
lopen - indicates if the left endpoint is excluded (true in this case)
ropen - indicates if the right endpoint is excluded (true in this case)

TimeInterval

public TimeInterval(TimeInterval source,
                    double low,
                    double high)
Constructs a deep copy of source that contains a given interval [low, high].

Parameters:
source - an object to copy from (could be null, then completely new instance is created)
low - the left endpoint
high - the right endpoint

TimeInterval

public TimeInterval(TimeInterval source,
                    double alow,
                    double ahigh,
                    boolean alopen,
                    boolean aropen,
                    double rlow,
                    double rhigh,
                    boolean blopen,
                    boolean bropen)
Constructs a deep copy of source that contains a given interval [alow, ahigh]. Before add it removes from the newly created object all intervals that overlap with a given interval [rlow, rhigh].

Parameters:
source - an object to copy from (could be null, then completely new instance is created)
alow - the left endpoint of the interval to add
ahigh - the right endpoint of the interval to add
alopen - indicates if the left endpoint of the interval to add is excluded (true in this case)
aropen - indicates if the right endpoint of the interval to add is excluded (true in this case)
rlow - the left endpoint of the interval to remove
rhigh - the right endpoint of the interval to remove
blopen - indicates if the left endpoint of the interval to remove is excluded (true in this case)
bropen - indicates if the right endpoint of the interval to remove is excluded (true in this case)

TimeInterval

public TimeInterval(TimeInterval source,
                    double alow,
                    double ahigh,
                    double rlow,
                    double rhigh)
Constructs a deep copy of source that contains a given interval [alow, ahigh]. Before add it removes from the newly created object all intervals that overlap with a given interval [rlow, rhigh].

Parameters:
source - an object to copy from (could be null, then completely new instance is created)
alow - the left endpoint of the interval to add
ahigh - the right endpoint of the interval to add
rlow - the left endpoint of the interval to remove
rhigh - the right endpoint of the interval to remove

TimeInterval

public TimeInterval(TimeInterval source,
                    java.util.List<Interval> in)
Constructs 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)

TimeInterval

public TimeInterval(TimeInterval source,
                    java.util.List<Interval> in,
                    java.util.List<Interval> out)
Constructs 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.

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)
Method Detail

getValue

public java.lang.Double[] getValue(Interval interval,
                                   Estimator estimator)
Description copied from class: DynamicType
Returns the estimated value of a set of values whose time intervals overlap with a given time interval.

Specified by:
getValue in class DynamicType<java.lang.Double[]>
Parameters:
interval - a given time interval
estimator - used to estimate the result
Returns:
the estimated value of a set of values whose time intervals overlap with a given time interval or null if there are no intervals.
See Also:
Estimator

getValues

public java.util.List<java.lang.Double[]> getValues(Interval interval)
Description copied from class: DynamicType
Returns a list of values whose time intervals overlap with a given time interval.

Overrides:
getValues in class DynamicType<java.lang.Double[]>
Parameters:
interval - a given time interval
Returns:
a list of values whose time intervals overlap with a given time interval.

getUnderlyingType

public java.lang.Class getUnderlyingType()
Description copied from class: DynamicType
Returns the underlying type T.

Specified by:
getUnderlyingType in class DynamicType<java.lang.Double[]>
Returns:
the underlying type T.

toString

public java.lang.String toString(boolean timesAsDoubles)
Description copied from class: DynamicType
Creates a string representation of all the intervals with their values.

Overrides:
toString in class DynamicType<java.lang.Double[]>
Parameters:
timesAsDoubles - indicates if times should be shown as doubles or dates
Returns:
a string representation with times as doubles or dates.

toStringTimesAsDates

public java.lang.String toStringTimesAsDates()
Returns a string representation of this instance in a format <[low, high], ..., [low, high]>. Intervals are ordered by its left endpoint.

Times are always shown as dates.

Returns:
a string representation of this instance.

toString

public java.lang.String toString()
Returns a string representation of this instance in a format <[low, high], ..., [low, high]>. Intervals are ordered by its left endpoint.

Overrides:
toString in class DynamicType<java.lang.Double[]>
Returns:
a string representation of this instance.

Gephi Toolkit Javadoc