Package org.silverpeas.core.util
Class ContributionPath<T extends Contribution>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.ArrayList<T>
-
- org.silverpeas.core.util.ContributionPath<T>
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Iterable<T>
,Collection<T>
,List<T>
,RandomAccess
,ResourcePath<T>
- Direct Known Subclasses:
CalendarComponentPath
,NodePath
public abstract class ContributionPath<T extends Contribution> extends ArrayList<T> implements ResourcePath<T>, Serializable
The path of a resource in the organizational resources tree of Silverpeas. It provides a centralized point to compute such a path according to the type of the concerned resource. Each segment of the path refers a given resource of the tree by its localized name.- Author:
- silveryocha
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.silverpeas.core.util.ResourcePath
ResourcePath.Constants
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,org.silverpeas.kernel.util.Pair<String,String>>
lastPathByLanguage
-
Fields inherited from class java.util.AbstractList
modCount
-
-
Constructor Summary
Constructors Constructor Description ContributionPath()
ContributionPath(int initialCapacity)
ContributionPath(Collection<? extends T> c)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
String
format(String language, boolean fullSpacePath, String pathSep)
Formats a path from the node that the list contains by using the specified path separator.protected abstract String
getLabel(T resource, String language)
int
hashCode()
protected abstract boolean
isRoot(T resource)
protected boolean
rootIsComponentInstance()
-
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, forEach, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
-
Methods inherited from class java.util.AbstractCollection
containsAll, toString
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface java.util.List
add, add, addAll, addAll, clear, contains, containsAll, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray
-
Methods inherited from interface org.silverpeas.core.util.ResourcePath
format, format
-
-
-
-
Constructor Detail
-
ContributionPath
public ContributionPath()
-
ContributionPath
public ContributionPath(int initialCapacity)
-
ContributionPath
public ContributionPath(@Nonnull Collection<? extends T> c)
-
-
Method Detail
-
isRoot
protected abstract boolean isRoot(T resource)
-
rootIsComponentInstance
protected boolean rootIsComponentInstance()
-
format
public String format(String language, boolean fullSpacePath, String pathSep)
Formats a path from the node that the list contains by using the specified path separator.- Specified by:
format
in interfaceResourcePath<T extends Contribution>
- Parameters:
language
- the aimed translation.fullSpacePath
- if false, the space host is taken into account, if true the space host and all of its parents are taken into account.pathSep
- the path separator to use.- Returns:
- a string.
-
equals
public boolean equals(Object o)
- Specified by:
equals
in interfaceCollection<T extends Contribution>
- Specified by:
equals
in interfaceList<T extends Contribution>
- Overrides:
equals
in classArrayList<T extends Contribution>
-
hashCode
public int hashCode()
- Specified by:
hashCode
in interfaceCollection<T extends Contribution>
- Specified by:
hashCode
in interfaceList<T extends Contribution>
- Overrides:
hashCode
in classArrayList<T extends Contribution>
-
-