Class IndexEntry
java.lang.Object
org.apache.maven.doxia.index.IndexEntry
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate List<IndexEntry> The child entries.private booleantrue if there is already an anchor for thisprivate StringThe id of the entry.private final IndexEntryThe parent entry.private StringThe entry title.private final IndexEntry.TypeThe type of the entry, one of the types defined byIndexingSink -
Constructor Summary
ConstructorsConstructorDescriptionIndexEntry(String newId) Constructor for root entry.IndexEntry(IndexEntry newParent, String newId) Constructor.IndexEntry(IndexEntry newParent, String newId, IndexEntry.Type type) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns an unmodifiableList of the child entries.Returns the first entry.getId()Returns the id.Returns the last entry.Returns the next entry.Returns the parent entry.Returns the previous entry.Returns the root entry.getTitle()Returns the title.getType()Returns the type of this entry.booleanReturns if the entry's id already has an anchor in the underlying document.inthashCode()booleanhasId()Returns if the entry has an id.voidsetAnchor(boolean hasAnchor) Set if the entry's id already has an anchor in the underlying document.voidsetChildEntries(List<IndexEntry> entries) Sets the child entries or creates a new ArrayList if entries == null.protected voidSet the id.voidSets the title.toString()Returns a string representation of the object.toString(int depth) Returns a string representation of all objects to the given depth.
-
Field Details
-
parent
The parent entry. -
id
The id of the entry. -
hasAnchor
private boolean hasAnchortrue if there is already an anchor for this -
title
The entry title. -
childEntries
The child entries. -
type
The type of the entry, one of the types defined byIndexingSink
-
-
Constructor Details
-
IndexEntry
Constructor for root entry.- Parameters:
newId- The id. May be null.
-
IndexEntry
Constructor.- Parameters:
newParent- The parent. May be null.newId- The id. May be null.
-
IndexEntry
Constructor.- Parameters:
newParent- The parent. May be null.newId- The id. May be null.type- The type. Cannot be null.
-
-
Method Details
-
getParent
-
getId
-
hasId
public boolean hasId()Returns if the entry has an id.- Returns:
trueif the entry has a valid id, otherwise it can be considered invalid/empty.
-
setId
-
getType
Returns the type of this entry. Is one of the types defined byIndexingSink.- Returns:
- the type of this entry
- Since:
- 2.0.0
-
setAnchor
public void setAnchor(boolean hasAnchor) Set if the entry's id already has an anchor in the underlying document.- Parameters:
hasAnchor-trueif the id already has an anchor.- Since:
- 2.0.0
-
hasAnchor
public boolean hasAnchor()Returns if the entry's id already has an anchor in the underlying document.- Returns:
trueif the id already has an anchor otherwisefalse.- Since:
- 2.0.0
-
getTitle
-
setTitle
-
getChildEntries
Returns an unmodifiableList of the child entries.- Returns:
- child entries.
-
setChildEntries
Sets the child entries or creates a new ArrayList if entries == null.- Parameters:
entries- the entries.
-
getNextEntry
Returns the next entry.- Returns:
- the next entry, or null if there is none.
-
getPrevEntry
Returns the previous entry.- Returns:
- the previous entry, or null if there is none.
-
getFirstEntry
Returns the first entry.- Returns:
- the first entry, or null if there is none.
-
getLastEntry
Returns the last entry.- Returns:
- the last entry, or null if there is none.
-
getRootEntry
Returns the root entry.- Returns:
- the root entry, or null if there is none.
-
toString
-
toString
Returns a string representation of all objects to the given depth.- Parameters:
depth- The depth to descent to.- Returns:
- A string.
-
hashCode
-
equals
-