📄 basepropertiesimpl.java
字号:
// You can redistribute this software and/or modify it under the terms of// the Ozone Library License version 1 published by ozone-db.org.//// This file is// Copyright (C) 2002-@year@ by Leo Mekenkamp. All rights reserved.// $Id: BasePropertiesImpl.java,v 1.2 2003/11/20 23:18:41 per_nyfelt Exp $package org.ozoneDB.collections;import java.util.Enumeration;import java.util.Iterator;import java.util.Map;import java.util.Properties;import org.ozoneDB.OzoneObject;/** * See the overall description on {@link org.ozoneDB.collections.OzoneCollection}. * <br/>Although properties are technically not a <code>Collection</code>, * there are enough similarities to justify placing one in this package. * * @author <a href="mailto:ozone-db.orgATmekenkampD0Tcom">Leo Mekenkamp (mind the anti-sp@m)</a> */public class BasePropertiesImpl extends OzoneObject implements OzoneProperties { private static final long serialVersionUID = 1L; protected OzoneTreeMap backingMap; protected BasePropertiesImpl() { } public void load(Properties properties) { for(Iterator i = properties.keySet().iterator(); i.hasNext(); ) { String key = (String) i.next(); setProperty(key, properties.getProperty(key)); } } public String getProperty(String key) { return (String) backingMap.get(key); } public String getProperty(String key, String defaultValue) { String result = getProperty(key); return result == null ? defaultValue : result; } public Enumeration propertyNames() { return new IteratorEnumerationAdaptor(backingMap.keySet().iterator()); } public String setProperty(String key, String value) { return (String) backingMap.put(key, value); } public Properties getClientProperties() { Properties result = new Properties(); for(Iterator i = backingMap.entrySet().iterator(); i.hasNext(); ) { Map.Entry entry = (Map.Entry) i.next(); result.setProperty((String) entry.getKey(), (String) entry.getValue()); } return result; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -