📄 neuralnetwork.java
字号:
* @return <code>true</code> if the list was changed; otherwise, the method
* returns <code>false</code>.
*/
public boolean addNeuralLayer(Collection coNeuralLayer)
{
if( coNeuralLayer==null )
return false;
java.util.Iterator it = coNeuralLayer.iterator();
while( it.hasNext() )
{
Object obj = it.next();
if( obj != null && obj instanceof com.borland.xml.toolkit.XmlObject )
((com.borland.xml.toolkit.XmlObject)obj)._setParent(this);
}
return _objNeuralLayer.addAll(coNeuralLayer);
}
/**
* Removes an existing NeuralLayer object at the specified index.
* @return The removed object.
*/
public NeuralLayer removeNeuralLayer(int index)
{
return (NeuralLayer)_objNeuralLayer.remove(index);
}
/**
* Removes the specified NeuralLayer object.
* @return <code>true</code> if this list contains the object; otherwise,
* the method returns <code>false</code>.
*/
public boolean removeNeuralLayer(NeuralLayer obj)
{
return _objNeuralLayer.remove(obj);
}
/**
* Clears all NeuralLayer objects from the list.
*/
public void clearNeuralLayerList()
{
_objNeuralLayer.clear();
}
/**
* Gets NeuralOutputs object.
*/
public NeuralOutputs getNeuralOutputs()
{
return _objNeuralOutputs;
}
/**
* Replaces the existing NeuralOutputs object with a new object.
* If you pass in a null value to this method, the NeuralOutputs object is
* cleared and will not be marshaled.
* @param obj A new object.
*/
public void setNeuralOutputs(NeuralOutputs obj)
{
this._objNeuralOutputs = obj;
if( obj == null )
return;
obj._setParent(this);
}
/**
* Returns an array of Extension objects. The length of the returned
* array is zero if the list of Extension object is empty.
*/
public Extension[] getExtension1()
{
return (Extension[])_objExtension1.toArray(new Extension[0]);
}
/**
* Replaces all existing Extension objects with a new array of
* Extension objects.
* @param objArray an array of Extension objects.
*/
public void setExtension1(Extension[] objArray)
{
if( objArray == null || objArray.length == 0 )
this._objExtension1.clear();
else
{
this._objExtension1 = new ArrayList(Arrays.asList(objArray));
for( int i=0; i<objArray.length; i++ )
{
if( objArray[i] != null )
objArray[i]._setParent(this);
}
}
}
/**
* Gets the Extension object at the specified index.
* @param index index of the returned object.
* @throws IndexOutOfBoundsException if index is out of range.
*/
public Extension getExtension1(int index)
{
return (Extension)_objExtension1.get(index);
}
/**
* Replaces an existing Extension object at the specified index with
* a new Extension object.
* @param index index of replaced object.
* @throws IndexOutOfBoundsException if index is out of range.
*/
public void setExtension1(int index, Extension obj)
{
if( obj == null )
removeExtension1(index);
else
{
_objExtension1.set(index, obj);
obj._setParent(this);
}
}
/**
* Returns the number of Extension objects in the list.
*/
public int getExtensionCount1()
{
return _objExtension1.size();
}
/**
* Returns <code>true</code> if there is no Extension object in the list; otherwise,
* the method returns <code>false</code>.
*/
public boolean isNoExtension1()
{
return _objExtension1.size() == 0;
}
/**
* Returns a read-only list of Extension objects.
*/
public List getExtensionList1()
{
return Collections.unmodifiableList(_objExtension1);
}
/**
* Adds a new Extension object at the end of the list.
* @return <code>true</code> if the new object is added to the list; otherwise,
* the method returns <code>false</code>.
*/
public boolean addExtension1(Extension obj)
{
if( obj==null )
return false;
obj._setParent(this);
return _objExtension1.add(obj);
}
/**
* Adds a list of new Extension objects at the end of the list.
* @return <code>true</code> if the list was changed; otherwise, the method
* returns <code>false</code>.
*/
public boolean addExtension1(Collection coExtension)
{
if( coExtension==null )
return false;
java.util.Iterator it = coExtension.iterator();
while( it.hasNext() )
{
Object obj = it.next();
if( obj != null && obj instanceof com.borland.xml.toolkit.XmlObject )
((com.borland.xml.toolkit.XmlObject)obj)._setParent(this);
}
return _objExtension1.addAll(coExtension);
}
/**
* Removes an existing Extension object at the specified index.
* @return The removed object.
*/
public Extension removeExtension1(int index)
{
return (Extension)_objExtension1.remove(index);
}
/**
* Removes the specified Extension object.
* @return <code>true</code> if this list contains the object; otherwise,
* the method returns <code>false</code>.
*/
public boolean removeExtension1(Extension obj)
{
return _objExtension1.remove(obj);
}
/**
* Clears all Extension objects from the list.
*/
public void clearExtensionList1()
{
_objExtension1.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 "threshold" attribute */
elem.addAttribute(threshold.marshal());
/** Marshals "modelName" attribute */
elem.addAttribute(modelName.marshal());
/** Marshals "algorithmName" attribute */
elem.addAttribute(algorithmName.marshal());
/** Marshals "functionName" attribute */
elem.addAttribute(functionName.marshal());
/** Marshals "activationFunction" attribute */
elem.addAttribute(activationFunction.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 MiningSchema object to an element */
if( _objMiningSchema != null )
elem.addContent(_objMiningSchema.marshal());
/** Marshals a ModelStats object to an element */
if( _objModelStats != null )
elem.addContent(_objModelStats.marshal());
/** Marshals a NeuralInputs object to an element */
if( _objNeuralInputs != null )
elem.addContent(_objNeuralInputs.marshal());
/** Marshals a list of NeuralLayer objects to elements */
Iterator it2 = _objNeuralLayer.iterator();
while( it2.hasNext() )
{
NeuralLayer obj = (NeuralLayer)it2.next();
if( obj != null )
elem.addContent(obj.marshal());
}
/** Marshals a NeuralOutputs object to an element */
if( _objNeuralOutputs != null )
elem.addContent(_objNeuralOutputs.marshal());
/** Marshals a list of Extension objects to elements */
Iterator it3 = _objExtension1.iterator();
while( it3.hasNext() )
{
Extension obj = (Extension)it3.next();
if( obj != null )
elem.addContent(obj.marshal());
}
return elem;
}
/**
* Unmarshals the specified "NeuralNetwork" element back to a NeuralNetwork object.
*/
public static NeuralNetwork unmarshal(com.borland.xml.toolkit.Element elem)
{
if( elem == null )
return null;
NeuralNetwork __objNeuralNetwork = new NeuralNetwork();
if( __objNeuralNetwork != null ) //found the element?
{
/** Unmarshals "threshold" attribute */
__objNeuralNetwork.threshold.setValue(elem.getAttribute("threshold"));
/** Unmarshals "modelName" attribute */
__objNeuralNetwork.modelName.setValue(elem.getAttribute("modelName"));
/** Unmarshals "algorithmName" attribute */
__objNeuralNetwork.algorithmName.setValue(elem.getAttribute("algorithmName"));
/** Unmarshals "functionName" attribute */
__objNeuralNetwork.functionName.setValue(elem.getAttribute("functionName"));
/** Unmarshals "activationFunction" attribute */
__objNeuralNetwork.activationFunction.setValue(elem.getAttribute("activationFunction"));
}
/** Unmarshals a list of "<<_tagName_>>" elements back to Extension objects. */
Iterator it1 = elem.getChildren(Extension._tagName).iterator();
while( it1.hasNext() )
__objNeuralNetwork.addExtension(Extension.unmarshal((com.borland.xml.toolkit.Element)it1.next()));
/** Unmarshals an element back to a MiningSchema object */
__objNeuralNetwork.setMiningSchema(MiningSchema.unmarshal(elem.getChild(MiningSchema._tagName)));
/** Unmarshals an element back to a ModelStats object */
__objNeuralNetwork.setModelStats(ModelStats.unmarshal(elem.getChild(ModelStats._tagName)));
/** Unmarshals an element back to a NeuralInputs object */
__objNeuralNetwork.setNeuralInputs(NeuralInputs.unmarshal(elem.getChild(NeuralInputs._tagName)));
/** Unmarshals a list of "<<_tagName_>>" elements back to NeuralLayer objects. */
Iterator it2 = elem.getChildren(NeuralLayer._tagName).iterator();
while( it2.hasNext() )
__objNeuralNetwork.addNeuralLayer(NeuralLayer.unmarshal((com.borland.xml.toolkit.Element)it2.next()));
/** Unmarshals an element back to a NeuralOutputs object */
__objNeuralNetwork.setNeuralOutputs(NeuralOutputs.unmarshal(elem.getChild(NeuralOutputs._tagName)));
/** Unmarshals a list of "<<_tagName_>>" elements back to Extension objects. */
Iterator it3 = elem.getChildren(Extension._tagName).iterator();
while( it3.hasNext() )
__objNeuralNetwork.addExtension1(Extension.unmarshal((com.borland.xml.toolkit.Element)it3.next()));
return __objNeuralNetwork;
}
/**
* 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;
}
}
/** MiningSchema is mandatory */
if( _objMiningSchema != null )
errors.add(_objMiningSchema.validate(firstError));
else
errors.add(new com.borland.xml.toolkit.ElementError(this, MiningSchema.class));
if( firstError && errors.size() > 0 )
return errors;
/** ModelStats is optional */
if( _objModelStats != null )
{
errors.add(_objModelStats.validate(firstError));
if( firstError && errors.size() > 0 )
return errors;
}
/** NeuralInputs is mandatory */
if( _objNeuralInputs != null )
errors.add(_objNeuralInputs.validate(firstError));
else
errors.add(new com.borland.xml.toolkit.ElementError(this, NeuralInputs.class));
if( firstError && errors.size() > 0 )
return errors;
/** NeuralLayer is one or more */
if( _objNeuralLayer.size() == 0 )
{
errors.add(new com.borland.xml.toolkit.ElementError(this, NeuralLayer.class));
if( firstError )
return errors;
}
else
{
Iterator it2 = _objNeuralLayer.iterator();
while( it2.hasNext() )
{
NeuralLayer obj = (NeuralLayer)it2.next();
if( obj != null )
{
errors.add(obj.validate(firstError));
if( firstError && errors.size() > 0 )
return errors;
}
}
}
/** NeuralOutputs is optional */
if( _objNeuralOutputs != null )
{
errors.add(_objNeuralOutputs.validate(firstError));
if( firstError && errors.size() > 0 )
return errors;
}
/** Extension is zero or more */
Iterator it3 = _objExtension1.iterator();
while( it3.hasNext() )
{
Extension obj = (Extension)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 _objMiningSchema */
if( _objMiningSchema != null )
children.add(_objMiningSchema);
/** adds _objModelStats */
if( _objModelStats != null )
children.add(_objModelStats);
/** adds _objNeuralInputs */
if( _objNeuralInputs != null )
children.add(_objNeuralInputs);
/** adds _objNeuralLayer */
if( _objNeuralLayer != null && _objNeuralLayer.size() > 0 )
children.add(_objNeuralLayer);
/** adds _objNeuralOutputs */
if( _objNeuralOutputs != null )
children.add(_objNeuralOutputs);
/** adds _objExtension1 */
if( _objExtension1 != null && _objExtension1.size() > 0 )
children.add(_objExtension1);
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 + -