idx int64 0 41.2k | question stringlengths 73 5.81k | target stringlengths 5 918 |
|---|---|---|
37,700 | private String optionListToHtml ( List < Options . OptionInfo > optList , int padding , int firstLinePadding , int refillWidth ) { StringJoiner b = new StringJoiner ( lineSep ) ; for ( Options . OptionInfo oi : optList ) { if ( oi . unpublicized ) { continue ; } StringBuilder bb = new StringBuilder ( ) ; String optHtml... | Get the HTML describing many options formatted as an HTML list . |
37,701 | public String optionToHtml ( Options . OptionInfo oi , int padding ) { StringBuilder b = new StringBuilder ( ) ; Formatter f = new Formatter ( b ) ; if ( oi . shortName != null ) { f . format ( "<b>-%s</b> " , oi . shortName ) ; } for ( String a : oi . aliases ) { f . format ( "<b>%s</b> " , a ) ; } String prefix = get... | Get the line of HTML describing one Option . |
37,702 | public void setFormatJavadoc ( boolean val ) { if ( val && ! formatJavadoc ) { startDelim = "* " + startDelim ; endDelim = "* " + endDelim ; } else if ( ! val && formatJavadoc ) { startDelim = StringUtils . removeStart ( "* " , startDelim ) ; endDelim = StringUtils . removeStart ( "* " , endDelim ) ; } this . formatJav... | Supply true to set the output format to Javadoc false to set the output format to HTML . |
37,703 | public synchronized void onLowMemory ( ) { try { this . mCachedTiles . clear ( ) ; } catch ( Exception e ) { log . log ( Level . SEVERE , "onLowMemory" , e ) ; } } | This method clears the memory cache |
37,704 | public TransportApiResult < Journey > getJourney ( String journeyId , String exclude ) { if ( Extensions . isNullOrWhiteSpace ( journeyId ) ) { throw new IllegalArgumentException ( "JourneyId is required." ) ; } return TransportApiClientCalls . getJourney ( tokenComponent , settings , journeyId , exclude ) ; } | Gets a journey previously requested through the POST journey call . |
37,705 | public TransportApiResult < Itinerary > getItinerary ( String journeyId , String itineraryId , String exclude ) { if ( Extensions . isNullOrWhiteSpace ( journeyId ) ) { throw new IllegalArgumentException ( "JourneyId is required." ) ; } if ( Extensions . isNullOrWhiteSpace ( itineraryId ) ) { throw new IllegalArgumentE... | Gets a specific itinerary of a journey previously requested through the POST journey call . |
37,706 | public TransportApiResult < List < Agency > > getAgencies ( AgencyQueryOptions options ) { if ( options == null ) { options = AgencyQueryOptions . defaultQueryOptions ( ) ; } return TransportApiClientCalls . getAgencies ( tokenComponent , settings , options , null , null , null ) ; } | Gets a list of all agencies in the system . |
37,707 | public TransportApiResult < List < Agency > > getAgenciesByBoundingBox ( AgencyQueryOptions options , String boundingBox ) { if ( options == null ) { options = AgencyQueryOptions . defaultQueryOptions ( ) ; } if ( boundingBox == null ) { throw new IllegalArgumentException ( "BoundingBox is required." ) ; } String [ ] b... | Gets a list of all agencies within a bounding box . |
37,708 | public TransportApiResult < Agency > getAgency ( String agencyId ) { if ( Extensions . isNullOrWhiteSpace ( agencyId ) ) { throw new IllegalArgumentException ( "AgencyId is required." ) ; } return TransportApiClientCalls . getAgency ( tokenComponent , settings , agencyId ) ; } | Gets a specific agency . |
37,709 | public TransportApiResult < List < Line > > getLines ( LineQueryOptions options ) { if ( options == null ) { options = LineQueryOptions . defaultQueryOptions ( ) ; } return TransportApiClientCalls . getLines ( tokenComponent , settings , options , null , null , null ) ; } | Gets a list of all lines in the system . |
37,710 | public TransportApiResult < List < Line > > getLinesNearby ( LineQueryOptions options , double latitude , double longitude , int radiusInMeters ) { if ( options == null ) { options = LineQueryOptions . defaultQueryOptions ( ) ; } if ( radiusInMeters < 0 ) { throw new IllegalArgumentException ( "Invalid limit. Valid val... | Gets a list of lines nearby ordered by distance from the point specified . |
37,711 | public TransportApiResult < List < Line > > getLinesByBoundingBox ( LineQueryOptions options , String boundingBox ) { if ( options == null ) { options = LineQueryOptions . defaultQueryOptions ( ) ; } if ( boundingBox == null ) { throw new IllegalArgumentException ( "BoundingBox is required." ) ; } String [ ] bbox = bou... | Gets a list of all lines within a bounding box . |
37,712 | public TransportApiResult < Line > getLine ( String lineId ) { if ( Extensions . isNullOrWhiteSpace ( lineId ) ) { throw new IllegalArgumentException ( "LineId is required." ) ; } return TransportApiClientCalls . getLine ( tokenComponent , settings , lineId ) ; } | Gets a specific line . |
37,713 | public TransportApiResult < List < LineTimetable > > getLineTimetable ( String lineId , LineTimetableQueryOptions options ) { if ( Extensions . isNullOrWhiteSpace ( lineId ) ) { throw new IllegalArgumentException ( "LineId is required." ) ; } if ( options == null ) { options = LineTimetableQueryOptions . defaultQueryOp... | Gets a timetable for a specific line . |
37,714 | public TransportApiResult < List < Stop > > getStops ( StopQueryOptions options ) { if ( options == null ) { options = StopQueryOptions . defaultQueryOptions ( ) ; } return TransportApiClientCalls . getStops ( tokenComponent , settings , options , null , null , null ) ; } | Gets a list of all stops in the system . |
37,715 | public TransportApiResult < List < Stop > > getStopsNearby ( StopQueryOptions options , double latitude , double longitude , int radiusInMeters ) { if ( options == null ) { options = StopQueryOptions . defaultQueryOptions ( ) ; } if ( radiusInMeters < 0 ) { throw new IllegalArgumentException ( "Invalid limit. Valid val... | Gets a list of stops nearby ordered by distance from the point specified . |
37,716 | public TransportApiResult < List < Stop > > getStopsByBoundingBox ( StopQueryOptions options , String boundingBox ) { if ( options == null ) { options = StopQueryOptions . defaultQueryOptions ( ) ; } if ( boundingBox == null ) { throw new IllegalArgumentException ( "BoundingBox is required." ) ; } String [ ] bbox = bou... | Gets a list of all stops within a bounding box . |
37,717 | public TransportApiResult < Stop > getStop ( String stopId ) { if ( Extensions . isNullOrWhiteSpace ( stopId ) ) { throw new IllegalArgumentException ( "StopId is required." ) ; } return TransportApiClientCalls . getStop ( tokenComponent , settings , stopId ) ; } | Gets a specific stop . |
37,718 | public TransportApiResult < List < StopTimetable > > getStopTimetable ( String stopId , StopTimetableQueryOptions options ) { if ( Extensions . isNullOrWhiteSpace ( stopId ) ) { throw new IllegalArgumentException ( "StopId is required." ) ; } if ( options == null ) { options = StopTimetableQueryOptions . defaultQueryOp... | Gets a timetable for a specific stop . |
37,719 | public TransportApiResult < List < FareProduct > > getFareProducts ( FareProductQueryOptions options ) { if ( options == null ) { options = FareProductQueryOptions . defaultQueryOptions ( ) ; } return TransportApiClientCalls . getFareProducts ( tokenComponent , settings , options ) ; } | Gets a list of all fare products in the system . |
37,720 | public TransportApiResult < FareProduct > getFareProduct ( String fareProductId ) { if ( Extensions . isNullOrWhiteSpace ( fareProductId ) ) { throw new IllegalArgumentException ( "FareProductId is required." ) ; } return TransportApiClientCalls . getFareProduct ( tokenComponent , settings , fareProductId ) ; } | Gets a specific fare product . |
37,721 | private static String getBookParam ( Map < String , String > bookParams , String paramName ) { String value = bookParams . get ( paramName ) ; if ( value != null && value . isEmpty ( ) ) value = null ; return value ; } | Gets a book parameter null if empty . |
37,722 | private static View findNewsView ( HtmlRenderer htmlRenderer ) throws ServletException { View view = htmlRenderer . getViewsByName ( ) . get ( NewsView . VIEW_NAME ) ; if ( view == null ) throw new ServletException ( "View not found: " + NewsView . VIEW_NAME ) ; return view ; } | Finds the news view . |
37,723 | public String getAvailableServices ( ) throws JsonGenerationException , JsonMappingException , IOException { DescribeServices services = serviceManager . getAvailableServices ( ) ; return services . asJSON ( ) ; } | Returns a JSON containing the describe service document of each service registered into the library |
37,724 | public String getPOIs ( String id , double lon , double lat , double distanceInMeters , List < Param > optionalParams ) throws Exception { DescribeService describeService = getDescribeServiceByID ( id ) ; double [ ] bbox = Calculator . boundingCoordinates ( lon , lat , distanceInMeters ) ; POIProxyEvent beforeEvent = n... | This method is used to get the pois from a service and return a GeoJSON document with the data retrieved given a longitude latitude and a radius in meters . |
37,725 | public String getPOIs ( String id , double minX , double minY , double maxX , double maxY , List < Param > optionalParams ) throws Exception { DescribeService describeService = getDescribeServiceByID ( id ) ; POIProxyEvent beforeEvent = new POIProxyEvent ( POIProxyEventEnum . BeforeBrowseExtent , describeService , new ... | This method is used to get the pois from a service and return a GeoJSON document with the data retrieved given a bounding box corners |
37,726 | public int getDistanceMeters ( Extent boundingBox ) { return new Double ( Math . floor ( Calculator . latLonDist ( boundingBox . getMinX ( ) , boundingBox . getMinY ( ) , boundingBox . getMaxX ( ) , boundingBox . getMaxY ( ) ) ) ) . intValue ( ) ; } | Utility method to get the distance from the bottom left corner of the bounding box to the upper right corner |
37,727 | private String getErrorForUnknownService ( String id ) { StringBuffer error = new StringBuffer ( ) ; error . append ( "Services path: " + ServiceConfigurationManager . CONFIGURATION_DIR ) ; error . append ( "The service with id: " + id + " is not registered" ) ; error . append ( "\n Available services are: " ) ; Set < ... | Exception text when a service requested is not registered into the library |
37,728 | public void register ( DescribeService service , String describeService ) throws POIProxyException { serviceManager . registerServiceConfiguration ( service . getId ( ) , describeService , service ) ; } | Interface for registering a new service in POIProxy |
37,729 | public JTSFeature parseFeature ( JSONObject feature ) throws JSONException { JTSFeature feat = new JTSFeature ( null ) ; JSONObject geometry = ( JSONObject ) feature . get ( "geometry" ) ; String geomType = geometry . get ( "type" ) . toString ( ) ; if ( geomType . compareTo ( "Point" ) == 0 ) { JSONArray coords = geom... | Parses a single feature with a Point |
37,730 | public synchronized Object put ( final String key , final Object value ) { try { if ( maxCacheSize == 0 ) { return null ; } if ( ! super . containsKey ( key ) && ! list . isEmpty ( ) && list . size ( ) + 1 > maxCacheSize ) { final Object deadKey = list . removeLast ( ) ; super . remove ( deadKey ) ; } updateKey ( key )... | Adds an Object to the cache . If the cache is full removes the last |
37,731 | public synchronized Object get ( final String key ) { try { final Object value = super . get ( key ) ; if ( value != null ) { updateKey ( key ) ; } return value ; } catch ( Exception e ) { log . log ( Level . SEVERE , "get" , e ) ; return null ; } } | Returns a cached Object given a key |
37,732 | public synchronized void remove ( final String key ) { try { list . remove ( key ) ; } catch ( Exception e ) { log . log ( Level . SEVERE , "remove" , e ) ; } super . remove ( key ) ; } | Removes a Object from the cache |
37,733 | public void setEscapeMode ( int escapeMode ) throws IllegalArgumentException { if ( escapeMode != ESCAPE_MODE_DOUBLED && escapeMode != ESCAPE_MODE_BACKSLASH ) { throw new IllegalArgumentException ( "Parameter escapeMode must be a valid value." ) ; } userSettings . EscapeMode = escapeMode ; } | Sets the current way to escape an occurance of the text qualifier inside qualified data . |
37,734 | public String [ ] getHeaders ( ) throws IOException { checkClosed ( ) ; if ( headersHolder . Headers == null ) { return null ; } else { String [ ] clone = new String [ headersHolder . Length ] ; System . arraycopy ( headersHolder . Headers , 0 , clone , 0 , headersHolder . Length ) ; return clone ; } } | Returns the header values as a string array . |
37,735 | public String get ( int columnIndex ) throws IOException { checkClosed ( ) ; if ( columnIndex > - 1 && columnIndex < columnsCount ) { return values [ columnIndex ] ; } else { return "" ; } } | Returns the current column value for a given column index . |
37,736 | public boolean readHeaders ( ) throws IOException { boolean result = readRecord ( ) ; headersHolder . Length = columnsCount ; headersHolder . Headers = new String [ columnsCount ] ; for ( int i = 0 ; i < headersHolder . Length ; i ++ ) { String columnValue = get ( i ) ; headersHolder . Headers [ i ] = columnValue ; hea... | Read the first record of data as column headers . |
37,737 | public String getHeader ( int columnIndex ) throws IOException { checkClosed ( ) ; if ( columnIndex > - 1 && columnIndex < headersHolder . Length ) { return headersHolder . Headers [ columnIndex ] ; } else { return "" ; } } | Returns the column header value for a given column index . |
37,738 | public int getIndex ( String headerName ) throws IOException { checkClosed ( ) ; Object indexValue = headersHolder . IndexByName . get ( headerName ) ; if ( indexValue != null ) { return ( ( Integer ) indexValue ) . intValue ( ) ; } else { return - 1 ; } } | Gets the corresponding column index for a given column header name . |
37,739 | public boolean skipLine ( ) throws IOException { checkClosed ( ) ; columnsCount = 0 ; boolean skippedLine = false ; if ( hasMoreData ) { boolean foundEol = false ; do { if ( dataBuffer . Position == dataBuffer . Count ) { checkDataLength ( ) ; } else { skippedLine = true ; char currentLetter = dataBuffer . Buffer [ dat... | Skips the next line of data using the standard end of line characters and does not do any column delimited parsing . |
37,740 | public double [ ] transform ( String from , String to , double [ ] xy ) { return GeotoolsUtils . transform ( from , to , xy ) ; } | Transform a pair of coordinates from a SRS to another expressed as EPSG codes |
37,741 | private static Map < Object , Object > getAllFieldsByClassIntern ( Class < ? > pvClass , Map < Object , Object > pvFieldsMap ) { putAllFieldsIntern ( pvClass . getFields ( ) , pvFieldsMap ) ; putAllFieldsIntern ( pvClass . getDeclaredFields ( ) , pvFieldsMap ) ; if ( ! ( pvClass . getSuperclass ( ) . equals ( Object . ... | Recursive search all methods from the Class in the Class Hierarchy to Object class . |
37,742 | public Object copy ( final Object pvRootObject ) { Object lvSimple = makeSimple ( pvRootObject ) ; Object lvComplex = makeComplex ( lvSimple ) ; return lvComplex ; } | Copy of all values of the root object . |
37,743 | public CompareResult compare ( final Object pvObject1 , final Object pvObject2 ) { CompareResult [ ] lvCompareResults = null ; lvCompareResults = compareIntern ( pvObject1 , pvObject2 , true ) ; CompareResult lvResult = ( lvCompareResults == null ? null : lvCompareResults [ 0 ] ) ; return lvResult ; } | Compare and is stopped by find the first different value . |
37,744 | public < T extends Object > T findById ( Object id , Class < T > clazz ) { Preconditions . checkNotNull ( clazz , "Tryed to find an object by id, but given class is null" ) ; Preconditions . checkNotNull ( id , "Tryed to find an object by id, but given id is null" ) ; return this . datastore . get ( clazz , ( id instan... | Retrieves a mapped Morphia object from MongoDB . If the id is not of type ObjectId it will be converted to ObjectId |
37,745 | public < T extends Object > List < T > findAll ( Class < T > clazz ) { Preconditions . checkNotNull ( clazz , "Tryed to get all morphia objects of a given object, but given object is null" ) ; return this . datastore . find ( clazz ) . asList ( ) ; } | Retrieves a list of mapped Morphia objects from MongoDB |
37,746 | public < T extends Object > long countAll ( Class < T > clazz ) { Preconditions . checkNotNull ( clazz , "Tryed to count all a morphia objects of a given object, but given object is null" ) ; return this . datastore . find ( clazz ) . count ( ) ; } | Counts all objected of a mapped Morphia class |
37,747 | public < T extends Object > void deleteAll ( Class < T > clazz ) { Preconditions . checkNotNull ( clazz , "Tryed to delete list of mapped morphia objects, but given class is null" ) ; this . datastore . delete ( this . datastore . createQuery ( clazz ) ) ; } | Deletes all mapped Morphia objects of a given class |
37,748 | public static Map < Object , Object > getAllNotEqualsGetterAndSetterAndRemoveThisProperties ( Map < Object , Object > pvGetterMap , Map < Object , Object > pvSetterMap ) { Map < Object , Object > lvMap = new TreeMap < Object , Object > ( ) ; Iterator < Object > it = new ArrayList < Object > ( pvGetterMap . keySet ( ) )... | Remove all getter - method where no setter - method exist . If more setter - method as getter - method they wasn t removed . |
37,749 | public static Map < Object , Object > getAllGetterMethodWithCache ( Class < ? > pvClass , String pvFilter [ ] ) { Map < Object , Object > lvGetterMap = classPropertiesCacheGetter . getClassPropertiesMapByClass ( pvClass ) ; if ( lvGetterMap == null ) { lvGetterMap = getAllGetterMethod ( pvClass ) ; Map < Object , Objec... | Find all getter - method from a Class and remove all getter - method where no setter - method exist . |
37,750 | public static Map < Object , Object > getAllSetterMethodWithCache ( Class < ? > pvClass , String pvFilter [ ] ) { Map < Object , Object > lvMap = classPropertiesCacheSetter . getClassPropertiesMapByClass ( pvClass ) ; if ( lvMap == null ) { lvMap = getAllSetterMethod ( pvClass ) ; classPropertiesCacheSetter . addClassP... | Find all setter - method from a Class . |
37,751 | private static Collection < Method > getAllMethodsByClassIntern ( Class < ? > pvClass , Set < Method > pvMethodsMap ) { putAllMethodsIntern ( pvClass . getMethods ( ) , pvMethodsMap ) ; putAllMethodsIntern ( pvClass . getDeclaredMethods ( ) , pvMethodsMap ) ; if ( ! ( pvClass . getSuperclass ( ) . equals ( Object . cla... | Recursive search all method from the Class in the Class Hierarchy to Object . class . |
37,752 | public String getColumnNames ( ) { StringBuffer sb = new StringBuffer ( ) ; int lvSize = columnNames . size ( ) ; for ( int i = 0 ; i < lvSize ; i ++ ) { sb . append ( columnNames . get ( i ) ) ; if ( i < ( lvSize - 1 ) ) { sb . append ( getDelimiter ( ) ) ; } } return sb . toString ( ) ; } | Get all column - names as String separated with a selected delimiter . |
37,753 | public String row2String ( int pvRow ) { StringBuffer sb = new StringBuffer ( ) ; List < ? > lvColumn = rows . get ( pvRow ) ; int lvSize = lvColumn . size ( ) ; for ( int i = 0 ; i < lvSize ; i ++ ) { sb . append ( lvColumn . get ( i ) ) ; if ( i < ( lvSize - 1 ) ) { sb . append ( getDelimiter ( ) ) ; } } return sb . ... | Convert a row of the table in a String where the every column is seperated with a delimiter . |
37,754 | public void executeSetValue ( Object pvObject , Object pvArgs ) throws IllegalArgumentException , IllegalAccessException , InvocationTargetException { AccessController . doPrivileged ( new AccessiblePrivilegedAction ( accessibleObject ) ) ; if ( propertyType == PROPERTY_TYPE_METHOD ) { ( ( Method ) accessibleObject ) .... | Call the setter Method or set value from Field . |
37,755 | public Object executeGetValue ( Object pvObject ) throws IllegalArgumentException , IllegalAccessException , InvocationTargetException { Object lvReturnValue = null ; AccessController . doPrivileged ( new AccessiblePrivilegedAction ( accessibleObject ) ) ; if ( propertyType == PROPERTY_TYPE_METHOD ) { lvReturnValue = (... | Call the getter Method or get value from Field . |
37,756 | public static boolean isPropertyToFiltering ( ClassPropertyFilterHandler pvClassPropertyFilterHandler , Class < ? > pvClassForFindFilter , Object pvKey ) { boolean lvAddProperty = false ; if ( pvClassPropertyFilterHandler != null ) { ClassPropertyFilter lvClassPropertyFilter = pvClassPropertyFilterHandler . getClassPro... | Check a property from a class by a handler . |
37,757 | private ConversionContext fireBeforeConvertRecursion ( int pvNumberOfIteration , Object pvKey , Object pvValue ) { ConversionContext lvContext = new ConversionContext ( pvNumberOfIteration , pvKey , pvValue ) ; getConverterInterceptorHandler ( ) . fireBeforeConvertRecursion ( lvContext ) ; return lvContext ; } | Create a new ConversionContext and fire before convert recursion event . |
37,758 | private ConversionContext fireAfterConvertRecursion ( final ConversionContext pvContext , Object pvKey , Object pvValue ) { pvContext . key = pvKey ; pvContext . value = pvValue ; getConverterInterceptorHandler ( ) . fireAfterConvertRecursion ( pvContext ) ; return pvContext ; } | Get a ConversionContext and fire after convert recursion event . |
37,759 | public void setUrls ( String [ ] urls ) { if ( urls == null ) { this . urls = null ; } else { this . urls = new String [ urls . length ] ; System . arraycopy ( urls , 0 , this . urls , 0 , urls . length ) ; } } | Default scope for test access . |
37,760 | public boolean exist ( String name , boolean bankAccount ) { String newName = name ; if ( ! Common . getInstance ( ) . getMainConfig ( ) . getBoolean ( "System.Case-sentitive" ) ) { newName = name . toLowerCase ( ) ; } boolean result ; if ( bankAccount ) { result = bankList . containsKey ( newName ) ; if ( ! result ) {... | Check if a account exist in the database . |
37,761 | public boolean delete ( String name , boolean bankAccount ) { boolean result = false ; if ( exist ( name , bankAccount ) ) { result = Common . getInstance ( ) . getStorageHandler ( ) . getStorageEngine ( ) . deleteAccount ( name , bankAccount ) ; if ( bankAccount ) { bankList . remove ( name ) ; } else { accountList . ... | Delete a account from the system |
37,762 | public List < String > getAllAccounts ( boolean bank ) { return Common . getInstance ( ) . getStorageHandler ( ) . getStorageEngine ( ) . getAllAccounts ( bank ) ; } | Retrieve a list of all the accounts |
37,763 | private boolean loadFile ( ) { boolean result = false ; File dbFile = new File ( Common . getInstance ( ) . getServerCaller ( ) . getDataFolder ( ) , getDbConnectInfo ( ) . get ( "filename" ) ) ; if ( dbFile . exists ( ) ) { try { flatFileReader = new BufferedReader ( new FileReader ( dbFile ) ) ; result = true ; } cat... | Allow to load a flatfile database . |
37,764 | private void loadMySQL ( ) { try { HikariConfig config = new HikariConfig ( ) ; config . setMaximumPoolSize ( 10 ) ; config . setDataSourceClassName ( "com.mysql.jdbc.jdbc2.optional.MysqlDataSource" ) ; config . addDataSourceProperty ( "serverName" , getDbConnectInfo ( ) . get ( "address" ) ) ; config . addDataSourcePr... | Allow to load a MySQL database . |
37,765 | private boolean importFlatFile ( String sender ) { boolean result = false ; try { List < String > file = new ArrayList < > ( ) ; String str ; while ( ( str = flatFileReader . readLine ( ) ) != null ) { file . add ( str ) ; } flatFileReader . close ( ) ; List < User > userList = new ArrayList < > ( ) ; for ( String aFil... | Import accounts from a flatfile . |
37,766 | public void playerJoinEvent ( PlayerJoinEvent event ) { if ( Common . getInstance ( ) . getMainConfig ( ) . getBoolean ( "System.CheckNewVersion" ) && Common . getInstance ( ) . getServerCaller ( ) . getPlayerCaller ( ) . isOp ( event . getP ( ) . getName ( ) ) && Common . getInstance ( ) . getVersionChecker ( ) . getR... | Event handler for when a player is connecting to the server . |
37,767 | public void addWorldToGroup ( String groupName , String world ) { if ( ! groupName . equalsIgnoreCase ( DEFAULT_GROUP_NAME ) ) { if ( list . containsKey ( groupName ) ) { list . get ( groupName ) . addWorld ( world ) ; } else { WorldGroup group = new WorldGroup ( groupName ) ; group . addWorld ( world ) ; } } } | Add a world to a group |
37,768 | public String getWorldGroupName ( String world ) { String result = DEFAULT_GROUP_NAME ; for ( Entry < String , WorldGroup > entry : list . entrySet ( ) ) { if ( entry . getValue ( ) . worldExist ( world ) ) { result = entry . getKey ( ) ; } } return result ; } | Retrieve the name of the worldgroup a world belongs to |
37,769 | public void removeWorldFromGroup ( String world ) { String groupName = getWorldGroupName ( world ) ; if ( ! groupName . equals ( DEFAULT_GROUP_NAME ) ) { list . get ( groupName ) . removeWorld ( world ) ; } } | Remove a world from a worldgroup |
37,770 | public void removeGroup ( String group ) { if ( worldGroupExist ( group ) ) { Common . getInstance ( ) . getStorageHandler ( ) . getStorageEngine ( ) . removeWorldGroup ( group ) ; list . remove ( group ) ; } } | Remove a world group . Reverting all the world into this group to the default one . |
37,771 | public void addWorldGroup ( String name ) { if ( ! worldGroupExist ( name ) ) { list . put ( name , new WorldGroup ( name ) ) ; } } | Create a world group |
37,772 | public void onDisable ( ) { if ( getStorageHandler ( ) != null ) { getLogger ( ) . info ( getLanguageManager ( ) . getString ( "closing_db_link" ) ) ; getStorageHandler ( ) . disable ( ) ; } accountManager = null ; config = null ; currencyManager = null ; storageHandler = null ; eventManager = null ; languageManager = ... | Disable the plugin . |
37,773 | public void reloadPlugin ( ) { sendConsoleMessage ( Level . INFO , "Starting up!" ) ; sendConsoleMessage ( Level . INFO , "Loading the Configuration" ) ; config = new ConfigurationManager ( serverCaller ) ; mainConfig = config . loadFile ( serverCaller . getDataFolder ( ) , "config.yml" ) ; if ( ! mainConfig . has ( "S... | Reload the plugin . |
37,774 | public void sendConsoleMessage ( Level level , String msg ) { if ( ! ( getServerCaller ( ) instanceof UnitTestServerCaller ) ) { getLogger ( ) . log ( level , msg ) ; } } | Sends a message to the console through the Logge . r |
37,775 | public String format ( String worldName , Currency currency , double balance , DisplayFormat format ) { StringBuilder string = new StringBuilder ( ) ; if ( worldName != null && ! worldName . equals ( WorldGroupsManager . DEFAULT_GROUP_NAME ) ) { string . append ( worldName ) . append ( ": " ) ; } if ( currency != null ... | Format a balance to a readable string . |
37,776 | public String format ( String worldName , Currency currency , double balance ) { return format ( worldName , currency , balance , displayFormat ) ; } | Format a balance to a readable string with the default formatting . |
37,777 | public void initialiseDatabase ( ) { if ( ! databaseInitialized ) { sendConsoleMessage ( Level . INFO , getLanguageManager ( ) . getString ( "loading_database_manager" ) ) ; storageHandler = new StorageHandler ( ) ; if ( getMainConfig ( ) . getBoolean ( "System.Database.ConvertFromH2" ) ) { convertDatabase ( ) ; } data... | Initialize the database Manager |
37,778 | private void convertDatabase ( ) { sendConsoleMessage ( Level . INFO , getLanguageManager ( ) . getString ( "starting_database_convert" ) ) ; new H2ToMySQLConverter ( ) . run ( ) ; sendConsoleMessage ( Level . INFO , getLanguageManager ( ) . getString ( "convert_done" ) ) ; getMainConfig ( ) . setValue ( "System.Databa... | Convert from SQLite to MySQL |
37,779 | public void addMetricsGraph ( String title , String value ) { if ( metrics != null ) { Metrics . Graph graph = metrics . createGraph ( title ) ; graph . addPlotter ( new Metrics . Plotter ( value ) { public int getValue ( ) { return 1 ; } } ) ; } } | Add a graph to Metrics |
37,780 | public void writeLog ( LogInfo info , Cause cause , String causeReason , Account account , double amount , Currency currency , String worldName ) { if ( getMainConfig ( ) . getBoolean ( "System.Logging.Enabled" ) ) { getStorageHandler ( ) . getStorageEngine ( ) . saveLog ( info , cause , causeReason , account , amount ... | Write a transaction to the Log . |
37,781 | public void loadDefaultSettings ( ) { String value = getStorageHandler ( ) . getStorageEngine ( ) . getConfigEntry ( "longmode" ) ; if ( value != null ) { displayFormat = DisplayFormat . valueOf ( value . toUpperCase ( ) ) ; } else { getStorageHandler ( ) . getStorageEngine ( ) . setConfigEntry ( "longmode" , "long" ) ... | Reload the default settings . |
37,782 | public void setDefaultHoldings ( double value ) { getStorageHandler ( ) . getStorageEngine ( ) . setConfigEntry ( "holdings" , String . valueOf ( value ) ) ; holdings = value ; } | Set the default amount of money a account will have |
37,783 | public void setBankPrice ( double value ) { getStorageHandler ( ) . getStorageEngine ( ) . setConfigEntry ( "bankprice" , String . valueOf ( value ) ) ; bankPrice = value ; } | Set the bank account creation price |
37,784 | private void quickSetup ( ) { initialiseDatabase ( ) ; Common . getInstance ( ) . initializeCurrency ( ) ; Currency currency = Common . getInstance ( ) . getCurrencyManager ( ) . addCurrency ( getMainConfig ( ) . getString ( "System.QuickSetup.Currency.Name" ) , getMainConfig ( ) . getString ( "System.QuickSetup.Curren... | Perform a quick setup |
37,785 | private void updateDatabase ( ) { if ( getMainConfig ( ) . getInt ( "Database.dbVersion" ) == 0 ) { alertOldDbVersion ( 0 , 1 ) ; String value = getStorageHandler ( ) . getStorageEngine ( ) . getConfigEntry ( "dbVersion" ) ; if ( value != null ) { try { new OldFormatConverter ( ) . run ( ) ; getMainConfig ( ) . setValu... | Run a database update . |
37,786 | private void alertOldDbVersion ( int currentVersion , int newVersion ) { Common . getInstance ( ) . sendConsoleMessage ( Level . INFO , "Your database is out of date! (Version " + currentVersion + "). Updating it to Revision " + newVersion + "." ) ; } | Alert in the console of a database update . |
37,787 | public boolean canDeposit ( String name ) { if ( getParent ( ) . ignoreACL ( ) ) { return true ; } String newName = name . toLowerCase ( ) ; boolean result = false ; if ( aclList . containsKey ( newName ) ) { result = aclList . get ( newName ) . canDeposit ( ) ; } return result ; } | Checks if a player can deposit money |
37,788 | public boolean canAcl ( String name ) { if ( getParent ( ) . ignoreACL ( ) ) { return false ; } String newName = name . toLowerCase ( ) ; boolean result = false ; if ( aclList . containsKey ( newName ) ) { result = aclList . get ( newName ) . canAcl ( ) ; } return result ; } | Checks if a player can modify the ACL |
37,789 | public void setDeposit ( String name , boolean deposit ) { String newName = name . toLowerCase ( ) ; if ( aclList . containsKey ( newName ) ) { AccountACLValue value = aclList . get ( newName ) ; set ( newName , deposit , value . canWithdraw ( ) , value . canAcl ( ) , value . canBalance ( ) , value . isOwner ( ) ) ; } ... | Set if a player can deposit money in the account |
37,790 | public void setWithdraw ( String name , boolean withdraw ) { String newName = name . toLowerCase ( ) ; if ( aclList . containsKey ( name ) ) { AccountACLValue value = aclList . get ( newName ) ; set ( newName , value . canDeposit ( ) , withdraw , value . canAcl ( ) , value . canBalance ( ) , value . isOwner ( ) ) ; } e... | Set if a player can withdraw money in the account |
37,791 | public void setAcl ( String name , boolean acl ) { String newName = name . toLowerCase ( ) ; if ( aclList . containsKey ( newName ) ) { AccountACLValue value = aclList . get ( newName ) ; set ( newName , value . canDeposit ( ) , value . canWithdraw ( ) , acl , value . canBalance ( ) , value . isOwner ( ) ) ; } else { s... | Set if a player can modify the ACL list |
37,792 | public void setShow ( String name , boolean show ) { String newName = name . toLowerCase ( ) ; if ( aclList . containsKey ( newName ) ) { AccountACLValue value = aclList . get ( newName ) ; set ( newName , value . canDeposit ( ) , value . canWithdraw ( ) , value . canAcl ( ) , show , value . isOwner ( ) ) ; } else { se... | Set if a player can show the bank balance . |
37,793 | public void set ( String name , boolean deposit , boolean withdraw , boolean acl , boolean show , boolean owner ) { String newName = name . toLowerCase ( ) ; aclList . put ( name , Common . getInstance ( ) . getStorageHandler ( ) . getStorageEngine ( ) . saveACL ( account , newName , deposit , withdraw , acl , show , o... | Set a player in the ACL list |
37,794 | public boolean isOwner ( String name ) { boolean result = false ; if ( aclList . containsKey ( name ) ) { result = aclList . get ( name ) . isOwner ( ) ; } return result ; } | Checks if the player is the bank owner . This is not affected by the ACL ignore . |
37,795 | public Currency getCurrency ( String name ) { Currency result ; if ( ! currencyList . containsKey ( name ) ) { result = Common . getInstance ( ) . getStorageHandler ( ) . getStorageEngine ( ) . getCurrency ( name ) ; if ( result != null ) { currencyList . put ( result . getName ( ) , result ) ; } } else { result = curr... | Get a currency |
37,796 | public void setDefault ( Currency currency ) { if ( currencyList . containsKey ( currency . getName ( ) ) ) { Common . getInstance ( ) . getStorageHandler ( ) . getStorageEngine ( ) . setDefaultCurrency ( currency ) ; defaultCurrency = currency ; currency . setDefault ( true ) ; for ( Map . Entry < String , Currency > ... | Set a currency as the default one . |
37,797 | public void deleteCurrency ( Currency currency ) { if ( currencyList . containsKey ( currency . getName ( ) ) ) { Common . getInstance ( ) . getStorageHandler ( ) . getStorageEngine ( ) . deleteCurrency ( currency ) ; currencyList . remove ( currency . getName ( ) ) ; } } | Delete a currency . |
37,798 | public double getBalance ( String world , String currencyName ) { double balance = Double . MIN_NORMAL ; if ( ! Common . getInstance ( ) . getWorldGroupManager ( ) . worldGroupExist ( world ) ) { world = Common . getInstance ( ) . getWorldGroupManager ( ) . getWorldGroupName ( world ) ; } Currency currency = Common . g... | Get s the player balance . Sends double . MIN_NORMAL in case of a error |
37,799 | public double withdraw ( double amount , String world , String currencyName , Cause cause , String causeReason ) { BalanceTable balanceTable ; double result = getBalance ( world , currencyName ) - format ( amount ) ; if ( ! Common . getInstance ( ) . getWorldGroupManager ( ) . worldGroupExist ( world ) ) { world = Comm... | withdraw a certain amount of money in the account |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.