📄 supportvectors.java
字号:
/**
* This file is generated by BorlandXML.
*/
package com.prudsys.pdm.Adapters.PmmlVersion20;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
/**
* The SupportVectors class represents the element "SupportVectors" with the content
* model defined as follows:
* <p>
* <!ELEMENT SupportVectors (SupportVector)+><br>
*/
public class SupportVectors extends com.borland.xml.toolkit.XmlObject
{
/** xml tag name of this element. */
public static String _tagName = "SupportVectors";
/** Defines a numberOfAttributes attribute */
public com.borland.xml.toolkit.Attribute numberOfAttributes = new com.borland.xml.toolkit.Attribute("numberOfAttributes", "CDATA", "REQUIRED", "");
/** Defines a numberOfSupportVectors attribute */
public com.borland.xml.toolkit.Attribute numberOfSupportVectors = new com.borland.xml.toolkit.Attribute("numberOfSupportVectors", "CDATA", "REQUIRED", "");
/** Defines a list of SupportVector objects. */
protected ArrayList _objSupportVector = new ArrayList();
/**
* Creates an empty SupportVectors object
*/
public SupportVectors()
{
super();
}
/**
* Gets the value of "numberOfAttributes" attribute.
*/
public String getNumberOfAttributes()
{
return numberOfAttributes.getValue();
}
/**
* Replaces the existing attribute value with a new value.
* @param value New value.
*/
public void setNumberOfAttributes(String value_)
{
numberOfAttributes.setValue(value_ );
}
/**
* Gets the value of "numberOfSupportVectors" attribute.
*/
public String getNumberOfSupportVectors()
{
return numberOfSupportVectors.getValue();
}
/**
* Replaces the existing attribute value with a new value.
* @param value New value.
*/
public void setNumberOfSupportVectors(String value_)
{
numberOfSupportVectors.setValue(value_ );
}
/**
* Returns an array of SupportVector objects. The length of the returned
* array is zero if the list of SupportVector object is empty.
*/
public SupportVector[] getSupportVector()
{
return (SupportVector[])_objSupportVector.toArray(new SupportVector[0]);
}
/**
* Replaces all existing SupportVector objects with a new array of
* SupportVector objects.
* @param objArray an array of SupportVector objects.
*/
public void setSupportVector(SupportVector[] objArray)
{
if( objArray == null || objArray.length == 0 )
this._objSupportVector.clear();
else
{
this._objSupportVector = new ArrayList(Arrays.asList(objArray));
for( int i=0; i<objArray.length; i++ )
{
if( objArray[i] != null )
objArray[i]._setParent(this);
}
}
}
/**
* Gets the SupportVector object at the specified index.
* @param index index of the returned object.
* @throws IndexOutOfBoundsException if index is out of range.
*/
public SupportVector getSupportVector(int index)
{
return (SupportVector)_objSupportVector.get(index);
}
/**
* Replaces an existing SupportVector object at the specified index with
* a new SupportVector object.
* @param index index of replaced object.
* @throws IndexOutOfBoundsException if index is out of range.
*/
public void setSupportVector(int index, SupportVector obj)
{
if( obj == null )
removeSupportVector(index);
else
{
_objSupportVector.set(index, obj);
obj._setParent(this);
}
}
/**
* Returns the number of SupportVector objects in the list.
*/
public int getSupportVectorCount()
{
return _objSupportVector.size();
}
/**
* Returns <code>true</code> if there is no SupportVector object in the list; otherwise,
* the method returns <code>false</code>.
*/
public boolean isNoSupportVector()
{
return _objSupportVector.size() == 0;
}
/**
* Returns a read-only list of SupportVector objects.
*/
public List getSupportVectorList()
{
return Collections.unmodifiableList(_objSupportVector);
}
/**
* Adds a new SupportVector 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 addSupportVector(SupportVector obj)
{
if( obj==null )
return false;
obj._setParent(this);
return _objSupportVector.add(obj);
}
/**
* Adds a list of new SupportVector 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 addSupportVector(Collection coSupportVector)
{
if( coSupportVector==null )
return false;
java.util.Iterator it = coSupportVector.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 _objSupportVector.addAll(coSupportVector);
}
/**
* Removes an existing SupportVector object at the specified index.
* @return The removed object.
*/
public SupportVector removeSupportVector(int index)
{
return (SupportVector)_objSupportVector.remove(index);
}
/**
* Removes the specified SupportVector object.
* @return <code>true</code> if this list contains the object; otherwise,
* the method returns <code>false</code>.
*/
public boolean removeSupportVector(SupportVector obj)
{
return _objSupportVector.remove(obj);
}
/**
* Clears all SupportVector objects from the list.
*/
public void clearSupportVectorList()
{
_objSupportVector.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 "numberOfAttributes" attribute */
elem.addAttribute(numberOfAttributes.marshal());
/** Marshals "numberOfSupportVectors" attribute */
elem.addAttribute(numberOfSupportVectors.marshal());
/** Marshals a list of SupportVector objects to elements */
Iterator it1 = _objSupportVector.iterator();
while( it1.hasNext() )
{
SupportVector obj = (SupportVector)it1.next();
if( obj != null )
elem.addContent(obj.marshal());
}
return elem;
}
/**
* Unmarshals the specified "SupportVectors" element back to a SupportVectors object.
*/
public static SupportVectors unmarshal(com.borland.xml.toolkit.Element elem)
{
if( elem == null )
return null;
SupportVectors __objSupportVectors = new SupportVectors();
if( __objSupportVectors != null ) //found the element?
{
/** Unmarshals "numberOfAttributes" attribute */
__objSupportVectors.numberOfAttributes.setValue(elem.getAttribute("numberOfAttributes"));
/** Unmarshals "numberOfSupportVectors" attribute */
__objSupportVectors.numberOfSupportVectors.setValue(elem.getAttribute("numberOfSupportVectors"));
}
/** Unmarshals a list of "<<_tagName_>>" elements back to SupportVector objects. */
Iterator it1 = elem.getChildren(SupportVector._tagName).iterator();
while( it1.hasNext() )
__objSupportVectors.addSupportVector(SupportVector.unmarshal((com.borland.xml.toolkit.Element)it1.next()));
return __objSupportVectors;
}
/**
* 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();
/** SupportVector is one or more */
if( _objSupportVector.size() == 0 )
{
errors.add(new com.borland.xml.toolkit.ElementError(this, SupportVector.class));
if( firstError )
return errors;
}
else
{
Iterator it1 = _objSupportVector.iterator();
while( it1.hasNext() )
{
SupportVector obj = (SupportVector)it1.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 _objSupportVector */
if( _objSupportVector != null && _objSupportVector.size() > 0 )
children.add(_objSupportVector);
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 + -