コード例 #1
0
 public String toString() {
   return "["
       + ((_peer != null) ? (_peer.getId() + ".") : "")
       + ((_schema != null) ? _schema.getSchemaId() + "." : "")
       + _relation.getName()
       + "]";
 }
コード例 #2
0
  /**
   * Returns true if the relation matches the string name
   *
   * @param s
   * @return
   */
  public boolean matches(String s) {
    String peer = "";
    String schema = "";
    String relation = "";

    if (s.contains(".")) {
      int inx = s.indexOf('.');

      int inx2 = s.indexOf('.', inx + 1);

      if (inx2 > inx) {
        peer = s.substring(0, inx);
        schema = s.substring(inx + 1, inx2);
        relation = s.substring(inx2 + 1);
      } else {
        schema = s.substring(0, inx);
        relation = s.substring(inx + 1);
      }
    } else {
      relation = s;
    }
    return (peer.isEmpty() || peer.equals(_peer.getId()))
        && (schema.isEmpty() || schema.equals(_schema.getSchemaId()))
        && relation.equals(_relation.getName());
  }
コード例 #3
0
  public boolean equals(Object o) {
    if (!(o instanceof TupleNode)) return false;

    TupleNode t2 = (TupleNode) o;
    return (_peer.getId().equals(t2._peer.getId()))
        && (_schema.getSchemaId().equals(t2._schema.getSchemaId()))
        && (_relation.getName().equals(t2._relation.getName()));
  }
コード例 #4
0
 public int hashCode() {
   return _relation.hashCode();
 }