📄 node.java
字号:
/**
* Clears all Node objects from the list.
*/
public void clearNodeList()
{
_objNode.clear();
}
/**
* Marshals this object to an element.
*/
public com.borland.xml.toolkit.Element marshal()
{
com.borland.xml.toolkit.Element elem = new com.borland.xml.toolkit.Element(get_TagName());
/** Marshals "recordCount" attribute */
elem.addAttribute(recordCount.marshal());
/** Marshals "score" attribute */
elem.addAttribute(score.marshal());
/** Marshals a list of Extension objects to elements */
Iterator it1 = _objExtension.iterator();
while( it1.hasNext() )
{
Extension obj = (Extension)it1.next();
if( obj != null )
elem.addContent(obj.marshal());
}
/** Marshals a SimplePredicate object to an element */
if( _objSimplePredicate != null )
elem.addContent(_objSimplePredicate.marshal());
/** Marshals a CompoundPredicate object to an element */
if( _objCompoundPredicate != null )
elem.addContent(_objCompoundPredicate.marshal());
/** Marshals a SimpleSetPredicate object to an element */
if( _objSimpleSetPredicate != null )
elem.addContent(_objSimpleSetPredicate.marshal());
/** Marshals a True object to an element */
if( _objTrue != null )
elem.addContent(_objTrue.marshal());
/** Marshals a False object to an element */
if( _objFalse != null )
elem.addContent(_objFalse.marshal());
/** Marshals a SupportVectorMachineModel object to an element */
if( _objSupportVectorMachineModel != null )
elem.addContent(_objSupportVectorMachineModel.marshal());
/** Marshals a SparseGridModel object to an element */
if( _objSparseGridModel != null )
elem.addContent(_objSparseGridModel.marshal());
/** Marshals a list of ScoreDistribution objects to elements */
Iterator it2 = _objScoreDistribution.iterator();
while( it2.hasNext() )
{
ScoreDistribution obj = (ScoreDistribution)it2.next();
if( obj != null )
elem.addContent(obj.marshal());
}
/** Marshals a list of Node objects to elements */
Iterator it3 = _objNode.iterator();
while( it3.hasNext() )
{
Node obj = (Node)it3.next();
if( obj != null )
elem.addContent(obj.marshal());
}
return elem;
}
/**
* Unmarshals the specified "Node" element back to a Node object.
*/
public static Node unmarshal(com.borland.xml.toolkit.Element elem)
{
if( elem == null )
return null;
Node __objNode = new Node();
if( __objNode != null ) //found the element?
{
/** Unmarshals "recordCount" attribute */
__objNode.recordCount.setValue(elem.getAttribute("recordCount"));
/** Unmarshals "score" attribute */
__objNode.score.setValue(elem.getAttribute("score"));
}
/** Unmarshals a list of "<<_tagName_>>" elements back to Extension objects. */
Iterator it1 = elem.getChildren(Extension._tagName).iterator();
while( it1.hasNext() )
__objNode.addExtension(Extension.unmarshal((com.borland.xml.toolkit.Element)it1.next()));
/** Unmarshals an element back to a SimplePredicate object */
__objNode.setSimplePredicate(SimplePredicate.unmarshal(elem.getChild(SimplePredicate._tagName)));
/** Unmarshals an element back to a CompoundPredicate object */
__objNode.setCompoundPredicate(CompoundPredicate.unmarshal(elem.getChild(CompoundPredicate._tagName)));
/** Unmarshals an element back to a SimpleSetPredicate object */
__objNode.setSimpleSetPredicate(SimpleSetPredicate.unmarshal(elem.getChild(SimpleSetPredicate._tagName)));
/** Unmarshals an element back to a True object */
__objNode.setTrue(True.unmarshal(elem.getChild(True._tagName)));
/** Unmarshals an element back to a False object */
__objNode.setFalse(False.unmarshal(elem.getChild(False._tagName)));
/** Unmarshals an element back to a SupportVectorMachineModel object */
__objNode.setSupportVectorMachineModel(SupportVectorMachineModel.unmarshal(elem.getChild(SupportVectorMachineModel._tagName)));
/** Unmarshals an element back to a SparseGridModel object */
__objNode.setSparseGridModel(SparseGridModel.unmarshal(elem.getChild(SparseGridModel._tagName)));
/** Unmarshals a list of "<<_tagName_>>" elements back to ScoreDistribution objects. */
Iterator it2 = elem.getChildren(ScoreDistribution._tagName).iterator();
while( it2.hasNext() )
__objNode.addScoreDistribution(ScoreDistribution.unmarshal((com.borland.xml.toolkit.Element)it2.next()));
/** Unmarshals a list of "<<_tagName_>>" elements back to Node objects. */
Iterator it3 = elem.getChildren(Node._tagName).iterator();
while( it3.hasNext() )
__objNode.addNode(Node.unmarshal((com.borland.xml.toolkit.Element)it3.next()));
return __objNode;
}
/**
* 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( _objSimplePredicate != null || _objCompoundPredicate != null || _objSimpleSetPredicate != null || _objTrue != null )
{
/** "or" block */
if( _objSimplePredicate != null || _objCompoundPredicate != null || _objSimpleSetPredicate != null )
{
/** "or" block */
if( _objSimplePredicate != null || _objCompoundPredicate != null )
{
/** "or" block */
if( _objSimplePredicate != null )
{
/** SimplePredicate is mandatory */
if( _objSimplePredicate != null )
errors.add(_objSimplePredicate.validate(firstError));
else
errors.add(new com.borland.xml.toolkit.ElementError(this, SimplePredicate.class));
if( firstError && errors.size() > 0 )
return errors;
}
if( _objCompoundPredicate != null )
{
/** CompoundPredicate is mandatory */
if( _objCompoundPredicate != null )
errors.add(_objCompoundPredicate.validate(firstError));
else
errors.add(new com.borland.xml.toolkit.ElementError(this, CompoundPredicate.class));
if( firstError && errors.size() > 0 )
return errors;
}
if( !(_objSimplePredicate != null) && !(_objCompoundPredicate != 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, SimplePredicate.class));
errors1.add(new com.borland.xml.toolkit.ElementError(this, CompoundPredicate.class));
errors.add(errors1);
if( firstError && errors.size() > 0 )
return errors;
}
}
if( _objSimpleSetPredicate != null )
{
/** SimpleSetPredicate is mandatory */
if( _objSimpleSetPredicate != null )
errors.add(_objSimpleSetPredicate.validate(firstError));
else
errors.add(new com.borland.xml.toolkit.ElementError(this, SimpleSetPredicate.class));
if( firstError && errors.size() > 0 )
return errors;
}
if( !(_objSimplePredicate != null || _objCompoundPredicate != null) && !(_objSimpleSetPredicate != 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, SimplePredicate.class));
errors1.add(new com.borland.xml.toolkit.ElementError(this, CompoundPredicate.class));
errors1.add(new com.borland.xml.toolkit.ElementError(this, SimpleSetPredicate.class));
errors.add(errors1);
if( firstError && errors.size() > 0 )
return errors;
}
}
if( _objTrue != null )
{
/** True is mandatory */
if( _objTrue != null )
errors.add(_objTrue.validate(firstError));
else
errors.add(new com.borland.xml.toolkit.ElementError(this, True.class));
if( firstError && errors.size() > 0 )
return errors;
}
if( !(_objSimplePredicate != null || _objCompoundPredicate != null || _objSimpleSetPredicate != null) && !(_objTrue != 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, SimplePredicate.class));
errors1.add(new com.borland.xml.toolkit.ElementError(this, CompoundPredicate.class));
errors1.add(new com.borland.xml.toolkit.ElementError(this, SimpleSetPredicate.class));
errors1.add(new com.borland.xml.toolkit.ElementError(this, True.class));
errors.add(errors1);
if( firstError && errors.size() > 0 )
return errors;
}
}
if( _objFalse != null )
{
/** False is mandatory */
if( _objFalse != null )
errors.add(_objFalse.validate(firstError));
else
errors.add(new com.borland.xml.toolkit.ElementError(this, False.class));
if( firstError && errors.size() > 0 )
return errors;
}
if( !(_objSimplePredicate != null || _objCompoundPredicate != null || _objSimpleSetPredicate != null || _objTrue != null) && !(_objFalse != 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, SimplePredicate.class));
errors1.add(new com.borland.xml.toolkit.ElementError(this, CompoundPredicate.class));
errors1.add(new com.borland.xml.toolkit.ElementError(this, SimpleSetPredicate.class));
errors1.add(new com.borland.xml.toolkit.ElementError(this, True.class));
errors1.add(new com.borland.xml.toolkit.ElementError(this, False.class));
errors.add(errors1);
if( firstError && errors.size() > 0 )
return errors;
}
/** SupportVectorMachineModel is optional */
if( _objSupportVectorMachineModel != null )
{
errors.add(_objSupportVectorMachineModel.validate(firstError));
if( firstError && errors.size() > 0 )
return errors;
}
/** SparseGridModel is optional */
if( _objSparseGridModel != null )
{
errors.add(_objSparseGridModel.validate(firstError));
if( firstError && errors.size() > 0 )
return errors;
}
/** ScoreDistribution is zero or more */
Iterator it2 = _objScoreDistribution.iterator();
while( it2.hasNext() )
{
ScoreDistribution obj = (ScoreDistribution)it2.next();
if( obj != null )
{
errors.add(obj.validate(firstError));
if( firstError && errors.size() > 0 )
return errors;
}
}
/** Node is zero or more */
Iterator it3 = _objNode.iterator();
while( it3.hasNext() )
{
Node obj = (Node)it3.next();
if( obj != null )
{
errors.add(obj.validate(firstError));
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 _objSimplePredicate */
if( _objSimplePredicate != null )
children.add(_objSimplePredicate);
/** adds _objCompoundPredicate */
if( _objCompoundPredicate != null )
children.add(_objCompoundPredicate);
/** adds _objSimpleSetPredicate */
if( _objSimpleSetPredicate != null )
children.add(_objSimpleSetPredicate);
/** adds _objTrue */
if( _objTrue != null )
children.add(_objTrue);
/** adds _objFalse */
if( _objFalse != null )
children.add(_objFalse);
/** adds _objSupportVectorMachineModel */
if( _objSupportVectorMachineModel != null )
children.add(_objSupportVectorMachineModel);
/** adds _objSparseGridModel */
if( _objSparseGridModel != null )
children.add(_objSparseGridModel);
/** adds _objScoreDistribution */
if( _objScoreDistribution != null && _objScoreDistribution.size() > 0 )
children.add(_objScoreDistribution);
/** adds _objNode */
if( _objNode != null && _objNode.size() > 0 )
children.add(_objNode);
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 + -