| /******************************************************************************* |
| * Copyright (c) 2009, 2010 Nokia and others. |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v1.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| * Contributors: |
| * Nokia - Initial API and implementation |
| *******************************************************************************/ |
| package org.eclipse.cdt.debug.edc.internal.symbols; |
| |
| import java.text.MessageFormat; |
| import java.util.HashMap; |
| import java.util.Map; |
| |
| import org.eclipse.cdt.core.IAddress; |
| |
| public class Section implements ISection { |
| |
| private final int id; |
| |
| private final long size; |
| |
| // the address generated by the linker |
| private final IAddress linkAddress; |
| |
| private final Map<String, Object> properties; |
| |
| public Section(int id, long size, IAddress linkAddress, Map<String, Object> properties) { |
| this.id = id; |
| this.size = size; |
| this.linkAddress = linkAddress; |
| this.properties = new HashMap<String, Object>(properties); // make a |
| // copy |
| } |
| |
| public int getId() { |
| return id; |
| } |
| |
| public long getSize() { |
| return size; |
| } |
| |
| public IAddress getLinkAddress() { |
| return linkAddress; |
| } |
| |
| public Map<String, Object> getProperties() { |
| return properties; |
| } |
| |
| @Override |
| public String toString() { |
| return MessageFormat.format("[sectionID={0}, link address={1}]", id, linkAddress.toHexAddressString()); //$NON-NLS-1$); |
| } |
| |
| @Override |
| public boolean equals(Object obj) { |
| if (this == obj) |
| return true; |
| if (obj == null) |
| return false; |
| if (getClass() != obj.getClass()) |
| return false; |
| Section other = (Section) obj; |
| if (linkAddress != other.linkAddress) |
| return false; |
| if (id != other.id) |
| return false; |
| return true; |
| } |
| } |