com.vii.brillien.kernel.axiom.atomic
Interface Unit<P extends Presence,C extends Communication,R>

All Superinterfaces:
Aspirer<C,R>, Callable<R>, Presence<C,R>, Progressor, Sensor<C>
All Known Subinterfaces:
Commander<P,C,R>, Context<P,C,R>, Flow<P,C,R>, PresenceBoard<P,C>, PresenceManager<P,C>

public interface Unit<P extends Presence,C extends Communication,R>
extends Presence<C,R>

Set-like Presence type. May collect Presence instances as a logical reference set. The Units must be arranged into a graph describing logical connection between unit instances


Field Summary
 
Fields inherited from interface com.vii.brillien.kernel.axiom.atomic.Presence
CONSONANT, RESIDENT, SPARKLE
 
Method Summary
 void activateUnitAll()
          Activates all Presences in this Unit.
 void activateUnitCallable()
          Activates the callable activity of all Presences in this Unit.
 void activateUnitMessaging()
          Makes all Presences in this Unit active
 void addPresence(P s)
          Adds new Presence.
 void addPresences(Iterable<P> ses)
          Adds new Presences.
 Unit<P,C,R> addSubUnit(Unit s)
          Adds a new subunit.
 Unit<P,C,R> addSubUnits(Iterable<Unit> ses)
          Adds new subunits.
 Collection<Unit> classify(EquivalenceRelation<P,C,R> function)
          Classifies the unit by using an equivalence relation
 void clearPresences()
          Clears all Presences
 void clearSubUnits()
          Clears all subunits
 void communicationUnitReceived(C message)
          Notification method about an incoming message addressed to this all Sensors of this Unit.
 Unit<P,C,R> complement(Unit<P,C,R> unit)
          Creates complement set from the actual and the given Unit
<T> CharacteristicFunction<P,C,T>
getCharacteristicFunction()
          Gets the characteristic function associated to the given Unit.
 Collection<P> getPresences()
          Gets all Presences included into this unite instance
 Collection<Unit> getSubUnits()
          Gets subunit instances
 boolean hasUnitActivity()
          Tells whether a Presence in this Unit has callable activity
 Unit<P,C,R> intersect(Unit<P,C,R> unit)
          Creates intersect set from the actual and the given Unit
 boolean isSubSet(Unit<P,C,R> u)
          Decides whether the given parameter is subset of the actual Unit instance
 boolean isUnitInExitState()
          Tells whether the presences in this unit are in exit state.
 boolean isUnitInValidStates()
          Tells whether the presences in this unit are in valid states
 boolean isUnitWaitingForResponse()
          Tells whether an Aspirer in this Unit is waiting an answer to a redirected get-like message sent earlier.
 Collection<P> order(OrderRelation<P,C,R> function)
          Orders the presences of the unit by using an order relation
 void passivateUnitAll()
          Passivates all Presences in this Unit.
 void passivateUnitCallable()
          Passivates the callable activity of all Presences in this Unit.
 void passivateUnitMessaging()
          Makes all Presences in this Unit passive.
 String printUnitErrorStates()
          Retrieves the String representation of error states of the presences inside of the current Unit
 void removePresence(P s)
          Removes a Presence.
 void removePresences(Iterable<P> ses)
          Removes Presences.
 Unit<P,C,R> removeSubUnit(Unit s)
          Removes a subunit.
 Unit<P,C,R> removeSubUnits(Iterable<Unit> ses)
          Removes subunits.
 void retrieveUnit()
          Makes all presences in this unit to be retrieved by the proper Presencemanagers
 void scrutinise(Presence p)
          Checks if the Presence could became set element
<T> void
setCharacteristicFunction(CharacteristicFunction<P,C,T> function)
          Setter method for the CharacteristicFunction associated to the given Unit.
 Unit<P,C,R> subset(CharacteristicFunction<P,C,R> function)
          Subset creation from the given Unit
 Unit<P,C,R> symmetricDifference(Unit<P,C,R> unit)
          Creates symmetric difference set from the actual and the given Unit
 Unit<P,C,R> union(Unit<P,C,R> unit)
          Creates union set from the actual and the given Unit
 
Methods inherited from interface com.vii.brillien.kernel.axiom.atomic.Presence
activateAll, addSuperUnits, clearSuperUnits, getApiKeyPresenceName, getApiVersion, getFlow, getFlowID, getLoggedUser, getLoggedUser, getPresence, getPresenceManager, getSharing, getSSOPresenceName, getSuperUnits, loginUser, passivateAll, printErrorStates, removeSuperUnits, retrieve, setApiVersion, setFlow, setPresenceManager
 
Methods inherited from interface com.vii.brillien.kernel.axiom.Presence
aspirationTimeIsUp, getAspirationPattern, getAspirationTimeMeasure, getFullName, getInterface, getMessageProcessorParameterNames, getMessageProcessorParameterTypes, getName, hasMessageProcessorReturnValue, isAspirationPeriodical, reset, setAspirationPattern, setAspirationPeriodical, setAspirationTimeMeasure, setName
 
Methods inherited from interface com.vii.brillien.kernel.axiom.Aspirer
activateCallable, getResult, hasActivity, isWaitingForInputData, isWaitingForResponse, passivateCallable, plan, sendAGet, sendDelegatedSet, sendError, sendError, sendError, sendGet, sendGet, sendResponse, sendSet, sendUnitAGet, sendUnitDelegatedSet, sendUnitGet, sendUnitGet, sendUnitSet
 
Methods inherited from interface java.util.concurrent.Callable
call
 
Methods inherited from interface com.vii.brillien.kernel.axiom.Sensor
activateMessaging, communicationReceived, errorReceived, passivateMessaging, presenseChangedState
 
Methods inherited from interface com.vii.brillien.kernel.axiom.Progressor
addState, changeState, getActualStates, getPotentialStates, getStateDivision, hasStateMachine, initStateMashine, isInExitState, isInState, isInValidStates, panic, registerStateChangeNotification, removeState, setStateDivision, unregisterStateChangeNotification
 

Method Detail

getCharacteristicFunction

<T> CharacteristicFunction<P,C,T> getCharacteristicFunction()
Gets the characteristic function associated to the given Unit.

Returns:
characteristic function

setCharacteristicFunction

<T> void setCharacteristicFunction(CharacteristicFunction<P,C,T> function)
Setter method for the CharacteristicFunction associated to the given Unit.

Parameters:
function - CharacteristicFunction to be associated

getSubUnits

Collection<Unit> getSubUnits()
Gets subunit instances

Returns:
subunits

addSubUnit

Unit<P,C,R> addSubUnit(Unit s)
                                                              throws BrillienException
Adds a new subunit. The readding is filtered

Parameters:
s - new subunit
Throws:
BrillienException

addSubUnits

Unit<P,C,R> addSubUnits(Iterable<Unit> ses)
                                                               throws BrillienException
Adds new subunits. The readding is filtered

Parameters:
ses - array of new subunits
Throws:
BrillienException

removeSubUnit

Unit<P,C,R> removeSubUnit(Unit s)
                                                                 throws BrillienException
Removes a subunit.

Parameters:
s - subunit to remove
Throws:
BrillienException

removeSubUnits

Unit<P,C,R> removeSubUnits(Iterable<Unit> ses)
                                                                  throws BrillienException
Removes subunits.

Parameters:
ses - array of subunits to remove
Throws:
BrillienException

clearSubUnits

void clearSubUnits()
                   throws BrillienException
Clears all subunits

Throws:
BrillienException

getPresences

Collection<P> getPresences()
Gets all Presences included into this unite instance

Returns:
included Presences

scrutinise

void scrutinise(Presence p)
                throws BrillienException
Checks if the Presence could became set element

Parameters:
p - element candidate presence
Throws:
BrillienException - in case of element rule violation

addPresence

void addPresence(P s)
                 throws BrillienException
Adds new Presence. The readding is filtered

Parameters:
s - new Presence
Throws:
BrillienException

addPresences

void addPresences(Iterable<P> ses)
                  throws BrillienException
Adds new Presences. The readding is filtered

Parameters:
ses - array of new Presences
Throws:
BrillienException

removePresence

void removePresence(P s)
                    throws BrillienException
Removes a Presence.

Parameters:
s - Presence to remove
Throws:
BrillienException

removePresences

void removePresences(Iterable<P> ses)
                     throws BrillienException
Removes Presences.

Parameters:
ses - array of Presences to remove
Throws:
BrillienException

clearPresences

void clearPresences()
                    throws BrillienException
Clears all Presences

Throws:
BrillienException

subset

Unit<P,C,R> subset(CharacteristicFunction<P,C,R> function)
                                                          throws BrillienException
Subset creation from the given Unit

Parameters:
function - CharacteristicFunction of the subset
Returns:
subset
Throws:
BrillienException

union

Unit<P,C,R> union(Unit<P,C,R> unit)
                                                         throws BrillienException
Creates union set from the actual and the given Unit

Parameters:
unit - other part of the unio set
Returns:
union set
Throws:
BrillienException

intersect

Unit<P,C,R> intersect(Unit<P,C,R> unit)
                                                             throws BrillienException
Creates intersect set from the actual and the given Unit

Parameters:
unit - other part of the intersect set
Returns:
intersect set
Throws:
BrillienException

complement

Unit<P,C,R> complement(Unit<P,C,R> unit)
                                                              throws BrillienException
Creates complement set from the actual and the given Unit

Parameters:
unit - other part of the complement set
Returns:
complement set
Throws:
BrillienException

symmetricDifference

Unit<P,C,R> symmetricDifference(Unit<P,C,R> unit)
                                                                       throws BrillienException
Creates symmetric difference set from the actual and the given Unit

Parameters:
unit - other part of the symmetric difference set
Returns:
symmetric difference set
Throws:
BrillienException

classify

Collection<Unit> classify(EquivalenceRelation<P,C,R> function)
                          throws BrillienException
Classifies the unit by using an equivalence relation

Parameters:
function - equivalence relation
Returns:
collection of element classes
Throws:
BrillienException

order

Collection<P> order(OrderRelation<P,C,R> function)
                                     throws BrillienException
Orders the presences of the unit by using an order relation

Parameters:
function - order relation
Returns:
collection of ordered presences
Throws:
BrillienException

isSubSet

boolean isSubSet(Unit<P,C,R> u)
Decides whether the given parameter is subset of the actual Unit instance

Parameters:
u - set instance
Returns:
result of the investigation on subset property

communicationUnitReceived

void communicationUnitReceived(C message)
                               throws BrillienException
Notification method about an incoming message addressed to this all Sensors of this Unit.

Parameters:
message - message object received
Throws:
BrillienException - Exception thrown in a problematic situation

retrieveUnit

void retrieveUnit()
                  throws BrillienException
Makes all presences in this unit to be retrieved by the proper Presencemanagers

Throws:
BrillienException

hasUnitActivity

boolean hasUnitActivity()
Tells whether a Presence in this Unit has callable activity


activateUnitMessaging

void activateUnitMessaging()
                           throws BrillienException
Makes all Presences in this Unit active

Throws:
BrillienException

passivateUnitMessaging

void passivateUnitMessaging()
                            throws BrillienException
Makes all Presences in this Unit passive.

Throws:
BrillienException

activateUnitCallable

void activateUnitCallable()
                          throws BrillienException
Activates the callable activity of all Presences in this Unit.

Throws:
BrillienException

passivateUnitCallable

void passivateUnitCallable()
                           throws BrillienException
Passivates the callable activity of all Presences in this Unit.

Throws:
BrillienException

isUnitWaitingForResponse

boolean isUnitWaitingForResponse()
Tells whether an Aspirer in this Unit is waiting an answer to a redirected get-like message sent earlier.


isUnitInExitState

boolean isUnitInExitState()
Tells whether the presences in this unit are in exit state.


printUnitErrorStates

String printUnitErrorStates()
Retrieves the String representation of error states of the presences inside of the current Unit


isUnitInValidStates

boolean isUnitInValidStates()
Tells whether the presences in this unit are in valid states


activateUnitAll

void activateUnitAll()
                     throws BrillienException
Activates all Presences in this Unit.

Throws:
BrillienException

passivateUnitAll

void passivateUnitAll()
                      throws BrillienException
Passivates all Presences in this Unit.

Throws:
BrillienException


Copyright © 2012. All Rights Reserved.