use of lucee.runtime.type.KeyImpl in project Lucee by lucee.
the class Filter method invoke.
private static Collection invoke(PageContext pc, StringListData sld, UDF udf, ExecutorService es, List<Future<Data<Pair<Object, Object>>>> futures) throws CasterException, PageException {
Array arr = ListUtil.listToArray(sld.list, sld.delimiter, sld.includeEmptyFieldsx, sld.multiCharacterDelimiter);
Array rtn = new ArrayImpl();
Iterator it = (arr instanceof ArrayPro ? ((ArrayPro) arr).entryArrayIterator() : arr.entryIterator());
Entry e;
KeyImpl k = null;
boolean async = es != null;
Object res;
while (it.hasNext()) {
e = (Entry) it.next();
res = _inv(pc, udf, new Object[] { e.getValue(), Caster.toDoubleValue(e.getKey()), sld.list, sld.delimiter }, e.getKey(), e.getValue(), es, futures);
if (!async && Caster.toBooleanValue(res)) {
rtn.append(e.getValue());
}
}
return rtn;
}
use of lucee.runtime.type.KeyImpl in project Lucee by lucee.
the class KeyConstants method getKey.
public static Key getKey(String key) {
init();
Key k = _____keys.get(key);
if (k == null)
return new KeyImpl(key);
return k;
}
use of lucee.runtime.type.KeyImpl in project Lucee by lucee.
the class AppListenerUtil method toWSType.
public static short toWSType(String wstype) throws ApplicationException {
String str = "";
KeyImpl cs = new KeyImpl(str) {
public String getString() {
return null;
}
};
short wst = toWSType(wstype, (short) -1);
if (wst != -1)
return wst;
throw new ApplicationException("invalid webservice type [" + wstype + "], valid values are [axis1]");
// throw new ApplicationException("invalid webservice type ["+wstype+"], valid values are [axis1,jax-ws,cxf]");
}
use of lucee.runtime.type.KeyImpl in project Lucee by lucee.
the class HashMapPro method hash.
/**
* Retrieve object hash code and applies a supplemental hash function to the
* result hash, which defends against poor quality hash functions. This is
* critical because HashMap uses power-of-two length hash tables, that
* otherwise encounter collisions for hashCodes that do not differ
* in lower bits. Note: Null keys always map to hash 0, thus index 0.
*/
static final int hash(Object k) {
if (k instanceof KeyImpl)
return ((KeyImpl) k).slotForMap();
int h = 0;
/*if (useAltHashing) {
if (k instanceof String) {
return Hashing.stringHash32((String) k);
}
h = hashSeed;
}*/
h ^= k.hashCode();
// This function ensures that hashCodes that differ only by
// constant multiples at each bit position have a bounded
// number of collisions (approximately 8 at default load factor).
h ^= (h >>> 20) ^ (h >>> 12);
return h ^ (h >>> 7) ^ (h >>> 4);
}
Aggregations