public Object property(String key) { Object o = super.property(key); if (o == null) { if (!calculatedNominal && NominalStats.creates(key)) { makeNominalStats(); o = super.property(key); } if (!calculatedNumeric && NumericStats.creates(key)) { if (!calculatedNominal) makeNominalStats(); makeNumericStats(); o = super.property(key); } if (!calculatedDate && DateStats.creates(key)) { if (!calculatedNominal) makeNominalStats(); if (!calculatedNumeric) makeNumericStats(); makeDateStats(); o = super.property(key); } } return o; }
Field(String name, String label, Provider provider, Field base) { this.name = name; this.label = label == null ? name : label; this.provider = provider; // Information is provided in the base field if (base != null) { if (provider == null) { // Ensure that the base field has everything calculated because we cannot calculate lazily // later base.makeNominalStats(); base.makeNumericStats(); base.makeDateStats(); } copyPropertiesFrom(base); } }
public void setCategories(Object[] cats) { // We must make the nominal stats first to prevent them being overridden. makeNominalStats(); set("categories", cats); }