net.named_data.jndn.encrypt
public class Interval extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Interval.Error
Interval.Error extends Exception for errors using Interval methods.
|
Constructor and Description |
---|
Interval()
Create an Interval that is invalid.
|
Interval(boolean isValid)
Create an Interval that is either invalid or an empty interval.
|
Interval(double startTime,
double endTime)
Create a valid Interval with the given start and end times.
|
Interval(Interval interval)
Create an Interval, copying values from the other interval.
|
Modifier and Type | Method and Description |
---|---|
boolean |
covers(double timePoint)
Check if the time point is in this interval.
|
double |
getEndTime()
Get the end time.
|
double |
getStartTime()
Get the start time.
|
Interval |
intersectWith(Interval interval)
Set this Interval to the intersection of this and the other interval.
|
boolean |
isEmpty()
Check if this Interval is empty.
|
boolean |
isValid()
Check if this Interval is valid.
|
void |
set(Interval interval)
Set this interval to have the same values as the other interval.
|
Interval |
unionWith(Interval interval)
Set this Interval to the union of this and the other interval.
|
public Interval(boolean isValid)
isValid
- True to create a valid empty interval, false to create an
invalid interval.public Interval(double startTime, double endTime)
startTime
- The start time as milliseconds since Jan 1, 1970 UTC.endTime
- The end time as milliseconds since Jan 1, 1970 UTC.public Interval(Interval interval)
interval
- The other Interval with values to copypublic Interval()
public void set(Interval interval)
interval
- The other Interval with values to copy.public final boolean covers(double timePoint)
timePoint
- The time point to check as milliseconds since Jan 1, 1970 UTC.public final Interval intersectWith(Interval interval)
interval
- The other Interval to intersect with.public final Interval unionWith(Interval interval) throws Interval.Error
interval
- The other Interval to union with.Interval.Error
- if the two intervals do not have an intersection.public final double getStartTime()
public final double getEndTime()
public final boolean isValid()
public final boolean isEmpty()
Copyright © 2016. All rights reserved.