/** * <p>getBounds</p> * * @return a {@link org.opennms.core.utils.TimeInterval} object. */ public TimeInterval getBounds() { Date start = getStart(); Date end = getEnd(); return (start == null || end == null ? null : new TimeInterval(start, end)); }
/** * Get the current properties object from the cache loading it in memory * * @param propFile a {@link java.io.File} object. * @throws java.io.IOException if any. * @return a {@link java.util.Properties} object. */ public Properties getProperties(final File propFile) throws IOException { return getHolder(propFile).get(); }
public static boolean isInetAddressInRange(final String addrString, final String beginString, final String endString) { final byte[] addr = InetAddressUtils.toIpAddrBytes(addrString); final byte[] begin = InetAddressUtils.toIpAddrBytes(beginString); if (s_BYTE_ARRAY_COMPARATOR.compare(addr, begin) > 0) { final byte[] end = InetAddressUtils.toIpAddrBytes(endString); return (s_BYTE_ARRAY_COMPARATOR.compare(addr, end) <= 0); } else if (s_BYTE_ARRAY_COMPARATOR.compare(addr, begin) == 0) { return true; } else { return false; } }
/** * Gets the home directory. * * @return the home directory */ protected String getHomeDirectory() { return ConfigFileConstants.getHome(); }
/** * <p>forEachUserNotification</p> * * @param notifId a int. * @param rp a {@link org.opennms.netmgt.utils.RowProcessor} object. */ public void forEachUserNotification(final int notifId, final RowProcessor rp) { final Querier querier = new Querier(m_dataSource, "select * from usersNotified where notifyId = ? order by notifytime", rp); querier.execute(notifId); }
/** * <p>setProperty</p> * * @param propFile a {@link java.io.File} object. * @param key a {@link java.lang.String} object. * @param value a {@link java.lang.String} object. * @throws java.io.IOException if any. */ public void setProperty(final File propFile, final String key, final String value) throws IOException { getHolder(propFile).setProperty(key, value); }
/** * <p>saveProperties</p> * * @param propFile a {@link java.io.File} object. * @param properties a {@link java.util.Properties} object. * @throws java.io.IOException if any. */ public void saveProperties(final File propFile, final Properties properties) throws IOException { getHolder(propFile).put(properties); }
/** * <p>getProperty</p> * * @param propFile a {@link java.io.File} object. * @param key a {@link java.lang.String} object. * @return a {@link java.lang.String} object. * @throws java.io.IOException if any. */ public String getProperty(final File propFile, final String key) throws IOException { return getHolder(propFile).getProperty(key); } }
/** * <p>updateProperties</p> * * @param propFile a {@link java.io.File} object. * @param props a {@link java.util.Map} object. * @throws java.io.IOException if any. */ public void updateProperties(final File propFile, final Map<String, String> props) throws IOException { getHolder(propFile).update(props); }
@Override public boolean match(final String value, final String range) { return matchRangeHex(value, range); } }
@Override public boolean match(final String value, final String range) { return matchRange(value, range); } }
/** * Get the average of the contents of a {@link List} of {@link Number} values, excluding null entries * * @param list the {@link List} of {@link Number} values * @return the average of the not-null values as a {@link Number} value */ public static Number average(List<? extends Number> list) { return averageBigDecimal(convertNumberToBigDecimal(list)); }
/** * Get the median of the contents of a {@link List} of {@link Number} values, excluding null entries * * @param list the {@link List} of {@link Number} values * @return the median of the not-null values as a {@link Number} value */ public static Number median(List<? extends Number> list) { return medianBigDecimal(convertNumberToBigDecimal(list)); }
public static String computeLabelForRRD(String ifname, String ifdescr, String physaddr) { String name = computeNameForRRD(ifname, ifdescr); String physAddrForRRD = computePhysAddrForRRD(physaddr); return (physAddrForRRD == null ? name : name + '-' + physAddrForRRD); } }
private void removeFromTail(T interval) { if (m_tail == null) { return; } m_tail.removeInterval(interval); if (m_tail.m_interval == null) { m_tail = null; } }