org.enhydra.shark.xpdl
Class XMLCollection

java.lang.Object
  extended by org.enhydra.shark.xpdl.XMLElement
      extended by org.enhydra.shark.xpdl.XMLBaseForCollectionAndComplex
          extended by org.enhydra.shark.xpdl.XMLCollection
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
Activities, ActivitySets, ActualParameters, Applications, DataFields, Deadlines, EnumerationType, ExtendedAttributes, ExternalPackages, FormalParameters, Namespaces, Participants, RecordType, Responsibles, Tools, TransitionRefs, TransitionRestrictions, Transitions, TypeDeclarations, UnionType, WorkflowProcesses

public abstract class XMLCollection
extends XMLBaseForCollectionAndComplex

Class that represents collection of elements from XML schema.

Author:
Sasa Bojanic
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.enhydra.shark.xpdl.XMLBaseForCollectionAndComplex
cachesInitialized, elementMap, elements
 
Fields inherited from class org.enhydra.shark.xpdl.XMLElement
isReadOnly, listeners, notifyListeners, notifyMainListeners, originalElementHashCode, parent, value
 
Constructor Summary
XMLCollection(XMLCollection parent, boolean isRequired)
           
XMLCollection(XMLCollection parent, java.lang.String name, boolean isRequired)
           
XMLCollection(XMLComplexChoice parent, boolean isRequired)
           
XMLCollection(XMLComplexChoice parent, java.lang.String name, boolean isRequired)
           
XMLCollection(XMLComplexElement parent, boolean isRequired)
           
XMLCollection(XMLComplexElement parent, java.lang.String name, boolean isRequired)
           
 
Method Summary
 boolean add(int no, XMLElement el)
          NOTE: Method signature changed to public.
 void add(XMLElement el)
          NOTE: Method signature changed to public.
 boolean addAll(java.util.List els)
           
protected  void checkRepositioning(org.enhydra.shark.utilities.SequencedHashMap oldEls, org.enhydra.shark.utilities.SequencedHashMap newEls)
           
 void clear()
          Clears the collection.
 void clearCaches()
           
 java.lang.Object clone()
          Used to create exact copy of the element.
 boolean containsElement(java.lang.String id)
          Returns true if element with given Id exists in collection.
abstract  XMLElement generateNewElement()
          Generates the new element that made collection.
 XMLCollectionElement getCollectionElement(java.lang.String id)
          Returns the element specified by Id attribute.
 int indexOf(XMLElement el)
           
 void initCaches()
          Initializes caches in read-only mode.
 boolean isEmpty()
          Returns true if there are no elements within collection.
 void makeAs(XMLElement el)
           
 XMLElement remove(int no)
           
 int remove(XMLElement el)
           
 boolean removeAll(java.util.List els)
           
protected  XMLElement removeElement(int no)
           
 boolean reposition(XMLElement el, int newPos)
           
 
Methods inherited from class org.enhydra.shark.xpdl.XMLBaseForCollectionAndComplex
contains, equals, get, setNotifyListeners, setNotifyMainListeners, setReadOnly, setValue, size, toElementMap, toElements
 
Methods inherited from class org.enhydra.shark.xpdl.XMLElement
addListener, createInfo, getListeners, getMainElement, getOriginalElementHashCode, getParent, isMainElement, isReadOnly, isRequired, notifyListeners, notifyMainListeners, removeListener, setParent, toName, toValue
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLCollection

public XMLCollection(XMLComplexElement parent,
                     boolean isRequired)

XMLCollection

public XMLCollection(XMLComplexElement parent,
                     java.lang.String name,
                     boolean isRequired)

XMLCollection

public XMLCollection(XMLComplexChoice parent,
                     boolean isRequired)

XMLCollection

public XMLCollection(XMLComplexChoice parent,
                     java.lang.String name,
                     boolean isRequired)

XMLCollection

public XMLCollection(XMLCollection parent,
                     boolean isRequired)

XMLCollection

public XMLCollection(XMLCollection parent,
                     java.lang.String name,
                     boolean isRequired)
Method Detail

makeAs

public void makeAs(XMLElement el)
Overrides:
makeAs in class XMLElement

initCaches

public void initCaches()
Description copied from class: XMLBaseForCollectionAndComplex
Initializes caches in read-only mode. If mode is not read-only, throws RuntimeException.

Overrides:
initCaches in class XMLBaseForCollectionAndComplex

clearCaches

public void clearCaches()
Overrides:
clearCaches in class XMLBaseForCollectionAndComplex

add

public void add(XMLElement el)
NOTE: Method signature changed to public.

Specified by:
add in class XMLBaseForCollectionAndComplex

add

public boolean add(int no,
                   XMLElement el)
NOTE: Method signature changed to public.

Specified by:
add in class XMLBaseForCollectionAndComplex

addAll

public boolean addAll(java.util.List els)

remove

public int remove(XMLElement el)

remove

public XMLElement remove(int no)

removeElement

protected XMLElement removeElement(int no)

removeAll

public boolean removeAll(java.util.List els)

reposition

public boolean reposition(XMLElement el,
                          int newPos)

isEmpty

public boolean isEmpty()
Returns true if there are no elements within collection.

Overrides:
isEmpty in class XMLElement

getCollectionElement

public XMLCollectionElement getCollectionElement(java.lang.String id)
Returns the element specified by Id attribute. Use only if this is collection of XMLCollectionElements.


containsElement

public boolean containsElement(java.lang.String id)
Returns true if element with given Id exists in collection.


indexOf

public int indexOf(XMLElement el)

clear

public void clear()
Clears the collection.


generateNewElement

public abstract XMLElement generateNewElement()
Generates the new element that made collection. Derived classes has to implement this method to create it's collection element.


checkRepositioning

protected void checkRepositioning(org.enhydra.shark.utilities.SequencedHashMap oldEls,
                                  org.enhydra.shark.utilities.SequencedHashMap newEls)

clone

public java.lang.Object clone()
Description copied from class: XMLElement
Used to create exact copy of the element.

Overrides:
clone in class XMLElement