/*[deutsch]
<p>Ermittelt, ob das angegebene Element eine Basiseinheit hat. </p>

@param   element     chronological element (optional)
@return  {@code true} if given element has a base unit else {@code false}
@see     #getBaseUnit(ChronoElement)
490620
public boolean hasBaseUnit(ChronoElement<?> element) {

        if (element == null) {
            return false;
        }

        boolean found = this.baseUnits.containsKey(element);

        if (
            !found
            && (element instanceof BasicElement)
        ) {
            ChronoElement<?> parent = ((BasicElement) element).getParent();
            found = ((parent != null) && this.baseUnits.containsKey(parent));
        }

        return found;

    }
330091
public boolean contains(int element) {
    return element >= 0 && this.imported(element) && this.pos.get(Math.abs(element)) >= 0;
  }
1225972
protected boolean isElementLate(StreamRecord<IN> element){
		return (windowAssigner.isEventTime()) &&
			(element.getTimestamp() + allowedLateness <= internalTimerService.currentWatermark());
	}
683162
public static boolean isMainElement( Element element ){
        switch( element.getType() ) {
            case START:
            case END:
            case VALUE:
            case CALL:
            case CALL_ASYNC:
            case HUMAN_TASK:
            case WAIT_SIGNAL:
            case WAIT_TIMER:
            case WAIT_UNTIL_DATE:
            case CREATE_INSTANCE:
            case WHILE_DO_BEGIN:
            case WHILE_DO_END:
            case DO_WHILE_BEGIN:
            case DO_WHILE_END:
            case IF:
            case ELSE_IF:
            case ELSE:
            case END_IF:
            case SPLIT:
            case BRANCH:
            case JOIN_FIRST:
            case JOIN_ALL:
            case ESCALATE:
            case VALIDATE_INPUT_VARIABLE:
                return true;
            default :
                return false;
        }
    }
1306419
private boolean addInstanceOfElement(HeaderElement root, HeaderElement elem) {
        // first add to the overall sequence list
        if (null == this.hdrSequence) {
            this.hdrSequence = elem;
            this.lastHdrInSequence = elem;
        } else {
            // find the end of the list and append this new element
            this.lastHdrInSequence.nextSequence = elem;
            elem.prevSequence = this.lastHdrInSequence;
            this.lastHdrInSequence = elem;
        }
        if (null == root) {
            return true;
        }
        HeaderElement prev = root;
        while (null != prev.nextInstance) {
            prev = prev.nextInstance;
        }
        prev.nextInstance = elem;
        return false;
    }
258180
public static boolean hasBorder(Element element) {

        String borderStyle = CmsDomUtil.getCurrentStyle(element, Style.borderStyle);
        if ((borderStyle == null) || borderStyle.equals(StyleValue.none.toString()) || (borderStyle.length() == 0)) {
            return false;
        }
        return true;

    }
674586
@Override
  public boolean isTimeIncluded (final long timeInMillis)
  {
    if (getBaseCalendar () != null && !getBaseCalendar ().isTimeIncluded (timeInMillis))
    {
      return false;
    }

    return !m_aCronExpression.isSatisfiedBy (new Date (timeInMillis));
  }
190475
private static <U, T extends TimePoint<U, T>> T add(
        TimePoint<U, T> context,
        ChronoElement<?> element,
        boolean forward
    ) {

        U unit = context.getChronology().getBaseUnit(element);

        if (forward) {
            return context.plus(1, unit);
        } else {
            return context.minus(1, unit);
        }

    }
1188201
function (element) {
		if (element) {
			if (element.metaClassName() === 'org.kevoree.ComponentInstance') {
				// if parent is this node platform: it's ok
				return (element.eContainer().name === this.node.getName());

			} else if (element.metaClassName() === 'org.kevoree.Channel') {
				// if this channel has bindings with components hosted in this node platform: it's ok
				var bindings = element.bindings.iterator();
				while (bindings.hasNext()) {
					var binding = bindings.next();
					if (binding.port && binding.port.eContainer()) {
						if (this.isRelatedToPlatform(binding.port.eContainer())) {
							return true;
						}
					}
				}

			} else if (element.metaClassName() === 'org.kevoree.Group') {
				return element.subNodes.array.some(function (node) {
					return this.isRelatedToPlatform(node);
				}.bind(this));

			} else if (element.metaClassName() === 'org.kevoree.ContainerNode') {
				return ((element.name === this.node.getName()) || (element.host && element.host.name === this.node.getName()));

			} else if (element.metaClassName() === 'org.kevoree.MBinding') {
				if (element.port && element.port.eContainer()) {
					if (this.isRelatedToPlatform(element.port.eContainer())) {
						return true;
					}
				}
				if (element.hub) {
					return this.isRelatedToPlatform(element.hub);
				}

			} else if (element.metaClassName() === 'org.kevoree.Value') {
				if (element.eContainer().metaClassName() === 'org.kevoree.FragmentDictionary') {
					return (element.eContainer().name === this.node.getName());
				} else {
					return this.isRelatedToPlatform(element.eContainer().eContainer());
				}

			} else if (element.metaClassName() === 'org.kevoree.Port') {
				return this.isRelatedToPlatform(element.eContainer());
			}
		}
		return false;
	}
140303
public boolean containsElement(Element element) {
        String deepName = getDeepName(element);
        return elementNameSortOrderMap.containsKey(deepName);
    }
635087
public static Stream<Element> ancestors(final Element element) {
        final Stream.Builder<Element> builder = Stream.builder();
        for (Node current = element.getParentNode(); current != null; current = current.getParentNode()) {
            if (current.getNodeType() == Node.ELEMENT_NODE) {
                builder.accept((Element) current);
            }
        }
        return builder.build();
    }
1172819
static XsdElement getBaseFromElement(XsdElement element) {
        XsdExtension extension = getXsdExtension(element);

        return extension != null ? extension.getBase(): null;
    }
1316369
protected boolean hasStereotype(Element element, Class<? extends Annotation> stereotype) {
        return hasStereotype(element, stereotype.getName());
    }
1336872
@Override
    public boolean contains(U unit) {

        for (Item<?> item : this.getTotalLength()) {
            if (item.getUnit().equals(unit)) {
                return (item.getAmount() > 0);
            }
        }

        return false;

    }
779930
protected boolean semanticallyEquivalent(BioPAXElement element)
	{
		if (!(element instanceof sequenceInterval))
		{
			return false;
		}

		final sequenceInterval that = (sequenceInterval) element;
		return
			(SEQUENCE_INTERVAL_BEGIN != null ?
				SEQUENCE_INTERVAL_BEGIN.isEquivalent(
					that.getSEQUENCE_INTERVAL_BEGIN()) :
				that.getSEQUENCE_INTERVAL_BEGIN() == null)
				&&
				(SEQUENCE_INTERVAL_END != null ?
					SEQUENCE_INTERVAL_END.isEquivalent(
						that.getSEQUENCE_INTERVAL_END()) :
					that.getSEQUENCE_INTERVAL_END() != null);
	}
751050
public static boolean failSafeRemoveFromParent(Element element) {
        return failSafeRemove(element != null ? element.parentNode : null, element);
    }
181035
public static boolean contains(Iterator<?> iterator, Object element) {
        if (iterator != null) {
            while (iterator.hasNext()) {
                Object candidate = iterator.next();
                if (ObjectUtils.nullSafeEquals(candidate, element)) {
                    return true;
                }
            }
        }
        return false;
    }