Package org.opennms.core.utils
Class AbstractTimeIntervalSequence<T extends TimeInterval>
- java.lang.Object
-
- org.opennms.core.utils.AbstractTimeIntervalSequence<T>
-
- Direct Known Subclasses:
OwnedIntervalSequence
,TimeIntervalSequence
public abstract class AbstractTimeIntervalSequence<T extends TimeInterval> extends java.lang.Object
TimeIntervalSequence class.
- Version:
- $Id: $
- Author:
- ranger
-
-
Constructor Summary
Constructors Constructor Description AbstractTimeIntervalSequence()
Constructor for TimeIntervalSequence.AbstractTimeIntervalSequence(T interval)
Constructor for TimeIntervalSequence.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addAll(java.util.Collection<T> intervals)
addAllvoid
addAll(AbstractTimeIntervalSequence<T> intervals)
addAllvoid
addInterval(T interval)
addIntervalvoid
bound(java.util.Date start, java.util.Date end)
boundvoid
bound(T interval)
boundprotected java.util.Collection<T>
combineIntervals(T currentInterval, T newInterval)
combineIntervalsprotected abstract T
createInterval(java.util.Date start, java.util.Date end)
createIntervalprotected abstract AbstractTimeIntervalSequence<T>
createTail(T interval)
createTailTimeInterval
getBounds()
getBoundsjava.util.Date
getEnd()
getEndjava.util.Date
getStart()
getStartjava.util.Iterator<T>
iterator()
iteratorvoid
removeAll(AbstractTimeIntervalSequence<T> intervals)
removeAllvoid
removeInterval(T removedInterval)
removeIntervalprotected java.util.Collection<T>
separateIntervals(T origInterval, T removedInterval)
separateIntervalsjava.lang.String
toString()
toString
-
-
-
Constructor Detail
-
AbstractTimeIntervalSequence
public AbstractTimeIntervalSequence()
Constructor for TimeIntervalSequence.
-
AbstractTimeIntervalSequence
public AbstractTimeIntervalSequence(T interval)
Constructor for TimeIntervalSequence.
- Parameters:
interval
- aTimeInterval
object.
-
-
Method Detail
-
iterator
public java.util.Iterator<T> iterator()
iterator
- Returns:
- a
Iterator
object.
-
addInterval
public void addInterval(T interval)
addInterval
- Parameters:
interval
- aTimeInterval
object.
-
combineIntervals
protected java.util.Collection<T> combineIntervals(T currentInterval, T newInterval)
combineIntervals
- Parameters:
currentInterval
- aTimeInterval
object.newInterval
- aTimeInterval
object.- Returns:
- a
Collection
object.
-
createInterval
protected abstract T createInterval(java.util.Date start, java.util.Date end)
createInterval
- Parameters:
start
- aDate
object.end
- aDate
object.- Returns:
- a
TimeInterval
object.
-
createTail
protected abstract AbstractTimeIntervalSequence<T> createTail(T interval)
createTail
- Parameters:
interval
- aTimeInterval
object.- Returns:
- a
AbstractTimeIntervalSequence
object.
-
removeInterval
public void removeInterval(T removedInterval)
removeInterval
- Parameters:
removedInterval
- aTimeInterval
object.
-
separateIntervals
protected java.util.Collection<T> separateIntervals(T origInterval, T removedInterval)
separateIntervals
- Parameters:
origInterval
- aTimeInterval
object.removedInterval
- aTimeInterval
object.- Returns:
- a
Collection
object.
-
bound
public void bound(java.util.Date start, java.util.Date end)
bound
- Parameters:
start
- aDate
object.end
- aDate
object.
-
bound
public void bound(T interval)
bound
- Parameters:
interval
- aTimeInterval
object.
-
getStart
public java.util.Date getStart()
getStart
- Returns:
- a
Date
object.
-
getEnd
public java.util.Date getEnd()
getEnd
- Returns:
- a
Date
object.
-
getBounds
public TimeInterval getBounds()
getBounds
- Returns:
- a
TimeInterval
object.
-
addAll
public void addAll(AbstractTimeIntervalSequence<T> intervals)
addAll
- Parameters:
intervals
- aAbstractTimeIntervalSequence
object.
-
addAll
public void addAll(java.util.Collection<T> intervals)
addAll
- Parameters:
intervals
- aCollection
object.
-
removeAll
public void removeAll(AbstractTimeIntervalSequence<T> intervals)
removeAll
- Parameters:
intervals
- aAbstractTimeIntervalSequence
object.
-
toString
public java.lang.String toString()
toString
- Overrides:
toString
in classjava.lang.Object
- Returns:
- a
String
object.
-
-