~ Methods **************************************************************************************************************************************
768032
@Override
    public List<Metric> transform(QueryContext context, List<Metric> metrics) {
        if (metrics == null) {
            throw new MissingDataException("The metrics list cannot be null or empty while performing arithmetic transformations.");
        }
        if (metrics.isEmpty()) {
            return metrics;
        }

        Metric result = new Metric(getResultScopeName(), RESULT_METRIC_NAME);
        Map<Long, Double> resultDatapoints = new HashMap<>();
        Iterator<Entry<Long, Double>> it = metrics.get(0).getDatapoints().entrySet().iterator();

        while (it.hasNext()) {
            Entry<Long, Double> entry = it.next();
            List<Double> operands = null;

            try {
                operands = getOperands(entry.getKey(), metrics);
            } catch (MissingDataException mde) {
                continue;
            }
            resultDatapoints.put(entry.getKey(), performOperation(operands));
        }
        result.setDatapoints(resultDatapoints);
        MetricDistiller.setCommonAttributes(metrics, result);

        List<Metric> resultMetrics = new ArrayList<>();

        Collections.addAll(resultMetrics, result);
        return resultMetrics;
    }
1240372
public function execute()
    {
        if ($this->email && $this->locale) {
            $this->create();
        } elseif ($this->referenceId) {
            $this->delete();
        }
    }
889251
@Override
    public void onCreate() {
        super.onCreate();

        graphMonitor = new Graph.Monitor() {
            @Override
            public void onInject(Object target) {
                if (controller != null && target == MvcService.this) {
                    controller.view = MvcService.this;
                }
            }

            @Override
            public void onRelease(Object target) {

            }
        };
        Mvc.graph().registerMonitor(graphMonitor);

        if (getControllerClass() != null) {
            try {
                controller = Mvc.graph().reference(getControllerClass(), null);
            } catch (CircularDependenciesException e) {
                e.printStackTrace();
            } catch (ProvideException e) {
                e.printStackTrace();
            } catch (ProviderMissingException e) {
                throw new IllegalStateException("Unable to inject "
                        + getControllerClass().getName() + ".\n" + e.getMessage(), e);
            }
        }

        Mvc.graph().inject(this);

        eventRegister = new EventRegister(this);
        eventRegister.registerEventBuses();
    }
832681
public function init()
    {
        if (true === $this->beforeInit()) {
            HasPropertiesEvent::on(HasProperties::class, HasProperties::EVENT_AFTER_SAVE, [$this, 'onSave']);
            HasPropertiesEvent::on(HasProperties::class, HasProperties::EVENT_AFTER_UPDATE, [$this, 'onUpdate']);
            HasPropertiesEvent::on(HasProperties::class, HasProperties::EVENT_BEFORE_DELETE, [$this, 'onDelete']);
        }
    }
4503
public function process()
    {
        parent::process();

        $areas_flydown = $this->getCompositeWidget('areas_flydown');
        $regions_flydown = $this->getCompositeWidget('regions_flydown');

        if ($areas_flydown->value === 'UTC') {
            $this->value = 'UTC';
        } elseif (
            $areas_flydown->value === null ||
            $regions_flydown->value === null
        ) {
            $this->value = null;
        } else {
            $this->value =
                $areas_flydown->value . '/' . $regions_flydown->value;
        }

        if (!$this->required && $this->value === null && $this->isSensitive()) {
            return;
        } elseif ($this->value === null) {
            $message = Swat::_('The %s field is required.');
            $this->addMessage(new SwatMessage($message, 'error'));
        } else {
            try {
                $time_zone = new DateTimeZone($this->value);
            } catch (Exception $e) {
                $message = Swat::_('The %s field is an invalid time zone.');
                $this->addMessage(new SwatMessage($message, 'error'));
            }
        }
    }
1283404
@Override
    public void setMethod(String method) throws UnsupportedMethodException {
        MethodValues val = MethodValues.match(method, 0, method.length());
        if (null == val) {
            throw new UnsupportedMethodException("Illegal method " + method);
        }
        setMethod(val);
    }
1310192
public void start() {
    if (outputThread != null) {
      outputThread.start();
    }
    if (errorThread != null) {
      errorThread.start();
    }
    if (inputThread != null) {
      inputThread.start();
    }
  }
380919
public void close() {
		if (defaultContext != null) {
			defaultContext.close();
			defaultContext = null;
		}
		if (defaultContextControl != null) {
			defaultContextControl.close();
			defaultContextControl = null;
		}
	}
1325327
@Override
    public void blueprintEvent(BlueprintEvent event) {
        states.put(event.getBundle().getBundleId(), BlueprintState.values()[event.getType()]);
    }
432798
public function init()
    {
        if ($this->autoStart && !$this->isStarted()) {
            $this->start();

            $this->autoStart = false;
        }
    }
1209001
public function process()
    {
        $this->debug->groupCollapsed(__METHOD__);
        if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] == 'HEAD') {
            $this->debug->warn('head request - do not process form');
            $this->debug->groupEnd();
            return;
        }
        $this->alerts->clear();
        $this->configNormalize();
        $this->initPersist();
        $this->status['submitted'] = $this->persist->get('submitted');
        $this->storeValues();
        $this->redirectPost();
        $this->setCurrentFields();
        // $this->debug->log('persist', $this->persist);
        // $this->debug->log('status', $this->status);
        $headers = $this->getHeaders();
        $this->processSubmit();
        $this->trashCollect();
        if (!\headers_sent()) {
            $this->debug->log('headers', $headers);
            foreach ($headers as $header) {
                \header($header);
            }
        }
        $this->persist->set('submitted', false);
        $this->debug->groupEnd();
        return;
    }
802378
public function initialize()
    {
        parent::initialize();
        $this->tag->reset();
        $this->tag->setTagName($this->tagName);
        if ($this->hasArgument('additionalAttributes') && is_array($this->arguments['additionalAttributes'])) {
            $this->tag->addAttributes($this->arguments['additionalAttributes']);
        }

        if ($this->hasArgument('data') && is_array($this->arguments['data'])) {
            foreach ($this->arguments['data'] as $dataAttributeKey => $dataAttributeValue) {
                $this->tag->addAttribute('data-' . $dataAttributeKey, $dataAttributeValue);
            }
        }

        if (isset(self::$tagAttributes[get_class($this)])) {
            foreach (self::$tagAttributes[get_class($this)] as $attributeName) {
                if ($this->hasArgument($attributeName) && $this->arguments[$attributeName] !== '' && $this->arguments[$attributeName] !== false) {
                    if ($this->arguments[$attributeName] === true) {
                        $this->tag->addAttribute($attributeName, '');
                        continue;
                    }
                    $this->tag->addAttribute($attributeName, $this->arguments[$attributeName]);
                }
            }
        }
    }
362130
public function process()
    {
        parent::process();

        $data = &$this->getForm()->getFormData();

        if (!isset($data[$this->id])) {
            return;
        }

        $this->value = $data[$this->id];
        $length = $this->getValueLength();

        if ($length === 0) {
            $this->value = null;
        }

        if ($this->required && $length === 0) {
            $message = $this->getValidationMessage('required');
            $this->addMessage($message);
        } elseif ($this->maxlength !== null && $length > $this->maxlength) {
            $message = $this->getValidationMessage('too-long');
            $message->primary_content = sprintf(
                $message->primary_content,
                $this->maxlength
            );

            $this->addMessage($message);
        }
    }
777268
@Override
	public void actionPerformed(ActionEvent event) {
		JMenuItem item = (JMenuItem) event.getSource();

		if (item.isSelected()) {
			showColumn(item.getText());
		} else {
			hideColumn(item.getText());
		}
	}
174521
@Override
    public <P> void pojoDaoCreated(PojoDaoFactoryEvent<P> event) {
        Schema schema = new Schema();
        event.getPojoBinding().describe(schema.createTable(event.getTableName()), schema);
        List<SchemaStatement> statements = schema.items().map(SchemaItem::createStatement).collect(Collectors.toList());
        if (LOGGER.isInfoEnabled()) {
            LOGGER.info("Creating table(s) to support \"{}\":\n\t{}\n", event.getPojoBinding().getPojoType().getSimpleName(), statements.stream().map(SchemaStatement::getQueryString).collect(Collectors.joining("\n\t")));
        }
        statements.forEach(session::execute);
    }
585670
private void initBeforeList() {
        final List<ProcessAdvice> beforeRequestProcessAdvices = new ArrayList<>();

        final Method invokeHolder = getInvokeHolder();
        final Class<?> processorClass = invokeHolder.getDeclaringClass();

        // 1. process class advice
        if (null != processorClass && processorClass.isAnnotationPresent(Before.class)) {
            final Class<? extends ProcessAdvice>[] bcs = processorClass.getAnnotation(Before.class).value();
            for (int i = 0; i < bcs.length; i++) {
                final Class<? extends ProcessAdvice> bc = bcs[i];
                final ProcessAdvice beforeRequestProcessAdvice = BeanManager.getInstance().getReference(bc);
                beforeRequestProcessAdvices.add(beforeRequestProcessAdvice);
            }
        }
        // 2. process method advice
        if (invokeHolder.isAnnotationPresent(Before.class)) {
            final Class<? extends ProcessAdvice>[] bcs = invokeHolder.getAnnotation(Before.class).value();
            for (int i = 0; i < bcs.length; i++) {
                final Class<? extends ProcessAdvice> bc = bcs[i];
                final ProcessAdvice beforeRequestProcessAdvice = BeanManager.getInstance().getReference(bc);
                beforeRequestProcessAdvices.add(beforeRequestProcessAdvice);
            }
        }

        this.beforeRequestProcessAdvices = beforeRequestProcessAdvices;
    }
221435
public function process()
    {
        parent::process();

        foreach ($this->children as $child) {
            if ($child !== null && !$child->isProcessed()) {
                $child->process();
            }
        }
    }