示例#1
0
文件: List.java 项目: s-webber/projog
 @Override
 public List copy(Map<Variable, Variable> sharedVariables) {
   if (immutable) {
     return this;
   } else {
     Term newHead = head.copy(sharedVariables);
     Term newTail = tail.copy(sharedVariables);
     if (newHead == head && newTail == tail) {
       return this;
     } else {
       return new List(newHead, newTail, newHead.isImmutable() && newTail.isImmutable());
     }
   }
 }
示例#2
0
文件: List.java 项目: s-webber/projog
 @Override
 public List getTerm() {
   if (immutable) {
     return this;
   } else {
     Term newHead = head.getTerm();
     Term newTail = tail.getTerm();
     if (newHead == head && newTail == tail) {
       return this;
     } else {
       return new List(newHead, newTail, newHead.isImmutable() && newTail.isImmutable());
     }
   }
 }