PageRenderTime 12ms CodeModel.GetById 2ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/testability-explorer/src/main/java/com/google/test/metric/method/op/turing/FieldAssignment.java

http://testability-explorer.googlecode.com/
Java | 57 lines | 33 code | 9 blank | 15 comment | 0 complexity | ba5cfbfc81d8b898657169cfa137de93 MD5 | raw file
 1/*
 2 * Copyright 2007 Google Inc.
 3 *
 4 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 5 * use this file except in compliance with the License. You may obtain a copy of
 6 * the License at
 7 *
 8 * http://www.apache.org/licenses/LICENSE-2.0
 9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 * License for the specific language governing permissions and limitations under
14 * the License.
15 */
16package com.google.test.metric.method.op.turing;
17
18import com.google.test.metric.FieldInfo;
19import com.google.test.metric.TestabilityVisitor;
20import com.google.test.metric.Variable;
21
22public class FieldAssignment extends Operation {
23
24  private final Variable fieldInstance;
25  private final FieldInfo field;
26  private final Variable value;
27
28  public FieldAssignment(int lineNumber, Variable fieldInstance,
29      FieldInfo field, Variable value) {
30    super(lineNumber);
31    this.fieldInstance = fieldInstance;
32    this.field = field;
33    this.value = value;
34  }
35
36  public Variable getFieldInstance() {
37    return fieldInstance;
38  }
39
40  public FieldInfo getField() {
41    return field;
42  }
43
44  public Variable getValue() {
45	return value;
46  }
47
48  @Override
49  public void visit(TestabilityVisitor.Frame visitor) {
50    visitor.assignField(fieldInstance, field, value, getLineNumber());
51  }
52
53  @Override
54  public String toString() {
55    return field + " <- " + value;
56  }
57}