java.lang.Object
uk.autores.handling.Pkg
- All Implemented Interfaces:
CharSequence
Character representation of a
Java package.
-
Method Summary
Modifier and TypeMethodDescriptionchar
charAt
(int index) boolean
NOTE: use of the unnamed package is highly discouraged.For package "foo.bar" returns "bar".int
length()
static Pkg
named
(CharSequence name) Instantiates an instance, decorating the given sequence.qualifiedClassName
(String simpleClassName) For a package "foo.bar" and a simple name "Baz" returns "foo.bar.Baz".subSequence
(int start, int end) toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.CharSequence
chars, codePoints, isEmpty
-
Method Details
-
named
Instantiates an instance, decorating the given sequence. The argument is typically aName
.- Parameters:
name
- package name of the annotated type or package- Returns:
- instance
-
qualifiedClassName
For a package "foo.bar" and a simple name "Baz" returns "foo.bar.Baz". For unnamed package and simple name "Foo" returns "Foo".- Parameters:
simpleClassName
- simple class name without package- Returns:
- the fully qualified class name
- See Also:
-
isUnnamed
public boolean isUnnamed()NOTE: use of the unnamed package is highly discouraged.- Returns:
- true if this is the unnamed package
-
length
public int length()- Specified by:
length
in interfaceCharSequence
-
charAt
public char charAt(int index) - Specified by:
charAt
in interfaceCharSequence
-
subSequence
- Specified by:
subSequence
in interfaceCharSequence
-
lastSegment
For package "foo.bar" returns "bar". For unnamed package returns "".- Returns:
- the last dotted segment
-
toString
- Specified by:
toString
in interfaceCharSequence
- Overrides:
toString
in classObject
-