Package anvil.java.util

Examples of anvil.java.util.Holder


        value = Conversions.URLDecode(token.substring(i+1));
      } else {
        key = Conversions.URLDecode(token);
        value = "";
      }
      Holder holder = _attributes.getHolder(key);
      if (holder != null) {
        Object obj = holder.getValue();
        if (obj instanceof String[]) {
          String[] arr = (String[])obj;
          int length = arr.length;
          String[] newarr = new String[length+1];
          System.arraycopy(arr, 0, newarr, 0, length);
          newarr[length] = value;
          holder.setValue(newarr);
        } else {
          holder.setValue(new String[] { obj.toString(), value } );
        }
      } else {
        _attributes.put(key, value);
      }
    }
View Full Code Here


  }


  public boolean deleteAttribute(Context context, String attribute)
  {
    Holder holder = getHolder(Any.create(attribute));
    if (holder != null) {
      holder.remove();
      return true;
    } else {
      return false;
    }
  }
View Full Code Here

  public boolean deleteReference(Context context, Any index)
  {
    if (index.isRange() || index.isTuple()) {
      deleteRef(index);
    }   
    Holder holder = getHolder(index);
    if (holder != null) {
      holder.remove();
      return true;
    } else {
      return false;
   
View Full Code Here

  public Any m_next(Any key)
  {
    if (key.isMap()) {
      key = key.toMap().getLeft();
    }
    Holder holder = nextOf(key);
    return (holder != null) ? toMap(holder) : UNDEFINED;
  }
View Full Code Here

  public Any m_nextKey(Any key)
  {
    if (key.isMap()) {
      key = key.toMap().getLeft();
    }
    Holder holder = nextOf(key);
    return (holder != null) ? (Any)holder.getKey() : UNDEFINED;
  }
View Full Code Here

  public Any m_nextValue(Any key)
  {
    if (key.isMap()) {
      key = key.toMap().getLeft();
    }
    Holder holder = nextOf(key);
    return (holder != null) ? (Any)holder.getValue() : UNDEFINED;
  }
View Full Code Here

  public Any m_previous(Any key)
  {
    if (key.isMap()) {
      key = key.toMap().getLeft();
    }
    Holder holder = previousOf(key);
    return (holder != null) ? toMap(holder) : UNDEFINED;
  }
View Full Code Here

  public Any m_previousKey(Any key)
  {
    if (key.isMap()) {
      key = key.toMap().getLeft();
    }
    Holder holder = previousOf(key);
    return (holder != null) ? (Any)holder.getKey() : UNDEFINED;
  }
View Full Code Here

  public Any m_previousValue(Any key)
  {
    if (key.isMap()) {
      key = key.toMap().getLeft();
    }
    Holder holder = previousOf(key);
    return (holder != null) ? (Any)holder.getValue() : UNDEFINED;
  }
View Full Code Here

TOP

Related Classes of anvil.java.util.Holder

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.