idx
int64
0
41.2k
question
stringlengths
74
4.21k
target
stringlengths
5
888
15,000
public void changeScope ( final ThreadDelegatedContext context ) { final ThreadDelegatedContext oldContext = threadLocal . get ( ) ; if ( oldContext != null ) { if ( oldContext == context ) { return ; } else { oldContext . event ( ScopeEvent . LEAVE ) ; } } if ( context != null ) { threadLocal . set ( context ) ; conte...
A thread enters the scope . Clear the current context . If a new context was given assign it to the scope otherwise leave it empty .
15,001
public static void generateFixedUrls ( final ContentSpec contentSpec , boolean missingOnly , final Integer fixedUrlPropertyTagId ) { final Set < String > existingFixedUrls = new HashSet < String > ( ) ; final Set < SpecNode > nodesWithoutFixedUrls = new HashSet < SpecNode > ( ) ; final List < SpecNode > specNodes = get...
Generate the fixed urls and sets it where required for a content specification .
15,002
public static void collectFixedUrlInformation ( final Collection < SpecNode > specNodes , final Collection < SpecNode > nodesWithoutFixedUrls , final Set < String > existingFixedUrls ) { for ( final SpecNode specNode : specNodes ) { if ( isNullOrEmpty ( specNode . getFixedUrl ( ) ) ) { if ( specNode instanceof CommonCo...
Collect the fixed url information from a list of spec nodes .
15,003
public static String generateFixedURLForNode ( final SpecNode specNode , final Set < String > existingFixedUrls , final Integer fixedUrlPropertyTagId ) { String value ; if ( specNode instanceof ITopicNode ) { final ITopicNode topicNode = ( ITopicNode ) specNode ; final BaseTopicWrapper < ? > topic = topicNode . getTopi...
Generate a fixed url for a specific content spec node making sure that it is valid within the Content Specification .
15,004
protected static void setFixedURL ( final SpecNode specNode , final String fixedURL , final Set < String > existingFixedUrls ) { specNode . setFixedUrl ( fixedURL ) ; existingFixedUrls . add ( fixedURL ) ; }
Sets the fixed URL property on the node .
15,005
public static String getStaticFixedURLForTopicNode ( final ITopicNode topicNode ) { if ( topicNode . getTopicType ( ) == TopicType . REVISION_HISTORY ) { return "appe-Revision_History" ; } else if ( topicNode . getTopicType ( ) == TopicType . LEGAL_NOTICE ) { return "Legal_Notice" ; } else if ( topicNode . getTopicType...
Generate the fixed url for a static topic node .
15,006
public static String createURLTitle ( final String title ) { String baseTitle = title ; baseTitle = baseTitle . replaceAll ( "</(.*?)>" , "" ) . replaceAll ( "<(.*?)>" , "" ) ; final Matcher invalidSequenceMatcher = STARTS_WITH_INVALID_SEQUENCE_RE . matcher ( baseTitle ) ; if ( invalidSequenceMatcher . find ( ) ) { bas...
Creates the URL specific title for a topic or level .
15,007
public static boolean containsFile ( final File parent , final File search ) { boolean exists = false ; final String [ ] children = parent . list ( ) ; if ( children == null ) { return false ; } final List < String > fileList = Arrays . asList ( children ) ; if ( fileList . contains ( search . getName ( ) ) ) { exists ...
Checks if the given file contains only in the parent file not in the subdirectories .
15,008
public static boolean containsFile ( final File fileToSearch , final String pathname ) { final String [ ] allFiles = fileToSearch . list ( ) ; if ( allFiles == null ) { return false ; } final List < String > list = Arrays . asList ( allFiles ) ; return list . contains ( pathname ) ; }
Checks if the given file contains in the parent file .
15,009
public static boolean containsFileRecursive ( final File parent , final File search ) { final File toSearch = search . getAbsoluteFile ( ) ; boolean exists = false ; final File [ ] children = parent . getAbsoluteFile ( ) . listFiles ( ) ; if ( children == null ) { return false ; } final List < File > fileList = Arrays ...
Checks if the given file contains only in the parent file recursively .
15,010
public static long countAllFilesInDirectory ( final File dir , long length , final boolean includeDirectories ) { final File [ ] children = dir . getAbsoluteFile ( ) . listFiles ( ) ; if ( children == null || children . length < 1 ) { return length ; } for ( final File element : children ) { if ( element . isDirectory ...
Counts all the files in a directory recursively . This includes files in the subdirectories .
15,011
public static List < File > findFiles ( final String start , final String [ ] extensions ) { final List < File > files = new ArrayList < > ( ) ; final Stack < File > dirs = new Stack < > ( ) ; final File startdir = new File ( start ) ; if ( startdir . isDirectory ( ) ) { dirs . push ( new File ( start ) ) ; } while ( d...
Searches for files with the given extensions and adds them to a Vector .
15,012
public static List < File > findFilesRecursive ( final File dir , final String filenameToSearch ) { final List < File > foundedFileList = new ArrayList < > ( ) ; final String regex = RegExExtensions . replaceWildcardsWithRE ( filenameToSearch ) ; final File [ ] children = dir . getAbsoluteFile ( ) . listFiles ( ) ; if ...
Finds all files that match the search pattern . The search is recursively .
15,013
public static List < File > findFilesWithFilter ( final File dir , final String ... extension ) { final List < File > foundedFileList = new ArrayList < > ( ) ; final File [ ] children = dir . listFiles ( new MultiplyExtensionsFileFilter ( true , extension ) ) ; for ( final File element : children ) { if ( element . isD...
Finds all files that match the given extension . The search is recursively .
15,014
public static List < File > getAllFilesFromDir ( final File dir ) { final List < File > foundedFileList = new ArrayList < > ( ) ; final File [ ] children = dir . getAbsoluteFile ( ) . listFiles ( ) ; if ( children == null || children . length < 1 ) { return foundedFileList ; } for ( final File child : children ) { if (...
Gets the all files from directory .
15,015
public static String getSearchFilePattern ( final String ... fileExtensions ) { if ( fileExtensions . length == 0 ) { return "" ; } final String searchFilePatternPrefix = "([^\\s]+(\\.(?i)(" ; final String searchFilePatternSuffix = "))$)" ; final StringBuilder sb = new StringBuilder ( ) ; int count = 1 ; for ( final St...
Gets a regex search file pattern that can be used for searching files with a Matcher .
15,016
public static boolean match ( final String stringToMatch , final String suffixes [ ] ) { for ( final String suffix : suffixes ) { final int suffixesLength = suffix . length ( ) ; final int stringToMatchLength = stringToMatch . length ( ) ; final int result = stringToMatchLength - suffixesLength ; final String extension...
Checks the given String matches the given suffixes .
15,017
public BaseScreen getScreen ( Map < String , Object > properties ) { if ( m_topScreen == null ) m_topScreen = ( ScreenModel ) this . createTopScreen ( this . getTask ( ) , null ) ; BaseScreen screen = null ; if ( m_topScreen . getSFieldCount ( ) > 0 ) screen = ( BaseScreen ) m_topScreen . getSField ( 0 ) ; this . setPr...
GetScreen Method .
15,018
public ComponentParent createTopScreen ( Task task , Map < String , Object > properties ) { if ( properties == null ) properties = new HashMap < String , Object > ( ) ; properties . put ( ScreenModel . VIEW_TYPE , ScreenModel . XML_TYPE ) ; properties . put ( DBParams . TASK , task ) ; ComponentParent topScreen = ( Com...
CreateTopScreen Method .
15,019
private URI makeURI ( final String service , final Map < String , String > parameters ) { try { StringBuilder queryStringBuilder = new StringBuilder ( ) ; if ( apiBaseUri . getQuery ( ) != null ) { queryStringBuilder . append ( apiBaseUri . getQuery ( ) ) . append ( "&" ) ; } queryStringBuilder . append ( "srv=" ) . ap...
Build the URI for a particular service call .
15,020
private < T extends CCBAPIResponse > T makeRequest ( final String api , final Map < String , String > params , final String form , final Class < T > clazz ) throws IOException { byte [ ] payload = null ; if ( form != null ) { payload = form . getBytes ( StandardCharsets . UTF_8 ) ; } final InputStream entity = httpClie...
Send a request to CCB .
15,021
public String getDestination ( TrxMessageHeader trxMessageHeader ) { String strDest = ( String ) trxMessageHeader . get ( TrxMessageHeader . DESTINATION_PARAM ) ; return strDest ; }
Get the message destination address
15,022
public static void addCompleter ( BiConsumer < Map < Object , Object > , Long > completer ) { Thread currentThread = Thread . currentThread ( ) ; if ( currentThread instanceof TaggableThread ) { TaggableThread taggableThread = ( TaggableThread ) currentThread ; taggableThread . addMe ( completer ) ; } }
Add a completer whose parameters are tag map and elapsed time in milliseconds . After thread run completers are called .
15,023
public static void tag ( Object key , Object value ) { Thread currentThread = Thread . currentThread ( ) ; if ( currentThread instanceof TaggableThread ) { TaggableThread taggableThread = ( TaggableThread ) currentThread ; taggableThread . tagMe ( key , value ) ; } }
Adds a tag if current thread is TaggableThread otherwise does nothing .
15,024
public final void pagedExecute ( String queryId , LogicalWorkflow workflow , IResultHandler resultHandler , int pageSize ) throws ConnectorException { Long time = null ; try { for ( LogicalStep project : workflow . getInitialSteps ( ) ) { ClusterName clusterName = ( ( Project ) project ) . getClusterName ( ) ; connecti...
This method execute a async and paged query .
15,025
public final QueryResult execute ( String queryId , LogicalWorkflow workflow ) throws ConnectorException { QueryResult result = null ; Long time = null ; try { for ( LogicalStep project : workflow . getInitialSteps ( ) ) { ClusterName clusterName = ( ( Project ) project ) . getClusterName ( ) ; connectionHandler . star...
This method execute a query .
15,026
public IndexMetadataBuilder addColumn ( String columnName , ColumnType colType ) { ColumnName colName = new ColumnName ( tableName , columnName ) ; ColumnMetadata colMetadata = new ColumnMetadata ( colName , null , colType ) ; columns . put ( colName , colMetadata ) ; return this ; }
Add column . Parameters in columnMetadata will be null .
15,027
public IndexMetadataBuilder addOption ( String option , Boolean value ) { if ( options == null ) { options = new HashMap < Selector , Selector > ( ) ; } options . put ( new StringSelector ( option ) , new BooleanSelector ( value ) ) ; return this ; }
Adds a new boolean option .
15,028
public Map getProperties ( ) { Map properties = super . getProperties ( ) ; if ( m_propertiesForFilter != null ) properties . putAll ( m_propertiesForFilter ) ; return properties ; }
Get the properties for this filter .
15,029
public Field [ ] getAllFields ( Object o ) { Field [ ] fields = o . getClass ( ) . getDeclaredFields ( ) ; AccessibleObject . setAccessible ( fields , true ) ; return fields ; }
Returns all declared Fields on Object o as accessible .
15,030
public Method [ ] getAllMethods ( Object o ) { Method [ ] methods = o . getClass ( ) . getDeclaredMethods ( ) ; AccessibleObject . setAccessible ( methods , true ) ; return methods ; }
Returns all declared Methods on Object o as accessible .
15,031
public Object getField ( Object o , String fieldName ) throws NoSuchFieldException , IllegalAccessException { Field field = o . getClass ( ) . getDeclaredField ( fieldName ) ; field . setAccessible ( true ) ; return field . get ( o ) ; }
Gets the specified field on Object o even if that field is not normally accessible . Only fields declared on the class for Object o can be accessed .
15,032
public void setField ( Object o , String fieldName , Object value ) throws NoSuchFieldException , IllegalAccessException { Field field = o . getClass ( ) . getDeclaredField ( fieldName ) ; field . setAccessible ( true ) ; field . set ( o , value ) ; }
Sets the specified field on Object o to the specified value even if that field is not normally accessible . Only fields declared on the class for Object o can be accessed .
15,033
public void init ( Record record , String strName , int iDataLength , String strDesc , Object strDefault ) { super . init ( record , strName , DBConstants . DEFAULT_FIELD_LENGTH , strDesc , strDefault ) ; if ( iDataLength == DBConstants . DEFAULT_FIELD_LENGTH ) m_iFakeFieldLength = 24 ; else m_iFakeFieldLength = iDataL...
Initialize the member fields .
15,034
public static void filterInnerPoints ( DenseMatrix64F points , DenseMatrix64F center , int minLeft , double percent ) { assert points . numCols == 2 ; assert center . numCols == 1 ; assert center . numRows == 2 ; if ( percent <= 0 || percent >= 1 ) { throw new IllegalArgumentException ( "percent " + percent + " is not ...
Filters points which are closes to the last estimated tempCenter .
15,035
public static double meanCenter ( DenseMatrix64F points , DenseMatrix64F center ) { assert points . numCols == 2 ; assert center . numCols == 1 ; assert center . numRows == 2 ; center . zero ( ) ; int count = points . numRows ; double [ ] d = points . data ; for ( int i = 0 ; i < count ; i ++ ) { center . add ( 0 , 0 ,...
Calculates mean tempCenter of points
15,036
public static double initialCenter ( DenseMatrix64F points , DenseMatrix64F center ) { assert points . numCols == 2 ; assert center . numCols == 1 ; assert center . numRows == 2 ; center . zero ( ) ; int count = 0 ; int len1 = points . numRows ; int len2 = len1 - 1 ; int len3 = len2 - 1 ; for ( int i = 0 ; i < len3 ; i...
Calculates an initial estimate for tempCenter .
15,037
public static File writeToFile ( InputStream inputStream , File file ) throws IOException { try ( RandomAccessFile raf = new RandomAccessFile ( file , "rw" ) ) { ReadableByteChannel inputChannel = Channels . newChannel ( inputStream ) ; FileChannel fileChannel = raf . getChannel ( ) ; fastChannelCopy ( inputChannel , f...
Writes from an InputStream to a file
15,038
public static File writeToTempFile ( InputStream inputStream , String prefix , String suffix ) throws IOException { File file = File . createTempFile ( prefix , "." + suffix ) ; writeToFile ( inputStream , file ) ; return file ; }
Writes from an InputStream to a temporary file
15,039
public static File writeToTempFile ( String buf , String prefix , String suffix ) throws IOException { InputStream is = new ByteArrayInputStream ( buf . getBytes ( "UTF-8" ) ) ; return writeToTempFile ( is , prefix , suffix ) ; }
Writes from a String to a temporary file
15,040
public void scanProjects ( int parentProjectID ) { ClassProject classProject = new ClassProject ( this ) ; try { classProject . addNew ( ) ; classProject . setKeyArea ( ClassProject . ID_KEY ) ; classProject . getField ( ClassProject . ID ) . setValue ( parentProjectID ) ; if ( classProject . seek ( null ) ) { if ( isB...
ScanProjects Method .
15,041
public void scanAllPackages ( ClassProject classProject ) { this . setProperty ( "projectID" , classProject . getField ( ClassProject . ID ) . toString ( ) ) ; this . scanPackages ( classProject , ClassProject . CodeType . RESOURCE_CODE ) ; this . scanPackages ( classProject , ClassProject . CodeType . RESOURCE_PROPERT...
ScanAllPackages Method .
15,042
public void scanPackages ( ClassProject classProject , ClassProject . CodeType codeType ) { String projectClassDirectory = classProject . getFileName ( null , null , codeType , true , false ) ; Packages recPackages = ( Packages ) this . getMainRecord ( ) ; Map < String , Object > prop = new HashMap < String , Object > ...
ScanPackages Method .
15,043
public boolean isBaseDatabase ( Record record ) { BaseDatabase database = record . getTable ( ) . getDatabase ( ) ; boolean isBaseDB = true ; int counter = ( int ) record . getCounterField ( ) . getValue ( ) ; String startingID = database . getProperty ( BaseDatabase . STARTING_ID ) ; String endingID = database . getPr...
IsBaseDatabase Method .
15,044
public String getFieldDesc ( ) { if ( m_convDescField != null ) return m_convDescField . getFieldDesc ( ) ; if ( ( m_strAltDesc == null ) || ( m_strAltDesc . length ( ) == 0 ) ) return super . getFieldDesc ( ) ; else return m_strAltDesc ; }
Get the field description .
15,045
protected String [ ] getLibEntries ( String dir ) { String [ ] entries = new String [ 0 ] ; File libdir = new File ( dir ) ; if ( libdir . exists ( ) && libdir . isDirectory ( ) ) { entries = libdir . list ( ) ; } return entries ; }
Returns a list of entries in the given directory . This method is separated so that unit tests can override it to return test - friendly file names .
15,046
public void free ( ) { if ( m_recordOwnerCollection != null ) m_recordOwnerCollection . free ( ) ; m_recordOwnerCollection = null ; if ( m_messageFilterList != null ) m_messageFilterList . free ( ) ; m_messageFilterList = null ; if ( m_vRecordList != null ) m_vRecordList . free ( this ) ; m_vRecordList = null ; if ( m_...
Free this remote record owner . Also explicitly unexports the RMI object .
15,047
public static String embed ( final String expression , final char trigger ) { return new StringBuilder ( ) . append ( trigger ) . append ( '{' ) . append ( strip ( expression ) ) . append ( '}' ) . toString ( ) ; }
Embed the specified expression if necessary using the specified triggering character .
15,048
public static char getTrigger ( final String delimitedExpression ) { final String expr = StringUtils . trimToEmpty ( delimitedExpression ) ; Validate . isTrue ( isDelimited ( expr ) ) ; return expr . charAt ( 0 ) ; }
Get the trigger character for the specified delimited expression .
15,049
public static String strip ( final String expression ) { final String expr = StringUtils . trimToEmpty ( expression ) ; final Matcher matcher = DELIMITED_EXPR . matcher ( expr ) ; return matcher . matches ( ) ? matcher . group ( 1 ) : expr ; }
Strip any delimiter from the specified expression .
15,050
public static String join ( final char trigger , final String ... expressions ) { Validate . notEmpty ( expressions ) ; final StringBuilder buf = new StringBuilder ( ) ; for ( String expression : expressions ) { final String stripped = strip ( expression ) ; if ( expression . isEmpty ( ) ) { continue ; } final int len ...
Join expressions using the specified trigger character .
15,051
public static < T > T coerceToType ( ELContext context , Class < T > toType , Object object ) { @ SuppressWarnings ( "unchecked" ) T result = ( T ) getExpressionFactory ( context ) . coerceToType ( object , toType ) ; return result ; }
Use EL specification coercion facilities to coerce an object to the specified type .
15,052
private org . hibernate . Query query ( String hql , Class < ? > ... type ) { org . hibernate . Query q = session . createQuery ( hql ) ; for ( int i = 0 ; i < positionedParameters . length ; i ++ ) { q . setParameter ( i , positionedParameters [ i ] ) ; } for ( Map . Entry < String , Object > entry : namedParameters ....
Create Hibernate query object and initialize it from this helper properties .
15,053
public static AbstractMatrix getInstance ( int rows , int cols , Class < ? > cls ) { return new AbstractMatrix ( rows , Array . newInstance ( cls , rows * cols ) ) ; }
Returns new DoubleMatrix initialized to zeroes .
15,054
public void swapRows ( int r1 , int r2 , Object tmp ) { int col = columns ( ) ; System . arraycopy ( array , col * r1 , tmp , 0 , col ) ; System . arraycopy ( array , col * r2 , array , col * r1 , col ) ; System . arraycopy ( tmp , 0 , array , col * r2 , col ) ; }
Swaps row r1 and r2 possibly using tmp
15,055
public void classifyTree ( Area root , FeatureExtractor features ) { if ( classifier != null ) { System . out . print ( "tree visual classification..." ) ; testRoot = root ; this . features = features ; testset = new Instances ( trainset , 0 ) ; mapping = new HashMap < Area , Instance > ( ) ; recursivelyExtractAreaData...
Classifies the areas in an area tree .
15,056
private Subquery < ImageFile > getImagesWithFileNameSubquery ( final String filename , final FilterStringLogic searchLogic ) { final CriteriaBuilder criteriaBuilder = getCriteriaBuilder ( ) ; final Subquery < ImageFile > subQuery = getCriteriaQuery ( ) . subquery ( ImageFile . class ) ; final Root < LanguageImage > roo...
Create a Subquery to check if a image has a specific filename .
15,057
protected void connectionClosed ( IoSession session ) { this . connected = false ; this . _disconnect ( ) ; log . info ( "Connection lost to aggregator at {}:{}" , this . host , Integer . valueOf ( this . port ) ) ; while ( this . stayConnected ) { try { Thread . sleep ( this . connectionRetryDelay ) ; } catch ( Interr...
Called when the connection to the aggregator closes .
15,058
protected void handshakeReceived ( IoSession session , HandshakeMessage handshakeMessage ) { log . debug ( "Received {}" , handshakeMessage ) ; this . receivedHandshake = handshakeMessage ; Boolean handshakeCheck = this . checkHandshake ( ) ; if ( handshakeCheck == null ) { return ; } if ( Boolean . FALSE . equals ( ha...
Called when a handshake message is received from the aggregator .
15,059
protected SubscriptionMessage generateGenericSubscriptionMessage ( ) { SubscriptionMessage subMessage = new SubscriptionMessage ( ) ; subMessage . setRules ( this . rules ) ; subMessage . setMessageType ( SubscriptionMessage . SUBSCRIPTION_MESSAGE_ID ) ; return subMessage ; }
Creates a generic subscription message with the rules defined within this interface .
15,060
protected void solverSampleReceived ( IoSession session , SampleMessage sampleMessage ) { for ( SampleListener listener : this . sampleListeners ) { listener . sampleReceived ( this , sampleMessage ) ; } }
Called when a sample is received from the aggregator .
15,061
protected void subscriptionRequestSent ( IoSession session , SubscriptionMessage subscriptionMessage ) { this . sentSubscription = subscriptionMessage ; log . info ( "Sent {}" , subscriptionMessage ) ; }
Called after a subscription request message is sent to the aggregator .
15,062
protected void subscriptionResponseReceived ( IoSession session , SubscriptionMessage subscriptionMessage ) { log . info ( "Received {}" , subscriptionMessage ) ; this . receivedSubscription = subscriptionMessage ; if ( this . sentSubscription == null ) { log . error ( "Protocol error: Received a subscription response ...
Called when a subscription response is received from the aggregator .
15,063
protected void exceptionCaught ( IoSession session , Throwable cause ) { log . error ( "Unhandled exception for: " + String . valueOf ( session ) , cause ) ; if ( this . disconnectOnException ) { this . _disconnect ( ) ; } }
Called when an exception occurs on the session
15,064
public StoreSchema getStore ( final String name ) { for ( StoreSchema store : storeSchemas ) if ( store . getName ( ) . equals ( name ) ) return store ; return null ; }
Returns the schema for the stores on this annotation class whose name matches the provided name . This method returns null if no field matches .
15,065
public static void modify ( int calleeValKind , Object callee , String calleeClass , String fieldName , int callerValKind , Object caller , String callerClass ) { System . err . println ( "modify( " + valAndValKindToString ( callee , calleeClass , calleeValKind ) + " . " + fieldName + ", " + "caller=" + valAnd...
an object WRITES a primitive field of another object
15,066
public void getPrice ( BaseMessage message ) { String strPrice = ( String ) message . get ( "hotelRate" ) ; System . out . println ( "Price: " + strPrice ) ; String strItem = ( String ) message . get ( "correlationID" ) ; int iHash = - 1 ; try { iHash = Integer . parseInt ( strItem ) ; } catch ( NumberFormatException e...
Get the price of this product .
15,067
public < A > void listen ( Class < A > key , VoidEvent < A > value ) { map . wire ( key , value ) ; }
Add void listener
15,068
static public Bus getBy ( String busName ) { if ( busName == null ) return get ( ) ; Bus bus = busMap . get ( busName ) ; if ( bus == null ) { bus = new Bus ( ) ; busMap . put ( busName , bus ) ; } return bus ; }
Get bus instance by name
15,069
static public Bus getBy ( Class < ? > busName ) { if ( busName == null ) return get ( ) ; return getBy ( busName . getName ( ) ) ; }
Get bus instance by class name
15,070
static public Bus getBy ( Object busName ) { if ( busName == null ) return get ( ) ; return getBy ( busName . getClass ( ) ) ; }
Get bus instance by object class name
15,071
public void setOwner ( ListenerOwner owner ) { super . setOwner ( owner ) ; if ( owner == null ) return ; if ( ( m_strFieldNameToCheck != null ) && ( m_strFieldNameToCheck . length ( ) > 0 ) ) if ( ( m_fldToCheck == null ) || ( m_fldToCheck . getFieldName ( ) == null ) || ( m_fldToCheck . getFieldName ( ) . length ( ) ...
Set the field or file that owns this listener . Besides inherited this method closes the owner record .
15,072
public int getMessageLength ( ) { int length = 1 ; if ( this . matchingIds != null ) { for ( String id : this . matchingIds ) { try { length += 4 ; length += id . getBytes ( "UTF-16BE" ) . length ; } catch ( UnsupportedEncodingException uee ) { log . error ( "Unable to encode UTF-16BE String: {}" , uee ) ; } } } return...
Gets the length of this message when encoded according to the Client - World Model protocol .
15,073
public int getRelativeSField ( int iSFieldSeq ) { Convert lastField = null ; for ( int i = 0 ; i < m_gridScreen . getSFieldCount ( ) ; i ++ ) { Convert field = m_gridScreen . getSField ( i ) . getConverter ( ) ; if ( field != null ) field = field . getField ( ) ; if ( m_gridScreen . getSField ( i ) instanceof ToolScree...
This is lame .
15,074
public static void main ( final String [ ] args ) { Utils4Swing . initSystemLookAndFeel ( ) ; final Cancelable cancelable = new CancelableVolatile ( ) ; final FileCopyProgressMonitor monitor = new FileCopyProgressMonitor ( cancelable , "Copy Test" , 10 ) ; monitor . open ( ) ; try { for ( int i = 0 ; i < 10 ; i ++ ) { ...
Main method to test the monitor . Only for testing purposes .
15,075
public void free ( ) { CalendarPanel panel = ( CalendarPanel ) JBasePanel . getSubScreen ( this , CalendarPanel . class ) ; if ( panel != null ) panel . free ( ) ; super . free ( ) ; }
Free the sub = components .
15,076
public CalendarModel getCalendarModel ( FieldTable table ) { if ( m_model == null ) if ( table != null ) m_model = new CalendarThinTableModel ( table ) ; return m_model ; }
Get the calendar model . Override this to supply the calendar model . The default listener wraps the table in a CalendarThinTableModel .
15,077
public void propertyChange ( PropertyChangeEvent evt ) { String strProperty = evt . getPropertyName ( ) ; if ( this . isValidProperty ( strProperty ) ) { Object objCurrentValue = this . get ( strProperty ) ; if ( evt . getNewValue ( ) != objCurrentValue ) { m_strCurrentProperty = strProperty ; if ( evt . getNewValue ( ...
This method gets called when a bound property is changed . Propogate the event to all listeners .
15,078
public Map < String , Object > getProperties ( ) { Map < String , Object > properties = new Hashtable < String , Object > ( ) ; ParamDispatcher params = this ; for ( Enumeration < String > e = params . keys ( ) ; e . hasMoreElements ( ) ; ) { String strKey = e . nextElement ( ) ; String strValue = params . get ( strKey...
Get the current parameters for this screen . Convert the params to strings and place them in a properties object .
15,079
public boolean isValidProperty ( String strProperty ) { if ( m_rgstrValidParams != null ) { for ( int i = 0 ; i < m_rgstrValidParams . length ; i ++ ) { if ( m_rgstrValidParams [ i ] . equalsIgnoreCase ( strProperty ) ) { if ( m_strCurrentProperty != strProperty ) { return true ; } } } } return false ; }
This method gets called when a bound property is changed . Propagate the event to all listeners .
15,080
public void firePropertyChange ( String propertyName , Object oldValue , Object newValue ) { if ( propertyChange != null ) propertyChange . firePropertyChange ( propertyName , oldValue , newValue ) ; }
The firePropertyChange method was generated to support the propertyChange field .
15,081
public Angle add ( Angle angle , boolean clockwice ) { if ( clockwice ) { return new Angle ( normalizeToFullAngle ( value + angle . value ) ) ; } else { return new Angle ( normalizeToFullAngle ( value - angle . value ) ) ; } }
Add angle clockwise or counter clockwice .
15,082
public Angle turn ( Angle angle ) { if ( angle . getRadians ( ) < Math . PI ) { return add ( angle , true ) ; } else { return add ( angle . toHalfAngle ( ) , false ) ; } }
Turn angle clockwise or counter clockwice . If &lt ; 180 turns clockwice . If &ge ; 180 turns counter clockwice 360 - angle
15,083
public final boolean inSector ( Angle start , Angle end ) { if ( start . clockwise ( end ) ) { return ! clockwise ( start ) && clockwise ( end ) ; } else { return clockwise ( start ) && ! clockwise ( end ) ; } }
Sector is less than 180 degrees delimited by start and end
15,084
public static final Angle difference ( Angle a1 , Angle a2 ) { return new Angle ( normalizeToHalfAngle ( angleDiff ( a1 . value , a2 . value ) ) ) ; }
The difference between two angles
15,085
public static final boolean clockwise ( Angle angle1 , Angle angle2 ) { return clockwise ( angle1 . value , angle2 . value ) ; }
10 is clockwise from 340
15,086
public static final double signed ( double angle ) { angle = normalizeToFullAngle ( angle ) ; if ( angle > Math . PI ) { return angle - FULL_CIRCLE ; } else { return angle ; } }
Convert full angle to signed angle - 180 - 180 . 340 - &gt ; - 20
15,087
public static UserInfo getUserInfo ( final String userId ) { if ( userId == null ) { throw new IllegalArgumentException ( "null userName" ) ; } try { Class < ? > accessor = Class . forName ( "com.sap.security.um.service.UserManagementAccessor" ) ; if ( accessor != null ) { Object users = MethodUtils . invokeExactStatic...
never returns null
15,088
public Predictor method ( int method , int startPage ) { input . add ( new CommandLine < > ( METHOD , 5 , method , startPage ) ) ; return this ; }
The METHOD command defines the analysis task to be performed for a particular system configuration .
15,089
public Predictor execute ( KRun krun ) { input . add ( new CommandLine < > ( EXECUTE , 5 , krun . ordinal ( ) ) ) ; return this ; }
The EXECUTE command causes the program to perform the indicated analysis task for the currently defined system configuration .
15,090
public Predictor time ( int ihro , int ihre , int ihrs , boolean ut ) { input . add ( new CommandLine < > ( TIME , 5 , ihro , ihre , ihrs , ut ? 1 : - 1 ) ) ; return this ; }
The TIME command indicates the time of day for which the analysis and predictions are to be performed .
15,091
public Predictor month ( int nyear , Month ... months ) { Object [ ] arr = new Object [ months . length + 1 ] ; arr [ 0 ] = nyear ; int index = 1 ; for ( Month m : months ) { arr [ index ++ ] = Double . valueOf ( m . getValue ( ) ) ; } input . add ( new CommandLine < > ( MONTH , 5 , arr ) ) ; return this ; }
The MONTH command indicates the year and months for which the analysis and prediction are to be performed .
15,092
public Predictor sunspot ( double ... sunspot ) { CommandLine < Double > line = new CommandLine < > ( SUNSPOT , 5 ) ; for ( double s : sunspot ) { line . add ( s ) ; } input . add ( line ) ; return this ; }
The sunspot command line indicates the sunspot numbers of the solar activity period of interest and is the 12 - month smoothed mean for each of the months specified .
15,093
public Predictor label ( String itran , String ircvr ) { input . add ( new CommandLine < > ( LABEL , 20 , itran , ircvr ) ) ; return this ; }
The LABEL command contains alphanumeric information used to describe the system location on both the input and output .
15,094
public Predictor circuit ( Location transmitter , Location receiver , boolean shorter ) { this . receiverLocation = receiver ; input . add ( new CommandLine < > ( CIRCUIT , 5 , Math . abs ( transmitter . getLatitude ( ) ) , transmitter . getLatitudeNS ( ) , Math . abs ( transmitter . getLongitude ( ) ) , transmitter . ...
The CIRCUIT command contains the geographic coordinates of the transmitter and receiver and a variable to indicate the user s choice between shorter or longer great circle paths from the transmitter to the receiver .
15,095
public Predictor frequency ( double ... frel ) { frequencies = frel ; CommandLine < Double > line = new CommandLine < > ( FREQUENCY , 5 ) ; for ( double f : frel ) { line . add ( f ) ; } input . add ( line ) ; return this ; }
The FREQUENCY complement command line contains up to 11 user - defined frequencies that are used in the calculation .
15,096
public < T extends BaseBugLinkStrategy < ? > > T create ( final BugLinkType type , final String serverUrl , final Object ... additionalArgs ) { if ( ! internalsRegistered ) { registerInternals ( ) ; } if ( map . containsKey ( type ) ) { try { final SortedSet < Helper > helpers = map . get ( type ) ; T helper = null ; f...
Create a strategy instance to be used for the specified type and server url .
15,097
public static final int call ( Path cwd , Map < String , String > env , String ... args ) throws IOException , InterruptedException { if ( args . length == 1 ) { args = args [ 0 ] . split ( "[ ]+" ) ; } String cmd = Arrays . stream ( args ) . collect ( Collectors . joining ( " " ) ) ; JavaLogging . getLogger ( OSProces...
Call os process and waits it s execution .
15,098
public void sessionSetup ( String project , String profile ) throws PeachApiException { stashUnirestProxy ( ) ; if ( _debug ) System . out . println ( ">>sessionSetup" ) ; try { HttpResponse < JsonNode > ret = null ; try { ret = Unirest . post ( String . format ( "%s/api/sessions" , _api ) ) . queryString ( "project" ,...
Start a Peach API Security job .
15,099
public void sessionTeardown ( ) throws PeachApiException { stashUnirestProxy ( ) ; if ( _debug ) System . out . println ( ">>sessionTeardown" ) ; try { HttpResponse < String > ret = null ; try { ret = Unirest . delete ( String . format ( "%s/api/sessions/%s" , _api , _jobid ) ) . header ( _token_header , _api_token ) ....
Stop testing job and destroy proxy .