/******************************************************************************* * Copyright (c) 2016 QNX Software Systems 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 *******************************************************************************/ package org.eclipse.cdt.arduino.core.internal; import java.util.Collections; import java.util.Enumeration; import java.util.HashSet; import java.util.LinkedHashSet; import java.util.Properties; public class LinkedProperties extends Properties { private static final long serialVersionUID = 1L; private final HashSet<Object> keys = new LinkedHashSet<Object>(); public Iterable<Object> orderedKeys() { return Collections.list(keys()); } public Enumeration<Object> keys() { return Collections.<Object>enumeration(keys); } public Object put(Object key, Object value) { keys.add(key); return super.put(key, value); } }