border with mnemonic
[fedora-idea.git] / java / compiler / impl / src / com / intellij / compiler / make / FieldIdKeyDescriptor.java
blob04635ef3f28ed36c4a320c0fd6c79d969d242c2e
1 /*
2 * Copyright 2000-2009 JetBrains s.r.o.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package com.intellij.compiler.make;
18 import com.intellij.util.io.KeyDescriptor;
20 import java.io.DataInput;
21 import java.io.DataOutput;
22 import java.io.IOException;
24 /**
25 * @author Eugene Zhuravlev
26 * Date: Dec 1, 2008
28 class FieldIdKeyDescriptor implements KeyDescriptor<StorageFieldId> {
29 public static final FieldIdKeyDescriptor INSTANCE = new FieldIdKeyDescriptor();
31 public int getHashCode(StorageFieldId value) {
32 return value.hashCode();
35 public boolean isEqual(StorageFieldId val1, StorageFieldId val2) {
36 return val1.equals(val2);
39 public void save(DataOutput out, StorageFieldId value) throws IOException {
40 out.writeInt(value.getClassQName());
41 out.writeInt(value.getFieldName());
44 public StorageFieldId read(DataInput in) throws IOException {
45 final int qName = in.readInt();
46 final int fieldName = in.readInt();
47 return new StorageFieldId(qName, fieldName);