Example #1
0
 @Override
 public void write(org.apache.thrift.protocol.TProtocol prot, Graph struct)
     throws org.apache.thrift.TException {
   TTupleProtocol oprot = (TTupleProtocol) prot;
   BitSet optionals = new BitSet();
   if (struct.isSetNodeType()) {
     optionals.set(0);
   }
   if (struct.isSetRoots()) {
     optionals.set(1);
   }
   if (struct.isSetAdjacencyList()) {
     optionals.set(2);
   }
   oprot.writeBitSet(optionals, 3);
   if (struct.isSetNodeType()) {
     oprot.writeI32(struct.nodeType.getValue());
   }
   if (struct.isSetRoots()) {
     {
       oprot.writeI32(struct.roots.size());
       for (String _iter16 : struct.roots) {
         oprot.writeString(_iter16);
       }
     }
   }
   if (struct.isSetAdjacencyList()) {
     {
       oprot.writeI32(struct.adjacencyList.size());
       for (Adjacency _iter17 : struct.adjacencyList) {
         _iter17.write(oprot);
       }
     }
   }
 }
Example #2
0
  public boolean equals(Graph that) {
    if (that == null) return false;

    boolean this_present_nodeType = true && this.isSetNodeType();
    boolean that_present_nodeType = true && that.isSetNodeType();
    if (this_present_nodeType || that_present_nodeType) {
      if (!(this_present_nodeType && that_present_nodeType)) return false;
      if (!this.nodeType.equals(that.nodeType)) return false;
    }

    boolean this_present_roots = true && this.isSetRoots();
    boolean that_present_roots = true && that.isSetRoots();
    if (this_present_roots || that_present_roots) {
      if (!(this_present_roots && that_present_roots)) return false;
      if (!this.roots.equals(that.roots)) return false;
    }

    boolean this_present_adjacencyList = true && this.isSetAdjacencyList();
    boolean that_present_adjacencyList = true && that.isSetAdjacencyList();
    if (this_present_adjacencyList || that_present_adjacencyList) {
      if (!(this_present_adjacencyList && that_present_adjacencyList)) return false;
      if (!this.adjacencyList.equals(that.adjacencyList)) return false;
    }

    return true;
  }
Example #3
0
 /** Performs a deep copy on <i>other</i>. */
 public Graph(Graph other) {
   if (other.isSetNodeType()) {
     this.nodeType = other.nodeType;
   }
   if (other.isSetRoots()) {
     List<String> __this__roots = new ArrayList<String>(other.roots);
     this.roots = __this__roots;
   }
   if (other.isSetAdjacencyList()) {
     List<Adjacency> __this__adjacencyList = new ArrayList<Adjacency>(other.adjacencyList.size());
     for (Adjacency other_element : other.adjacencyList) {
       __this__adjacencyList.add(new Adjacency(other_element));
     }
     this.adjacencyList = __this__adjacencyList;
   }
 }
Example #4
0
  @Override
  public int compareTo(Graph other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetNodeType()).compareTo(other.isSetNodeType());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetNodeType()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nodeType, other.nodeType);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetRoots()).compareTo(other.isSetRoots());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetRoots()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.roots, other.roots);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetAdjacencyList()).compareTo(other.isSetAdjacencyList());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetAdjacencyList()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.adjacencyList, other.adjacencyList);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }