1 21 package com.db4o; 22 23 import com.db4o.foundation.*; 24 25 28 public class QConEvaluation extends QCon { 29 30 private transient Object i_evaluation; 31 32 public byte[] i_marshalledEvaluation; 33 34 public int i_marshalledID; 35 36 public QConEvaluation() { 37 } 39 40 QConEvaluation(Transaction a_trans, Object a_evaluation) { 41 super(a_trans); 42 i_evaluation = a_evaluation; 43 } 44 45 void evaluateEvaluationsExec(QCandidates a_candidates, boolean rereadObject) { 46 if (rereadObject) { 47 a_candidates.traverse(new Visitor4() { 48 public void visit(Object a_object) { 49 ((QCandidate) a_object).useField(null); 50 } 51 }); 52 } 53 a_candidates.filter(this); 54 } 55 56 void marshall() { 57 super.marshall(); 58 int[] id = {0}; 59 if(Deploy.csharp){ 60 i_marshalledEvaluation = i_trans.stream().marshall(Platform4.wrapEvaluation(i_evaluation), id); 61 }else{ 62 try{ 63 i_marshalledEvaluation = Platform4.serialize(i_evaluation); 65 }catch (Exception e){ 66 i_marshalledEvaluation = i_trans.stream().marshall(i_evaluation, id); 67 } 68 69 } 70 i_marshalledID = id[0]; 71 } 72 73 void unmarshall(Transaction a_trans) { 74 if (i_trans == null) { 75 super.unmarshall(a_trans); 76 if(Deploy.csharp){ 77 i_evaluation = i_trans.stream().unmarshall(i_marshalledEvaluation, i_marshalledID); 78 }else{ 79 if(i_marshalledID > 0){ 80 i_evaluation = i_trans.stream().unmarshall(i_marshalledEvaluation, i_marshalledID); 81 }else{ 82 i_evaluation = Platform4.deserialize(i_marshalledEvaluation); 83 } 84 } 85 } 86 } 87 88 public void visit(Object obj) { 89 QCandidate candidate = (QCandidate) obj; 90 try { 91 Platform4.evaluationEvaluate(i_evaluation, candidate); 92 if (!candidate._include) { 93 doNotInclude(candidate.getRoot()); 94 } 95 } catch (Exception e) { 96 candidate.include(false); 97 doNotInclude(candidate.getRoot()); 98 } 101 } 102 103 boolean supportsIndex() { 104 return false; 105 } 106 } 107
| Popular Tags
|