Overview | Package | Class | Use | Tree | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.togethersoft.openapi.sci
Interface SciInheritanceList

public interface SciInheritanceList
extends SciContainer

`SciInheritanceList` is a container of references to the exteded or implemented interfaces, or to the extended classes. An object of this type is returned by both SciClass.getExtendsList and SciClass.getImplementsList methods:

- When it is returned by the `getExtendsList` for a class, it contains `SciInheritance`s which are references to the extended classes.

- When it is returned by the `getExtendsList` for an interface, it contains `SciInheritance`s which are references to the extended interfaces.

- When it is returned by the `getImplementsList` (it is non-null only for classes), it contains `SciInheritance`s which are references to the implemented interfaces.

`getText` method returns a string containing the source code fragment with the names of classes/interfaces. For example, if class `mySciClass` stands for this source code class:

     public class Class1 extends somepackage.Class2 implements Interface1, somePackage.Interface2 {
       ...
     }

then the following code:

    mySciClass.getExtendsList().getText()

will return "somepackage.Class2".

    mySciClass.getImplementsList().getText()

will return "Interface1, somePackage.Interface2".

References to the classes/interfaces can be obtained via `inheritances` method. You can change the text of extends/implements section represented by this `SciInheritanceList` object using the `setText` method. For example, let's set the `implements` section to the `"implements SciContainer, MyInterface"`: ``

     mySciClass.getImplementsList().setText("SciContainer, MyInterface");

Since this interface extends `SciContainer`, its paste method can be used to add new `SciInheritance`s to this container. For example, consider this situation: you wish to make some class (represented by the `someSciClass` object) implement an interface represented by `targetInterface` object (instance of `SciClass`). This is how it can be done: ``

     SciInheritance newInheritance = SciModelAccess.getModel().getFactory(SciLanguage.JAVA).newInheritance();
     newInheritance.setReferencedElement(targetInterface);
     someSciClass.getImplementsList().paste(newInheritance, null, false);

Author:
  TogetherSoft
See Also: SciInheritance, inheritances(), SciClass.getExtendsList(), SciClass.getImplementsList()

Method Summary
`boolean` | `canSetText(String text)` Checks whether the specified string containing the names of classes/interfaces can be put into the source code for this class (in the extends/implements section).
`String` | `getText()` Returns a string containing the source code fragment with the names of classes/interfaces.
`SciInheritanceEnumeration` | `inheritances()` Returns an enumeration of `SciInheritance` references to the classes/interfaces.
`void` | `setText(String text)` Puts the string containing the names of classes/interfaces into the source code for this class (in the extends/implements section).

Methods inherited from interface com.togethersoft.openapi.sci.SciContainer
`canPaste, objects, paste`

Method Detail

### canSetText

    public boolean canSetText(String text)

  Checks whether the specified string containing the names of classes/interfaces can be put into the source code for this class (in the extends/implements section).
  Returns: `true` if the specified string can be put into the source code for this class, `false` otherwise

### getText

    public String getText()

  Returns a string containing the source code fragment with the names of classes/interfaces. See the desciption of this interface for an example. If this `SciClass` doesn't extends/implements anything, returns an empty string.
  Returns: a string containing the source code fragment with the names classes/interfaces

### inheritances

    public SciInheritanceEnumeration inheritances()

  Returns an enumeration of `SciInheritance` references to the classes/interfaces.
  Returns: an enumeration of `SciInheritance` references to the classes/interfaces
  See Also:
    SciInheritance, SciReference

### setText

    public void setText(String text)

  Puts the string containing the names of classes/interfaces into the source code for this class (in the extends/implements section).
  Parameters:
    text - the string containing the names of classes/interfaces

Overview | Package | Class | Use | Tree | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD