Exemplo n.º 1
0
 /**
  * Sets the expansionFactor. Throws IllegalArgumentException if the the following conditions are
  * not met:
  *
  * <ul>
  *   <li><code>expansionFactor > 1</code>
  *   <li><code>contractionFactor >= expansionFactor</code>
  * </ul>
  *
  * @param expansionFactor the new expansion factor value.
  * @throws IllegalArgumentException if expansionFactor is <= 1 or greater than contractionFactor
  */
 public void setExpansionFactor(float expansionFactor) {
   checkContractExpand(getContractionCriteria(), expansionFactor);
   // The check above verifies that the expansion factor is > 1.0;
   synchronized (this) {
     this.expansionFactor = expansionFactor;
   }
 }
Exemplo n.º 2
0
 /**
  * Sets the contraction criteria for this ExpandContractDoubleArray.
  *
  * @param contractionCriteria contraction criteria
  */
 public void setContractionCriteria(float contractionCriteria) {
   checkContractExpand(contractionCriteria, getExpansionFactor());
   synchronized (this) {
     this.contractionCriteria = contractionCriteria;
   }
 }