public StatValue[] matchSpec(StatSpec spec){
  if (spec.getCombineType() == StatSpec.GLOBAL) {
    StatValue[] allValues=matchSpec(new RawStatSpec(spec));
    if (allValues.length == 0) {
      return allValues;
    }
 else {
      ComboValue cv=new ComboValue(allValues);
      return new StatValue[]{cv};
    }
  }
 else {
    List l=new ArrayList();
    StatArchiveReader.StatArchiveFile[] archives=getArchives();
    for (int i=0; i < archives.length; i++) {
      StatArchiveFile f=archives[i];
      if (spec.archiveMatches(f.getFile())) {
        f.matchSpec(spec,l);
      }
    }
    StatValue[] result=new StatValue[l.size()];
    return (StatValue[])l.toArray(result);
  }
}

public StatValue [ ] matchSpec ( StatSpec spec ) { if ( spec . getCombineType ( ) == StatSpec . GLOBAL ) { StatValue [ ] allValues = matchSpec ( new RawStatSpec ( spec ) ) ; if ( allValues . length == 0 ) { return allValues ; } else { ComboValue cv = new ComboValue ( allValues ) ; return new StatValue [ ] { cv } ; } } else { List l = new ArrayList ( ) ; StatArchiveReader . StatArchiveFile [ ] archives = getArchives ( ) ; for ( int i = 0 ; i < archives . length ; i ++ ) { StatArchiveFile f = archives [ i ] ; if ( spec . archiveMatches ( f . getFile ( ) ) ) { f . matchSpec ( spec , l ) ; } } StatValue [ ] result = new StatValue [ l . size ( ) ] ; return ( StatValue [ ] ) l . toArray ( result ) ; } }
returns an array of stat values that match the specified spec . if nothing matches then an empty array is returned .
