idx
int64
0
34.9k
question
stringlengths
12
26.4k
target
stringlengths
15
2.15k
800
public NSObject [ ] objectsAtIndexes ( int ... indexes ) { NSObject [ ] result = new NSObject [ indexes . length ] ; Arrays . sort ( indexes ) ; for ( int i = 0 ; i < indexes . length ; i ++ ) result [ i ] = array [ indexes [ i ] ] ; return result ; }
Print the specified text to the specified PrintWriter.
801
private static Entry [ ] concat ( Entry [ ] attrs1 , Entry [ ] attrs2 ) { Entry [ ] nattrs = new Entry [ attrs1 . length + attrs2 . length ] ; System . arraycopy ( attrs1 , 0 , nattrs , 0 , attrs1 . length ) ; System . arraycopy ( attrs2 , 0 , nattrs , attrs1 . length , attrs2 . length ) ; return nattrs ; }
Create save-points asynchronously in order to not affect swiping performance on larger forms.
802
public static List < ShapeRecord > rectangle ( double startX , double startY , double width , double height ) { List < ShapeRecord > shapeRecords = new ArrayList < ShapeRecord > ( ) ; shapeRecords . add ( move ( startX , startY ) ) ; shapeRecords . addAll ( straightEdge ( startX , startY , width , startY ) ) ; shapeRecords . addAll ( straightEdge ( width , startY , width , height ) ) ; shapeRecords . addAll ( straightEdge ( width , height , startX , height ) ) ; shapeRecords . addAll ( straightEdge ( startX , height , startX , startY ) ) ; return shapeRecords ; }
Declare a named in-memory/on-disk cache.
803
public GlowServer ( ServerConfig config ) { materialValueManager = new BuiltinMaterialValueManager ( ) ; this . config = config ; opsList = new UuidListFile ( config . getFile ( "ops.json" ) ) ; whitelist = new UuidListFile ( config . getFile ( "whitelist.json" ) ) ; nameBans = new GlowBanList ( this , Type . NAME ) ; ipBans = new GlowBanList ( this , Type . IP ) ; Bukkit . setServer ( this ) ; loadConfig ( ) ; }
Parses the given json specification and extracts a list of column ids that are subject to recoding.
804
public FPSTextureView removeChild ( @ NonNull DisplayBase displayBase ) { displayBase . disable ( ) ; boolean a = mDisplayList . remove ( displayBase ) ; return this ; }
Open the HTTP connection
805
static int midPt ( final int a , final int b ) { return a + ( b - a ) / 2 ; }
The race is equal if it has the same id.
806
public static ReactiveSeq < Double > fromDoubleStream ( final DoubleStream stream ) { Objects . requireNonNull ( stream ) ; return StreamUtils . reactiveSeq ( stream . boxed ( ) , Optional . empty ( ) ) ; }
Test with a journal on which a single index has been registered with random data on the index.
807
String format ( Date source , StringBuffer toAppendTo ) { return source . toString ( ) ; }
Calculates control width and creates text layouts
808
public static boolean isExtension ( String filename , String [ ] extensions ) { if ( filename == null ) { return false ; } if ( extensions == null || extensions . length == 0 ) { return indexOfExtension ( filename ) == - 1 ; } String fileExt = getExtension ( filename ) ; for ( String extension : extensions ) { if ( fileExt . equals ( extension ) ) { return true ; } } return false ; }
The specified dimensions are used to locate a matching MediaSize instance from amongst all the standard MediaSize instances. If there is no exact match, the closest match is used. <p> The MediaSize is in turn used to locate the MediaSizeName object. This method may return null if the closest matching MediaSize has no corresponding Media instance. <p> This method is useful for clients which have only dimensions and want to find a Media which corresponds to the dimensions.
809
public static List < String > availableInstances ( ) throws IOException { Path confPath = Paths . get ( SystemProperties . getConfigurationProxyConfPath ( ) ) ; return subDirectoryNames ( confPath ) ; }
obtains the size of the panel and saves it in the history.
810
public LazyFutureStream < Integer > from ( final IntStream stream ) { return fromStream ( stream . boxed ( ) ) ; }
Action to do on drag start.
811
protected void resetOptions ( ) { m_trainSelector = new weka . attributeSelection . AttributeSelection ( ) ; setEvaluator ( new CfsSubsetEval ( ) ) ; setSearch ( new BestFirst ( ) ) ; m_SelectedAttributes = null ; }
Replace sequence of dots with single dot.
812
protected void limitTransAndScale ( Matrix matrix ) { float [ ] vals = new float [ 9 ] ; matrix . getValues ( vals ) ; float curTransX = vals [ Matrix . MTRANS_X ] ; float curScaleX = vals [ Matrix . MSCALE_X ] ; mScaleX = Math . max ( 1f , Math . min ( getMaxScale ( ) , curScaleX ) ) ; float maxTransX = - ( float ) mContentRect . width ( ) * ( mScaleX - 1f ) ; float newTransX = Math . min ( Math . max ( curTransX , maxTransX ) , 0 ) ; vals [ Matrix . MTRANS_X ] = newTransX ; vals [ Matrix . MSCALE_X ] = mScaleX ; matrix . setValues ( vals ) ; }
Removes from given list the first element that matches given predicate.
813
public void testGetInputEncoding ( ) throws Exception { assertEquals ( "US-ASCII" , documentA . getInputEncoding ( ) ) ; assertEquals ( "ISO-8859-1" , documentB . getInputEncoding ( ) ) ; }
Returns an attribute name by buffer. <p>C++ ownership: The return value is either released by the caller if the attribute is a duplicate or the ownership is transferred to HtmlAttributes and released upon clearing or destroying that object.
814
protected void closeDialogOk ( ) { dispose ( ) ; }
Creates new DChangePassword dialog where the parent is a dialog.
815
public static boolean isDangerous ( double d ) { return Double . isInfinite ( d ) || Double . isNaN ( d ) || d == 0.0 ; }
Compute replacement string for the given function.
816
public static byte [ ] fromBase58WithChecksum ( String s ) throws HyperLedgerException { byte [ ] b = fromBase58 ( s ) ; if ( b . length < 4 ) { throw new HyperLedgerException ( "Too short for checksum " + s ) ; } byte [ ] cs = new byte [ 4 ] ; System . arraycopy ( b , b . length - 4 , cs , 0 , 4 ) ; byte [ ] data = new byte [ b . length - 4 ] ; System . arraycopy ( b , 0 , data , 0 , b . length - 4 ) ; byte [ ] h = new byte [ 4 ] ; System . arraycopy ( Hash . hash ( data ) , 0 , h , 0 , 4 ) ; if ( Arrays . equals ( cs , h ) ) { return data ; } throw new HyperLedgerException ( "Checksum mismatch " + s ) ; }
Generate a unique id
817
public Collection < Class < ? extends Closeable > > shardServices ( ) { return Collections . emptyList ( ) ; }
Try to fill the buffer with compressed bytes. Except the last effective read, this method always returns with a full buffer of compressed data.
818
public static SparseIntArray adjustPosition ( SparseIntArray positions , int startPosition , int endPosition , int adjustBy ) { SparseIntArray newPositions = new SparseIntArray ( ) ; for ( int i = 0 , size = positions . size ( ) ; i < size ; i ++ ) { int position = positions . keyAt ( i ) ; if ( position < startPosition || position > endPosition ) { newPositions . put ( position , positions . valueAt ( i ) ) ; } else if ( adjustBy > 0 ) { newPositions . put ( position + adjustBy , positions . valueAt ( i ) ) ; } else if ( adjustBy < 0 ) { if ( position > startPosition + adjustBy && position <= startPosition ) { ; } else { newPositions . put ( position + adjustBy , positions . valueAt ( i ) ) ; } } } return newPositions ; }
Adds a new entry in the form
819
public int compare ( Object o1 , Object o2 ) { String s1 = o1 . toString ( ) ; if ( s1 == null ) s1 = "" ; String s2 = o2 . toString ( ) ; if ( s2 == null ) s2 = "" ; return s1 . compareTo ( s2 ) ; }
Switch to next entry.
820
private final ArrayList < AwtreeNodeLeaf > to_array ( ) { ArrayList < AwtreeNodeLeaf > result = new ArrayList < AwtreeNodeLeaf > ( leaf_count ) ; AwtreeNode curr_node = root_node ; if ( curr_node == null ) return result ; for ( ; ; ) { while ( curr_node instanceof AwtreeNodeFork ) { curr_node = ( ( AwtreeNodeFork ) curr_node ) . first_child ; } result . add ( ( AwtreeNodeLeaf ) curr_node ) ; AwtreeNodeFork curr_parent = curr_node . parent ; while ( curr_parent != null && curr_parent . second_child == curr_node ) { curr_node = curr_parent ; curr_parent = curr_node . parent ; } if ( curr_parent == null ) break ; curr_node = curr_parent . second_child ; } return result ; }
Create a LF which can access the given field. Cache and share this structure among all fields with the same basicType and refKind.
821
public void unregister ( ) throws PayloadException , NetworkException { if ( sLogger . isActivated ( ) ) { sLogger . debug ( "Unregister from IMS" ) ; } mRegistration . deRegister ( ) ; mSip . closeStack ( ) ; }
Expect an alarm for the specified time.
822
public static int listFind ( String list , String value ) { return listFind ( list , value , "," ) ; }
Find end of tag (&gt;). The position returned is the position of the &gt; plus one (exclusive).
823
public FlacStreamReader ( RandomAccessFile raf ) { this . raf = raf ; }
Update shared preferences entry with ids of the visible notifications.
824
public static void overScrollBy ( final PullToRefreshBase < ? > view , final int deltaX , final int scrollX , final int deltaY , final int scrollY , final int scrollRange , final int fuzzyThreshold , final float scaleFactor , final boolean isTouchEvent ) { final int deltaValue , currentScrollValue , scrollValue ; switch ( view . getPullToRefreshScrollDirection ( ) ) { case HORIZONTAL : deltaValue = deltaX ; scrollValue = scrollX ; currentScrollValue = view . getScrollX ( ) ; break ; case VERTICAL : default : deltaValue = deltaY ; scrollValue = scrollY ; currentScrollValue = view . getScrollY ( ) ; break ; } if ( view . isPullToRefreshOverScrollEnabled ( ) && ! view . isRefreshing ( ) ) { final Mode mode = view . getMode ( ) ; if ( mode . permitsPullToRefresh ( ) && ! isTouchEvent && deltaValue != 0 ) { final int newScrollValue = ( deltaValue + scrollValue ) ; if ( PullToRefreshBase . DEBUG ) { Log . d ( LOG_TAG , "OverScroll. DeltaX: " + deltaX + ", ScrollX: " + scrollX + ", DeltaY: " + deltaY + ", ScrollY: " + scrollY + ", NewY: " + newScrollValue + ", ScrollRange: " + scrollRange + ", CurrentScroll: " + currentScrollValue ) ; } if ( newScrollValue < ( 0 - fuzzyThreshold ) ) { if ( mode . showHeaderLoadingLayout ( ) ) { if ( currentScrollValue == 0 ) { view . setState ( State . OVERSCROLLING ) ; } view . setHeaderScroll ( ( int ) ( scaleFactor * ( currentScrollValue + newScrollValue ) ) ) ; } } else if ( newScrollValue > ( scrollRange + fuzzyThreshold ) ) { if ( mode . showFooterLoadingLayout ( ) ) { if ( currentScrollValue == 0 ) { view . setState ( State . OVERSCROLLING ) ; } view . setHeaderScroll ( ( int ) ( scaleFactor * ( currentScrollValue + newScrollValue - scrollRange ) ) ) ; } } else if ( Math . abs ( newScrollValue ) <= fuzzyThreshold || Math . abs ( newScrollValue - scrollRange ) <= fuzzyThreshold ) { view . setState ( State . RESET ) ; } } else if ( isTouchEvent && State . OVERSCROLLING == view . getState ( ) ) { view . setState ( State . RESET ) ; } } }
Returns an enumeration of the entries in this ACL. Each element in the enumeration is of type AclEntry.
825
public void addScrollingListener ( OnWheelScrollListener listener ) { scrollingListeners . add ( listener ) ; }
Writes the contents of this CacheHeader to the specified OutputStream.
826
public final void skipUntil ( final double when ) { this . skipUntil = when ; }
Do a double set : Add (not replace !) the children to the current Adm and set the current Adm as the parent of the specified Children
827
public static String quote ( char ch ) { switch ( ch ) { case '\b' : return "\\b" ; case '\f' : return "\\f" ; case '\n' : return "\\n" ; case '\r' : return "\\r" ; case '\t' : return "\\t" ; case '\'' : return "\\'" ; case '\"' : return "\\\"" ; case '\\' : return "\\\\" ; default : return ( isPrintableAscii ( ch ) ) ? String . valueOf ( ch ) : String . format ( "\\u%04x" , ( int ) ch ) ; } }
Adds a new http request listener. Don't add multiple listeners when binary content responses are required! One Listener should handle binary responses, because the result length needs to be calculated. You can add multiple Listeners that use the Writer inside the HttpRequestEvent to concatenate a complete text response.
828
public static byte [ ] serializeToByteArray ( Serializable value ) { try { ByteArrayOutputStream buffer = new ByteArrayOutputStream ( ) ; try ( ObjectOutputStream oos = new ObjectOutputStream ( new SnappyOutputStream ( buffer ) ) ) { oos . writeObject ( value ) ; } return buffer . toByteArray ( ) ; } catch ( IOException exn ) { throw new IllegalArgumentException ( "unable to serialize " + value , exn ) ; } }
Sign a JAR file overwriting it with the signed JAR.
829
@ Override public Set < Statement > gather ( final IGASState < Set < Statement > , Set < Statement > , Set < Statement > > state , final Value u , final Statement e ) { return Collections . singleton ( e ) ; }
According View (mainly ImageView) to get the width and height of the thumbnail pictures
830
public void run ( E start ) { run ( Collections . singleton ( start ) ) ; }
return true if time to flush else return false
831
private boolean tooBig ( BasicBlock bb , int maxCost ) { int cost = 0 ; for ( Enumeration < Instruction > e = bb . forwardRealInstrEnumerator ( ) ; e . hasMoreElements ( ) ; ) { Instruction s = e . nextElement ( ) ; if ( s . isCall ( ) ) { cost += 3 ; } else if ( s . isAllocation ( ) ) { cost += 6 ; } else { cost ++ ; } if ( cost > maxCost ) return true ; } return false ; }
Replace all occurrences of a substring within a string with another string.
832
@ Override public boolean addEntry ( Principal caller , AclEntry entry ) throws NotOwnerException { if ( ! isOwner ( caller ) ) throw new NotOwnerException ( ) ; if ( entryList . contains ( entry ) ) return false ; entryList . addElement ( entry ) ; return true ; }
Perform a kNN search on the kd-tree.
833
private boolean has_colinear ( PlaPointInt a_point ) { int count = point_alist . size ( ) ; if ( count < 2 ) return false ; for ( int index = 0 ; index < count - 1 ; index ++ ) { PlaPointInt start = point_alist . get ( index ) ; PlaPointInt end = point_alist . get ( index + 1 ) ; if ( a_point . side_of ( start , end ) != PlaSide . COLLINEAR ) continue ; double d_start_p = start . distance_square ( a_point ) ; double d_p_end = a_point . distance_square ( end ) ; double d_start_end = start . distance_square ( end ) ; if ( d_start_end >= d_start_p ) { if ( d_start_end >= d_p_end ) { return true ; } else { point_alist . set ( index , a_point ) ; return true ; } } else { if ( d_start_end >= d_p_end ) { point_alist . set ( index + 1 , a_point ) ; return true ; } else { point_alist . set ( index , a_point ) ; return true ; } } } return false ; }
Remove a Generic Entity corresponding to the primaryKey
834
protected void incorporateDigestMethod ( final Element parentDom , final DigestAlgorithm digestAlgorithm ) { final Element digestMethodDom = documentDom . createElementNS ( XMLNS , DS_DIGEST_METHOD ) ; final String digestAlgorithmXmlId = digestAlgorithm . getXmlId ( ) ; digestMethodDom . setAttribute ( ALGORITHM , digestAlgorithmXmlId ) ; parentDom . appendChild ( digestMethodDom ) ; }
Deserialize the state of the object.
835
public static boolean isXML11ValidName ( String name ) { final int length = name . length ( ) ; if ( length == 0 ) { return false ; } int i = 1 ; char ch = name . charAt ( 0 ) ; if ( ! isXML11NameStart ( ch ) ) { if ( length > 1 && isXML11NameHighSurrogate ( ch ) ) { char ch2 = name . charAt ( 1 ) ; if ( ! XMLChar . isLowSurrogate ( ch2 ) || ! isXML11NameStart ( XMLChar . supplemental ( ch , ch2 ) ) ) { return false ; } i = 2 ; } else { return false ; } } while ( i < length ) { ch = name . charAt ( i ) ; if ( ! isXML11Name ( ch ) ) { if ( ++ i < length && isXML11NameHighSurrogate ( ch ) ) { char ch2 = name . charAt ( i ) ; if ( ! XMLChar . isLowSurrogate ( ch2 ) || ! isXML11Name ( XMLChar . supplemental ( ch , ch2 ) ) ) { return false ; } } else { return false ; } } ++ i ; } return true ; }
Update the effective size label.
836
public String resolvePath ( String pathInfo ) { if ( ( pathInfo == null ) || ( pathInfo . indexOf ( ".." ) != - 1 ) ) { return null ; } int libStart = pathInfo . indexOf ( '/' ) + 1 ; int libEnd = pathInfo . indexOf ( '/' , libStart ) ; if ( libEnd == - 1 ) { libEnd = pathInfo . length ( ) ; } String libname = pathInfo . substring ( libStart , libEnd ) ; String subpath = pathInfo . substring ( libEnd ) ; String lib_home = getPath ( libname ) ; if ( lib_home == null ) { return null ; } return lib_home + "/" + subpath ; }
Reads the header of the resource file
837
protected int rangeUpper ( String range ) { int hyphenIndex ; if ( ( hyphenIndex = range . indexOf ( '-' ) ) >= 0 ) { return Math . max ( rangeUpper ( range . substring ( 0 , hyphenIndex ) ) , rangeUpper ( range . substring ( hyphenIndex + 1 ) ) ) ; } return rangeSingle ( range ) ; }
Creates a neuron property panel with a default display state.
838
@ Override public boolean equals ( Object that ) { try { if ( that == null ) { return false ; } RuleBasedBreakIterator other = ( RuleBasedBreakIterator ) that ; if ( checksum != other . checksum ) { return false ; } if ( text == null ) { return other . text == null ; } else { return text . equals ( other . text ) ; } } catch ( ClassCastException e ) { return false ; } }
Check if all jobs this one depends on are finished
839
public static String extractResponse ( IDiagnosticsLogger log , StringWriter sw ) { String samlResponseField = "<input type=\"hidden\" name=\"SAMLResponse\" value=\"" ; String responseAsString = sw . toString ( ) ; log . debug ( "Received response " + responseAsString ) ; int index = responseAsString . indexOf ( samlResponseField ) ; assertTrue ( index >= 0 ) ; int startIndex = index + samlResponseField . length ( ) ; int endIndex = responseAsString . indexOf ( '\"' , startIndex ) ; assertTrue ( endIndex >= 0 ) ; String encodedSamlResponse = responseAsString . substring ( startIndex , endIndex ) ; String decodedSamlResponse = new String ( Base64 . decode ( encodedSamlResponse ) ) ; return decodedSamlResponse ; }
Calculates the log marginal likelihood of a model using Newton and Raftery's harmonic mean estimator
840
public void testPowNegativeNumToEvenExp ( ) { byte aBytes [ ] = { 50 , - 26 , 90 , 69 , 120 , 32 , 63 , - 103 , - 14 , 35 } ; int aSign = - 1 ; int exp = 4 ; byte rBytes [ ] = { 102 , 107 , - 122 , - 43 , - 52 , - 20 , - 27 , 25 , - 9 , 88 , - 13 , 75 , 78 , 81 , - 33 , - 77 , 39 , 27 , - 37 , 106 , 121 , - 73 , 108 , - 47 , - 101 , 80 , - 25 , 71 , 13 , 94 , - 7 , - 33 , 1 , - 17 , - 65 , - 70 , - 61 , - 3 , - 47 } ; BigInteger aNumber = new BigInteger ( aSign , aBytes ) ; BigInteger result = aNumber . pow ( exp ) ; byte resBytes [ ] = new byte [ rBytes . length ] ; resBytes = result . toByteArray ( ) ; for ( int i = 0 ; i < resBytes . length ; i ++ ) { assertTrue ( resBytes [ i ] == rBytes [ i ] ) ; } assertEquals ( "incorrect sign" , 1 , result . signum ( ) ) ; }
Unescapes the character identified by the character or characters that immediately follow a backslash. The backslash '\' should have already been read. This supports both unicode escapes "u000A" and two-character escapes "\n".
841
public void putAttribute ( final String attrId , final List ltValues ) { if ( map == null ) { map = new HashMap ( ) ; } map . put ( attrId . toLowerCase ( ) , new LdapEntryAttributeVO ( attrId . toLowerCase ( ) , ltValues ) ) ; }
Register a network to be cleaned up at JVM shutdown.
842
protected JavaFileObject preferredFileObject ( JavaFileObject a , JavaFileObject b ) { if ( preferSource ) return ( a . getKind ( ) == JavaFileObject . Kind . SOURCE ) ? a : b ; else { long adate = a . getLastModified ( ) ; long bdate = b . getLastModified ( ) ; return ( adate > bdate ) ? a : b ; } }
Construct with specified timeout.
843
public void evaluate ( final MultivariateFunction evaluationFunction , final Comparator < PointValuePair > comparator ) { for ( int i = 0 ; i < simplex . length ; i ++ ) { final PointValuePair vertex = simplex [ i ] ; final double [ ] point = vertex . getPointRef ( ) ; if ( Double . isNaN ( vertex . getValue ( ) ) ) { simplex [ i ] = new PointValuePair ( point , evaluationFunction . value ( point ) , false ) ; } } Arrays . sort ( simplex , comparator ) ; }
Writes an int at the current position in the given buffer, using the given ByteOrder
844
public void testToEngineeringStringZeroNegExponent ( ) { String a = "0.0E-16" ; BigDecimal aNumber = new BigDecimal ( a ) ; String result = "0.00E-15" ; assertEquals ( "incorrect value" , result , aNumber . toEngineeringString ( ) ) ; }
Before streaming data to the remote node, make sure it is ok to. We have found that we can be more efficient on a push by relying on HTTP keep-alive.
845
public SelectClause add ( Expression expression ) { selectList . add ( new SelectClauseExpression ( expression ) ) ; return this ; }
Asserts that the specified debug result key does or does not exist in the response based on the expected boolean.
846
private void attemptResponse ( InetSocketAddress addr , int timeout ) throws Exception { Socket s = new Socket ( ) ; try { s . connect ( addr , timeout ) ; respond ( s ) ; } finally { try { s . close ( ) ; } catch ( IOException e ) { logger . log ( Levels . HANDLED , "exception closing socket" , e ) ; } } }
Creates a new Synchronizer from a database object.
847
protected void addToPortMap ( IOFSwitch sw , MacAddress mac , VlanVid vlan , OFPort portVal ) { Map < MacVlanPair , OFPort > swMap = macVlanToSwitchPortMap . get ( sw ) ; if ( vlan == VlanVid . FULL_MASK ) { vlan = VlanVid . ofVlan ( 0 ) ; } if ( swMap == null ) { swMap = Collections . synchronizedMap ( new LRULinkedHashMap < MacVlanPair , OFPort > ( MAX_MACS_PER_SWITCH ) ) ; macVlanToSwitchPortMap . put ( sw , swMap ) ; } swMap . put ( new MacVlanPair ( mac , vlan ) , portVal ) ; }
invoked when a window is deactivated
848
public void save ( ) throws SSOException , SMSException { if ( readOnly ) { if ( debug . warningEnabled ( ) ) { debug . warning ( "SMSEntry: Attempted to save an entry that " + "is marked as read-only: " + dn ) ; } throw ( new SMSException ( SMSException . STATUS_NO_PERMISSION , "sms-INSUFFICIENT_ACCESS_RIGHTS" ) ) ; } save ( ssoToken ) ; }
Let the sleeping thread pass the synchronization point any number of times.
849
public ErrorDialog ( final SafeHtml message ) { this ( ) ; body . add ( message . toBlockWidget ( ) ) ; }
Creates a new menu object.
850
public List < Annotation > findByProject ( AppContext app , ProjectPK projectPk , String orderBy ) { List < DataStoreQueryField > queryFields = new ArrayList < DataStoreQueryField > ( 1 ) ; queryFields . add ( new DataStoreQueryField ( "id.projectId" , projectPk . getProjectId ( ) ) ) ; return super . find ( app , projectPk , queryFields , findByProjectCache , orderBy ) ; }
Returns true if proxy2 is a generated Proxy (proxy1 is assumed to be one) and the classes of both proxies implement the same ordered list of interfaces, and returns false otherwise.
851
public long start_brk ( ) { return Long . parseLong ( fields [ 46 ] ) ; }
Draws an image at x,y in nonblocking mode with a solid background color and a callback object.
852
private void addToMap ( LocatorReg reg ) { undiscoveredLocators . add ( reg ) ; queueDiscoveryTask ( reg ) ; }
Adds an River to the map (if the map is at least 5x5 hexes big). The river has an width of 1-3 hexes (everything else is no more a river). The river goes from one border to another. Nor Params, no results.
853
public static String [ ] createFixedRandomStrings ( int count ) { String [ ] strings = new String [ count ] ; Random lengthRandom = new Random ( ) ; lengthRandom . setSeed ( SEED ) ; Random stringRandom = new Random ( ) ; stringRandom . setSeed ( SEED ) ; for ( int i = 0 ; i < count ; i ++ ) { int nextLength = lengthRandom . nextInt ( MAX_LENGTH - MIN_LENGTH - 1 ) ; nextLength += MIN_LENGTH ; strings [ i ] = RandomStringUtils . random ( nextLength , 0 , CHARS . length , true , true , CHARS , stringRandom ) ; } return strings ; }
Verifies whether the ipv6reference, i.e. whether it enclosed in square brackets
854
private void createEsxiSession ( ImageServerDialog d , ComputeImageJob job , ComputeImage ci , ComputeImageServer imageServer ) { String s = ImageServerUtils . getResourceAsString ( ESXI5X_UUID_TEMPLATE ) ; StringBuilder sb = new StringBuilder ( s ) ; ImageServerUtils . replaceAll ( sb , "${os_full_name}" , ci . getImageName ( ) ) ; ImageServerUtils . replaceAll ( sb , "${os_path}" , ci . getPathToDirectory ( ) ) ; ImageServerUtils . replaceAll ( sb , "${pxe_identifier}" , job . getPxeBootIdentifier ( ) ) ; String content = sb . toString ( ) ; log . trace ( content ) ; d . writeFile ( imageServer . getTftpBootDir ( ) + PXELINUX_CFG_DIR + job . getPxeBootIdentifier ( ) , content ) ; s = d . readFile ( imageServer . getTftpBootDir ( ) + ci . getPathToDirectory ( ) + "/boot.cfg" ) ; sb = new StringBuilder ( s . trim ( ) ) ; ImageServerUtils . replaceAll ( sb , "/" , "/" + ci . getPathToDirectory ( ) ) ; ImageServerUtils . replaceAll ( sb , "runweasel" , "runweasel vmkopts=debugLogToSerial:1 ks=http://" + imageServer . getImageServerSecondIp ( ) + ":" + imageServer . getImageServerHttpPort ( ) + "/ks/" + job . getPxeBootIdentifier ( ) + " kssendmac" ) ; content = sb . toString ( ) ; log . trace ( content ) ; d . writeFile ( imageServer . getTftpBootDir ( ) + PXELINUX_CFG_DIR + job . getPxeBootIdentifier ( ) + ".boot.cfg" , content ) ; content = generateKickstart ( job , ci , imageServer ) ; d . writeFile ( imageServer . getTftpBootDir ( ) + HTTP_KICKSTART_DIR + job . getPxeBootIdentifier ( ) , content ) ; content = generateFirstboot ( job , ci ) ; d . writeFile ( imageServer . getTftpBootDir ( ) + HTTP_FIRSTBOOT_DIR + job . getPxeBootIdentifier ( ) , content ) ; d . rm ( imageServer . getTftpBootDir ( ) + HTTP_SUCCESS_DIR + job . getPxeBootIdentifier ( ) ) ; d . rm ( imageServer . getTftpBootDir ( ) + HTTP_FAILURE_DIR + job . getPxeBootIdentifier ( ) ) ; }
Constructs a new currency value by parsing the specific input. <p/> Currency values are expected to be in the format &lt;amount&gt;,&lt;currency code&gt;, for example, "500,USD" would represent 5 U.S. Dollars. <p/> If no currency code is specified, the default is assumed.
855
protected void createFilterToolbar ( ) { timer = new Timer ( 400 , null ) ; timer . setInitialDelay ( 400 ) ; timer . setActionCommand ( CMD_FILTER_CHANGED ) ; timer . setRepeats ( false ) ; searchFilter = new SearchFilter ( ) ; searchFilter . setFilterText ( StringUtils . EMPTY ) ; }
Used to communicate a progress update between a plugin tool and the main Whitebox user interface.
856
public ParseHeaderState ( HttpHeaders headers , StringBuilder logger ) { Class < ? extends HttpHeaders > clazz = headers . getClass ( ) ; this . context = Arrays . < Type > asList ( clazz ) ; this . classInfo = ClassInfo . of ( clazz , true ) ; this . logger = logger ; this . arrayValueMap = new ArrayValueMap ( headers ) ; }
If data collection is enabled, add this information to the log.
857
public static String listInsertAt ( String list , int pos , String value , String delimiter , boolean ignoreEmpty ) throws ExpressionException { if ( pos < 1 ) throw new ExpressionException ( "invalid string list index [" + ( pos ) + "]" ) ; char [ ] del = delimiter . toCharArray ( ) ; char c ; StringBuilder result = new StringBuilder ( ) ; String end = "" ; int len ; if ( ignoreEmpty ) { outer : while ( list . length ( ) > 0 ) { c = list . charAt ( 0 ) ; for ( int i = 0 ; i < del . length ; i ++ ) { if ( c == del [ i ] ) { list = list . substring ( 1 ) ; result . append ( c ) ; continue outer ; } } break ; } } if ( ignoreEmpty ) { outer : while ( list . length ( ) > 0 ) { c = list . charAt ( list . length ( ) - 1 ) ; for ( int i = 0 ; i < del . length ; i ++ ) { if ( c == del [ i ] ) { len = list . length ( ) ; list = list . substring ( 0 , len - 1 < 0 ? 0 : len - 1 ) ; end = c + end ; continue outer ; } } break ; } } len = list . length ( ) ; int last = 0 ; int count = 0 ; outer : for ( int i = 0 ; i < len ; i ++ ) { c = list . charAt ( i ) ; for ( int y = 0 ; y < del . length ; y ++ ) { if ( c == del [ y ] ) { if ( ! ignoreEmpty || last < i ) { if ( pos == ++ count ) { result . append ( value ) ; result . append ( del [ 0 ] ) ; } } result . append ( list . substring ( last , i ) ) ; result . append ( c ) ; last = i + 1 ; continue outer ; } } } count ++ ; if ( last <= len ) { if ( pos == count ) { result . append ( value ) ; result . append ( del [ 0 ] ) ; } result . append ( list . substring ( last ) ) ; } if ( pos > count ) { throw new ExpressionException ( "invalid string list index [" + ( pos ) + "], indexes go from 1 to " + ( count ) ) ; } return result + end ; }
Returns the shortest prefix of <code>input<code> that is matched, or <code>null<code> if no match exists.
858
void updateDayCounter ( final long newMessages ) { GregorianCalendar cal = new GregorianCalendar ( ) ; int currentIndex = cal . get ( Calendar . HOUR_OF_DAY ) ; boolean bUpdate = false ; for ( int i = 0 ; i <= currentIndex ; i ++ ) { if ( counters [ i ] > - 1 ) { bUpdate = true ; } if ( bUpdate == true ) { if ( counters [ i ] == - 1 ) { counters [ i ] = 0 ; } } } counters [ currentIndex ] += newMessages ; }
Store param for the future
859
public float readFloat ( ) throws IOException { return dis . readFloat ( ) ; }
Returns a pretty printed string of the given Json array, indented at the given level.
860
private < T > Stream < Collection < T > > partitionedStream ( Iterator < T > iterator ) { return StreamSupport . stream ( Spliterators . spliteratorUnknownSize ( Iterators . partition ( iterator , batchSize ) , Spliterator . ORDERED ) , false ) ; }
Writes a String to a file creating the file if it does not exist using the default encoding for the VM.
861
public static Cache . Entry makeRandomCacheEntry ( byte [ ] data , boolean isExpired , boolean needsRefresh ) { Random random = new Random ( ) ; Cache . Entry entry = new Cache . Entry ( ) ; if ( data != null ) { entry . data = data ; } else { entry . data = new byte [ random . nextInt ( 1024 ) ] ; } entry . etag = String . valueOf ( random . nextLong ( ) ) ; entry . lastModified = random . nextLong ( ) ; entry . ttl = isExpired ? 0 : Long . MAX_VALUE ; entry . softTtl = needsRefresh ? 0 : Long . MAX_VALUE ; return entry ; }
Constructs a dataset containing a single series (more can be added), tied to the default timezone.
862
public void removeLast ( ) { DataChangeEvent [ ] events ; synchronized ( this ) { int row = getRowCount ( ) - 1 ; Row r = new Row ( this , row ) ; events = new DataChangeEvent [ getColumnCount ( ) ] ; for ( int col = 0 ; col < events . length ; col ++ ) { events [ col ] = new DataChangeEvent ( this , col , row , r . get ( col ) , null ) ; } rows . remove ( row ) ; } notifyDataRemoved ( events ) ; }
Tests comparison of different values.
863
public CustomEntryConcurrentHashMap ( final Map < ? extends K , ? extends V > m ) { this ( Math . max ( ( int ) ( m . size ( ) / DEFAULT_LOAD_FACTOR ) + 1 , DEFAULT_INITIAL_CAPACITY ) , DEFAULT_LOAD_FACTOR , DEFAULT_CONCURRENCY_LEVEL , false ) ; putAll ( m ) ; }
Compile the given source files.
864
public FileReadStream ( ) { }
Arrays.copyOf(byte[] original, int newLength) not found in API <= 8. Copies the specified array, truncating or padding with zeros (if necessary) so the copy has the specified length. For all indices that are valid in both the original array and the copy, the two arrays will contain identical values. For any indices that are valid in the copy but not the original, the copy will contain (byte)0. Such indices will exist if and only if the specified length is greater than that of the original array.
865
public static String quote ( String s ) { if ( s == null ) return null ; if ( s . length ( ) == 0 ) return "\"\"" ; StringBuffer b = new StringBuffer ( s . length ( ) + 8 ) ; quote ( b , s ) ; return b . toString ( ) ; }
Convert date formatted as yyyy-MM to yyyy-QQ
866
public void querySorted ( String type , int index , boolean ascending , int page , int limit , int visibilityScope , CloudResponse < CloudObject [ ] > response ) { try { queryImpl ( type , null , 0 , page , limit , visibilityScope , 1 , index , ascending , false , false , response ) ; } catch ( CloudException e ) { response . onError ( e ) ; } }
Create a new executor queue.
867
private void logMessage ( String msg , Object [ ] obj ) { if ( _monitoringPropertiesLoader . isToLogIndications ( ) ) { _logger . debug ( "-> " + msg , obj ) ; } }
Quick exp, with a max relative error of about 3e-2 for |value| &lt; 700.0 or so, and no accuracy at all outside this range. Derived from a note by Nicol N. Schraudolph, IDSIA, 1998.
868
public void actionPerformed ( ActionEvent e ) { ActionMap map = tabPane . getActionMap ( ) ; if ( map != null ) { String actionKey ; if ( e . getSource ( ) == scrollForwardButton ) { actionKey = "scrollTabsForwardAction" ; } else { actionKey = "scrollTabsBackwardAction" ; } Action action = map . get ( actionKey ) ; if ( action != null && action . isEnabled ( ) ) { action . actionPerformed ( new ActionEvent ( tabPane , ActionEvent . ACTION_PERFORMED , null , e . getWhen ( ) , e . getModifiers ( ) ) ) ; } } }
Returns the best achieved metric value.
869
public double entropy ( int g , int lag ) { double h = 0.0 ; int n = cases . length - lag ; double ln2 = Math . log ( 2.0 ) ; int n0 = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( cases [ i + lag ] [ g ] == 0 ) { n0 ++ ; } } double p ; if ( n0 == 0 || n0 == n ) { return h ; } else { p = ( double ) n0 / ( double ) n ; h = - ( p * Math . log ( p ) + ( 1.0 - p ) * Math . log ( 1.0 - p ) ) / ln2 ; } return h ; }
Parse alpha gradient of color from range 0-1 to range 0-255
870
public OnUpdateClause addAssignment ( Expression expression ) { assignments . add ( new Assignment ( expression ) ) ; return this ; }
Verifies that the `getColorsByName()` method returns the proper color counts. This test uses the overload to check for non accents This test does not validate the data returned, only the expected counts.
871
public short readShortBE ( ) throws IOException { return inputStream . readShort ( ) ; }
Decides if given x-coordinate in screen space needs to be interpreted as "within" the normalized thumb x-coordinate.
872
public boolean removeMetricCollector ( final IGangliaMetricsCollector c ) { if ( c == null ) throw new IllegalArgumentException ( ) ; return metricCollectors . remove ( c ) ; }
Removes first entry; returns its snapshot.
873
private void fillCommentCombo ( Combo combo ) { if ( previousComments == null ) { previousComments = new ArrayList ( ) ; } for ( int i = previousComments . size ( ) - 1 ; i >= 0 ; i -- ) { combo . add ( ( ( String ) previousComments . get ( i ) ) ) ; } combo . select ( 0 ) ; }
Proposes a getter that is assumed to delegate to a method with the same name as the java method.
874
public static synchronized void removeFromDisabledList ( String classname ) { DISABLED . remove ( classname ) ; }
Set a selection in the manufacturer list, without triggering an update of the decoder panel.
875
public void refresh ( CloudObject [ ] objects , CloudResponse < Integer > response ) { refreshImpl ( objects , response ) ; }
TODO(danilatos): Click + drag? I.e. return true for mouse move, if the button is pressed? (this might be useful for tracking changing selections as the user holds & drags)
876
public static String approxTimeUntil ( final int seconds ) { final StringBuilder sbuf = new StringBuilder ( ) ; approxTimeUntil ( sbuf , seconds ) ; return sbuf . toString ( ) ; }
Computes what action to perform for the specified cookie name.
877
public static AccessibilityNodeInfoCompat searchFocus ( TraversalStrategy traversal , AccessibilityNodeInfoCompat currentFocus , int direction , NodeFilter filter ) { if ( traversal == null || currentFocus == null ) { return null ; } if ( filter == null ) { filter = DEFAULT_FILTER ; } AccessibilityNodeInfoCompat targetNode = AccessibilityNodeInfoCompat . obtain ( currentFocus ) ; Set < AccessibilityNodeInfoCompat > seenNodes = new HashSet < > ( ) ; try { do { seenNodes . add ( targetNode ) ; targetNode = traversal . findFocus ( targetNode , direction ) ; if ( seenNodes . contains ( targetNode ) ) { LogUtils . log ( AccessibilityNodeInfoUtils . class , Log . ERROR , "Found duplicate during traversal: %s" , targetNode . getInfo ( ) ) ; return null ; } } while ( targetNode != null && ! filter . accept ( targetNode ) ) ; } finally { AccessibilityNodeInfoUtils . recycleNodes ( seenNodes ) ; } return targetNode ; }
Create formatted lines from a text.
878
private void collectWrapperAndSuppressedInfo ( Matcher matcher ) throws AdeException { m_suppressedNonWrapperMessageCount ++ ; m_suppressedMessagesRemaining = Integer . parseInt ( matcher . group ( 1 ) ) ; m_suppressedMessagesRemaining -- ; m_messageInstanceWaiting = m_messageTextPreprocessor . getExtraMessage ( m_prevMessageInstance ) ; }
Locates an edge of a triangle which contains a location specified by a Vertex v. The edge returned has the property that either v is on e, or e is an edge of a triangle containing v. The search starts from startEdge amd proceeds on the general direction of v. <p> This locate algorithm relies on the subdivision being Delaunay. For non-Delaunay subdivisions, this may loop for ever.
879
private static void assertMp4WebvttSubtitleEquals ( Subtitle sub , Cue ... expectedCues ) { assertEquals ( 1 , sub . getEventTimeCount ( ) ) ; assertEquals ( 0 , sub . getEventTime ( 0 ) ) ; List < Cue > subtitleCues = sub . getCues ( 0 ) ; assertEquals ( expectedCues . length , subtitleCues . size ( ) ) ; for ( int i = 0 ; i < subtitleCues . size ( ) ; i ++ ) { List < String > differences = getCueDifferences ( subtitleCues . get ( i ) , expectedCues [ i ] ) ; assertTrue ( "Cues at position " + i + " are not equal. Different fields are " + Arrays . toString ( differences . toArray ( ) ) , differences . isEmpty ( ) ) ; } }
sets up needed parts for sending email message presumes any needed sets have been done first
880
public String concatenate ( String start , List < String > chunks ) { StringBuffer buf ; if ( start == null ) { buf = new StringBuffer ( ) ; } else { buf = new StringBuffer ( start ) ; } if ( chunks != null ) { for ( String chunk : chunks ) { if ( chunk != null ) { buf . append ( chunk ) ; } } } return ( buf . length ( ) == 0 ) ? null : buf . toString ( ) ; }
Create a Transferable to use as the source for a data transfer.
881
public List < String > createEntity ( String ... entitiesAsJson ) throws AtlasServiceException { return createEntity ( new JSONArray ( Arrays . asList ( entitiesAsJson ) ) ) ; }
Callback for the native layer
882
private void populateCompletedActivitiSteps ( Job job , List < HistoricActivityInstance > historicActivitiTasks ) { List < WorkflowStep > completedWorkflowSteps = new ArrayList < > ( ) ; for ( HistoricActivityInstance historicActivityInstance : historicActivitiTasks ) { completedWorkflowSteps . add ( new WorkflowStep ( historicActivityInstance . getActivityId ( ) , historicActivityInstance . getActivityName ( ) , HerdDateUtils . getXMLGregorianCalendarValue ( historicActivityInstance . getStartTime ( ) ) , HerdDateUtils . getXMLGregorianCalendarValue ( historicActivityInstance . getEndTime ( ) ) ) ) ; } job . setCompletedWorkflowSteps ( completedWorkflowSteps ) ; }
allow iteration of HttpMonItems. Used to start/stop all monitors.
883
public static String join ( String separator , double ... elements ) { if ( elements == null || elements . length == 0 ) { return "" ; } List < Number > list = new ArrayList < Number > ( elements . length ) ; for ( Double elem : elements ) { list . add ( elem ) ; } return join ( separator , list ) ; }
Format and publish a LogRecord. <p> This FileHandler is associated with a Formatter, which has to format the LogRecord according to ELF and return back the string formatted as per ELF. This method first checks if the header is already written to the file, if not, gets the header from the Formatter and writes it at the beginning of the file.
884
public double entropyNMISqrt ( ) { if ( entropyFirst ( ) * entropySecond ( ) <= 0 ) { return entropyMutualInformation ( ) ; } return ( entropyMutualInformation ( ) / Math . sqrt ( entropyFirst ( ) * entropySecond ( ) ) ) ; }
Writes out a Protein object to a GFF version 3 file
885
public void applyAll ( Collection < ? extends IChange > changes ) throws BadLocationException { final Map < URI , List < IAtomicChange > > changesPerFile = organize ( changes ) ; for ( URI currURI : changesPerFile . keySet ( ) ) { final IXtextDocument document = getDocument ( currURI ) ; applyAllInSameDocument ( changesPerFile . get ( currURI ) , document ) ; } }
Matches the input string against contacts names and addresses.
886
public static Map < String , String > strToMap ( String str , String delim , boolean trim , String pairsSeparator ) { if ( str == null ) return null ; Map < String , String > decodedMap = new HashMap < String , String > ( ) ; List < String > elements = split ( str , delim ) ; pairsSeparator = pairsSeparator == null ? "=" : pairsSeparator ; for ( String s : elements ) { List < String > e = split ( s , pairsSeparator ) ; if ( e . size ( ) != 2 ) { continue ; } String name = e . get ( 0 ) ; String value = e . get ( 1 ) ; if ( trim ) { if ( name != null ) { name = name . trim ( ) ; } if ( value != null ) { value = value . trim ( ) ; } } try { decodedMap . put ( URLDecoder . decode ( name , "UTF-8" ) , URLDecoder . decode ( value , "UTF-8" ) ) ; } catch ( UnsupportedEncodingException e1 ) { Debug . logError ( e1 , module ) ; } } return decodedMap ; }
find if we have been created earler if not create our node
887
public Criteria or ( ) { Criteria criteria = createCriteriaInternal ( ) ; oredCriteria . add ( criteria ) ; return criteria ; }
Builds a command line containing all basic arguments required by java
888
private boolean linkLast ( Node < E > node ) { if ( count >= capacity ) return false ; Node < E > l = last ; node . prev = l ; last = node ; if ( first == null ) first = node ; else l . next = node ; ++ count ; notEmpty . signal ( ) ; return true ; }
Returns true if this is a detail record
889
public static String now ( ) { Calendar cal = Calendar . getInstance ( ) ; SimpleDateFormat sdf = new SimpleDateFormat ( DATE_FORMAT_NOW ) ; return sdf . format ( cal . getTime ( ) ) ; }
Render the scalable parts of the screen.
890
private void doPostHelper ( HttpServletRequest request , HttpServletResponse response ) throws ServletException , IOException { logger . log ( Level . INFO , "request: " + request . getRequestURI ( ) ) ; final RequestAndResponse requestAndResponse = new RequestAndResponse ( request , response ) ; standardResponseStuff ( requestAndResponse ) ; final String uri = request . getRequestURI ( ) ; requestAndResponse . setOverrideUri ( uri ) ; if ( uri . equals ( "/createQuotationJson" ) ) { handleJsonCreateQuotation ( requestAndResponse ) ; } else if ( uri . equals ( "/makeNotebook" ) ) { handleHtmlMakeNotebook ( requestAndResponse ) ; } else if ( uri . equals ( "/moveNotesJson" ) ) { handleJsonMoveNotes ( requestAndResponse ) ; } else if ( uri . equals ( "/noteOpJson" ) ) { handleJsonNoteOp ( requestAndResponse ) ; } else if ( uri . equals ( "/getNotebookPathJson" ) ) { handleJsonGetNotebookPath ( requestAndResponse ) ; } else if ( uri . equals ( "/makeChildrenJson" ) ) { handleJsonMakeChildren ( requestAndResponse ) ; } else if ( uri . equals ( "/makeSiblingsJson" ) ) { handleJsonMakeSiblings ( requestAndResponse ) ; } else if ( uri . equals ( "/signIn" ) ) { handleJsonSignIn ( requestAndResponse ) ; } else if ( uri . equals ( "/signOut" ) ) { handleJsonSignOut ( requestAndResponse ) ; } else if ( uri . equals ( "/createAccount" ) ) { handleJsonCreateAccount ( requestAndResponse ) ; } else if ( uri . startsWith ( "/doRestore/" ) ) { handleHtmlDoUserRestore ( requestAndResponse ) ; } else if ( uri . startsWith ( "/doOfflineBackup/" ) ) { handleHtmlDoOfflineDbBackup ( requestAndResponse ) ; } else if ( uri . startsWith ( "/doOnlineBackup/" ) ) { handleHtmlDoOnlineDbBackup ( requestAndResponse ) ; } else if ( uri . startsWith ( "/doClear/" ) ) { handleHtmlDoClear ( requestAndResponse ) ; } else if ( uri . startsWith ( "/doBackup/" ) ) { handleHtmlDoUserBackup ( requestAndResponse ) ; } else if ( uri . startsWith ( "/doShutdown/" ) ) { handleHtmlDoShutdown ( requestAndResponse ) ; } else if ( uri . startsWith ( "/doCheckForErrors/" ) ) { handleHtmlDoCheckForErrors ( requestAndResponse ) ; } else if ( uri . startsWith ( "/changePassword/" ) ) { handleHtmlChangePassword ( requestAndResponse ) ; } else if ( uri . startsWith ( "/changeAccount/" ) ) { handleHtmlChangeAccount ( requestAndResponse ) ; } else if ( uri . startsWith ( "/closeAccount/" ) ) { handleHtmlCloseAccount ( requestAndResponse ) ; } else if ( uri . equals ( "/saveOptions" ) ) { handleJsonSaveOptions ( requestAndResponse ) ; } else if ( uri . startsWith ( "/doExport/" ) ) { handleHtmlDoExport ( requestAndResponse ) ; } else { returnHtml404 ( requestAndResponse ) ; } }
Responds to Edit button on row in the Light Control Table
891
public void clearSelections ( ) { mSelectedTags . clear ( ) ; refreshSelectedTags ( ) ; }
Adds all source volume mirrors to the consistency group
892
@ Override public synchronized void addTestSetListener ( TestSetListener tsl ) { m_listeners . addElement ( tsl ) ; }
Moves an entry to a given destination folder.
893
public void addObserver ( Observer observer ) { Assert . notNull ( "observer" , observer ) ; observers . addIfAbsent ( observer ) ; }
Compares two strings lexicographically.
894
protected void applyValue ( T value ) { bean . setValue ( property , value ) ; }
If this thread was constructed using a separate Runnable run object, then that Runnable object's run method is called; otherwise, this method does nothing and returns. Subclasses of Thread should override this method.
895
protected Object convertAttributeValue ( Object value ) { if ( value == null || value instanceof String || value instanceof Byte || value instanceof Long || value instanceof Double || value instanceof Boolean || value instanceof Integer || value instanceof Short || value instanceof Float ) { return value ; } return value . toString ( ) ; }
Return all move objects in moveList to the move cache.
896
@ Override public int hashCode ( ) { int myPosition = position ; int hash = 0 ; long l ; while ( myPosition < limit ) { l = Double . doubleToLongBits ( get ( myPosition ++ ) ) ; hash = hash + ( ( int ) l ) ^ ( ( int ) ( l > > 32 ) ) ; } return hash ; }
Add a bean property to the class i.e. add followings to a class: 1. a class field 2. a getter method 3. a setter method
897
private void onLocationChangedAsync ( Location location ) { try { if ( ! isRecording ( ) || isPaused ( ) ) { Log . w ( TAG , "Ignore onLocationChangedAsync. Not recording or paused." ) ; return ; } Track track = myTracksProviderUtils . getTrack ( recordingTrackId ) ; if ( track == null ) { Log . w ( TAG , "Ignore onLocationChangedAsync. No track." ) ; return ; } if ( ! LocationUtils . isValidLocation ( location ) ) { Log . w ( TAG , "Ignore onLocationChangedAsync. location is invalid." ) ; return ; } if ( ! location . hasAccuracy ( ) || location . getAccuracy ( ) >= recordingGpsAccuracy ) { Log . d ( TAG , "Ignore onLocationChangedAsync. Poor accuracy." ) ; return ; } if ( location . getTime ( ) == 0L ) { location . setTime ( System . currentTimeMillis ( ) ) ; } Location lastValidTrackPoint = getLastValidTrackPointInCurrentSegment ( track . getId ( ) ) ; long idleTime = 0L ; if ( lastValidTrackPoint != null && location . getTime ( ) > lastValidTrackPoint . getTime ( ) ) { idleTime = location . getTime ( ) - lastValidTrackPoint . getTime ( ) ; } locationListenerPolicy . updateIdleTime ( idleTime ) ; if ( currentRecordingInterval != locationListenerPolicy . getDesiredPollingInterval ( ) ) { registerLocationListener ( ) ; } SensorDataSet sensorDataSet = getSensorDataSet ( ) ; if ( sensorDataSet != null ) { location = new MyTracksLocation ( location , sensorDataSet ) ; } if ( ! currentSegmentHasLocation ) { insertLocation ( track , location , null ) ; currentSegmentHasLocation = true ; lastLocation = location ; return ; } if ( ! LocationUtils . isValidLocation ( lastValidTrackPoint ) ) { insertLocation ( track , location , null ) ; lastLocation = location ; return ; } double distanceToLastTrackLocation = location . distanceTo ( lastValidTrackPoint ) ; if ( distanceToLastTrackLocation > maxRecordingDistance ) { insertLocation ( track , lastLocation , lastValidTrackPoint ) ; Location pause = new Location ( LocationManager . GPS_PROVIDER ) ; pause . setLongitude ( 0 ) ; pause . setLatitude ( PAUSE_LATITUDE ) ; pause . setTime ( lastLocation . getTime ( ) ) ; insertLocation ( track , pause , null ) ; insertLocation ( track , location , null ) ; isIdle = false ; } else if ( sensorDataSet != null || distanceToLastTrackLocation >= recordingDistanceInterval ) { insertLocation ( track , lastLocation , lastValidTrackPoint ) ; insertLocation ( track , location , null ) ; isIdle = false ; } else if ( ! isIdle && location . hasSpeed ( ) && location . getSpeed ( ) < MAX_NO_MOVEMENT_SPEED ) { insertLocation ( track , lastLocation , lastValidTrackPoint ) ; insertLocation ( track , location , null ) ; isIdle = true ; } else if ( isIdle && location . hasSpeed ( ) && location . getSpeed ( ) >= MAX_NO_MOVEMENT_SPEED ) { insertLocation ( track , lastLocation , lastValidTrackPoint ) ; insertLocation ( track , location , null ) ; isIdle = false ; } else { Log . d ( TAG , "Not recording location, idle" ) ; } lastLocation = location ; } catch ( Error e ) { Log . e ( TAG , "Error in onLocationChangedAsync" , e ) ; throw e ; } catch ( RuntimeException e ) { Log . e ( TAG , "RuntimeException in onLocationChangedAsync" , e ) ; throw e ; } }
Add layers to the BeanContext, if they want to be. Since the BeanContext is a Collection, it doesn't matter if a layer is already there because duplicates aren't allowed.
898
public static byte [ ] decode ( String str , int flags ) { return decode ( str . getBytes ( ) , flags ) ; }
Add all key value pairs from the supplied properties stream
899
public void lockUI ( ProcessInfo pi ) { m_isLocked = true ; }
Enters a new scope by appending any necessary whitespace and the given bracket.