|
![]() Quark Platform Documentation Version 1.7.0_0 Business Objects |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openquark.cal.compiler.ModuleName
public final class ModuleName
This class abstracts a module name in CAL. A module name is composed of one or more components separated
by dots. For example, Foo and Cal.Core.Prelude are valid module names. Each component
must start with an uppercase letter.
| Nested Class Summary | |
|---|---|
static class |
ModuleName.FullyQualifiedComparator
A Comparator which compares ModuleNames by their fully-qualified form, comparing on
a component-by-component basis. |
| Method Summary | |
|---|---|
int |
compareTo(ModuleName other)
|
boolean |
equals(ModuleName other)
Compares whether the given module name is equal to this module name. |
boolean |
equals(Object other)
|
ModuleName |
getCommonPrefix(ModuleName other)
Returns the common prefix of this module name and the given module name (which may be equal to either one if one is an improper prefix of the other), or null if they do not share a common prefix. |
String[] |
getComponents()
|
String[] |
getComponents(int start,
int end)
Returns an array of some of the components in this module name, as specified by the given start and end indices. |
ModuleName |
getImmediatePrefix()
Returns a module name that is the immediate prefix of this name, i.e. it is this name, but dropping the last component. |
String |
getLastComponent()
Returns the last component. |
ModuleName |
getModuleName()
|
int |
getNComponents()
Returns the number of components in this module name. |
String |
getNthComponent(int n)
Returns the component at the position specified by the given index. |
ModuleName |
getPrefix(int nComponents)
Returns a module name that is a prefix of this name. |
int |
hashCode()
|
boolean |
isProperPrefixOf(ModuleName other)
Returns whether this module name is a proper prefix of the given module name. |
static ModuleName |
make(String moduleName)
Factory method for constructing an instance of this class. |
static ModuleName |
make(String[] components)
Factory method for constructing an instance of this class. |
static ModuleName |
maybeMake(String maybeModuleName)
Factory method for constructing an instance of this class which accepts nulls and invalid module name strings. |
String |
toSourceText()
Returns the module name as it would appear in source, fully-qualified. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public static ModuleName make(String moduleName)
moduleName - a module name. Cannot be null.
public static ModuleName maybeMake(String maybeModuleName)
maybeModuleName - a string which may or may not represent a valid module name. Can be null.
public static ModuleName make(String[] components)
components - an array of the components for the module name. Cannot be null.
public String toString()
toString in class Objectpublic String toSourceText()
toSourceText in interface Namepublic boolean equals(Object other)
equals in class Objectpublic boolean equals(ModuleName other)
other - another module name.
public int hashCode()
hashCode in class Objectpublic int compareTo(ModuleName other)
compareTo in interface Comparable<ModuleName>public int getNComponents()
public String getNthComponent(int n)
n - the index of the component to return.
public String getLastComponent()
public String[] getComponents()
getNComponents(),
getNthComponent(int),
getComponents(int, int)
public String[] getComponents(int start,
int end)
start - the start position, inclusive.end - the end position, exclusive.
public boolean isProperPrefixOf(ModuleName other)
other - another module name.
public ModuleName getPrefix(int nComponents)
nComponents - the number of components in the prefix.
public ModuleName getImmediatePrefix()
public ModuleName getCommonPrefix(ModuleName other)
other - another module name.
public ModuleName getModuleName()
getModuleName in interface Name
|
![]() Quark Platform Documentation Version 1.7.0_0 Business Objects |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||