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 SciFile

public interface SciFile
extends SciScope

Represents a file with source code, or compiled java class.

Method `classes` returns this file's content as an enumeration of upper-level classes (inner classes are not included in the enumeration).

Method `getContainingPackage` returns a containing package for this file.

Qualified Name
  Qualified name is an absolute pathname for this file. For example,

  `"C:\agent007\java\myClass.java"`

  It is returned by the `getQualifiedName` method.

Name
  A string containing a short name of this file. For example,

  `"myClass.java"`

  It is returned by the `getName` method. It can be changed using the `setName` method.

A new file can be created by SciFactory or SciGenericFactory objects.

Author:
  TogetherSoft

Method Summary
`boolean` | `canSetName(String name)` Checks whether the specified string can be set as a name for this file.
`SciClassEnumeration` | `classes()` Returns an enumeration of upper-level classes in this file.
`SciPackage` | `getContainingPackage()` Returns the package this file belongs to.
`SciJavaImportList` | `getJavaImportList()` Returns `JavaImportList` containing `SciJavaImport` instances.
`String` | `getName()` Returns a string with the name for this file.
`String` | `getQualifiedName()` Returns the qualified name string for this file.
`void` | `setName(String name)` Sets the name for this file.

Methods inherited from interface com.togethersoft.openapi.sci.SciScope
`declaredElements, visitExpressions, visitExpressions, visitReferences, visitReferences, visitStatements, visitStatements`

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

Methods inherited from interface com.togethersoft.openapi.sci.SciObject
`canCut, canDelete, canReplace, copy, cut, delete, getContainingFile, getContainingScope, getLanguage, getPositions, getText, getUserProperty, isReadOnly, replace, setUserProperty`

Method Detail

### canSetName

    public boolean canSetName(String name)

  Checks whether the specified string can be set as a name for this file.
  Parameters:
    name - the string which needs to be assigned as a name to this file
  Returns: `true` if the specified name can be set for this file, `false` otherwise

### classes

    public SciClassEnumeration classes()

  Returns an enumeration of upper-level classes in this file. For accessing the information about inner classes of an upper-level one, the `innerClasses` method should be used.
  Returns: an enumeration of upper-level classes in this file
  See Also:
    SciClass.innerClasses()

### getContainingPackage

    public SciPackage getContainingPackage()

  Returns the package this file belongs to.
  Returns: the package this file belongs to

### getJavaImportList

    public SciJavaImportList getJavaImportList()

  Returns `JavaImportList` containing `SciJavaImport` instances. For Java language only.
  Returns: `JavaImportList` containing `SciJavaImport` instances
  See Also:
    SciJavaImport, SciJavaImportList

### getName

    public String getName()

  Returns a string with the name for this file.
  Returns: a string with the name for this file

### getQualifiedName

    public String getQualifiedName()

  Returns the qualified name string for this file. For `SciFile`es the qualified name is an absolute pathname to this file.
  Returns: the qualified name string for this file

### setName

    public void setName(String name)

  Sets the name for this file. For example: `

       SciFile f = SciModelAccess.getModel().getFactory(SciLanguage.JAVA).newFile();
       f.setName("R.java"); //setting the name
       someSciPackage.paste(f,null,false);

  `
  Parameters:
    name - the string which needs to be assigned as a name to this file

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