Class CompositeName
- java.lang.Object
-
- net.sourceforge.pmd.lang.modelica.resolver.CompositeName
-
public final class CompositeName extends Object
An immutable composite name representation for use in "pattern matching style". Supports lightweight splitting into first element and "tail" (everything else).
-
-
Field Summary
Fields Modifier and Type Field Description static String
NAME_COMPONENT_SEPARATOR
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static CompositeName
create(boolean isAbsolute, String[] components)
static CompositeName
create(boolean isAbsolute, String[] components, int prefixLength)
static CompositeName
create(String simpleName)
String
getHead()
CompositeName
getTail()
boolean
isEmpty()
CompositeName
matchPrefix(String[] prefix)
Tries to match theprefix
argument with the first elements of this nameString
toString()
-
-
-
Field Detail
-
NAME_COMPONENT_SEPARATOR
public static final String NAME_COMPONENT_SEPARATOR
- See Also:
- Constant Field Values
-
-
Method Detail
-
create
public static CompositeName create(boolean isAbsolute, String[] components)
-
create
public static CompositeName create(boolean isAbsolute, String[] components, int prefixLength)
-
create
public static CompositeName create(String simpleName)
-
isEmpty
public boolean isEmpty()
-
getHead
public String getHead()
-
getTail
public CompositeName getTail()
-
matchPrefix
public CompositeName matchPrefix(String[] prefix)
Tries to match theprefix
argument with the first elements of this name- Returns:
- the remaining elements on success or null on failure
-
-