示例#1
0
 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;
 }
示例#2
0
  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);
    }
  }
示例#3
0
 public void setCategories(Object[] cats) {
   // We must make the nominal stats first to prevent them being overridden.
   makeNominalStats();
   set("categories", cats);
 }