Package railo.runtime.type.Collection

Examples of railo.runtime.type.Collection.Key


public class HashMapNullSensitive extends HashMap<Key, Object> {


  public Object gib(Key key) throws PageException {
    int hash = hash(key.hashCode());
    Key k;
    for (Entry<Key,Object> e = table[indexFor(hash, table.length)]; e != null; e = e.next) {
      if (e.hash == hash && ((k = e.key) == key || key.equalsIgnoreCase(k)))
        return e.value;
      }
      throw invalidKey(this,key);
View Full Code Here


  }
 

  public Object gib(Key key, Object defaultValue) {
    int hash = hash(key.hashCode());
    Key k;
    for (Entry<Key,Object> e = table[indexFor(hash, table.length)]; e != null; e = e.next) {
      if (e.hash == hash && ((k = e.key) == key || key.equalsIgnoreCase(k)))
        return e.value;
      }
      return defaultValue;
View Full Code Here

 
  public Object haeb(Key key, Object value) {
    int hash = hash(key.hashCode());
    int i = indexFor(hash, table.length);
    for (Entry<Key,Object> e = table[i]; e != null; e = e.next) {
      Key k;
      if (e.hash == hash && ((k = e.key) == key || key.equalsIgnoreCase(k))) {
        Object oldValue = e.value;
        e.value = value;
        e.recordAccess(this);
        return oldValue;
View Full Code Here

 
  public static ExpressionException invalidKey(Map map,Key key) {

    StringBuilder sb=new StringBuilder();
    Iterator<Key> it = map.keySet().iterator();
    Key k;

    while(it.hasNext()){
      k = it.next();
      if( k.equals( key ) )
        return new ExpressionException( "the value from key [" + key.getString() + "] is NULL, which is the same as not existing in CFML" );
      if(sb.length()>0)sb.append(',');
      sb.append(k.getString());
    }

    return new ExpressionException( "key [" + key.getString() + "] doesn't exist (existing keys:" + sb.toString() + ")" );
  }
View Full Code Here

  }

  @Override
  public Object callWithNamedValues(PageContext pageContext, Struct values,boolean doIncludePath) throws PageException {
    UDFUtil.argumentCollection(values,getFunctionArguments());
    Key key = arguments[0].getName();
    Object value = values.get(key,null);
    if(value==null){
      Key[] keys = CollectionUtil.keys(values);
      if(keys.length==1) {
        value=values.get(keys[0]);
View Full Code Here

    return (keys.length)>pos;
  }

  @Override
  public Entry<Key, Object> next() {
    Key key = keys[pos++];
    if(key==null) return null;
    return new EntryImpl(coll,key);
  }
View Full Code Here

    return keys.hasNext();
  }

  @Override
  public Entry<Key, Object> next() {
    Key key = KeyImpl.toKey(keys.next(),null);
    return new EntryImpl(objs,key);
  }
View Full Code Here

    return (keys.length)>pos;
  }

  @Override
  public Object next() {
    Key key = keys[pos++];
    if(key==null) return null;
    return coll.get(key,null);
  }
View Full Code Here

    return (arr.length)>pos;
  }

  @Override
  public Collection.Key next() {
    Key key = arr[pos++];
    if(key==null) return null;
    return key;
  }
View Full Code Here

 
  public static boolean equals(Collection left, Collection right) {
    if(left.size()!=right.size()) return false;
    Iterator<Key> it = left.keyIterator();
    Key k;
    Object l,r;
    while(it.hasNext()){
      k=it.next();
      r=right.get(k,NULL);
      if(r==NULL) return false;
View Full Code Here

TOP

Related Classes of railo.runtime.type.Collection.Key

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.