java.lang.Object
uk.autores.handling.Pkg
- All Implemented Interfaces:
CharSequence
Character representation of a
Java package.
-
Method Summary
Modifier and TypeMethodDescriptioncharcharAt(int index) booleanNOTE: use of the unnamed package is highly discouraged.For package "foo.bar" returns "bar".intlength()static Pkgnamed(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, waitMethods 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:
lengthin interfaceCharSequence
-
charAt
public char charAt(int index) - Specified by:
charAtin interfaceCharSequence
-
subSequence
- Specified by:
subSequencein interfaceCharSequence
-
lastSegment
For package "foo.bar" returns "bar". For unnamed package returns "".- Returns:
- the last dotted segment
-
toString
- Specified by:
toStringin interfaceCharSequence- Overrides:
toStringin classObject
-