Top Description Methods
org.eclipse.persistence.jpa.jpql.tools.model.query

public Interface ListHolderStateObject<T>

extends StateObject
Known Direct Implementers
org.eclipse.persistence.jpa.jpql.tools.model.query.SelectClauseStateObject, org.eclipse.persistence.jpa.jpql.tools.model.query.UpdateClauseStateObject, org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractListHolderStateObject, org.eclipse.persistence.jpa.jpql.tools.model.query.CoalesceExpressionStateObject, org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractPathExpressionStateObject, org.eclipse.persistence.jpa.jpql.tools.model.query.FunctionExpressionStateObject
Imports
java.util.Collection, .List, org.eclipse.persistence.jpa.jpql.tools.model.IListChangeListener, org.eclipse.persistence.jpa.jpql.utility.iterable.ListIterable

A ListHolderStateObject is a StateObject having a list of children and this gives access to some operation over the list.
Author
Pascal Filion
Since
2.4
Version
2.5

Method Summary

Modifier and TypeMethod and Description
public <S extends T> S
addItem(S
The child StateObject to become a child of this one return The given item
item
)

Adds the given StateObject as a child of this one.

public void
addItems(List<? extends T>
The StateObjects to become children of this one
items
)

Adds the given list of StateObjects as children of this one.

public void
addListChangeListener(String
The name of the list for which the listener will be notified when the content of the list has changed
listName
,
IListChangeListener<T>
The listener to be notified upon changes
listener
)

Registers the given IListChangeListener for the specified list.

public boolean

Returns:

true if the object can be moved down by one unit; false otherwise
canMoveDown
(T
The StateObject that could potentially be moved down
item
)

Determines whether the given StateObject can be moved down by one position in the list owned by its parent.

public boolean

Returns:

true if the object can be moved up by one unit; false otherwise
canMoveUp
(T
The StateObject that could potentially be moved up
item
)

Determines whether the given StateObject can be moved up by one position in the list owned by its parent.

public T

Returns:

The StateObject at the given position
getItem
(int
The position of the StateObject to retrieve
index
)

Returns the StateObject at the given positions from the list

public boolean

Returns:

true if this StateObject has children; false otherwise
hasItems
()

Determines whether this StateObject has any children.

public ListIterable<? extends T>

Returns:

An ListIterable that is iterating over the children
items
()

Returns an ListIterable over the children.

public int

Returns:

The count of StateObjects that are children of this one
itemsSize
()

Returns the number of children this list holder has.

public T

Returns:

The given item
moveDown
(T
The StateObject to move down in the list
item
)

Moves the given StateObject down by one position in the list owned by its parent.

public T

Returns:

The given item
moveUp
(T
The StateObject to move up in the list
item
)

Moves the given StateObject up by one position in the list owned by its parent.

public void
removeItem(T
The child StateObject to not longer be a child
item
)

Removes the given StateObject from the list of children.

public void
removeItems(Collection<T>
The StateObjects to remove from this one
items
)

Removes the given StateObject from the list of children.

public void
removeListChangeListener(String
The name of the list for which the listener was registered
listName
,
IListChangeListener<T>
The listener to unregister
listener
)

Unregisters the given IListChangeListener that was registered for the specified list.

Inherited from org.eclipse.persistence.jpa.jpql.tools.model.query.StateObject:
acceptaddPropertyChangeListenerchildrendecoratefindIdentificationVariablegetDeclarationgetDecoratorgetExpressiongetGrammargetManagedTypeProvidergetParentgetQueryBuildergetRootisDecoratedisEquivalentremovePropertyChangeListenersetParenttoStringtoText

Method Detail

addItemback to summary
public <S extends T> S addItem(S item)

Adds the given StateObject as a child of this one.

Parameters
item:S

The child StateObject to become a child of this one return The given item

addItemsback to summary
public void addItems(List<? extends T> items)

Adds the given list of StateObjects as children of this one.

Parameters
items:List<? extends T>

The StateObjects to become children of this one

addListChangeListenerback to summary
public void addListChangeListener(String listName, IListChangeListener<T> listener)

Registers the given IListChangeListener for the specified list. The listener will be notified only when items are added, removed, moved from the list.

Parameters
listName:String

The name of the list for which the listener will be notified when the content of the list has changed

listener:IListChangeListener<T>

The listener to be notified upon changes

Exceptions
NullPointerException:
IListChangeListener cannot be null
IllegalArgumentException:
The listener is already registered with the list name
canMoveDownback to summary
public boolean canMoveDown(T item)

Determines whether the given StateObject can be moved down by one position in the list owned by its parent.

Parameters
item:T

The StateObject that could potentially be moved down

Returns:boolean

true if the object can be moved down by one unit; false otherwise

canMoveUpback to summary
public boolean canMoveUp(T item)

Determines whether the given StateObject can be moved up by one position in the list owned by its parent.

Parameters
item:T

The StateObject that could potentially be moved up

Returns:boolean

true if the object can be moved up by one unit; false otherwise

getItemback to summary
public T getItem(int index)

Returns the StateObject at the given positions from the list

Parameters
index:int

The position of the StateObject to retrieve

Returns:T

The StateObject at the given position

hasItemsback to summary
public boolean hasItems()

Determines whether this StateObject has any children.

Returns:boolean

true if this StateObject has children; false otherwise

itemsback to summary
public ListIterable<? extends T> items()

Returns an ListIterable over the children.

Returns:ListIterable<? extends T>

An ListIterable that is iterating over the children

itemsSizeback to summary
public int itemsSize()

Returns the number of children this list holder has.

Returns:int

The count of StateObjects that are children of this one

moveDownback to summary
public T moveDown(T item)

Moves the given StateObject down by one position in the list owned by its parent.

Parameters
item:T

The StateObject to move down in the list

Returns:T

The given item

moveUpback to summary
public T moveUp(T item)

Moves the given StateObject up by one position in the list owned by its parent.

Parameters
item:T

The StateObject to move up in the list

Returns:T

The given item

removeItemback to summary
public void removeItem(T item)

Removes the given StateObject from the list of children.

Parameters
item:T

The child StateObject to not longer be a child

removeItemsback to summary
public void removeItems(Collection<T> items)

Removes the given StateObject from the list of children.

Parameters
items:Collection<T>

The StateObjects to remove from this one

removeListChangeListenerback to summary
public void removeListChangeListener(String listName, IListChangeListener<T> listener)

Unregisters the given IListChangeListener that 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:String

The name of the list for which the listener was registered

listener:IListChangeListener<T>

The listener to unregister

Exceptions
NullPointerException:
IListChangeListener cannot be null
IllegalArgumentException:
The listener was never registered with the list name