idx
int64
0
41.2k
question
stringlengths
74
4.21k
target
stringlengths
5
888
17,000
public Message createReplyMessage ( Message message ) { Object objResponseID = ( ( BaseMessage ) message ) . getMessageHeader ( ) . get ( TrxMessageHeader . MESSAGE_RESPONSE_ID ) ; if ( objResponseID == null ) return null ; MessageProcessInfo recMessageProcessInfo = ( MessageProcessInfo ) this . getMessageProcessInfo (...
Create the response message for this message .
17,001
public void run ( ) { try { Object result = execute ( ) ; if ( ! aborted ) { this . retval = result ; finished = true ; } } catch ( InterruptedException ie ) { } catch ( Throwable t ) { execException = t ; finished = true ; } }
Used to invoke executable asynchronously .
17,002
public void interrupt ( ) { if ( ! aborted ) { aborted = true ; if ( executeThread != null ) { executeThread . interrupt ( ) ; } if ( helperExecutable != null ) { helperExecutable . interrupt ( ) ; } } }
Tries to interrupt execution . Execution code is interrupted if it sleeps once in a while .
17,003
public void init ( Record record , Record recordMain , String iMainFilesField , BaseField fieldMain , String fsToCount , boolean bRecountOnSelect , boolean bVerifyOnEOF , boolean bResetOnBreak ) { super . init ( record ) ; this . fsToCount = fsToCount ; if ( fieldMain != null ) m_fldMain = fieldMain ; else if ( recordM...
Constructor for counting the value of a field in this record .
17,004
public int setCount ( double dFieldCount , boolean bDisableListeners , int iMoveMode ) { int iErrorCode = DBConstants . NORMAL_RETURN ; if ( m_fldMain != null ) { boolean [ ] rgbEnabled = null ; if ( bDisableListeners ) rgbEnabled = m_fldMain . setEnableListeners ( false ) ; int iOriginalValue = ( int ) m_fldMain . get...
Reset the field count .
17,005
public OWLSAtomicService buildOWLSServiceFrom ( URI serviceURI , List < URI > modelURIs ) throws ModelException { if ( isFile ( serviceURI ) ) { return buildOWLSServiceFromLocalOrRemoteURI ( serviceURI , modelURIs ) ; } else { Service service = OWLSStore . persistentModelAsOWLKB ( ) . getService ( serviceURI ) ; if ( n...
Builds an OWLSAtomicService
17,006
public OWLSAtomicService buildOWLSServiceFrom ( Service owlsService ) throws ModelException { OWLSAtomicService service = new OWLSAtomicService ( owlsService ) ; return completeOWLSServiceIfNeeded ( service ) ; }
Builds an OWLSAtomicService from a given Service object
17,007
private OWLSAtomicService buildOWLSServiceFromLocalOrRemoteURI ( URI serviceURI , List < URI > modelURIs ) throws ModelException { BSDFLogger . getLogger ( ) . info ( "Builds OWL service (BSDF functionality) from: " + serviceURI . toString ( ) ) ; OWLContainer owlSyntaxTranslator = new OWLContainer ( ) ; OWLKnowledgeBa...
Builds an OWLSAtomicService from a given URI that has to be a local file or an http URL
17,008
public final < T > T getTypedContext ( Class < T > key , T defaultValue ) { return UEL . getContext ( this , key , defaultValue ) ; }
Convenience method to return a typed context object when key resolves per documented convention to an object of the same type .
17,009
public < T extends EventListener > void subscribe ( EventPublisher source , T listener ) { if ( source == null || listener == null ) { throw new IllegalArgumentException ( "Parameters cannot be null" ) ; } log . debug ( "[subscribe] Adding {} , source . getClass ( ) . getName ( ) , listener . getClass ( ) . getName ( ...
Binds a listener to a publisher
17,010
public < T extends EventListener > void unsubscribe ( EventPublisher source , T listener ) { log . debug ( "[unsubscribe] Removing {} , source . getClass ( ) . getName ( ) , listener . getClass ( ) . getName ( ) ) ; GenericEventDispatcher < T > dispatcher = ( GenericEventDispatcher < T > ) dispatchers . get ( source )...
Unbinds a listener to a publisher
17,011
public EventDispatcher getEventDispatcher ( EventPublisher source ) { EventDispatcher ret = dispatchers . get ( source ) ; if ( ret == null ) { ret = createDispatcher ( source ) ; } return ret ; }
Gets the object used to fire events
17,012
public int getSubscribersCount ( EventPublisher source ) { GenericEventDispatcher < ? > dispatcherObject = dispatchers . get ( source ) ; if ( dispatcherObject == null ) { return 0 ; } else { return dispatcherObject . getListenersCount ( ) ; } }
Gets the number of listeners registered for a publisher
17,013
public static JFrame createShowAndPosition ( final String title , final Container content , final boolean exitOnClose , final FramePositioner positioner ) { return createShowAndPosition ( title , content , exitOnClose , true , positioner ) ; }
Create a new resizeable frame with a panel as it s content pane and position the frame .
17,014
public static ImageIcon loadIcon ( final Class clasz , final String name ) { final URL url = Utils4J . getResource ( clasz , name ) ; return new ImageIcon ( url ) ; }
Load an icon located in the same package as a given class .
17,015
private static void initLookAndFeelIntern ( final String className ) { try { UIManager . setLookAndFeel ( className ) ; } catch ( final Exception e ) { throw new RuntimeException ( "Error initializing the Look And Feel!" , e ) ; } }
Initializes the look and feel and wraps exceptions into a runtime exception . It s executed in the calling thread .
17,016
public static RootPaneContainer findRootPaneContainer ( final Component source ) { Component comp = source ; while ( ( comp != null ) && ! ( comp instanceof RootPaneContainer ) ) { comp = comp . getParent ( ) ; } if ( comp instanceof RootPaneContainer ) { return ( RootPaneContainer ) comp ; } return null ; }
Find the root pane container in the current hierarchy .
17,017
public static GlassPaneState showGlassPane ( final Component source ) { final Component focusOwner = KeyboardFocusManager . getCurrentKeyboardFocusManager ( ) . getFocusOwner ( ) ; final RootPaneContainer rootPaneContainer = findRootPaneContainer ( source ) ; final Component glassPane = rootPaneContainer . getGlassPane...
Makes the glass pane visible and focused and stores the saves the current state .
17,018
public static void hideGlassPane ( final GlassPaneState state ) { Utils4J . checkNotNull ( "state" , state ) ; final Component glassPane = state . getGlassPane ( ) ; glassPane . removeMouseListener ( state . getMouseListener ( ) ) ; glassPane . setCursor ( state . getCursor ( ) ) ; glassPane . setVisible ( false ) ; if...
Hides the glass pane and restores the saved state .
17,019
public < T > void setObject ( DataKey < T > key , T object ) { if ( key == null ) { throw new IllegalArgumentException ( "key must not be null" ) ; } if ( object == null && ! key . allowNull ( ) ) { throw new IllegalArgumentException ( "key \"" + key . getName ( ) + "\" disallows null values but object was null" ) ; } ...
stores an object for the given key
17,020
public < T > void setObjectList ( ListDataKey < T > key , List < T > objects ) { if ( key == null ) { throw new IllegalArgumentException ( "key must not be null" ) ; } if ( objects == null && ! key . allowNull ( ) ) { throw new IllegalArgumentException ( "list key \"" + key . getName ( ) + "\" disallows null values but...
stores a list of objects for a given key
17,021
@ SuppressWarnings ( "unchecked" ) public static < C > C delegateIf ( Class < C > contract , Supplier < C > target , Supplier < Boolean > condition ) { checkVoid ( contract ) ; return ( C ) Proxy . newProxyInstance ( contract . getClassLoader ( ) , new Class [ ] { contract } , invocationHandler ( contract , target , co...
Create a proxy which only delegates if a condition is true .
17,022
public void keyPressed ( KeyEvent evt ) { if ( evt . getKeyCode ( ) == KeyEvent . VK_ENTER ) { boolean bDoTab = true ; int iTextLength = m_control . getDocument ( ) . getLength ( ) ; if ( ( ( m_control . getSelectionStart ( ) == 0 ) || ( m_control . getSelectionStart ( ) == iTextLength ) ) && ( ( m_control . getSelecti...
key released if tab select next field .
17,023
public Object unmarshalRootElement ( Node node , BaseXmlTrxMessageIn soapTrxMessage ) throws Exception { TransformerFactory tFact = TransformerFactory . newInstance ( ) ; Source source = new DOMSource ( node ) ; Writer writer = new StringWriter ( ) ; Result result = new StreamResult ( writer ) ; Transformer transformer...
Create the root element for this message . You SHOULD override this if the unmarshaller has a native method to unmarshall a dom node .
17,024
public void addPayloadProperties ( Object msg , BaseMessage message ) { MessageDataDesc messageDataDesc = message . getMessageDataDesc ( null ) ; if ( messageDataDesc != null ) { Map < String , Class < ? > > mapPropertyNames = messageDataDesc . getPayloadPropertyNames ( null ) ; if ( mapPropertyNames != null ) { Map < ...
Utility to add the standard payload properties to the message
17,025
public Map < String , Object > getPayloadProperties ( Object msg , Map < String , Class < ? > > mapPropertyNames ) { Map < String , Object > properties = new HashMap < String , Object > ( ) ; for ( String strKey : mapPropertyNames . keySet ( ) ) { this . addPayloadProperty ( msg , properties , strKey ) ; } this . addPa...
Get all the payload properties .
17,026
public void addPayloadProperty ( Object msg , Map < String , Object > properties , String key ) { String name = "get" + key ; try { Method method = msg . getClass ( ) . getMethod ( name , EMPTY_PARAMS ) ; if ( method != null ) { Object value = method . invoke ( msg , EMPTY_DATA ) ; if ( value != null ) { if ( value . g...
Add this payload property to this map .
17,027
public void addErrorsProperties ( Map < String , Object > properties , Object errorsType ) { try { Method method = errorsType . getClass ( ) . getMethod ( "getErrors" , EMPTY_PARAMS ) ; if ( method != null ) { Object value = method . invoke ( errorsType , EMPTY_DATA ) ; if ( value instanceof List < ? > ) { for ( Object...
Add the error properties from this message .
17,028
@ Unit ( NM ) public static double radius ( Location ... location ) { Location center = center ( location ) ; double max = 0 ; for ( Location loc : location ) { Distance distance = distance ( loc , center ) ; double miles = distance . getMiles ( ) ; if ( miles > max ) { max = miles ; } } return max ; }
First calculates center point and returns maximum distance from center in NM .
17,029
public List < PublishedEvent > findQueued ( ) { return repositoryService . allMatches ( new QueryDefault < > ( PublishedEvent . class , "findByStateOrderByTimestamp" , "state" , PublishedEvent . State . QUEUED ) ) ; }
region > findQueued
17,030
public List < PublishedEvent > findProcessed ( ) { return repositoryService . allMatches ( new QueryDefault < > ( PublishedEvent . class , "findByStateOrderByTimestamp" , "state" , PublishedEvent . State . PROCESSED ) ) ; }
region > findProcessed
17,031
public void purgeProcessed ( ) { List < PublishedEvent > processedEvents = findProcessed ( ) ; for ( PublishedEvent publishedEvent : processedEvents ) { publishedEvent . delete ( ) ; } }
region > purgeProcessed
17,032
public static URL getURLFromPath ( String path , BaseApplet applet ) { URL url = null ; try { if ( ( url == null ) && ( path != null ) ) url = new URL ( path ) ; } catch ( MalformedURLException ex ) { Application app = null ; if ( applet == null ) applet = ( BaseApplet ) BaseApplet . getSharedInstance ( ) . getApplet (...
Get the URL from the path .
17,033
public int tryFillAll ( RingByteBuffer ring ) throws IOException , InterruptedException { fillLock . lock ( ) ; try { if ( ring . marked ( ) > free ( ) ) { return 0 ; } return fill ( ring ) ; } finally { fillLock . unlock ( ) ; } }
Calls fill if rings marked fits . Otherwise returns 0 .
17,034
public int fillAll ( RingByteBuffer ring ) throws IOException , InterruptedException { if ( ring . marked ( ) > capacity ) { throw new IllegalArgumentException ( "marked > capacity" ) ; } fillLock . lock ( ) ; try { fillSync . waitUntil ( ( ) -> ring . marked ( ) <= free ( ) ) ; return fill ( ring ) ; } finally { fillL...
Waits until ring . marked fits .
17,035
protected String getSpacer ( ) { final StringBuilder output = new StringBuilder ( ) ; final int indentationSize = parent != null ? getColumn ( ) : 0 ; for ( int i = 1 ; i < indentationSize ; i ++ ) { output . append ( SPACER ) ; } return output . toString ( ) ; }
Gets the spacer string to append before nodes in their toString methods .
17,036
public void init ( RecordOwnerParent taskParent , Record recordMain , Map < String , Object > properties ) { m_trxMessage = null ; if ( properties != null ) m_trxMessage = ( BaseMessage ) properties . remove ( DBParams . MESSAGE ) ; super . init ( taskParent , recordMain , properties ) ; }
Initializes the MessageProcessor .
17,037
public Integer getRegistryID ( BaseMessage internalMessageReply ) { Integer intRegistryID = null ; Object objRegistryID = null ; if ( internalMessageReply . getMessageHeader ( ) instanceof TrxMessageHeader ) objRegistryID = ( ( TrxMessageHeader ) internalMessageReply . getMessageHeader ( ) ) . getMessageHeaderMap ( ) ....
Get the message queue registry ID from this message .
17,038
public < T > T answer ( Function < String , T > function , final String validationErrorMessage ) { validateWith ( functionValidator ( function , validationErrorMessage ) ) ; return function . apply ( answer ( ) ) ; }
Return user input as T
17,039
private String initConsoleAndGetAnswer ( ) { ConsoleReaderWrapper consoleReaderWrapper = initConsole ( ) ; String input = "" ; boolean valid = false ; while ( ! valid ) { input = consoleReaderWrapper . getInput ( ) ; valid = validate ( consoleReaderWrapper , input ) ; if ( ! valid ) { consoleReaderWrapper . print ( "" ...
Initialize console and get user input as answer
17,040
private boolean validate ( ConsoleReaderWrapper consoleReaderWrapper , String input ) { Iterable < String > errors = validate ( input ) ; if ( ! Iterables . isEmpty ( errors ) ) { consoleReaderWrapper . beep ( ) ; for ( String error : errors ) { consoleReaderWrapper . print ( error ) ; } return false ; } else { return ...
Validate user input with available validators
17,041
public void init ( Object env , Map < String , Object > properties , Object applet ) { super . init ( env , properties , applet ) ; Task task = new AutoTask ( this , null , null ) ; m_systemRecordOwner = ( RecordOwner ) ClassServiceUtility . getClassService ( ) . makeObjectFromClassName ( ResourceConstants . BASE_PROCE...
Initializes the MainApplication . Usually you pass the object that wants to use this sesssion . For example the applet or MainApplication .
17,042
public void free ( ) { Record recUserRegistration = ( Record ) m_systemRecordOwner . getRecord ( UserRegistrationModel . USER_REGISTRATION_FILE ) ; if ( recUserRegistration != null ) { for ( UserProperties regKey : m_htRegistration . values ( ) ) { regKey . free ( ) ; } recUserRegistration . free ( ) ; recUserRegistrat...
Release the user s preferences .
17,043
public String getDefaultSystemName ( ) { Environment env = this . getEnvironment ( ) ; Map < String , Object > properties = new HashMap < String , Object > ( ) ; properties . put ( DBConstants . SYSTEM_NAME , "base" ) ; BaseApplication app = new MainApplication ( env , properties , null ) ; try { Task task = new AutoTa...
Read the default system name .
17,044
public Map < String , Object > addMenuProperties ( String strSubDomain , Record recMenus , Map < String , Object > mapDomainProperties ) { try { recMenus . getField ( Menus . CODE ) . setString ( strSubDomain ) ; if ( recMenus . seek ( "=" ) ) { Map < String , Object > properties = ( ( PropertiesField ) recMenus . getF...
Add the properies from this menu item .
17,045
public Map < String , Object > setDomainProperties ( Task task , String strDomain ) { Map < String , Object > mapDomainProperties = null ; if ( strDomain != null ) { if ( m_systemRecordOwner != null ) { mapDomainProperties = this . getDomainProperties ( strDomain ) ; if ( mapDomainProperties != null ) if ( ( ( mapDomai...
If the domain changes change the properties to the new domain .
17,046
public boolean readUserInfo ( boolean bRefreshOnChange , boolean bForceRead ) { String strUserID = this . getProperty ( DBParams . USER_ID ) ; if ( strUserID == null ) strUserID = this . getProperty ( DBParams . USER_NAME ) ; if ( strUserID == null ) strUserID = Constants . BLANK ; Record recUserInfo = ( Record ) this ...
Read the user info record for the current user .
17,047
public void removeUserProperties ( UserProperties userProperties ) { if ( m_htRegistration . get ( userProperties . getKey ( ) ) != null ) m_htRegistration . remove ( userProperties . getKey ( ) ) ; }
Remove this user registration record .
17,048
public Record getUserRegistration ( ) { Record recUserRegistration = ( Record ) m_systemRecordOwner . getRecord ( UserRegistrationModel . USER_REGISTRATION_FILE ) ; if ( recUserRegistration == null ) recUserRegistration = Record . makeRecordFromClassName ( UserRegistrationModel . THICK_CLASS , m_systemRecordOwner ) ; r...
Get the user registration record . And create it if it doesn t exist yet .
17,049
public UserInfoModel getUserInfo ( ) { UserInfoModel recUserInfo = null ; if ( m_systemRecordOwner != null ) recUserInfo = ( UserInfoModel ) m_systemRecordOwner . getRecord ( UserInfoModel . USER_INFO_FILE ) ; return recUserInfo ; }
Get the user information record .
17,050
public RemoteTask createRemoteTask ( String strServer , String strRemoteApp , String strUserID , String strPassword ) { RemoteTask remoteTask = super . createRemoteTask ( strServer , strRemoteApp , strUserID , strPassword ) ; return remoteTask ; }
Connect to the remote server and get the remote server object .
17,051
public int generateBytes ( byte [ ] out , int outOff , int len ) throws DataLengthException , IllegalArgumentException { if ( ( out . length - len ) < outOff ) { throw new DataLengthException ( "output buffer too small" ) ; } long oBytes = len ; int outLen = digest . getDigestSize ( ) ; if ( oBytes > ( ( 2L << 32 ) - 1...
fill len bytes of the output buffer with bytes generated from the derivation function .
17,052
public void severe ( String format , Object ... args ) { if ( isLoggable ( SEVERE ) ) { logIt ( SEVERE , String . format ( format , args ) ) ; } }
Write to log SEVERE level .
17,053
public void warning ( String format , Object ... args ) { if ( isLoggable ( WARNING ) ) { logIt ( WARNING , String . format ( format , args ) ) ; } }
Write to log at WARNING level .
17,054
public void info ( String format , Object ... args ) { if ( isLoggable ( INFO ) ) { logIt ( INFO , String . format ( format , args ) ) ; } }
Write to log at INFO level .
17,055
public void config ( String format , Object ... args ) { if ( isLoggable ( CONFIG ) ) { logIt ( CONFIG , String . format ( format , args ) ) ; } }
Write to log at CONFIG level .
17,056
public void fine ( String format , Object ... args ) { if ( isLoggable ( FINE ) ) { logIt ( FINE , String . format ( format , args ) ) ; } }
Write to log at FINE level .
17,057
public void finer ( String format , Object ... args ) { if ( isLoggable ( FINER ) ) { logIt ( FINER , String . format ( format , args ) ) ; } }
Write to log at FINER level .
17,058
public void finest ( String format , Object ... args ) { if ( isLoggable ( FINEST ) ) { logIt ( FINEST , String . format ( format , args ) ) ; } }
Write to log at FINEST level .
17,059
public void verbose ( String format , Object ... args ) { if ( isLoggable ( VERBOSE ) ) { logIt ( VERBOSE , String . format ( format , args ) ) ; } }
Write to log at VERBOSE level .
17,060
public void debug ( String format , Object ... args ) { if ( isLoggable ( DEBUG ) ) { logIt ( DEBUG , String . format ( format , args ) ) ; } }
Write to log at DEBUG level .
17,061
public void log ( Level level , String format , Object ... args ) { if ( isLoggable ( level ) ) { if ( format != null ) { logIt ( level , String . format ( format , args ) ) ; } else { logIt ( level , String . format ( "%s format == null" , level ) ) ; } } }
Write to log
17,062
public JButton addButton ( String strParam ) { String strDesc = strParam ; BaseApplet applet = this . getBaseApplet ( ) ; if ( applet != null ) strDesc = applet . getString ( strParam ) ; return this . addButton ( strDesc , strParam ) ; }
Add a button to this window . Convert this param to the local string and call addButton .
17,063
public CounterMetadata getCounterMetadata ( String counterName ) { String jsonString = getRow ( counterName ) ; if ( jsonString != null ) { CounterMetadata result = CounterMetadata . fromJsonString ( jsonString ) ; if ( result != null ) { result . setName ( counterName ) ; } return result ; } else { return findCounterM...
Gets a counter metadata by name .
17,064
public static Date newRandomDate ( final Date from ) { final Random secrand = new SecureRandom ( ) ; final double randDouble = - secrand . nextDouble ( ) * from . getTime ( ) ; final double randomDouble = from . getTime ( ) - secrand . nextDouble ( ) ; final double result = randDouble * randomDouble ; return new Date (...
Creates the random date .
17,065
@ SuppressWarnings ( "unchecked" ) Class < ? > [ ] getAllInterfacesAndClasses ( Class < ? > [ ] classes ) { if ( 0 == classes . length ) { return classes ; } else { List < Class < ? > > extendedClasses = new ArrayList < Class < ? > > ( ) ; for ( Class < ? > clazz : classes ) { if ( clazz != null ) { Class < ? > [ ] int...
possibly contain the declaration of the annotated method we re looking for .
17,066
public static String driversLicense ( ) { StringBuffer dl = new StringBuffer ( JDefaultAddress . stateAbbr ( ) ) ; dl . append ( "-" ) ; dl . append ( JDefaultNumber . randomNumberString ( 8 ) ) ; return dl . toString ( ) ; }
Creates a Driver s license in the format of 2 Letter State Code Dash 8 Digit Random Number ie CO - 12345678
17,067
public void free ( ) { if ( m_messageReceiver != null ) m_messageReceiver . removeMessageFilter ( this , false ) ; m_messageReceiver = null ; while ( this . getMessageListener ( 0 ) != null ) { JMessageListener listener = this . getMessageListener ( 0 ) ; this . removeFilterMessageListener ( listener ) ; } if ( m_vList...
Free this object . If I belong to a message listener set my reference to null and free the listener . If I belong to a messagereceiver remove this filter from it .
17,068
public void setRemoteFilterInfo ( String strRemoteQueueName , String strRemoteQueueType , Integer intRemoteQueueID , Integer intRegistryID ) { m_strRemoteQueueName = strRemoteQueueName ; m_strRemoteQueueType = strRemoteQueueType ; m_intRemoteID = intRemoteQueueID ; m_intRegistryID = intRegistryID ; }
Set the links to the remote filter .
17,069
public void addMessageListener ( JMessageListener listener ) { if ( listener == null ) return ; this . removeDuplicateFilters ( listener ) ; if ( m_vListenerList == null ) m_vListenerList = new Vector < JMessageListener > ( ) ; for ( int i = 0 ; i < m_vListenerList . size ( ) ; i ++ ) { if ( m_vListenerList . get ( i )...
Add this message listener to the listener list . Also adds the filter to my filter list .
17,070
public void removeDuplicateFilters ( JMessageListener listenerToCheck ) { for ( int iIndex = 0 ; ; iIndex ++ ) { BaseMessageFilter filter = listenerToCheck . getListenerMessageFilter ( iIndex ) ; if ( filter == null ) break ; if ( this . isSameFilter ( filter ) ) { if ( filter . getMessageListener ( 1 ) == null ) { fil...
If there is another RecordMessageFilter supplying messages to this listener remove it . This typically fixes the problem in TableModelSession where a grid listener is added for the session and then also when thin needs a listener
17,071
public boolean isSameFilter ( BaseMessageFilter filter ) { if ( filter . getClass ( ) . equals ( this . getClass ( ) ) ) { if ( filter . isFilterMatch ( this ) ) ; } return false ; }
Are these filters functionally the same? Override this to compare filters .
17,072
public void removeFilterMessageListener ( JMessageListener listener ) { if ( listener == null ) return ; if ( m_vListenerList == null ) return ; for ( int i = 0 ; i < m_vListenerList . size ( ) ; i ++ ) { if ( m_vListenerList . get ( i ) == listener ) m_vListenerList . remove ( i ) ; } listener . removeListenerMessageF...
Set the message listener .
17,073
public JMessageListener getMessageListener ( int iIndex ) { if ( m_vListenerList == null ) return null ; if ( iIndex >= m_vListenerList . size ( ) ) return null ; return m_vListenerList . get ( iIndex ) ; }
Get the message listener for this filter .
17,074
public void setMessageReceiver ( BaseMessageReceiver messageReceiver , Integer intID ) { if ( ( messageReceiver != null ) || ( intID != null ) ) if ( ( m_intID != null ) || ( m_messageReceiver != null ) ) Util . getLogger ( ) . warning ( "BaseMessageFilter/setMessageReceiver()----Error - Filter added twice." ) ; m_mess...
Set the message receiver for this filter .
17,075
public final void updateFilterMap ( Map < String , Object > propFilter ) { if ( propFilter == null ) propFilter = new HashMap < String , Object > ( ) ; propFilter = this . handleUpdateFilterMap ( propFilter ) ; this . setFilterMap ( propFilter ) ; }
Update this object s filter with this new map information .
17,076
public final void setFilterMap ( Map < String , Object > propFilter ) { if ( this . getMessageReceiver ( ) != null ) this . getMessageReceiver ( ) . setNewFilterProperties ( this , null , propFilter ) ; }
Update the remote filter with this new map information .
17,077
public final void setFilterTree ( Object [ ] [ ] mxProperties ) { if ( this . getMessageReceiver ( ) != null ) this . getMessageReceiver ( ) . setNewFilterProperties ( this , mxProperties , null ) ; else this . setNameValueTree ( mxProperties ) ; }
Update this filter and the remote filter with this new key tree .
17,078
public < T > T getMeta ( String key , Class < T > type ) { return ConverterRegistry . getConverter ( ) . asObject ( getMeta ( key ) , type ) ; }
Get files archive meta data converted to requested type .
17,079
public < T > T getMeta ( String key , Class < T > type , T defaultValue ) { String value = manifest . getMainAttributes ( ) . getValue ( key ) ; return value == null ? defaultValue : ConverterRegistry . getConverter ( ) . asObject ( value , type ) ; }
Get files archive meta data converted to requested type or default value if meta data key is missing .
17,080
protected void addSizeGreaterThanOrEqualToCondition ( final String propertyName , final Integer size ) { final Expression < Integer > propertySizeExpression = getCriteriaBuilder ( ) . size ( getRootPath ( ) . get ( propertyName ) . as ( Set . class ) ) ; fieldConditions . add ( getCriteriaBuilder ( ) . ge ( propertySiz...
Add a Field Search Condition that will check if the size of a collection in an entity is greater than or equal to the specified size .
17,081
protected void addSizeGreaterThanCondition ( final String propertyName , final Integer size ) { final Expression < Integer > propertySizeExpression = getCriteriaBuilder ( ) . size ( getRootPath ( ) . get ( propertyName ) . as ( Set . class ) ) ; fieldConditions . add ( getCriteriaBuilder ( ) . gt ( propertySizeExpressi...
Add a Field Search Condition that will check if the size of a collection in an entity is greater than the specified size .
17,082
protected void addSizeLessThanOrEqualToCondition ( final String propertyName , final Integer size ) { final Expression < Integer > propertySizeExpression = getCriteriaBuilder ( ) . size ( getRootPath ( ) . get ( propertyName ) . as ( Set . class ) ) ; fieldConditions . add ( getCriteriaBuilder ( ) . le ( propertySizeEx...
Add a Field Search Condition that will check if the size of a collection in an entity is less than or equal to the specified size .
17,083
protected void addSizeLessThanCondition ( final String propertyName , final Integer size ) { final Expression < Integer > propertySizeExpression = getCriteriaBuilder ( ) . size ( getRootPath ( ) . get ( propertyName ) . as ( Set . class ) ) ; fieldConditions . add ( getCriteriaBuilder ( ) . lt ( propertySizeExpression ...
Add a Field Search Condition that will check if the size of a collection in an entity is less than the specified size .
17,084
public void free ( ) { int iOldEditMode = 0 ; if ( m_record != null ) { iOldEditMode = this . getRecord ( ) . getEditMode ( ) ; this . getRecord ( ) . setEditMode ( iOldEditMode | DBConstants . EDIT_CLOSE_IN_FREE ) ; } this . close ( ) ; if ( m_record != null ) this . getRecord ( ) . setEditMode ( iOldEditMode ) ; supe...
Free this table object . Don t call this directly freeing the record will free the table correctly . You never know another table may have been added to the table chain . First closes this table then removes me from the database .
17,085
public void addListener ( Record record , FileListener listener ) { record . doAddListener ( listener ) ; boolean bOldState = listener . setEnabledListener ( false ) ; BaseListener nextListener = listener . setNextListener ( null ) ; if ( record . getEditMode ( ) == Constants . EDIT_ADD ) { boolean [ ] rgbModified = th...
Adding a file listener to the chain . This just gives the table an ability to respond to listeners being added .
17,086
private BaseTable getPhysicalTable ( PassThruTable table , Record record ) { BaseTable altTable = table . getNextTable ( ) ; if ( altTable instanceof PassThruTable ) { BaseTable physicalTable = getPhysicalTable ( ( PassThruTable ) altTable , record ) ; if ( physicalTable != null ) if ( physicalTable != altTable ) retur...
Dig down and get the physical table for this record .
17,087
public boolean doHasPrevious ( ) { if ( ( m_iRecordStatus & DBConstants . RECORD_AT_BOF ) != 0 ) return false ; if ( ( m_iRecordStatus & DBConstants . RECORD_PREVIOUS_PENDING ) != 0 ) return true ; boolean bAtBOF = true ; try { FieldList record = this . move ( DBConstants . PREVIOUS_RECORD ) ; if ( record == null ) bAt...
Is the first record in the file?
17,088
public boolean isBOF ( ) { boolean bFlag = ( ( m_iRecordStatus & DBConstants . RECORD_AT_BOF ) != 0 ) ; if ( this . isTable ( ) ) { if ( bFlag ) return bFlag ; if ( this . getRecord ( ) . getKeyArea ( - 1 ) . isModified ( DBConstants . START_SELECT_KEY ) ) { if ( ! bFlag ) bFlag = this . getRecord ( ) . checkParams ( D...
Is the record at the Start of the file?
17,089
public boolean doHasNext ( ) throws DBException { if ( ( m_iRecordStatus & DBConstants . RECORD_AT_EOF ) != 0 ) return false ; if ( ( m_iRecordStatus & DBConstants . RECORD_NEXT_PENDING ) != 0 ) return true ; boolean bAtEOF = true ; if ( ! this . isOpen ( ) ) this . open ( ) ; Object [ ] rgobjEnabledFields = this . get...
Is the last record in the file?
17,090
public boolean isEOF ( ) { boolean bFlag = ( ( m_iRecordStatus & DBConstants . RECORD_AT_EOF ) != 0 ) ; if ( this . isTable ( ) ) { if ( bFlag ) return bFlag ; if ( this . getRecord ( ) . getKeyArea ( - 1 ) . isModified ( DBConstants . END_SELECT_KEY ) ) { if ( ! bFlag ) bFlag = this . getRecord ( ) . checkParams ( DBC...
Is the record at the End of the file?
17,091
public boolean unlockIfLocked ( Record record , Object bookmark ) throws DBException { if ( record != null ) { BaseApplication app = null ; org . jbundle . model . Task task = null ; if ( record . getRecordOwner ( ) != null ) task = record . getRecordOwner ( ) . getTask ( ) ; if ( task != null ) app = ( BaseApplication...
Unlock this record if it is locked .
17,092
public Map < String , Object > getProperties ( ) { if ( this . getRecord ( ) != null ) if ( ( ( this . getRecord ( ) . getDatabaseType ( ) & DBConstants . MAPPED ) != 0 ) || ( ( this . getRecord ( ) . getDatabaseType ( ) & DBConstants . REMOTE_MEMORY ) != 0 ) ) { if ( m_properties == null ) m_properties = new Hashtable...
Get this property for this table .
17,093
public ScreenComponent setupDefaultView ( ScreenLoc itsLocation , ComponentParent targetScreen , Convert converter , int iDisplayFieldDesc , Map < String , Object > properties ) { properties = new HashMap < String , Object > ( ) ; properties . put ( ScreenModel . COMMAND , MenuConstants . FORMLINK ) ; properties . put ...
Set up the default control for this field . A SCannedBox for a query bitmap converter .
17,094
public FilterChannel position ( long newPosition ) throws IOException { if ( ! isOpen ( ) ) { throw new ClosedChannelException ( ) ; } int skip = ( int ) ( newPosition - position ( ) ) ; if ( skip < 0 ) { throw new UnsupportedOperationException ( "backwards position not supported" ) ; } if ( skip > skipBuffer . capacit...
Changes unfiltered position . Only forward direction is allowed with small skips . This method is for alignment purposes mostly .
17,095
private String getURL ( String endpoint , int version , String method ) { StringBuilder sb = new StringBuilder ( ) ; sb . append ( endpoint ) ; if ( ! endpoint . endsWith ( FORWARD_SLASH ) ) { sb . append ( FORWARD_SLASH ) ; } sb . append ( VERSION_PREFIX + version + FORWARD_SLASH + method ) ; return sb . toString ( ) ...
Create the FigShare API URL using the endpoint version and API method .
17,096
public static FigShareClient to ( String endpoint , int version , String clientKey , String clientSecret , String tokenKey , String tokenSecret ) { return new FigShareClient ( endpoint , version , clientKey , clientSecret , tokenKey , tokenSecret ) ; }
Create a FigShareClient to interface to the FigShare API .
17,097
protected List < Article > readArticlesFromJson ( String json ) { Gson gson = new Gson ( ) ; JsonParser parser = new JsonParser ( ) ; JsonObject array = parser . parse ( json ) . getAsJsonObject ( ) ; JsonElement items = array . get ( "items" ) ; JsonArray itemsArray = items . getAsJsonArray ( ) ; List < Article > arti...
Get the articles objects from JSON .
17,098
public Article createArticle ( final String title , final String description , final String definedType ) { HttpClient httpClient = null ; try { final String method = "my_data/articles" ; final String url = getURL ( endpoint , version , method ) ; final HttpPost request = new HttpPost ( url ) ; Gson gson = new Gson ( )...
Create an article .
17,099
protected Article readArticleFromJson ( String json ) { Gson gson = new Gson ( ) ; Article article = gson . fromJson ( json , Article . class ) ; return article ; }
Get the article object from JSON .