idx
int64
0
41.2k
question
stringlengths
83
4.15k
target
stringlengths
5
715
15,500
public static void setConverterFactoryClass ( Configuration conf , Class < ? extends ConverterFactory > converterFactoryClass ) { conf . setClass ( CONVERTER_FACTORY , converterFactoryClass , ConverterFactory . class ) ; LOG . debug ( "Set input ConverterFactory class on conf: {}" , converterFactoryClass ) ; }
Sets the ConverterFactory class
15,501
static StructTypeInfo getTypeInfo ( Configuration conf ) { StructTypeInfo inputTypeInfo = ( StructTypeInfo ) TypeInfoUtils . getTypeInfoFromTypeString ( conf . get ( INPUT_TYPE_INFO ) ) ; LOG . debug ( "Got input typeInfo from conf: {}" , inputTypeInfo ) ; return inputTypeInfo ; }
Gets the StructTypeInfo that declares the columns to be read from the configuration
15,502
public static void setTypeInfo ( Configuration conf , StructTypeInfo typeInfo ) { conf . set ( INPUT_TYPE_INFO , typeInfo . getTypeName ( ) ) ; LOG . debug ( "Set input typeInfo on conf: {}" , typeInfo ) ; }
Sets the StructTypeInfo that declares the columns to be read in the configuration
15,503
static StructTypeInfo getSchemaTypeInfo ( Configuration conf ) { String schemaTypeInfo = conf . get ( SCHEMA_TYPE_INFO ) ; if ( schemaTypeInfo != null && ! schemaTypeInfo . isEmpty ( ) ) { LOG . debug ( "Got schema typeInfo from conf: {}" , schemaTypeInfo ) ; return ( StructTypeInfo ) TypeInfoUtils . getTypeInfoFromTyp...
Gets the StructTypeInfo that declares the total schema of the file from the configuration
15,504
public static void setSchemaTypeInfo ( Configuration conf , StructTypeInfo schemaTypeInfo ) { if ( schemaTypeInfo != null ) { conf . set ( SCHEMA_TYPE_INFO , schemaTypeInfo . getTypeName ( ) ) ; LOG . debug ( "Set schema typeInfo on conf: {}" , schemaTypeInfo ) ; } }
Sets the StructTypeInfo that declares the total schema of the file in the configuration
15,505
static void setReadColumns ( Configuration conf , StructTypeInfo actualStructTypeInfo ) { StructTypeInfo readStructTypeInfo = getTypeInfo ( conf ) ; LOG . info ( "Read StructTypeInfo: {}" , readStructTypeInfo ) ; List < Integer > ids = new ArrayList < > ( ) ; List < String > names = new ArrayList < > ( ) ; List < Strin...
Sets which fields are to be read from the ORC file
15,506
protected void addClassEditors ( BuilderModel model , String cprefix ) { List < ComponentClass > classes = model . getComponentClasses ( ) ; int size = classes . size ( ) ; for ( int ii = 0 ; ii < size ; ii ++ ) { ComponentClass cclass = classes . get ( ii ) ; if ( ! cclass . name . startsWith ( cprefix ) ) { continue ...
Adds editor user interface elements for each component class to allow the user to select the desired component .
15,507
public boolean isListening ( ) throws Exception { try { JSONObject resp = new JSONObject ( Get . get ( API_BASE_URL + ":" + API_PORT , Constants . REQUEST_HEARTBEAT , "" ) ) ; return true ; } catch ( Exception e ) { return false ; } }
Returns true if there is RoboRemoteServer currently listening
15,508
public JSONArray map ( String query , String method_name , Object ... items ) throws Exception { QueryBuilder builder = new QueryBuilder ( API_PORT ) ; builder . map ( query , method_name , items ) ; return builder . execute ( ) ; }
Used to call a method with a list of arguments
15,509
public static Tracker parseTracker ( JSONObject object ) throws JSONException { final int id = JsonInput . getInt ( object , "id" ) ; final String name = JsonInput . getStringNotNull ( object , "name" ) ; return new Tracker ( id , name ) ; }
Parses a tracker .
15,510
public static IssueStatus parseStatus ( JSONObject object ) throws JSONException { final int id = JsonInput . getInt ( object , "id" ) ; final String name = JsonInput . getStringNotNull ( object , "name" ) ; final IssueStatus result = new IssueStatus ( id , name ) ; if ( object . has ( "is_default" ) ) result . setDefa...
Parses a status .
15,511
public static Project parseMinimalProject ( JSONObject content ) throws JSONException { final Project result = new Project ( ) ; result . setId ( JsonInput . getInt ( content , "id" ) ) ; result . setIdentifier ( JsonInput . getStringOrNull ( content , "identifier" ) ) ; result . setName ( JsonInput . getStringNotNull ...
Parses a minimal version of a project .
15,512
public static Project parseProject ( JSONObject content ) throws JSONException { final Project result = new Project ( ) ; result . setId ( JsonInput . getInt ( content , "id" ) ) ; result . setIdentifier ( JsonInput . getStringOrNull ( content , "identifier" ) ) ; result . setName ( JsonInput . getStringNotNull ( conte...
Parses a project .
15,513
public int getRenderPriority ( String action , String component , int orientation ) { int ocount = ( _overrides != null ) ? _overrides . size ( ) : 0 ; for ( int ii = 0 ; ii < ocount ; ii ++ ) { PriorityOverride over = _overrides . get ( ii ) ; if ( over . matches ( action , component , orientation ) ) { return over . ...
Returns the render priority appropriate for the specified action orientation and component .
15,514
public void addPriorityOverride ( PriorityOverride override ) { if ( _overrides == null ) { _overrides = new ComparableArrayList < PriorityOverride > ( ) ; } _overrides . insertSorted ( override ) ; }
Adds the supplied render priority override record to this component class .
15,515
public int fringesOn ( int first , int second ) { FringeRecord f1 = _frecs . get ( first ) ; if ( null != f1 ) { if ( f1 . tilesets . size ( ) > 0 ) { FringeRecord f2 = _frecs . get ( second ) ; if ( ( null == f2 ) || ( f1 . priority > f2 . priority ) ) { return f1 . priority ; } } } return - 1 ; }
If the first base tileset fringes upon the second return the fringe priority of the first base tileset otherwise return - 1 .
15,516
public FringeTileSetRecord getFringe ( int baseset , int hashValue ) { FringeRecord f = _frecs . get ( baseset ) ; return f . tilesets . get ( hashValue % f . tilesets . size ( ) ) ; }
Get a random FringeTileSetRecord from amongst the ones listed for the specified base tileset .
15,517
public Window getWindow ( ) { Component parent = getParent ( ) ; while ( ! ( parent instanceof Window ) && parent != null ) { parent = parent . getParent ( ) ; } return ( Window ) parent ; }
from interface FrameManager . ManagedRoot
15,518
public String getAttributeString ( String attName ) { Object o = attributes . get ( attName ) ; if ( o == null ) { return null ; } else { return ( String ) o ; } }
Get the value for a given attribute .
15,519
private void maybeSetProperty ( final String name , final String value ) { if ( System . getProperty ( name ) == null ) { System . setProperty ( name , value ) ; } }
Helper to only set a property if not already set .
15,520
public void render ( Graphics2D gfx ) { Object oalias = SwingUtil . activateAntiAliasing ( gfx ) ; gfx . setColor ( getBackground ( ) ) ; gfx . fill ( _shape ) ; gfx . setColor ( _outline ) ; gfx . draw ( _shape ) ; SwingUtil . restoreAntiAliasing ( gfx , oalias ) ; if ( _icon != null ) { _icon . paintIcon ( _owner . g...
Render the chat glyph with no thought to dirty rectangles or restoring composites .
15,521
public void translate ( int dx , int dy ) { setLocation ( _bounds . x + dx , _bounds . y + dy ) ; }
Attempt to translate this glyph .
15,522
public static MisoSceneMetrics getSceneMetrics ( ) { return new MisoSceneMetrics ( config . getValue ( TILE_WIDTH_KEY , DEF_TILE_WIDTH ) , config . getValue ( TILE_HEIGHT_KEY , DEF_TILE_HEIGHT ) , config . getValue ( FINE_GRAN_KEY , DEF_FINE_GRAN ) ) ; }
Creates scene metrics with information obtained from the deployed config file .
15,523
public void onCreate ( SQLiteDatabase db ) { try { if ( builder . tables == null ) { throw new SQLiteHelperException ( "The array of String tables can't be null!!" ) ; } executePragma ( db ) ; builder . onCreateCallback . onCreate ( db ) ; } catch ( SQLiteHelperException e ) { Log . e ( this . getClass ( ) . toString (...
Called when the database is created for the first time . This is where the creation of tables and the initial population of the tables should happen .
15,524
public void onUpgrade ( SQLiteDatabase db , int oldVersion , int newVersion ) { try { if ( builder . tableNames == null ) { throw new SQLiteHelperException ( "The array of String tableNames can't be null!!" ) ; } builder . onUpgradeCallback . onUpgrade ( db , oldVersion , newVersion ) ; } catch ( SQLiteHelperException ...
Called when the database needs to be upgraded . The implementation should use this method to drop tables add tables or do anything else it needs to upgrade to the new schema version .
15,525
static String getHex ( Color color ) { return String . format ( "#%02x%02x%02x%02x" , color . getRed ( ) , color . getGreen ( ) , color . getBlue ( ) , color . getAlpha ( ) ) ; }
create rgba hex from a java color
15,526
public List < ConnectionListener > getConnectionListeners ( ) { if ( changes == null ) { return ( List < ConnectionListener > ) Collections . EMPTY_LIST ; } List < EventListener > listeners = changes . getListenerList ( AMQP ) ; if ( ( listeners == null ) || listeners . isEmpty ( ) ) { return ( List < ConnectionListene...
Returns the list of ConnectionListeners registered with this AmqpClient instance .
15,527
public void connect ( String url , String virtualHost , String username , String password ) { if ( websocket != null ) { throw new IllegalStateException ( "AmqpClient already connected" ) ; } this . readyState = ReadyState . CONNECTING ; this . url = url ; this . userName = username ; this . password = password ; this ...
Connect to AMQP Broker via Kaazing Gateway
15,528
public void disconnect ( ) { if ( readyState == ReadyState . OPEN ) { this . closeConnection ( 0 , "" , 0 , 0 , null , null ) ; } else if ( readyState == ReadyState . CONNECTING ) { socketClosedHandler ( ) ; } }
Disconnects from Amqp Server .
15,529
public AmqpChannel openChannel ( ) { int id = ++ this . channelCount ; AmqpChannel chan = new AmqpChannel ( id , this ) ; channels . put ( id , chan ) ; return chan ; }
Opens a channel on server .
15,530
void closedHandler ( Object context , String input , Object frame , String stateName ) { if ( getReadyState ( ) == ReadyState . CLOSED ) { return ; } if ( this . channels . size ( ) != 0 ) { for ( int i = 1 ; i <= this . channels . size ( ) ; i ++ ) { AmqpChannel channel = this . channels . get ( i ) ; AmqpFrame f = ne...
should be the order following in all our client implementations .
15,531
private void socketClosedHandler ( ) { if ( getReadyState ( ) == ReadyState . CLOSED ) { return ; } if ( this . channels . size ( ) != 0 ) { for ( int i = 1 ; i <= this . channels . size ( ) ; i ++ ) { AmqpChannel channel = this . channels . get ( i ) ; AmqpFrame f = new AmqpFrame ( ) ; f . setMethodName ( "closeChanne...
closing the channels raising events and such .
15,532
AmqpClient tuneOkConnection ( int channelMax , int frameMax , int heartbeat ) { this . tuneOkConnection ( channelMax , frameMax , heartbeat , null , null ) ; return this ; }
Sends a TuneOkConnection to server .
15,533
AmqpClient closeOkConnection ( Continuation callback , ErrorHandler error ) { Object [ ] args = { } ; AmqpBuffer bodyArg = null ; String methodName = "closeOkConnection" ; String methodId = "10" + "50" ; AmqpMethod amqpMethod = MethodLookup . LookupMethod ( methodId ) ; Object [ ] arguments = { this , amqpMethod , this...
Sends a CloseOkConnection to server .
15,534
private void fireOnClosed ( ConnectionEvent e ) { List < EventListener > listeners = changes . getListenerList ( AMQP ) ; for ( EventListener listener : listeners ) { ConnectionListener amqpListener = ( ConnectionListener ) listener ; amqpListener . onConnectionClose ( e ) ; } }
Occurs when the connection to the AMQP server is closed
15,535
protected CompositedMirage createCompositedMirage ( int index ) { if ( _sources . length == 1 && _sources [ 0 ] . frames instanceof TileSetFrameImage ) { TileSetFrameImage frames = ( TileSetFrameImage ) _sources [ 0 ] . frames ; Rectangle tbounds = new Rectangle ( ) ; frames . getTrimmedBounds ( _orient , index , tboun...
Creates a composited image for the specified frame .
15,536
protected void createComponent ( int componentId , String cclass , String cname , FrameProvider fprov ) { ComponentClass clazz = _classes . get ( cclass ) ; if ( clazz == null ) { log . warning ( "Non-existent component class" , "class" , cclass , "name" , cname , "id" , componentId ) ; return ; } CharacterComponent co...
Creates a component and inserts it into the component table .
15,537
public void setFrames ( MultiFrameImage frames ) { if ( frames == null ) { return ; } if ( frames == _frames ) { return ; } _frames = frames ; _frameIdx = 0 ; layout ( ) ; }
Set the image array used to render the sprite .
15,538
protected void setFrameIndex ( int frameIdx , boolean forceUpdate ) { frameIdx = ( frameIdx % _frames . getFrameCount ( ) ) ; if ( frameIdx == _frameIdx && ! forceUpdate ) { return ; } else { _frameIdx = frameIdx ; } Rectangle dirty = new Rectangle ( _bounds ) ; accomodateFrame ( _frameIdx , _frames . getWidth ( _frame...
Instructs the sprite to display the specified frame index .
15,539
private MetricGroup up_down_host_ ( String host , boolean up ) { final GroupName group = GroupName . valueOf ( getBasePath ( ) , Tags . valueOf ( singletonMap ( "host" , MetricValue . fromStrValue ( host ) ) ) ) ; return new SimpleMetricGroup ( group , singleton ( up ? UP_METRIC : DOWN_METRIC ) ) ; }
Return a metric group indicating if the host is up or down .
15,540
public static synchronized JspFactory getDefaultFactory ( ) { if ( deflt == null ) { try { Class factory = Class . forName ( "org.apache.jasper.runtime.JspFactoryImpl" ) ; if ( factory != null ) { deflt = ( JspFactory ) factory . newInstance ( ) ; } } catch ( Exception ex ) { } } return deflt ; }
Returns the default factory for this implementation .
15,541
public VariableInfo [ ] getVariableInfo ( TagData data ) { VariableInfo [ ] result = null ; TagExtraInfo tei = getTagExtraInfo ( ) ; if ( tei != null ) { result = tei . getVariableInfo ( data ) ; } return result ; }
Information on the scripting objects created by this tag at runtime . This is a convenience method on the associated TagExtraInfo class .
15,542
private String getProperty ( final String name ) { assert name != null ; ensureConfigured ( ) ; return evaluate ( System . getProperty ( name , props . getProperty ( name ) ) ) ; }
Get the value of a property checking system properties then configuration properties and evaluating the result .
15,543
public static Collection < Attribute > fromJson ( ObjectNode object ) throws IOException { Collection < Attribute > attributes = new HashSet < > ( ) ; convertJsonObject ( attributes , object , "" , 0 , new HashMap < > ( ) ) ; return attributes ; }
Flattens a raw nested json string representation into a collection of attributes .
15,544
public static String toJsonString ( Collection < Attribute > attributeCollection , ObjectMapper objectMapper ) throws JsonProcessingException { return objectMapper . writeValueAsString ( toObject ( attributeCollection ) ) ; }
Re - expands a flattened json representation from a collection of attributes back into a raw nested json string .
15,545
public BaseTile getFringeTile ( MisoSceneModel scene , int col , int row , Map < FringeTile , WeakReference < FringeTile > > fringes , Map < Long , BufferedImage > masks ) { int underset = adjustTileSetId ( scene . getBaseTileId ( col , row ) >> 16 ) ; _fringers . clear ( ) ; boolean passable = true ; for ( int y = row...
Compute and return the fringe tile to be inserted at the specified location .
15,546
protected FringeTile composeFringeTile ( FringerRec [ ] fringers , Map < FringeTile , WeakReference < FringeTile > > fringes , int hashValue , boolean passable , Map < Long , BufferedImage > masks ) { QuickSort . sort ( fringers ) ; List < Long > keys = Lists . newArrayList ( ) ; for ( FringerRec fringer : fringers ) {...
Compose a FringeTile out of the various fringe images needed .
15,547
protected BufferedImage getTileImage ( BufferedImage img , FringeConfiguration . FringeTileSetRecord tsr , int baseset , int index , int hashValue , Map < Long , BufferedImage > masks ) throws NoSuchTileSetException { int fringeset = tsr . fringe_tsid ; TileSet fset = _tmgr . getTileSet ( fringeset ) ; if ( ! tsr . mas...
Retrieve or compose an image for the specified fringe .
15,548
protected int [ ] getFringeIndexes ( int bits ) { int index = BITS_TO_INDEX [ bits ] ; if ( index != - 1 ) { int [ ] ret = new int [ 1 ] ; ret [ 0 ] = index ; return ret ; } int start = 0 ; while ( ( ( ( 1 << start ) & bits ) != 0 ) && ( start < NUM_FRINGEBITS ) ) { start ++ ; } if ( start == NUM_FRINGEBITS ) { return ...
Get the fringe index specified by the fringebits . If no index is available try breaking down the bits into contiguous regions of bits and look for indexes for those .
15,549
public Sound getSound ( String path ) { ClipBuffer buffer = null ; if ( _manager . isInitialized ( ) ) { buffer = _manager . getClip ( _provider , path ) ; } return ( buffer == null ) ? new BlankSound ( ) : new Sound ( this , buffer ) ; }
Obtains an instance of the specified sound which can be positioned played looped and otherwise used to make noise .
15,550
public void dispose ( ) { reclaimAll ( ) ; for ( PooledSource pooled : _sources ) { pooled . source . delete ( ) ; } _sources . clear ( ) ; _manager . removeGroup ( this ) ; }
Disposes this sound group freeing up the OpenAL sources with which it is associated . All sounds obtained from this group will no longer be usable and should be discarded .
15,551
public void reclaimAll ( ) { for ( PooledSource pooled : _sources ) { if ( pooled . holder != null ) { pooled . holder . stop ( ) ; pooled . holder . reclaim ( ) ; pooled . holder = null ; } } }
Stops and reclaims all sounds from this sound group but does not free the sources .
15,552
protected void baseGainChanged ( ) { for ( int ii = 0 , nn = _sources . size ( ) ; ii < nn ; ii ++ ) { Sound holder = _sources . get ( ii ) . holder ; if ( holder != null ) { holder . updateSourceGain ( ) ; } } }
Called by the manager when the base gain has changed .
15,553
protected void setFrameIndex ( int fidx ) { _fidx = fidx ; _bounds . width = _frames . getWidth ( _fidx ) ; _bounds . height = _frames . getHeight ( _fidx ) ; }
Sets the frame index and updates our dimensions .
15,554
public synchronized T read ( T dto ) throws Exception { Cursor cursor = db . query ( transformer . getTableName ( ) , transformer . getFields ( ) , transformer . getWhereClause ( dto ) , null , null , null , null ) ; T object = null ; if ( cursor . moveToFirst ( ) ) { object = transformer . transform ( cursor ) ; } ret...
Convenience method for reading rows in the database .
15,555
public synchronized Collection < T > readAll ( ) throws Exception { Cursor cursor = db . query ( transformer . getTableName ( ) , transformer . getFields ( ) , null , null , null , null , null ) ; Collection < T > list = getAllCursor ( cursor ) ; return list ; }
Convenience method for reading all rows in the table of database .
15,556
public static int dot ( Point v1s , Point v1e , Point v2s , Point v2e ) { return ( ( v1e . x - v1s . x ) * ( v2e . x - v2s . x ) + ( v1e . y - v1s . y ) * ( v2e . y - v2s . y ) ) ; }
Computes and returns the dot product of the two vectors .
15,557
public static int dot ( Point vs , Point v1e , Point v2e ) { return ( ( v1e . x - vs . x ) * ( v2e . x - vs . x ) + ( v1e . y - vs . y ) * ( v2e . y - vs . y ) ) ; }
Computes and returns the dot product of the two vectors . The vectors are assumed to start with the same coordinate and end with different coordinates .
15,558
public static boolean lineIntersection ( Point2D p1 , Point2D p2 , boolean seg1 , Point2D p3 , Point2D p4 , boolean seg2 , Point2D result ) { double y43 = p4 . getY ( ) - p3 . getY ( ) ; double x21 = p2 . getX ( ) - p1 . getX ( ) ; double x43 = p4 . getX ( ) - p3 . getX ( ) ; double y21 = p2 . getY ( ) - p1 . getY ( ) ...
Calculate the intersection of two lines . Either line may be considered as a line segment and the intersecting point is only considered valid if it lies upon the segment . Note that Point extends Point2D .
15,559
public static Rectangle grow ( Rectangle source , Rectangle target ) { if ( target == null ) { log . warning ( "Can't grow with null rectangle [src=" + source + ", tgt=" + target + "]." , new Exception ( ) ) ; } else if ( source == null ) { source = new Rectangle ( target ) ; } else { source . add ( target ) ; } return...
Adds the target rectangle to the bounds of the source rectangle . If the source rectangle is null a new rectangle is created that is the size of the target rectangle .
15,560
public static Rectangle getTile ( int width , int height , int tileWidth , int tileHeight , int tileIndex ) { Rectangle bounds = new Rectangle ( ) ; getTile ( width , height , tileWidth , tileHeight , tileIndex , bounds ) ; return bounds ; }
Returns the rectangle containing the specified tile in the supplied larger rectangle . Tiles go from left to right top to bottom .
15,561
public static void getTile ( int width , int height , int tileWidth , int tileHeight , int tileIndex , Rectangle bounds ) { int tilesPerRow = width / tileWidth ; if ( tilesPerRow == 0 ) { bounds . setBounds ( 0 , 0 , width , height ) ; } else { int row = tileIndex / tilesPerRow ; int col = tileIndex % tilesPerRow ; bou...
Fills in the bounds of the specified tile in the supplied larger rectangle . Tiles go from left to right top to bottom .
15,562
private void setNegotiatedExtensions ( String extensionsHeader ) { if ( ( extensionsHeader == null ) || ( extensionsHeader . trim ( ) . length ( ) == 0 ) ) { _negotiatedExtensions = null ; return ; } String [ ] extns = extensionsHeader . split ( "," ) ; List < String > extnNames = new ArrayList < String > ( ) ; for ( S...
RFC 3864 format .
15,563
public static int scrollToIndex ( String listRef , int itemIndex ) throws Exception { int listViewIndex = getListViewIndex ( listRef ) ; if ( itemIndex >= numItemsInList ( listRef ) ) throw new Exception ( "Item index is greater than number of items in the list" ) ; QueryBuilder builder = new QueryBuilder ( ) ; int fir...
Scrolls the specified item index onto the screen and returns the offset based on the current visible list
15,564
public int value ( ) { int end = Math . min ( _history . length , _index ) ; int value = 0 ; for ( int ii = 0 ; ii < end ; ii ++ ) { value += _history [ ii ] ; } return ( end > 0 ) ? ( value / end ) : 0 ; }
Returns the current averaged value .
15,565
protected Frob loop ( String pkgPath , String key , float pan , byte cmd ) { SoundKey skey = new SoundKey ( cmd , pkgPath , key , 0 , _clipVol , pan ) ; addToPlayQueue ( skey ) ; return skey ; }
Loop the specified sound .
15,566
protected void addToPlayQueue ( SoundKey skey ) { boolean queued = enqueue ( skey , true ) ; if ( queued ) { if ( _verbose . getValue ( ) ) { log . info ( "Sound request [key=" + skey . key + "]." ) ; } } else { log . warning ( "SoundManager not playing sound because too many sounds in queue " + "[key=" + skey + "]." )...
Add the sound clip key to the queue to be played .
15,567
protected boolean enqueue ( SoundKey key , boolean okToStartNew ) { boolean add ; boolean queued ; synchronized ( _queue ) { if ( key . cmd == PLAY && _queue . size ( ) > MAX_QUEUE_SIZE ) { queued = add = false ; } else { _queue . appendLoud ( key ) ; queued = true ; add = okToStartNew && ( _freeSpoolers == 0 ) && ( _s...
Enqueue a new SoundKey .
15,568
protected void spoolerRun ( ) { while ( true ) { try { SoundKey key ; synchronized ( _queue ) { _freeSpoolers ++ ; key = _queue . get ( MAX_WAIT_TIME ) ; _freeSpoolers -- ; if ( key == null || key . cmd == DIE ) { _spoolerCount -- ; if ( key != null && _spoolerCount > 0 ) { _queue . appendLoud ( key ) ; } return ; } } ...
This is the primary run method of the sound - playing threads .
15,569
protected void processKey ( SoundKey key ) throws Exception { switch ( key . cmd ) { case PLAY : case LOOP : playSound ( key ) ; break ; case LOCK : if ( ! isTesting ( ) ) { synchronized ( _clipCache ) { try { getClipData ( key ) ; _lockedClips . put ( key , _clipCache . get ( key ) ) ; } catch ( Exception e ) { if ( _...
Process the requested command in the specified SoundKey .
15,570
protected byte [ ] getClipData ( SoundKey key ) throws IOException , UnsupportedAudioFileException { byte [ ] [ ] data ; synchronized ( _clipCache ) { if ( isTesting ( ) ) { _clipCache . clear ( ) ; } data = _clipCache . get ( key ) ; if ( data == null ) { data = _lockedClips . get ( key ) ; } if ( data == null ) { Inp...
Called by spooling threads loads clip data from the resource manager or the cache .
15,571
protected static void adjustVolume ( Line line , float vol ) { FloatControl control = ( FloatControl ) line . getControl ( FloatControl . Type . MASTER_GAIN ) ; float gain ; if ( vol == 0f ) { gain = control . getMinimum ( ) ; } else { gain = ( float ) ( ( Math . log ( vol ) / Math . log ( 10.0 ) ) * 20.0 ) ; } control...
Use the gain control to implement volume .
15,572
protected static void adjustPan ( Line line , float pan ) { try { FloatControl control = ( FloatControl ) line . getControl ( FloatControl . Type . PAN ) ; control . setValue ( pan ) ; } catch ( Exception e ) { log . debug ( "Cannot set pan on line: " + e ) ; } }
Set the pan value for the specified line .
15,573
public void tick ( long tickStamp ) { if ( _nextTime == - 1 ) { _nextTime = tickStamp + _initDelay ; } else if ( tickStamp >= _nextTime ) { if ( _repeatDelay != 0L ) { _nextTime += _repeatDelay ; } else { _nextTime = - 1 ; cancel ( ) ; } expired ( ) ; } }
documentation inherited from FrameParticipant
15,574
private AffineTransform getRotationTransform ( ) { double theta ; switch ( _orient ) { case NORTH : default : theta = 0.0 ; break ; case SOUTH : theta = Math . PI ; break ; case EAST : theta = Math . PI * 0.5 ; break ; case WEST : theta = - Math . PI * 0.5 ; break ; case NORTHEAST : theta = Math . PI * 0.25 ; break ; c...
Computes and returns the rotation transform for this sprite .
15,575
public Stream < Entry < MatchedName , MetricValue > > filter ( Context t ) { return t . getTSData ( ) . getCurrentCollection ( ) . get ( this :: match , x -> true ) . stream ( ) . flatMap ( this :: filterMetricsInTsv ) ; }
Create a stream of TimeSeriesMetricDeltas with values .
15,576
public static final Color blend ( Color c1 , Color c2 ) { return new Color ( ( c1 . getRed ( ) + c2 . getRed ( ) ) >> 1 , ( c1 . getGreen ( ) + c2 . getGreen ( ) ) >> 1 , ( c1 . getBlue ( ) + c2 . getBlue ( ) ) >> 1 ) ; }
Blends the two supplied colors .
15,577
public static final Color blend ( Color c1 , Color c2 , float firstperc ) { float p2 = 1.0f - firstperc ; return new Color ( ( int ) ( c1 . getRed ( ) * firstperc + c2 . getRed ( ) * p2 ) , ( int ) ( c1 . getGreen ( ) * firstperc + c2 . getGreen ( ) * p2 ) , ( int ) ( c1 . getBlue ( ) * firstperc + c2 . getBlue ( ) * p...
Blends the two supplied colors using the supplied percentage as the amount of the first color to use .
15,578
protected void setupLogging ( final Level level ) { SLF4JBridgeHandler . removeHandlersForRootLogger ( ) ; SLF4JBridgeHandler . install ( ) ; Log . configure ( LoggerFactory . getILoggerFactory ( ) ) ; log . debug ( "Logging setup; level: {}" , level ) ; }
Setup logging environment .
15,579
public void addAnimations ( Animation [ ] anims ) { int acount = anims . length ; for ( int ii = 0 ; ii < acount ; ii ++ ) { addAnimation ( anims [ ii ] ) ; } }
Adds the supplied animations to the animation waiter for observation .
15,580
public static SoundManager createSoundManager ( RunQueue rqueue ) { if ( _soundmgr != null ) { throw new IllegalStateException ( "A sound manager has already been created." ) ; } _soundmgr = new SoundManager ( rqueue ) ; return _soundmgr ; }
Creates initializes and returns the singleton sound manager instance .
15,581
public void updateStreams ( float time ) { for ( int ii = _streams . size ( ) - 1 ; ii >= 0 ; ii -- ) { _streams . get ( ii ) . update ( time ) ; } deleteFinalizedObjects ( ) ; }
Updates all of the streams controlled by the manager . This should be called once per frame by the application .
15,582
public void loadClip ( ClipProvider provider , String path , Observer observer ) { getClip ( provider , path , observer ) ; }
Loads a clip buffer for the sound clip loaded via the specified provider with the specified path . The loaded clip is placed in the cache .
15,583
protected synchronized void deleteFinalizedObjects ( ) { if ( _finalizedSources != null ) { IntBuffer idbuf = BufferUtils . createIntBuffer ( _finalizedSources . length ) ; idbuf . put ( _finalizedSources ) . rewind ( ) ; AL10 . alDeleteSources ( idbuf ) ; _finalizedSources = null ; } if ( _finalizedBuffers != null ) {...
Deletes all finalized objects .
15,584
protected void paintLabels ( Graphics2D gfx , int x , int y ) { _label . render ( gfx , x , y ) ; }
Derived classes may wish to extend score animation and render more than just the standard single label .
15,585
public void addRule ( ValidationData vd ) { this . rules . addAll ( vd . getValidationRules ( ) . stream ( ) . filter ( vr -> vr . isUse ( ) ) . collect ( Collectors . toList ( ) ) ) ; }
Add rule .
15,586
public void initDataGroup ( ParamType paramType , List < ValidationData > lists ) { this . paramType = paramType ; lists . forEach ( vd -> { this . addRule ( vd ) ; } ) ; }
Init data group .
15,587
public HandlerRegistration addMapZoomEndHandler ( final Runnable zoomHandler ) { return mapWidget . addZoomChangeHandler ( zoomChangeMapEvent -> zoomHandler . run ( ) ) ; }
Add zoom handler event is not exposed at present
15,588
public boolean sameProduct ( JProduct p , Map < String , String > featLinks , boolean exactContent ) { List < JCell > tempCells = new ArrayList < > ( this . cells ) ; if ( p . getCells ( ) . size ( ) != this . cells . size ( ) ) { return false ; } for ( JCell pC : p . getCells ( ) ) { for ( JCell thisC : this . cells )...
Compares cells of both products omitting ids
15,589
public static Annotation getAnnotation ( Annotation [ ] annotations , Class < ? > annotationClass ) { return Arrays . stream ( annotations ) . filter ( annotation -> annotation . annotationType ( ) . equals ( annotationClass ) ) . findFirst ( ) . orElse ( null ) ; }
Gets annotation .
15,590
public List < ValidationData > getValidationDatas ( ParamType paramType , String key ) { if ( this . urlMap == null || this . validationDataRuleListMap == null ) { log . info ( "url map is empty :: " + key ) ; return null ; } if ( key == null || paramType == null ) { throw new ValidationLibException ( "any parameter is...
Gets validation datas .
15,591
public static AssistType all ( ) { AssistType assistType = new AssistType ( ) ; assistType . nullable = true ; assistType . string = true ; assistType . number = true ; assistType . enumType = true ; assistType . list = true ; assistType . obj = true ; return assistType ; }
All assist type .
15,592
public List < ReqUrl > getReqUrls ( ) { String url = this . getClassMappingUrl ( this . getParentClass ( ) ) ; RequestAnnotation requestAnnotation = new RequestAnnotation ( this . getParentMethod ( ) ) ; url += this . getRequestMappingUrl ( requestAnnotation . getValue ( ) ) ; List < ReqUrl > list = new ArrayList < > (...
Gets req urls .
15,593
public boolean sameJSONFormat ( JSONFormat jf ) { Map < String , String > featLinks = new HashMap < > ( ) ; if ( ! this . name . equals ( jf . name ) || ! this . creator . equals ( jf . creator ) || ! this . license . equals ( jf . license ) || ! this . source . equals ( jf . source ) ) { return false ; } else if ( ! t...
Checks if the JSONFormat in parameter is the same as this omitting ids and jcell . jvalue . value content
15,594
private void validateFacetFields ( String [ ] facetFieldList ) { if ( facetFieldList == null || facetFieldList . length == 0 ) { return ; } for ( String facetfield : facetFieldList ) { if ( schema . getColumnIndex ( facetfield ) < 0 ) { throw new IllegalArgumentException ( "Facet field:" + facetfield + ", not found in ...
Check each facet field is present in schema .
15,595
private FacetList calculateFacetList ( AbstractDataTable table , String [ ] facetFields ) { if ( facetFields == null || facetFields . length == 0 ) { throw new NullPointerException ( "Facet field list empty" ) ; } FacetList facetList = new FacetList ( ) ; for ( String facetField : facetFields ) { Set < String > distinc...
facet field - > list of facet field values
15,596
public DataProvider getDataProvider ( ) { if ( this . dataProvider == null ) { DataSchema schema = getSchema ( ) ; String [ ] facetFieldList = getFacetFieldList ( ) ; final ApplicationContext applicationContext1 = getApplicationContext ( ) ; final DatasourceConfig config = applicationContext1 . getConfig ( DatasourceCo...
Lazy initialise Dataprovider
15,597
public void setConfigDynamically ( Config viewConfig ) { if ( viewConfig instanceof MapViewConfig ) { MapViewConfig newMapViewConfig = ( MapViewConfig ) viewConfig ; updateMapViewConfig ( newMapViewConfig ) ; } }
This method configures dynamically any config in the xml . Right now only overrides the coordinates of the map but it could be use to override any configuration
15,598
public void sessionCheck ( HttpServletRequest req ) { String authHeader = req . getHeader ( "Authorization" ) ; if ( authHeader != null && this . validationSessionCheck ( authHeader ) ) { return ; } if ( req . getCookies ( ) != null ) { Cookie cookie = Arrays . stream ( req . getCookies ( ) ) . filter ( ck -> ck . getN...
Session check .
15,599
public ValidationSessionInfo checkAuth ( ValidationLoginInfo info , HttpServletRequest req , HttpServletResponse res ) { if ( info . getToken ( ) == null || info . getToken ( ) . isEmpty ( ) ) { throw new ValidationLibException ( "UnAuthorization" , HttpStatus . UNAUTHORIZED ) ; } if ( this . validationConfig . getAuth...
Check auth validation session info .