idx int64 0 41.2k | question stringlengths 74 4.21k | target stringlengths 5 888 |
|---|---|---|
15,200 | public void setBookVersion ( final String bookVersion ) { if ( bookVersion == null && this . bookVersion == null ) { return ; } else if ( bookVersion == null ) { removeChild ( this . bookVersion ) ; this . bookVersion = null ; } else if ( this . bookVersion == null ) { this . bookVersion = new KeyValueNode < String > ( CommonConstants . CS_BOOK_VERSION_TITLE , bookVersion ) ; appendChild ( this . bookVersion , false ) ; } else { this . bookVersion . setValue ( bookVersion ) ; } } | Set the BookVersion of the Book the Content Specification represents . |
15,201 | public void setEdition ( final String edition ) { if ( edition == null && this . edition == null ) { return ; } else if ( edition == null ) { removeChild ( this . edition ) ; this . edition = null ; } else if ( this . edition == null ) { this . edition = new KeyValueNode < String > ( CommonConstants . CS_EDITION_TITLE , edition ) ; appendChild ( this . edition , false ) ; } else { this . edition . setValue ( edition ) ; } } | Set the Edition of the Book the Content Specification represents . |
15,202 | public void setPubsNumber ( final Integer pubsNumber ) { if ( pubsNumber == null && this . pubsNumber == null ) { return ; } else if ( pubsNumber == null ) { removeChild ( this . pubsNumber ) ; this . pubsNumber = null ; } else if ( this . pubsNumber == null ) { this . pubsNumber = new KeyValueNode < Integer > ( CommonConstants . CS_PUBSNUMBER_TITLE , pubsNumber ) ; appendChild ( this . pubsNumber , false ) ; } else { this . pubsNumber . setValue ( pubsNumber ) ; } } | Set the publication number for the Content Specification . |
15,203 | public String getPublicanCfg ( ) { return ! publicanCfgs . containsKey ( DEFAULT_PUBLICAN_CFG_KEY ) ? null : publicanCfgs . get ( DEFAULT_PUBLICAN_CFG_KEY ) . getValueText ( ) ; } | Gets the data what will be appended to the publican . cfg file when built . |
15,204 | public String getAdditionalPublicanCfg ( final String name ) { return ! publicanCfgs . containsKey ( name ) ? null : publicanCfgs . get ( name ) . getValueText ( ) ; } | Gets the data what will be appended to the custom additional publican . cfg file when built . |
15,205 | public KeyValueNode < String > getAdditionalPublicanCfgNode ( final String name ) { return ! publicanCfgs . containsKey ( name ) ? null : publicanCfgs . get ( name ) ; } | Gets the custom additional publican . cfg node for the specified name . |
15,206 | public Map < String , String > getAllAdditionalPublicanCfgs ( ) { final Map < String , String > retValue = new HashMap < String , String > ( ) ; for ( final Map . Entry < String , KeyValueNode < String > > entry : publicanCfgs . entrySet ( ) ) { if ( ! DEFAULT_PUBLICAN_CFG_KEY . equals ( entry . getKey ( ) ) ) { retValue . put ( entry . getValue ( ) . getKey ( ) , entry . getValue ( ) . getValueText ( ) ) ; } } return retValue ; } | Gets all of the additional custom publican . cfg files in the |
15,207 | public void setDefaultPublicanCfg ( final String defaultPublicanCfg ) { if ( defaultPublicanCfg == null && this . defaultPublicanCfg == null ) { return ; } else if ( defaultPublicanCfg == null ) { removeChild ( this . defaultPublicanCfg ) ; this . defaultPublicanCfg = null ; } else if ( this . defaultPublicanCfg == null ) { this . defaultPublicanCfg = new KeyValueNode < String > ( CommonConstants . CS_DEFAULT_PUBLICAN_CFG_TITLE , defaultPublicanCfg ) ; appendChild ( this . defaultPublicanCfg , false ) ; } else { this . defaultPublicanCfg . setValue ( defaultPublicanCfg ) ; } } | Set the default publican . cfg configuration that should be used when building . |
15,208 | public void setFormat ( final String format ) { if ( format == null && this . format == null ) { return ; } else if ( format == null ) { removeChild ( this . format ) ; this . format = null ; } else if ( this . format == null ) { this . format = new KeyValueNode < String > ( CommonConstants . CS_FORMAT_TITLE , format ) ; appendChild ( this . format , false ) ; } else { this . format . setValue ( format ) ; } } | Sets the DTD for a Content Specification . |
15,209 | public void setCopyrightHolder ( final String copyrightHolder ) { if ( copyrightHolder == null && this . copyrightHolder == null ) { return ; } else if ( copyrightHolder == null ) { removeChild ( this . copyrightHolder ) ; this . copyrightHolder = null ; } else if ( this . copyrightHolder == null ) { this . copyrightHolder = new KeyValueNode < String > ( CommonConstants . CS_COPYRIGHT_HOLDER_TITLE , copyrightHolder ) ; appendChild ( this . copyrightHolder , false ) ; } else { this . copyrightHolder . setValue ( copyrightHolder ) ; } } | Set the Copyright Holder of the Content Specification and the book it creates . |
15,210 | public void setBookType ( final BookType bookType ) { if ( bookType == null && this . bookType == null ) { return ; } else if ( bookType == null ) { removeChild ( this . bookType ) ; this . bookType = null ; } else if ( this . bookType == null ) { this . bookType = new KeyValueNode < BookType > ( CommonConstants . CS_BOOK_TYPE_TITLE , bookType ) ; appendChild ( this . bookType , false ) ; } else { this . bookType . setValue ( bookType ) ; } } | Set the Type of Book the Content Specification should be created for . The current values that are supported are Book and Article . |
15,211 | public void setBrandLogo ( final String brandLogo ) { if ( brandLogo == null && this . brandLogo == null ) { return ; } else if ( brandLogo == null ) { removeChild ( this . brandLogo ) ; this . brandLogo = null ; } else if ( this . brandLogo == null ) { this . brandLogo = new KeyValueNode < String > ( CommonConstants . CS_BRAND_LOGO_TITLE , brandLogo ) ; appendChild ( this . brandLogo , false ) ; } else { this . brandLogo . setValue ( brandLogo ) ; } } | Sets the path of the Brand Logo for the Content Specification . |
15,212 | public void setInjectionOptions ( final InjectionOptions injectionOptions ) { if ( injectionOptions == null && this . injectionOptions == null ) { return ; } else if ( injectionOptions == null ) { removeChild ( this . injectionOptions ) ; this . injectionOptions = null ; } else if ( this . injectionOptions == null ) { this . injectionOptions = new KeyValueNode < InjectionOptions > ( CommonConstants . CS_INLINE_INJECTION_TITLE , injectionOptions ) ; appendChild ( this . injectionOptions , false ) ; } else { this . injectionOptions . setValue ( injectionOptions ) ; } } | Sets the InjectionOptions that will be used by the Builder when building a book . |
15,213 | public void setLocale ( final String locale ) { if ( locale == null && this . locale == null ) { return ; } else if ( locale == null ) { removeChild ( this . locale ) ; this . locale = null ; } else if ( this . locale == null ) { this . locale = new KeyValueNode < String > ( CommonConstants . CS_LOCALE_TITLE , locale ) ; appendChild ( this . locale , false ) ; } else { this . locale . setValue ( locale ) ; } } | Sets the Content Specifications locale . |
15,214 | public void setUseDefaultPreface ( final Boolean useDefaultPreface ) { if ( useDefaultPreface == null && this . useDefaultPreface == null ) { return ; } else if ( useDefaultPreface == null ) { removeChild ( this . useDefaultPreface ) ; this . useDefaultPreface = null ; } else if ( this . useDefaultPreface == null ) { this . useDefaultPreface = new KeyValueNode < Boolean > ( CommonConstants . CS_DEFAULT_PREFACE , useDefaultPreface ) ; appendChild ( this . useDefaultPreface , false ) ; } else { this . useDefaultPreface . setValue ( useDefaultPreface ) ; } } | Sets the Content Specifications Default Preface setting . |
15,215 | public void setOutputStyle ( final String outputStyle ) { if ( outputStyle == null && this . outputStyle == null ) { return ; } else if ( outputStyle == null ) { removeChild ( this . outputStyle ) ; this . outputStyle = null ; } else if ( this . outputStyle == null ) { this . outputStyle = new KeyValueNode < String > ( CSConstants . OUTPUT_STYLE_TITLE , outputStyle ) ; appendChild ( this . outputStyle , false ) ; } else { this . outputStyle . setValue ( outputStyle ) ; } } | Sets the Content Specifications output style . |
15,216 | public void setBugzillaVersion ( final String bugzillaVersion ) { if ( bugzillaVersion == null && this . bugzillaVersion == null ) { return ; } else if ( bugzillaVersion == null ) { removeChild ( this . bugzillaVersion ) ; this . bugzillaVersion = null ; } else if ( this . bugzillaVersion == null ) { this . bugzillaVersion = new KeyValueNode < String > ( CommonConstants . CS_BUGZILLA_VERSION_TITLE , bugzillaVersion ) ; appendChild ( this . bugzillaVersion , false ) ; } else { this . bugzillaVersion . setValue ( bugzillaVersion ) ; } } | Set the Bugzilla Version to be applied during building . |
15,217 | public void setBugzillaKeywords ( final String bugzillaKeywords ) { if ( bugzillaKeywords == null && this . bugzillaKeywords == null ) { return ; } else if ( bugzillaKeywords == null ) { removeChild ( this . bugzillaKeywords ) ; this . bugzillaKeywords = null ; } else if ( this . bugzillaKeywords == null ) { this . bugzillaKeywords = new KeyValueNode < String > ( CommonConstants . CS_BUGZILLA_KEYWORDS_TITLE , bugzillaKeywords ) ; appendChild ( this . bugzillaKeywords , false ) ; } else { this . bugzillaKeywords . setValue ( bugzillaKeywords ) ; } } | Set the Bugzilla Keywords to be applied during building . |
15,218 | public void setBugzillaURL ( final String bugzillaURL ) { if ( bugzillaURL == null && this . bugzillaURL == null ) { return ; } else if ( bugzillaURL == null ) { removeChild ( this . bugzillaURL ) ; this . bugzillaURL = null ; } else if ( this . bugzillaURL == null ) { this . bugzillaURL = new KeyValueNode < String > ( CommonConstants . CS_BUGZILLA_URL_TITLE , bugzillaURL ) ; appendChild ( this . bugzillaURL , false ) ; } else { this . bugzillaURL . setValue ( bugzillaURL ) ; } } | Set the URL component that is used in the . ent file when building the Docbook files . |
15,219 | public void setJIRAVersion ( final String jiraVersion ) { if ( jiraVersion == null && this . jiraVersion == null ) { return ; } else if ( jiraVersion == null ) { removeChild ( this . jiraVersion ) ; this . jiraVersion = null ; } else if ( this . jiraVersion == null ) { this . jiraVersion = new KeyValueNode < String > ( CommonConstants . CS_JIRA_VERSION_TITLE , jiraVersion ) ; appendChild ( this . jiraVersion , false ) ; } else { this . jiraVersion . setValue ( jiraVersion ) ; } } | Set the JIRA Version to be applied during building . |
15,220 | public void setJIRALabels ( final String jiraLabels ) { if ( jiraLabels == null && this . jiraLabels == null ) { return ; } else if ( jiraLabels == null ) { removeChild ( this . jiraLabels ) ; this . jiraLabels = null ; } else if ( this . jiraLabels == null ) { this . jiraLabels = new KeyValueNode < String > ( CommonConstants . CS_JIRA_LABELS_TITLE , jiraLabels ) ; appendChild ( this . jiraLabels , false ) ; } else { this . jiraLabels . setValue ( jiraLabels ) ; } } | Set the JIRA Labels to be applied during building . |
15,221 | public void setRevisionHistory ( final SpecTopic revisionHistory ) { if ( revisionHistory == null && this . revisionHistory == null ) { return ; } else if ( revisionHistory == null ) { removeChild ( this . revisionHistory ) ; this . revisionHistory = null ; } else if ( this . revisionHistory == null ) { revisionHistory . setTopicType ( TopicType . REVISION_HISTORY ) ; this . revisionHistory = new KeyValueNode < SpecTopic > ( CommonConstants . CS_REV_HISTORY_TITLE , revisionHistory ) ; appendChild ( this . revisionHistory , false ) ; } else { revisionHistory . setTopicType ( TopicType . REVISION_HISTORY ) ; this . revisionHistory . setValue ( revisionHistory ) ; } } | Sets the SpecTopic of the Revision History for the Content Specification . |
15,222 | public void setFeedback ( final SpecTopic feedback ) { if ( feedback == null && this . feedback == null ) { return ; } else if ( feedback == null ) { removeChild ( this . feedback ) ; this . feedback = null ; } else if ( this . feedback == null ) { feedback . setTopicType ( TopicType . FEEDBACK ) ; this . feedback = new KeyValueNode < SpecTopic > ( CommonConstants . CS_FEEDBACK_TITLE , feedback ) ; appendChild ( this . feedback , false ) ; } else { feedback . setTopicType ( TopicType . FEEDBACK ) ; this . feedback . setValue ( feedback ) ; } } | Sets the SpecTopic of the Feedback for the Content Specification . |
15,223 | public void setLegalNotice ( final SpecTopic legalNotice ) { if ( legalNotice == null && this . legalNotice == null ) { return ; } else if ( legalNotice == null ) { removeChild ( this . legalNotice ) ; this . legalNotice = null ; } else if ( this . legalNotice == null ) { legalNotice . setTopicType ( TopicType . LEGAL_NOTICE ) ; this . legalNotice = new KeyValueNode < SpecTopic > ( CommonConstants . CS_LEGAL_NOTICE_TITLE , legalNotice ) ; appendChild ( this . legalNotice , false ) ; } else { legalNotice . setTopicType ( TopicType . LEGAL_NOTICE ) ; this . legalNotice . setValue ( legalNotice ) ; } } | Sets the SpecTopic of the Legal Notice for the Content Specification . |
15,224 | public void setAuthorGroup ( final SpecTopic authorGroup ) { if ( authorGroup == null && this . authorGroup == null ) { return ; } else if ( authorGroup == null ) { removeChild ( this . authorGroup ) ; this . authorGroup = null ; } else if ( this . authorGroup == null ) { authorGroup . setTopicType ( TopicType . AUTHOR_GROUP ) ; this . authorGroup = new KeyValueNode < SpecTopic > ( CommonConstants . CS_AUTHOR_GROUP_TITLE , authorGroup ) ; appendChild ( this . authorGroup , false ) ; } else { authorGroup . setTopicType ( TopicType . AUTHOR_GROUP ) ; this . authorGroup . setValue ( authorGroup ) ; } } | Sets the SpecTopic of the Author Group for the Content Specification . |
15,225 | public void setGroupId ( final String groupId ) { if ( groupId == null && this . groupId == null ) { return ; } else if ( groupId == null ) { removeChild ( this . groupId ) ; this . groupId = null ; } else if ( this . groupId == null ) { this . groupId = new KeyValueNode < String > ( CommonConstants . CS_MAVEN_GROUP_ID_TITLE , groupId ) ; appendChild ( this . groupId , false ) ; } else { this . groupId . setValue ( groupId ) ; } } | Set the Maven groupId that is used in the pom . xml file when building the jDocbook files . |
15,226 | public void setArtifactId ( final String artifactId ) { if ( artifactId == null && this . artifactId == null ) { return ; } else if ( artifactId == null ) { removeChild ( this . artifactId ) ; this . artifactId = null ; } else if ( this . artifactId == null ) { this . artifactId = new KeyValueNode < String > ( CommonConstants . CS_MAVEN_ARTIFACT_ID_TITLE , artifactId ) ; appendChild ( this . artifactId , false ) ; } else { this . artifactId . setValue ( artifactId ) ; } } | Set the Maven artifactId that is used in the pom . xml file when building the jDocbook files . |
15,227 | public void setPOMVersion ( final String pomVersion ) { if ( pomVersion == null && this . pomVersion == null ) { return ; } else if ( pomVersion == null ) { removeChild ( this . pomVersion ) ; this . pomVersion = null ; } else if ( this . pomVersion == null ) { this . pomVersion = new KeyValueNode < String > ( CommonConstants . CS_MAVEN_POM_VERSION_TITLE , pomVersion ) ; appendChild ( this . pomVersion , false ) ; } else { this . pomVersion . setValue ( pomVersion ) ; } } | Set the Maven POM version that is used in the pom . xml file when building the jDocbook files . |
15,228 | public void setFiles ( final List < File > files ) { if ( files == null && this . files == null ) { return ; } else if ( files == null ) { removeChild ( this . files ) ; this . files = null ; } else if ( this . files == null ) { this . files = new FileList ( CommonConstants . CS_FILE_TITLE , files ) ; appendChild ( this . files , false ) ; } else { this . files . setValue ( files ) ; } } | Sets the list of additional files needed by the book . |
15,229 | public void setEntities ( final String entities ) { if ( entities == null && this . entities == null ) { return ; } else if ( entities == null ) { removeChild ( this . entities ) ; this . entities = null ; } else if ( this . entities == null ) { this . entities = new KeyValueNode < String > ( CommonConstants . CS_ENTITIES_TITLE , entities ) ; appendChild ( this . entities , false ) ; } else { this . entities . setValue ( entities ) ; } } | Set the data that will be appended to the < ; book> ; . ent file when built . |
15,230 | public void setIncludeIndex ( final Boolean includeIndex ) { if ( includeIndex == null && this . includeIndex == null ) { return ; } else if ( includeIndex == null ) { removeChild ( this . includeIndex ) ; this . includeIndex = null ; } else if ( this . includeIndex == null ) { this . includeIndex = new KeyValueNode < Boolean > ( CommonConstants . CS_INDEX_TITLE , includeIndex ) ; appendChild ( this . includeIndex , false ) ; } else { this . includeIndex . setValue ( includeIndex ) ; } } | Set whether an index should be included in the Content Specification output . |
15,231 | protected void appendChild ( final Node child , boolean checkForType ) { if ( checkForType && child instanceof KeyValueNode ) { appendKeyValueNode ( ( KeyValueNode < ? > ) child ) ; } else if ( checkForType && child instanceof Level ) { getBaseLevel ( ) . appendChild ( child ) ; } else if ( checkForType && child instanceof SpecTopic ) { getBaseLevel ( ) . appendChild ( child ) ; } else { nodes . add ( child ) ; if ( child . getParent ( ) != null ) { child . removeParent ( ) ; } child . setParent ( this ) ; } } | Adds a Child node to the Content Spec . If the Child node already has a parent then it is removed from that parent and added to this content spec . |
15,232 | public boolean processServletCommand ( ) throws DBException { String strCommand = this . getProperty ( DBParams . COMMAND ) ; if ( strCommand == null ) strCommand = Constants . BLANK ; boolean bSuccess = false ; if ( this . getScreenField ( ) instanceof BasePanel ) { if ( strCommand . equalsIgnoreCase ( ThinMenuConstants . FIRST ) ) bSuccess = ( ( BasePanel ) this . getScreenField ( ) ) . onMove ( DBConstants . FIRST_RECORD ) ; else if ( strCommand . equalsIgnoreCase ( ThinMenuConstants . PREVIOUS ) ) bSuccess = ( ( BasePanel ) this . getScreenField ( ) ) . onMove ( DBConstants . PREVIOUS_RECORD ) ; else if ( strCommand . equalsIgnoreCase ( ThinMenuConstants . NEXT ) ) bSuccess = ( ( BasePanel ) this . getScreenField ( ) ) . onMove ( DBConstants . NEXT_RECORD ) ; else if ( strCommand . equalsIgnoreCase ( ThinMenuConstants . LAST ) ) bSuccess = ( ( BasePanel ) this . getScreenField ( ) ) . onMove ( DBConstants . LAST_RECORD ) ; else if ( strCommand . equalsIgnoreCase ( ThinMenuConstants . SUBMIT ) ) bSuccess = ( ( BasePanel ) this . getScreenField ( ) ) . onAdd ( ) ; else if ( strCommand . equalsIgnoreCase ( ThinMenuConstants . DELETE ) ) bSuccess = ( ( BasePanel ) this . getScreenField ( ) ) . onDelete ( ) ; else { bSuccess = false ; } } return bSuccess ; } | Move the HTML input format to the fields and do the action requested . |
15,233 | public String getZmlImagePath ( ) { String strImage = null ; if ( this . getScreenField ( ) . getConverter ( ) != null ) if ( this . getScreenField ( ) . getConverter ( ) . getField ( ) != null ) if ( ! this . getScreenField ( ) . getConverter ( ) . getField ( ) . isNull ( ) ) { BaseField field = ( BaseField ) this . getScreenField ( ) . getConverter ( ) . getField ( ) ; Record record = field . getRecord ( ) ; String strObjectID = null ; if ( ( record . getEditMode ( ) == DBConstants . EDIT_CURRENT ) || ( record . getEditMode ( ) == DBConstants . EDIT_IN_PROGRESS ) ) { try { strObjectID = record . getHandle ( DBConstants . OBJECT_ID_HANDLE ) . toString ( ) ; } catch ( DBException ex ) { strObjectID = null ; } } if ( strObjectID != null ) if ( strObjectID . length ( ) > 0 ) { String strGraphicFormat = "jpg" ; String strImageServlet = HtmlConstants . SERVLET_PATH + '/' + DBParams . IMAGE_PATH ; strImageServlet = Utility . addURLParam ( strImageServlet , DBParams . DATATYPE , strGraphicFormat ) ; strImageServlet = Utility . addURLParam ( strImageServlet , DBParams . RECORD , record . getClass ( ) . getName ( ) ) ; strImageServlet = Utility . addURLParam ( strImageServlet , DBConstants . STRING_OBJECT_ID_HANDLE , strObjectID ) ; strImageServlet = Utility . addURLParam ( strImageServlet , "field" , field . getFieldName ( false , false ) ) ; strImage = strImageServlet ; } } return strImage ; } | Get the path to the image in this control . |
15,234 | public String getDefaultFormsParam ( ) { if ( this . getScreenField ( ) . getParentScreen ( ) != null ) return ( ( ZScreenField ) this . getScreenField ( ) . getParentScreen ( ) . getScreenFieldView ( ) ) . getDefaultFormsParam ( ) ; else return null ; } | Get the Forms param to be passed on submit . |
15,235 | public String getJnlpURL ( String strJnlpURL , Map < String , Object > propApplet , Map < String , Object > properties ) { String strBaseURL = ( String ) properties . get ( DBParams . BASE_URL ) ; if ( strBaseURL == null ) strBaseURL = DBConstants . BLANK ; else if ( ( ! strBaseURL . startsWith ( "/" ) ) && ( ! strBaseURL . startsWith ( "http:" ) ) ) strBaseURL = "//" + strBaseURL ; if ( ! strBaseURL . startsWith ( "http:" ) ) strBaseURL = "http:" + strBaseURL ; StringBuffer sbJnlpURL = new StringBuffer ( strBaseURL ) ; if ( ( strJnlpURL == null ) || ( strJnlpURL . length ( ) == 0 ) ) strJnlpURL = DEFAULT_JNLP_URL ; sbJnlpURL . append ( strJnlpURL ) ; sbJnlpURL . append ( "&" + DBParams . APPLET + "=" + propApplet . get ( DBParams . APPLET ) ) ; try { for ( Map . Entry < String , Object > entry : properties . entrySet ( ) ) { String strKey = entry . getKey ( ) ; Object objValue = entry . getValue ( ) ; String strValue = null ; if ( objValue != null ) strValue = objValue . toString ( ) ; if ( strValue != null ) sbJnlpURL . append ( "&" + strKey + "=" + URLEncoder . encode ( strValue , DBConstants . URL_ENCODING ) ) ; } } catch ( UnsupportedEncodingException e ) { e . printStackTrace ( ) ; } return sbJnlpURL . toString ( ) ; } | Create a URL to retrieve the JNLP file . |
15,236 | public static < T > T getValue ( Class < T > type , Selector selector ) throws ExecutionException { return convert ( getValue ( selector ) , type ) ; } | Return the selector value represents in the type class . |
15,237 | public static Object getRestrictedValue ( Selector selector , SelectorType type ) throws ExecutionException { Object field = null ; if ( type != null && selector . getType ( ) != type ) { throw new ExecutionException ( "The selector type expected is: " + type + " but received: " + selector . getType ( ) ) ; } switch ( selector . getType ( ) ) { case COLUMN : field = ( ( ColumnSelector ) selector ) . getName ( ) . getName ( ) ; break ; case BOOLEAN : field = ( ( BooleanSelector ) selector ) . getValue ( ) ; break ; case STRING : field = ( ( StringSelector ) selector ) . getValue ( ) ; break ; case INTEGER : field = ( ( IntegerSelector ) selector ) . getValue ( ) ; break ; case FLOATING_POINT : field = ( ( FloatingPointSelector ) selector ) . getValue ( ) ; break ; case GROUP : field = getRestrictedValue ( ( ( GroupSelector ) selector ) . getFirstValue ( ) , null ) ; break ; case LIST : if ( ( ( ListSelector ) selector ) . getSelectorsList ( ) . isEmpty ( ) ) { throw new ExecutionException ( "Selector " + selector . getType ( ) + " not supported get value operation." ) ; } field = getRestrictedValue ( ( ( ListSelector ) selector ) . getSelectorsList ( ) . get ( 0 ) , null ) ; break ; default : throw new ExecutionException ( "Selector " + selector . getType ( ) + " not supported get value operation." ) ; } return field ; } | Return the selector value only if the type matches with the specified value . |
15,238 | public static Class getClass ( Selector selector ) throws ExecutionException { Class returnClass = null ; switch ( selector . getType ( ) ) { case STRING : case COLUMN : returnClass = String . class ; break ; case BOOLEAN : returnClass = Boolean . class ; break ; case INTEGER : returnClass = Long . class ; break ; case FLOATING_POINT : returnClass = Double . class ; break ; case GROUP : returnClass = getClass ( ( ( GroupSelector ) selector ) . getFirstValue ( ) ) ; break ; case LIST : if ( ( ( ListSelector ) selector ) . getSelectorsList ( ) . isEmpty ( ) ) { throw new ExecutionException ( "Selector " + selector . getType ( ) + " not supported get value operation." ) ; } returnClass = getClass ( ( ( ListSelector ) selector ) . getSelectorsList ( ) . get ( 0 ) ) ; break ; default : throw new ExecutionException ( "Selector " + selector . getType ( ) + " not supported get value operation." ) ; } return returnClass ; } | Return the selector value class . |
15,239 | public void setProperty ( String strProperty , String strValue ) { if ( strValue == null ) strValue = NULL ; if ( strValue != null ) m_properties . setProperty ( strProperty , strValue ) ; else m_properties . remove ( strProperty ) ; } | Set this comand property . |
15,240 | @ SuppressWarnings ( "unchecked" ) public static List < TopLevelGdl > parse ( Reader input ) throws Exception { try { Scanner lexer = new GdlScanner ( input ) ; SymbolFactory symbolFactory = new ComplexSymbolFactory ( ) ; Symbol result = new GdlParser ( lexer , symbolFactory ) . parse ( ) ; return ( List < TopLevelGdl > ) result . value ; } finally { input . close ( ) ; } } | This consumes and closes the input . |
15,241 | private Request getRequest ( Action action , BrokerSession session ) { switch ( action ) { case QUERY : if ( query == null ) { query = new Request ( action ) ; query . addParameter ( "UID" , session . getId ( ) ) ; } return query ; case PING : if ( ping == null ) { ping = new Request ( action ) ; } return ping ; default : return null ; } } | Creates a request packet for the specified action . |
15,242 | private void pollHost ( BrokerSession session ) { Request request = ! enabled ? null : getRequest ( session . pollingAction ( ) , session ) ; if ( request == null ) { return ; } try { Response response = session . netCall ( request , 1000 ) ; String results [ ] = response . getData ( ) . split ( Constants . LINE_SEPARATOR , 2 ) ; String params [ ] = StrUtil . split ( results [ 0 ] , StrUtil . U , 2 ) ; switch ( response . getResponseType ( ) ) { case ACK : int i = StrUtil . toInt ( params [ 0 ] ) ; if ( i > 0 ) { pollingInterval = i * 1000 ; } FMDate hostTime = new FMDate ( params [ 1 ] ) ; session . setHostTime ( hostTime ) ; break ; case ASYNC : int asyncHandle = StrUtil . toInt ( params [ 0 ] ) ; int asyncError = StrUtil . toInt ( params [ 1 ] ) ; if ( asyncHandle > 0 ) { if ( asyncError != 0 ) { session . onRPCError ( asyncHandle , asyncError , results [ 1 ] ) ; } else { session . onRPCComplete ( asyncHandle , results [ 1 ] ) ; } } break ; case EVENT : List < IHostEventHandler > hostEventHandlers = session . getHostEventHandlers ( ) ; if ( hostEventHandlers != null ) { try { String eventName = results [ 0 ] ; Object eventData = SerializationMethod . deserialize ( results [ 1 ] ) ; for ( IHostEventHandler hostEventHandler : hostEventHandlers ) { try { hostEventHandler . onHostEvent ( eventName , eventData ) ; } catch ( Throwable e ) { log . error ( "Host event subscriber threw an exception" , e ) ; } } } catch ( Throwable e ) { log . error ( "Error processing host event" , e ) ; } } break ; } } catch ( Throwable e ) { log . error ( "Error processing polling response." , e ) ; terminate ( ) ; } } | Polls the host at the specified interval for asynchronous activity . |
15,243 | public void run ( ) { synchronized ( monitor ) { while ( ! terminated ) { try { BrokerSession session = this . sessionRef . get ( ) ; if ( session == null ) { break ; } else { pollHost ( session ) ; } session = null ; monitor . wait ( pollingInterval ) ; } catch ( InterruptedException e ) { } } } log . debug ( getName ( ) + " has exited." ) ; } | Main polling loop . |
15,244 | public static MutableTimecodeDuration valueOf ( String timecode ) throws IllegalArgumentException { MutableTimecodeDuration td = new MutableTimecodeDuration ( ) ; return ( MutableTimecodeDuration ) td . parse ( timecode ) ; } | Returns a UnmodifiableTimecodeDuration instance for given TimecodeDuration storage string . Will return null in case the storage string represents a null TimecodeDuration |
15,245 | public RemoteTable getRemoteTable ( String strRecordName ) throws RemoteException { if ( ( strRecordName == null ) || ( strRecordName . length ( ) == 0 ) ) strRecordName = this . getMainRecord ( ) . getTableNames ( false ) ; if ( strRecordName . lastIndexOf ( '.' ) != - 1 ) strRecordName = strRecordName . substring ( strRecordName . lastIndexOf ( '.' ) + 1 ) ; Record record = this . getRecord ( strRecordName ) ; if ( record == null ) return null ; if ( this instanceof TableSession ) { if ( this . getMainRecord ( ) == record ) return ( RemoteTable ) this ; } RemoteTable table = null ; for ( int iIndex = 0 ; iIndex < this . getSessionObjectCount ( ) ; iIndex ++ ) { BaseSession sessionObject = this . getSessionObjectAt ( iIndex ) ; if ( sessionObject instanceof TableSession ) { if ( sessionObject . getMainRecord ( ) != null ) if ( sessionObject . getMainRecord ( ) . getTableNames ( false ) . equals ( strRecordName ) ) return ( RemoteTable ) sessionObject ; } } try { RecordOwner recordOwner = record . getRecordOwner ( ) ; boolean bMainQuery = false ; if ( recordOwner != null ) if ( record == recordOwner . getMainRecord ( ) ) bMainQuery = true ; table = new TableSession ( this , record , null ) ; if ( recordOwner != null ) if ( bMainQuery ) { recordOwner . addRecord ( record , bMainQuery ) ; Utility . getLogger ( ) . info ( "Should not create a sub-session for the main record!" ) ; } } catch ( Exception ex ) { table = null ; } return table ; } | Get the remote table for this session . |
15,246 | public BaseMessageFilter setupRemoteFilter ( BaseMessageFilter messageFilter ) { Map < String , Object > propertiesForFilter = messageFilter . getProperties ( ) ; if ( propertiesForFilter != null ) { String strClassName = ( String ) propertiesForFilter . get ( MessageConstants . CLASS_NAME ) ; if ( strClassName != null ) { if ( strClassName . indexOf ( MessageConstants . GRID_FILTER ) != - 1 ) { Record record = this . getMainRecord ( ) ; if ( record != null ) messageFilter = new GridRecordMessageFilter ( record , null , true ) ; messageFilter . setMessageSource ( null ) ; } else if ( strClassName . indexOf ( MessageConstants . RECORD_FILTER ) != - 1 ) { Record record = this . getMainRecord ( ) ; if ( record != null ) messageFilter = new RecordMessageFilter ( record , null ) ; messageFilter . setMessageSource ( null ) ; } else { BaseMessageFilter newMessageFilter = ( BaseMessageFilter ) ClassServiceUtility . getClassService ( ) . makeObjectFromClassName ( strClassName ) ; if ( newMessageFilter != null ) newMessageFilter . init ( messageFilter . getQueueName ( ) , messageFilter . getQueueType ( ) , null , null ) ; if ( newMessageFilter != null ) messageFilter = newMessageFilter ; } } } return messageFilter ; } | Give a copy of the message filter set up a remote filter . |
15,247 | public void addMessageFilter ( BaseMessageFilter messageFilter ) { if ( messageFilter == null ) return ; m_mapFilters . put ( m_intNext , messageFilter ) ; messageFilter . setMessageReceiver ( this . getMessageReceiver ( ) , m_intNext ) ; int i = m_intNext . intValue ( ) ; if ( i == Integer . MAX_VALUE ) i = 0 ; m_intNext = new Integer ( i + 1 ) ; } | Add this message filter to this receive queue . |
15,248 | public BaseMessageFilter findMessageFilter ( JMessageListener listener ) { Iterator < BaseMessageFilter > iterator = m_mapFilters . values ( ) . iterator ( ) ; while ( iterator . hasNext ( ) ) { BaseMessageFilter filter = iterator . next ( ) ; for ( int i = 0 ; ( filter . getMessageListener ( i ) != null ) ; i ++ ) { if ( filter . getMessageListener ( i ) == listener ) return filter ; } } return null ; } | Lookup this message listener . This message looks through my list to see if the listener s filter is there . |
15,249 | public void start ( BundleContext context ) throws Exception { Util . getLogger ( ) . info ( "Starting Jdbc bundle" ) ; this . setProperty ( BundleConstants . TYPE , DBParams . JDBC ) ; super . start ( context ) ; } | Bundle starting up . |
15,250 | private Map < String , List < String > > createUsernameRolesMap ( final Iterable < String > roleList ) { final Map < String , List < String > > usersRolesMap = new HashMap < > ( ) ; for ( final String role : roleList ) { for ( final String user : getUsersWithRole ( role ) ) { if ( usersRolesMap . containsKey ( user ) ) { if ( ! usersRolesMap . get ( user ) . contains ( role ) ) { usersRolesMap . get ( user ) . add ( role ) ; } } else { final List < String > list = new ArrayList < > ( Collections . singletonList ( role ) ) ; usersRolesMap . put ( user , list ) ; } } } return usersRolesMap ; } | and only the roles contained in the roleList are included in the role lists . |
15,251 | private Iterable < String > retainExistingRoles ( final Collection < String > roles ) { final List < String > existingRoles = getRoles ( ) ; existingRoles . retainAll ( roles ) ; return existingRoles ; } | Returns a list of roles present in both the roles parameter and in community |
15,252 | public ZipFileBuilder addClasspathResource ( final String zipEntryPath , final String pathToResource ) { final Class < ? > callerClass = getCallerClass ( ) ; final URL resource = resolver . resolve ( pathToResource , callerClass ) ; addResource ( zipEntryPath , resource ) ; return this ; } | Adds an entry to the zip file from a classpath resource . |
15,253 | public ZipFileBuilder addResource ( String zipEntryPath , URL resource ) { this . entryMap . put ( zipEntryPath , resource ) ; return this ; } | Adds a resource to the Zip File under the path specified . |
15,254 | public int fieldChanged ( boolean bDisplayOption , int iMoveMode ) { if ( m_bWaiting ) { synchronized ( this ) { m_bWaiting = false ; this . notify ( ) ; } } return super . fieldChanged ( bDisplayOption , iMoveMode ) ; } | The Field has Changed . Don t need to call inherited . |
15,255 | public int waitForChange ( ) { if ( m_lTimeOut <= 0 ) return TIMEOUT_ERROR ; m_bWaiting = false ; synchronized ( this ) { long lStartTime = System . currentTimeMillis ( ) ; try { m_bWaiting = true ; this . wait ( m_lTimeOut ) ; } catch ( InterruptedException e ) { e . printStackTrace ( ) ; } m_lTimeOut = m_lTimeOut - ( System . currentTimeMillis ( ) - lStartTime ) ; } if ( m_bWaiting == false ) return DBConstants . NORMAL_RETURN ; m_bWaiting = false ; return TIMEOUT_ERROR ; } | Wait for this field to change . |
15,256 | public IntReference put ( K key , int value ) { IntReference w = map . get ( key ) ; if ( w == null ) { w = new IntReference ( value ) ; return map . put ( key , w ) ; } else { w . value = value ; return null ; } } | Associates value to key |
15,257 | public < T extends SebConfiguration > Seb withConfiguration ( Class < T > configCls ) { try { return withConfiguration ( configCls . getConstructor ( ) . newInstance ( ) ) ; } catch ( Exception e ) { throw new SebConfigurationConstructException ( "Unable to construct Seb configuration " + configCls . getName ( ) , e ) ; } } | Set configuration to configuration constructed from given class . Configuration class needs to have constructor with no parameters . |
15,258 | public Seb withLabel ( String ... labels ) { this . label = utils . join ( LABEL_DELIMITER , ( Object [ ] ) labels ) ; return this ; } | Set label joining given labels . |
15,259 | public void setLabel ( String ... labels ) { this . label = utils . join ( LABEL_DELIMITER , ( Object [ ] ) labels ) ; } | Modify Seb label joining given labels . |
15,260 | public Seb useEnclosingMethodLabel ( ) { final StackTraceElement e = Thread . currentThread ( ) . getStackTrace ( ) [ 2 ] ; final String s = e . getClassName ( ) ; setLabel ( s . substring ( s . lastIndexOf ( '.' ) + 1 , s . length ( ) ) , e . getMethodName ( ) ) ; return this ; } | Sets label using enclosing method class name and method name . |
15,261 | public void writeThisClass ( String strClassName , String strRecordType ) { Record recFileHdr = this . getRecord ( FileHdr . FILE_HDR_FILE ) ; try { recFileHdr . addNew ( ) ; recFileHdr . getField ( FileHdr . FILE_NAME ) . setString ( strClassName ) ; recFileHdr . setKeyArea ( FileHdr . FILE_NAME_KEY ) ; if ( recFileHdr . seek ( DBConstants . EQUALS ) ) strRecordType = "Record" ; } catch ( DBException ex ) { ex . printStackTrace ( ) ; } if ( strRecordType . length ( ) == 0 ) strRecordType = " " ; if ( m_ClassNameList . addName ( strClassName ) == false ) return ; WriteClass writeClass = null ; if ( strRecordType . equalsIgnoreCase ( "Record" ) ) writeClass = new WriteRecordClass ( this . getTask ( ) , null , null ) ; else if ( strRecordType . equalsIgnoreCase ( "Resource" ) ) writeClass = new WriteResourceClass ( this . getTask ( ) , null , null ) ; else writeClass = new WriteClass ( this . getTask ( ) , null , null ) ; if ( writeClass != null ) { writeClass . writeClass ( strClassName , CodeType . THICK ) ; writeClass . free ( ) ; } } | Write this class using the correct method for the type . |
15,262 | public int getRecordCount ( FieldTable table ) { int iKeyOrder = table . getRecord ( ) . getDefaultOrder ( ) ; if ( iKeyOrder == - 1 ) iKeyOrder = Constants . MAIN_KEY_AREA ; return this . getPKeyArea ( iKeyOrder ) . getRecordCount ( ) ; } | Get the record count . Just returns the count of the default key area . |
15,263 | public void open ( FieldTable table ) throws DBException { super . open ( table ) ; if ( ! m_bDataIn ) { m_bDataIn = true ; this . readData ( table ) ; } } | Init this object |
15,264 | public static NetworkPort remotePort ( String hostname , int port ) { return new RemoteNetworkPort ( hostname , port , NetworkPort . Type . TCP ) ; } | Creates a type - safe tcp port pointing ot a remote host and port . |
15,265 | public static NetworkPort remoteDatagramPort ( String hostname , int port ) { return new RemoteNetworkPort ( hostname , port , NetworkPort . Type . UDP ) ; } | Creates a type - safe udp port pointing ot a remote host and port . |
15,266 | public static URI buildUri ( String httpOrHttps , String host , String path , Map < String , String > paramMap ) { try { return new URIBuilder ( ) . setScheme ( httpOrHttps ) . setHost ( host ) . setPath ( path ) . setParameters ( buildNameValuePareList ( paramMap ) ) . build ( ) ; } catch ( URISyntaxException e ) { throw JMExceptionManager . handleExceptionAndReturnRuntimeEx ( log , e , "getResponseAsString" , httpOrHttps , host , path , paramMap ) ; } } | Build uri uri . |
15,267 | public static List < NameValuePair > buildNameValuePareList ( Map < String , String > keyValueMap ) { return keyValueMap . entrySet ( ) . stream ( ) . map ( entry -> new BasicNameValuePair ( entry . getKey ( ) , entry . getValue ( ) ) ) . collect ( toList ( ) ) ; } | Build name value pare list list . |
15,268 | @ SuppressWarnings ( "unchecked" ) private Map < Long , DataPoint > _getRowWithCache ( long timestampMs ) { int [ ] yyyymm_dd = toYYYYMM_DD ( timestampMs ) ; int yyyymmdd = yyyymm_dd [ 0 ] * 100 + yyyymm_dd [ 1 ] ; ICache cache = getCache ( ) ; String cacheKey = String . valueOf ( yyyymmdd ) ; Object temp = cache != null ? cache . get ( cacheKey ) : null ; Map < Long , DataPoint > result = ( Map < Long , DataPoint > ) ( temp instanceof Map ? temp : null ) ; if ( result == null ) { result = _getRow ( getName ( ) , yyyymm_dd [ 0 ] , yyyymm_dd [ 1 ] ) ; if ( cache != null ) { cache . set ( cacheKey , result ) ; } } return result ; } | Gets all data points of a day specified by the timestamp cache supported . |
15,269 | private Map < Long , DataPoint > _getRow ( String counterName , int yyyymm , int dd ) { Map < Long , DataPoint > result = new HashMap < Long , DataPoint > ( ) ; ResultSet rs = CqlUtils . execute ( sessionHelper . getSession ( ) , cqlGetRow , getConsistencyLevelForRead ( ) , counterName , yyyymm , dd ) ; for ( Iterator < Row > it = rs . iterator ( ) ; it . hasNext ( ) ; ) { Row row = it . next ( ) ; long key = row . getLong ( CqlTemplate . COL_COUNTER_TIMESTAMP ) ; long value = row . getLong ( CqlTemplate . COL_COUNTER_VALUE ) ; DataPoint dp = new DataPoint ( Type . SUM , key , value , RESOLUTION_MS ) ; result . put ( key , dp ) ; } return result ; } | Gets all data points of a day . |
15,270 | public static final byte [ ] fromHex ( String hexDump ) { List < Integer > list = new ArrayList < > ( ) ; String [ ] lines = hexDump . split ( "\n" ) ; if ( lines . length < 2 ) { throw new IllegalArgumentException ( "not a hex dump" ) ; } if ( ! lines [ 0 ] . contains ( Title ) ) { throw new IllegalArgumentException ( "not a hex dump" ) ; } for ( int ll = 1 ; ll < lines . length ; ll ++ ) { String line = lines [ ll ] ; int i1 = line . indexOf ( ':' ) ; if ( i1 == - 1 ) { throw new IllegalArgumentException ( "not a hex dump" ) ; } int i2 = line . indexOf ( " " , i1 + 2 ) ; if ( i2 == - 1 ) { throw new IllegalArgumentException ( "not a hex dump" ) ; } String [ ] fields = line . substring ( i1 + 2 , i2 ) . split ( " " ) ; for ( int ii = 0 ; ii < fields . length ; ii ++ ) { list . add ( Integer . parseInt ( fields [ ii ] , 16 ) ) ; } } byte [ ] bytes = new byte [ list . size ( ) ] ; for ( int ii = 0 ; ii < bytes . length ; ii ++ ) { bytes [ ii ] = list . get ( ii ) . byteValue ( ) ; } return bytes ; } | Recreates byte array from hex dump . |
15,271 | public static final String remainingToHex ( ByteBuffer bb ) { byte [ ] buf = new byte [ bb . remaining ( ) ] ; int safe = bb . position ( ) ; bb . get ( buf ) ; bb . position ( safe ) ; return toHex ( buf ) ; } | Creates readable view to byte buffer remaining . Doesn t change byte buffer . |
15,272 | public static final String startToHex ( ByteBuffer bb ) { byte [ ] buf = new byte [ bb . position ( ) ] ; int safePos = bb . position ( ) ; int safeLim = bb . limit ( ) ; bb . position ( 0 ) ; bb . get ( buf ) ; bb . position ( safePos ) ; bb . limit ( safeLim ) ; return toHex ( buf ) ; } | Creates readable view to byte buffer remaining . Mark will be discarded . |
15,273 | public BaseField getSyncedListenersField ( BaseField field , FieldListener listener ) { if ( field != null ) if ( field . getRecord ( ) == this . getOwner ( ) . getRecord ( ) ) field = listener . getOwner ( ) . getRecord ( ) . getField ( field . getFieldName ( ) ) ; return field ; } | When cloning a listener if the field is contained in the source record get the same field is the new record . |
15,274 | public boolean respondsToMode ( int iMoveMode ) { if ( iMoveMode == DBConstants . SCREEN_MOVE ) return m_bScreenMove ; if ( iMoveMode == DBConstants . INIT_MOVE ) return m_bInitMove ; if ( iMoveMode == DBConstants . READ_MOVE ) return m_bReadMove ; return false ; } | Does this listener respond to this mode? |
15,275 | private final String eval ( final String str ) throws InvalidExpression { if ( str == null ) return null ; return new MapExpression ( str , null , mapper , false ) . eval ( ) . get ( ) ; } | GET with MapExpression |
15,276 | protected void addToCache ( K canonicalKey , R row ) { assert ObjectUtils . equals ( canonicalize ( row . getKey ( ) ) , canonicalKey ) ; rowCache . get ( ) . put ( canonicalKey , row ) ; } | Adds a single object to the cache . |
15,277 | public BaseMessageHeader createMessageHeader ( ) { Map < String , Object > properties = ( ( PropertiesField ) this . getField ( MessageLog . MESSAGE_HEADER_PROPERTIES ) ) . getProperties ( ) ; BaseMessageHeader messageHeader = null ; String strMessageHeaderClassName = this . getField ( MessageLog . MESSAGE_HEADER_CLASS_NAME ) . toString ( ) ; String strQueueName = this . getField ( MessageLog . MESSAGE_QUEUE_NAME ) . toString ( ) ; String strQueueType = this . getField ( MessageLog . MESSAGE_QUEUE_TYPE ) . toString ( ) ; Object source = null ; messageHeader = BaseMessageHeader . createMessageHeader ( strMessageHeaderClassName , strQueueName , strQueueType , source , properties ) ; if ( messageHeader == null ) messageHeader = new TrxMessageHeader ( null , properties ) ; if ( messageHeader instanceof TrxMessageHeader ) { properties = ( ( PropertiesField ) this . getField ( MessageLog . MESSAGE_INFO_PROPERTIES ) ) . getProperties ( ) ; ( ( TrxMessageHeader ) messageHeader ) . setMessageInfoMap ( properties ) ; properties = ( ( PropertiesField ) this . getField ( MessageLog . MESSAGE_TRANSPORT_PROPERTIES ) ) . getProperties ( ) ; ( ( TrxMessageHeader ) messageHeader ) . setMessageTransportMap ( properties ) ; ( ( TrxMessageHeader ) messageHeader ) . put ( TrxMessageHeader . LOG_TRX_ID , this . getCounterField ( ) . toString ( ) ) ; } return messageHeader ; } | CreateMessageHeader Method . |
15,278 | public BaseMessageRecordDesc createMessageData ( ) { MessageRecordDesc messageData = null ; String strMessageDataClassName = this . getField ( MessageLog . MESSAGE_DATA_CLASS_NAME ) . toString ( ) ; return MessageRecordDesc . createMessageRecordDesc ( strMessageDataClassName , null , null ) ; } | CreateMessageData Method . |
15,279 | public String getProperty ( String strKey ) { String strProperty = this . getMessageProperty ( strKey ) ; if ( strProperty == null ) strProperty = ( ( PropertiesField ) this . getField ( MessageLog . MESSAGE_HEADER_PROPERTIES ) ) . getProperty ( strKey ) ; if ( strProperty == null ) strProperty = ( ( PropertiesField ) this . getField ( MessageLog . MESSAGE_INFO_PROPERTIES ) ) . getProperty ( strKey ) ; if ( strProperty == null ) strProperty = ( ( PropertiesField ) this . getField ( MessageLog . MESSAGE_TRANSPORT_PROPERTIES ) ) . getProperty ( strKey ) ; return strProperty ; } | Get this property from this record . |
15,280 | public static final IntStream toDigits ( long v , int length , int radix ) { Spliterator . OfInt spliterator = Spliterators . spliterator ( new PRimIt ( v , length , radix ) , Long . MAX_VALUE , 0 ) ; return StreamSupport . intStream ( spliterator , false ) ; } | Returns IntStream where each item is a digit . I . e zero leading digits . |
15,281 | public static final char parseChar ( CharSequence cs , int beginIndex , int endIndex ) { if ( endIndex - beginIndex != 1 ) { throw new IllegalArgumentException ( "input length must be 1" ) ; } return cs . charAt ( beginIndex ) ; } | Returns char from input . |
15,282 | public static final boolean parseBoolean ( CharSequence cs , int beginIndex , int endIndex ) { return endIndex - beginIndex == 4 && Character . codePointCount ( cs , beginIndex , endIndex ) == 4 && Character . toUpperCase ( Character . codePointAt ( cs , beginIndex ) ) == 'T' && Character . toUpperCase ( Character . codePointAt ( cs , beginIndex + 1 ) ) == 'R' && Character . toUpperCase ( Character . codePointAt ( cs , beginIndex + 2 ) ) == 'U' && Character . toUpperCase ( Character . codePointAt ( cs , beginIndex + 3 ) ) == 'E' ; } | Parses the char sequence argument as a boolean . The boolean returned represents the value true if the char sequence argument is not null and is equal ignoring case to the string true . |
15,283 | public static final boolean parseBoolean ( CharSequence cs , int radix , int beginIndex , int endIndex ) { if ( radix != 2 ) { throw new IllegalArgumentException ( "radix must be 2" ) ; } if ( Character . codePointCount ( cs , beginIndex , endIndex ) != 1 ) { throw new IllegalArgumentException ( "input length must be 1" ) ; } int digit = Character . digit ( Character . codePointAt ( cs , beginIndex ) , 2 ) ; switch ( digit ) { case 1 : return true ; case 0 : return false ; default : throw new IllegalArgumentException ( "input must be 0/1" ) ; } } | Parses the char sequence argument as a boolean . The boolean returned represents the value true if the char sequence argument is not null and it s digit value is 1 . |
15,284 | public static final float parseFloat ( CharSequence cs , int beginIndex , int endIndex ) { FloatState fs = FloatState . Significand ; int end = endIndex ; int significand = 0 ; int sign = 1 ; int index = beginIndex ; int decimal = 0 ; int exponent = 0 ; int exponentSign = 1 ; boolean overFlow = false ; int cp = Character . codePointAt ( cs , index ) ; if ( cp == '+' ) { index ++ ; } if ( cp == '-' ) { sign = - 1 ; index ++ ; } if ( index >= end ) { throw new NumberFormatException ( "unparsable number " + cs . subSequence ( beginIndex , endIndex ) ) ; } while ( index < end ) { cp = Character . codePointAt ( cs , index ) ; if ( Character . isBmpCodePoint ( cp ) ) { index ++ ; } else { index += 2 ; } switch ( cp ) { default : int digit = Character . digit ( cp , 10 ) ; if ( digit != - 1 ) { if ( ! overFlow && significand > INT_LIMIT ) { overFlow = true ; } switch ( fs ) { case Significand : if ( ! overFlow ) { significand *= 10 ; significand += digit ; } else { decimal ++ ; } break ; case Decimal : if ( ! overFlow ) { significand *= 10 ; significand += digit ; decimal -- ; } break ; case Exponent : exponent = 10 * exponent + digit ; break ; } } else { throw new NumberFormatException ( "no float " + cs . subSequence ( beginIndex , endIndex ) ) ; } break ; case '.' : if ( fs != FloatState . Significand ) { throw new NumberFormatException ( "cannot convert " + cs . subSequence ( beginIndex , endIndex ) + " to float" ) ; } fs = FloatState . Decimal ; break ; case 'e' : case 'E' : if ( fs == FloatState . Exponent ) { throw new NumberFormatException ( "cannot convert " + cs . subSequence ( beginIndex , endIndex ) + " to float" ) ; } fs = FloatState . Exponent ; break ; case '-' : if ( fs != FloatState . Exponent ) { throw new NumberFormatException ( "cannot convert " + cs . subSequence ( beginIndex , endIndex ) + " to float" ) ; } exponentSign = - 1 ; break ; case '+' : if ( fs != FloatState . Exponent ) { throw new NumberFormatException ( "cannot convert " + cs . subSequence ( beginIndex , endIndex ) + " to float" ) ; } break ; } } return ( float ) ( sign * significand * Math . pow ( 10 , exponentSign * exponent + decimal ) ) ; } | Parses float from decimal floating point representation . |
15,285 | public static final int findInt ( CharSequence cs , int radix , int beginIndex , int endIndex ) { IntPredicate predicate = null ; switch ( radix ) { case 8 : predicate = Primitives :: isOctalDigit ; break ; case 10 : predicate = Primitives :: isDecimalDigit ; break ; case 16 : predicate = Primitives :: isHexDigit ; break ; default : throw new UnsupportedOperationException ( "radix " + radix + " not supported" ) ; } int begin = CharSequences . indexOf ( cs , predicate , beginIndex ) ; int end = CharSequences . indexOf ( cs , predicate . negate ( ) , begin ) ; return parseInt ( cs , radix , begin , endIndex ( end , endIndex ) ) ; } | Parses next int |
15,286 | public static final float findFloat ( CharSequence cs , int beginIndex , int endIndex ) { int begin = CharSequences . indexOf ( cs , Primitives :: isFloatDigit , beginIndex ) ; int end = CharSequences . indexOf ( cs , ( c ) -> ! Primitives . isFloatDigit ( c ) , begin ) ; return parseFloat ( cs , begin , endIndex ( end , endIndex ) ) ; } | Parses next float |
15,287 | public static final double findDouble ( CharSequence cs , int beginIndex , int endIndex ) { int begin = CharSequences . indexOf ( cs , Primitives :: isFloatDigit , beginIndex ) ; int end = CharSequences . indexOf ( cs , ( c ) -> ! Primitives . isFloatDigit ( c ) , begin ) ; return parseDouble ( cs , begin , endIndex ( end , endIndex ) ) ; } | Parses next double in decimal form |
15,288 | public static final double findScientific ( CharSequence cs , int beginIndex , int endIndex ) { int begin = CharSequences . indexOf ( cs , Primitives :: isScientificDigit , beginIndex ) ; int end = CharSequences . indexOf ( cs , ( c ) -> ! Primitives . isScientificDigit ( c ) , begin ) ; return parseDouble ( cs , begin , endIndex ( end , endIndex ) ) ; } | Parses next double in scientific form |
15,289 | public static DoubleUnaryOperator b ( int n , int m ) { return ( t ) -> c ( n , m ) * Math . pow ( t , m ) * Math . pow ( 1 - t , n - m ) ; } | Returns Bernstein polynomial |
15,290 | public static String toFirstLower ( String name ) { if ( isEmpty ( name ) ) { return name ; } return "" + name . toLowerCase ( Locale . ROOT ) . charAt ( 0 ) + name . substring ( 1 ) ; } | Make the first character lower case |
15,291 | public static String toFirstUpper ( String name ) { if ( isEmpty ( name ) ) { return name ; } return "" + name . toUpperCase ( Locale . ROOT ) . charAt ( 0 ) + name . substring ( 1 ) ; } | Make the first character upper case |
15,292 | public String getInputType ( String strViewType ) { if ( ScreenModel . HTML_TYPE . equalsIgnoreCase ( strViewType ) ) return "date" ; else return super . getInputType ( strViewType ) ; } | Get the HTML Input Type . |
15,293 | public void getSQLFromField ( PreparedStatement statement , int iType , int iParamColumn ) throws SQLException { if ( this . isNull ( ) ) { if ( ( ! this . isNullable ( ) ) || ( iType == DBConstants . SQL_SELECT_TYPE ) || ( DBConstants . FALSE . equals ( this . getRecord ( ) . getTable ( ) . getDatabase ( ) . getProperties ( ) . get ( SQLParams . NULL_TIMESTAMP_SUPPORTED ) ) ) ) { java . sql . Timestamp sqlDate = new java . sql . Timestamp ( 0 ) ; statement . setTimestamp ( iParamColumn , sqlDate ) ; } else statement . setNull ( iParamColumn , Types . TIMESTAMP ) ; } else { java . util . Date time = ( java . util . Date ) this . getData ( ) ; Converter . initGlobals ( ) ; Converter . gCalendar . setTime ( time ) ; java . sql . Timestamp sqlDate = new java . sql . Timestamp ( Converter . gCalendar . getTimeInMillis ( ) ) ; statement . setTimestamp ( iParamColumn , sqlDate ) ; } } | Move the physical binary data to this SQL parameter row . This method used the setTimestamp statement method . |
15,294 | public int setValue ( double value , boolean bDisplayOption , int iMoveMode ) { java . util . Date dateTemp = new java . util . Date ( ( long ) value ) ; int iErrorCode = this . setData ( dateTemp , bDisplayOption , iMoveMode ) ; return iErrorCode ; } | Set the Value of this field as a double . |
15,295 | public Calendar getCalendar ( ) { java . util . Date dateValue = ( java . util . Date ) this . getData ( ) ; if ( dateValue == null ) return null ; Calendar calendar = Calendar . getInstance ( ) ; calendar . setTime ( dateValue ) ; return calendar ; } | Get this field as a java calendar value . |
15,296 | public int setTime ( java . util . Date time , boolean bDisplayOption , int iMoveMode ) { java . util . Date m_DateTime = ( java . util . Date ) m_data ; int iYear = DBConstants . FIRST_YEAR ; int iMonth = DBConstants . FIRST_DAY ; int iDate = DBConstants . FIRST_MONTH ; if ( m_DateTime != null ) { m_calendar . setTime ( m_DateTime ) ; iYear = m_calendar . get ( Calendar . YEAR ) ; iMonth = m_calendar . get ( Calendar . MONTH ) ; iDate = m_calendar . get ( Calendar . DATE ) ; } m_calendar . setTime ( time ) ; int iHour = m_calendar . get ( Calendar . HOUR_OF_DAY ) ; int iMinute = m_calendar . get ( Calendar . MINUTE ) ; int iSecond = m_calendar . get ( Calendar . SECOND ) ; m_calendar . set ( iYear , iMonth , iDate , iHour , iMinute , iSecond ) ; java . util . Date dateNew = m_calendar . getTime ( ) ; return this . setDateTime ( dateNew , bDisplayOption , iMoveMode ) ; } | Change the time without changing the date . |
15,297 | public void setToLimit ( int iAreaDesc ) { m_calendar . set ( DBConstants . FIRST_YEAR , Calendar . JANUARY , 1 , 0 , 0 , 0 ) ; if ( iAreaDesc == DBConstants . END_SELECT_KEY ) m_calendar . set ( DBConstants . LAST_YEAR , Calendar . DECEMBER , 31 , 23 , 59 , 59 ) ; java . util . Date time = m_calendar . getTime ( ) ; this . doSetData ( time , DBConstants . DONT_DISPLAY , DBConstants . SCREEN_MOVE ) ; } | Set to the min or max value . |
15,298 | public static double todaysDate ( ) { java . util . Date date = new java . util . Date ( ) ; m_calendar . setTime ( date ) ; m_calendar . set ( Calendar . HOUR_OF_DAY , 0 ) ; m_calendar . set ( Calendar . MINUTE , 0 ) ; m_calendar . set ( Calendar . SECOND , 0 ) ; m_calendar . set ( Calendar . MILLISECOND , 0 ) ; date = m_calendar . getTime ( ) ; return date . getTime ( ) ; } | Return the current date with a 0 time . |
15,299 | public static double currentTime ( ) { java . util . Date time = new java . util . Date ( ) ; m_calendar . setTime ( time ) ; m_calendar . set ( Calendar . MILLISECOND , 0 ) ; time = m_calendar . getTime ( ) ; return time . getTime ( ) ; } | Return the current date and time as a double . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.