Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /*
  * Copyright (C) 2015 The Pennsylvania State University and the University of Wisconsin
  * Systems and Internet Infrastructure Security Laboratory
  *
  * Author: Damien Octeau
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package edu.psu.cse.siis.coal;
import soot.Unit;
A constant propagation result.
public class Result {
  private Map<UnitMap<IntegerObject>> result = new HashMap<>();
  private String statistics;

  
Returns the results. A result is a map between statements and statement results. There may be more than an argument that is of interest in a COAL hotspot. A statement result is a map between argument index and value.

Returns:
The results.
  public Map<UnitMap<IntegerObject>> getResults() {
    return ;
  }

  
Returns the result for a given statement and a given argument.

Parameters:
unit A statement.
argument An argument.
Returns:
The result for the input statement and argument.
  public Object getResult(Unit unitArgument argument) {
    Map<IntegerObjectunitResult = .get(unit);
    if (unitResult != null) {
      return unitResult.get(argument.getArgnum());
    }
    return null;
  }

  
Returns problem statistics in the form of a string.

Returns:
Some statistics for the problem.
  public String getStatistics() {
    return ;
  }

  
Adds a result.

Parameters:
unit A COAL hotspot.
argnum The argument index.
value The value of the argument.
  public void addResult(Unit unitint argnumObject value) {
    Map<IntegerObjectunitResult = .get(unit);
    if (unitResult == null) {
      unitResult = new HashMap<>();
      .put(unitunitResult);
    }
    unitResult.put(argnumvalue);
  }

  
Sets statistics in the form of a string.

Parameters:
statistics The statistics.
  public void setStatistics(String statistics) {
    this. = statistics;
  }
New to GrepCode? Check out our FAQ X