1 24 package org.objectweb.jalisto.se.query.result; 25 26 import org.objectweb.jalisto.se.impl.LogicalOid; 27 import org.objectweb.jalisto.se.api.Session; 28 import org.objectweb.jalisto.se.impl.util.JalistoUtils; 29 30 public class QueryResultWrapper implements Comparable { 31 32 public QueryResultWrapper(LogicalOid loid, Object [] value) { 33 this.logicalOid = loid; 34 this.value = value; 35 } 36 37 public QueryResultWrapper() { 38 } 39 40 public LogicalOid getLogicalOid() { 41 return logicalOid; 42 } 43 44 public void setLogicalOid(LogicalOid logicalOid) { 45 this.logicalOid = logicalOid; 46 } 47 48 public Object [] getValue() { 49 return value; 50 } 51 52 public void setValue(Object [] value) { 53 this.value = value; 54 } 55 56 public boolean isReaded() { 57 return (value != null); 58 } 59 60 public int hashCode() { 61 return logicalOid.hashCode(); 62 } 63 64 public boolean equals(Object o) { 65 try { 66 return this.logicalOid.equals(((QueryResultWrapper) o).logicalOid); 67 } catch (Exception e) { 68 } 69 return false; 70 } 71 72 public String toString() { 73 return "(" + String.valueOf(logicalOid) + "," + JalistoUtils.arrayToString(value); 74 } 75 76 public String toStringFull(Session session) { 77 return "(" + String.valueOf(logicalOid) + "," + JalistoUtils.arrayToString(value, session); 78 } 79 80 public int compareTo(Object object) { 81 QueryResultWrapper candidate = (QueryResultWrapper) object; 82 return this.logicalOid.compareTo(candidate.logicalOid); 83 } 84 85 private LogicalOid logicalOid; 86 private Object [] value; 87 } 88 | Popular Tags |