📄 discretize.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 Discretize class represents the element "Discretize" with the content
* model defined as follows:
* <p>
* <!ELEMENT Discretize (DiscretizeBin)+><br>
*/
public class Discretize extends com.borland.xml.toolkit.XmlObject
{
/** xml tag name of this element. */
public static String _tagName = "Discretize";
/** Defines a field attribute */
public com.borland.xml.toolkit.Attribute field = new com.borland.xml.toolkit.Attribute("field", "CDATA", "REQUIRED", "");
/** Defines a list of DiscretizeBin objects. */
protected ArrayList _objDiscretizeBin = new ArrayList();
/**
* Creates an empty Discretize object
*/
public Discretize()
{
super();
}
/**
* Gets the value of "field" attribute.
*/
public String getField()
{
return field.getValue();
}
/**
* Replaces the existing attribute value with a new value.
* @param value New value.
*/
public void setField(String value_)
{
field.setValue(value_ );
}
/**
* Returns an array of DiscretizeBin objects. The length of the returned
* array is zero if the list of DiscretizeBin object is empty.
*/
public DiscretizeBin[] getDiscretizeBin()
{
return (DiscretizeBin[])_objDiscretizeBin.toArray(new DiscretizeBin[0]);
}
/**
* Replaces all existing DiscretizeBin objects with a new array of
* DiscretizeBin objects.
* @param objArray an array of DiscretizeBin objects.
*/
public void setDiscretizeBin(DiscretizeBin[] objArray)
{
if( objArray == null || objArray.length == 0 )
this._objDiscretizeBin.clear();
else
{
this._objDiscretizeBin = new ArrayList(Arrays.asList(objArray));
for( int i=0; i<objArray.length; i++ )
{
if( objArray[i] != null )
objArray[i]._setParent(this);
}
}
}
/**
* Gets the DiscretizeBin object at the specified index.
* @param index index of the returned object.
* @throws IndexOutOfBoundsException if index is out of range.
*/
public DiscretizeBin getDiscretizeBin(int index)
{
return (DiscretizeBin)_objDiscretizeBin.get(index);
}
/**
* Replaces an existing DiscretizeBin object at the specified index with
* a new DiscretizeBin object.
* @param index index of replaced object.
* @throws IndexOutOfBoundsException if index is out of range.
*/
public void setDiscretizeBin(int index, DiscretizeBin obj)
{
if( obj == null )
removeDiscretizeBin(index);
else
{
_objDiscretizeBin.set(index, obj);
obj._setParent(this);
}
}
/**
* Returns the number of DiscretizeBin objects in the list.
*/
public int getDiscretizeBinCount()
{
return _objDiscretizeBin.size();
}
/**
* Returns <code>true</code> if there is no DiscretizeBin object in the list; otherwise,
* the method returns <code>false</code>.
*/
public boolean isNoDiscretizeBin()
{
return _objDiscretizeBin.size() == 0;
}
/**
* Returns a read-only list of DiscretizeBin objects.
*/
public List getDiscretizeBinList()
{
return Collections.unmodifiableList(_objDiscretizeBin);
}
/**
* Adds a new DiscretizeBin 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 addDiscretizeBin(DiscretizeBin obj)
{
if( obj==null )
return false;
obj._setParent(this);
return _objDiscretizeBin.add(obj);
}
/**
* Adds a list of new DiscretizeBin 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 addDiscretizeBin(Collection coDiscretizeBin)
{
if( coDiscretizeBin==null )
return false;
java.util.Iterator it = coDiscretizeBin.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 _objDiscretizeBin.addAll(coDiscretizeBin);
}
/**
* Removes an existing DiscretizeBin object at the specified index.
* @return The removed object.
*/
public DiscretizeBin removeDiscretizeBin(int index)
{
return (DiscretizeBin)_objDiscretizeBin.remove(index);
}
/**
* Removes the specified DiscretizeBin object.
* @return <code>true</code> if this list contains the object; otherwise,
* the method returns <code>false</code>.
*/
public boolean removeDiscretizeBin(DiscretizeBin obj)
{
return _objDiscretizeBin.remove(obj);
}
/**
* Clears all DiscretizeBin objects from the list.
*/
public void clearDiscretizeBinList()
{
_objDiscretizeBin.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 "field" attribute */
elem.addAttribute(field.marshal());
/** Marshals a list of DiscretizeBin objects to elements */
Iterator it1 = _objDiscretizeBin.iterator();
while( it1.hasNext() )
{
DiscretizeBin obj = (DiscretizeBin)it1.next();
if( obj != null )
elem.addContent(obj.marshal());
}
return elem;
}
/**
* Unmarshals the specified "Discretize" element back to a Discretize object.
*/
public static Discretize unmarshal(com.borland.xml.toolkit.Element elem)
{
if( elem == null )
return null;
Discretize __objDiscretize = new Discretize();
if( __objDiscretize != null ) //found the element?
{
/** Unmarshals "field" attribute */
__objDiscretize.field.setValue(elem.getAttribute("field"));
}
/** Unmarshals a list of "<<_tagName_>>" elements back to DiscretizeBin objects. */
Iterator it1 = elem.getChildren(DiscretizeBin._tagName).iterator();
while( it1.hasNext() )
__objDiscretize.addDiscretizeBin(DiscretizeBin.unmarshal((com.borland.xml.toolkit.Element)it1.next()));
return __objDiscretize;
}
/**
* 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();
/** DiscretizeBin is one or more */
if( _objDiscretizeBin.size() == 0 )
{
errors.add(new com.borland.xml.toolkit.ElementError(this, DiscretizeBin.class));
if( firstError )
return errors;
}
else
{
Iterator it1 = _objDiscretizeBin.iterator();
while( it1.hasNext() )
{
DiscretizeBin obj = (DiscretizeBin)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 _objDiscretizeBin */
if( _objDiscretizeBin != null && _objDiscretizeBin.size() > 0 )
children.add(_objDiscretizeBin);
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 + -