mt420 release from Henrik.

git-svn-id: svn://10.0.0.236/trunk@79505 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
tao%netscape.com
2000-09-19 03:11:15 +00:00
parent c72110c027
commit 967ad1d080
23 changed files with 1785 additions and 320 deletions

View File

@@ -0,0 +1,118 @@
/*
* FetchUntranslated.java
*
* Created on 19. august 2000, 20:32
*/
package org.mozilla.translator.fetch;
import org.mozilla.translator.datamodel.*;
/**
*
* @author Henrik Lynggaard
* @version
*/
public class FetchAdvancedSearch implements Fetcher
{
private Filter first;
private Filter second;
private Filter third;
private boolean all;
/** Creates new FetchUntranslated */
public FetchAdvancedSearch(Filter f1,Filter f2,Filter f3,boolean al)
{
first = f1;
second = f2;
third = f3;
all=al;
}
public boolean check(Phrase ph)
{
boolean realResult,firstResult,secondResult,thirdResult;
if (all)
{
if (first!=null)
{
firstResult = first.check(ph);
}
else
{
firstResult=true;
}
if (second!=null)
{
secondResult = second.check(ph);
}
else
{
secondResult=true;
}
if (third!=null)
{
thirdResult = third.check(ph);
}
else
{
thirdResult=true;
}
if ((firstResult==true) && (secondResult==true) && (thirdResult==true))
{
realResult=true;
}
else
{
realResult=false;
}
}
else
{
if (first!=null)
{
firstResult = first.check(ph);
}
else
{
firstResult=false;
}
if (second!=null)
{
secondResult = second.check(ph);
}
else
{
secondResult=false;
}
if (third!=null)
{
thirdResult = third.check(ph);
}
else
{
thirdResult=false;
}
if ((firstResult==true) || (secondResult==true) || (thirdResult==true))
{
realResult=true;
}
else
{
realResult=false;
}
}
return realResult;
}
}