Package r.data

Examples of r.data.RAny$Attributes$PartialEntry


  /**
   * Support for CustomControlCreator
   * @param interact
   */
  public ControlInteractAttributes(final InteractType interact) {
    this.attributes = new Attributes(interact.getAttributes());
  }
View Full Code Here


      final Nifty nifty,
      final Element element,
      final EffectEventId effectEventId,
      final Attributes effectsTypeAttibutes,
      final LinkedList < Object > controllers) {
    Attributes effectAttributes = new Attributes(getAttributes());
    effectAttributes.merge(effectsTypeAttibutes);

    Attributes attributes = effectAttributes;

    RegisterEffectType registerEffectType = getRegisteredEffectType(nifty, attributes);
    if (registerEffectType == null) {
      return;
    }

    Class < ? > effectClass = registerEffectType.getEffectClass();
    if (effectClass == null) {
      return;
    }

    EffectProperties effectProperties = new EffectProperties(attributes.createProperties());
    applyEffectValues(effectProperties);

    Effect effect = createEffect(nifty, effectEventId, attributes);
    effect.init(
        element,
View Full Code Here

    parent = parentParam;
    controlAttributes = controlAttributesParam;
  }

  public Attributes resolve(final Attributes attributes) {
    Attributes result = new Attributes(attributes);

    for (Entry entry : getParameterSet(attributes)) {
      String key = (String) entry.getKey();
      String value = (String) entry.getValue();
      if (controlAttributes.isSet(key)) {
        result.set(value, controlAttributes.get(key));
      }
    }

    Attributes res = parent.resolve(result);
    for (Entry entry : getParameterSet(attributes)) {
      String value = (String) entry.getValue();
      result.set(value, "");
    }
    return res;
View Full Code Here

  public RegisterEffectType() {
  }

  public RegisterEffectType(final String nameParam, final String classParam) {
    Attributes attributes = new Attributes();
    attributes.set("name", nameParam);
    attributes.set("class", classParam);
    try {
      initFromAttributes(attributes);
    } catch (Exception e) {
      logger.warning(
          "unable to register effect [" + nameParam + "] for class [" + classParam + "] (" + e.getMessage() + "]");
View Full Code Here

                    return update(lhs, rhs);
                } catch (SpecializationException e) {
                    Selector failedSelector = (Selector) e.getResult();
                    for (int i = 0; i < selectorVals.length; ++i) {
                        if (selectorVals[i] == failedSelector) {
                            RAny index = failedSelector.getIndex();
                            SelectorNode newSelector = Selector.createSelectorNode(ast, subset, index, selectorExprs[i].child, false, failedSelector.getTransition());
                            selectorExprs[i].replace(newSelector);
                            assert Utils.check(selectorExprs[i] == newSelector);
                            selectorVals[i] = newSelector.executeSelector(index);
                            if (DEBUG_UP) Utils.debug("Selector " + i + " changed...");
View Full Code Here

         * This is the general case that performs all the computations at once. In the slowpath makes a copy of the lhs
         * and determines if a copy of the rhs should be made and then runs the update of arrays for non-const rhs
         * values (this will work for the const values too, of course).
         */
        @Override public RAny execute(Frame frame, RAny lhsParam, RAny rhsParam) {
            RAny lhs = lhsParam;
            RAny rhs = rhsParam;
            if (Configuration.ARRAY_UPDATE_DIRECT_SPECIALIZATIONS_IN_GENERALIZED && !lhs.isShared()) {
                if (Configuration.ARRAY_UPDATE_DIRECT_SPECIALIZATIONS_IN_GENERALIZED_CACHE) {
                    // check if we have a reason to believe that we are specialized, and if so, just use the simple checks to
                    // confirm and proceed
                    switch (updateType) {
View Full Code Here

         * This is the general case that performs all the computations at once. In the slowpath makes a copy of the lhs
         * and determines if a copy of the rhs should be made and then runs the update of arrays for non-const rhs
         * values (this will work for the const values too, of course).
         */
        @Override public RAny execute(Frame frame, RAny lhsParam, RAny rhsParam) {
            RAny lhs = lhsParam;
            RAny rhs = rhsParam;

            // 1. copy the rhs
            ValueCopy.Impl rhsImpl = CopyRhs.determineCopyImplementation(lhs, rhs, selectorExprs.length, ast); // can be null if no copy is needed
            if (rhsImpl != null) {
                try {
                    rhs = rhsImpl.copy(rhs);
                } catch (SpecializationException e) {
                    assert (false) : "unreachable";
                }
            }

            // now the type of lhs <= type of rhs
            ValueCopy.Impl lhsImpl = CopyLhs.determineCopyImplementation(lhs, rhs, selectorExprs.length, !subset, ast); // will not be null, will be an upcast or a duplicate
            if (!(lhsImpl instanceof ValueCopy.Duplicate) || lhs.isShared() || rhs.dependsOn(lhs)) {
                try {
                    lhs = lhsImpl.copy(lhs);
                } catch (SpecializationException e) {
                    assert (false) : "unreachable";
                }
View Full Code Here

            /**
             * Copies the lhs and then executes the child of the copy lhs node (the assignment itself). Upon failure of
             * the copy code rewrites the whole tree to the general case.
             */
            @Override public RAny execute(Frame frame, RAny lhsParam, RAny rhs) {
                RAny lhs = lhsParam;
                try {
                    // we need to check the LHS type to make sure that we still need to copy the RHS
                    // otherwise we may up-cast it to a wrong type (note the original rhs would be lost)
                    rhsTypeGuard.check(rhs);

View Full Code Here

                this.impl = copy;
            }

            @Override public RAny execute(Frame frame, RAny lhsParam, RAny rhs) {
                RAny lhs;
                if (lhsParam.isShared() || rhs.dependsOn(lhsParam)) {
                    try {
                        lhs = impl.copy(lhsParam);
                    } catch (SpecializationException e) {
                        if (DEBUG_UP) Utils.debug("CopyLhs.SpecializedDuplicate -> Generalized");
View Full Code Here

            /**
             * Executes the child on the typecasted rhs and given lhs. If the typecast fails rewrites itself to the
             * generalized case.
             */
            @Override public RAny execute(Frame frame, RAny lhs, RAny rhsParam) {
                RAny rhs;
                try {
                    // we need to check the LHS type to make sure that we still need to copy the RHS
                    // otherwise we may up-cast it to a wrong type (note the original rhs would be lost)
                    lhsTypeGuard.check(lhs);

View Full Code Here

TOP

Related Classes of r.data.RAny$Attributes$PartialEntry

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.