code stringlengths 10 174k | nl stringlengths 3 129k |
|---|---|
@NotNull public static Couple<VcsFileRevision> sortRevisions(@NotNull VcsFileRevision revision1,@NotNull VcsFileRevision revision2){
VcsFileRevision left=revision1;
VcsFileRevision right=revision2;
if (compare(revision1,revision2) > 0) {
left=revision2;
right=revision1;
}
return Couple.of(left,right);... | Compares the given revisions and returns a pair of them, where the first one is older, and second is newer. |
private static final void encodeLELong(long val,byte[] dst,int off){
dst[off + 0]=(byte)val;
dst[off + 1]=(byte)((int)val >>> 8);
dst[off + 2]=(byte)((int)val >>> 16);
dst[off + 3]=(byte)((int)val >>> 24);
dst[off + 4]=(byte)(val >>> 32);
dst[off + 5]=(byte)(val >>> 40);
dst[off + 6]=(byte)(val >>> 48);
... | Encode a 64-bit integer with little-endian convention. |
public <T>void addToRequestQueue(Request<T> request){
request.setTag(TAG);
getRequestQueue().add(request);
}
| Manage the Queue |
private int totalLength(double[][] samples){
int N=0;
for ( double[] samp : samples) {
N+=samp.length;
}
return N;
}
| Total length of a set of Samples. |
@Deprecated public boolean isAssignableFrom(Class<?> cls){
return isAssignableFrom((Type)cls);
}
| Check if this type is assignable from the given class object. |
private void writeFlowMod(IOFSwitch sw,OFFlowModCommand command,OFBufferId bufferId,Match match,OFPort outPort){
OFFlowMod.Builder fmb;
if (command == OFFlowModCommand.DELETE) {
fmb=sw.getOFFactory().buildFlowDelete();
}
else {
fmb=sw.getOFFactory().buildFlowAdd();
}
fmb.setMatch(match);
fmb.setCoo... | Writes a OFFlowMod to a switch. |
public RuntimeExceptionConfig(String msg){
super(msg);
}
| Creates an exception with a message |
public Vertex(){
this(-1);
}
| Must call advance() before use, e.g. while (vertex.advance()) {...} |
private void forgetSource(Color newColor,State nextState){
sourceQuality=0;
dancingThreshold=-1;
sourceDistance=0;
sourceConcentration=0;
repeatedTrip=0;
foodSource=null;
foragingCosts=0;
if (newColor != null) setColor(newColor);
setState(nextState);
}
| Reset all information about the last or current food source; set the current color and the next state. |
public boolean isRepresentationClassReader(){
return java.io.Reader.class.isAssignableFrom(representationClass);
}
| Returns whether the representation class for this <code>DataFlavor</code> is <code>java.io.Reader</code> or a subclass thereof. |
@Interruptible public void createFinalMCMap(IR ir,int machineCodeLength){
_mcMap=OptMachineCodeMap.create(ir,machineCodeLength);
}
| Create the final machine code map for the compiled method. Remember the offset for the end of prologue too for debugger. |
private int parseTimezoneOffset(boolean isOptional) throws ParseException {
if (currentOffset >= maxOffset) {
if (!isOptional) throw new java.text.ParseException("Missing non-optional timezone offset",currentOffset);
return 0;
}
char optionalSign=data.charAt(currentOffset);
boolean negate=false;
i... | Parse a time offset, which can be in the format of [+|-]hh[:mm[:ss]]. This is the time added to local time to get UTC. |
private void deletePubsubTopic(String topic) throws IOException {
if (pubsubClient == null) {
pubsubClient=Transport.newPubsubClient(options.as(PubsubOptions.class)).build();
}
if (executeNullIfNotFound(pubsubClient.projects().topics().get(topic)) != null) {
pubsubClient.projects().topics().delete(topic).... | Deletes the Google Cloud Pub/Sub topic. |
public void processLocalizedOption(String locale,String localizedText){
List<VOLocalizedText> obsoleteLocalizedTexts=obsoleteOptionDescriptions.get(Long.valueOf(parameterOption.getKey()));
VOLocalizedText obsoleteLocalizedText=getLocalizedText(locale,obsoleteLocalizedTexts);
if (obsoleteLocalizedText != null) {
... | Store a parsed localized option |
private void checkNeeded(Player player,Engine en,String item){
ItemCollection needed=getMissingItems(player);
if (!player.isQuestCompleted(questSlot)) {
if (needed.containsKey(item)) {
boolean last=needed.size() == 1;
en.step(player,item);
if (last) {
assertEquals("Thank you so much! N... | Try bringing a new item that the player is carrying. |
private void addMapping(String jarItem,String jarName){
addToList(jarItem,jarName,indexMap);
addToList(jarName,jarItem,jarMap);
}
| Same as add(String,String) except that it doesn't strip off from the last index of '/'. It just adds the jarItem (filename or package) as it is received. |
public <T>T submit(final Callable<T> callable){
if (taskExecutor instanceof ForkJoinPool) {
log.debug("Submited callable to SimpleReact ForkJoinPool. JDK ParallelStreams will reuse SimpleReact ForkJoinPool.");
try {
return ((ForkJoinPool)taskExecutor).submit(callable).get();
}
catch ( final Exec... | This method allows the SimpleReact Executor to be reused by JDK parallel streams |
private Transform matchMath(Class type) throws Exception {
if (type == BigDecimal.class) {
return new BigDecimalTransform();
}
if (type == BigInteger.class) {
return new BigIntegerTransform();
}
return null;
}
| This is used to resolve <code>Transform</code> implementations that relate to the <code>java.math</code> package. If the type does not resolve to a valid transform then this method will throw an exception to indicate that no stock transform exists for the specified type. |
public DateTime roundFloorCopy(){
return iInstant.withMillis(iField.roundFloor(iInstant.getMillis()));
}
| Rounds to the lowest whole unit of this field on a copy of this DateTime. |
protected void onPushReceive(Context context,Intent intent){
String pushDataStr=intent.getStringExtra(KEY_PUSH_DATA);
if (pushDataStr == null) {
PLog.e(TAG,"Can not get push data from intent.");
return;
}
PLog.v(TAG,"Received push data: " + pushDataStr);
JSONObject pushData=null;
try {
pushData=... | Called when the push notification is received. By default, a broadcast intent will be sent if an "action" is present in the data and a notification will be show if "alert" and "title" are present in the data. |
public void runTest() throws Throwable {
Document doc;
NodeList genderList;
Node genderNode;
Node entText;
EntityReference entReference;
doc=(Document)load("staff",true);
genderList=doc.getElementsByTagName("gender");
genderNode=genderList.item(4);
entReference=doc.createEntityReference("ent3");
ass... | Runs the test case. |
public int showDialog(Instances inst){
setInstances(inst);
return showDialog();
}
| Pops up the modal dialog and waits for Cancel or OK. |
public CacheRequest(final URL url,final String method,final EtagCache cache) throws HttpRequestException {
super(url,method);
this.cache=cache;
}
| Create cache request |
public OnlineSearchProblem(ActionsFunction actionsFunction,GoalTest goalTest){
this(actionsFunction,goalTest,new DefaultStepCostFunction());
}
| Constructs an online search problem with the specified action function, goal test, and a default step cost function. |
private CachedRowSet buildCachedRow() throws SQLException {
int iColCount;
CachedRowSetImpl crsRow=new CachedRowSetImpl();
RowSetMetaDataImpl rsmd=new RowSetMetaDataImpl();
RowSetMetaDataImpl rsmdWrite=(RowSetMetaDataImpl)crsSync.getMetaData();
RowSetMetaDataImpl rsmdRow=new RowSetMetaDataImpl();
iColCount=... | This function builds a row as a <code>CachedRowSet</code> object which has been resolved and is ready to be synchrinized to the datasource |
public static boolean isSameDay(Calendar cal1,Calendar cal2){
if (cal1 == null || cal2 == null) {
throw new IllegalArgumentException("The date must not be null");
}
return (cal1.get(Calendar.ERA) == cal2.get(Calendar.ERA) && cal1.get(Calendar.YEAR) == cal2.get(Calendar.YEAR) && cal1.get(Calendar.DAY_OF_YEAR) ... | <p>Checks if two calendar objects are on the same day ignoring time.</p> <p/> <p>28 Mar 2002 13:45 and 28 Mar 2002 06:01 would return true. 28 Mar 2002 13:45 and 12 Mar 2002 13:45 would return false. </p> |
public void resume(){
throwReadOnly();
}
| Resume the network after a save. Keep the MAX_SIZE number of most conscious vertices in memory. |
public PdfReportTable createTable(float[] columnWidths){
return new PdfReportTable(this,columnWidths);
}
| Crea una tabla para el informe. |
public boolean reverseCorrectIt(){
log.info(toString());
m_processMsg=ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSECORRECT);
if (m_processMsg != null) return false;
MPeriod.testPeriodOpen(getCtx(),getDateAcct(),getC_DocType_ID(),getAD_Org_ID());
MAllocationHdr[] alloc... | Reverse Correction - same date |
public boolean isCellEditable(int rowIndex,int columnIndex){
assert 0 <= rowIndex && rowIndex < rows;
assert 0 <= columnIndex && columnIndex < columns;
return false;
}
| It returns whether the given cell is editable. Right now, no cells are editable. |
public PowerVmAllocationPolicyMigrationMedianAbsoluteDeviation(List<? extends Host> hostList,PowerVmSelectionPolicy vmSelectionPolicy,double safetyParameter,PowerVmAllocationPolicyMigrationAbstract fallbackVmAllocationPolicy,double utilizationThreshold){
super(hostList,vmSelectionPolicy);
setSafetyParameter(safetyP... | Instantiates a new PowerVmAllocationPolicyMigrationMedianAbsoluteDeviation. |
@Override public void process(ResponseBuilder rb) throws IOException {
SolrParams params=rb.req.getParams();
LOG.info("SuggestComponent process with : " + params);
if (!params.getBool(COMPONENT_NAME,false) || suggesters.isEmpty()) {
return;
}
boolean buildAll=params.getBool(SUGGEST_BUILD_ALL,false);
boo... | Responsible for using the specified suggester to get the suggestions for the query and write the results |
private void updateProgress(int progress){
if (myHost != null && progress != previousProgress) {
myHost.updateProgress(progress);
}
previousProgress=progress;
}
| Used to communicate a progress update between a plugin tool and the main Whitebox user interface. |
private Automaton buildAutomaton(BytesRefHash termBytesHash){
final TreeSet<BytesRef> terms=new TreeSet<BytesRef>();
for (int i=0; i < termBytesHash.size(); i++) {
BytesRef ref=new BytesRef();
termBytesHash.get(i,ref);
terms.add(ref);
}
final Automaton a=DaciukMihovAutomatonBuilder.build(terms);
r... | Build an automaton to represent the frontier query |
protected void rewriteHops(){
try {
dmlTranslator.rewriteHopsDAG(dmlProgram);
}
catch ( LanguageException e) {
throw new MLContextException("Exception occurred while rewriting HOPS (high-level operators)",e);
}
catch ( HopsException e) {
throw new MLContextException("Exception occurred while rewrit... | Apply static rewrites, perform intra-/inter-procedural analysis to propagate size information into functions, apply dynamic rewrites, and compute memory estimates for all HOPs. |
public MediaMarkerTimingSpecifier(TimedElement owner,boolean isBegin,String syncbaseID,String markerName){
super(owner,isBegin);
this.syncbaseID=syncbaseID;
this.markerName=markerName;
this.mediaElement=owner.getTimedElementById(syncbaseID);
}
| Creates a new MediaMarkerTimingSpecifier object. |
public boolean isSuspended(){
return suspended;
}
| Checks if is suspended. |
public static void detect(String url,OnDetectBigUrlFileListener onDetectBigUrlFileListener,DownloadConfiguration downloadConfiguration){
if (downloadConfiguration != null) {
downloadConfiguration.initNullKeyForUrl(url);
}
getFileDownloadManager().detect(url,onDetectBigUrlFileListener,downloadConfiguration);
}... | detect a big url file, which means can detect the url file bigger than 2G |
private void runUpdates(Collection<Runnable> runnables){
for ( Runnable runnable : runnables) {
runnable.run();
}
}
| Run all of the runnables that are the widget updates |
public byte[] encode(){
char type=getAttributeType();
byte binValue[]=new byte[HEADER_LENGTH + getDataLength() + (4 - getDataLength() % 4) % 4];
binValue[0]=(byte)(type >> 8);
binValue[1]=(byte)(type & 0x00FF);
binValue[2]=(byte)(getDataLength() >> 8);
binValue[3]=(byte)(getDataLength() & 0x00FF);
System.... | Returns a binary representation of this attribute. |
public void visitSyscall(int opcode){
flushInstructionCount(false,false);
int code=(opcode >> 6) & 0x000FFFFF;
if (code == SyscallHandler.syscallUnmappedImport) {
storePc();
}
HLEModuleFunction func=HLEModuleManager.getInstance().getFunctionFromSyscallCode(code);
boolean fastSyscall=isFastSyscall(code);... | Generate the required Java code to perform a syscall. When the syscall function is an HLEModuleFunctionReflection, generate the code for calling the module function directly, as HLEModuleFunctionReflection.execute() would. Otherwise, generate the code for calling RuntimeContext.syscall() or RuntimeContext.syscallFast() |
public void removeGpsStatusListener(GpsStatus.Listener listener){
try {
GpsStatusListenerTransport transport=mGpsStatusListeners.remove(listener);
if (transport != null) {
mService.removeGpsStatusListener(transport);
}
}
catch ( RemoteException e) {
Log.e(TAG,"RemoteException in unregisterGp... | Removes a GPS status listener. |
public CharacterResult create(){
final Result result=validators.runValidators();
if (result != null) {
return new CharacterResult(result,character,template);
}
final TransactionPool transactionPool=SingletonRepository.getTransactionPool();
final DBTransaction trans=transactionPool.beginWork();
final Cha... | tries to create this character. |
public CriteriosBusquedaNotiBean(){
}
| Creates a new instance of CriteriosBusquedaNotiBean |
private void pushCallStack(){
StackTraceElement[] eles=(new Throwable()).getStackTrace();
int i;
for (i=1; i < eles.length; i++) {
if (!eles[i].getClassName().equals(this.getClass().getName())) {
break;
}
}
this.callStack.push(eles[i]);
}
| Pushes the call stack. |
public void write(int c) throws java.io.IOException {
return;
}
| Write a single character. |
public static Vector<String> find(String classname,String[] pkgnames){
Vector<String> result;
Class<?> cls;
result=new Vector<String>();
try {
cls=Class.forName(classname);
result=find(cls,pkgnames);
}
catch ( Exception e) {
e.printStackTrace();
}
return result;
}
| Checks the given packages for classes that inherited from the given class, in case it's a class, or implement this class, in case it's an interface. |
private static String createMessage(int product_id,int asi_id,BigDecimal qty,BigDecimal remainingQty){
MProduct product=MProduct.get(Env.getCtx(),product_id);
String productValue=product != null ? product.getValue() : "?";
String productName=product != null ? product.getName() : "?";
return "@M_Product_ID@ : " ... | Create Msg |
public void loadArgs(){
loadArgs(0,argumentTypes.length);
}
| Generates the instructions to load all the method arguments on the stack. |
static <T>T[] arraysCopyOf(T[] original,int newLength){
T[] copy=newArray(original,newLength);
System.arraycopy(original,0,copy,0,Math.min(original.length,newLength));
return copy;
}
| GWT safe version of Arrays.copyOf. |
protected static String buildMessage(String format,Object... args){
String msg=(args == null) ? format : String.format(Locale.US,format,args);
StackTraceElement[] trace=new Throwable().fillInStackTrace().getStackTrace();
String caller="<unknown>";
if (trace.length >= 2) {
String callingClass=trace[2].getCla... | Formats the caller's provided message and prepends useful info like calling thread ID and method name. |
public void deleteAsync(final String id,final FutureCallback<Task> responseCallback) throws IOException {
deleteObjectAsync(id,responseCallback);
}
| Delete the specified tenant. |
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2014-02-25 10:38:00.951 -0500",hash_original_method="F9C41201775A1AACD21054779541BDEA",hash_generated_method="3CA11E865E7B60B42B88D30C85038589") @DSVerified @DSSpec(DSCat.IO) @DSSink({DSSinkKind.NETWORK}) public String listHelp() throws IOException ... | Fetches the system help information from the server and returns the full string. <p> |
public void onFragmentResult(int requestCode,int resultCode,Intent data){
}
| called when your started LiteFragment finishes. you will receive this call immediately when started LiteFragment finishes, it will be called before onStart() . |
public AnsibleRunner extraParams(String params){
if (params != null && params.length() > 0) {
extraParams=params;
}
return this;
}
| Additional arguments to pass to the process |
public static IPackageFragmentRoot addClassFolder(IJavaProject jproject,String containerName,IPath sourceAttachPath,IPath sourceAttachRoot) throws CoreException {
IProject project=jproject.getProject();
IContainer container=null;
if (containerName == null || containerName.length() == 0) {
container=project;
... | Creates and adds a class folder to the class path. |
public static String encode(byte[] source,int off,int len,byte[] alphabet,boolean doPadding){
byte[] outBuff=encode(source,off,len,alphabet,Integer.MAX_VALUE);
int outLen=outBuff.length;
while (doPadding == false && outLen > 0) {
if (outBuff[outLen - 1] != '=') {
break;
}
outLen-=1;
}
return... | Encodes a byte array into Base64 notation. |
public void updateAsciiStream(int columnIndex,java.io.InputStream x) throws SQLException {
throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.featnotsupp").toString());
}
| Updates the designated column with an ascii stream value. The updater methods are used to update column values in the current row or the insert row. The updater methods do not update the underlying database; instead the <code>updateRow</code> or <code>insertRow</code> methods are called to update the database. <P><B>N... |
private boolean isUsedTileset(final Map map,final TileSet tileset){
for (final Iterator<?> tiles=tileset.iterator(); tiles.hasNext(); ) {
final Tile tile=(Tile)tiles.next();
for ( final MapLayer layer : map) {
if ((layer instanceof TileLayer) && (((TileLayer)layer).isUsed(tile))) {
return tru... | Check whether a tileset is in use by a map. |
private void doReuseDOI(DOI doi,Resource resource){
resource.setDoi(doi);
resource.setDoiOrganisationKey(registrationManager.findPrimaryDoiAgencyAccount().getKey());
resource.setIdentifierStatus(IdentifierStatus.PUBLIC_PENDING_PUBLICATION);
resource.updateAlternateIdentifierForDOI();
resource.updateCitationId... | Do the changes to the resource, necessary to reuse an existing DOI. |
public static void addClassFactory(ClassFactory classFactory){
getUserClassFactories().add(classFactory);
}
| Add a class factory in order to manage more than one class loader. |
public List<SNMPTriple> querySingleSNMPEntryByOID(String oid) throws IOException {
if (oid == null || oid.isEmpty()) return null;
if (!oid.startsWith(".")) oid="." + oid;
List<SNMPTriple> snmpList=new ArrayList<SNMPTriple>();
Map<OID,String> res=get(new OID[]{new OID(oid)});
if (res != null) {
for ( ... | For test SNMP purpose. Used to check if individual SNMP entry is supported |
private void verifyOneofContainingType(OneofDescriptor oneof){
if (oneof.getContainingType() != type) {
throw new IllegalArgumentException("OneofDescriptor does not match message type.");
}
}
| Verifies that the oneof is an oneof of this message. |
private static void removeHOVs(){
HashSet<Id> linksToRemove=new HashSet<Id>();
for ( Link i : network.getLinks().values()) {
Link L=(Link)i;
if (NetworkUtils.getType(L).equals("HOV") || NetworkUtils.getType(L).equals("HOV transfer")) {
linksToRemove.add(L.getId());
}
}
for ( Id i : linksToRe... | Simply clears the network of all HOV lanes. |
public boolean userCanViewArch(int connectedUserId,int archId,String entidad) throws Exception {
boolean can=false;
int acsId;
int archMgrId=Defs.NULL_ID;
ArchivesTable table=new ArchivesTable();
LdapUsersTable usrTable=new LdapUsersTable();
DbConnection dbConn=new DbConnection();
try {
dbConn.open(DB... | Obtiene si el usuario conectador puede ver el archivador |
public boolean isSetScope(){
return this.scope != null;
}
| Returns true if field scope is set (has been assigned a value) and false otherwise |
private void updateIdealPoint(Solution solution){
for (int i=0; i < solution.getNumberOfObjectives(); i++) {
idealPoint[i]=Math.min(idealPoint[i],solution.getObjective(i));
}
}
| Updates the ideal point with the specified solution. |
public void addPreferredAuthPolicy(String policyUri){
String policies=getPreferredAuthPolicies();
if (policies == null || policies.length() == 0) setPreferredAuthPolicies(policyUri);
else setPreferredAuthPolicies(policies + " " + policyUri);
}
| Adds an authentication policy URI to the preferred_auth_policies parameter. |
private void assertLayout(Integer... expectedLayout){
toggleMenu();
}
| Asserts the layout of the menu. |
@Override public boolean execute(final String[] params,final String remainder){
j2DClient.get().clearGameLog();
return true;
}
| Execute a chat command. |
public static void writeString(OutputStream out,Charset charset,String value) throws IOException {
Writer writer=new OutputStreamWriter(out,charset);
String nl=System.getProperty("line.separator");
int r=0;
while (r < value.length()) {
int i=value.indexOf("\n",r);
if (i == -1) {
break;
}
w... | Convert a \n string to a platform encoding. This uses the specified charset to extract the raw bytes. |
public void writeR820TRegister(Register register,byte value,boolean controlI2C) throws UsbException {
if (register.isMasked()) {
int current=mShadowRegister[register.getRegister()];
value=(byte)((current & ~register.getMask()) | (value & register.getMask()));
}
writeI2CRegister(mDeviceHandle,mI2CAddress,(... | Writes the byte value to the specified register, optionally controlling the I2C repeater as needed. |
public Timer schedule(int refreshRateInMs){
Timer timer=new Timer(JamonDataPersisterTimerTask.class.getSimpleName() + "-saveJamonData");
timer.scheduleAtFixedRate(this,refreshRateInMs,refreshRateInMs);
return timer;
}
| Start thread that will save jamon data (MonitorComposite). |
public static UpdateTicker.ThreadTicker threadTicker(){
return instance.threadTicker;
}
| The thread ticker that runs on NOVA's thread. |
public PermissionCollectionRequest(final String requestUrl,final IOneDriveClient client,final List<Option> options){
super(requestUrl,client,options);
}
| The request for this collection of Item |
@DSComment("Private Method") @DSBan(DSCat.PRIVATE_METHOD) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:58:11.914 -0500",hash_original_method="9F84EE545D7A893B2BE12E7FDE7E048D",hash_generated_method="3550118099D2274DF1E233703CE4A395") private void updatePacketRecvAddress(DatagramP... | Set the received address and port in the packet. We do this when the Datagram socket is connected at the native level and the recvConnnectedDatagramImpl does not update the packet with address from which the packet was received |
public RegressionResult(boolean zeroInterceptAssumed,String[] regressorNames,int n,double[] b,double[] t,double[] p,double[] se,double r2,double rss,double alpha,TetradVector yHat,TetradVector res){
if (regressorNames == null) {
throw new NullPointerException();
}
if (b == null) {
throw new NullPointerExc... | A result for a variety of regression algorithm. |
public BusinessObjectDefinitionTagEntity createBusinessObjectDefinitionTagEntity(BusinessObjectDefinitionEntity businessObjectDefinitionEntity,TagEntity tagEntity){
BusinessObjectDefinitionTagEntity businessObjectDefinitionTagEntity=new BusinessObjectDefinitionTagEntity();
businessObjectDefinitionTagEntity.setBusin... | Creates and persists a new business object definition tag entity. |
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:27:47.707 -0500",hash_original_method="936283CC8EFD34F7D7362628995C0399",hash_generated_method="04666F3055631A388E7245104E27551E") public void fillInNotifierBundle(Bundle m){
m.putInt("GsmSignalStrength",mGsmSignalStrength);
m.putI... | Set intent notifier Bundle based on SignalStrength |
public CircularWallForce(float gravConst,float x,float y,float r){
params=new float[]{gravConst};
minValues=new float[]{DEFAULT_MIN_GRAV_CONSTANT};
maxValues=new float[]{DEFAULT_MAX_GRAV_CONSTANT};
this.x=x;
this.y=y;
this.r=r;
}
| Create a new CircularWallForce. |
public void editText(VisualItem item,String attribute,Rectangle r){
if (m_editing) {
stopEditing();
}
String txt=item.getString(attribute);
m_editItem=item;
m_editAttribute=attribute;
Color tc=ColorLib.getColor(item.getTextColor());
Color fc=ColorLib.getColor(item.getFillColor());
m_editor.setForegr... | Edit text for the given VisualItem and field. Presents a text editing widget spaning the given bounding box. Use stopEditing() to hide the text widget. When stopEditing() is called, the field will automatically be updated with the VisualItem. |
public void init(int numDataSources){
if (dataset == null) {
dataset=new XYSeriesCollection();
dataset.addSeries(new XYSeries("Data",false,true));
}
if (numDataSources == -1) {
projector=new Projector();
}
else {
projector=new Projector(numDataSources);
}
fireChartInitialized(projector.getD... | Initialize the projection model with a certain number of data sources. |
private ClobImpl(String data){
stringData=data;
}
| Creates a new <code>Clob</code> instance. |
private long readTimeStamp(byte[] buffer,int offset){
long seconds=read32(buffer,offset);
long fraction=read32(buffer,offset + 4);
return ((seconds - OFFSET_1900_TO_1970) * 1000) + ((fraction * 1000L) / 0x100000000L);
}
| Reads the NTP time stamp at the given offset in the buffer and returns it as a system time (milliseconds since January 1, 1970). |
public Iterator<BuildStep> iterator(){
return Collections.unmodifiableList(mStepList).iterator();
}
| Gets an <code>Iterator</code> to iterate over the set of <code>BuildStep</code>s in build-order. Any attempts to change the list through the remove method will fail. |
public void createLogicalPort(LogicalPortCreateSpec spec,FutureCallback<LogicalPort> responseCallback) throws IOException {
postAsync(LOGICAL_PORTS_BASE_PATH,serializeObjectAsJson(spec),HttpStatus.SC_CREATED,new TypeReference<LogicalPort>(){
}
,responseCallback);
}
| Creates a port on the switch. |
public static byte[] toByteArray(URLConnection urlConn) throws IOException {
InputStream inputStream=urlConn.getInputStream();
try {
return IOUtils.toByteArray(inputStream);
}
finally {
inputStream.close();
}
}
| Get the contents of a <code>URLConnection</code> as a <code>byte[]</code>. |
public boolean isDrawFilledEnabled(){
return mDrawFilled;
}
| returns true if filled drawing is enabled, false if not |
public T caseAbstractCatchBlock(AbstractCatchBlock object){
return null;
}
| Returns the result of interpreting the object as an instance of '<em>Abstract Catch Block</em>'. <!-- begin-user-doc --> This implementation returns null; returning a non-null result will terminate the switch. <!-- end-user-doc --> |
final public boolean scanTail(final int nscan,final T ref){
if (nscan <= 0) throw new IllegalArgumentException();
if (ref == null) throw new IllegalArgumentException();
for (int n=0, i=tail; n < nscan; n++) {
if (ref == refs[i]) return true;
i=(i + 1) % capacity;
}
return false;
}
| Return true iff the reference is found in the first N positions scanning backwards from the tail of the queue. |
public static String formatQuantity(double quantity){
return quantityDecimalFormat.format(quantity);
}
| Formats an double representing a quantity into a string |
protected void fireActionPerformed(){
Object[] listeners=listenerList.getListenerList();
int modifiers=0;
AWTEvent currentEvent=EventQueue.getCurrentEvent();
if (currentEvent instanceof InputEvent) {
modifiers=((InputEvent)currentEvent).getModifiers();
}
else if (currentEvent instanceof ActionEvent) {
... | Notifies all listeners that have registered interest for notification on this event type. The event instance is lazily created. The listener list is processed in last to first order. |
public RequestHandle put(String url,RequestParams params,ResponseHandlerInterface responseHandler){
return put(null,url,params,responseHandler);
}
| Perform a HTTP PUT request with parameters. |
public static _Fields findByThriftId(int fieldId){
switch (fieldId) {
case 1:
return HEADER;
case 2:
return STORE;
case 3:
return KEYS;
default :
return null;
}
}
| Find the _Fields constant that matches fieldId, or null if its not found. |
public void writeText(char text[],int off,int len) throws IOException {
if (text == null) {
throw new NullPointerException(MessageUtils.getExceptionMessageString(MessageUtils.NULL_PARAMETERS_ERROR_MESSAGE_ID,"text"));
}
if (off < 0 || off > text.length || len < 0 || len > text.length) {
throw new IndexOut... | <p>Write properly escaped text from a character array. If there is an open element that has been created by a call to <code>startElement()</code>, that element will be closed first.</p> <p/> <p>All angle bracket occurrences in the argument must be escaped using the &gt; &lt; syntax.</p> |
@Override public void draw(Graphics2D g2,XYPlot plot,Rectangle2D dataArea,ValueAxis domainAxis,ValueAxis rangeAxis,int rendererIndex,PlotRenderingInfo info){
PlotOrientation orientation=plot.getOrientation();
RectangleEdge domainEdge=Plot.resolveDomainAxisLocation(plot.getDomainAxisLocation(),orientation);
Rectan... | Draws the annotation. |
public int hashCode(){
return root.hashCode();
}
| Returns a hashcode value for the object. |
public void addProcessInteractionListener(final ProcessInteractionListener l){
if (l == null) {
throw new IllegalArgumentException("l must not be null!");
}
processInteractionListeners.add(l);
}
| Adds a listener that will be informed when the user right-clicks an operator or a port. |
public synchronized void addAPI(SQLiteDatabase db,String id,String name,String url,String readonlyurl,String notesurl,String user,String pass,String preset,boolean showicon,boolean oauth){
ContentValues values=new ContentValues();
values.put("id",id);
values.put("name",name);
values.put("url",url);
values.put... | adds a new API with the given values to the supplied database |
public void initializeLocalComment(final List<IComment> comments){
m_edge.initializeLocalComment(comments);
}
| Initialize the local edge comments. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.