idx int64 0 41.2k | question stringlengths 83 4.15k | target stringlengths 5 715 |
|---|---|---|
19,000 | public static JinxConstants . GroupPrivacy privacyIdToGroupPrivacyEnum ( Integer id ) { if ( id == null ) { return null ; } JinxConstants . GroupPrivacy privacy ; switch ( id ) { case 1 : privacy = JinxConstants . GroupPrivacy . group_private ; break ; case 2 : privacy = JinxConstants . GroupPrivacy . group_invite_only_public ; break ; case 3 : privacy = JinxConstants . GroupPrivacy . group_open_public ; break ; default : privacy = null ; break ; } return privacy ; } | Convert a Flickr group privacy numeric identifier to the corresponding GroupPrivacy enum value . |
19,001 | public static Integer suggestionStatusToFlickrSuggestionStatusId ( JinxConstants . SuggestionStatus status ) { if ( status == null ) { return null ; } Integer id ; switch ( status ) { case pending : id = 0 ; break ; case approved : id = 1 ; break ; case rejected : id = 2 ; break ; default : id = null ; break ; } return id ; } | Convert a suggestion status to the corresponding Flickr suggestion status id . |
19,002 | public static JinxConstants . SuggestionStatus suggestionStatusIdToSuggestionStatusEnum ( Integer id ) { if ( id == null ) { return null ; } JinxConstants . SuggestionStatus status ; switch ( id ) { case 0 : status = JinxConstants . SuggestionStatus . pending ; break ; case 1 : status = JinxConstants . SuggestionStatus . approved ; break ; case 2 : status = JinxConstants . SuggestionStatus . rejected ; break ; default : status = null ; break ; } return status ; } | Convert a Flickr suggestion status id to the corresponding SuggestionStatus value . |
19,003 | public PhotosetInfo getInfo ( String photosetId ) throws JinxException { JinxUtils . validateParams ( photosetId ) ; Map < String , String > params = new TreeMap < > ( ) ; params . put ( "method" , "flickr.photosets.getInfo" ) ; params . put ( "photoset_id" , photosetId ) ; return jinx . flickrGet ( params , PhotosetInfo . class ) ; } | Gets information about a photoset . This method does not require authentication . |
19,004 | public Domains getCollectionDomains ( Date date , String collectionId , Integer perPage , Integer page ) throws JinxException { JinxUtils . validateParams ( date ) ; Map < String , String > params = new TreeMap < > ( ) ; params . put ( "method" , "flickr.stats.getCollectionDomains" ) ; params . put ( "date" , JinxUtils . formatDateAsYMD ( date ) ) ; if ( ! JinxUtils . isNullOrEmpty ( collectionId ) ) { params . put ( "collection_id" , collectionId ) ; } if ( perPage != null ) { params . put ( "per_page" , perPage . toString ( ) ) ; } if ( page != null ) { params . put ( "page" , page . toString ( ) ) ; } return jinx . flickrGet ( params , Domains . class ) ; } | Get a list of referring domains for a collection |
19,005 | public Stats getPhotosetStats ( Date date , String photosetId ) throws JinxException { JinxUtils . validateParams ( date , photosetId ) ; Map < String , String > params = new TreeMap < > ( ) ; params . put ( "method" , "flickr.stats.getPhotosetStats" ) ; params . put ( "date" , JinxUtils . formatDateAsYMD ( date ) ) ; params . put ( "photoset_id" , photosetId ) ; return jinx . flickrGet ( params , Stats . class ) ; } | Get the number of views on a photoset for a given date . |
19,006 | public Photos getPopularPhotos ( Date date , JinxConstants . PopularPhotoSort sort , Integer perPage , Integer page ) throws JinxException { Map < String , String > params = new TreeMap < > ( ) ; params . put ( "method" , "flickr.stats.getPopularPhotos" ) ; if ( date != null ) { params . put ( "date" , JinxUtils . formatDateAsYMD ( date ) ) ; } if ( sort != null ) { params . put ( "sort" , sort . toString ( ) ) ; } if ( perPage != null ) { params . put ( "per_page" , perPage . toString ( ) ) ; } if ( page != null ) { params . put ( "page" , page . toString ( ) ) ; } return jinx . flickrGet ( params , Photos . class ) ; } | List the photos with the most views comments or favorites |
19,007 | public GroupUrls getGroup ( String groupId ) throws JinxException { JinxUtils . validateParams ( groupId ) ; Map < String , String > params = new TreeMap < > ( ) ; params . put ( "method" , "flickr.urls.getGroup" ) ; params . put ( "group_id" , groupId ) ; return jinx . flickrGet ( params , GroupUrls . class , false ) ; } | Returns the url to a group s page . |
19,008 | public UserUrls getUserPhotos ( String userId ) throws JinxException { Map < String , String > params = new TreeMap < > ( ) ; params . put ( "method" , "flickr.urls.getUserPhotos" ) ; if ( ! JinxUtils . isNullOrEmpty ( userId ) ) { params . put ( "user_id" , userId ) ; } return jinx . flickrGet ( params , UserUrls . class ) ; } | Returns the url to a user s photos . |
19,009 | public GalleryInfo lookupGallery ( String url ) throws JinxException { JinxUtils . validateParams ( url ) ; Map < String , String > params = new TreeMap < > ( ) ; params . put ( "method" , "flickr.urls.lookupGallery" ) ; params . put ( "url" , url ) ; return jinx . flickrGet ( params , GalleryInfo . class ) ; } | Returns gallery info by url . |
19,010 | public GroupUrls lookupGroup ( String url ) throws JinxException { JinxUtils . validateParams ( url ) ; Map < String , String > params = new TreeMap < > ( ) ; params . put ( "method" , "flickr.urls.lookupGroup" ) ; params . put ( "url" , url ) ; return jinx . flickrGet ( params , GroupUrls . class , false ) ; } | Returns a group NSID given the url to a group s page or photo pool . |
19,011 | public UserUrls lookupUser ( String url ) throws JinxException { JinxUtils . validateParams ( url ) ; Map < String , String > params = new TreeMap < > ( ) ; params . put ( "method" , "flickr.urls.lookupUser" ) ; params . put ( "url" , url ) ; return jinx . flickrGet ( params , UserUrls . class ) ; } | Returns a user NSID given the url to a user s photos or profile . |
19,012 | public synchronized void storeToXML ( OutputStream os , String comment ) throws IOException { if ( os == null ) throw new NullPointerException ( ) ; storeToXML ( os , comment , "UTF-8" ) ; } | Emits an XML document representing all of the properties contained in this table . |
19,013 | public void list ( PrintStream out ) { out . println ( "-- listing properties --" ) ; Hashtable h = new Hashtable ( ) ; enumerate ( h ) ; for ( Enumeration e = h . keys ( ) ; e . hasMoreElements ( ) ; ) { String key = ( String ) e . nextElement ( ) ; String val = ( String ) h . get ( key ) ; if ( val . length ( ) > 40 ) { val = val . substring ( 0 , 37 ) + "..." ; } out . println ( key + "=" + val ) ; } } | Prints this property list out to the specified output stream . This method is useful for debugging . |
19,014 | public Response browse ( String categoryId ) throws JinxException { Map < String , String > params = new TreeMap < > ( ) ; params . put ( "method" , "flickr.groups.browse" ) ; return jinx . flickrGet ( params , Response . class ) ; } | This is a legacy method and will not return anything useful . |
19,015 | public void setoAuthAccessToken ( OAuthAccessToken oAuthAccessToken ) { this . oAuthAccessToken = oAuthAccessToken ; this . accessToken = new Token ( oAuthAccessToken . getOauthToken ( ) , oAuthAccessToken . getOauthTokenSecret ( ) ) ; } | Set the oauth access token . |
19,016 | public static void setDecodeHintAllowedLengths ( Intent intent , int [ ] lengths ) { intent . putExtra ( DecodeHintType . ALLOWED_LENGTHS . name ( ) , lengths ) ; } | Set allowed lengths of encoded data . |
19,017 | public PlaceInfo getInfo ( String placeId , String woeId ) throws JinxException { if ( JinxUtils . isNullOrEmpty ( placeId ) ) { JinxUtils . validateParams ( woeId ) ; } Map < String , String > params = new TreeMap < > ( ) ; params . put ( "method" , "flickr.places.getInfo" ) ; if ( JinxUtils . isNullOrEmpty ( placeId ) ) { params . put ( "woe_id" , woeId ) ; } else { params . put ( "place_id" , placeId ) ; } return jinx . flickrGet ( params , PlaceInfo . class , false ) ; } | Get information about a place . Authentication This method does not require authentication . You must provide a valid placesId or woeId . If you provide both the placesId will be used . |
19,018 | public Places getPlacesForBoundingBox ( String boundingBox , JinxConstants . PlaceTypeId placeTypeId ) throws JinxException { JinxUtils . validateParams ( boundingBox , placeTypeId ) ; Map < String , String > params = new TreeMap < > ( ) ; params . put ( "method" , "flickr.places.placesForBoundingBox" ) ; params . put ( "bbox" , boundingBox ) ; params . put ( "place_type_id" , placeTypeId . getTypeId ( ) . toString ( ) ) ; return jinx . flickrGet ( params , Places . class , false ) ; } | Return all the locations of a matching place type for a bounding box . |
19,019 | public Places getPlacesForContacts ( JinxConstants . PlaceTypeId placeTypeId , String placeId , String woeId , Integer threshold , JinxConstants . Contacts contacts , Date minimumUploadDate , Date maximumUploadDate , Date minimumTakenDate , Date maximumTakenDate ) throws JinxException { JinxUtils . validateParams ( placeTypeId ) ; if ( JinxUtils . isNullOrEmpty ( placeId ) ) { JinxUtils . validateParams ( woeId ) ; } Map < String , String > params = new TreeMap < > ( ) ; params . put ( "method" , "flickr.places.placesForContacts" ) ; params . put ( "place_type_id" , placeTypeId . getTypeId ( ) . toString ( ) ) ; if ( JinxUtils . isNullOrEmpty ( placeId ) ) { params . put ( "woe_id" , woeId ) ; } else { params . put ( "place_id" , placeId ) ; } if ( threshold != null ) { params . put ( "threshold" , threshold . toString ( ) ) ; } if ( contacts != null ) { params . put ( "contacts" , contacts . toString ( ) ) ; } if ( minimumUploadDate != null ) { params . put ( "min_upload_date" , JinxUtils . formatDateAsUnixTimestamp ( minimumUploadDate ) ) ; } if ( maximumUploadDate != null ) { params . put ( "max_upload_date" , JinxUtils . formatDateAsUnixTimestamp ( maximumUploadDate ) ) ; } if ( minimumTakenDate != null ) { params . put ( "min_taken_date" , JinxUtils . formatDateAsMySqlTimestamp ( minimumTakenDate ) ) ; } if ( maximumTakenDate != null ) { params . put ( "max_taken_date" , JinxUtils . formatDateAsMySqlTimestamp ( maximumTakenDate ) ) ; } return jinx . flickrGet ( params , Places . class ) ; } | Return a list of the top 100 unique places clustered by a given placetype for a user s contacts . |
19,020 | public Methods getMethods ( ) throws JinxException { Map < String , String > params = new TreeMap < > ( ) ; params . put ( "method" , "flickr.reflection.getMethods" ) ; return jinx . flickrGet ( params , Methods . class , false ) ; } | Returns a list of available Flickr API methods . |
19,021 | public MethodInfo getMethodInfo ( String methodName ) throws JinxException { JinxUtils . validateParams ( methodName ) ; Map < String , String > params = new TreeMap < > ( ) ; params . put ( "method" , "flickr.reflection.getMethodInfo" ) ; params . put ( "method_name" , methodName ) ; return jinx . flickrGet ( params , MethodInfo . class , false ) ; } | Returns information for a given Flickr API method . |
19,022 | public Clusters getClusters ( String tag ) throws JinxException { JinxUtils . validateParams ( tag ) ; Map < String , String > params = new TreeMap < > ( ) ; params . put ( "method" , "flickr.tags.getClusters" ) ; params . put ( "tag" , tag ) ; return jinx . flickrGet ( params , Clusters . class , false ) ; } | Gives you a list of tag clusters for the given tag . |
19,023 | public PhotoTagList getListPhoto ( String photoId ) throws JinxException { JinxUtils . validateParams ( photoId ) ; Map < String , String > params = new TreeMap < > ( ) ; params . put ( "method" , "flickr.tags.getListPhoto" ) ; params . put ( "photo_id" , photoId ) ; return jinx . flickrGet ( params , PhotoTagList . class , false ) ; } | Get the tag list for a given photo . |
19,024 | public TagsForUser getMostFrequentlyUsed ( ) throws JinxException { Map < String , String > params = new TreeMap < > ( ) ; params . put ( "method" , "flickr.tags.getMostFrequentlyUsed" ) ; return jinx . flickrGet ( params , TagsForUser . class ) ; } | Returns a list of most frequently used tags for a user . |
19,025 | public RelatedTags getRelated ( String tag ) throws JinxException { JinxUtils . validateParams ( tag ) ; Map < String , String > params = new TreeMap < > ( ) ; params . put ( "method" , "flickr.tags.getRelated" ) ; params . put ( "tag" , tag ) ; return jinx . flickrGet ( params , RelatedTags . class ) ; } | Returns a list of tags related to the given tag based on clustered usage analysis . |
19,026 | public String getPhotosFirstDateTaken ( ) { return ( person == null || person . photos == null || person . photos . firstDateTaken == null ) ? null : person . photos . firstDateTaken . _content ; } | Get the mysql datetime of the first photo taken by the user . |
19,027 | public String getPhotosFirstDate ( ) { return ( person == null || person . photos == null || person . photos . firstDate == null ) ? null : person . photos . firstDate . _content ; } | Get the unix timestamp of the first photo uploaded by the user . |
19,028 | public CameraModels getBrandModels ( String brandId ) throws JinxException { JinxUtils . validateParams ( brandId ) ; Map < String , String > params = new TreeMap < > ( ) ; params . put ( "method" , "flickr.cameras.getBrandModels" ) ; params . put ( "brand" , brandId ) ; return jinx . flickrGet ( params , CameraModels . class , false ) ; } | Retrieve all the models for a given camera brand . This method does not require authentication . |
19,029 | public static String generateAuthorizeUrl ( String oAuthUri , String clientId , String [ ] scope ) { StringBuilder sb = new StringBuilder ( oAuthUri ) ; sb . append ( "/oauth/authorize?response_type=code" ) ; sb . append ( "&client_id=" + clientId ) ; if ( scope != null ) { sb . append ( "&scope=" ) ; for ( int i = 0 ; i < scope . length ; i ++ ) { if ( i > 0 ) { sb . append ( "%20" ) ; } sb . append ( scope [ i ] ) ; } } return sb . toString ( ) ; } | Generates the initial url for the OAuth authorization flow |
19,030 | public Response correctLocation ( String photoId , String placeId , String woeId , String foursquareId ) throws JinxException { JinxUtils . validateParams ( photoId ) ; if ( JinxUtils . isNullOrEmpty ( placeId ) ) { JinxUtils . validateParams ( woeId ) ; } Map < String , String > params = new TreeMap < > ( ) ; params . put ( "method" , "flickr.photos.geo.correctLocation" ) ; params . put ( "photo_id" , photoId ) ; if ( ! JinxUtils . isNullOrEmpty ( placeId ) ) { params . put ( "place_id" , placeId ) ; } if ( ! JinxUtils . isNullOrEmpty ( woeId ) ) { params . put ( "woe_id" , woeId ) ; } if ( ! JinxUtils . isNullOrEmpty ( foursquareId ) ) { params . put ( "foursquare_id" , foursquareId ) ; } return jinx . flickrPost ( params , Response . class ) ; } | This method requires authentication with write permission . |
19,031 | public GalleryInfo galleryInfo ( String galleryId ) throws JinxException { JinxUtils . validateParams ( galleryId ) ; Map < String , String > params = new TreeMap < > ( ) ; params . put ( "method" , "flickr.galleries.getInfo" ) ; params . put ( "gallery_id" , galleryId ) ; return jinx . flickrPost ( params , GalleryInfo . class ) ; } | This method does not require authentication . |
19,032 | public Subscriptions getSubscriptions ( ) throws JinxException { Map < String , String > params = new TreeMap < > ( ) ; params . put ( "method" , "flickr.push.getSubscriptions" ) ; return jinx . flickrGet ( params , Subscriptions . class ) ; } | Returns a list of the subscriptions for the logged - in user . |
19,033 | public Topics getTopics ( ) throws JinxException { Map < String , String > params = new TreeMap < > ( ) ; params . put ( "method" , "flickr.push.getTopics" ) ; return jinx . flickrGet ( params , Topics . class ) ; } | Get all available push topics . |
19,034 | public Response subscribe ( String topic , String callbackUrl , JinxConstants . VerificationMode mode , String verificationToken , Integer leaseSeconds , Integer woeIds , List < String > placeIds , Float latitude , Float longitude , Integer radius , JinxConstants . RadiusUnits radiusUnits , Integer accuracy , List < String > commonsNSIDs , List < String > tags ) throws JinxException { JinxUtils . validateParams ( topic , callbackUrl , mode ) ; Map < String , String > params = new TreeMap < > ( ) ; params . put ( "method" , "flickr.push.subscribe" ) ; params . put ( "topic" , topic ) ; params . put ( "callback" , callbackUrl ) ; params . put ( "verify" , mode . toString ( ) ) ; if ( ! JinxUtils . isNullOrEmpty ( verificationToken ) ) { params . put ( "verify_token" , verificationToken ) ; } if ( leaseSeconds != null && leaseSeconds > 59 ) { params . put ( "lease_seconds" , leaseSeconds . toString ( ) ) ; } if ( woeIds != null ) { params . put ( "woe_ids" , woeIds . toString ( ) ) ; } if ( ! JinxUtils . isNullOrEmpty ( placeIds ) ) { params . put ( "place_ids" , JinxUtils . buildCommaDelimitedList ( placeIds ) ) ; } if ( latitude != null ) { params . put ( "lat" , latitude . toString ( ) ) ; } if ( longitude != null ) { params . put ( "lon" , longitude . toString ( ) ) ; } if ( radius != null ) { params . put ( "radius" , radius . toString ( ) ) ; } if ( radiusUnits != null ) { params . put ( "radius_units" , radiusUnits . toString ( ) ) ; } if ( accuracy != null ) { params . put ( "accuracy" , accuracy . toString ( ) ) ; } if ( ! JinxUtils . isNullOrEmpty ( commonsNSIDs ) ) { params . put ( "nsids" , JinxUtils . buildCommaDelimitedList ( commonsNSIDs ) ) ; } if ( ! JinxUtils . isNullOrEmpty ( tags ) ) { params . put ( "tags" , JinxUtils . buildCommaDelimitedList ( tags ) ) ; } return jinx . flickrGet ( params , Response . class ) ; } | Subscribe to a push feed . |
19,035 | public Response unsubscribe ( String topic , String callbackUrl , JinxConstants . VerificationMode mode , String verificationToken ) throws JinxException { JinxUtils . validateParams ( topic , callbackUrl , mode ) ; Map < String , String > params = new TreeMap < > ( ) ; params . put ( "method" , "flickr.push.unsubscribe" ) ; params . put ( "topic" , topic ) ; params . put ( "callback" , callbackUrl ) ; params . put ( "verify" , mode . toString ( ) ) ; if ( ! JinxUtils . isNullOrEmpty ( verificationToken ) ) { params . put ( "verify_token" , verificationToken ) ; } return jinx . flickrGet ( params , Response . class ) ; } | Unsubscribe from a push feed . |
19,036 | public void log ( String message , Throwable t ) { System . out . println ( message ) ; System . out . println ( getStackTrace ( t ) ) ; } | Log message to stdout along with exception information . |
19,037 | public synchronized void stopPreview ( ) { if ( autoFocusManager != null ) { autoFocusManager . stop ( ) ; autoFocusManager = null ; } if ( camera != null && previewing ) { camera . stopPreview ( ) ; previewCallback . setHandler ( null , 0 ) ; previewing = false ; } } | Tells the camera to stop drawing preview frames . |
19,038 | public Integer getPerPage ( ) { int ret = 0 ; if ( photos != null ) { int pp ; if ( photos . perpage == null ) { pp = 0 ; } else { pp = photos . perpage ; } int pP ; if ( photos . perPage == null ) { pP = 0 ; } else { pP = photos . perPage ; } if ( pp > pP ) { ret = pp ; } else { ret = pP ; } } return ret ; } | Get the number of photos per page . This value is returned by flickr as per_page and perpage depending on the method that was called . This class can parse either value and will return whichever one was found . |
19,039 | public String getComment ( String key ) { String raw = getRawComment ( key ) ; return cookComment ( raw ) ; } | Returns the comment for the specified key or null if there is none . Any embedded newline sequences will be replaced by \ n characters . |
19,040 | public static BufferedImage getImageForSize ( JinxConstants . PhotoSize size , Photo photo ) throws JinxException { if ( photo == null || size == null ) { throw new JinxException ( "Cannot look up null photo or size." ) ; } BufferedImage image ; try { image = ImageIO . read ( getUrlForSize ( size , photo ) ) ; } catch ( JinxException je ) { throw je ; } catch ( Exception e ) { throw new JinxException ( "Unable to get image for size " + size . toString ( ) , e ) ; } return image ; } | Get an image for a photo at a specific size . |
19,041 | public static BufferedImage getImageForSize ( JinxConstants . PhotoSize size , PhotoInfo info ) throws JinxException { if ( info == null || size == null ) { throw new JinxException ( "Cannot look up null photo or size." ) ; } BufferedImage image ; try { image = ImageIO . read ( getUrlForSize ( size , info ) ) ; } catch ( JinxException je ) { throw je ; } catch ( Exception e ) { throw new JinxException ( "Unable to get image for size " + size . toString ( ) , e ) ; } return image ; } | Get an image for photo info at a specific size . |
19,042 | public static URL getUrlForSize ( JinxConstants . PhotoSize size , String photoId , String secret , String farm , String server , String originalFormat , String originalSecret ) throws JinxException { JinxUtils . validateParams ( photoId , size , farm , server ) ; if ( size == JinxConstants . PhotoSize . SIZE_ORIGINAL ) { JinxUtils . validateParams ( originalFormat , originalSecret ) ; } else { JinxUtils . validateParams ( secret ) ; } StringBuilder sb = new StringBuilder ( "https://farm" ) ; sb . append ( farm ) ; sb . append ( ".static.flickr.com/" ) ; sb . append ( server ) . append ( "/" ) ; sb . append ( photoId ) . append ( '_' ) ; switch ( size ) { case SIZE_SMALL_SQUARE : sb . append ( secret ) . append ( "_s.jpg" ) ; break ; case SIZE_LARGE_SQUARE : sb . append ( secret ) . append ( "_q.jpg" ) ; break ; case SIZE_THUMBNAIL : sb . append ( secret ) . append ( "_t.jpg" ) ; break ; case SIZE_SMALL : sb . append ( secret ) . append ( "_m.jpg" ) ; break ; case SIZE_SMALL_320 : sb . append ( secret ) . append ( "_n.jpg" ) ; break ; case SIZE_MEDIUM : sb . append ( secret ) . append ( ".jpg" ) ; break ; case SIZE_MEDIUM_640 : sb . append ( secret ) . append ( "_z.jpg" ) ; break ; case SIZE_MEDIUM_800 : sb . append ( secret ) . append ( "_c.jpg" ) ; break ; case SIZE_LARGE : sb . append ( secret ) . append ( "_b.jpg" ) ; break ; case SIZE_LARGE_1600 : sb . append ( secret ) . append ( "_h.jpg" ) ; break ; case SIZE_LARGE_2048 : sb . append ( secret ) . append ( "_k.jpg" ) ; break ; case SIZE_ORIGINAL : sb . append ( originalSecret ) . append ( "_o" ) ; sb . append ( '.' ) . append ( originalFormat ) ; break ; default : throw new JinxException ( "Undefined size: " + size ) ; } try { return new URL ( sb . toString ( ) ) ; } catch ( Exception e ) { throw new JinxException ( "Could not create URL from string " + sb . toString ( ) ) ; } } | Get the URL for a specific size of photo . |
19,043 | public Person getContentType ( ) throws JinxException { Map < String , String > params = new TreeMap < > ( ) ; params . put ( "method" , "flickr.prefs.getContentType" ) ; return jinx . flickrGet ( params , Person . class ) ; } | Returns the default content type preference for the user . |
19,044 | public boolean cancelJob ( String slaveJobId ) { final AnalysisResultFuture resultFuture = _runningJobs . remove ( slaveJobId ) ; if ( resultFuture != null ) { resultFuture . cancel ( ) ; return true ; } return false ; } | Cancels a slave job referred by it s id . |
19,045 | protected final boolean entityExists ( final String entityName ) { final Set < EntityType < ? > > entityTypes = getEm ( ) . getMetamodel ( ) . getEntities ( ) ; for ( final EntityType < ? > entityType : entityTypes ) { if ( entityType . getName ( ) . equals ( entityName ) ) { return true ; } } return false ; } | Returns if an entity with agiven name exists . |
19,046 | protected final String createJpqlStreamSelect ( final StreamId streamId ) { if ( streamId . isProjection ( ) ) { throw new IllegalArgumentException ( "Projections do not have a stream table : " + streamId ) ; } final List < KeyValue > params = new ArrayList < > ( streamId . getParameters ( ) ) ; if ( params . size ( ) == 0 ) { params . add ( new KeyValue ( "streamName" , streamId . getName ( ) ) ) ; } final StringBuilder sb = new StringBuilder ( "SELECT t FROM " + streamEntityName ( streamId ) + " t" ) ; sb . append ( " WHERE " ) ; for ( int i = 0 ; i < params . size ( ) ; i ++ ) { final KeyValue param = params . get ( i ) ; if ( i > 0 ) { sb . append ( " AND " ) ; } sb . append ( "t." + param . getKey ( ) + "=:" + param . getKey ( ) ) ; } return sb . toString ( ) ; } | Creates the JPQL to select the stream itself . |
19,047 | protected final JpaStream findStream ( final StreamId streamId ) { Contract . requireArgNotNull ( "streamId" , streamId ) ; verifyStreamEntityExists ( streamId ) ; final String sql = createJpqlStreamSelect ( streamId ) ; final TypedQuery < JpaStream > query = getEm ( ) . createQuery ( sql , JpaStream . class ) ; setJpqlParameters ( query , streamId ) ; final List < JpaStream > streams = query . getResultList ( ) ; if ( streams . size ( ) == 0 ) { throw new StreamNotFoundException ( streamId ) ; } final JpaStream stream = streams . get ( 0 ) ; if ( stream . getState ( ) == StreamState . SOFT_DELETED ) { throw new StreamNotFoundException ( streamId ) ; } return stream ; } | Reads the stream with the given identifier from the DB and returns it . |
19,048 | private final String createNativeSqlEventSelect ( final StreamId streamId , final List < NativeSqlCondition > conditions ) { final StringBuilder sb = new StringBuilder ( "SELECT " + JPA_EVENT_PREFIX + ".* FROM " + JpaEvent . TABLE_NAME + " " + JPA_EVENT_PREFIX + ", " + nativeEventsTableName ( streamId ) + " " + JPA_STREAM_EVENT_PREFIX + " WHERE " + JPA_EVENT_PREFIX + "." + JpaEvent . COLUMN_ID + "=" + JPA_STREAM_EVENT_PREFIX + "." + JpaStreamEvent . COLUMN_EVENTS_ID ) ; for ( final NativeSqlCondition condition : conditions ) { sb . append ( " AND " ) ; sb . append ( condition . asWhereConditionWithParam ( ) ) ; } return sb . toString ( ) ; } | Creates a native SQL select using the parameters from the stream identifier and optional other arguments . |
19,049 | public void delete ( final boolean hardDelete ) { if ( hardDelete ) { this . state = StreamState . HARD_DELETED . dbValue ( ) ; } else { this . state = StreamState . SOFT_DELETED . dbValue ( ) ; } } | Marks the stream as deleted . |
19,050 | public boolean removeDatastore ( final String datastoreName ) { final Element datastoreCatalogElement = getDatastoreCatalogElement ( ) ; final NodeList childNodes = datastoreCatalogElement . getChildNodes ( ) ; final int length = childNodes . getLength ( ) ; for ( int i = 0 ; i < length ; i ++ ) { final Node node = childNodes . item ( i ) ; if ( node instanceof Element ) { final Element element = ( Element ) node ; final Attr [ ] attributes = XmlDomDataContext . getAttributes ( element ) ; for ( Attr attr : attributes ) { if ( "name" . equals ( attr . getName ( ) ) ) { final String value = attr . getValue ( ) ; if ( datastoreName . equals ( value ) ) { datastoreCatalogElement . removeChild ( element ) ; onDocumentChanged ( getDocument ( ) ) ; return true ; } } } } } return false ; } | Removes a datastore by it s name if it exists and is recognizeable by the externalizer . |
19,051 | public final void add ( final SerializedDataType type , final String contentType , final SerDeserializer serDeserializer ) { this . addSerializer ( type , serDeserializer ) ; this . addDeserializer ( type , contentType , serDeserializer ) ; } | Convenience method that adds both a new serializer and deserializer to the registry . |
19,052 | public final void addDeserializer ( final SerializedDataType type , final String contentType , final Deserializer deserializer ) { Contract . requireArgNotNull ( "type" , type ) ; Contract . requireArgNotNull ( "contentType" , contentType ) ; Contract . requireArgNotNull ( "deserializer" , deserializer ) ; final Key key = new Key ( type , contentType ) ; desMap . put ( key , deserializer ) ; } | Adds a new deserializer to the registry . |
19,053 | public final void setDefaultContentType ( final SerializedDataType type , final EnhancedMimeType contentType ) { Contract . requireArgNotNull ( "type" , type ) ; Contract . requireArgNotNull ( "contentType" , contentType ) ; contentTypes . put ( type , contentType ) ; } | Sets the default content type to use if no content type is given . |
19,054 | public final void addSerializer ( final SerializedDataType type , final Serializer serializer ) { Contract . requireArgNotNull ( "type" , type ) ; Contract . requireArgNotNull ( "serializer" , serializer ) ; serMap . put ( type , serializer ) ; } | Adds a new serializer to the registry . |
19,055 | public void compileProgram ( ) { program . inputs ( ) . forEach ( var -> var . calculateFuzzySpace ( ) ) ; program . outputs ( ) . forEach ( var -> var . calculateFuzzySpace ( ) ) ; program . rules ( ) . forEach ( rule -> { updateMemberReferenceCount ( rule . getCondition ( ) ) ; rule . assignmentMembers ( ) . forEach ( member -> member . incrReferenceCount ( ) ) ; } ) ; } | Compile the program |
19,056 | public MutableInputColumn < ? > getOutputColumnByName ( String name ) { if ( StringUtils . isNullOrEmpty ( name ) ) { return null ; } final List < MutableInputColumn < ? > > outputColumns = getOutputColumns ( ) ; for ( MutableInputColumn < ? > inputColumn : outputColumns ) { if ( name . equals ( inputColumn . getName ( ) ) ) { return inputColumn ; } } return null ; } | Gets an output column by name . |
19,057 | public static InvalidEntityKanbaneryException mostSpecializedException ( String response ) { if ( response == null || "" . equals ( response ) ) { return new InvalidEntityKanbaneryException ( response ) ; } else if ( TaskAlreadyInFirstColumnException . isBestExceptionFor ( response ) ) { return new TaskAlreadyInFirstColumnException ( response ) ; } else if ( TaskAlreadyInLastColumnException . isBestExceptionFor ( response ) ) { return new TaskAlreadyInLastColumnException ( response ) ; } else if ( PositionExceedsNumberOfTasksInColumnException . isBestExceptionFor ( response ) ) { return new PositionExceedsNumberOfTasksInColumnException ( response ) ; } else if ( CanOnlyIceBoxTaskFromFirstColumnException . isBestExceptionFor ( response ) ) { return new CanOnlyIceBoxTaskFromFirstColumnException ( response ) ; } else if ( CanOnlyArchiveFromLastColumnException . isBestExceptionFor ( response ) ) { return new CanOnlyArchiveFromLastColumnException ( response ) ; } else if ( NotFixedColumnCannotBeFirstException . isBestExceptionFor ( response ) ) { return new NotFixedColumnCannotBeFirstException ( response ) ; } else if ( BodyMustNotBeBlankException . isBestExceptionFor ( response ) ) { return new BodyMustNotBeBlankException ( response ) ; } else if ( MaximumNumbersOfCollaboratorsReachedException . isBestExceptionFor ( response ) ) { return new MaximumNumbersOfCollaboratorsReachedException ( response ) ; } else if ( UserAlreadyAssignedToThisProjectException . isBestExceptionFor ( response ) ) { return new UserAlreadyAssignedToThisProjectException ( response ) ; } else if ( ProjectOwnerCanNotBeGivenProjectMembership . isBestExceptionFor ( response ) ) { return new ProjectOwnerCanNotBeGivenProjectMembership ( response ) ; } else if ( CanNotDeleteColumnThatContainsTasksException . isBestExceptionFor ( response ) ) { return new CanNotDeleteColumnThatContainsTasksException ( response ) ; } else { return new InvalidEntityKanbaneryException ( response ) ; } } | May be used as Exception factory to determine the best exception to be thrown for such JSON response . For example we may throw TaskAlreadyInFirstColumnException if the JSON contains a message informing us about this . |
19,058 | public void init ( ) { logger . info ( "Initializing dictionary: {}" , this ) ; Datastore datastore = getDatastore ( ) ; DatastoreConnection dataContextProvider = datastore . openConnection ( ) ; getDatastoreConnections ( ) . add ( dataContextProvider ) ; } | Initializes a DatastoreConnection which will keep the connection open |
19,059 | public static ClassLoader getParentClassLoader ( ) { logger . debug ( "getParentClassLoader() invoked, web start mode: {}" , IS_WEB_START ) ; if ( IS_WEB_START ) { return Thread . currentThread ( ) . getContextClassLoader ( ) ; } else { return ClassLoaderUtils . class . getClassLoader ( ) ; } } | Gets an appropriate classloader for usage when performing classpath lookups and scanning . |
19,060 | protected Crosstab < Serializable > createMasterCrosstab ( Collection < ? extends R > results ) { final R firstResult = results . iterator ( ) . next ( ) ; final Crosstab < ? > firstCrosstab = firstResult . getCrosstab ( ) ; final Class < ? > valueClass = firstCrosstab . getValueClass ( ) ; final CrosstabDimension dimension1 = firstCrosstab . getDimension ( 0 ) ; final CrosstabDimension dimension2 = firstCrosstab . getDimension ( 1 ) ; @ SuppressWarnings ( { "unchecked" , "rawtypes" } ) final Crosstab < Serializable > masterCrosstab = new Crosstab ( valueClass , dimension1 , dimension2 ) ; return masterCrosstab ; } | Builds the master crosstab including all dimensions and categories that will be included in the final result . |
19,061 | public void startFragment ( Fragment fragment , String tag , boolean canAddToBackstack ) { FragmentTransaction transaction = getSupportFragmentManager ( ) . beginTransaction ( ) . replace ( R . id . fragmentContainer , fragment ) ; if ( canAddToBackstack ) { transaction . addToBackStack ( tag ) ; } transaction . commit ( ) ; } | Start given Fragment |
19,062 | public void calculateFuzzySpace ( ) { double start = getFrom ( ) . doubleValue ( ) ; double stop = getTo ( ) . doubleValue ( ) ; double step = getStep ( ) . doubleValue ( ) ; members ( ) . forEach ( member -> { if ( member . haveFunctionCall ( ) ) { for ( double i = start ; i <= stop ; i += step ) { member . calculateFunctionAt ( i ) ; } } else { member . calculateEndPoints ( start , stop ) ; for ( double i = start ; i <= stop ; i += step ) { member . calculateValueAt ( i ) ; } } } ) ; double yMax = Double . MIN_VALUE ; for ( Member member : members ( ) ) { double memberMax = member . findMax ( ) ; yMax = memberMax > yMax ? memberMax : yMax ; } for ( Member member : members ( ) ) { member . normalizeY ( yMax , 255 ) ; totalSteps = Math . max ( totalSteps , member . normalized ( ) . size ( ) ) ; } this . calculated = true ; } | Calculate the full fuzzy space for this variable . |
19,063 | static void accessFailed ( ) throws Throwable { String controllerClassName = getControllerClass ( ) . getName ( ) ; Logger . debug ( "Deadbolt: Access failure on [%s]" , controllerClassName ) ; String responseFormat = null ; if ( getActionAnnotation ( JSON . class ) != null ) { responseFormat = "json" ; } else if ( getActionAnnotation ( XML . class ) != null ) { responseFormat = "xml" ; } else if ( getControllerAnnotation ( JSON . class ) != null ) { responseFormat = "json" ; } else if ( getControllerAnnotation ( XML . class ) != null ) { responseFormat = "xml" ; } else { String defaultResponseFormat = Play . configuration . getProperty ( DEFAULT_RESPONSE_FORMAT ) ; if ( ! isEmpty ( defaultResponseFormat ) ) { responseFormat = defaultResponseFormat ; } } if ( ! isEmpty ( responseFormat ) ) { request . format = responseFormat ; } DEADBOLT_HANDLER . onAccessFailure ( controllerClassName ) ; } | Generic access failure forwarding point . |
19,064 | public static boolean hasAllRoles ( RoleHolder roleHolder , String [ ] roleNames ) { boolean hasRole = false ; if ( roleHolder != null ) { List < ? extends Role > roles = roleHolder . getRoles ( ) ; if ( roles != null ) { List < String > heldRoles = new ArrayList < String > ( ) ; for ( Role role : roles ) { if ( role != null ) { heldRoles . add ( role . getRoleName ( ) ) ; } } boolean roleCheckResult = true ; for ( int i = 0 ; roleCheckResult && i < roleNames . length ; i ++ ) { boolean invert = false ; String roleName = roleNames [ i ] ; if ( roleName . startsWith ( "!" ) ) { invert = true ; roleName = roleName . substring ( 1 ) ; } roleCheckResult = heldRoles . contains ( roleName ) ; if ( invert ) { roleCheckResult = ! roleCheckResult ; } } hasRole = roleCheckResult ; } } return hasRole ; } | Checks if the current user has all of the specified roles . |
19,065 | public static boolean hasRoles ( List < String > roleNames ) throws Throwable { DEADBOLT_HANDLER . beforeRoleCheck ( ) ; RoleHolder roleHolder = getRoleHolder ( ) ; return roleHolder != null && roleHolder . getRoles ( ) != null && hasAllRoles ( roleHolder , roleNames . toArray ( new String [ roleNames . size ( ) ] ) ) ; } | Checks if the current user has the specified role . |
19,066 | public void put ( E value , boolean createCategories ) throws IllegalArgumentException , NullPointerException { if ( createCategories ) { for ( int i = 0 ; i < categories . length ; i ++ ) { String category = categories [ i ] ; CrosstabDimension dimension = crosstab . getDimension ( i ) ; dimension . addCategory ( category ) ; } } crosstab . putValue ( value , categories ) ; } | Puts the given value to the navigated position in the crosstab . |
19,067 | protected String getHeaderValue ( HtmlRenderingContext context , int col , String columnName ) { return context . escapeHtml ( columnName ) ; } | Overrideable method for defining the literal HTML table header of a particular column . |
19,068 | public final String asWhereConditionWithParam ( ) { if ( table == null ) { return column + operator + ":" + column ; } return table + "." + column + operator + ":" + column ; } | Returns the where condition with a parameter . |
19,069 | public static List < RowProcessingConsumer > sortConsumers ( List < RowProcessingConsumer > consumers ) { final RowProcessingConsumerSorter sorter = new RowProcessingConsumerSorter ( consumers ) ; final List < RowProcessingConsumer > sortedConsumers = sorter . createProcessOrderedConsumerList ( ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Row processing order ({} consumers):" , sortedConsumers . size ( ) ) ; int i = 1 ; for ( RowProcessingConsumer rowProcessingConsumer : sortedConsumers ) { logger . debug ( " {}) {}" , i , rowProcessingConsumer ) ; i ++ ; } } return sortedConsumers ; } | Sorts a list of consumers into their execution order |
19,070 | public void processRows ( RowProcessingMetrics rowProcessingMetrics ) { final RowProcessingQueryOptimizer queryOptimizer = getQueryOptimizer ( ) ; final Query finalQuery = queryOptimizer . getOptimizedQuery ( ) ; final RowIdGenerator idGenerator ; if ( finalQuery . getFirstRow ( ) == null ) { idGenerator = new SimpleRowIdGenerator ( ) ; } else { idGenerator = new SimpleRowIdGenerator ( finalQuery . getFirstRow ( ) ) ; } final AnalysisJob analysisJob = _publishers . getAnalysisJob ( ) ; final AnalysisListener analysisListener = _publishers . getAnalysisListener ( ) ; final TaskRunner taskRunner = _publishers . getTaskRunner ( ) ; for ( RowProcessingConsumer rowProcessingConsumer : _consumers ) { if ( rowProcessingConsumer instanceof AnalyzerConsumer ) { final AnalyzerConsumer analyzerConsumer = ( AnalyzerConsumer ) rowProcessingConsumer ; final AnalyzerJob analyzerJob = analyzerConsumer . getComponentJob ( ) ; final AnalyzerMetrics metrics = rowProcessingMetrics . getAnalysisJobMetrics ( ) . getAnalyzerMetrics ( analyzerJob ) ; analysisListener . analyzerBegin ( analysisJob , analyzerJob , metrics ) ; } if ( rowProcessingConsumer instanceof TransformerConsumer ) { ( ( TransformerConsumer ) rowProcessingConsumer ) . setRowIdGenerator ( idGenerator ) ; } } final List < RowProcessingConsumer > consumers = queryOptimizer . getOptimizedConsumers ( ) ; final Collection < ? extends FilterOutcome > availableOutcomes = queryOptimizer . getOptimizedAvailableOutcomes ( ) ; analysisListener . rowProcessingBegin ( analysisJob , rowProcessingMetrics ) ; final RowConsumerTaskListener taskListener = new RowConsumerTaskListener ( analysisJob , analysisListener , taskRunner ) ; final Datastore datastore = _publishers . getDatastore ( ) ; try ( final DatastoreConnection con = datastore . openConnection ( ) ) { final DataContext dataContext = con . getDataContext ( ) ; if ( logger . isDebugEnabled ( ) ) { final String queryString ; if ( dataContext instanceof JdbcDataContext ) { final JdbcDataContext jdbcDataContext = ( JdbcDataContext ) dataContext ; queryString = jdbcDataContext . getQueryRewriter ( ) . rewriteQuery ( finalQuery ) ; } else { queryString = finalQuery . toSql ( ) ; } logger . debug ( "Final query: {}" , queryString ) ; logger . debug ( "Final query firstRow={}, maxRows={}" , finalQuery . getFirstRow ( ) , finalQuery . getMaxRows ( ) ) ; } int numTasks = 0 ; try ( final DataSet dataSet = dataContext . executeQuery ( finalQuery ) ) { final ConsumeRowHandler consumeRowHandler = new ConsumeRowHandler ( consumers , availableOutcomes ) ; while ( dataSet . next ( ) ) { if ( taskListener . isErrornous ( ) ) { break ; } numTasks ++ ; final Row metaModelRow = dataSet . getRow ( ) ; final int rowId = idGenerator . nextPhysicalRowId ( ) ; final MetaModelInputRow inputRow = new MetaModelInputRow ( rowId , metaModelRow ) ; final ConsumeRowTask task = new ConsumeRowTask ( consumeRowHandler , rowProcessingMetrics , inputRow , analysisListener , numTasks ) ; taskRunner . run ( task , taskListener ) ; } } taskListener . awaitTasks ( numTasks ) ; } if ( taskListener . isErrornous ( ) ) { _successful . set ( false ) ; return ; } analysisListener . rowProcessingSuccess ( analysisJob , rowProcessingMetrics ) ; } | Fires the actual row processing . This method assumes that consumers have been initialized and the publisher is ready to start processing . |
19,071 | public AbstractDatastoreType createPojoDatastore ( final Datastore datastore , final Set < Column > columns , final int maxRowsToQuery ) { final PojoDatastoreType datastoreType = new PojoDatastoreType ( ) ; datastoreType . setName ( datastore . getName ( ) ) ; datastoreType . setDescription ( datastore . getDescription ( ) ) ; try ( final DatastoreConnection con = datastore . openConnection ( ) ) { final DataContext dataContext = con . getDataContext ( ) ; final Schema schema ; final Table [ ] tables ; if ( columns == null || columns . isEmpty ( ) ) { schema = dataContext . getDefaultSchema ( ) ; tables = schema . getTables ( ) ; } else { tables = MetaModelHelper . getTables ( columns ) ; schema = tables [ 0 ] . getSchema ( ) ; } datastoreType . setSchemaName ( schema . getName ( ) ) ; for ( final Table table : tables ) { final Column [ ] usedColumns ; if ( columns == null || columns . isEmpty ( ) ) { usedColumns = table . getColumns ( ) ; } else { usedColumns = MetaModelHelper . getTableColumns ( table , columns ) ; } final PojoTableType tableType = createPojoTable ( dataContext , table , usedColumns , maxRowsToQuery ) ; datastoreType . getTable ( ) . add ( tableType ) ; } } return datastoreType ; } | Creates a serialized POJO copy of a datastore . |
19,072 | public static Data valueOf ( final String type , final Object obj ) { return new Data ( type , mimeType ( obj ) , content ( obj ) ) ; } | Creates a new instance from a given object . |
19,073 | public void run ( R row , String value , int distinctCount ) { final List < Token > tokens ; boolean match = false ; try { tokens = _tokenizer . tokenize ( value ) ; } catch ( RuntimeException e ) { throw new IllegalStateException ( "Error occurred while tokenizing value: " + value , e ) ; } final String patternCode = getPatternCode ( tokens ) ; Set < TokenPattern > patterns ; synchronized ( this ) { patterns = _patterns . get ( patternCode ) ; if ( patterns == null ) { patterns = new HashSet < TokenPattern > ( ) ; _patterns . put ( patternCode , patterns ) ; } for ( TokenPattern pattern : patterns ) { if ( pattern . match ( tokens ) ) { storeMatch ( pattern , row , value , distinctCount ) ; match = true ; } } if ( ! match ) { final TokenPattern pattern ; try { pattern = new TokenPatternImpl ( value , tokens , _configuration ) ; } catch ( RuntimeException e ) { throw new IllegalStateException ( "Error occurred while creating pattern for: " + tokens , e ) ; } storeNewPattern ( pattern , row , value , distinctCount ) ; patterns . add ( pattern ) ; } } } | This method should be invoked by the user of the PatternFinder . Invoke it for each value in your dataset . Repeated values are handled correctly but if available it is more effecient to handle only the distinct values and their corresponding distinct counts . |
19,074 | public String map ( String name ) { String mapped = super . get ( name ) ; if ( mapped == null ) { mapped = String . format ( "%s%03d" , BASENAME , count . incrementAndGet ( ) ) ; super . put ( name , mapped ) ; } return mapped ; } | Map a variable name |
19,075 | public static KAFDocument createFromFile ( File file ) throws IOException { KAFDocument kaf = null ; try { kaf = ReadWriteManager . load ( file ) ; } catch ( JDOMException e ) { e . printStackTrace ( ) ; } return kaf ; } | Creates a new KAFDocument and loads the contents of the file passed as argument |
19,076 | public static KAFDocument createFromStream ( Reader stream ) throws IOException , JDOMException { KAFDocument kaf = null ; kaf = ReadWriteManager . load ( stream ) ; return kaf ; } | Creates a new KAFDocument loading the content read from the reader given on argument . |
19,077 | public LinguisticProcessor addLinguisticProcessor ( String layer , String name ) { LinguisticProcessor lp = new LinguisticProcessor ( name , layer ) ; List < LinguisticProcessor > layerLps = lps . get ( layer ) ; if ( layerLps == null ) { layerLps = new ArrayList < LinguisticProcessor > ( ) ; lps . put ( layer , layerLps ) ; } layerLps . add ( lp ) ; return lp ; } | Adds a linguistic processor to the document header . The timestamp is added implicitly . |
19,078 | public boolean linguisticProcessorExists ( String layer , String name , String version ) { List < LinguisticProcessor > layerLPs = lps . get ( layer ) ; if ( layerLPs == null ) { return false ; } for ( LinguisticProcessor lp : layerLPs ) { if ( lp . version == null ) { return false ; } else if ( lp . name . equals ( name ) && lp . version . equals ( version ) ) { return true ; } } return false ; } | Returns wether the given linguistic processor is already defined or not . Both name and version must be exactly the same . |
19,079 | public Term newTerm ( String id , Span < WF > span ) { idManager . updateCounter ( AnnotationType . TERM , id ) ; Term newTerm = new Term ( id , span , false ) ; annotationContainer . add ( newTerm , Layer . TERMS , AnnotationType . TERM ) ; addToWfTermIndex ( newTerm . getSpan ( ) . getTargets ( ) , newTerm ) ; return newTerm ; } | Creates a Term object to load an existing term . It receives the ID as an argument . The Term is added to the document object . |
19,080 | public Dep newDep ( Term from , Term to , String rfunc ) { Dep newDep = new Dep ( from , to , rfunc ) ; annotationContainer . add ( newDep , Layer . DEPS , AnnotationType . DEP ) ; return newDep ; } | Creates a new dependency . The Dep is added to the document object . |
19,081 | public Chunk newChunk ( String id , String phrase , Span < Term > span ) { idManager . updateCounter ( AnnotationType . CHUNK , id ) ; Chunk newChunk = new Chunk ( id , span ) ; newChunk . setPhrase ( phrase ) ; annotationContainer . add ( newChunk , Layer . CHUNKS , AnnotationType . CHUNK ) ; return newChunk ; } | Creates a chunk object to load an existing chunk . It receives it s ID as an argument . The Chunk is added to the document object . |
19,082 | public Chunk newChunk ( String phrase , Span < Term > span ) { String newId = idManager . getNextId ( AnnotationType . CHUNK ) ; Chunk newChunk = new Chunk ( newId , span ) ; newChunk . setPhrase ( phrase ) ; annotationContainer . add ( newChunk , Layer . CHUNKS , AnnotationType . CHUNK ) ; return newChunk ; } | Creates a new chunk . It assigns an appropriate ID to it . The Chunk is added to the document object . |
19,083 | public Entity newEntity ( String id , List < Span < Term > > references ) { idManager . updateCounter ( AnnotationType . ENTITY , id ) ; Entity newEntity = new Entity ( id , references ) ; annotationContainer . add ( newEntity , Layer . ENTITIES , AnnotationType . ENTITY ) ; return newEntity ; } | Creates an Entity object to load an existing entity . It receives the ID as an argument . The entity is added to the document object . |
19,084 | public Entity newEntity ( List < Span < Term > > references ) { String newId = idManager . getNextId ( AnnotationType . ENTITY ) ; Entity newEntity = new Entity ( newId , references ) ; annotationContainer . add ( newEntity , Layer . ENTITIES , AnnotationType . ENTITY ) ; return newEntity ; } | Creates a new Entity . It assigns an appropriate ID to it . The entity is added to the document object . |
19,085 | public Coref newCoref ( String id , List < Span < Term > > mentions ) { idManager . updateCounter ( AnnotationType . COREF , id ) ; Coref newCoref = new Coref ( id , mentions ) ; annotationContainer . add ( newCoref , Layer . COREFERENCES , AnnotationType . COREF ) ; return newCoref ; } | Creates a coreference object to load an existing Coref . It receives it s ID as an argument . The Coref is added to the document . |
19,086 | public Coref newCoref ( List < Span < Term > > mentions ) { String newId = idManager . getNextId ( AnnotationType . COREF ) ; Coref newCoref = new Coref ( newId , mentions ) ; annotationContainer . add ( newCoref , Layer . COREFERENCES , AnnotationType . COREF ) ; return newCoref ; } | Creates a new coreference . It assigns an appropriate ID to it . The Coref is added to the document . |
19,087 | public Timex3 newTimex3 ( String id , String type ) { idManager . updateCounter ( AnnotationType . TIMEX3 , id ) ; Timex3 newTimex3 = new Timex3 ( id , type ) ; annotationContainer . add ( newTimex3 , Layer . TIME_EXPRESSIONS , AnnotationType . TIMEX3 ) ; return newTimex3 ; } | Creates a timeExpressions object to load an existing Timex3 . It receives it s ID as an argument . The Timex3 is added to the document . |
19,088 | public Timex3 newTimex3 ( String type ) { String newId = idManager . getNextId ( AnnotationType . TIMEX3 ) ; Timex3 newTimex3 = new Timex3 ( newId , type ) ; annotationContainer . add ( newTimex3 , Layer . TIME_EXPRESSIONS , AnnotationType . TIMEX3 ) ; return newTimex3 ; } | Creates a new timeExpressions . It assigns an appropriate ID to it . The Coref is added to the document . |
19,089 | public Factvalue newFactvalue ( WF wf , String prediction ) { Factvalue factuality = new Factvalue ( wf , prediction ) ; annotationContainer . add ( factuality , Layer . FACTUALITY_LAYER , AnnotationType . FACTVALUE ) ; return factuality ; } | Creates a factualitylayer object and add it to the document |
19,090 | public Feature newProperty ( String id , String lemma , List < Span < Term > > references ) { idManager . updateCounter ( AnnotationType . PROPERTY , id ) ; Feature newProperty = new Feature ( id , lemma , references ) ; annotationContainer . add ( newProperty , Layer . PROPERTIES , AnnotationType . PROPERTY ) ; return newProperty ; } | Creates a new property . It receives it s ID as an argument . The property is added to the document . |
19,091 | public Feature newProperty ( String lemma , List < Span < Term > > references ) { String newId = idManager . getNextId ( AnnotationType . PROPERTY ) ; Feature newProperty = new Feature ( newId , lemma , references ) ; annotationContainer . add ( newProperty , Layer . PROPERTIES , AnnotationType . PROPERTY ) ; return newProperty ; } | Creates a new property . It assigns an appropriate ID to it . The property is added to the document . |
19,092 | public Feature newCategory ( String id , String lemma , List < Span < Term > > references ) { idManager . updateCounter ( AnnotationType . CATEGORY , id ) ; Feature newCategory = new Feature ( id , lemma , references ) ; annotationContainer . add ( newCategory , Layer . CATEGORIES , AnnotationType . CATEGORY ) ; return newCategory ; } | Creates a new category . It receives it s ID as an argument . The category is added to the document . |
19,093 | public Feature newCategory ( String lemma , List < Span < Term > > references ) { String newId = idManager . getNextId ( AnnotationType . CATEGORY ) ; Feature newCategory = new Feature ( newId , lemma , references ) ; annotationContainer . add ( newCategory , Layer . CATEGORIES , AnnotationType . CATEGORY ) ; return newCategory ; } | Creates a new category . It assigns an appropriate ID to it . The category is added to the document . |
19,094 | public Opinion newOpinion ( ) { String newId = idManager . getNextId ( AnnotationType . OPINION ) ; Opinion newOpinion = new Opinion ( newId ) ; annotationContainer . add ( newOpinion , Layer . OPINIONS , AnnotationType . OPINION ) ; return newOpinion ; } | Creates a new opinion object . It assigns an appropriate ID to it . The opinion is added to the document . |
19,095 | public Opinion newOpinion ( String id ) { idManager . updateCounter ( AnnotationType . OPINION , id ) ; Opinion newOpinion = new Opinion ( id ) ; annotationContainer . add ( newOpinion , Layer . OPINIONS , AnnotationType . OPINION ) ; return newOpinion ; } | Creates a new opinion object . It receives its ID as an argument . The opinion is added to the document . |
19,096 | public Predicate newPredicate ( String id , Span < Term > span ) { idManager . updateCounter ( AnnotationType . PREDICATE , id ) ; Predicate newPredicate = new Predicate ( id , span ) ; annotationContainer . add ( newPredicate , Layer . SRL , AnnotationType . PREDICATE ) ; return newPredicate ; } | Creates a new srl predicate . It receives its ID as an argument . The predicate is added to the document . |
19,097 | public Predicate newPredicate ( Span < Term > span ) { String newId = idManager . getNextId ( AnnotationType . PREDICATE ) ; Predicate newPredicate = new Predicate ( newId , span ) ; annotationContainer . add ( newPredicate , Layer . SRL , AnnotationType . PREDICATE ) ; return newPredicate ; } | Creates a new srl predicate . It assigns an appropriate ID to it . The predicate is added to the document . |
19,098 | public Predicate . Role newRole ( String id , Predicate predicate , String semRole , Span < Term > span ) { idManager . updateCounter ( AnnotationType . ROLE , id ) ; Predicate . Role newRole = new Predicate . Role ( id , semRole , span ) ; return newRole ; } | Creates a Role object to load an existing role . It receives the ID as an argument . It doesn t add the role to the predicate . |
19,099 | public Predicate . Role newRole ( Predicate predicate , String semRole , Span < Term > span ) { String newId = idManager . getNextId ( AnnotationType . ROLE ) ; Predicate . Role newRole = new Predicate . Role ( newId , semRole , span ) ; return newRole ; } | Creates a new Role object . It assigns an appropriate ID to it . It uses the ID of the predicate to create a new ID for the role . It doesn t add the role to the predicate . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.