コード例 #1
0
 @Override
 public @Nullable abstract_value lookup(principal_type key) {
   if (key instanceof master_type) {
     return params.get((master_type) key);
   } else {
     return null;
   }
 }
コード例 #2
0
  @Override
  public string to_string() {
    StringBuilder s = new StringBuilder();
    boolean first = true;
    s.append('[');

    if (!params.is_empty()) {
      readonly_list<dictionary.entry<master_type, abstract_value>> named_list = params.elements();
      for (int i = 0; i < named_list.size(); ++i) {
        if (first) {
          first = false;
        } else {
          s.append(", ");
        }
        s.append(utilities.s(named_list.get(i).key().short_name().to_string()));
        s.append(": ");
        s.append(utilities.s(named_list.get(i).value().to_string()));
      }
    }

    s.append(']');
    return new base_string(s.toString());
  }