public class TimespanTools
extends java.lang.Object
Constructor and Description |
---|
TimespanTools() |
Modifier and Type | Method and Description |
---|---|
static <T extends IdentifiableTimespanI> |
getAllValid(java.util.Collection<T> c,
java.util.Date d,
boolean ignoreTime,
boolean doThrow,
java.lang.Class<? extends T> onlyOfClass)
Returns a Map with all IdentifiableTimespanI-s among the values in the passed Collection that are valid at the passed date.
|
static <T extends IdentifiableTimespanI> |
getAllValid(java.util.Map<java.lang.Long,T> m,
java.util.Date d,
boolean ignoreTime,
boolean doThrow,
java.lang.Class<? extends T> onlyOfClass)
Returns a Map with all IdentifiableTimespanI-s among the values of the passed Map that are valid at the passed date.
|
static <T extends IdentifiableTimespanI> |
getNewestValid(java.util.Collection<T> c) |
static <T extends IdentifiableTimespanI> |
getNewestValid(java.util.Collection<T> c,
java.lang.Class<? extends T> onlyOfClass) |
static <T extends IdentifiableTimespanI> |
getNewestValidAfter(java.util.Collection<T> c,
java.util.Date limit) |
static <T extends IdentifiableTimespanI> |
getNewestValidAfter(java.util.Collection<T> c,
java.util.Date limit,
java.lang.Class<? extends T> onlyOfClass) |
static <T extends IdentifiableTimespanI> |
getNewestValidBefore(java.util.Collection<T> c,
java.util.Date limit) |
static <T extends IdentifiableTimespanI> |
getNewestValidBefore(java.util.Collection<T> c,
java.util.Date limit,
java.lang.Class<? extends T> onlyOfClass) |
static <T extends IdentifiableTimespanI> |
getOldestOrNewestValidBeforeOrAfter(java.util.Collection<T> c,
java.util.Date d,
java.lang.Class<? extends T> onlyOfClass,
boolean returnOldest,
boolean before) |
static <T extends IdentifiableTimespanI> |
getOldestOrNewestValidBeforeOrAfter(java.util.Collection<T> c,
java.util.Date d,
java.lang.Class<? extends T> onlyOfClass,
boolean returnOldest,
boolean before,
boolean nullDateIsValid) |
static <T extends IdentifiableTimespanI> |
getOldestValid(java.util.Collection<T> c) |
static <T extends IdentifiableTimespanI> |
getOldestValid(java.util.Collection<T> c,
java.lang.Class<? extends T> onlyOfClass) |
static <T extends IdentifiableTimespanI> |
getOldestValidAfter(java.util.Collection<T> c,
java.util.Date limit) |
static <T extends IdentifiableTimespanI> |
getOldestValidAfter(java.util.Collection<T> c,
java.util.Date limit,
java.lang.Class<? extends T> onlyOfClass) |
static <T extends IdentifiableTimespanI> |
getOldestValidBefore(java.util.Collection<T> c,
java.util.Date limit) |
static <T extends IdentifiableTimespanI> |
getOldestValidBefore(java.util.Collection<T> c,
java.util.Date limit,
java.lang.Class<? extends T> onlyOfClass) |
static <T extends IdentifiableTimespanI> |
getValid(java.util.Collection<T> c,
java.util.Date d) |
static <T extends IdentifiableTimespanI> |
getValid(java.util.Collection<T> c,
java.util.Date d,
boolean ignoreTime) |
static <T extends IdentifiableTimespanI> |
getValid(java.util.Collection<T> c,
java.util.Date d,
boolean ignoreTime,
boolean doThrow) |
static <T extends IdentifiableTimespanI> |
getValid(java.util.Collection<T> c,
java.util.Date d,
boolean ignoreTime,
boolean doThrow,
java.lang.Class<? extends T> onlyOfClass)
Returns the IdentifiableTimespanI object from the values in the passed Collection that is valid at the specified date.
|
static <T extends IdentifiableTimespanI> |
getValid(java.util.Map<java.lang.Long,T> m,
java.util.Date d) |
static <T extends IdentifiableTimespanI> |
getValid(java.util.Map<java.lang.Long,T> m,
java.util.Date d,
boolean ignoreTime) |
static <T extends IdentifiableTimespanI> |
getValid(java.util.Map<java.lang.Long,T> m,
java.util.Date d,
boolean ignoreTime,
boolean doThrow) |
static <T extends IdentifiableTimespanI> |
getValid(java.util.Map<java.lang.Long,T> m,
java.util.Date d,
boolean ignoreTime,
boolean doThrow,
java.lang.Class<? extends T> onlyOfClass)
Returns the IdentifiableTimespanI object from the values of the passed Map that is valid at the specified date.
|
public static <T extends IdentifiableTimespanI> java.util.Map<java.lang.Long,T> getAllValid(java.util.Map<java.lang.Long,T> m, java.util.Date d, boolean ignoreTime, boolean doThrow, java.lang.Class<? extends T> onlyOfClass)
public static <T extends IdentifiableTimespanI> java.util.Map<java.lang.Long,T> getAllValid(java.util.Collection<T> c, java.util.Date d, boolean ignoreTime, boolean doThrow, java.lang.Class<? extends T> onlyOfClass)
public static <T extends IdentifiableTimespanI> T getValid(java.util.Map<java.lang.Long,T> m, java.util.Date d, boolean ignoreTime, boolean doThrow, java.lang.Class<? extends T> onlyOfClass)
m
- The Mapd
- The Date representing the point in time to check for validity.ignoreTime
- A boolean indicating whether the time component should be ignored when checking validity.
Set to 'true' to ignore the time component, 'false' otherwise.doThrow
- A boolean indicating whether an IllegalStateException should be thrown if no or more than
one valid IdentifiableTimespanI object is found.
Set to 'true' to throw an exception, 'false' to return null instead.onlyOfClass
- The Class object representing the specific subclass of IdentifiableTimespanI.
Only objects of this class or its subclasses will be considered for validity.java.lang.IllegalStateException
- if throwException is set to 'true' and no or more than one valid IdentifiableTimespanI object is found.public static <T extends IdentifiableTimespanI> T getValid(java.util.Map<java.lang.Long,T> m, java.util.Date d, boolean ignoreTime, boolean doThrow)
public static <T extends IdentifiableTimespanI> T getValid(java.util.Map<java.lang.Long,T> m, java.util.Date d, boolean ignoreTime)
public static <T extends IdentifiableTimespanI> T getValid(java.util.Map<java.lang.Long,T> m, java.util.Date d)
public static <T extends IdentifiableTimespanI> T getValid(java.util.Collection<T> c, java.util.Date d, boolean ignoreTime, boolean doThrow, java.lang.Class<? extends T> onlyOfClass)
c
- The Collectiond
- The Date representing the point in time to check for validity.ignoreTime
- A boolean indicating whether the time component should be ignored when checking validity.
Set to 'true' to ignore the time component, 'false' otherwise.doThrow
- A boolean indicating whether an IllegalStateException should be thrown if no or more than
one valid IdentifiableTimespanI object is found.
Set to 'true' to throw an exception, 'false' to return null instead.onlyOfClass
- The Class object representing the specific subclass of IdentifiableTimespanI.
Only objects of this class or its subclasses will be considered for validity.java.lang.IllegalStateException
- if throwException is set to 'true' and no or more than one valid IdentifiableTimespanI object is found.public static <T extends IdentifiableTimespanI> T getValid(java.util.Collection<T> c, java.util.Date d, boolean ignoreTime, boolean doThrow)
public static <T extends IdentifiableTimespanI> T getValid(java.util.Collection<T> c, java.util.Date d, boolean ignoreTime)
public static <T extends IdentifiableTimespanI> T getValid(java.util.Collection<T> c, java.util.Date d)
public static <T extends IdentifiableTimespanI> T getOldestValid(java.util.Collection<T> c)
public static <T extends IdentifiableTimespanI> T getOldestValid(java.util.Collection<T> c, java.lang.Class<? extends T> onlyOfClass)
public static <T extends IdentifiableTimespanI> T getNewestValid(java.util.Collection<T> c)
public static <T extends IdentifiableTimespanI> T getNewestValid(java.util.Collection<T> c, java.lang.Class<? extends T> onlyOfClass)
public static <T extends IdentifiableTimespanI> T getNewestValidBefore(java.util.Collection<T> c, java.util.Date limit)
public static <T extends IdentifiableTimespanI> T getNewestValidBefore(java.util.Collection<T> c, java.util.Date limit, java.lang.Class<? extends T> onlyOfClass)
public static <T extends IdentifiableTimespanI> T getOldestValidBefore(java.util.Collection<T> c, java.util.Date limit)
public static <T extends IdentifiableTimespanI> T getOldestValidBefore(java.util.Collection<T> c, java.util.Date limit, java.lang.Class<? extends T> onlyOfClass)
public static <T extends IdentifiableTimespanI> T getNewestValidAfter(java.util.Collection<T> c, java.util.Date limit)
public static <T extends IdentifiableTimespanI> T getNewestValidAfter(java.util.Collection<T> c, java.util.Date limit, java.lang.Class<? extends T> onlyOfClass)
public static <T extends IdentifiableTimespanI> T getOldestValidAfter(java.util.Collection<T> c, java.util.Date limit)
public static <T extends IdentifiableTimespanI> T getOldestValidAfter(java.util.Collection<T> c, java.util.Date limit, java.lang.Class<? extends T> onlyOfClass)
public static <T extends IdentifiableTimespanI> T getOldestOrNewestValidBeforeOrAfter(java.util.Collection<T> c, java.util.Date d, java.lang.Class<? extends T> onlyOfClass, boolean returnOldest, boolean before)
public static <T extends IdentifiableTimespanI> T getOldestOrNewestValidBeforeOrAfter(java.util.Collection<T> c, java.util.Date d, java.lang.Class<? extends T> onlyOfClass, boolean returnOldest, boolean before, boolean nullDateIsValid)
before
- if true, will check if a timespan has started before or at the given date.
if false, will check if a timespan has ended after or at the given datereturnOldest
- if true, return the oldest timespan before or after the given date
if false return the newest timespan before or after the given dateCopyright © 2000-2025 OAshi S.à r.l. All Rights Reserved.