org.jetbrains.jet.util
Class QualifiedNamesUtil

java.lang.Object
  extended by org.jetbrains.jet.util.QualifiedNamesUtil

public final class QualifiedNamesUtil
extends java.lang.Object

Common methods for working with qualified names.


Method Summary
static FqName combine(FqName first, Name second)
           
static java.lang.String getFirstSegment(java.lang.String fqn)
           
static boolean isImported(ImportPath alreadyImported, FqName fqName)
           
static boolean isImported(ImportPath alreadyImported, ImportPath newImport)
           
static boolean isImported(java.lang.Iterable<ImportPath> imports, ImportPath newImport)
           
static boolean isOneSegmentFQN(FqName fqn)
           
static boolean isOneSegmentFQN(java.lang.String fqn)
           
static boolean isSubpackageOf(FqName subpackageName, FqName packageName)
           
static boolean isSubpackageOf(java.lang.String subpackageNameStr, java.lang.String packageNameStr)
           
static boolean isValidJavaFqName(java.lang.String qualifiedName)
           
static int numberOfSegments(FqName fqName)
           
static FqName plusOneSegment(FqName fqn, FqName fullFQN)
          Add one segment of nesting to given qualified name according to the full qualified name.
static java.lang.String tail(FqName headFQN, FqName fullFQN)
          Get tail part of the full fqn by subtracting head part.
static FqName withoutFirstSegment(FqName fqName)
           
static FqName withoutLastSegment(FqName fqName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isSubpackageOf

public static boolean isSubpackageOf(@NotNull
                                     FqName subpackageName,
                                     @NotNull
                                     FqName packageName)

isOneSegmentFQN

public static boolean isOneSegmentFQN(@NotNull
                                      java.lang.String fqn)

isOneSegmentFQN

public static boolean isOneSegmentFQN(@NotNull
                                      FqName fqn)

getFirstSegment

@NotNull
public static java.lang.String getFirstSegment(@NotNull
                                                       java.lang.String fqn)

withoutLastSegment

@NotNull
public static FqName withoutLastSegment(@NotNull
                                                FqName fqName)

withoutFirstSegment

@NotNull
public static FqName withoutFirstSegment(@NotNull
                                                 FqName fqName)

numberOfSegments

public static int numberOfSegments(@NotNull
                                   FqName fqName)

combine

@NotNull
public static FqName combine(@NotNull
                                     FqName first,
                                     @NotNull
                                     Name second)

tail

@NotNull
public static java.lang.String tail(@NotNull
                                            FqName headFQN,
                                            @NotNull
                                            FqName fullFQN)
Get tail part of the full fqn by subtracting head part.

Parameters:
headFQN -
fullFQN -
Returns:
tail fqn. If first part is not a begging of the full fqn, fullFQN will be returned.

plusOneSegment

@Nullable
public static FqName plusOneSegment(@NotNull
                                             FqName fqn,
                                             @NotNull
                                             FqName fullFQN)
Add one segment of nesting to given qualified name according to the full qualified name.

Parameters:
fqn -
fullFQN -
Returns:
qualified name with one more segment or null if fqn is not head part of fullFQN or there's no additional segment.

isImported

public static boolean isImported(@NotNull
                                 ImportPath alreadyImported,
                                 @NotNull
                                 FqName fqName)

isImported

public static boolean isImported(@NotNull
                                 ImportPath alreadyImported,
                                 @NotNull
                                 ImportPath newImport)

isImported

public static boolean isImported(@NotNull
                                 java.lang.Iterable<ImportPath> imports,
                                 @NotNull
                                 ImportPath newImport)

isValidJavaFqName

public static boolean isValidJavaFqName(@Nullable
                                        java.lang.String qualifiedName)

isSubpackageOf

public static boolean isSubpackageOf(java.lang.String subpackageNameStr,
                                     java.lang.String packageNameStr)