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 StringNAME_COMPONENT_SEPARATOR
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static CompositeNamecreate(boolean isAbsolute, String[] components)static CompositeNamecreate(boolean isAbsolute, String[] components, int prefixLength)static CompositeNamecreate(String simpleName)StringgetHead()CompositeNamegetTail()booleanisEmpty()CompositeNamematchPrefix(String[] prefix)Tries to match theprefixargument with the first elements of this nameStringtoString()
-
-
-
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 theprefixargument with the first elements of this name- Returns:
- the remaining elements on success or null on failure
-
-