Ejemplo n.º 1
0
 private void setConnup(String conn) {
   if (conn.equals("JJ")) {
     JjCouplingType jj = new JjCouplingType();
     termup.setJj(jj);
   }
   if (conn.equals("LS")) {
     LSCouplingType ls = new LSCouplingType();
     termup.setLS(ls);
   }
 }
Ejemplo n.º 2
0
 @Override
 public int hashCode() {
   final int prime = 31;
   int result = 1;
   result = prime * result + ((text == null) ? 0 : text.hashCode());
   result = prime * result + ((type == null) ? 0 : type.hashCode());
   return result;
 }
Ejemplo n.º 3
0
 @Override
 public boolean unify(Term t1) {
   // used to be implemented using recursion but caused stack overflow problems with long lists
   Term t2 = this;
   do {
     TermType tType = t1.getType();
     if (tType == TermType.LIST) {
       if (t2.getArgument(0).unify(t1.getArgument(0)) == false) {
         return false;
       }
       t1 = t1.getArgument(1);
       t2 = t2.getArgument(1);
     } else if (tType.isVariable()) {
       return t1.unify(t2);
     } else {
       return false;
     }
   } while (t2.getType() == TermType.LIST);
   return t2.unify(t1);
 }
Ejemplo n.º 4
0
 public int compareTo(TermType o) {
   return value.compareTo(o.getValue());
 }
Ejemplo n.º 5
0
 @Override
 public synchronized boolean equals(java.lang.Object obj) {
   if (!(obj instanceof TermType)) return false;
   TermType other = (TermType) obj;
   if (obj == null) return false;
   if (this == obj) return true;
   if (__equalsCalc != null) {
     return (__equalsCalc == obj);
   }
   __equalsCalc = obj;
   boolean _equals;
   _equals =
       true
           && ((this.value == null && other.getValue() == null)
               || (this.value != null && this.value.equals(other.getValue())))
           && ((this.numberOfRecords == null && other.getNumberOfRecords() == null)
               || (this.numberOfRecords != null
                   && this.numberOfRecords.equals(other.getNumberOfRecords())))
           && ((this.displayTerm == null && other.getDisplayTerm() == null)
               || (this.displayTerm != null && this.displayTerm.equals(other.getDisplayTerm())))
           && ((this.whereInList == null && other.getWhereInList() == null)
               || (this.whereInList != null && this.whereInList.equals(other.getWhereInList())))
           && ((this.extraTermData == null && other.getExtraTermData() == null)
               || (this.extraTermData != null
                   && this.extraTermData.equals(other.getExtraTermData())));
   __equalsCalc = null;
   return _equals;
 }
Ejemplo n.º 6
0
 /**
  * Create new Term instance from a string, and an integer that corresponds with the token ID from
  * CQLParser.
  *
  * @param text the text representation of the term.
  * @param type the term's type as an integer token ID.
  */
 public Term(String text, int type) {
   this(text == null ? "" : text, TermType.forInt(type));
 }
Ejemplo n.º 7
0
 private void setConfup(String conf) {
   confup.setConfigurationLabel(conf);
   String[] cf = conf.split(point);
   termup.setTermLabel(cf[0]);
 }
Ejemplo n.º 8
0
 public TermType getTargetTermType() {
   return TermType.ofTerm(targetTerm.get());
 }
Ejemplo n.º 9
0
 public TermType getSourceTermType() {
   return TermType.ofTerm(sourceTerm.get());
 }
Ejemplo n.º 10
0
 private String toString(TermType type) {
   return type.getTermTypeName();
 }