📄 sequencerule.java
字号:
public void setTime(Time[] objArray)
{
if( objArray == null || objArray.length == 0 )
this._objTime.clear();
else
{
this._objTime = new ArrayList(Arrays.asList(objArray));
for( int i=0; i<objArray.length; i++ )
{
if( objArray[i] != null )
objArray[i]._setParent(this);
}
}
}
/**
* Gets the Time object at the specified index.
* @param index index of the returned object.
* @throws IndexOutOfBoundsException if index is out of range.
*/
public Time getTime(int index)
{
return (Time)_objTime.get(index);
}
/**
* Replaces an existing Time object at the specified index with
* a new Time object.
* @param index index of replaced object.
* @throws IndexOutOfBoundsException if index is out of range.
*/
public void setTime(int index, Time obj)
{
if( obj == null )
removeTime(index);
else
{
_objTime.set(index, obj);
obj._setParent(this);
}
}
/**
* Returns the number of Time objects in the list.
*/
public int getTimeCount()
{
return _objTime.size();
}
/**
* Returns <code>true</code> if there is no Time object in the list; otherwise,
* the method returns <code>false</code>.
*/
public boolean isNoTime()
{
return _objTime.size() == 0;
}
/**
* Returns a read-only list of Time objects.
*/
public List getTimeList()
{
return Collections.unmodifiableList(_objTime);
}
/**
* Adds a new Time 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 addTime(Time obj)
{
if( obj==null )
return false;
obj._setParent(this);
return _objTime.add(obj);
}
/**
* Adds a list of new Time 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 addTime(Collection coTime)
{
if( coTime==null )
return false;
java.util.Iterator it = coTime.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 _objTime.addAll(coTime);
}
/**
* Removes an existing Time object at the specified index.
* @return The removed object.
*/
public Time removeTime(int index)
{
return (Time)_objTime.remove(index);
}
/**
* Removes the specified Time object.
* @return <code>true</code> if this list contains the object; otherwise,
* the method returns <code>false</code>.
*/
public boolean removeTime(Time obj)
{
return _objTime.remove(obj);
}
/**
* Clears all Time objects from the list.
*/
public void clearTimeList()
{
_objTime.clear();
}
/**
* Gets ConsequentSequence object.
*/
public ConsequentSequence getConsequentSequence()
{
return _objConsequentSequence;
}
/**
* Replaces the existing ConsequentSequence object with a new object.
* If you pass in a null value to this method, the ConsequentSequence object is
* cleared and will not be marshaled.
* @param obj A new object.
*/
public void setConsequentSequence(ConsequentSequence obj)
{
this._objConsequentSequence = obj;
if( obj == null )
return;
obj._setParent(this);
}
/**
* 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 "confidence" attribute */
elem.addAttribute(confidence.marshal());
/** Marshals "support" attribute */
elem.addAttribute(support.marshal());
/** Marshals "occurrence" attribute */
elem.addAttribute(occurrence.marshal());
/** Marshals "id" attribute */
elem.addAttribute(id.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 AntecedentSequence object to an element */
if( _objAntecedentSequence != null )
elem.addContent(_objAntecedentSequence.marshal());
/** Marshals a Delimiter object to an element */
if( _objDelimiter != null )
elem.addContent(_objDelimiter.marshal());
/** Marshals a list of Time objects to elements */
Iterator it2 = _objTime.iterator();
while( it2.hasNext() )
{
Time obj = (Time)it2.next();
if( obj != null )
elem.addContent(obj.marshal());
}
/** Marshals a ConsequentSequence object to an element */
if( _objConsequentSequence != null )
elem.addContent(_objConsequentSequence.marshal());
return elem;
}
/**
* Unmarshals the specified "SequenceRule" element back to a SequenceRule object.
*/
public static SequenceRule unmarshal(com.borland.xml.toolkit.Element elem)
{
if( elem == null )
return null;
SequenceRule __objSequenceRule = new SequenceRule();
if( __objSequenceRule != null ) //found the element?
{
/** Unmarshals "numberOfSets" attribute */
__objSequenceRule.numberOfSets.setValue(elem.getAttribute("numberOfSets"));
/** Unmarshals "confidence" attribute */
__objSequenceRule.confidence.setValue(elem.getAttribute("confidence"));
/** Unmarshals "support" attribute */
__objSequenceRule.support.setValue(elem.getAttribute("support"));
/** Unmarshals "occurrence" attribute */
__objSequenceRule.occurrence.setValue(elem.getAttribute("occurrence"));
/** Unmarshals "id" attribute */
__objSequenceRule.id.setValue(elem.getAttribute("id"));
}
/** Unmarshals a list of "<<_tagName_>>" elements back to Extension objects. */
Iterator it1 = elem.getChildren(Extension._tagName).iterator();
while( it1.hasNext() )
__objSequenceRule.addExtension(Extension.unmarshal((com.borland.xml.toolkit.Element)it1.next()));
/** Unmarshals an element back to a AntecedentSequence object */
__objSequenceRule.setAntecedentSequence(AntecedentSequence.unmarshal(elem.getChild(AntecedentSequence._tagName)));
/** Unmarshals an element back to a Delimiter object */
__objSequenceRule.setDelimiter(Delimiter.unmarshal(elem.getChild(Delimiter._tagName)));
/** Unmarshals a list of "<<_tagName_>>" elements back to Time objects. */
Iterator it2 = elem.getChildren(Time._tagName).iterator();
while( it2.hasNext() )
__objSequenceRule.addTime(Time.unmarshal((com.borland.xml.toolkit.Element)it2.next()));
/** Unmarshals an element back to a ConsequentSequence object */
__objSequenceRule.setConsequentSequence(ConsequentSequence.unmarshal(elem.getChild(ConsequentSequence._tagName)));
return __objSequenceRule;
}
/**
* 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;
}
}
/** AntecedentSequence is mandatory */
if( _objAntecedentSequence != null )
errors.add(_objAntecedentSequence.validate(firstError));
else
errors.add(new com.borland.xml.toolkit.ElementError(this, AntecedentSequence.class));
if( firstError && errors.size() > 0 )
return errors;
/** Delimiter is mandatory */
if( _objDelimiter != null )
errors.add(_objDelimiter.validate(firstError));
else
errors.add(new com.borland.xml.toolkit.ElementError(this, Delimiter.class));
if( firstError && errors.size() > 0 )
return errors;
/** Time is zero or more */
Iterator it2 = _objTime.iterator();
while( it2.hasNext() )
{
Time obj = (Time)it2.next();
if( obj != null )
{
errors.add(obj.validate(firstError));
if( firstError && errors.size() > 0 )
return errors;
}
}
/** ConsequentSequence is mandatory */
if( _objConsequentSequence != null )
errors.add(_objConsequentSequence.validate(firstError));
else
errors.add(new com.borland.xml.toolkit.ElementError(this, ConsequentSequence.class));
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 _objAntecedentSequence */
if( _objAntecedentSequence != null )
children.add(_objAntecedentSequence);
/** adds _objDelimiter */
if( _objDelimiter != null )
children.add(_objDelimiter);
/** adds _objTime */
if( _objTime != null && _objTime.size() > 0 )
children.add(_objTime);
/** adds _objConsequentSequence */
if( _objConsequentSequence != null )
children.add(_objConsequentSequence);
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 + -