code
stringlengths
10
174k
nl
stringlengths
3
129k
public void finish() throws IOException { if (done) { return; } def.finish(); while (!def.finished()) { int byteCount=def.deflate(buf); out.write(buf,0,byteCount); } done=true; }
Writes any unwritten data to the underlying stream. Does not close the stream.
@Override protected MoveResult doTask() throws Exception { e.start(); BuildResult historicalWritesBuildResult=null; try { if (resourceManager.isOverflowAllowed()) throw new IllegalStateException(); try { final ILocalBTreeView src=getIndex(vmd.name); historicalWritesBuildResult=resourceManager.buildIndexSegment(vmd.name,src,true,vmd.commitTime,null,null,e); if (INFO) log.info("Generated compact index segment from historical view: " + historicalWritesBuildResult); } finally { clearRefs(); } final MoveResult moveResult=doAtomicUpdate(resourceManager,vmd.name,historicalWritesBuildResult,targetDataServiceUUID,newPartitionId,e); if (INFO) log.info("Successfully moved index partition: " + summary); return moveResult; } finally { if (historicalWritesBuildResult != null) { resourceManager.retentionSetRemove(historicalWritesBuildResult.segmentMetadata.getUUID()); resourceManager.deleteResource(historicalWritesBuildResult.segmentMetadata.getUUID(),false); } e.end(); } }
Builds a compact index segment from the historical view as of the last commit time on the old journal and then submits an atomic update operation to move the source index partition to the target data service.
public void error(ServiceCoded sc){ if (sc != null) { setServiceCode(sc.getServiceCode().getCode()); setMessage(sc.getMessage()); } updateStatus(Status.error.name()); if (sc instanceof Exception) { _log.info("Setting operation to error due to an exception {}",ExceptionUtils.getExceptionMessage((Exception)sc)); _log.info("Caused by: {} ",(Exception)sc); } }
This method sets the status of the operation to "error"
@Bean public ObjectMapper objectMapper(){ return new ObjectMapper(); }
Jackson ObjectMapper
public static byte[] reverseBytes(byte[] bytes){ byte[] buf=new byte[bytes.length]; for (int i=0; i < bytes.length; i++) buf[i]=bytes[bytes.length - 1 - i]; return buf; }
Returns a copy of the given byte array in reverse order.
public void quit(){ mQuit=true; interrupt(); }
Forces this dispatcher to quit immediately. If any requests are still in the queue, they are not guaranteed to be processed.
public Object runSafely(Catbert.FastStack stack) throws Exception { Show s=getShow(stack); if (s == null) return new Float(0); String rating=s.getRating(); if (rating == null) return new Float(0); float f=0; for (int i=0; i < rating.length(); i++) { if (rating.charAt(i) == '*') f=f + 1.0f; else if (rating.charAt(i) == '+') f=f + 0.5f; } return new Float(f); }
Returns the star rating for a Movie as a floating point number.
public XObject operate(XObject right) throws javax.xml.transform.TransformerException { return (XString)right.xstr(); }
Apply the operation to two operands, and return the result.
protected void prepare(){ for ( ProcessInfoParameter para : getParameter()) { String name=para.getParameterName(); if (para.getParameter() == null) ; else if (name.equals(PARAM_M_Warehouse_ID)) p_M_Warehouse_ID=para.getParameterAsInt(); else log.log(Level.SEVERE,"Unknown Parameter: " + name); } p_C_Invoice_ID=getRecord_ID(); }
Prepare - e.g., get Parameters.
@Deprecated public static File createTempDir() throws IOException { return DefaultGroovyStaticMethods.createTempDir(null); }
Creates a temporary directory in the default temporary directory (as specified by the system property <i>java.io.tmpdir</i>.
protected void fireTradeOrderStatusChanged(TradeOrder tradeOrder){ Object[] listeners=this.listenerList.getListenerList(); for (int i=listeners.length - 2; i >= 0; i-=2) { if (listeners[i] == BrokerChangeListener.class) { ((BrokerChangeListener)listeners[i + 1]).tradeOrderStatusChanged(tradeOrder); } } }
Notifies all registered listeners that the brokerManagerModel has opened a trade position.
public ContentEncodingParser(String contentEncoding){ super(contentEncoding); }
Creates a new instance of ContentEncodingParser
public boolean isCreateField(){ return fCreateField; }
Returns whether the field will be moved to extracted class. The default is <code>true</code>
public static BigDecimal paidToDate(int p_C_Invoice_ID,int p_C_Currency_ID,int p_MultiplierAP,Timestamp DateAcct) throws SQLException { if (p_C_Invoice_ID == 0 || p_C_Currency_ID == 0) return null; BigDecimal MultiplierAP=new BigDecimal((double)p_MultiplierAP); if (p_MultiplierAP == 0) MultiplierAP=Adempiere.ONE; int C_ConversionType_ID=0; BigDecimal paymentAmt=allocatedAmtToDate(p_C_Invoice_ID,p_C_Currency_ID,C_ConversionType_ID,MultiplierAP,DateAcct); return Currency.round(paymentAmt,p_C_Currency_ID,null); }
Get Invoice paid(allocated) amount. - invoicePaid
public static void main(String... a) throws Exception { TestBase.createCaller().init().test(); }
Run just this test.
public ExtractConstantRefactoring(ICompilationUnit unit,int selectionStart,int selectionLength){ Assert.isTrue(selectionStart >= 0); Assert.isTrue(selectionLength >= 0); fSelectionStart=selectionStart; fSelectionLength=selectionLength; fCu=unit; fCuRewrite=null; fLinkedProposalModel=null; fConstantName=""; fCheckResultForCompileProblems=true; }
Creates a new extract constant refactoring
public AuthenticationInfo(){ super(NAME); parameters.setSeparator(COMMA); }
Default contstructor.
public AsyncResult CreateMonitoredItemsAsync(RequestHeader RequestHeader,UnsignedInteger SubscriptionId,TimestampsToReturn TimestampsToReturn,MonitoredItemCreateRequest... ItemsToCreate){ CreateMonitoredItemsRequest req=new CreateMonitoredItemsRequest(RequestHeader,SubscriptionId,TimestampsToReturn,ItemsToCreate); return channel.serviceRequestAsync(req); }
Asynchronous CreateMonitoredItems service request.
public LogbackFactoryAccessor(ClassLoader cl) throws ClassNotFoundException, IllegalAccessException, InvocationTargetException { Class clazz=cl.loadClass("org.slf4j.impl.StaticLoggerBinder"); Method getSingleton=MethodUtils.getAccessibleMethod(clazz,"getSingleton",new Class[0]); Object singleton=getSingleton.invoke(null); Method getLoggerFactory=MethodUtils.getAccessibleMethod(clazz,"getLoggerFactory",new Class[0]); Object loggerFactory=getLoggerFactory.invoke(singleton); Class loggerFactoryClass=cl.loadClass("ch.qos.logback.classic.LoggerContext"); if (!loggerFactoryClass.isInstance(loggerFactory)) { throw new RuntimeException("The singleton SLF4J binding was not Logback"); } setTarget(loggerFactory); }
Attempts to initialize a Logback logger factory via the given class loader.
public long toLong(){ return m_value.longValue(); }
Returns the long value of the address.
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:34:28.581 -0500",hash_original_method="34D447B50A8BF0311FD91158BAB8271D",hash_generated_method="629A4461D3844C6A125DAA9A9D517CBA") public PeriodicSync(Account account,String authority,Bundle extras,long period){ this.account=account; this.authority=authority; this.extras=new Bundle(extras); this.period=period; }
Creates a new PeriodicSync, copying the Bundle
public boolean isPacked(){ String ext=getExtension().toLowerCase(); return (ext.equals("zip") || ext.equals("rar") || ext.equals("7z")|| ext.matches("r\\d+")); }
is this a "packed" file? (zip, rar, whatsoever).
public QQPlotDisplayPanel(QQPlot qqPlot){ this.qqPlot=qqPlot; if (qqPlot == null) { throw new NullPointerException("Given q-q plot must be null"); } this.addMouseMotionListener(new MouseMovementListener()); this.setToolTipText(" "); }
Constructs the histogram dipslay panel given the initial histogram to display.
private static JFreeChart createLineChart3D(){ Number[][] data=new Integer[][]{{new Integer(-3),new Integer(-2)},{new Integer(-1),new Integer(1)},{new Integer(2),new Integer(3)}}; CategoryDataset dataset=DatasetUtilities.createCategoryDataset("S","C",data); return ChartFactory.createLineChart3D("Line Chart","Domain","Range",dataset); }
Create a line chart with sample data in the range -3 to +3.
public void complement(){ assert (opMode == Mode.POLAR_DENSE); char t=(char)(CircleLookupTable.PHASE_RESOLUTION / 2); for (int i=0; i < dimension; i++) phaseAngles[i]+=t; }
Transforms this vector into its complement. Assumes vector is in dense polar form.
public static JBBPOut BeginBin(final OutputStream out){ return new JBBPOut(out,DEFAULT_BYTE_ORDER,DEFAULT_BIT_ORDER); }
Start a DSL session for a defined output stream and default parameters.
public static String unquoteIfJavaKeyword(String name){ String unquoted=unquote(name); if (isJavaKeyword(unquoted)) return unquoted; return name; }
Removes dollar ($) prefix from the given name if it was a quoted Java keyword
public static void assertJPost(String request,String content,String... tests) throws Exception { assertJPost(request,content,JSONTestUtil.DEFAULT_DELTA,tests); }
Validates the response from a POST request matches some JSON test expressions
public FBXAException(String msg,int errorCode,Exception reason){ this(msg,errorCode); this.reason=reason; initCause(reason); }
Create a new instance of <code>FBXAException</code> based around a message and with an underlying exception.
public void clear() throws SchedulerException { try { getRemoteScheduler().clear(); } catch ( RemoteException re) { throw invalidateHandleCreateException("Error communicating with remote scheduler.",re); } }
<p> Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>. </p>
public void sendMessage(SIPMessage sipMessage) throws IOException { long time=System.currentTimeMillis(); this.sendMessage(sipMessage,true); if (this.sipStack.getStackLogger().isLoggingEnabled(ServerLogger.TRACE_MESSAGES)) logMessage(sipMessage,peerAddress,peerPort,time); }
Return a formatted message to the client. We try to re-connect with the peer on the other end if possible.
public static boolean validateCardNumber(String cardNumber) throws NumberFormatException { int sum=0, digit, addend=0; boolean doubled=false; for (int i=cardNumber.length() - 1; i >= 0; i--) { digit=Integer.parseInt(cardNumber.substring(i,i + 1)); if (doubled) { addend=digit * 2; if (addend > 9) { addend-=9; } } else { addend=digit; } sum+=addend; doubled=!doubled; } return (sum % 10) == 0; }
Validates the credit card number using the Luhn algorithm
private int addEntry(E entry){ entries[numEntries++]=entry; return numEntries - 1; }
Adds the specified entry to the entries array and increases the numEntries counter.
private static File createTempFileInSameDirectoryAs(File file) throws IOException { File dir=file.getParentFile(); if (dir == null) dir=new File("."); return File.createTempFile("jartmp",null,dir); }
Creates a new empty temporary file in the same directory as the specified file. A variant of File.createTempFile.
public void testGetLocalName() throws Throwable { Document doc; Element element; Element qelement; Attr attr; Attr qattr; String localElemName; String localQElemName; String localAttrName; String localQAttrName; doc=(Document)load("staff",builder); element=doc.createElementNS("http://www.w3.org/DOM/Test/elem","elem"); qelement=doc.createElementNS("http://www.w3.org/DOM/Test/elem","qual:qelem"); attr=doc.createAttributeNS("http://www.w3.org/DOM/Test/attr","attr"); qattr=doc.createAttributeNS("http://www.w3.org/DOM/Test/attr","qual:qattr"); localElemName=element.getLocalName(); localQElemName=qelement.getLocalName(); localAttrName=attr.getLocalName(); localQAttrName=qattr.getLocalName(); assertEquals("nodegetlocalname03_localElemName","elem",localElemName); assertEquals("nodegetlocalname03_localQElemName","qelem",localQElemName); assertEquals("nodegetlocalname03_localAttrName","attr",localAttrName); assertEquals("nodegetlocalname03_localQAttrName","qattr",localQAttrName); }
Runs the test case.
public int start_state(){ return 0; }
Indicates start state.
private void showFeedback(String message){ if (myHost != null) { myHost.showFeedback(message); } else { System.out.println(message); } }
Used to communicate feedback pop-up messages between a plugin tool and the main Whitebox user-interface.
public int size(){ return (tail - head) & (elements.length - 1); }
Returns the number of elements in this deque.
public static void main(final String[] args){ DOMTestCase.doMain(nodetextnodename.class,args); }
Runs this test from the command line.
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2014-03-25 14:54:54.299 -0400",hash_original_method="CCEBFF7F71B5744B0502DA0F73CE72D0",hash_generated_method="218E19485147294D1EFF0EB93065B0E0") public void addMimeType(String mimeType){ mMimeTypeList.add(mimeType); }
Adds the specified MIME type to the list of MIME types this DRM plug-in supports.
public static void main(final String[] args) throws IOException { final File directory=new File(args[0]); final SequencesReader sr=SequencesReaderFactory.createDefaultSequencesReader(directory); final ReferenceGenome male=new ReferenceGenome(sr,Sex.MALE); System.out.println("male"); System.out.println(male.toString()); System.out.println(); final ReferenceGenome female=new ReferenceGenome(sr,Sex.FEMALE); System.out.println("female"); System.out.println(female.toString()); System.out.println(); final ReferenceGenome either=new ReferenceGenome(sr,Sex.EITHER); System.out.println("either"); System.out.println(either.toString()); System.out.println(); }
Check that a reference.txt file inside an SDF directory is valid for both male and female.
@NonNull public AuthorizationResponse build(){ return new AuthorizationResponse(mRequest,mState,mTokenType,mAuthorizationCode,mAccessToken,mAccessTokenExpirationTime,mIdToken,mScope,Collections.unmodifiableMap(mAdditionalParameters)); }
Builds the Authorization object.
public boolean isProcessed(){ Object oo=get_Value(COLUMNNAME_Processed); if (oo != null) { if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); return "Y".equals(oo); } return false; }
Get Processed.
public AffineTransformation reflect(double x,double y){ compose(reflectionInstance(x,y)); return this; }
Updates the value of this transformation to that of a reflection transformation composed with the current value.
public synchronized void reset(){ m_elapsed=0; }
Resets the timer back to zero
public PtAccessibility(Scenario sc,List<Integer> distanceCluster,int quadrantSegments,SortedMap<String,List<String>> activityCluster,String targetCoordinateSystem,int gridSize){ super(PtAccessibility.class.getSimpleName()); this.scenario=sc; this.quadrantSegments=quadrantSegments; this.distanceCluster=createClusterCircles(distanceCluster,this.quadrantSegments); this.activityCluster=activityCluster; this.activityCluster.put("unknown",new ArrayList<String>()); this.targetCoordinateSystem=targetCoordinateSystem; this.gridSize=gridSize; }
This module creates circles around all used TransitStops within the specified distances for all modes and writes one shapefile per distance-cluster. After that the activities will be clustered as specified and written to a shapefile. Out of the processed data a csv-file is generated, containing a table of the relative number of stops per mode within the specified clusters.
public List<String> header(String key){ return headers.get(key); }
Get header of option
public static Stats of(int... values){ StatsAccumulator acummulator=new StatsAccumulator(); acummulator.addAll(values); return acummulator.snapshot(); }
Returns statistics over a dataset containing the given values.
@SuppressWarnings("deprecation") static HttpUriRequest createHttpRequest(Request<?> request,Map<String,String> additionalHeaders) throws AuthFailureError { switch (request.getMethod()) { case Method.DEPRECATED_GET_OR_POST: { byte[] postBody=request.getPostBody(); if (postBody != null) { HttpPost postRequest=new HttpPost(request.getUrl()); postRequest.addHeader(HEADER_CONTENT_TYPE,request.getPostBodyContentType()); HttpEntity entity; entity=new ByteArrayEntity(postBody); postRequest.setEntity(entity); return postRequest; } else { return new HttpGet(request.getUrl()); } } case Method.GET: return new HttpGet(request.getUrl()); case Method.DELETE: return new HttpDelete(request.getUrl()); case Method.POST: { HttpPost postRequest=new HttpPost(request.getUrl()); postRequest.addHeader(HEADER_CONTENT_TYPE,request.getBodyContentType()); setEntityIfNonEmptyBody(postRequest,request); return postRequest; } case Method.PUT: { HttpPut putRequest=new HttpPut(request.getUrl()); putRequest.addHeader(HEADER_CONTENT_TYPE,request.getBodyContentType()); setEntityIfNonEmptyBody(putRequest,request); return putRequest; } default : throw new IllegalStateException("Unknown request method."); } }
Creates the appropriate subclass of HttpUriRequest for passed in request.
public boolean[] doFrustumCheck(Vector3D[] frustumCorners,Vector3D frustumPos,double x,double y,double z){ Vector3D point=new Vector3D(x,y,z); boolean c1=crossPlane(new Vector3D[]{frustumPos,frustumCorners[3],frustumCorners[0]},point); boolean c2=crossPlane(new Vector3D[]{frustumPos,frustumCorners[0],frustumCorners[1]},point); boolean c3=crossPlane(new Vector3D[]{frustumPos,frustumCorners[1],frustumCorners[2]},point); boolean c4=crossPlane(new Vector3D[]{frustumPos,frustumCorners[2],frustumCorners[3]},point); return new boolean[]{c1,c2,c3,c4}; }
Performs a frustum check.
Attributes parseAttributes() throws JasperException { AttributesImpl attrs=new AttributesImpl(); reader.skipSpaces(); while (parseAttribute(attrs)) reader.skipSpaces(); return attrs; }
Attributes ::= (S Attribute)* S?
public synchronized void sort(final Comparator<String[]> comparator){ Check.notNull(comparator,"comparator"); Collections.sort(rows,comparator); }
Sort the rows already added to this table with the given comparator. Does not affect rows added later.
public final void printLongString(CharSequence text) throws IOException { if (text == null) { appendAscii("null.string"); } else { appendAscii(TRIPLE_QUOTES); printCodePoints(text,LONG_STRING_ESCAPE_CODES); appendAscii(TRIPLE_QUOTES); } }
Print an Ion triple-quoted string
public ST createStringTemplateInternally(CompiledST impl){ ST st=createStringTemplate(impl); if (trackCreationEvents && st.debugState != null) { st.debugState.newSTEvent=null; } return st; }
Differentiate so we can avoid having creation events for regions, map operations, and other implicit "new ST" events during rendering.
public WrongClassTypeException(String message){ super(message); }
Create a new <code>WrongClassTypeException</code> with a message text.
public boolean isUnicast(){ return unicast; }
Normally event sources are multicast. However there are some exceptions that are strictly unicast.
public void register(Kryo kryo){ kryo.register(IAgentStorageService.class); kryo.register(IAgentService.class); kryo.register(IKeepAliveService.class); kryo.register(RegisterTCP.class); kryo.register(RegisterUDP.class); kryo.register(KeepAlive.class); kryo.register(DiscoverHost.class); kryo.register(Ping.class); ObjectSpace.registerClasses(kryo); }
Registers needed classes for network communication.
public static void startFinalizer(Class<?> finalizableReferenceClass,ReferenceQueue<Object> queue,PhantomReference<Object> frqReference){ if (!finalizableReferenceClass.getName().equals(FINALIZABLE_REFERENCE)) { throw new IllegalArgumentException("Expected " + FINALIZABLE_REFERENCE + "."); } Finalizer finalizer=new Finalizer(finalizableReferenceClass,queue,frqReference); Thread thread=new Thread(finalizer); thread.setName(Finalizer.class.getName()); thread.setDaemon(true); try { if (inheritableThreadLocals != null) { inheritableThreadLocals.set(thread,null); } } catch ( Throwable t) { logger.log(Level.INFO,"Failed to clear thread local values inherited by reference finalizer thread.",t); } thread.start(); }
Starts the Finalizer thread. FinalizableReferenceQueue calls this method reflectively.
public void testProcessString() throws ChessParseError { Game game=new Game(null,new TimeControlData()); assertEquals(TextIO.startPosFEN,TextIO.toFEN(game.currPos())); boolean res=game.processString("Nf3"); assertEquals(true,res); assertEquals(1,game.currPos().halfMoveClock); assertEquals(1,game.currPos().fullMoveCounter); res=game.processString("d5"); assertEquals(true,res); assertEquals(0,game.currPos().halfMoveClock); assertEquals(2,game.currPos().fullMoveCounter); game.undoMove(); assertEquals(1,game.currPos().halfMoveClock); assertEquals(1,game.currPos().fullMoveCounter); game.undoMove(); assertEquals(TextIO.startPosFEN,TextIO.toFEN(game.currPos())); game.undoMove(); assertEquals(TextIO.startPosFEN,TextIO.toFEN(game.currPos())); game.redoMove(); assertEquals(1,game.currPos().halfMoveClock); assertEquals(1,game.currPos().fullMoveCounter); game.redoMove(); assertEquals(0,game.currPos().halfMoveClock); assertEquals(2,game.currPos().fullMoveCounter); game.redoMove(); assertEquals(0,game.currPos().halfMoveClock); assertEquals(2,game.currPos().fullMoveCounter); game.newGame(); assertEquals(TextIO.startPosFEN,TextIO.toFEN(game.currPos())); String fen="8/8/8/4k3/8/8/2p5/5K2 b - - 47 68"; Position pos=TextIO.readFEN(fen); game.setPos(TextIO.readFEN(fen)); assertEquals(pos,game.currPos()); res=game.processString("junk"); assertEquals(false,res); game.newGame(); res=game.processString("e7e5"); assertEquals(false,res); }
Test of processString method, of class Game.
public Builder considerExifParams(boolean considerExifParams){ this.considerExifParams=considerExifParams; return this; }
Sets whether ImageLoader will consider EXIF parameters of JPEG image (rotate, flip)
public static String encodeBase64URLSafeString(byte[] binaryData){ return org.apache.commons.codec.binary.Base64.encodeBase64URLSafeString(binaryData); }
Encodes binary data using a URL-safe variation of the base64 algorithm but does not chunk the output. The url-safe variation emits - and _ instead of + and / characters.
public void init(int WindowNo,FormFrame frame){ log.info(""); m_WindowNo=WindowNo; m_frame=frame; Env.setContext(Env.getCtx(),m_WindowNo,"IsSOTrx","Y"); try { super.dynInit(); dynInit(); jbInit(); frame.getContentPane().add(mainPanel,BorderLayout.CENTER); frame.setSize(1000,400); } catch ( Exception ex) { log.log(Level.SEVERE,"init",ex); } }
Initialize Panel
public boolean absolute(int row) throws SQLException { if (row == 0 || getType() == ResultSet.TYPE_FORWARD_ONLY) { throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.absolute").toString()); } if (row > 0) { if (row > numRows) { afterLast(); return false; } else { if (absolutePos <= 0) internalFirst(); } } else { if (cursorPos + row < 0) { beforeFirst(); return false; } else { if (absolutePos >= 0) internalLast(); } } while (absolutePos != row) { if (absolutePos < row) { if (!internalNext()) break; } else { if (!internalPrevious()) break; } } notifyCursorMoved(); if (isAfterLast() || isBeforeFirst()) { return false; } else { return true; } }
Moves this <code>CachedRowSetImpl</code> object's cursor to the row number specified. <p>If the number is positive, the cursor moves to an absolute row with respect to the beginning of the rowset. The first row is row 1, the second is row 2, and so on. For example, the following command, in which <code>crs</code> is a <code>CachedRowSetImpl</code> object, moves the cursor to the fourth row, starting from the beginning of the rowset. <PRE><code> crs.absolute(4); </code> </PRE> <P> If the number is negative, the cursor moves to an absolute row position with respect to the end of the rowset. For example, calling <code>absolute(-1)</code> positions the cursor on the last row, <code>absolute(-2)</code> moves it on the next-to-last row, and so on. If the <code>CachedRowSetImpl</code> object <code>crs</code> has five rows, the following command moves the cursor to the fourth-to-last row, which in the case of a rowset with five rows, is also the second row, counting from the beginning. <PRE><code> crs.absolute(-4); </code> </PRE> If the number specified is larger than the number of rows, the cursor will move to the position after the last row. If the number specified would move the cursor one or more rows before the first row, the cursor moves to the position before the first row. <P> Note: Calling <code>absolute(1)</code> is the same as calling the method <code>first()</code>. Calling <code>absolute(-1)</code> is the same as calling <code>last()</code>.
protected void resetCutOffDay(long supplAdminKey) throws Exception { resetCutOffDay(supplAdminKey,UserRoleType.SERVICE_MANAGER); }
Reset the cutoffDay for the given supplier organization
public String toString(){ return imgInfo.toString() + " interlaced=" + interlaced; }
Basic info, for debugging.
public void addRateLimit(RateLimitType type,long retryAfter){ addRateLimit(type,null,retryAfter); }
Adds a rate limit for the given type.
public static void reinitiate(){ CLIENT_INSTANCE=new FrequencyGrid(); SERVER_INSTANCE=new FrequencyGrid(); }
Called to re-initiate the grid. Used when server restarts or when player rejoins a world to clean up previously registered objects.
@Override public void addValueAtIndex(final IScope scope,final Object index,final V value){ setValueAtIndex(scope,index,value); }
Method add()
public Object pop(){ return stack.pop(); }
Returns the latest element from the stack, removes it.
protected void update(){ updateVisualizerMenus(); if (currentSubplot != null) { showPlot(currentSubplot); } overview.lazyRefresh(); }
Refresh the overview
protected void onFieldShort(final Object obj,final Field field,final Bin annotation,final boolean signed,final int value){ }
Notification about short field.
public static Geo center(GeoArray poly,Geo ret){ Geo c=poly.get(0,new Geo()); int size=poly.getSize(); for (int i=1; i < size; i++) { poly.get(i,ret); c=c.add(ret,c); } return c.normalize(ret); }
Returns the center of the polygon poly.
private JMenu createViewMenu(){ JMenuItem menuItem; JMenu menu; menu=new JMenu(ResourceManager.translate("view.menu")); menu.setMnemonic(KeyStroke.getKeyStroke(ResourceManager.translate("view.menu.mnem")).getKeyCode()); menu.getAccessibleContext().setAccessibleDescription(ResourceManager.translate("view.menu.description")); add(menu); expandAllMenuItem=new JMenuItem(ResourceManager.translate("view.expand"),KeyStroke.getKeyStroke(ResourceManager.translate("view.expand.mnem")).getKeyCode()); expandAllMenuItem.setIcon(TDA.createImageIcon("Expanded.png")); expandAllMenuItem.setAccelerator(KeyStroke.getKeyStroke(ResourceManager.translate("view.expand.accel"))); expandAllMenuItem.getAccessibleContext().setAccessibleDescription(ResourceManager.translate("view.expand.description")); expandAllMenuItem.addActionListener(listener); expandAllMenuItem.setEnabled(false); menu.add(expandAllMenuItem); collapseAllMenuItem=new JMenuItem(ResourceManager.translate("view.collapse"),KeyStroke.getKeyStroke(ResourceManager.translate("view.collapse.mnem")).getKeyCode()); collapseAllMenuItem.setIcon(TDA.createImageIcon("Collapsed.png")); collapseAllMenuItem.setAccelerator(KeyStroke.getKeyStroke(ResourceManager.translate("view.collapse.accel"))); collapseAllMenuItem.getAccessibleContext().setAccessibleDescription(ResourceManager.translate("view.collapse.description")); collapseAllMenuItem.setEnabled(false); collapseAllMenuItem.addActionListener(listener); menu.add(collapseAllMenuItem); menu.addSeparator(); menuItem=new JCheckBoxMenuItem(ResourceManager.translate("view.showtoolbar"),PrefManager.get().getShowToolbar()); menuItem.setMnemonic(KeyStroke.getKeyStroke(ResourceManager.translate("view.showtoolbar.mnem")).getKeyCode()); menuItem.addActionListener(listener); menuItem.setIcon(TDA.createImageIcon("Empty.gif")); menu.add(menuItem); return (menu); }
Build tools menu in the menu bar.
public short wIndex(){ return this.controlSetup.getShort(4); }
Returns the index. Varies according to request, typically used to pass an index or offset
public TransitionExpressionConfigAttribute(Expression authorizeExpression){ Assert.notNull(authorizeExpression,"Expression must be set"); this.authorizeExpression=authorizeExpression; }
Instantiates a new transition expression config attribute.
@Override public Optional<ClientAppUserAccessToken> verifyAccessToken(@Nullable String rawAccessToken){ return ClientAppUserAccessToken.tryDecode(rawAccessToken,oauthSecret).filter(null); }
unlike AccountAccessToken, which have two variations (one is in memory verify, the other is hit db for strong verify). ClientAppAccessToken are always check against db, but with one minute local caching window. So in worst cases, user or app revoke, the token require wait up to one minute to take effect when kaif deploy to multiple servers.
public void clearLoggersCache(){ loggers.clear(); }
Removes all currently cached loggers. Note that loggers still used by other objects will not be disposed or garbage collected - this method only affects internal logger service cache.
public void openChat() throws RcsGenericException { try { mGroupChatInf.openChat(); } catch ( Exception e) { throw new RcsGenericException(e); } }
open the chat conversation.<br> Note: if it is an incoming pending chat session and the parameter IM SESSION START is 0 then the session is accepted now.
public void nodeRemoved(SessionEvent event){ }
Indicates that a node has been removed.
public ResponseFuture request(Object request) throws RemotingException { return client.request(request); }
Description: <br>
public static ScalarOperator parseScalarBinaryOperator(String opcode,boolean arg1IsScalar,double constant) throws DMLRuntimeException { if (opcode.equalsIgnoreCase("+")) { return new RightScalarOperator(Plus.getPlusFnObject(),constant); } else if (opcode.equalsIgnoreCase("*")) { return new RightScalarOperator(Multiply.getMultiplyFnObject(),constant); } else if (opcode.equalsIgnoreCase("-")) { if (arg1IsScalar) return new LeftScalarOperator(Minus.getMinusFnObject(),constant); else return new RightScalarOperator(Minus.getMinusFnObject(),constant); } else if (opcode.equalsIgnoreCase("-nz")) { return new RightScalarOperator(MinusNz.getMinusNzFnObject(),constant); } else if (opcode.equalsIgnoreCase("/")) { if (arg1IsScalar) return new LeftScalarOperator(Divide.getDivideFnObject(),constant); else return new RightScalarOperator(Divide.getDivideFnObject(),constant); } else if (opcode.equalsIgnoreCase("%%")) { if (arg1IsScalar) return new LeftScalarOperator(Modulus.getFnObject(),constant); else return new RightScalarOperator(Modulus.getFnObject(),constant); } else if (opcode.equalsIgnoreCase("%/%")) { if (arg1IsScalar) return new LeftScalarOperator(IntegerDivide.getFnObject(),constant); else return new RightScalarOperator(IntegerDivide.getFnObject(),constant); } else if (opcode.equalsIgnoreCase("^")) { if (arg1IsScalar) return new LeftScalarOperator(Power.getPowerFnObject(),constant); else return new RightScalarOperator(Power.getPowerFnObject(),constant); } else if (opcode.equalsIgnoreCase("max")) { return new RightScalarOperator(Builtin.getBuiltinFnObject("max"),constant); } else if (opcode.equalsIgnoreCase("min")) { return new RightScalarOperator(Builtin.getBuiltinFnObject("min"),constant); } else if (opcode.equalsIgnoreCase("log") || opcode.equalsIgnoreCase("log_nz")) { if (arg1IsScalar) return new LeftScalarOperator(Builtin.getBuiltinFnObject(opcode),constant); return new RightScalarOperator(Builtin.getBuiltinFnObject(opcode),constant); } else if (opcode.equalsIgnoreCase(">")) { if (arg1IsScalar) return new LeftScalarOperator(GreaterThan.getGreaterThanFnObject(),constant); return new RightScalarOperator(GreaterThan.getGreaterThanFnObject(),constant); } else if (opcode.equalsIgnoreCase(">=")) { if (arg1IsScalar) return new LeftScalarOperator(GreaterThanEquals.getGreaterThanEqualsFnObject(),constant); return new RightScalarOperator(GreaterThanEquals.getGreaterThanEqualsFnObject(),constant); } else if (opcode.equalsIgnoreCase("<")) { if (arg1IsScalar) return new LeftScalarOperator(LessThan.getLessThanFnObject(),constant); return new RightScalarOperator(LessThan.getLessThanFnObject(),constant); } else if (opcode.equalsIgnoreCase("<=")) { if (arg1IsScalar) return new LeftScalarOperator(LessThanEquals.getLessThanEqualsFnObject(),constant); return new RightScalarOperator(LessThanEquals.getLessThanEqualsFnObject(),constant); } else if (opcode.equalsIgnoreCase("==")) { if (arg1IsScalar) return new LeftScalarOperator(Equals.getEqualsFnObject(),constant); return new RightScalarOperator(Equals.getEqualsFnObject(),constant); } else if (opcode.equalsIgnoreCase("!=")) { if (arg1IsScalar) return new LeftScalarOperator(NotEquals.getNotEqualsFnObject(),constant); return new RightScalarOperator(NotEquals.getNotEqualsFnObject(),constant); } else if (opcode.equalsIgnoreCase("*2")) { return new RightScalarOperator(Multiply2.getMultiply2FnObject(),constant); } else if (opcode.equalsIgnoreCase("^2")) { return new RightScalarOperator(Power2.getPower2FnObject(),constant); } else if (opcode.equalsIgnoreCase("1-*")) { return new RightScalarOperator(Minus1Multiply.getMinus1MultiplyFnObject(),constant); } else if (opcode.equalsIgnoreCase("s-r")) { return new LeftScalarOperator(Minus.getMinusFnObject(),constant); } else if (opcode.equalsIgnoreCase("so")) { return new LeftScalarOperator(Divide.getDivideFnObject(),constant); } throw new DMLRuntimeException("Unknown binary opcode " + opcode); }
scalar-matrix operator
protected String convertCharEntity(String charEntity){ try { return HTMLUtils.convertCharEntity(charEntity,true,null); } catch ( IllegalArgumentException iae) { return super.convertCharEntity(charEntity); } }
Overrides XMLParser.convertCharEntity to add in HTML char entities
public boolean isShutdown() throws SchedulerException { try { return getRemoteScheduler().isShutdown(); } catch ( RemoteException re) { throw invalidateHandleCreateException("Error communicating with remote scheduler.",re); } }
<p> Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>. </p>
protected void overrideStylePropertyRemoved(CSSStylableElement e,String name){ Iterator i=cssNavigableDocumentListeners.keySet().iterator(); while (i.hasNext()) { CSSNavigableDocumentListener l=(CSSNavigableDocumentListener)i.next(); l.overrideStylePropertyRemoved(e,name); } }
A property in the override style declaration has been removed.
public static String generateNewDomainRoid(String tld){ return createDomainRoid(ObjectifyService.allocateId(),tld); }
Returns a newly allocated, globally unique domain repoId of the format HEX-TLD.
public boolean contains(String unicode){ if (unicode.length() == 1) { int unicodeVal=unicode.charAt(0); return contains(unicodeVal); } return false; }
Returns true if the specified unicode value is within this range.
@POST @Consumes({MediaType.APPLICATION_XML,MediaType.APPLICATION_JSON}) @Produces({MediaType.APPLICATION_XML,MediaType.APPLICATION_JSON}) @Path("/{id}/protection/snapshot-sessions") @CheckPermission(roles={Role.SYSTEM_ADMIN},acls={ACL.ANY}) public TaskList createConsistencyGroupSnapshotSession(@PathParam("id") URI consistencyGroupId,SnapshotSessionCreateParam param){ BlockConsistencyGroup cg=queryObject(BlockConsistencyGroup.class,consistencyGroupId,true); validateVolumesInReplicationGroups(cg,param.getVolumes(),_dbClient); return getSnapshotSessionManager().createSnapshotSession(cg,param,getFullCopyManager()); }
Creates a consistency group snapshot session
protected DTEDFrameCacheHandler(){ this(null); }
The DTEDFrameCache must be set at some point.
@DSSafe(DSCat.SAFE_LIST) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2014-09-03 14:59:50.416 -0400",hash_original_method="82AABA56BCAF4EA117FD967EA0C801E1",hash_generated_method="45823FC2302E3887DFCEFEED7BEB9398") public static int readSwappedUnsignedShort(InputStream input) throws IOException { int value1=read(input); int value2=read(input); return (((value1 & 0xff) << 0) + ((value2 & 0xff) << 8)); }
Reads a unsigned short (16-bit) from an InputStream. The value is converted to the opposed endian system while reading.
private void appendSequenceText(CoordinateSequence seq,int level,boolean doIndent,Writer writer) throws IOException { if (seq.size() == 0) { writer.write("EMPTY"); } else { if (doIndent) indent(level,writer); writer.write("("); for (int i=0; i < seq.size(); i++) { if (i > 0) { writer.write(", "); if (coordsPerLine > 0 && i % coordsPerLine == 0) { indent(level + 1,writer); } } appendCoordinate(seq,i,writer); } writer.write(")"); } }
Converts a <code>LineString</code> to &lt;LineString Text&gt; format, then appends it to the writer.
public void write(AnnotationsWriter writer) throws IOException { writer.constValueIndex(getValue()); }
Writes the value.
@Override public void addText(String text){ current.appendChild(document.createTextNode(text)); }
Adds a text to current element of the DOM Document. Note: Multiple consecutives texts will be merged.
public boolean hasPositionExt(){ return hasExtension(GphotoPosition.class); }
Returns whether it has the position of the photo in its album.
public static XorRelayedAddressAttribute createXorRelayedAddressAttribute(TransportAddress address,byte[] tranID){ XorRelayedAddressAttribute attribute=new XorRelayedAddressAttribute(); attribute.setAddress(address,tranID); return attribute; }
Creates a XorRelayedAddressAttribute of the specified type and with the specified address and port.
public static ProviderDownloadDialog newInstance(boolean dsp){ ProviderDownloadDialog fragment=new ProviderDownloadDialog(); Bundle bundle=new Bundle(); bundle.putBoolean(KEY_DSP,dsp); fragment.setArguments(bundle); return fragment; }
Creates the fragment in the perspective of selecting a provider or DSP plugin download source
public static CassandraApplicationConfig parse(byte[] bytes) throws IOException { return MAPPER.readValue(bytes,CassandraApplicationConfig.class); }
Parses a configuration from bytes.
public void test_propertyCache(){ final Properties properties=getProperties(); final Journal store=new Journal(properties); final String namespace="test"; try { { final ByteBuffer b=ByteBuffer.allocate(4); b.putInt(0); b.flip(); store.write(b); assertNotSame(0L,store.commit()); } { assertNull(store.getResourceLocator().locate(namespace,ITx.UNISOLATED)); assertNull(store.getResourceLocator().locate(namespace,store.getLastCommitTime())); { final long tx=store.newTx(ITx.READ_COMMITTED); try { assertNull(store.getResourceLocator().locate(namespace,store.getLastCommitTime())); } finally { store.abort(tx); } } } MockRelation mockRelation=new MockRelation(store,namespace,ITx.UNISOLATED,properties); { assertNull(store.getResourceLocator().locate(namespace,ITx.UNISOLATED)); assertNull(store.getResourceLocator().locate(namespace,store.getLastCommitTime())); { final long tx=store.newTx(ITx.READ_COMMITTED); try { assertNull(store.getResourceLocator().locate(namespace,store.getLastCommitTime())); } finally { store.abort(tx); } } } mockRelation.create(); { assertNotNull(store.getResourceLocator().locate(namespace,ITx.UNISOLATED)); assertTrue(store.getResourceLocator().locate(namespace,ITx.UNISOLATED) == mockRelation); assertNull(store.getResourceLocator().locate(namespace,ITx.READ_COMMITTED)); } final long priorCommitTime=store.getLastCommitTime(); final long lastCommitTime=store.commit(); { assertNotNull(store.getResourceLocator().locate(namespace,ITx.READ_COMMITTED)); assertTrue(((MockRelation)store.getResourceLocator().locate(namespace,ITx.READ_COMMITTED)) != mockRelation); } if (log.isInfoEnabled()) { log.info("priorCommitTime=" + priorCommitTime); log.info("lastCommitTime =" + lastCommitTime); } final long tx1=store.newTx(store.getLastCommitTime()); final long tx2=store.newTx(store.getLastCommitTime()); final long ts1=store.getLastCommitTime() - 1; try { assertTrue(tx1 != tx2); assertTrue(ts1 != tx1); assertTrue(ts1 != tx2); assertTrue(ts1 > priorCommitTime); final AbstractResource<?> view_un=(AbstractResource<?>)store.getResourceLocator().locate(namespace,ITx.UNISOLATED); assertNotNull(view_un); final AbstractResource<?> view_tx1=(AbstractResource<?>)store.getResourceLocator().locate(namespace,tx1); assertNotNull(view_tx1); final AbstractResource<?> view_tx2=(AbstractResource<?>)store.getResourceLocator().locate(namespace,tx2); assertNotNull(view_tx2); assertTrue(view_un != view_tx1); assertTrue(view_un != view_tx2); assertTrue(view_tx1 != view_tx2); assertEquals(ITx.UNISOLATED,view_un.getTimestamp()); assertEquals(tx1,view_tx1.getTimestamp()); assertEquals(tx2,view_tx2.getTimestamp()); assertEquals(null,((MockRelation)view_un).getCommitTime()); assertEquals(Long.valueOf(lastCommitTime),((MockRelation)view_tx1).getCommitTime()); assertEquals(Long.valueOf(lastCommitTime),((MockRelation)view_tx2).getCommitTime()); final Properties p_un=view_un.getProperties(); final Properties p_tx1=view_tx1.getProperties(); final Properties p_tx2=view_tx2.getProperties(); assertTrue(p_un != p_tx1); assertTrue(p_un != p_tx2); assertTrue(p_tx1 != p_tx2); final DefaultResourceLocator<?> locator=(DefaultResourceLocator<?>)store.getResourceLocator(); assertNull(locator.propertyCache.get(new NT(namespace,ITx.UNISOLATED))); assertNull(locator.propertyCache.get(new NT(namespace,tx1))); assertNull(locator.propertyCache.get(new NT(namespace,tx2))); assertNull(locator.propertyCache.get(new NT(namespace,ts1))); assertNotNull(locator.propertyCache.get(new NT(namespace,lastCommitTime))); assertNull(locator.propertyCache.get(new NT(namespace,priorCommitTime))); } finally { store.abort(tx1); store.abort(tx2); } } finally { store.destroy(); } }
Unit test for property caching for locatable resources.
public static void clearCache(){ cache.clear(); }
Clears the internal cache of downloaded timezone definitions.
public Boolean isWantAssertionsSigned(){ return wantAssertionsSigned; }
Gets the value of the wantAssertionsSigned property.
public Map<String,Object> convertDataToObjects(Map<String,String> data){ Map<String,Object> results=new HashMap<>(); if (data != null) { for ( String key : data.keySet()) { results.put(key,data.get(key)); } } return results; }
Internal conversion. This is needed to support the current SpringBoot actuator AuditEventRepository interface