001: /*
002: * Hammurapi
003: * Automated Java code review system.
004: * Copyright (C) 2004 Hammurapi Group
005: *
006: * This program is free software; you can redistribute it and/or modify
007: * it under the terms of the GNU General Public License as published by
008: * the Free Software Foundation; either version 2 of the License, or
009: * (at your option) any later version.
010: *
011: * This program is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
014: * GNU General Public License for more details.
015: *
016: * You should have received a copy of the GNU General Public License
017: * along with this program; if not, write to the Free Software
018: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
019: *
020: * URL: http://www.hammurapi.org
021: * e-Mail: support@hammurapi.biz
022: */
023: package org.hammurapi.results.simple;
024:
025: import org.hammurapi.HammurapiException;
026: import org.hammurapi.WaiverSet;
027: import org.hammurapi.results.AggregatedResults;
028: import org.hammurapi.results.CompositeResults;
029: import org.hammurapi.results.DetailedResults;
030: import org.hammurapi.results.NamedResults;
031: import org.hammurapi.results.ResultsFactory;
032: import org.hammurapi.results.ReviewResults;
033:
034: import com.pavelvlasov.jsel.CompilationUnit;
035: import com.pavelvlasov.logging.Logger;
036: import com.pavelvlasov.persistence.MemoryStorage;
037: import com.pavelvlasov.persistence.Storage;
038:
039: /**
040: * @author Pavel Vlasov
041: * @version $Revision: 1.4 $
042: */
043: public class QuickResultsFactory extends ResultsFactory {
044: private WaiverSet waiverSet;
045: private Logger logger;
046: private ClassLoader classLoader;
047: private int tabSize;
048:
049: public QuickResultsFactory(WaiverSet waiverSet,
050: ClassLoader classLoader, int tabSize, Logger logger) {
051: this .waiverSet = waiverSet;
052: this .classLoader = classLoader;
053: this .logger = logger;
054: this .tabSize = tabSize;
055: }
056:
057: public AggregatedResults newAggregatedResults() {
058: return new SimpleAggregatedResults(waiverSet);
059: }
060:
061: public NamedResults newNamedResults(String name) {
062: return new SimpleNamedResults(name, waiverSet);
063: }
064:
065: public DetailedResults newDetailedResults(String name) {
066: return new SimpleDetailedResults(name, waiverSet);
067: }
068:
069: public CompositeResults newCompositeResults(String name) {
070: return new SimpleCompositeResults(name, waiverSet);
071: }
072:
073: public ReviewResults newReviewResults(
074: CompilationUnit compilationUnit) {
075: return new ReparsingReviewResults(compilationUnit, waiverSet,
076: classLoader, tabSize, logger);
077: }
078:
079: public void setSummary(AggregatedResults summary) {
080: }
081:
082: private Storage storage = new MemoryStorage();
083:
084: public Storage getStorage() {
085: return storage;
086: }
087:
088: public ReviewResults findReviewResults(CompilationUnit cu) {
089: return null;
090: }
091:
092: public void commit(long l) {
093: // DO NOTHING
094: }
095:
096: public void execute(Task task) throws HammurapiException {
097: if (task != null) {
098: task.execute();
099: }
100: }
101:
102: public void join() {
103: // DO NOTHING
104: }
105:
106: }
|