Interface ListHolderStateObject<T>
-
- All Superinterfaces:
StateObject
- All Known Implementing Classes:
AbstractFromClauseStateObject,AbstractIdentificationVariableDeclarationStateObject,AbstractListHolderStateObject,AbstractPathExpressionStateObject,CaseExpressionStateObject,CoalesceExpressionStateObject,CollectionValuedPathExpressionStateObject,ConcatExpressionStateObject,ConstructorExpressionStateObject,DerivedPathIdentificationVariableDeclarationStateObject,FromClauseStateObject,FunctionExpressionStateObject,GroupByClauseStateObject,IdentificationVariableDeclarationStateObject,InExpressionStateObject,OrderByClauseStateObject,SelectClauseStateObject,SimpleFromClauseStateObject,StateFieldPathExpressionStateObject,UpdateClauseStateObject
public interface ListHolderStateObject<T> extends StateObject
AListHolderStateObjectis aStateObjecthaving a list of children and this gives access to some operation over the list.- Version:
- 2.5
- Author:
- Pascal Filion
- Since:
- 2.4
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <S extends T>
SaddItem(S item)Adds the givenStateObjectas a child of this one.voidaddItems(java.util.List<? extends T> items)Adds the given list ofStateObjectsas children of this one.voidaddListChangeListener(java.lang.String listName, IListChangeListener<T> listener)Registers the givenIListChangeListenerfor the specified list.booleancanMoveDown(T item)Determines whether the givenStateObjectcan be moved down by one position in the list owned by its parent.booleancanMoveUp(T item)Determines whether the givenStateObjectcan be moved up by one position in the list owned by its parent.TgetItem(int index)Returns theStateObjectat the given positions from the listbooleanhasItems()Determines whether thisStateObjecthas any children.ListIterable<? extends T>items()Returns anListIterableover the children.intitemsSize()Returns the number of children this list holder has.TmoveDown(T item)Moves the givenStateObjectdown by one position in the list owned by its parent.TmoveUp(T item)Moves the givenStateObjectup by one position in the list owned by its parent.voidremoveItem(T item)Removes the givenStateObjectfrom the list of children.voidremoveItems(java.util.Collection<T> items)Removes the givenStateObjectfrom the list of children.voidremoveListChangeListener(java.lang.String listName, IListChangeListener<T> listener)Unregisters the givenIListChangeListenerthat was registered for the specified list.-
Methods inherited from interface org.eclipse.persistence.jpa.jpql.tools.model.query.StateObject
accept, addPropertyChangeListener, children, decorate, findIdentificationVariable, getDeclaration, getDecorator, getExpression, getGrammar, getManagedTypeProvider, getParent, getQueryBuilder, getRoot, isDecorated, isEquivalent, removePropertyChangeListener, setParent, toString, toText
-
-
-
-
Method Detail
-
addItem
<S extends T> S addItem(S item)
Adds the givenStateObjectas a child of this one.- Parameters:
item- The childStateObjectto become a child of this one return The given item
-
addItems
void addItems(java.util.List<? extends T> items)
Adds the given list ofStateObjectsas children of this one.- Parameters:
items- TheStateObjectsto become children of this one
-
addListChangeListener
void addListChangeListener(java.lang.String listName, IListChangeListener<T> listener)Registers the givenIListChangeListenerfor the specified list. The listener will be notified only when items are added, removed, moved from the list.- Parameters:
listName- The name of the list for which the listener will be notified when the content of the list has changedlistener- The listener to be notified upon changes- Throws:
java.lang.NullPointerException-IListChangeListenercannot benulljava.lang.IllegalArgumentException- The listener is already registered with the list name
-
canMoveDown
boolean canMoveDown(T item)
Determines whether the givenStateObjectcan be moved down by one position in the list owned by its parent.- Parameters:
item- TheStateObjectthat could potentially be moved down- Returns:
trueif the object can be moved down by one unit;falseotherwise
-
canMoveUp
boolean canMoveUp(T item)
Determines whether the givenStateObjectcan be moved up by one position in the list owned by its parent.- Parameters:
item- TheStateObjectthat could potentially be moved up- Returns:
trueif the object can be moved up by one unit;falseotherwise
-
getItem
T getItem(int index)
Returns theStateObjectat the given positions from the list- Parameters:
index- The position of theStateObjectto retrieve- Returns:
- The
StateObjectat the given position
-
hasItems
boolean hasItems()
Determines whether thisStateObjecthas any children.- Returns:
trueif thisStateObjecthas children;falseotherwise
-
items
ListIterable<? extends T> items()
Returns anListIterableover the children.- Returns:
- An
ListIterablethat is iterating over the children
-
itemsSize
int itemsSize()
Returns the number of children this list holder has.- Returns:
- The count of
StateObjectsthat are children of this one
-
moveDown
T moveDown(T item)
Moves the givenStateObjectdown by one position in the list owned by its parent.- Parameters:
item- TheStateObjectto move down in the list- Returns:
- The given item
-
moveUp
T moveUp(T item)
Moves the givenStateObjectup by one position in the list owned by its parent.- Parameters:
item- TheStateObjectto move up in the list- Returns:
- The given item
-
removeItem
void removeItem(T item)
Removes the givenStateObjectfrom the list of children.- Parameters:
item- The childStateObjectto not longer be a child
-
removeItems
void removeItems(java.util.Collection<T> items)
Removes the givenStateObjectfrom the list of children.- Parameters:
items- TheStateObjectsto remove from this one
-
removeListChangeListener
void removeListChangeListener(java.lang.String listName, IListChangeListener<T> listener)Unregisters the givenIListChangeListenerthat was registered for the specified list. The listener will no longer be notified only when items are added, removed, moved from the list.- Parameters:
listName- The name of the list for which the listener was registeredlistener- The listener to unregister- Throws:
java.lang.NullPointerException-IListChangeListenercannot benulljava.lang.IllegalArgumentException- The listener was never registered with the list name
-
-