| ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
A generic container for the SCI model objects.
The objects() method gives an enumeration of all SciObjects in this container:
SciObjectEnumeration objectsEnum=someContainer.objects();
objects method in SciClass(extends this interface) returns
This interface has the method paste for pasting the SciObjects, inherited by all of
its derivatives. If you want to paste a copy of an existing SciObject, or SciObject
itself, you can obtain it using
SciObject's methods copy or
cut respectively:
SciFunction copiedFunction = (SciFunction)someSciFunction.copy(); //getting a copy of a function
someSciClass.paste(copiedFunction, null, false); //pasting it into SciClass
If you want to paste a new object, you should first create this object using SciFactory
or SciGenericFactory:
import com.togethersoft.openapi.sci.SciModelAccess;
...
SciAttribute newAttribute = SciModelAccess.getModel().getFactory(SciLanguage.JAVA).newAttribute(); //creating a new attribute with default name and type
newAttribute.setName("myLastName"); //setting the name
newAttribute.getType().setText("String"); //setting the type
someSciClass.paste(newAttribute, null, false); //pasting it into someSciClass
| Method Summary | |
boolean | canPaste(SciObject object, SciObject anchor, boolean before)Returns true if the object can be pasted into this container in the specified place,
false otherwise. |
SciObjectEnumeration | objects()Returns an enumeration of all SciObjects in this container |
SciObject | paste(SciObject object, SciObject anchor, boolean before)Pastes the object into this containter. |
| Method Detail |
public boolean canPaste(SciObject object, SciObject anchor, boolean before)
true if the object can be pasted into this container in the specified place,
false otherwise. false can be returned either if
SciObject to check whether it can be pastedSciObject that the object
anchor is null, then the object will be pasted
true, the new object will be
anchor. If false, it will be pasted after it. If anchor
null, then the value of this parameter does not matter.true if the object can be pasted, false otherwisepublic SciObjectEnumeration objects()
SciObjects in this containerSciObjects in this containerpublic SciObject paste(SciObject object, SciObject anchor, boolean before)
SciObject which needs be to pastedSciObject before or after the object
anchor is null, then the object will be pasted
true, the new object will be
anchor. If false, it will be pasted after it. If anchor
null, then the value of this parameter does not matter.
| ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||