src/main/java/com/mxgraph/view/mxMultiplicity.java
public String check(mxGraph graph, Object edge, Object source,
			Object target, int sourceOut, int targetIn)
	{
		StringBuffer error = new StringBuffer();

		if ((this.source && checkTerminal(graph, source, edge))
				|| (!this.source && checkTerminal(graph, target, edge)))
		{
			if (!isUnlimited())
			{
				int m = getMaxValue();

				if (m == 0 || (this.source && sourceOut >= m)
						|| (!this.source && targetIn >= m))
				{
					error.append(countError + "\n");
				}
			}

			if (validNeighbors != null && typeError != null && validNeighbors.size() > 0)
			{
				boolean isValid = checkNeighbors(graph, edge, source, target);

				if (!isValid)
				{
					error.append(typeError + "\n");
				}
			}
		}

		return (error.length() > 0) ? error.toString() : null;
	}
/**
	 * Function: check
	 * 
	 * Checks the multiplicity for the given arguments and returns the error
	 * for the given connection or null if the multiplicity does not apply.
	 *  
	 * Parameters:
	 * 
	 * graph - Reference to the enclosing graph instance.
	 * edge - Cell that represents the edge to validate.
	 * source - Cell that represents the source terminal.
	 * target - Cell that represents the target terminal.
	 * sourceOut - Number of outgoing edges from the source terminal.
	 * targetIn - Number of incoming edges for the target terminal.
	 */
check

Checks the multiplicity for the given arguments and returns the error
for the given connection or null if the multiplicity does not apply.



Reference to the enclosing graph instance.
edge - Cell that represents the edge to validate.
source - Cell that represents the source terminal.
target - Cell that represents the target terminal.
sourceOut - Number of outgoing edges from the source terminal.
targetIn - Number of incoming edges for the target terminal.
check Checks the multiplicity for the given arguments and returns the error for the given connection or null if the multiplicity does not apply . Reference to the enclosing graph instance . edge - Cell that represents the edge to validate . source - Cell that represents the source terminal . target - Cell that represents the target terminal . sourceOut - Number of outgoing edges from the source terminal . targetIn - Number of incoming edges for the target terminal .
public String check(mxGraph graph, Object edge, Object source,
			Object target, int sourceOut, int targetIn)
	{
		StringBuffer error = new StringBuffer();
		if ((this.source && checkTerminal(graph, source, edge))
				|| (!this.source && checkTerminal(graph, target, edge)))
		{
			if (!isUnlimited())
			{
				int m = getMaxValue();
				if (m == 0 || (this.source && sourceOut >= m)
						|| (!this.source && targetIn >= m))
				{
					error.append(countError + "\n");
				}
			}
			if (validNeighbors != null && typeError != null && validNeighbors.size() > 0)
			{
				boolean isValid = checkNeighbors(graph, edge, source, target);
				if (!isValid)
				{
					error.append(typeError + "\n");
				}
			}
		}
		return (error.length() > 0) ? error.toString() : null;
	}
public String check ( mxGraph graph , Object edge , Object source , Object target , int sourceOut , int targetIn ) { StringBuffer error = new StringBuffer ( ) ; if ( ( this . source && checkTerminal ( graph , source , edge ) ) || ( ! this . source && checkTerminal ( graph , target , edge ) ) ) { if ( ! isUnlimited ( ) ) { int m = getMaxValue ( ) ; if ( m == 0 || ( this . source && sourceOut >= m ) || ( ! this . source && targetIn >= m ) ) { error . append ( countError + "\n" ) ; } } if ( validNeighbors != null && typeError != null && validNeighbors . size ( ) > 0 ) { boolean isValid = checkNeighbors ( graph , edge , source , target ) ; if ( ! isValid ) { error . append ( typeError + "\n" ) ; } } } return ( error . length ( ) > 0 ) ? error . toString ( ) : null ; }
Function: check
Function : check