idx
int64
0
41.2k
question
stringlengths
74
4.21k
target
stringlengths
5
888
16,600
public int [ ] getComponentOrder ( Container container ) { int components = container . getComponentCount ( ) ; int [ ] componentOrder = new int [ components ] ; int [ ] rgY = new int [ components ] ; for ( int i = 0 ; i < components ; i ++ ) { componentOrder [ i ] = i ; rgY [ i ] = container . getComponent ( i ) . get...
Get the component order by how they are ordered vertically on the screen .
16,601
public void resetAll ( ) { currentLocationOnPage = 0 ; componentIndex = 0 ; currentComponent = this . getComponent ( componentIndex ) ; componentStartYLocation = 0 ; componentPageHeight = 0 ; currentPageIndex = 0 ; remainingComponentHeight = 0 ; if ( currentComponent != null ) remainingComponentHeight = currentComponen...
Reset to the first page .
16,602
public boolean setCurrentYLocation ( int targetPageIndex , int targetLocationOnPage ) { this . resetAll ( ) ; boolean pageDone = false ; while ( pageDone == false ) { if ( currentComponent == null ) break ; componentPageHeight = this . calcComponentPageHeight ( ) ; if ( currentPageIndex > targetPageIndex ) break ; if (...
Set the current Y location and change the current component information to match .
16,603
public int getMaxComponentWidth ( ) { int maxWidth = 0 ; for ( int index = 0 ; ; index ++ ) { Component component = this . getComponent ( index ) ; if ( component == null ) break ; if ( component instanceof JTableHeader ) continue ; if ( component instanceof JPanel ) { for ( int i = 0 ; i < ( ( JPanel ) component ) . g...
Get the widest component . To calculate the scale .
16,604
public Component getComponent ( int componentIndex ) { if ( componentList != null ) if ( componentIndex < componentList . length ) return componentList [ componentIndex ] ; return null ; }
Get the component at this index .
16,605
public int checkComponentHeight ( ) { int maxHeightToCheck = componentStartYLocation - currentLocationOnPage + pageHeight ; if ( currentComponent == null ) return 0 ; if ( currentComponent instanceof JTable ) { int beforeHeight = currentComponent . getHeight ( ) ; int rowHeight = ( ( JTable ) currentComponent ) . getRo...
Get the height of this component . Typically this is just the height of the component . Except for JTables where I need to query to this target height to make sure the component is at least this correct height .
16,606
public int calcComponentPageHeight ( ) { remainingComponentHeight = remainingComponentHeight + this . checkComponentHeight ( ) ; if ( remainingComponentHeight <= remainingPageHeight ) return remainingComponentHeight ; if ( currentComponent == null ) return 0 ; if ( ! ( currentComponent instanceof Container ) ) return 0...
Calculate the remaining height of this component on this page . This is used to calculate a smart page break that does not split a control between pages .
16,607
protected final QueryResult executeWorkFlow ( LogicalWorkflow workflow ) throws ConnectorException { checkIsSupported ( workflow ) ; ClusterName clusterName = ( ( Project ) workflow . getInitialSteps ( ) . get ( 0 ) ) . getClusterName ( ) ; return execute ( ( Project ) workflow . getInitialSteps ( ) . get ( 0 ) , conne...
This method execute a query with only a project .
16,608
protected final void asyncExecuteWorkFlow ( String queryId , LogicalWorkflow workflow , IResultHandler resultHandler ) throws ConnectorException { checkIsSupported ( workflow ) ; ClusterName clusterName = ( ( Project ) workflow . getInitialSteps ( ) . get ( 0 ) ) . getClusterName ( ) ; asyncExecute ( queryId , ( Projec...
Abstract method which must be implemented by the concrete database metadataEngine to execute a async workflow .
16,609
protected final void pagedExecuteWorkFlow ( String queryId , LogicalWorkflow workflow , IResultHandler resultHandler , int pageSize ) throws ConnectorException { checkIsSupported ( workflow ) ; ClusterName clusterName = ( ( Project ) workflow . getInitialSteps ( ) . get ( 0 ) ) . getClusterName ( ) ; pagedExecute ( que...
Abstract method which must be implemented by the concrete database metadataEngine to execute a async and paged workflow .
16,610
public Object set ( int index , Object element ) { if ( ( index < m_iStartIndex ) || ( index >= m_iStartIndex + m_iMaxSize ) ) { int iNewStart = index - m_iMaxSize / 2 ; if ( iNewStart < 0 ) iNewStart = 0 ; int iStart = 0 ; int iEnd = this . size ( ) - 1 ; int iIncrement = + 1 ; if ( iNewStart < m_iStartIndex ) { iStar...
Set this element to this object . If this index is not in the current array shift the array and add it .
16,611
public void addState ( String name , Runnable enter ) { addState ( name , ( S ) new AdhocState ( name , enter , null , null ) ) ; }
Creates named state with functional interface .
16,612
public void addState ( String name , S state ) { AbstractState old = states . put ( name , new StateWrapper ( name , state ) ) ; if ( old != null ) { throw new IllegalArgumentException ( "state " + name + " exists already" ) ; } }
Creates named state
16,613
public void initSharedRecord ( Record record ) { FieldListener listener = null ; try { BaseField field = record . getSharedRecordTypeKey ( ) ; field . addListener ( listener = new InitOnceFieldHandler ( null ) ) ; field . setData ( new Integer ( 0 ) , true , DBConstants . INIT_MOVE ) ; field . setData ( new Integer ( 0...
InitSharedRecord Method .
16,614
public boolean validateContentSpec ( final ContentSpec contentSpec , final String username ) { boolean valid = preValidateContentSpec ( contentSpec ) ; if ( ! postValidateContentSpec ( contentSpec , username ) ) { valid = false ; } return valid ; }
Validates that a Content Specification is valid by checking the META data child levels and topics . This method is a wrapper to first call PreValidate and then PostValidate .
16,615
private boolean preValidateXML ( final KeyValueNode < String > keyValueNode , final String wrappedValue , final String format ) { Document doc = null ; String errorMsg = null ; try { String fixedXML = DocBookUtilities . escapeForXML ( wrappedValue ) ; if ( CommonConstants . DOCBOOK_50_TITLE . equalsIgnoreCase ( format ...
Performs the pre validation on keyvalue nodes that may be used as XML to ensure it is at least valid XML .
16,616
private boolean doesPublicanCfgsContainValue ( final ContentSpec contentSpec , final String value ) { final Pattern pattern = Pattern . compile ( "^(.*\\n)?( |\\t)*" + value + ":.*" , java . util . regex . Pattern . DOTALL ) ; if ( ! isNullOrEmpty ( contentSpec . getPublicanCfg ( ) ) && pattern . matcher ( contentSpec ...
Check if the default or additional publican cfg files have a specified value
16,617
protected void checkForConflictingCondition ( final IOptionsNode node , final ContentSpec contentSpec ) { if ( ! isNullOrEmpty ( node . getConditionStatement ( ) ) ) { final String publicanCfg ; if ( ! contentSpec . getDefaultPublicanCfg ( ) . equals ( CommonConstants . CS_PUBLICAN_CFG_TITLE ) ) { final String name = c...
Check if the condition on a node will conflict with a condition in the defined publican . cfg file .
16,618
protected boolean validateEntities ( final ContentSpec contentSpec ) { final String entities = contentSpec . getEntities ( ) ; if ( isNullOrEmpty ( entities ) ) return true ; boolean valid = true ; final String wrappedEntities = "<!DOCTYPE section [" + entities + "]><section></section>" ; Document doc = null ; try { do...
Validates the custom entities to ensure that only the defaults are overridden and that the content is valid XML .
16,619
protected boolean postValidateXML ( final ContentSpec contentSpec , final KeyValueNode < String > keyValueNode , final String wrappedElement , String parentElement ) { String fixedWrappedElement = DocBookUtilities . escapeForXML ( wrappedElement ) ; final String docbookFileName ; final XMLValidator . ValidationMethod v...
Checks that the XML for a keyvalue node is valid DocBook XML .
16,620
protected boolean validateFiles ( final ContentSpec contentSpec ) { final FileList fileList = contentSpec . getFileList ( ) ; boolean valid = true ; if ( fileList != null && ! fileList . getValue ( ) . isEmpty ( ) ) { for ( final File file : fileList . getValue ( ) ) { FileWrapper fileWrapper = null ; try { fileWrapper...
Checks to make sure that the files specified in a content spec are valid and exist .
16,621
public boolean preValidateRelationships ( final ContentSpec contentSpec ) { boolean error = false ; final Map < String , List < ITopicNode > > specTopicMap = ContentSpecUtilities . getIdTopicNodeMap ( contentSpec ) ; final Map < SpecNodeWithRelationships , List < Relationship > > relationships = contentSpec . getRelati...
Validate a set of relationships created when parsing .
16,622
protected boolean validateFixedUrl ( final SpecNode specNode , final Set < String > processedFixedUrls ) { boolean valid = true ; if ( ! ProcessorConstants . VALID_FIXED_URL_PATTERN . matcher ( specNode . getFixedUrl ( ) ) . matches ( ) ) { log . error ( format ( ProcessorConstants . ERROR_FIXED_URL_NOT_VALID , specNod...
Checks to make sure that a user defined fixed url is valid
16,623
protected boolean preValidateCommonContent ( final CommonContent commonContent , final BookType bookType ) { boolean valid = true ; if ( isShuttingDown . get ( ) ) { shutdown . set ( true ) ; return false ; } if ( isNullOrEmpty ( commonContent . getTitle ( ) ) ) { log . error ( String . format ( ProcessorConstants . ER...
Validates a Common Content node for formatting issues .
16,624
private boolean validateExistingTopicTags ( final ITopicNode topicNode , final BaseTopicWrapper < ? > topic ) { if ( topicNode . getRevision ( ) != null ) { return true ; } boolean valid = true ; final List < String > tagNames = topicNode . getTags ( true ) ; if ( ! tagNames . isEmpty ( ) ) { final Set < TagWrapper > t...
Checks that adding tags to existing topic won t cause problems
16,625
public boolean preValidateBugLinks ( final ContentSpec contentSpec ) { if ( ! contentSpec . isInjectBugLinks ( ) ) { return true ; } final BugLinkOptions bugOptions ; final BugLinkType type ; if ( contentSpec . getBugLinks ( ) . equals ( BugLinkType . JIRA ) ) { type = BugLinkType . JIRA ; bugOptions = contentSpec . ge...
Validate the Bug Links MetaData for a Content Specification without doing any external calls .
16,626
public boolean postValidateBugLinks ( final ContentSpec contentSpec , boolean strict ) { if ( ! contentSpec . isInjectBugLinks ( ) ) { return true ; } try { final BugLinkOptions bugOptions ; final BugLinkType type ; if ( contentSpec . getBugLinks ( ) . equals ( BugLinkType . JIRA ) ) { type = BugLinkType . JIRA ; bugOp...
Validate the Bug Links MetaData for a Content Specification .
16,627
public static List < Block > removeEmptyBlocks ( final Collection < Block > blocks ) { List < Block > cleanBlocks = Lists . newArrayListWithExpectedSize ( blocks . size ( ) ) ; for ( Block block : blocks ) { if ( block . content . isEmpty ( ) ) { continue ; } if ( isWhitespace ( block . content ) ) { continue ; } clean...
Removes empty blocks from a collection of blocks .
16,628
private static Block block ( final String comment , final int nameStart ) { int attrIndex = comment . indexOf ( '{' ) ; if ( attrIndex != - 1 ) { return new Block ( comment . substring ( nameStart , attrIndex ) . trim ( ) , comment . substring ( attrIndex ) . trim ( ) ) ; } else { return new Block ( comment . substring...
Creates an empty block from a comment string .
16,629
public static < FT extends FarObject < NT > , NT > FT getFarObject ( NT nearObject , Class < FT > farType ) { return nearObject == null ? null : farType . cast ( getFarObject ( nearObject ) ) ; }
Returns the far object that corresponds to the given near object in a type safe way .
16,630
public static FarObject < ? > getFarObject ( Object nearObject ) { return nearObject == null ? null : getFacets ( nearObject ) . getFarObject ( ) ; }
Returns the far object that corresponds to the given near object .
16,631
public static WebApiClient getInstance ( Locale locale ) { if ( null == webApiClient ) { webApiClient = new WebApiClient ( locale ) ; } return webApiClient ; }
Returns instance of web API client for given locale . This method use default connection parameters from property configuration file .
16,632
public static WebApiClient getInstance ( Locale locale , String host , int port ) { if ( null == webApiClient ) { webApiClient = new WebApiClient ( locale , host , "" + port ) ; } return webApiClient ; }
Returns instance of web API client for given locale and connection properties .
16,633
public Correspondence match ( String sourceName , List < String > sourceNodes , String targetName , List < String > targetNodes ) { MatchMethods method = new MatchMethods ( httpClient , locale , serverPath ) ; Correspondence correspondace = null ; try { correspondace = method . match ( sourceName , sourceNodes , target...
Returns the correspondence between the source and the target contexts
16,634
private static Map < String , String > parseAttributes ( String attrString ) throws ParseException { AttributeString str = new AttributeString ( attrString ) ; Map < String , String > attributes = Maps . newLinkedHashMapWithExpectedSize ( 4 ) ; AttrState state = AttrState . NAME ; String currName = "" ; String currStri...
Parse attributes in a shortcode .
16,635
private static String scanForName ( int pos , final char [ ] chars ) { StringBuilder buf = new StringBuilder ( ) ; while ( pos < chars . length ) { char ch = chars [ pos ++ ] ; switch ( ch ) { case ' ' : case ']' : return buf . toString ( ) ; case '[' : case '<' : case '>' : case '&' : case '/' : return "" ; default : ...
Scans for a valid shortcode name .
16,636
public static String fixDisplayURL ( String strURL , boolean bHelp , boolean bNoNav , boolean bLanguage , PropertyOwner propertyOwner ) { if ( ( strURL == null ) || ( strURL . length ( ) == 0 ) ) return strURL ; Map < String , Object > properties = UrlUtil . parseArgs ( null , strURL ) ; if ( bHelp ) properties . put (...
Get this URL minus the nav bars
16,637
public boolean matches ( ESigItem item ) { if ( selected != null && item . isSelected ( ) != selected ) { return false ; } if ( eSigType != null && ! item . getESigType ( ) . equals ( eSigType ) ) { return false ; } if ( session != null && ! item . getSession ( ) . equals ( session ) ) { return false ; } if ( ids != nu...
Returns true if the item matches the selection filter .
16,638
public void scanTableItems ( ) { m_vDisplays = new Vector < String > ( ) ; m_vValues = new Vector < String > ( ) ; String strField = null ; Convert converter = this . getScreenField ( ) . getConverter ( ) ; Object data = converter . getData ( ) ; BaseField field = ( BaseField ) converter . getField ( ) ; boolean bModif...
Scan through the items and cache the values and display strings .
16,639
public String getSFieldProperty ( String strFieldName ) { String strValue = super . getSFieldProperty ( strFieldName ) ; Convert converter = this . getScreenField ( ) . getConverter ( ) ; String strConverter = converter . toString ( ) ; if ( ( ( strValue != null ) && ( strValue . equals ( strConverter ) ) ) || ( ( strV...
Get this control s value as it was submitted by the HTML post operation .
16,640
public static Object unmarshall ( HttpResponse response ) throws JAXBException , IOException { String xml = EntityUtils . toString ( response . getEntity ( ) ) ; Unmarshaller unmarshaller = ctx . createUnmarshaller ( ) ; return unmarshaller . unmarshal ( new StringReader ( xml ) ) ; }
Unmarshalls the input stream into an object from org . yestech . episodic . objectmodel .
16,641
public static String join ( String [ ] strings ) { StringBuilder builder = new StringBuilder ( ) ; for ( int i = 0 ; i < strings . length ; i ++ ) { builder . append ( strings [ i ] ) ; if ( i + 1 < strings . length ) builder . append ( "," ) ; } return builder . toString ( ) ; }
A simple method for joining an array of strings to a comma seperated string .
16,642
public void removeIt ( ) { if ( m_queryRecord != null ) if ( this . getOwner ( ) != null ) m_queryRecord . removeRecord ( this . getOwner ( ) ) ; m_queryRecord = null ; }
Remove this record from the query record .
16,643
public List < Class < ? > > directSuperclasses ( Class < ? > c ) { if ( c . isPrimitive ( ) ) { return primitiveSuperclasses ( c ) ; } else if ( c . isArray ( ) ) { return arrayDirectSuperclasses ( 0 , c ) ; } else { Class < ? > [ ] interfaces = c . getInterfaces ( ) ; Class < ? > superclass = c . getSuperclass ( ) ; L...
Get the direct superclasses of a class . Interfaces followed by the superclasses . Interfaces with no super interfaces extend Object .
16,644
public Object getValue ( String name ) { if ( arguments == null ) { throw new IllegalStateException ( "setArgs not called" ) ; } Object ob = options . get ( name ) ; if ( ob != null ) { return ob ; } return arguments . get ( name ) ; }
Returns named option or argument value
16,645
public void command ( String ... args ) { try { setArgs ( args ) ; } catch ( CmdArgsException ex ) { ex . printStackTrace ( ) ; Logger logger = Logger . getLogger ( CmdArgs . class . getName ( ) ) ; logger . log ( Level . SEVERE , Arrays . toString ( args ) ) ; logger . log ( Level . SEVERE , ex . getMessage ( ) , ex )...
Initializes options and arguments . Reports error and exits on error . Called usually from main method .
16,646
public final < T > T getArgument ( String name ) { if ( arguments == null ) { throw new IllegalStateException ( "setArgs not called" ) ; } return ( T ) arguments . get ( name ) ; }
Returns named argument value
16,647
public final < T > T getOption ( String name ) { if ( arguments == null ) { throw new IllegalStateException ( "setArgs not called" ) ; } Object value = options . get ( name ) ; if ( value == null ) { Option opt = map . get ( name ) ; if ( opt == null ) { throw new IllegalArgumentException ( "option " + name + " not fou...
Return named option value .
16,648
public final < T > void addArgument ( Class < T > cls , String name ) { if ( map . containsKey ( name ) ) { throw new IllegalArgumentException ( name + " is already added as option" ) ; } if ( hasArrayArgument ) { throw new IllegalArgumentException ( "no argument allowed after array argument" ) ; } types . add ( cls ) ...
Add typed argument
16,649
public final < T > void addOption ( String name , String description ) { addOption ( String . class , name , description , null ) ; }
Add a mandatory string option
16,650
public String getUsage ( ) { Set < Option > set = new HashSet < > ( ) ; StringBuilder sb = new StringBuilder ( ) ; sb . append ( "usage: " ) ; boolean n1 = false ; for ( Entry < String , List < Option > > e : groups . entrySet ( ) ) { if ( n1 ) { sb . append ( "|" ) ; } n1 = true ; sb . append ( "[" ) ; boolean n2 = fa...
Returns usage string .
16,651
public Object intercept ( Object obj , Method method , Object [ ] args , MethodProxy proxy ) throws Throwable { if ( method . getName ( ) . equals ( "annotationType" ) ) { return annotationType ; } else if ( method . getName ( ) . equals ( "toString" ) ) { return toString ( ) ; } else if ( method . getName ( ) . equals...
Intercept all methods calls .
16,652
private boolean annotationEquals ( Object object ) { if ( object == null || ! ( object instanceof Annotation ) || ! annotationType . equals ( ( ( Annotation ) object ) . annotationType ( ) ) ) { return false ; } for ( Map . Entry < String , Method > entry : attributes . entrySet ( ) ) { String methodName = entry . getK...
Returns true if the specified object represents an annotation that is logically equivalent to this one .
16,653
private boolean attributeEquals ( Object value , Object otherValue ) { if ( value == null && otherValue == null ) { return true ; } else if ( value == null || otherValue == null ) { return false ; } else { if ( value . getClass ( ) . isArray ( ) ) { return Arrays . equals ( ( Object [ ] ) value , ( Object [ ] ) otherVa...
Returns true if two attributes are equal .
16,654
public synchronized void sendNotification ( Supplier < String > textSupplier , Supplier < U > userDataSupplier , LongSupplier timestampSupplier ) { if ( ! map . isEmpty ( ) ) { sendNotification ( textSupplier . get ( ) , userDataSupplier . get ( ) , timestampSupplier . getAsLong ( ) ) ; } }
Send notification . supplier is called only if there are listeners
16,655
public synchronized void sendNotification ( String text , U userData , long timestamp ) { map . allValues ( ) . forEach ( ( ListenerWrapper w ) -> executor . execute ( ( ) -> w . sendNotification ( text , userData , timestamp ) ) ) ; }
Send notification .
16,656
public void logoutAllSessions ( final Timestamp logoutTimestamp ) { final PersistenceManager pm = isisJdoSupport . getJdoPersistenceManager ( ) ; final Properties properties = pm . getPersistenceManagerFactory ( ) . getProperties ( ) ; if ( isTrue ( properties . get ( DN_BULK_UPDATES_KEY ) ) ) { final javax . jdo . Que...
region > logoutAllSessions
16,657
public SessionLogEntry findBySessionId ( final String sessionId ) { return repositoryService . firstMatch ( new QueryDefault < > ( SessionLogEntry . class , "findBySessionId" , "sessionId" , sessionId ) ) ; }
region > findBySessionId
16,658
public List < SessionLogEntry > findByUserAndStrictlyBefore ( final String user , final Timestamp from ) { return repositoryService . allMatches ( new QueryDefault < > ( SessionLogEntry . class , "findByUserAndTimestampStrictlyBefore" , "user" , user , "from" , from ) ) ; }
region > findByUserAndStrictlyBefore
16,659
@ XmlElement ( name = "maxPaginationLinks" , defaultValue = "7" ) @ JsonProperty ( value = "maxPaginationLinks" , required = true ) @ ApiModelProperty ( value = "The maximum number of pagination links." , required = true , example = "7" ) public int getMaxPaginationLinks ( ) { return maxPaginationLinks ; }
Returns the maximum number of pagination links .
16,660
@ XmlElement ( name = "firstPageLink" ) @ JsonProperty ( value = "firstPageLink" ) @ ApiModelProperty ( value = "The first pagination link." , position = 1 ) public PageRequestLinkDto getFirstPageLink ( ) { return firstPageLink ; }
Returns the first pagination link .
16,661
@ XmlElement ( name = "previousPageLink" ) @ JsonProperty ( value = "previousPageLink" ) @ ApiModelProperty ( value = "The previous pagination link." , position = 2 ) public PageRequestLinkDto getPreviousPageLink ( ) { return previousPageLink ; }
Returns the previous pagination link .
16,662
@ XmlElementWrapper ( name = "links" ) @ XmlElement ( name = "link" ) @ JsonProperty ( value = "links" ) @ ApiModelProperty ( value = "The pagination links." , position = 3 ) public List < PageRequestLinkDto > getLinks ( ) { return links ; }
Returns the pagination links .
16,663
@ JsonProperty ( value = "links" ) public void setLinks ( List < PageRequestLinkDto > links ) { if ( links == null ) { this . links = new ArrayList < > ( ) ; } else { this . links = links ; } }
Sets the pagination links .
16,664
@ XmlElement ( name = "nextPageLink" ) @ JsonProperty ( value = "nextPageLink" ) @ ApiModelProperty ( value = "The next pagination link." , position = 4 ) public PageRequestLinkDto getNextPageLink ( ) { return nextPageLink ; }
Returns the next pagination link .
16,665
@ XmlElement ( name = "lastPageLink" ) @ JsonProperty ( value = "lastPageLink" ) @ ApiModelProperty ( value = "The last pagination link." , position = 5 ) public PageRequestLinkDto getLastPageLink ( ) { return lastPageLink ; }
Returns the last pagination link .
16,666
private List < EditableAcraReport > retrieveUnsyncedElements ( ) throws IOException , ServiceException { final ListFeed listFeed = client . getFeed ( listFeedUrl , ListFeed . class ) ; final List < EditableAcraReport > reports = new ArrayList < EditableAcraReport > ( ) ; for ( final ListEntry listEntry : listFeed . get...
Gets unsynchronized Acra reports from the Google spreadsheet .
16,667
public void startSynchronization ( ) throws IOException , ServiceException , AuthenticationException , NotFoundException , RedmineException , ParseException { final List < EditableAcraReport > listReports = retrieveUnsyncedElements ( ) ; for ( final EditableAcraReport report : listReports ) { final Issue issue = getIss...
Starts the synchronization between Acra reports Google spreadsheet and Chiliproject bugtracker .
16,668
private Issue getIssueForStack ( final String pStacktraceMD5 ) throws IOException , AuthenticationException , NotFoundException , RedmineException { final Map < String , String > parameters = new HashMap < String , String > ( ) ; parameters . put ( "project_id" , String . valueOf ( config . CHILIPROJECT_PROJECT_ID ) ) ...
Search for the issue related to the given MD5 stacktrace hash .
16,669
public Set < V > get ( Object key ) { Set < V > set = map . get ( key ) ; return set != null ? set : Collections . EMPTY_SET ; }
Returns mapped set . Returns empty set if no mapping exists .
16,670
public static Typeface createFromAsset ( AssetManager mgr , String path ) { Typeface typeface = TYPEFACES . get ( path ) ; if ( typeface != null ) { return typeface ; } else { typeface = Typeface . createFromAsset ( mgr , path ) ; TYPEFACES . put ( path , typeface ) ; return typeface ; } }
Create a new typeface from the specified font data .
16,671
@ SuppressWarnings ( "PMD.CollapsibleIfStatements" ) private < V extends FileAttributeView > V addIsLinkIfPossible ( Class < V > type , V fav ) { if ( BasicFileAttributeView . class . isAssignableFrom ( type ) ) { if ( ( ! v ( ( ) -> BasicFileAttributeView . class . cast ( fav ) . readAttributes ( ) ) . isSymbolicLink ...
if the the FAV is actually a BasicFileAttributeView then there is an isLink method if this is not already set and FAV implements LinkInfoSettable use it to add this link info
16,672
public Object unmarshalThisMessage ( String strXMLBody ) { try { Reader inStream = new StringReader ( strXMLBody ) ; Object msg = this . unmarshalRootElement ( inStream ) ; inStream . close ( ) ; return msg ; } catch ( Throwable ex ) { ex . printStackTrace ( ) ; } return null ; }
UnmarshalThisMessage Method .
16,673
public Object unmarshalRootElement ( Reader inStream ) throws UnmarshalException { try { String strSOAPPackage = this . getSOAPPackage ( ) ; if ( strSOAPPackage != null ) { Unmarshaller u = JaxbContexts . getJAXBContexts ( ) . getUnmarshaller ( strSOAPPackage ) ; Object obj = null ; synchronized ( u ) { obj = u . unmar...
UnmarshalRootElement Method .
16,674
public void updateMessageProcessInfo ( String elementIn , String elementOut , String elementFault , boolean bIsSafe , String address ) { MessageInfo recMessageInfo = this . getMessageInfo ( elementIn ) ; if ( recMessageInfo != null ) { MessageProcessInfo recMessageProcessInfo = ( MessageProcessInfo ) this . getRecord (...
UpdateMessageProcessInfo Method .
16,675
public MessageInfo getMessageInfo ( String element ) { MessageInfo recMessageInfo = ( MessageInfo ) this . getRecord ( MessageInfo . MESSAGE_INFO_FILE ) ; recMessageInfo . setKeyArea ( MessageInfo . CODE_KEY ) ; recMessageInfo . getField ( MessageInfo . CODE ) . setString ( element ) ; try { if ( recMessageInfo . seek ...
GetMessageInfo Method .
16,676
public String addAddressToTarget ( String address ) { if ( address != null ) { MessageDetailTarget messageDetailTarget = ( MessageDetailTarget ) this . getMainRecord ( ) ; String site = messageDetailTarget . getProperty ( TrxMessageHeader . DESTINATION_PARAM ) ; site = this . getSiteFromAddress ( address , site ) ; if ...
AddAddressToTarget Method .
16,677
public void updateMessageDetail ( MessageProcessInfo recMessageProcessInfo , Map < String , Object > map ) { MessageDetail recMessageDetail = ( MessageDetail ) this . getRecord ( MessageDetail . MESSAGE_DETAIL_FILE ) ; MessageTransport recMessageTransport = ( MessageTransport ) this . getRecord ( MessageTransport . MES...
UpdateMessageDetail Method .
16,678
public String getSiteFromAddress ( String url , String site ) { int iStart = url . indexOf ( "//" ) + 2 ; iStart = url . indexOf ( '/' , iStart ) ; if ( iStart == - 1 ) iStart = url . length ( ) ; if ( ( site != null ) && ( site . length ( ) > 0 ) ) if ( ! url . equalsIgnoreCase ( site ) ) return site ; return url . su...
GetSiteFromAddress Method .
16,679
@ SuppressWarnings ( "unchecked" ) public static < V > V get ( String key ) { return ( V ) share . get ( ) . get ( key ) ; }
Get the specific key value
16,680
public static void set ( String key , Object value ) { share . get ( ) . put ( key , value ) ; }
Set the specific key value
16,681
@ SuppressWarnings ( "unchecked" ) public static < V > V remove ( String key ) { return ( V ) share . get ( ) . remove ( key ) ; }
Remove the specific key
16,682
public Record getNextRecord ( PrintWriter out , int iPrintOptions , boolean bFirstTime , boolean bHeadingFootingExists ) throws DBException { Object [ ] rgobjEnabled = null ; boolean bAfterRequery = ! this . getMainRecord ( ) . isOpen ( ) ; if ( ! this . getMainRecord ( ) . isOpen ( ) ) this . getMainRecord ( ) . open ...
Get the next record . This is the special method for a report . It handles breaks by disabling all listeners except filter listeners then reenabling and calling the listeners after the footing has been printed so totals etc will be in the next break .
16,683
private static Class < ? > box ( Class < ? > clazz ) { if ( clazz == int . class ) { return Integer . class ; } else if ( clazz == float . class ) { return Float . class ; } else if ( clazz == long . class ) { return Long . class ; } else if ( clazz == double . class ) { return double . class ; } else if ( clazz == boo...
returns the boxed type of the primitive class or the class itself if there is no wrapper for the given type .
16,684
static String getNativeDataTypeName ( int nativeDataTypeCode ) throws OdaException { DataTypeMapping typeMapping = getManifest ( ) . getDataSetType ( null ) . getDataTypeMapping ( nativeDataTypeCode ) ; if ( typeMapping != null ) return typeMapping . getNativeType ( ) ; return "Non-defined" ; }
Returns the native data type name of the specified code as defined in this data source extension s manifest .
16,685
private String toAlias ( String propertyName ) { String result = propertyAliasType . get ( propertyName ) ; return result == null ? propertyName : result ; }
Returns alias for name if it exists or the original name if not .
16,686
private Property newProperty ( String propertyName , String instanceName , String entity ) { return new Property ( toAlias ( propertyName ) , instanceName , entity ) ; }
Returns an instance of the specified property observing property aliases .
16,687
public static ECPoint compressPoint ( ECPoint uncompressed ) { return CURVE . getCurve ( ) . decodePoint ( uncompressed . getEncoded ( true ) ) ; }
Utility for compressing an elliptic curve point . Returns the same point if it s already compressed . See the ECKey class docs for a discussion of point compression .
16,688
public static ECPoint decompressPoint ( ECPoint compressed ) { return CURVE . getCurve ( ) . decodePoint ( compressed . getEncoded ( false ) ) ; }
Utility for decompressing an elliptic curve point . Returns the same point if it s already compressed . See the ECKey class docs for a discussion of point compression .
16,689
public static ECKey fromPrivate ( BigInteger privKey ) { return new ECKey ( privKey , CURVE . getG ( ) . multiply ( privKey ) ) ; }
Creates an ECKey given the private key only .
16,690
public static byte [ ] pubBytesWithoutFormat ( ECPoint pubPoint ) { final byte [ ] pubBytes = pubPoint . getEncoded ( false ) ; return Arrays . copyOfRange ( pubBytes , 1 , pubBytes . length ) ; }
Compute the encoded X Y coordinates of a public point .
16,691
public static ECKey fromNodeId ( byte [ ] nodeId ) { check ( nodeId . length == 64 , "Expected a 64 byte node id" ) ; byte [ ] pubBytes = new byte [ 65 ] ; System . arraycopy ( nodeId , 0 , pubBytes , 1 , nodeId . length ) ; pubBytes [ 0 ] = 0x04 ; return ECKey . fromPublicOnly ( pubBytes ) ; }
Recover the public key from an encoded node id .
16,692
public ECDSASignature doSign ( byte [ ] input ) { if ( input . length != 32 ) { throw new IllegalArgumentException ( "Expected 32 byte input to ECDSA signature, not " + input . length ) ; } if ( privKey == null ) throw new MissingPrivateKeyException ( ) ; if ( privKey instanceof BCECPrivateKey ) { ECDSASigner signer = ...
Signs the given hash and returns the R and S components as BigIntegers and put them in ECDSASignature
16,693
public static byte [ ] signatureToKeyBytes ( byte [ ] messageHash , String signatureBase64 ) throws SignatureException { byte [ ] signatureEncoded ; try { signatureEncoded = Base64 . decode ( signatureBase64 ) ; } catch ( RuntimeException e ) { throw new SignatureException ( "Could not decode base64" , e ) ; } if ( sig...
Given a piece of text and a message signature encoded in base64 returns an ECKey containing the public key that was used to sign it . This can then be compared to the expected public key to determine if the signature was correct .
16,694
public static boolean isPubKeyCanonical ( byte [ ] pubkey ) { if ( pubkey [ 0 ] == 0x04 ) { if ( pubkey . length != 65 ) return false ; } else if ( pubkey [ 0 ] == 0x02 || pubkey [ 0 ] == 0x03 ) { if ( pubkey . length != 33 ) return false ; } else return false ; return true ; }
Returns true if the given pubkey is canonical i . e . the correct length taking into account compression .
16,695
public byte [ ] getPrivKeyBytes ( ) { if ( privKey == null ) { return null ; } else if ( privKey instanceof BCECPrivateKey ) { return bigIntegerToBytes ( ( ( BCECPrivateKey ) privKey ) . getD ( ) , 32 ) ; } else { return null ; } }
Returns a 32 byte array containing the private key or null if the key is encrypted or public only
16,696
public void setGridTable ( int iKeyArea ) { String keyAreaName = null ; if ( iKeyArea != - 1 ) keyAreaName = this . getOwner ( ) . getRecord ( ) . getKeyArea ( iKeyArea ) . getKeyName ( ) ; this . setGridTable ( keyAreaName , null , - 1 ) ; }
Default call ; gridTable = mainRecord index = next .
16,697
public void setGridTable ( String keyAreaName , Rec gridTable , int index ) { if ( index == - 1 ) index = m_iNextArrayIndex ; m_iNextArrayIndex = Math . max ( m_iNextArrayIndex , index + 1 ) ; if ( gridTable == null ) if ( m_gridScreen != null ) gridTable = m_gridScreen . getMainRecord ( ) ; if ( gridTable != null ) if...
Set an index to a key area .
16,698
public int setupGridOrder ( ) { int iErrorCode = DBConstants . NORMAL_RETURN ; boolean bOrder = DBConstants . ASCENDING ; int iKeyOrder = ( int ) ( ( NumberField ) this . getOwner ( ) ) . getValue ( ) ; if ( iKeyOrder == 0 ) return DBConstants . KEY_NOT_FOUND ; if ( iKeyOrder < 0 ) { bOrder = DBConstants . DESCENDING ;...
Set the grid order to the value in this field .
16,699
public int fieldChanged ( boolean bDisplayOption , int iMoveMode ) { int iErrorCode = this . setupGridOrder ( ) ; if ( iErrorCode != DBConstants . NORMAL_RETURN ) return iErrorCode ; return super . fieldChanged ( bDisplayOption , iMoveMode ) ; }
The Field has Changed . Change the key order to match this field s value .