idx
int64
0
165k
question
stringlengths
73
5.81k
target
stringlengths
5
918
9,900
public static < G , B > Bad < G , B > of ( B value ) { return new Bad < > ( value ) ; }
Creates a Bad of type B .
9,901
public LREnvelope sign ( LREnvelope envelope ) throws LRException { String bencodedMessage = bencode ( envelope . getSignableData ( ) ) ; String clearSignedMessage = signEnvelopeData ( bencodedMessage ) ; envelope . addSigningData ( signingMethod , publicKeyLocation , clearSignedMessage ) ; return envelope ; }
Sign the specified envelope with this signer
9,902
private List < Object > normalizeList ( List < Object > list ) { List < Object > result = new ArrayList < Object > ( ) ; for ( Object o : list ) { if ( o == null ) { result . add ( nullLiteral ) ; } else if ( o instanceof Boolean ) { result . add ( ( ( Boolean ) o ) . toString ( ) ) ; } else if ( o instanceof List < ? ...
Helper for map normalization ; inspects list and returns a replacement list that has been normalized .
9,903
private String signEnvelopeData ( String message ) throws LRException { if ( passPhrase == null || publicKeyLocation == null || privateKey == null ) { throw new LRException ( LRException . NULL_FIELD ) ; } InputStream privateKeyStream = getPrivateKeyStream ( privateKey ) ; ByteArrayOutputStream result = new ByteArrayOu...
Encodes the provided message with the private key and pass phrase set in configuration
9,904
private PGPSecretKey readSecretKey ( InputStream input ) throws LRException { PGPSecretKeyRingCollection pgpSec ; try { pgpSec = new PGPSecretKeyRingCollection ( PGPUtil . getDecoderStream ( input ) ) ; } catch ( Exception e ) { throw new LRException ( LRException . NO_KEY ) ; } java . util . Iterator keyRingIter = pgp...
Reads private key from the provided InputStream
9,905
private InputStream getPrivateKeyStream ( String privateKey ) throws LRException { try { if ( privateKey . matches ( pgpRegex ) ) { return new ByteArrayInputStream ( privateKey . getBytes ( ) ) ; } else { return new FileInputStream ( new File ( privateKey ) ) ; } } catch ( IOException e ) { throw new LRException ( LREx...
Converts the local location or text of a private key into an input stream
9,906
public void include ( Readable in , String source ) throws IOException { if ( cursor != end ) { release ( ) ; } if ( includeStack == null ) { includeStack = new ArrayDeque < > ( ) ; } includeStack . push ( includeLevel ) ; includeLevel = new IncludeLevel ( in , source ) ; }
Include Readable at current input . Readable is read as part of input . When Readable ends input continues using current input .
9,907
private static Set < Type > getChildTypes ( final Type _type ) throws CacheReloadException { final Set < Type > ret = new HashSet < Type > ( ) ; ret . add ( _type ) ; for ( final Type child : _type . getChildTypes ( ) ) { ret . addAll ( getChildTypes ( child ) ) ; } return ret ; }
Gets the type list .
9,908
public Criteria addCriteria ( final int _idx , final List < String > _sqlColNames , final Comparison _comparison , final Set < String > _values , final boolean _escape , final Connection _connection ) { final Criteria criteria = new Criteria ( ) . tableIndex ( _idx ) . colNames ( _sqlColNames ) . comparison ( _comparis...
Adds the criteria .
9,909
protected void appendSQL ( final String _tablePrefix , final StringBuilder _cmd ) { if ( sections . size ( ) > 0 ) { if ( isStarted ( ) ) { new SQLSelectPart ( SQLPart . AND ) . appendSQL ( _cmd ) ; new SQLSelectPart ( SQLPart . SPACE ) . appendSQL ( _cmd ) ; } else { new SQLSelectPart ( SQLPart . WHERE ) . appendSQL (...
Append SQL .
9,910
public static InetAddress getInetAddress ( Config config , String path ) { try { return InetAddress . getByName ( config . getString ( path ) ) ; } catch ( UnknownHostException e ) { throw badValue ( e , config , path ) ; } }
Get an IP address . The configuration value can either be a hostname or a literal IP address .
9,911
public static NetworkInterface getNetworkInterface ( Config config , String path ) { NetworkInterface value = getNetworkInterfaceByName ( config , path ) ; if ( value == null ) value = getNetworkInterfaceByInetAddress ( config , path ) ; if ( value == null ) throw badValue ( "No network interface for value '" + config ...
Get a network interface . The network interface can be identified by its name or its IP address .
9,912
public static int getPort ( Config config , String path ) { try { return new InetSocketAddress ( config . getInt ( path ) ) . getPort ( ) ; } catch ( IllegalArgumentException e ) { throw badValue ( e , config , path ) ; } }
Get a port number .
9,913
public List < ChatMessageStatus > adaptEvents ( List < DbOrphanedEvent > dbOrphanedEvents ) { List < ChatMessageStatus > statuses = new ArrayList < > ( ) ; Parser parser = new Parser ( ) ; for ( DbOrphanedEvent event : dbOrphanedEvents ) { OrphanedEvent orphanedEvent = parser . parse ( event . event ( ) , OrphanedEvent...
Translates Orphaned events to message statuses .
9,914
public List < ChatMessage > adaptMessages ( List < MessageReceived > messagesReceived ) { List < ChatMessage > chatMessages = new ArrayList < > ( ) ; if ( messagesReceived != null ) { for ( MessageReceived msg : messagesReceived ) { ChatMessage adaptedMessage = ChatMessage . builder ( ) . populate ( msg ) . build ( ) ;...
Translates received messages through message query to chat SDK model .
9,915
public List < ChatMessageStatus > adaptStatuses ( String conversationId , String messageId , Map < String , MessageReceived . Status > statuses ) { List < ChatMessageStatus > adapted = new ArrayList < > ( ) ; for ( String key : statuses . keySet ( ) ) { MessageReceived . Status status = statuses . get ( key ) ; adapted...
Translates received message statuses through message query to chat SDK model .
9,916
public List < ChatParticipant > adapt ( List < Participant > participants ) { List < ChatParticipant > result = new ArrayList < > ( ) ; if ( participants != null && ! participants . isEmpty ( ) ) { for ( Participant p : participants ) { result . add ( ChatParticipant . builder ( ) . populate ( p ) . build ( ) ) ; } } r...
Translates Foundation conversation participants to Chat SDK conversation participants .
9,917
private final void setColor ( ColorSet colorSet ) { int [ ] rgb = ColorSet . getRGB ( colorSet ) ; this . red = rgb [ 0 ] / 255.0 ; this . green = rgb [ 1 ] / 255.0 ; this . blue = rgb [ 2 ] / 255.0 ; }
Returns the colorset s RGB values .
9,918
public static void shutDown ( ) { if ( Quartz . QUARTZ != null && Quartz . QUARTZ . scheduler != null ) { try { Quartz . QUARTZ . scheduler . shutdown ( ) ; } catch ( final SchedulerException e ) { Quartz . LOG . error ( "Problems on shutdown of QuartsSheduler" , e ) ; } } }
ShutDown Quartz .
9,919
public static GenClassCompiler compile ( TypeElement superClass , ProcessingEnvironment env ) throws IOException { GenClassCompiler compiler ; GrammarDef grammarDef = superClass . getAnnotation ( GrammarDef . class ) ; if ( grammarDef != null ) { compiler = new ParserCompiler ( superClass ) ; } else { DFAMap mapDef = s...
Compiles a subclass for annotated superClass
9,920
private synchronized boolean refreshAuthToken ( final AuthHandler handler , final boolean forceRefresh ) { if ( handler == null ) { return false ; } AuthToken token = authToken . get ( ) ; if ( ! forceRefresh && token != null && token . isValid ( ) ) { logger . fine ( "Auth token is already valid" ) ; return true ; } t...
Return true if caller should retry false if give up
9,921
public PropertyDescriptor getPropertyDescriptor ( String propertyName ) { final PropertyDescriptor propertyDescriptor = findPropertyDescriptor ( propertyName ) ; if ( propertyDescriptor == null ) { throw new PropertyNotFoundException ( beanClass , propertyName ) ; } return propertyDescriptor ; }
Get the property descriptor for the named property . Throws an exception if the property does not exist .
9,922
public PropertyDescriptor findPropertyDescriptor ( String propertyName ) { for ( PropertyDescriptor property : propertyDescriptors ) { if ( property . getName ( ) . equals ( propertyName ) ) { return property ; } } return null ; }
Attempt to get the property descriptor for the named property .
9,923
public boolean isAssigendTo ( final Company _company ) throws CacheReloadException { final boolean ret ; if ( isRoot ( ) ) { ret = this . companies . isEmpty ( ) ? true : this . companies . contains ( _company ) ; } else { ret = getParentClassification ( ) . isAssigendTo ( _company ) ; } return ret ; }
Check if the root classification of this classification is assigned to the given company .
9,924
private void overrideAbstractMethods ( ) throws IOException { for ( final ExecutableElement method : El . getEffectiveMethods ( superClass ) ) { if ( method . getModifiers ( ) . contains ( Modifier . ABSTRACT ) ) { if ( method . getAnnotation ( Terminal . class ) != null || method . getAnnotation ( Rule . class ) != nu...
Implement abstract method which have either one parameter and returning something or void type not returning anything .
9,925
private void init ( ) { this . container = InfinispanCache . findCacheContainer ( ) ; if ( this . container == null ) { try { this . container = new DefaultCacheManager ( this . getClass ( ) . getResourceAsStream ( "/org/efaps/util/cache/infinispan-config.xml" ) ) ; if ( this . container instanceof EmbeddedCacheManager...
init this instance .
9,926
private void terminate ( ) { if ( this . container != null ) { final Cache < String , Integer > cache = this . container . < String , Integer > getCache ( InfinispanCache . COUNTERCACHE ) ; Integer count = cache . get ( InfinispanCache . COUNTERCACHE ) ; if ( count == null || count < 2 ) { this . container . stop ( ) ;...
Terminate the manager .
9,927
public < K , V > AdvancedCache < K , V > getIgnReCache ( final String _cacheName ) { return this . container . < K , V > getCache ( _cacheName , true ) . getAdvancedCache ( ) . withFlags ( Flag . IGNORE_RETURN_VALUES , Flag . SKIP_REMOTE_LOOKUP , Flag . SKIP_CACHE_LOAD ) ; }
An advanced cache that does not return the value of the previous value in case of replacement .
9,928
public < K , V > Cache < K , V > initCache ( final String _cacheName ) { if ( ! exists ( _cacheName ) && ( ( EmbeddedCacheManager ) getContainer ( ) ) . getCacheConfiguration ( _cacheName ) == null ) { ( ( EmbeddedCacheManager ) getContainer ( ) ) . defineConfiguration ( _cacheName , "eFaps-Default" , new Configuration...
Method to init a Cache using the default definitions .
9,929
public static FacetsConfig getFacetsConfig ( ) { final FacetsConfig ret = new FacetsConfig ( ) ; ret . setHierarchical ( Indexer . Dimension . DIMCREATED . name ( ) , true ) ; return ret ; }
Gets the facets config .
9,930
public static Analyzer getAnalyzer ( ) throws EFapsException { IAnalyzerProvider provider = null ; if ( EFapsSystemConfiguration . get ( ) . containsAttributeValue ( KernelSettings . INDEXANALYZERPROVCLASS ) ) { final String clazzname = EFapsSystemConfiguration . get ( ) . getAttributeValue ( KernelSettings . INDEXANAL...
Gets the analyzer .
9,931
@ CallMethod ( pattern = "install/version/script" ) public void addScript ( @ CallParam ( pattern = "install/version/script" ) final String _code , @ CallParam ( pattern = "install/version/script" , attributeName = "type" ) final String _type , @ CallParam ( pattern = "install/version/script" , attributeName = "name" )...
Adds a new Script to this version .
9,932
@ CallMethod ( pattern = "install/version/description" ) public void appendDescription ( @ CallParam ( pattern = "install/version/description" ) final String _desc ) { if ( _desc != null ) { this . description . append ( _desc . trim ( ) ) . append ( "\n" ) ; } }
Append a description for this version .
9,933
@ CallMethod ( pattern = "install/version/lifecyle/ignore" ) public void addIgnoredStep ( @ CallParam ( pattern = "install/version/lifecyle/ignore" , attributeName = "step" ) final String _step ) { this . ignoredSteps . add ( UpdateLifecycle . valueOf ( _step . toUpperCase ( ) ) ) ; }
Appends a step which is ignored within the installation of this version .
9,934
protected void freeResource ( ) throws EFapsException { try { if ( ! getConnection ( ) . isClosed ( ) ) { getConnection ( ) . close ( ) ; } } catch ( final SQLException e ) { throw new EFapsException ( "Could not close" , e ) ; } }
Frees the resource and gives this connection resource back to the context object .
9,935
public static < K , V > Configuration newMutable ( TimeUnit expiryTimeUnit , long expiryDurationAmount ) { return new MutableConfiguration < K , V > ( ) . setExpiryPolicyFactory ( factoryOf ( new Duration ( expiryTimeUnit , expiryDurationAmount ) ) ) ; }
Build a new mutable javax . cache . configuration . Configuration with an expiry policy
9,936
public boolean next ( ) throws EFapsException { initialize ( false ) ; boolean stepForward = true ; boolean ret = true ; while ( stepForward && ret ) { ret = step ( this . selection . getAllSelects ( ) ) ; stepForward = ! this . access . hasAccess ( inst ( ) ) ; } return ret ; }
Move the evaluator to the next value . Skips values the User does not have access to .
9,937
private boolean step ( final Collection < Select > _selects ) { boolean ret = ! CollectionUtils . isEmpty ( _selects ) ; for ( final Select select : _selects ) { ret = ret && select . next ( ) ; } return ret ; }
Move the selects to the next value .
9,938
private void evalAccess ( ) throws EFapsException { final List < Instance > instances = new ArrayList < > ( ) ; while ( step ( this . selection . getInstSelects ( ) . values ( ) ) ) { for ( final Entry < String , Select > entry : this . selection . getInstSelects ( ) . entrySet ( ) ) { final Object object = entry . get...
Evaluate the access for the instances .
9,939
public DataList getDataList ( ) throws EFapsException { final DataList ret = new DataList ( ) ; while ( next ( ) ) { final ObjectData data = new ObjectData ( ) ; int idx = 1 ; for ( final Select select : this . selection . getSelects ( ) ) { final String key = select . getAlias ( ) == null ? String . valueOf ( idx ) : ...
Gets the data list .
9,940
protected String makeInfo ( ) { final StringBuilder str = new StringBuilder ( ) ; if ( this . className != null ) { str . append ( "Thrown within class " ) . append ( this . className . getName ( ) ) . append ( '\n' ) ; } if ( this . id != null ) { str . append ( "Id of Exception is " ) . append ( this . id ) . append ...
Prepares a string of all information of this EFapsException . The returned string includes information about the class which throws this exception the exception id and all arguments .
9,941
private static String getValueFromDB ( final String _key , final String _language ) { String ret = null ; try { boolean closeContext = false ; if ( ! Context . isThreadActive ( ) ) { Context . begin ( ) ; closeContext = true ; } final Connection con = Context . getConnection ( ) ; final PreparedStatement stmt = con . p...
This method is initializing the cache .
9,942
private static void cacheOnStart ( ) { try { boolean closeContext = false ; if ( ! Context . isThreadActive ( ) ) { Context . begin ( ) ; closeContext = true ; } Context . getThreadContext ( ) ; final Connection con = Context . getConnection ( ) ; final PreparedStatement stmtLang = con . prepareStatement ( DBProperties...
Load the properties that must be cached on start .
9,943
public static void initialize ( ) { if ( InfinispanCache . get ( ) . exists ( DBProperties . CACHENAME ) ) { InfinispanCache . get ( ) . < String , String > getCache ( DBProperties . CACHENAME ) . clear ( ) ; } else { InfinispanCache . get ( ) . < String , String > getCache ( DBProperties . CACHENAME ) . addListener ( ...
Initialize the Cache be calling it . Used from runtime level .
9,944
public static int getReadCount ( final Long _userId ) { int ret = 0 ; if ( MessageStatusHolder . CACHE . userID2Read . containsKey ( _userId ) ) { ret = MessageStatusHolder . CACHE . userID2Read . get ( _userId ) ; } return ret ; }
Count of read messages .
9,945
public static int getUnReadCount ( final Long _userId ) { int ret = 0 ; if ( MessageStatusHolder . CACHE . userID2UnRead . containsKey ( _userId ) ) { ret = MessageStatusHolder . CACHE . userID2UnRead . get ( _userId ) ; } return ret ; }
Count of unread messages .
9,946
public void setNode ( int number , Vector3D v ) { setNode ( number , v . getX ( ) , v . getY ( ) , v . getZ ( ) ) ; }
Sets coordinate of nodes of this Bezier .
9,947
public void setAnchorColor ( int index , Color color ) { if ( index <= 0 ) { if ( startColor == null ) { startColor = new RGBColor ( 0.0 , 0.0 , 0.0 ) ; } setGradation ( true ) ; this . startColor = color ; } else if ( index >= 1 ) { if ( endColor == null ) { endColor = new RGBColor ( 0.0 , 0.0 , 0.0 ) ; } setGradation...
Sets the color of the anchor point for gradation .
9,948
public final double getWidth ( int line ) { if ( strArray . length == 0 ) return 0.0 ; try { return textRenderer . getBounds ( strArray [ line ] ) . getWidth ( ) ; } catch ( GLException e ) { reset = true ; } return 0.0 ; }
Returns letter s width of the current font at its current size and line .
9,949
public final void setFont ( Font font ) { this . font = font ; textRenderer = new TextRenderer ( font . getAWTFont ( ) , true , true ) ; }
Sets the Font of this Text .
9,950
public static PermissionSet getPermissionSet ( final Instance _instance ) throws EFapsException { Evaluation . LOG . debug ( "Evaluation PermissionSet for {}" , _instance ) ; final Key accessKey = Key . get4Instance ( _instance ) ; final PermissionSet ret = AccessCache . getPermissionCache ( ) . get ( accessKey ) ; Eva...
Gets the permissions .
9,951
public static PermissionSet getPermissionSet ( final Instance _instance , final boolean _evaluate ) throws EFapsException { Evaluation . LOG . debug ( "Retrieving PermissionSet for {}" , _instance ) ; final Key accessKey = Key . get4Instance ( _instance ) ; final PermissionSet ret ; if ( AccessCache . getPermissionCach...
Gets the PermissionSet .
9,952
public static Status getStatus ( final Instance _instance ) throws EFapsException { Evaluation . LOG . debug ( "Retrieving Status for {}" , _instance ) ; long statusId = 0 ; if ( _instance . getType ( ) . isCheckStatus ( ) ) { final Cache < String , Long > cache = AccessCache . getStatusCache ( ) ; if ( cache . contain...
Gets the status .
9,953
public static void evalStatus ( final Collection < Instance > _instances ) throws EFapsException { Evaluation . LOG . debug ( "Evaluating Status for {}" , _instances ) ; if ( CollectionUtils . isNotEmpty ( _instances ) ) { final Cache < String , Long > cache = AccessCache . getStatusCache ( ) ; final List < Instance > ...
Eval status .
9,954
public static String addZerosBefore ( String orderNo , int count ) { if ( orderNo == null ) { return "" ; } if ( orderNo . length ( ) > count ) { orderNo = "?" + orderNo . substring ( orderNo . length ( ) - count - 1 , orderNo . length ( ) - 1 ) ; } else { int le = orderNo . length ( ) ; for ( int i = 0 ; i < count - l...
Method addZerosBefore .
9,955
public Map < String , Set < DataPoint > > getSeries ( ) { return new HashMap < String , Set < DataPoint > > ( store ) ; }
Gets a mapping from series to an unordered set of DataPoints .
9,956
public void addDataPoint ( String series , DataPoint dataPoint ) { DataSet set = store . get ( series ) ; if ( set == null ) { set = new DataSet ( ) ; store . put ( series , set ) ; } set . add ( dataPoint ) ; }
Adds a new data point to a particular series .
9,957
public void addDataPointSet ( String series , Set < DataPoint > dataPoints ) { DataSet set = store . get ( series ) ; if ( set == null ) { set = new DataSet ( dataPoints ) ; store . put ( series , set ) ; } else { set . addAll ( dataPoints ) ; } }
Adds a set of DataPoint s to a series .
9,958
public JSONObject serialize ( Map < String , Object > out ) { JSONObject json = new JSONObject ( ) ; json . put ( "device_id" , deviceId ) ; json . put ( "project_id" , projectId ) ; out . put ( "device_id" , deviceId ) ; out . put ( "project_id" , projectId ) ; JSONArray sourcesArr = new JSONArray ( ) ; List < String ...
Custom serialization method for this object to JSON .
9,959
public Vector3D getVertex ( int index ) { tmpV . setX ( cornerX . get ( index ) ) ; tmpV . setY ( cornerY . get ( index ) ) ; tmpV . setZ ( cornerZ . get ( index ) ) ; calcG ( ) ; return tmpV ; }
Gets the corner of Polygon .
9,960
public void removeVertex ( int index ) { this . cornerX . remove ( index ) ; this . cornerY . remove ( index ) ; this . cornerZ . remove ( index ) ; if ( isGradation ( ) == true ) this . cornerColor . remove ( index ) ; setNumberOfCorner ( this . cornerX . size ( ) ) ; calcG ( ) ; }
Removes the corner of Polygon .
9,961
public void setVertex ( int i , double x , double y , double z ) { this . cornerX . set ( i , x ) ; this . cornerY . set ( i , y ) ; this . cornerZ . set ( i , z ) ; calcG ( ) ; }
Sets the coordinates of the corner .
9,962
public void setCornerColor ( int index , Color color ) { if ( cornerColor == null ) { for ( int i = 0 ; i < cornerX . size ( ) ; i ++ ) { cornerColor . add ( new RGBColor ( this . fillColor . getRed ( ) , this . fillColor . getGreen ( ) , this . fillColor . getBlue ( ) , this . fillColor . getAlpha ( ) ) ) ; } setGrada...
Sets the color of a corner .
9,963
public static List < DataPoint > parse ( int [ ] values , long ts ) { List < DataPoint > ret = new ArrayList < DataPoint > ( values . length ) ; for ( int v : values ) { ret . add ( new DataPoint ( ts , v ) ) ; } return ret ; }
Takes an array of values and converts it into a list of DataPoint s with the same timestamp .
9,964
@ SuppressWarnings ( "unchecked" ) public static < G , ERR > Or < G , Every < ERR > > when ( Or < ? extends G , ? extends Every < ? extends ERR > > or , Function < ? super G , ? extends Validation < ERR > > ... validations ) { return when ( or , Stream . of ( validations ) ) ; }
Enables further validation on an existing accumulating Or by passing validation functions .
9,965
public static < A , B , ERR , RESULT > Or < RESULT , Every < ERR > > withGood ( Or < ? extends A , ? extends Every < ? extends ERR > > a , Or < ? extends B , ? extends Every < ? extends ERR > > b , BiFunction < ? super A , ? super B , ? extends RESULT > function ) { if ( allGood ( a , b ) ) return Good . of ( function ...
Combines two accumulating Or into a single one using the given function . The resulting Or will be a Good if both Ors are Goods otherwise it will be a Bad containing every error in the Bads .
9,966
public Vector3D getVertex ( int i ) { tmpV . setX ( x . get ( i ) ) ; tmpV . setY ( y . get ( i ) ) ; tmpV . setZ ( z . get ( i ) ) ; calcG ( ) ; return tmpV ; }
Gets the coordinates of the point .
9,967
public void removeVertex ( int i ) { this . x . remove ( i ) ; this . y . remove ( i ) ; this . z . remove ( i ) ; this . colors . remove ( i ) ; calcG ( ) ; }
Removes the point from Lines .
9,968
public void setVertex ( int i , double x , double y ) { this . x . set ( i , x ) ; this . y . set ( i , y ) ; this . z . set ( i , 0d ) ; calcG ( ) ; }
Sets the coordinates of the point .
9,969
public void setStartCornerColor ( Color color ) { if ( startColor == null ) { startColor = new RGBColor ( 0.0 , 0.0 , 0.0 ) ; } setGradation ( true ) ; this . startColor = color ; }
Sets the start point s color for gradation .
9,970
public void setEndCornerColor ( Color color ) { if ( endColor == null ) { endColor = new RGBColor ( 0.0 , 0.0 , 0.0 ) ; } setGradation ( true ) ; this . endColor = color ; }
Sets the end point s color for gradation .
9,971
public void setCornerColor ( int index , Color color ) { if ( ! cornerGradation ) { cornerGradation = true ; } colors . set ( index , color ) ; }
Sets the point s color for gradation .
9,972
public boolean hasTransitionTo ( CharRange condition , NFAState < T > state ) { Set < Transition < NFAState < T > > > set = transitions . get ( condition ) ; if ( set != null ) { for ( Transition < NFAState < T > > tr : set ) { if ( state . equals ( tr . getTo ( ) ) ) { return true ; } } } return false ; }
Returns true if transition with condition to state exists
9,973
public RangeSet getConditionsTo ( NFAState < T > state ) { RangeSet rs = new RangeSet ( ) ; for ( CharRange range : transitions . keySet ( ) ) { if ( range != null ) { Set < Transition < NFAState < T > > > set2 = transitions . get ( range ) ; for ( Transition < NFAState < T > > tr : set2 ) { if ( state . equals ( tr . ...
Returns non epsilon confitions to transit to given state
9,974
public static boolean isSingleEpsilonOnly ( Set < Transition < NFAState > > set ) { if ( set . size ( ) != 1 ) { return false ; } for ( Transition < NFAState > tr : set ) { if ( tr . isEpsilon ( ) ) { return true ; } } return false ; }
Returns true if set only has one epsilon transition .
9,975
boolean isDeadEnd ( Set < NFAState < T > > nfaSet ) { for ( Set < Transition < NFAState < T > > > set : transitions . values ( ) ) { for ( Transition < NFAState < T > > t : set ) { if ( ! nfaSet . contains ( t . getTo ( ) ) ) { return false ; } } } return true ; }
Returns true if this state is not accepting and doesn t have any outbound transitions .
9,976
public DFAState < T > constructDFA ( Scope < DFAState < T > > dfaScope ) { Map < Set < NFAState < T > > , DFAState < T > > all = new HashMap < > ( ) ; Deque < DFAState < T > > unmarked = new ArrayDeque < > ( ) ; Set < NFAState < T > > startSet = epsilonClosure ( dfaScope ) ; DFAState < T > startDfa = new DFAState < > (...
Construct a dfa by using this state as starting state .
9,977
RangeSet getConditions ( ) { RangeSet is = new RangeSet ( ) ; for ( CharRange ic : transitions . keySet ( ) ) { if ( ic != null ) { is . add ( ic ) ; } } return is ; }
Returns all ranges from all transitions
9,978
private Set < NFAState < T > > epsilonTransitions ( StateVisitSet < NFAState < T > > marked ) { marked . add ( this ) ; Set < NFAState < T > > set = new HashSet < > ( ) ; for ( NFAState < T > nfa : epsilonTransit ( ) ) { if ( ! marked . contains ( nfa ) ) { set . add ( nfa ) ; set . addAll ( nfa . epsilonTransitions ( ...
Returns a set of states that can be reached by epsilon transitions .
9,979
public Set < NFAState < T > > epsilonClosure ( Scope < DFAState < T > > scope ) { Set < NFAState < T > > set = new HashSet < > ( ) ; set . add ( this ) ; return epsilonClosure ( scope , set ) ; }
Creates a dfa state from all nfa states that can be reached from this state with epsilon move .
9,980
public void addTransition ( RangeSet rs , NFAState < T > to ) { for ( CharRange c : rs ) { addTransition ( c , to ) ; } edges . add ( to ) ; to . inStates . add ( this ) ; }
Adds a set of transitions
9,981
public Transition < NFAState < T > > addTransition ( CharRange condition , NFAState < T > to ) { Transition < NFAState < T > > t = new Transition < > ( condition , this , to ) ; Set < Transition < NFAState < T > > > set = transitions . get ( t . getCondition ( ) ) ; if ( set == null ) { set = new HashSet < > ( ) ; tran...
Adds a transition
9,982
public void addEpsilon ( NFAState < T > to ) { Transition < NFAState < T > > t = new Transition < > ( this , to ) ; Set < Transition < NFAState < T > > > set = transitions . get ( null ) ; if ( set == null ) { set = new HashSet < > ( ) ; transitions . put ( null , set ) ; } set . add ( t ) ; edges . add ( to ) ; to . i...
Adds a epsilon transition
9,983
public void addChildValueSelect ( final AbstractValueSelect _valueSelect ) throws EFapsException { if ( this . child == null ) { this . child = _valueSelect ; _valueSelect . setParentValueSelect ( this ) ; } else { this . child . addChildValueSelect ( _valueSelect ) ; } }
Method adds an AbstractValueSelect as a child of this chain of AbstractValueSelect .
9,984
public Object getValue ( final List < Object > _objectList ) throws EFapsException { final List < Object > ret = new ArrayList < Object > ( ) ; for ( final Object object : _objectList ) { ret . add ( getValue ( object ) ) ; } return _objectList . size ( ) > 0 ? ( ret . size ( ) > 1 ? ret : ret . get ( 0 ) ) : null ; }
Method to get the value for a list of object .
9,985
private void preparePrint ( final AbstractPrint _print ) throws EFapsException { for ( final Select select : _print . getSelection ( ) . getAllSelects ( ) ) { for ( final AbstractElement < ? > element : select . getElements ( ) ) { if ( element instanceof AbstractDataElement ) { ( ( AbstractDataElement < ? > ) element ...
Prepare print .
9,986
private void addTypeCriteria ( final QueryPrint _print ) { final MultiValuedMap < TableIdx , TypeCriteria > typeCriterias = MultiMapUtils . newListValuedHashMap ( ) ; final List < Type > types = _print . getTypes ( ) . stream ( ) . sorted ( ( type1 , type2 ) -> Long . compare ( type1 . getId ( ) , type2 . getId ( ) ) )...
Adds the type criteria .
9,987
private void executeUpdates ( ) throws EFapsException { ConnectionResource con = null ; try { con = Context . getThreadContext ( ) . getConnectionResource ( ) ; for ( final Entry < SQLTable , AbstractSQLInsertUpdate < ? > > entry : updatemap . entrySet ( ) ) { ( ( SQLUpdate ) entry . getValue ( ) ) . execute ( con ) ; ...
Execute the update .
9,988
@ SuppressWarnings ( "unchecked" ) protected boolean executeSQLStmt ( final ISelectionProvider _sqlProvider , final String _complStmt ) throws EFapsException { SQLRunner . LOG . debug ( "SQL-Statement: {}" , _complStmt ) ; boolean ret = false ; List < Object [ ] > rows = new ArrayList < > ( ) ; boolean cached = false ;...
Execute SQL stmt .
9,989
void processTedQueue ( ) { int totalProcessing = context . taskManager . calcWaitingTaskCountInAllChannels ( ) ; if ( totalProcessing >= TaskManager . LIMIT_TOTAL_WAIT_TASKS ) { logger . warn ( "Total size of waiting tasks ({}) already exceeded limit ({}), skip this iteration (2)" , totalProcessing , TaskManager . LIMI...
heads uniqueness by key1 should be guaranteed by unique index .
9,990
private void processEventQueue ( final TaskRec head ) { final TedResult headResult = processEvent ( head ) ; TaskConfig tc = context . registry . getTaskConfig ( head . name ) ; if ( tc == null ) { context . taskManager . handleUnknownTasks ( asList ( head ) ) ; return ; } TaskRec lastUnsavedEvent = null ; TedResult la...
process events from queue each after other until ERROR or RETRY will happen
9,991
static public String [ ] getAllProperties ( ) { java . util . Properties prop = System . getProperties ( ) ; java . util . ArrayList < String > list = new java . util . ArrayList < String > ( ) ; java . util . Enumeration < ? > enumeration = prop . propertyNames ( ) ; while ( enumeration . hasMoreElements ( ) ) { list ...
Get all property names .
9,992
public void set ( double fov , double aspect , double zNear , double zFar ) { this . fov = fov ; this . aspect = aspect ; this . zNear = zNear ; this . zFar = zFar ; }
Sets a perspective projection applying foreshortening making distant objects appear smaller than closer ones .
9,993
public static List < CharRange > removeOverlap ( CharRange r1 , CharRange r2 ) { assert r1 . intersect ( r2 ) ; List < CharRange > list = new ArrayList < CharRange > ( ) ; Set < Integer > set = new TreeSet < Integer > ( ) ; set . add ( r1 . getFrom ( ) ) ; set . add ( r1 . getTo ( ) ) ; set . add ( r2 . getFrom ( ) ) ;...
Returns a list of ranges that together gather the same characters as r1 and r2 . None of the resulting ranges doesn t intersect each other .
9,994
public String getHrefResolved ( ) { if ( Atom10Parser . isAbsoluteURI ( href ) ) { return href ; } else if ( baseURI != null && collectionElement != null ) { final int lastslash = baseURI . lastIndexOf ( "/" ) ; return Atom10Parser . resolveURI ( baseURI . substring ( 0 , lastslash ) , collectionElement , href ) ; } re...
Get resolved URI of the collection or null if impossible to determine
9,995
public String getHrefResolved ( final String relativeUri ) { if ( Atom10Parser . isAbsoluteURI ( relativeUri ) ) { return relativeUri ; } else if ( baseURI != null && collectionElement != null ) { final int lastslash = baseURI . lastIndexOf ( "/" ) ; return Atom10Parser . resolveURI ( baseURI . substring ( 0 , lastslas...
Get resolved URI using collection s baseURI or null if impossible to determine
9,996
public boolean accepts ( final String ct ) { for ( final Object element : accepts ) { final String accept = ( String ) element ; if ( accept != null && accept . trim ( ) . equals ( "*/*" ) ) { return true ; } final String entryType = "application/atom+xml" ; final boolean entry = entryType . equals ( ct ) ; if ( entry ...
Returns true if contentType is accepted by collection .
9,997
public Element collectionToElement ( ) { final Collection collection = this ; final Element element = new Element ( "collection" , AtomService . ATOM_PROTOCOL ) ; element . setAttribute ( "href" , collection . getHref ( ) ) ; final Element titleElem = new Element ( "title" , AtomService . ATOM_FORMAT ) ; titleElem . se...
Serialize an AtomService . Collection into an XML element
9,998
public void rotate ( double angle ) { double s = Math . sin ( angle ) ; double c = Math . cos ( angle ) ; double temp1 = m00 ; double temp2 = m01 ; m00 = c * temp1 + s * temp2 ; m01 = - s * temp1 + c * temp2 ; temp1 = m10 ; temp2 = m11 ; m10 = c * temp1 + s * temp2 ; m11 = - s * temp1 + c * temp2 ; }
Implementation roughly based on AffineTransform .
9,999
public Vector3D mult ( Vector3D source ) { Vector3D result = new Vector3D ( ) ; result . setX ( m00 * source . getX ( ) + m01 * source . getY ( ) + m02 ) ; result . setY ( m10 * source . getX ( ) + m11 * source . getY ( ) + m12 ) ; return result ; }
Multiply the x and y coordinates of a Vertex against this matrix .