use of com.webobjects.foundation.NSDictionary in project wonder-slim by undur.
the class WOStatsPage method _initIvars.
public void _initIvars() {
statsDict = WOApplication.application().statistics();
pagesDict = (NSDictionary) statsDict.objectForKey("Pages");
directActionsDict = (NSDictionary) statsDict.objectForKey("DirectActions");
detailsDict = (NSDictionary) statsDict.objectForKey("Details");
transactions = (NSDictionary) statsDict.objectForKey("Transactions");
memoryDict = (NSDictionary) statsDict.objectForKey("Memory");
sessionsDict = ((NSDictionary) statsDict.objectForKey("Sessions")).mutableClone();
sessionMemoryDict = new NSDictionary((Map) sessionsDict.removeObjectForKey("Avg. Memory Per Session"), true);
sessionStats = (NSArray) sessionsDict.removeObjectForKey("Last Session's Statistics");
maxSessionsDate = (NSTimestamp) sessionsDict.removeObjectForKey("Peak Active Sessions Date");
maxPageCount = 0;
maxActionCount = 0;
maxPageCount = _maxServedForDictionary(pagesDict);
maxActionCount = _maxServedForDictionary(directActionsDict);
}
use of com.webobjects.foundation.NSDictionary in project wonder-slim by undur.
the class ERXProperties method propertiesFromArgv.
/**
* Sets and returns properties object with the values from the given command line arguments string array.
*
* @param argv string array typically provided by the command line arguments
* @return properties object with the values from the argv
*/
public static Properties propertiesFromArgv(String[] argv) {
ERXProperties._Properties properties = new ERXProperties._Properties();
NSDictionary argvDict = NSProperties.valuesFromArgv(argv);
Enumeration e = argvDict.allKeys().objectEnumerator();
while (e.hasMoreElements()) {
Object key = e.nextElement();
properties.put(key, argvDict.objectForKey(key));
}
return properties;
}
use of com.webobjects.foundation.NSDictionary in project wonder-slim by undur.
the class ERXStatisticsStore method statistics.
@Override
public NSDictionary statistics() {
NSDictionary stats = super.statistics();
NSMutableDictionary fixed = stats.mutableClone();
for (Enumeration enumerator = stats.keyEnumerator(); enumerator.hasMoreElements(); ) {
Object key = enumerator.nextElement();
Object value = stats.objectForKey(key);
fixed.setObjectForKey(fix(value), key);
}
stats = fixed;
return stats;
}
use of com.webobjects.foundation.NSDictionary in project wonder-slim by undur.
the class ERXUtilities method valueFromPlistBundleWithKey.
/**
* Returns the key in an plist of the given framework.
*
* @param bundle bundle name
* @param plist plist Filename
* @param key key
* @return Result
*/
private static String valueFromPlistBundleWithKey(NSBundle bundle, String plist, String key) {
if (bundle == null)
return "";
String dictString = new String(bundle.bytesForResourcePath(plist));
NSDictionary versionDictionary = NSPropertyListSerialization.dictionaryForString(dictString);
String versionString = (String) versionDictionary.objectForKey(key);
// trim() removes the line ending char
return versionString == null ? "" : versionString.trim();
}
Aggregations