final Sequence sequence = new RecursiveSequence(value, context);
while (sequence.hasNext())
{
final Object o = sequence.next();
needles.add(new TypeValuePair(AnyType.TYPE, o));
}
}
catch (EvaluationException e)
{
if (e.getErrorValue() == LibFormulaErrorValue.ERROR_NA_VALUE)
{
needles.add(new TypeValuePair(AnyType.TYPE, null));
}
else
{
throw e;
}
}
}
if (needles.size() == 0)
{
return new TypeValuePair(LogicalType.TYPE, Boolean.TRUE);
}
final Object value = parameters.getValue(0);
final Sequence sequence = new RecursiveSequence(value, context);
final EqualOperator equalOperator = new EqualOperator();
while (sequence.hasNext())
{
final Object o = sequence.next();
final TypeValuePair sequenceValue = new TypeValuePair(AnyType.TYPE, o);
for (int i = needles.size() - 1; i >= 0; i -= 1)
{
final TypeValuePair needle = needles.get(i);
if (needle.getValue() == o)
{
needles.remove(i);
}
else if (o != null)
{
final TypeValuePair evaluate = equalOperator.evaluate(context, sequenceValue, needle);
if (Boolean.TRUE.equals(evaluate.getValue()))
{
needles.remove(i);
}
}
}
}
return new TypeValuePair(LogicalType.TYPE, needles.isEmpty());
}