Package me.datafox.dfxengine.handles
Class HandleImpl
java.lang.Object
me.datafox.dfxengine.handles.HandleImpl
- All Implemented Interfaces:
Comparable<Handle>,Handle
Implementation of
Handle.-
Method Summary
Modifier and TypeMethodDescriptionintCompares this handle with the specified handle for order.Creates a new subhandle.Creates a subhandle with the specified id if it does not already exist and returns the subhandle with that id.booleantoString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface me.datafox.dfxengine.handles.api.Handle
getHandleManager, getId, getIndex, getSpace, getSubIndex, getTags
-
Method Details
-
getSubHandles
- Specified by:
getSubHandlesin interfaceHandle- Returns:
- subhandles contained in this handle
-
createSubHandle
Creates a new subhandle. ThrowsUnsupportedOperationExceptionif this handle is a subhandle or is associated with aSpace(subhandles for space handles are used exclusively forGroups, useSpace.createGroup(String)instead).- Specified by:
createSubHandlein interfaceHandle- Parameters:
id-Stringid for the new subhandle- Returns:
- created subhandle
- Throws:
NullPointerException- if the id isnullIllegalArgumentException- if the id is empty, blank, contains non-ASCII or non-printable characters or the colon (:), or if a subhandle with the given id already exists in this handleUnsupportedOperationException- if this handle is a subhandle or if this handle is associated with aSpace
-
getOrCreateSubHandle
Creates a subhandle with the specified id if it does not already exist and returns the subhandle with that id. ThrowsUnsupportedOperationExceptionif this handle is a subhandle or is associated with aSpace(subhandles for space handles are used exclusively forGroups) and a subhandle with the specified id is not present. UseSpace.getOrCreateGroup(String).- Specified by:
getOrCreateSubHandlein interfaceHandle- Parameters:
id-Stringid for the subhandle- Returns:
- created or pre-existing subhandle
- Throws:
NullPointerException- if the id isnullIllegalArgumentException- if the id is empty, blank, contains non-ASCII or non-printable characters or the colon (:)UnsupportedOperationException- if this handle is a subhandle or if this handle is associated with aSpaceand a subhandle with the specified id is not present
-
isSubHandle
public boolean isSubHandle()- Specified by:
isSubHandlein interfaceHandle- Returns:
trueif this handle is a subhandle
-
compareTo
Compares this handle with the specified handle for order. Returns a negative integer, zero, or a positive integer as this handle is less than, equal to, or greater than the specified handle. The order of handles is specified by three things. If theSpacesof the handles are different, comparison is done with the space's handle. If the spaces are the same, comparison is done with the index, using the sub-index if the indices are also the same.- Specified by:
compareToin interfaceComparable<Handle>- Specified by:
compareToin interfaceHandle- Parameters:
o- handle to be compared.- Returns:
- negative integer, zero, or a positive integer as this handle is less than, equal to, or greater than the specified handle
- Throws:
NullPointerException- if the specified handle isnull
-
toString
-