📄 comparisonmeasure.java
字号:
__objComparisonMeasure.setSimpleMatching(SimpleMatching.unmarshal(elem.getChild(SimpleMatching._tagName)));
/** Unmarshals an element back to a Jaccard object */
__objComparisonMeasure.setJaccard(Jaccard.unmarshal(elem.getChild(Jaccard._tagName)));
/** Unmarshals an element back to a Tanimoto object */
__objComparisonMeasure.setTanimoto(Tanimoto.unmarshal(elem.getChild(Tanimoto._tagName)));
/** Unmarshals an element back to a BinarySimilarity object */
__objComparisonMeasure.setBinarySimilarity(BinarySimilarity.unmarshal(elem.getChild(BinarySimilarity._tagName)));
return __objComparisonMeasure;
}
/**
* Validates this object. If you pass <code>true</code> to this method, it
* checks for the first error and stops. On the other hand, if you pass
* <code>false</code> to this method, it collects all the errors by
* visiting every available elements.
* @param firstError <code>true</code> to exit this method when the first error
* is found; <code>false</code> to collect all errors.
* @return com.borland.xml.toolkit.ErrorList A list that contains one or more errors.
* @see com.borland.xml.toolkit.XmlObject#validate()
* @see com.borland.xml.toolkit.XmlObject#isValid()
* @see com.borland.xml.toolkit.ErrorList
*/
public com.borland.xml.toolkit.ErrorList validate(boolean firstError)
{
com.borland.xml.toolkit.ErrorList errors = new com.borland.xml.toolkit.ErrorList();
/** Extension is zero or more */
Iterator it1 = _objExtension.iterator();
while( it1.hasNext() )
{
Extension obj = (Extension)it1.next();
if( obj != null )
{
errors.add(obj.validate(firstError));
if( firstError && errors.size() > 0 )
return errors;
}
}
/** "or" block */
if( _objEuclidean != null || _objSquaredEuclidean != null || _objChebychev != null || _objCityBlock != null || _objMinkowski != null || _objSimpleMatching != null || _objJaccard != null || _objTanimoto != null )
{
/** "or" block */
if( _objEuclidean != null || _objSquaredEuclidean != null || _objChebychev != null || _objCityBlock != null || _objMinkowski != null || _objSimpleMatching != null || _objJaccard != null )
{
/** "or" block */
if( _objEuclidean != null || _objSquaredEuclidean != null || _objChebychev != null || _objCityBlock != null || _objMinkowski != null || _objSimpleMatching != null )
{
/** "or" block */
if( _objEuclidean != null || _objSquaredEuclidean != null || _objChebychev != null || _objCityBlock != null || _objMinkowski != null )
{
/** "or" block */
if( _objEuclidean != null || _objSquaredEuclidean != null || _objChebychev != null || _objCityBlock != null )
{
/** "or" block */
if( _objEuclidean != null || _objSquaredEuclidean != null || _objChebychev != null )
{
/** "or" block */
if( _objEuclidean != null || _objSquaredEuclidean != null )
{
/** "or" block */
if( _objEuclidean != null )
{
/** Euclidean is mandatory */
if( _objEuclidean != null )
errors.add(_objEuclidean.validate(firstError));
else
errors.add(new com.borland.xml.toolkit.ElementError(this, Euclidean.class));
if( firstError && errors.size() > 0 )
return errors;
}
if( _objSquaredEuclidean != null )
{
/** SquaredEuclidean is mandatory */
if( _objSquaredEuclidean != null )
errors.add(_objSquaredEuclidean.validate(firstError));
else
errors.add(new com.borland.xml.toolkit.ElementError(this, SquaredEuclidean.class));
if( firstError && errors.size() > 0 )
return errors;
}
if( !(_objEuclidean != null) && !(_objSquaredEuclidean != null) ) /** missing one or more elements? */
{
com.borland.xml.toolkit.OrErrorList errors1 = new com.borland.xml.toolkit.OrErrorList();
errors1.add(new com.borland.xml.toolkit.ElementError(this, Euclidean.class));
errors1.add(new com.borland.xml.toolkit.ElementError(this, SquaredEuclidean.class));
errors.add(errors1);
if( firstError && errors.size() > 0 )
return errors;
}
}
if( _objChebychev != null )
{
/** Chebychev is mandatory */
if( _objChebychev != null )
errors.add(_objChebychev.validate(firstError));
else
errors.add(new com.borland.xml.toolkit.ElementError(this, Chebychev.class));
if( firstError && errors.size() > 0 )
return errors;
}
if( !(_objEuclidean != null || _objSquaredEuclidean != null) && !(_objChebychev != null) ) /** missing one or more elements? */
{
com.borland.xml.toolkit.OrErrorList errors1 = new com.borland.xml.toolkit.OrErrorList();
errors1.add(new com.borland.xml.toolkit.ElementError(this, Euclidean.class));
errors1.add(new com.borland.xml.toolkit.ElementError(this, SquaredEuclidean.class));
errors1.add(new com.borland.xml.toolkit.ElementError(this, Chebychev.class));
errors.add(errors1);
if( firstError && errors.size() > 0 )
return errors;
}
}
if( _objCityBlock != null )
{
/** CityBlock is mandatory */
if( _objCityBlock != null )
errors.add(_objCityBlock.validate(firstError));
else
errors.add(new com.borland.xml.toolkit.ElementError(this, CityBlock.class));
if( firstError && errors.size() > 0 )
return errors;
}
if( !(_objEuclidean != null || _objSquaredEuclidean != null || _objChebychev != null) && !(_objCityBlock != null) ) /** missing one or more elements? */
{
com.borland.xml.toolkit.OrErrorList errors1 = new com.borland.xml.toolkit.OrErrorList();
errors1.add(new com.borland.xml.toolkit.ElementError(this, Euclidean.class));
errors1.add(new com.borland.xml.toolkit.ElementError(this, SquaredEuclidean.class));
errors1.add(new com.borland.xml.toolkit.ElementError(this, Chebychev.class));
errors1.add(new com.borland.xml.toolkit.ElementError(this, CityBlock.class));
errors.add(errors1);
if( firstError && errors.size() > 0 )
return errors;
}
}
if( _objMinkowski != null )
{
/** Minkowski is mandatory */
if( _objMinkowski != null )
errors.add(_objMinkowski.validate(firstError));
else
errors.add(new com.borland.xml.toolkit.ElementError(this, Minkowski.class));
if( firstError && errors.size() > 0 )
return errors;
}
if( !(_objEuclidean != null || _objSquaredEuclidean != null || _objChebychev != null || _objCityBlock != null) && !(_objMinkowski != null) ) /** missing one or more elements? */
{
com.borland.xml.toolkit.OrErrorList errors1 = new com.borland.xml.toolkit.OrErrorList();
errors1.add(new com.borland.xml.toolkit.ElementError(this, Euclidean.class));
errors1.add(new com.borland.xml.toolkit.ElementError(this, SquaredEuclidean.class));
errors1.add(new com.borland.xml.toolkit.ElementError(this, Chebychev.class));
errors1.add(new com.borland.xml.toolkit.ElementError(this, CityBlock.class));
errors1.add(new com.borland.xml.toolkit.ElementError(this, Minkowski.class));
errors.add(errors1);
if( firstError && errors.size() > 0 )
return errors;
}
}
if( _objSimpleMatching != null )
{
/** SimpleMatching is mandatory */
if( _objSimpleMatching != null )
errors.add(_objSimpleMatching.validate(firstError));
else
errors.add(new com.borland.xml.toolkit.ElementError(this, SimpleMatching.class));
if( firstError && errors.size() > 0 )
return errors;
}
if( !(_objEuclidean != null || _objSquaredEuclidean != null || _objChebychev != null || _objCityBlock != null || _objMinkowski != null) && !(_objSimpleMatching != null) ) /** missing one or more elements? */
{
com.borland.xml.toolkit.OrErrorList errors1 = new com.borland.xml.toolkit.OrErrorList();
errors1.add(new com.borland.xml.toolkit.ElementError(this, Euclidean.class));
errors1.add(new com.borland.xml.toolkit.ElementError(this, SquaredEuclidean.class));
errors1.add(new com.borland.xml.toolkit.ElementError(this, Chebychev.class));
errors1.add(new com.borland.xml.toolkit.ElementError(this, CityBlock.class));
errors1.add(new com.borland.xml.toolkit.ElementError(this, Minkowski.class));
errors1.add(new com.borland.xml.toolkit.ElementError(this, SimpleMatching.class));
errors.add(errors1);
if( firstError && errors.size() > 0 )
return errors;
}
}
if( _objJaccard != null )
{
/** Jaccard is mandatory */
if( _objJaccard != null )
errors.add(_objJaccard.validate(firstError));
else
errors.add(new com.borland.xml.toolkit.ElementError(this, Jaccard.class));
if( firstError && errors.size() > 0 )
return errors;
}
if( !(_objEuclidean != null || _objSquaredEuclidean != null || _objChebychev != null || _objCityBlock != null || _objMinkowski != null || _objSimpleMatching != null) && !(_objJaccard != null) ) /** missing one or more elements? */
{
com.borland.xml.toolkit.OrErrorList errors1 = new com.borland.xml.toolkit.OrErrorList();
errors1.add(new com.borland.xml.toolkit.ElementError(this, Euclidean.class));
errors1.add(new com.borland.xml.toolkit.ElementError(this, SquaredEuclidean.class));
errors1.add(new com.borland.xml.toolkit.ElementError(this, Chebychev.class));
errors1.add(new com.borland.xml.toolkit.ElementError(this, CityBlock.class));
errors1.add(new com.borland.xml.toolkit.ElementError(this, Minkowski.class));
errors1.add(new com.borland.xml.toolkit.ElementError(this, SimpleMatching.class));
errors1.add(new com.borland.xml.toolkit.ElementError(this, Jaccard.class));
errors.add(errors1);
if( firstError && errors.size() > 0 )
return errors;
}
}
if( _objTanimoto != null )
{
/** Tanimoto is mandatory */
if( _objTanimoto != null )
errors.add(_objTanimoto.validate(firstError));
else
errors.add(new com.borland.xml.toolkit.ElementError(this, Tanimoto.class));
if( firstError && errors.size() > 0 )
return errors;
}
if( !(_objEuclidean != null || _objSquaredEuclidean != null || _objChebychev != null || _objCityBlock != null || _objMinkowski != null || _objSimpleMatching != null || _objJaccard != null) && !(_objTanimoto != null) ) /** missing one or more elements? */
{
com.borland.xml.toolkit.OrErrorList errors1 = new com.borland.xml.toolkit.OrErrorList();
errors1.add(new com.borland.xml.toolkit.ElementError(this, Euclidean.class));
errors1.add(new com.borland.xml.toolkit.ElementError(this, SquaredEuclidean.class));
errors1.add(new com.borland.xml.toolkit.ElementError(this, Chebychev.class));
errors1.add(new com.borland.xml.toolkit.ElementError(this, CityBlock.class));
errors1.add(new com.borland.xml.toolkit.ElementError(this, Minkowski.class));
errors1.add(new com.borland.xml.toolkit.ElementError(this, SimpleMatching.class));
errors1.add(new com.borland.xml.toolkit.ElementError(this, Jaccard.class));
errors1.add(new com.borland.xml.toolkit.ElementError(this, Tanimoto.class));
errors.add(errors1);
if( firstError && errors.size() > 0 )
return errors;
}
}
if( _objBinarySimilarity != null )
{
/** BinarySimilarity is mandatory */
if( _objBinarySimilarity != null )
errors.add(_objBinarySimilarity.validate(firstError));
else
errors.add(new com.borland.xml.toolkit.ElementError(this, BinarySimilarity.class));
if( firstError && errors.size() > 0 )
return errors;
}
if( !(_objEuclidean != null || _objSquaredEuclidean != null || _objChebychev != null || _objCityBlock != null || _objMinkowski != null || _objSimpleMatching != null || _objJaccard != null || _objTanimoto != null) && !(_objBinarySimilarity != null) ) /** missing one or more elements? */
{
com.borland.xml.toolkit.OrErrorList errors1 = new com.borland.xml.toolkit.OrErrorList();
errors1.add(new com.borland.xml.toolkit.ElementError(this, Euclidean.class));
errors1.add(new com.borland.xml.toolkit.ElementError(this, SquaredEuclidean.class));
errors1.add(new com.borland.xml.toolkit.ElementError(this, Chebychev.class));
errors1.add(new com.borland.xml.toolkit.ElementError(this, CityBlock.class));
errors1.add(new com.borland.xml.toolkit.ElementError(this, Minkowski.class));
errors1.add(new com.borland.xml.toolkit.ElementError(this, SimpleMatching.class));
errors1.add(new com.borland.xml.toolkit.ElementError(this, Jaccard.class));
errors1.add(new com.borland.xml.toolkit.ElementError(this, Tanimoto.class));
errors1.add(new com.borland.xml.toolkit.ElementError(this, BinarySimilarity.class));
errors.add(errors1);
if( firstError && errors.size() > 0 )
return errors;
}
return errors.size()==0 ? null : errors;
}
/**
* Returns a list containing all child elements. Each element in the list is a subclass
* of XmlObject.
*/
public java.util.List _getChildren()
{
java.util.List children = new java.util.ArrayList();
/** adds _objExtension */
if( _objExtension != null && _objExtension.size() > 0 )
children.add(_objExtension);
/** adds _objEuclidean */
if( _objEuclidean != null )
children.add(_objEuclidean);
/** adds _objSquaredEuclidean */
if( _objSquaredEuclidean != null )
children.add(_objSquaredEuclidean);
/** adds _objChebychev */
if( _objChebychev != null )
children.add(_objChebychev);
/** adds _objCityBlock */
if( _objCityBlock != null )
children.add(_objCityBlock);
/** adds _objMinkowski */
if( _objMinkowski != null )
children.add(_objMinkowski);
/** adds _objSimpleMatching */
if( _objSimpleMatching != null )
children.add(_objSimpleMatching);
/** adds _objJaccard */
if( _objJaccard != null )
children.add(_objJaccard);
/** adds _objTanimoto */
if( _objTanimoto != null )
children.add(_objTanimoto);
/** adds _objBinarySimilarity */
if( _objBinarySimilarity != null )
children.add(_objBinarySimilarity);
return children;
}
/**
* Gets the tag name of this element.
*/
public String get_TagName()
{
return _tagName;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -