📄 sequence.java
字号:
/**
* Replaces all existing SetReference objects with a new array of
* SetReference objects.
* @param objArray an array of SetReference objects.
*/
public void setSetReference1(SetReference[] objArray)
{
if( objArray == null || objArray.length == 0 )
this._objSetReference1.clear();
else
{
this._objSetReference1 = new ArrayList(Arrays.asList(objArray));
for( int i=0; i<objArray.length; i++ )
{
if( objArray[i] != null )
objArray[i]._setParent(this);
}
}
}
/**
* Gets the SetReference object at the specified index.
* @param index index of the returned object.
* @throws IndexOutOfBoundsException if index is out of range.
*/
public SetReference getSetReference1(int index)
{
return (SetReference)_objSetReference1.get(index);
}
/**
* Replaces an existing SetReference object at the specified index with
* a new SetReference object.
* @param index index of replaced object.
* @throws IndexOutOfBoundsException if index is out of range.
*/
public void setSetReference1(int index, SetReference obj)
{
if( obj == null )
removeSetReference1(index);
else
{
_objSetReference1.set(index, obj);
obj._setParent(this);
}
}
/**
* Returns the number of SetReference objects in the list.
*/
public int getSetReferenceCount1()
{
return _objSetReference1.size();
}
/**
* Returns <code>true</code> if there is no SetReference object in the list; otherwise,
* the method returns <code>false</code>.
*/
public boolean isNoSetReference1()
{
return _objSetReference1.size() == 0;
}
/**
* Returns a read-only list of SetReference objects.
*/
public List getSetReferenceList1()
{
return Collections.unmodifiableList(_objSetReference1);
}
/**
* Adds a new SetReference 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 addSetReference1(SetReference obj)
{
if( obj==null )
return false;
obj._setParent(this);
return _objSetReference1.add(obj);
}
/**
* Adds a list of new SetReference 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 addSetReference1(Collection coSetReference)
{
if( coSetReference==null )
return false;
java.util.Iterator it = coSetReference.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 _objSetReference1.addAll(coSetReference);
}
/**
* Removes an existing SetReference object at the specified index.
* @return The removed object.
*/
public SetReference removeSetReference1(int index)
{
return (SetReference)_objSetReference1.remove(index);
}
/**
* Removes the specified SetReference object.
* @return <code>true</code> if this list contains the object; otherwise,
* the method returns <code>false</code>.
*/
public boolean removeSetReference1(SetReference obj)
{
return _objSetReference1.remove(obj);
}
/**
* Clears all SetReference objects from the list.
*/
public void clearSetReferenceList1()
{
_objSetReference1.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 "numberOfSets" attribute */
elem.addAttribute(numberOfSets.marshal());
/** Marshals "support" attribute */
elem.addAttribute(support.marshal());
/** Marshals "occurrence" attribute */
elem.addAttribute(occurrence.marshal());
/** Marshals "id" attribute */
elem.addAttribute(id.marshal());
/** Marshals a SetReference object to an element */
if( _objSetReference != null )
elem.addContent(_objSetReference.marshal());
/** Marshals a list of Delimiter objects to elements */
Iterator it1 = _objDelimiter.iterator();
while( it1.hasNext() )
{
Delimiter obj = (Delimiter)it1.next();
if( obj != null )
elem.addContent(obj.marshal());
}
/** Marshals a list of SetReference objects to elements */
Iterator it2 = _objSetReference1.iterator();
while( it2.hasNext() )
{
SetReference obj = (SetReference)it2.next();
if( obj != null )
elem.addContent(obj.marshal());
}
return elem;
}
/**
* Unmarshals the specified "Sequence" element back to a Sequence object.
*/
public static Sequence unmarshal(com.borland.xml.toolkit.Element elem)
{
if( elem == null )
return null;
Sequence __objSequence = new Sequence();
if( __objSequence != null ) //found the element?
{
/** Unmarshals "numberOfSets" attribute */
__objSequence.numberOfSets.setValue(elem.getAttribute("numberOfSets"));
/** Unmarshals "support" attribute */
__objSequence.support.setValue(elem.getAttribute("support"));
/** Unmarshals "occurrence" attribute */
__objSequence.occurrence.setValue(elem.getAttribute("occurrence"));
/** Unmarshals "id" attribute */
__objSequence.id.setValue(elem.getAttribute("id"));
}
/** Unmarshals an element back to a SetReference object */
__objSequence.setSetReference(SetReference.unmarshal(elem.getChild(SetReference._tagName)));
/** Unmarshals a list of "<<_tagName_>>" elements back to Delimiter objects. */
Iterator it1 = elem.getChildren(Delimiter._tagName).iterator();
while( it1.hasNext() )
__objSequence.addDelimiter(Delimiter.unmarshal((com.borland.xml.toolkit.Element)it1.next()));
/** Unmarshals a list of "<<_tagName_>>" elements back to SetReference objects. */
Iterator it2 = elem.getChildren(SetReference._tagName).iterator();
while( it2.hasNext() )
__objSequence.addSetReference1(SetReference.unmarshal((com.borland.xml.toolkit.Element)it2.next()));
return __objSequence;
}
/**
* 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();
/** SetReference is mandatory */
if( _objSetReference != null )
errors.add(_objSetReference.validate(firstError));
else
errors.add(new com.borland.xml.toolkit.ElementError(this, SetReference.class));
if( firstError && errors.size() > 0 )
return errors;
/** Delimiter is zero or more */
Iterator it1 = _objDelimiter.iterator();
while( it1.hasNext() )
{
Delimiter obj = (Delimiter)it1.next();
if( obj != null )
{
errors.add(obj.validate(firstError));
if( firstError && errors.size() > 0 )
return errors;
}
}
/** SetReference is zero or more */
Iterator it2 = _objSetReference1.iterator();
while( it2.hasNext() )
{
SetReference obj = (SetReference)it2.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 _objSetReference */
if( _objSetReference != null )
children.add(_objSetReference);
/** adds _objDelimiter */
if( _objDelimiter != null && _objDelimiter.size() > 0 )
children.add(_objDelimiter);
/** adds _objSetReference1 */
if( _objSetReference1 != null && _objSetReference1.size() > 0 )
children.add(_objSetReference1);
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 + -