All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.snapscript.agent.debug.ScopeVariableTree Maven / Gradle / Ivy

There is a newer version: 1.4.6
Show newest version

package org.snapscript.agent.debug;

import java.util.Collections;
import java.util.Map;

public class ScopeVariableTree {
   
   public static final ScopeVariableTree EMPTY = new ScopeVariableTree.Builder(-1)
      .withEvaluation(Collections.EMPTY_MAP)
      .withLocal(Collections.EMPTY_MAP)
      .build();

   private final Map> evaluation;
   private final Map> local;
   private final int change;
   
   private ScopeVariableTree(Builder builder) {
      this.evaluation = Collections.unmodifiableMap(builder.evaluation);
      this.local = Collections.unmodifiableMap(builder.local);
      this.change = builder.change;
   }
   
   public Map> getLocal() {
      return local;
   }
   
   public Map> getEvaluation() {
      return evaluation;
   }
   
   public int getChange() {
      return change;
   }
   
   public static class Builder {
      
      private Map> evaluation;
      private Map> local;
      private int change;
      
      public Builder(int change){
         this.change = change;
      }

      public Builder withEvaluation(Map> evaluation) {
         this.evaluation = evaluation;
         return this;
      }

      public Builder withLocal(Map> local) {
         this.local = local;
         return this;
      }

      public Builder withChange(int change) {
         this.change = change;
         return this;
      }
      
      public ScopeVariableTree build() {
         return new ScopeVariableTree(this);
      }
   }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy