예제 #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);
   }
 }
예제 #2
0
파일: Term.java 프로젝트: N3xtHub/cassandra
 @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;
 }
예제 #3
0
파일: List.java 프로젝트: s-webber/projog
 @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);
 }
예제 #4
0
 public int compareTo(TermType o) {
   return value.compareTo(o.getValue());
 }
예제 #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;
 }
예제 #6
0
파일: Term.java 프로젝트: N3xtHub/cassandra
 /**
  * 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));
 }
예제 #7
0
 private void setConfup(String conf) {
   confup.setConfigurationLabel(conf);
   String[] cf = conf.split(point);
   termup.setTermLabel(cf[0]);
 }
예제 #8
0
 public TermType getTargetTermType() {
   return TermType.ofTerm(targetTerm.get());
 }
예제 #9
0
 public TermType getSourceTermType() {
   return TermType.ofTerm(sourceTerm.get());
 }
예제 #10
0
 private String toString(TermType type) {
   return type.getTermTypeName();
 }