/** * Sets the value at the given index. * Null values are not allowed. */ @Override public Date set(final int index, final Date value) { final long date = value.getTime(); final Date previous = get(index); switch (index) { case 0: date1 = date; break; case 1: date2 = date; break; } modCount++; return previous; }
/** * Adds all content from the given collection into this collection. */ @Override @SuppressWarnings("fallthrough") public boolean addAll(final Collection<? extends Date> dates) { final int c = modCount; if (dates != null) { final Iterator<? extends Date> it = dates.iterator(); switch (size()) { // Fallthrough everywhere. case 0: if (!it.hasNext()) break; date1 = it.next().getTime(); modCount++; case 1: if (!it.hasNext()) break; date2 = it.next().getTime(); modCount++; default: if (!it.hasNext()) break; throw new IllegalArgumentException(Errors.format( Errors.Keys.ExcessiveArgumentSize_3, "dates", 2, dates.size())); } } return modCount != c; }
/** * Adds all content from the given collection into this collection. */ @Override @SuppressWarnings("fallthrough") public boolean addAll(final Collection<? extends Date> dates) { final int c = modCount; if (dates != null) { final Iterator<? extends Date> it = dates.iterator(); switch (size()) { // Fallthrough everywhere. case 0: if (!it.hasNext()) break; date1 = it.next().getTime(); modCount++; case 1: if (!it.hasNext()) break; date2 = it.next().getTime(); modCount++; default: if (!it.hasNext()) break; throw new IllegalArgumentException(Errors.format( Errors.Keys.ExcessiveArgumentSize_3, "dates", 2, dates.size())); } } return modCount != c; }
/** * Returns the date or range of dates on which a data quality measure was applied. * The collection size is 1 for a single date, or 2 for a range. * Returns an empty collection if this information is not available. * * @return date or range of dates on which a data quality measure was applied. */ @Override @XmlElement(name = "dateTime", namespace = Namespaces.DQC) @SuppressWarnings("ReturnOfCollectionOrArrayField") public Collection<Date> getDates() { if (Semaphores.query(Semaphores.NULL_COLLECTION)) { return isNullOrEmpty(dates) ? null : dates; } if (dates == null) { dates = new Dates(); } return dates; }
/** * Returns the date or range of dates on which a data quality measure was applied. * The collection size is 1 for a single date, or 2 for a range. * Returns an empty collection if this information is not available. * * @return date or range of dates on which a data quality measure was applied. */ @Override @XmlElement(name = "dateTime") @SuppressWarnings("ReturnOfCollectionOrArrayField") public Collection<Date> getDates() { if (Semaphores.query(Semaphores.NULL_COLLECTION)) { return isNullOrEmpty(dates) ? null : dates; } if (dates == null) { dates = new Dates(); } return dates; }
/** * Removes the value at the given index. */ @Override @SuppressWarnings("fallthrough") public Date remove(final int index) { final Date previous = get(index); switch (index) { case 0: date1 = date2; // Fallthrough case 1: date2 = Long.MIN_VALUE; break; } modCount++; return previous; }
/** * Sets the value at the given index. * Null values are not allowed. */ @Override public Date set(final int index, final Date value) { final long date = value.getTime(); final Date previous = get(index); switch (index) { case 0: date1 = date; break; case 1: date2 = date; break; } modCount++; return previous; }
/** * Removes the value at the given index. */ @Override @SuppressWarnings("fallthrough") public Date remove(final int index) { final Date previous = get(index); switch (index) { case 0: date1 = date2; // Fallthrough case 1: date2 = Long.MIN_VALUE; break; } modCount++; return previous; }
/** * Creates a new list initialized with no dates. */ Dates() { clear(); }
/** * Creates a new list initialized with no dates. */ Dates() { clear(); }