code
stringlengths
10
174k
nl
stringlengths
3
129k
private static void decodeAnsiX12Segment(BitSource bits,StringBuilder result) throws FormatException { int[] cValues=new int[3]; do { if (bits.available() == 8) { return; } int firstByte=bits.readBits(8); if (firstByte == 254) { return; } parseTwoBytes(firstByte,bits.readBits(8),...
See ISO 16022:2006, 5.2.7
@Override public void configureZone(final StendhalRPZone zone,final Map<String,String> attributes){ buildNPC(zone); }
Configure a zone.
public ByteBuffer duplicate(){ return copy(this,mark); }
Returns a duplicated buffer that shares its content with this buffer. <p> The duplicated buffer's position, limit, capacity and mark are the same as this buffer's. The duplicated buffer's read-only property and byte order are the same as this buffer's too. </p> <p> The new buffer shares its content with this buffer, wh...
public void paintFileChooserBackground(SynthContext context,Graphics g,int x,int y,int w,int h){ paintBackground(context,g,x,y,w,h,null); }
Paints the background of a file chooser.
public ExtentTest assignAuthor(String author){ Author a=new Author(); a.setName(author); test.setAuthor(a); extent.assignAuthor(test,a); return this; }
Assigns an author
protected static double regularizedIncBetaCF(double alpha,double beta,double x){ final double FPMIN=Double.MIN_VALUE / NUM_PRECISION; double qab=alpha + beta; double qap=alpha + 1.0; double qam=alpha - 1.0; double c=1.0; double d=1.0 - qab * x / qap; if (Math.abs(d) < FPMIN) { d=FPMIN; } d=1.0 / d...
Returns the regularized incomplete beta function I_x(a, b) Includes the continued fraction way of computing, based on the book "Numerical Recipes".
private void createResponse(final HttpServerRequest request,final HttpClientResponse response){ request.response().setStatusCode(response.statusCode()); request.response().setStatusMessage(response.statusMessage()); request.response().setChunked(true); request.response().headers().addAll(response.headers()); ...
Create a response.
public void updateSeries(CandleSeries source,int skip,boolean newBar){ if (source == null) { throw new IllegalArgumentException("Null source (CandleSeries)."); } if (getLength() == null || getLength() < 1) { throw new IllegalArgumentException("RSI period must be greater than zero."); } if (source.get...
Method updateSeries.
protected int nextOffset(){ int opcode=getCode()[_offset] & 0xff; int length=OP_LEN[opcode]; switch (opcode) { case GOTO: case GOTO_W: case RET: case IRETURN: case LRETURN: case FRETURN: case DRETURN: case ARETURN: case RETURN: case ATHROW: return -1; case TABLESWITCH: { int arg=_offset + 1; arg+=(4 - a...
Goes to the next opcode.
public Object invoke(Object o) throws IllegalAccessException, InvocationTargetException { return method.invoke(o,args); }
Invokes the method
protected static String LexicalError(boolean EOFSeen,int lexState,int errorLine,int errorColumn,String errorAfter,char curChar){ return ("Lexical error at line " + errorLine + ", column "+ errorColumn+ ". Encountered: "+ (EOFSeen ? "<EOF> " : ("\"" + addEscapes(String.valueOf(curChar)) + "\"") + " (" + (int)curChar+...
Returns a detailed message for the Error when it is thrown by the token manager to indicate a lexical error. Parameters : EOFSeen : indicates if EOF caused the lexical error curLexState : lexical state in which this error occurred errorLine : line number when the error occurred errorColumn : column number when the erro...
public static void flushExternalFileCache(){ existingExternalFiles=new HashSet<>(); existingExternalConfirmedFiles=new HashSet<>(); }
Flushes the cache of external files known to be existing.
@Override public float defineBoost(final Object value){ final Product product=(Product)value; return 1f + featuredBoost(product) + categoryBoost(product); }
Dynamic boosting of products.
public void addEventTypeName(String eventTypeName){ variantTypeNames.add(eventTypeName); }
Adds names of an event types that is one of the predefined event typs allowed for the variant stream.
private void writeQName(javax.xml.namespace.QName qname,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { java.lang.String namespaceURI=qname.getNamespaceURI(); if (namespaceURI != null) { java.lang.String prefix=xmlWriter.getPrefix(namespaceURI); if (prefix == null) {...
method to handle Qnames
private static boolean intersectsOneOf(final Rectangle2D r,final Collection<? extends Shape> shapes){ if (shapes.isEmpty()) { return false; } for ( final Shape item : shapes) { if (item.intersects(r)) { return true; } } return false; }
java.lang.boolean intersectsOneOf(java.awt.geom.Rectangle2D, java.tools.Collection) Function to test if the given 2D rectangle intersects any of the shapes given in the collection.
protected void sendDiscoveryMessage(DatapathId sw,OFPort port,boolean isStandard,boolean isReverse){ if (!isOutgoingDiscoveryAllowed(sw,port,isStandard,isReverse)) return; IOFSwitch iofSwitch=switchService.getSwitch(sw); if (iofSwitch == null) return; OFPortDesc ofpPort=iofSwitch.getPort(port); OFPacketOu...
Send link discovery message out of a given switch port. The discovery message may be a standard LLDP or a modified LLDP, where the dst mac address is set to :ff. TODO: The modified LLDP will updated in the future and may use a different eth-type.
public String notesTipText(){ return "The (optional) notes for this experiment in Markdown."; }
Describes this property.
public List<ExportGroupRestRep> exportBlockResources(List<URI> resourceIds,URI parentId){ List<ExportGroupRestRep> exports=Lists.newArrayList(); List<URI> newVolumes=new ArrayList<URI>(); Map<URI,Set<URI>> addVolumeExports=Maps.newHashMap(); Map<URI,URI> addComputeResourceToExports=Maps.newHashMap(); Integer ...
export the block resources identified by URIs in the given resource id list
protected void writeHeader() throws IOException { header=new byte[SHAPE_FILE_HEADER_LENGTH]; writeBEInt(header,0,SHAPE_FILE_CODE); writeBEInt(header,24,50); writeLEInt(header,28,SHAPE_FILE_VERSION); writeLEInt(header,32,SHAPE_TYPE_NULL); writeLEDouble(header,36,0.0); writeLEDouble(header,44,0.0); writeL...
Writes a blank header into the shape file.
public void testParseLargeFile() throws Exception { MyReader reader=new MyReader(); String delimiter="\r?\n"; Scanner scanner=new Scanner(reader).useDelimiter(delimiter); while (scanner.hasNext()) { scanner.next(); } scanner.close(); reader.close(); }
This test will check when parse a large file like more than 200M bytes if the Scanner will exhaust all heap memory
public Template findTemplate(String name,String contextTypeId){ Assert.isNotNull(name); for (Iterator it=fTemplates.iterator(); it.hasNext(); ) { TemplatePersistenceData data=(TemplatePersistenceData)it.next(); Template template=data.getTemplate(); if (data.isEnabled() && !data.isDeleted() && (contextTy...
Returns the first enabled template that matches both name and context type id.
public void testLimitAndMaxRows() throws Exception { try { this.stmt.executeUpdate("DROP TABLE IF EXISTS testMaxRowsAndLimit"); this.stmt.executeUpdate("CREATE TABLE testMaxRowsAndLimit(limitField INT)"); for (int i=0; i < 500; i++) { this.stmt.executeUpdate("INSERT INTO testMaxRowsAndLimit VALUES (...
Tests that max_rows and 'limit' don't cause exceptions to be thrown.
public CoordinateSequence create(Coordinate[] coordinates){ return coordinates instanceof ExtendedCoordinate[] ? new ExtendedCoordinateSequence((ExtendedCoordinate[])coordinates) : new ExtendedCoordinateSequence(coordinates); }
Returns an ExtendedCoordinateSequence based on the given array -- the array is used directly if it is an instance of ExtendedCoordinate[]; otherwise it is copied.
public float distanceTo(AnimatableValue other){ AnimatableTransformListValue o=(AnimatableTransformListValue)other; if (transforms.isEmpty() || o.transforms.isEmpty()) { return 0f; } AbstractSVGTransform t1=(AbstractSVGTransform)transforms.lastElement(); AbstractSVGTransform t2=(AbstractSVGTransform)o.tra...
Returns the absolute distance between this value and the specified other value.
@Override public void write(final String filename){ this.writeStartPlans(filename); this.writePersons(); this.writeEndPlans(); counter.printCounter(); counter.reset(); log.info("Population written to: " + filename); }
Writes all plans to the file.
@Override public int speed(){ if (this.count == 0) return 0; return (int)(this.count / Math.max(1L,runningTime())); }
return the number of articles per second
public static Button button(ImageView icon,String tip,EventHandler<ActionEvent> onAct){ Button btn=new Button(); btn.setGraphic(icon); btn.setOnAction(onAct); tooltip(btn,tip); return btn; }
Create button with icon only.
public DLSequence(){ }
create an empty sequence
public PostorderTraversal(T node){ super(node); }
Start at the given node.
@Nullable public static Object[] readArray(ObjectInput in) throws IOException, ClassNotFoundException { int len=in.readInt(); Object[] arr=null; if (len > 0) { arr=new Object[len]; for (int i=0; i < len; i++) arr[i]=in.readObject(); } return arr; }
Reads array from input stream.
public boolean isFrozen(){ return frozen; }
Tells whether freeze() has been called on this MethodSet.
public static QueryEntity readQueryEntity(BinaryRawReader in){ QueryEntity res=new QueryEntity(); res.setKeyType(in.readString()); res.setValueType(in.readString()); int cnt=in.readInt(); if (cnt > 0) { LinkedHashMap<String,String> fields=new LinkedHashMap<>(cnt); for (int i=0; i < cnt; i++) field...
Reads the query entity.
public boolean hasBeShownForThisVersion(int appVersionCode){ if (onAllAfter != null) { if (appVersionCode > onAllAfter) { return true; } } if (onAllBefore != null) { if (appVersionCode < onAllBefore) { return true; } } if (onSpecific != null) { if (onSpecific.contains(appVersio...
Checks if one of <code>onAllAfter</code>, <code>onAllBefore</code> or <code>onSpecific</code> matches the given <code>versionCode</code>. If one matches <code>true</code> is returned, else <code>false</code>.
public boolean isValidRow(int row){ return (row >= m_firstid && row <= m_curid && (m_openrows == null || !m_openrows.containsKey(row))); }
Indicates if a given row value is a valid, occupied row of the table.
public void testDisablePrecedence(){ Query expected=new TermQuery(new Term("field","(foo)")); assertEquals(expected,parseKeyword("(foo)",~PRECEDENCE_OPERATORS)); expected=new TermQuery(new Term("field",")foo(")); assertEquals(expected,parseKeyword(")foo(",~PRECEDENCE_OPERATORS)); }
test the ability to enable/disable precedence operators
public double areaUnderPRC(int classIndex){ return m_delegate.areaUnderPRC(classIndex); }
Returns the area under precision-recall curve (AUPRC) for those predictions that have been collected in the evaluateClassifier(Classifier, Instances) method. Returns Utils.missingValue() if the area is not available.
public static void main(String[] args) throws Exception { CheckSource check; StringBuffer text; Enumeration<Option> enm; check=new CheckSource(); if (Utils.getFlag('h',args)) { text=new StringBuffer(); text.append("\nHelp requested:\n\n"); enm=check.listOptions(); while (enm.hasMoreElements())...
Executes the tests, use "-h" to list the commandline options.
public TransferEntropyCalculatorKernelPlainIterators(){ super(); }
Creates a new instance of the kernel-estimate style transfer entropy calculator
private boolean startSymbolicCarry(char[] ca,int cLast,int cFirst){ boolean carry=true; for (int i=cLast; carry && i >= cFirst; i--) { carry=false; switch (ca[i]) { case '0': ca[i]='1'; break; case '1': ca[i]='2'; break; case '2': ca[i]='3'; break; case '3': ca[i]='4'; break; case '4': ca[i]='5'; br...
Start the symbolic carry process. The process is not quite finished because the symbolic carry may change the length of the string and change the exponent (in e format).
public FragmentLoader(Map<String,AttributteFragmentProvider> attfragmentProviderMap){ this.attfragmentProviderMap=attfragmentProviderMap; classCache=new HashMap<String,IGenerator>(); }
Creates a new instance of XMLRulesLoader
public static void init(int numUser,Calendar cal,boolean traceFlag){ try { initCommonVariable(cal,traceFlag,numUser); cis=new CloudInformationService("CloudInformationService"); cisId=cis.getId(); } catch ( IllegalArgumentException s) { Log.printLine("CloudSim.init(): The simulation has been termi...
Initialises CloudSim parameters. This method should be called before creating any entities. <p> Inside this method, it will create the following CloudSim entities: <ul> <li>CloudInformationService. <li>CloudSimShutdown </ul> <p>
public List<Protos.Resource> consumePorts(Collection<Long> requestedValues){ return rangeValues.get(RESOURCE_PORTS).consumeResource(requestedValues); }
Returns a list of Range Resources meeting the requestedvalues. Removes the requested values from the available range resources available in the offer. Uses Preconditions the ensure values are contained in the offer.
public void testEmptyHighlights() throws Exception { RandomIndexWriter iw=new RandomIndexWriter(random(),dir,indexAnalyzer); Document doc=new Document(); Field body=new Field("body","test this is. another sentence this test has. far away is that planet.",fieldType); doc.add(body); iw.addDocument(doc); Ind...
Make sure highlighter returns first N sentences if there were no hits.
public static void writeExtensionMedia(OutputStream theOs,String theStr) throws IOException { theOs.write(theStr.getBytes(StandardCharsets.UTF_8)); theOs.write((byte)0x00); }
Writes an "extension media" in pdu format to the given output stream. It currently only handles ASCII chars, but should be extended to work with other charsets.
public boolean hasAttributes(){ error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); return false; }
Unimplemented. Introduced in DOM Level 2.
public Color readPixelColor(int x,int y,Color result){ if (result == null) { result=new Color(); } ByteBuffer pixelBuffer=(ByteBuffer)this.scratchBuffer(4).clear(); GLES20.glReadPixels(x,y,1,1,GLES20.GL_RGBA,GLES20.GL_UNSIGNED_BYTE,pixelBuffer); pixelBuffer.get(this.pixelArray,0,4); result.red=(this.pix...
Reads the fragment color at a screen point in the currently active OpenGL frame buffer. The X and Y components indicate OpenGL screen coordinates, which originate in the frame buffer's lower left corner.
@Override public void run(){ ImageToProcess img=mImage; Rect safeCrop=guaranteedSafeCrop(img.proxy,img.crop); final TaskImage inputImage=calculateInputImage(img,safeCrop); final int subsample=calculateBestSubsampleFactor(new Size(safeCrop.width(),safeCrop.height()),mTargetSize); final TaskImage resultImage=ca...
Runnable implementation
public int size(){ return effects.size(); }
Returns the size of the EffectList
public static boolean targsUseSynapticInputs(Collection<Synapse> synapses){ if (synapses.isEmpty()) { return true; } if (synapses.size() == 1) { Iterator<Synapse> synIter=synapses.iterator(); if (synIter.next().getTarget() == null) { return true; } } for ( Synapse s : synapses) { if...
Tests to make sure that at least one source neuron in the provided list of synapses is a spiking neuron. . This is used to determine if a spike responder panel should or shouldn't be displayed.
private Set<SuperFamilyHmmer3RawMatch> parseLine(String line){ Set<SuperFamilyHmmer3RawMatch> rawMatches=new HashSet<SuperFamilyHmmer3RawMatch>(); if (line == null || line.equals("")) { LOGGER.warn("Ignoring null or empty line!"); return rawMatches; } String token; String sequenceId=null; String mod...
Create raw matches from this line of text from the binary output. Multiple start/stop locations will cause multiple raw match objects to be created. Any parsing issues with the line will cause a warning message to be logged and an empty or incomplete collection to be returned.
@Override public ImmutableRangeSet<C> subRangeSet(Range<C> range){ if (!isEmpty()) { Range<C> span=span(); if (range.encloses(span)) { return this; } else if (range.isConnected(span)) { return new ImmutableRangeSet<C>(intersectRanges(range)); } } return of(); }
Returns a view of the intersection of this range set with the given range.
public void testUpdate1(){ String newValue="newValue"; String updateQuery="UPDATE " + DatabaseCreator.TEST_TABLE1 + " SET field1='"+ newValue+ "'"; try { int num=statement.executeUpdate(updateQuery); assertEquals("Not all records in the database were updated",numberOfRecords,num); String selectQuery="...
UpdateFunctionalityTest#testUpdate1(). Updates all values in one column in the table
public static byte[] toBytes(String s){ try { return s.getBytes("UTF-8"); } catch ( UnsupportedEncodingException e) { return null; } }
Converts a string to a UTF-8 byte array.
@Override public SoftwarePIDController withTolerance(double tolerance){ target=target.withTolerance(Math.abs(tolerance)); return this; }
Sets the absolute tolerance for this controller.
public boolean isFloat(Class type) throws Exception { return support.isFloat(type); }
This is used to determine if the type specified is a floating point type. Types that are floating point are the double and float primitives as well as the java types for this primitives.
public CpcLocalRunner(DataWrapper dataWrapper,Parameters params,KnowledgeBoxModel knowledgeBoxModel){ super(dataWrapper,params,knowledgeBoxModel); this.sourceGraph=dataWrapper.getSourceGraph(); }
Constructs a wrapper for the given DataWrapper. The DataWrapper must contain a DataSet that is either a DataSet or a DataSet or a DataList containing either a DataSet or a DataSet as its selected model.
private Integer translateDesiredAccuracy(Integer accuracy){ if (accuracy <= 0) { accuracy=LocationRequest.PRIORITY_HIGH_ACCURACY; } else if (accuracy <= 100) { accuracy=LocationRequest.PRIORITY_BALANCED_POWER_ACCURACY; } else if (accuracy <= 1000) { accuracy=LocationRequest.PRIORITY_LOW_POWER; ...
Translates a number representing desired accuracy of GeoLocation system from set [0, 10, 100, 1000]. 0: most aggressive, most accurate, worst battery drain 1000: least aggressive, least accurate, best for battery.
@Override public void stop(){ _state=_state.toStandby(); _firstSuccessTime=0; _startSequenceId.incrementAndGet(); clearRecycle(); }
Disable the client.
@PreAuthorize("hasRole('ROLE_DOWNLOAD')") @Transactional(propagation=Propagation.REQUIRED) public void addProductToCart(Long u_id,Long p_id) throws UserNotExistingException, ProductNotExistingException { Product product=productDao.read(p_id); if (product == null) { throw new ProductNotExistingException(); } ...
Add a product into a user's cart. Is user has no cart, it will be created.
public static boolean isContiguousStateCode(String s){ if (isEmpty(s)) return defaultEmptyOK; return ((ContiguousUSStateCodes.indexOf(s) != -1) && (s.indexOf(USStateCodeDelimiter) == -1)); }
Return true if s is a valid contiguous U.S. Postal Code (abbreviation for state).
private IllegalStateException createException(){ return new IllegalStateException("Hadoop module is not loaded (please ensure that ignite-hadoop.jar is " + "in libs and IgniteConfiguration.peerClassLoadingEnabled is set to false)."); }
Creates an exception to be uniformly thrown from all the methods.
public void clear(){ m.clear(); }
Removes all of the elements from this set.
private void registerComponent(JComponent c){ for ( JComponent root : roots) { for (Component p=c; p != null; p=p.getParent()) { if (p == root) { return; } } } for (int i=0; i < roots.size(); i++) { JComponent root=roots.elementAt(i); for (Component p=root.getParent(); p != nu...
If <code>c</code> isn't a descendant of a component we've already seen, then add it to the roots <code>Vector</code>.
public synchronized void releaseAll(){ if (!done) { if (this.writeConnection != null) { writeConnection.releaseInternal(); writeConnection=null; } for ( LogConnection connection : readConnections) { connection.releaseInternal(); } readConnections=null; done=true; } }
Releases all connections. This must be called when terminating to ensure file descriptors are released.
private void addRow(Dimension dim,int rowWidth,int rowHeight){ dim.width=Math.max(dim.width,rowWidth); if (dim.height > 0) { dim.height+=getVgap(); } dim.height+=rowHeight; }
A new row has been completed. Use the dimensions of this row to update the preferred size for the container.
@DSComment("Private Method") @DSBan(DSCat.PRIVATE_METHOD) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:31:30.519 -0500",hash_original_method="AC707126EF44BD77373D761D306CE415",hash_generated_method="D0E41D6528D270D96ED7F0179237EF44") private View fillFromSelection(int selectedTop...
Fills the grid based on positioning the new selection at a specific location. The selection may be moved so that it does not intersect the faded edges. The grid is then filled upwards and downwards from there.
public boolean hideSubMenus(){ if (mActionButtonPopup != null) { mActionButtonPopup.dismiss(); return true; } return false; }
Dismiss all submenu popups.
public void addOfferListener(OfferListener offerListener){ synchronized (offerListeners) { if (!offerListeners.contains(offerListener)) { offerListeners.add(offerListener); } } }
Adds an offer listener.
@Override public Enumeration<Option> listOptions(){ Vector<Option> result=new Vector<Option>(); result.addElement(new Option("\tSpecify list of string attributes to convert to words.\n" + "\t(default: select all relational attributes)","R",1,"-R <index1,index2-index4,...>")); result.addElement(new Option("\tInver...
Returns an enumeration describing the available options.
private void zzScanError(int errorCode){ String message; try { message=ZZ_ERROR_MSG[errorCode]; } catch ( ArrayIndexOutOfBoundsException e) { message=ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR]; } throw new Error(message); }
Reports an error that occured while scanning. In a wellformed scanner (no or only correct usage of yypushback(int) and a match-all fallback rule) this method will only be called with things that "Can't Possibly Happen". If this method is called, something is seriously wrong (e.g. a JFlex bug producing a faulty scanne...
public static <T,U>SortedMap<T,U> nullToEmpty(@Nullable SortedMap<T,U> potentiallyNull){ return firstNonNull(potentiallyNull,ImmutableSortedMap.<T,U>of()); }
Turns a null sorted map into an empty sorted map..
public static <U>SimpleFastUserIndex<U> load(Stream<U> users){ SimpleFastUserIndex<U> userIndex=new SimpleFastUserIndex<>(); users.forEach(null); return userIndex; }
Creates a user index from a stream of user objects.
private void showNotification(){ CharSequence text=getText(R.string.local_service_started); Notification notification=new Notification(R.drawable.stat_sample,text,System.currentTimeMillis()); PendingIntent contentIntent=PendingIntent.getActivity(this,0,new Intent(this,LocalServiceActivities.Controller.class),0); ...
Show a notification while this service is running.
public void print(String value,boolean checkForEscape) throws IOException { if (!checkForEscape) { printSep(); out.write(value); return; } if (buf.length < value.length()) { buf=new char[value.length()]; } value.getChars(0,value.length(),buf,0); print(buf,0,value.length(),checkForEscape); }
Print the string as the next value on the line. The value will be escaped or encapsulated as needed if checkForEscape==true
public RDFProcessor(XMLReader reader,int subsetDenom,boolean includeAdult,int skew,Pattern topicPattern,boolean snippet) throws IOException { this.reader=reader; this.subsetDenom=subsetDenom; this.includeAdult=includeAdult; this.topicPattern=topicPattern; this.snippet=snippet; this.hashSkew=skew != 0 ? skew...
Pass in an XMLReader, plus a flag as to whether we should include adult material.
public BeanContextServicesSupport(BeanContextServices peer,Locale lcle){ this(peer,lcle,false,true); }
Create an instance using the specified locale
@Override public void generateCode(BlockScope currentScope){ if ((this.bits & IsReachable) == 0) { return; } BranchLabel endifLabel=new BranchLabel(); Constant cst; boolean hasThenPart=!(((cst=this.condition.optimizedBooleanConstant()) != Constant.NotAConstant && cst.booleanValue() == false) || this.thenS...
If code generation
@Override public synchronized void clear(){ File[] files=mRootDirectory.listFiles(); if (files != null) { for ( File file : files) { file.delete(); } } mEntries.clear(); mTotalSize=0; VolleyLog.d("Cache cleared."); }
Clears the cache. Deletes all cached files from disk.
public void testVideoSharingLogQuery() throws RemoteException { Cursor cursor=null; try { String where=VideoSharingLog.SHARING_ID.concat("=?"); String[] whereArgs=new String[]{"123456789"}; cursor=mProvider.query(VideoSharingLog.CONTENT_URI,VIDEO_SHARING_LOG_PROJECTION,where,whereArgs,null); assertN...
Test the VideoSharingLog provider according to GSMA API specifications.<br> Check the following operations: <ul> <li>query <li>insert <li>delete <li>update
protected boolean beforeDelete(){ return delete_Accounting("M_Product_Category_Acct"); }
Before Delete
public void addInternalFrameListener(InternalFrameListener l){ listenerList.add(InternalFrameListener.class,l); enableEvents(0); }
Adds the specified listener to receive internal frame events from this internal frame.
public static final HeaderElement[] parseElements(final String headerValue){ LOG.trace("enter HeaderElement.parseElements(String)"); if (headerValue == null) { return new HeaderElement[]{}; } return parseElements(headerValue.toCharArray()); }
This parses the value part of a header. The result is an array of HeaderElement objects.
public void testNumericScalars() throws Exception { ObjectMapper m=new ObjectMapper(); m.enableDefaultTyping(); assertEquals("[123]",m.writeValueAsString(new Object[]{Integer.valueOf(123)})); assertEquals("[[\"java.lang.Long\",37]]",m.writeValueAsString(new Object[]{Long.valueOf(37)})); assertEquals("[0.25]",...
Unit test to verify that limited number of core types do NOT include type information, even if declared as Object. This is only done for types that JSON scalar values natively map to: String, Integer and Boolean (and nulls never have type information)
public Tag use(String className,String tagBundleName,String tagBundleVersion,Identification id) throws PageException { Queue<Tag> queue=getQueue(toId(className,tagBundleName,tagBundleVersion)); Tag tag=queue.poll(); if (tag != null) return tag; return loadTag(className,tagBundleName,tagBundleVersion,id); }
return a tag to use from a class
public ImmutableClassToInstanceMap<B> build(){ return new ImmutableClassToInstanceMap<B>(mapBuilder.build()); }
Returns a new immutable class-to-instance map containing the entries provided to this builder.
public FluentBiFunction<T1,T2,R> before(final BiConsumer<T1,T2> action){ return withFn(null); }
Apply before advice to this BiFunction
public ByteVector putLong(final long l){ int length=this.length; if (length + 8 > data.length) { enlarge(8); } byte[] data=this.data; int i=(int)(l >>> 32); data[length++]=(byte)(i >>> 24); data[length++]=(byte)(i >>> 16); data[length++]=(byte)(i >>> 8); data[length++]=(byte)i; i=(int)l; data[...
Puts a long into this byte vector. The byte vector is automatically enlarged if necessary.
public static void saveTo(File file,Client client) throws IOException { if (null == client.getGame()) { return; } Writer output=new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file),"UTF-8")); output.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); output.write(CommonConstants.NL); ou...
Save the entities from the game of client to the given file. This will create separate sections for salvage, devastated, and ejected crews in addition to the surviving units <p/> The <code>Entity</code>s\" pilots, damage, ammo loads, ammo usage, and other campaign-related information are retained but data specific to a...
protected void blockLocosTwoColumn(PrintWriter file,List<Engine> engineList,RouteLocation rl,boolean isManifest){ if (isThereWorkAtLocation(null,engineList,rl)) { printEngineHeader(file,isManifest); } int lineLength=getLineLength(isManifest); for ( Engine engine : engineList) { if (engine.getRouteLocat...
Used to generate "Two Column" format for engines.
@Override protected void checkForListType(OneRowChange orc) throws SQLException, ReplicatorException { checkForListType(orc,"SET"); }
Overriding EnumToStringFilter core to check for SET columns in the event. If found, transforms values from integers to corresponding strings.
protected void engineSetMode(String mode){ if (!mode.equalsIgnoreCase("ECB")) { throw new IllegalArgumentException("can't support mode " + mode); } }
should never be called.
public boolean containsValue(V val){ V[] values=_values; if (null == val) { for (int i=values.length; i-- > 0; ) { if (TObjectHash.NULL == values[i]) { return true; } } } else { for (int i=values.length; i-- > 0; ) { V value=unwrapNull(values[i]); if (isFull(values,i) ...
checks for the presence of <tt>val</tt> in the values of the map.
@Override protected void onPause(){ super.onPause(); stopRecording(); }
Called when the activity is about to be paused.
@Override public void onCreate(SQLiteDatabase db){ createSchema(db); }
Called when the database is first created.
private long hash(final byte[] a,final int l,final int k){ final int[] w=weight[k]; long h=init[k]; int i=l; while (i-- != 0) h^=(h << 5) + a[i] * w[i % NUMBER_OF_WEIGHTS] + (h >>> 2); return (h & 0x7FFFFFFFFFFFFFFFL) % m; }
Hashes the given byte array with the given hash function.
private Map<String,Long> readLockColumns(boolean readDataColumns) throws Exception { Map<String,Long> result=Maps.newLinkedHashMap(); ConsistencyLevel read_consistencyLevel=consistencyLevel; if (consistencyLevel == ConsistencyLevel.CL_EACH_QUORUM) { read_consistencyLevel=ConsistencyLevel.CL_LOCAL_QUORUM; } ...
Read all the lock columns. Will also ready data columns if withDataColumns(true) was called
public boolean deletePanel(){ if (!super.deletePanel()) { return false; } turnoutList.clear(); trackList.clear(); pointList.clear(); xingList.clear(); slipList.clear(); turntableList.clear(); return true; }
Invoked by DeletePanel menu item Validate user intent before deleting
public Vector2 tmp(){ return tmp.set(this); }
NEVER EVER SAVE THIS REFERENCE! Do not use this unless you are aware of the side-effects, e.g. other methods might call this as well.
public void testTwoNodeSubmitCommand() throws Throwable { testSubmitCommand(2); }
Tests submitting a command.