Home | History | Annotate | Download | only in core
      1 /*
      2  *
      3  * Copyright 2001-2011 Texas Instruments, Inc. - http://www.ti.com/
      4  *
      5  * Licensed under the Apache License, Version 2.0 (the "License");
      6  * you may not use this file except in compliance with the License.
      7  * You may obtain a copy of the License at
      8  *
      9  *    http://www.apache.org/licenses/LICENSE-2.0
     10  *
     11  * Unless required by applicable law or agreed to in writing, software
     12  * distributed under the License is distributed on an "AS IS" BASIS,
     13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     14  * See the License for the specific language governing permissions and
     15  * limitations under the License.
     16  */
     17 
     18 package com.ti.jfm.core;
     19 
     20 import android.util.Log;
     21 
     22 public class JFmContext {
     23     private long value = 0;
     24 
     25     public static final long INVALID_CONTEXT_VALUE = -1;
     26 
     27     public JFmContext() {
     28        value = INVALID_CONTEXT_VALUE;
     29     }
     30 
     31     public JFmContext(long contextValue) {
     32        value = contextValue;
     33     }
     34 
     35     @Override
     36     public boolean equals(Object otherContextAsObject) {
     37        if (otherContextAsObject instanceof JFmContext) {
     38           return (value == ((JFmContext) otherContextAsObject).getValue());
     39        } else {
     40           return false;
     41        }
     42     }
     43 
     44     @Override
     45     public int hashCode() {
     46        return (int) value;
     47     }
     48 
     49     public final long getValue() {
     50        return value;
     51     }
     52 
     53     public final void setValue(int value) {
     54        Log.d("JFmContext()", "setValue: setValue called, value:" + value);
     55        this.value = value;
     56     }
     57 
     58 }
     59