code
stringlengths
10
174k
nl
stringlengths
3
129k
private void connectToPredictions(ChanceNode outputNode){ String outputVar=outputNode.getId(); String baseVar=outputVar.substring(0,outputVar.length() - 1); String predictEquiv=baseVar + "^p"; if (hasChanceNode(predictEquiv) && !outputVar.contains("^p")) { ChanceNode equalityNode=new ChanceNode("=_" + baseV...
Connects the chance node to its prior predictions (if any).
public void doDelete(){ try { int result=JOptionPane.showConfirmDialog(this.getFrame(),"Are you sure you want to delete all Trade Orders?","Warning",JOptionPane.YES_NO_OPTION); if (result == JOptionPane.YES_OPTION) { deleteTradeOrders(m_tradingdays); } } catch ( Exception ex) { this.setError...
This is fired from any Tab when the Delete button is pressed. This should be used to delete all the trading orders for the current trading days.
public void printStat(JCTree tree) throws IOException { printExpr(tree,TreeInfo.notExpression); }
Derived visitor method: print statement tree.
protected static Test suite(Test t,Vector<String> missing){ if (missing.size() > 0) { Collections.sort(missing); System.out.println("Missing Test classes:"); for (int i=0; i < missing.size(); i++) { System.out.println("- " + missing.get(i)); } System.out.println(); } return t; }
outputs the missing Test classes (if any) and returns the given TestSuite
public void defaultMutate(EvolutionState state,int thread){ IntegerVectorSpecies s=(IntegerVectorSpecies)species; for (int x=0; x < genome.length; x++) if (state.random[thread].nextBoolean(s.mutationProbability(x))) { long old=genome[x]; for (int retries=0; retries < s.duplicateRetries(x) + 1; retries++) ...
Destructively mutates the individual in some default manner. The default form simply randomizes genes to a uniform distribution from the min and max of the gene values.
public void bind(Class type,Class transform){ types.cache(type,transform); }
This is used to bind a <code>Transform</code> type. The first time a transform is requested for the specified type a new instance of this <code>Transform</code> will be instantiated.
public boolean configureSpliceTo(SampleQueue nextQueue){ if (spliceOutTimeUs != Long.MIN_VALUE) { return true; } long firstPossibleSpliceTime; if (rollingBuffer.peekSample(sampleInfoHolder)) { firstPossibleSpliceTime=sampleInfoHolder.timeUs; } else { firstPossibleSpliceTime=lastReadTimeUs + 1; ...
Attempts to configure a splice from this queue to the next.
protected int[] runSelectedConversion(ImageProxy img,Rect crop,int subsample){ switch (mThumbnailShape) { case DEBUG_SQUARE_ASPECT_CIRCULAR_INSET: return dummyColorInscribedDataCircleFromYuvImage(img,subsample); case SQUARE_ASPECT_CIRCULAR_INSET: return colorInscribedDataCircleFromYuvImage(img,crop,subsample); ca...
Runs the correct image conversion routine, based upon the selected thumbnail shape.
static String fileNameOfClass(final String className,String typeSuffix){ return className.replace('.','/') + "." + typeSuffix; }
Get the file name of a class.
public long addAndGet(long l){ return atomicSeq.addAndGet(l); }
Adds a value.
private int size(){ if (isLeaf()) return points.size(); else return children.size(); }
If this node is a leaf, it returns the number of vectors contained by it. Otherwise, it returns the number of children nodes this node contains
public static boolean containsString(final String fileName,final String searchString) throws IOException { File inFile=new File(fileName); if (inFile.exists()) { BufferedReader in=new BufferedReader(new FileReader(inFile)); try { return containsString(in,searchString); } finally { if (in !...
Search for the specified <code>searchString</code> in the given filename. If the specified file doesn't exist, <code>FALSE</code> returns.
public static Date parseDate(String dateValue,Collection dateFormats) throws DateParseException { return parseDate(dateValue,dateFormats,null); }
Parses the date value using the given date formats.
@SuppressWarnings("unchecked") public static <T>Function<T,Integer> zero(){ return (Function<T,Integer>)ZERO; }
Returns a constant function that returns zero (0).
public boolean equals(java.lang.Object obj){ return false; }
Compares this object against the specified object. The result is true if and only if the argument is not null and is a Long object that contains the same long value as this object.
private void tryScrollBackToTopAfterComplete(){ tryScrollBackToTop(); }
just make easier to understand
public static <T>T selectRandomItem(Set<T> items){ checkNotNull(items,"Cannot selectRandomItem from null items"); checkArgument(!items.isEmpty(),"Cannot selectRandomItem from empty items"); randomGenerator.setSeed(System.currentTimeMillis()); int selectedServerIndex=randomGenerator.nextInt(items.size()); T it...
Randomly select one of the items.
public static boolean isFileTransferOverHttp(SipRequest request){ CpimMessage message=extractCpimMessage(request); if (message == null) { return false; } String contentType=message.getContentType(); return contentType != null && contentType.startsWith(FileTransferHttpInfoDocument.MIME_TYPE); }
Is request is for FToHTTP
public IgniteIllegalStateException(Throwable cause){ this(cause.getMessage(),cause); }
Creates exception given throwable as a cause and source of error message.
public SQLRecoverableException(String reason,String sqlState,int vendorCode){ super(reason,sqlState,vendorCode); }
Creates an SQLRecoverableException object. The Reason string is set to the given reason string, the SQLState string is set to the given SQLState string and the Error Code is set to the given error code value.
public T onkeydown(String value){ return attr("onkeydown",value); }
Sets the <code>onkeydown</code> attribute on the last started tag that has not been closed.
@SuppressWarnings("unchecked") public <T>TopGroups<T> search(IndexSearcher searcher,Query query,int groupOffset,int groupLimit) throws IOException { if (groupField != null || groupFunction != null) { return groupByFieldOrFunction(searcher,query,groupOffset,groupLimit); } else if (groupEndDocs != null) { ...
Executes a grouped search. Both the first pass and second pass are executed on the specified searcher.
public void stop(){ mRunning=false; mStop=true; }
Stops the animation in place. It does not snap the image to its final zoom.
public static boolean clear(String name){ SharedPreferences.Editor editor=getSharedPreferences(name).edit(); editor.clear(); return editor.commit(); }
Mark in the editor to remove all values from the preferences.
public LabeledPath(ScreenAnnotation annotation){ this.setAnnotation(annotation); }
Creates a labeled path with the specified label annotation and no locations.
private boolean replace(TestChromosome test,int statement){ logger.debug("Replacing call"); TestFactory factory=TestFactory.getInstance(); Statement theStatement=test.getTestCase().getStatement(statement); VariableReference var=theStatement.getReturnValue(); int oldLength=test.size(); try { VariableRefe...
Replace the call with a completely different call
public static void clearInputProcessor(){ Gdx.input.setInputProcessor(null); }
Application's input processor will be set to null.
@Override public MessageConsumer createSharedConsumer(Topic topic,String name,String messageSelector) throws JMSException { if (sessionType == ActiveMQSession.TYPE_QUEUE_SESSION) { throw new IllegalStateException("Cannot create a shared consumer on a QueueSession"); } checkTopic(topic); ActiveMQTopic localT...
Note: Needs to throw an exception if a subscriptionName is already in use by another topic, or if the messageSelector is different validate multiple subscriptions on the same session. validate multiple subscriptions on different sessions validate failure in one connection while another connection stills fine. Validate ...
public RangeCategorySeries(String title){ super(title); }
Builds a new category series.
public boolean isEmpty(){ return size == 0; }
Returns <tt>true</tt> if this map contains no key-value mappings.
public static boolean isLocalOrAnonymous(String className){ int i=className.lastIndexOf('$'); if (i >= 0 && i + 1 < className.length()) { return Character.isDigit(className.charAt(i + 1)); } return false; }
Does a class name appear to designate an anonymous or local (defined inside method) class? Only the name is analyzed. No classes are loaded or looked up.
public String xmlToCsv(UpdateInventoryInput input){ return input.getSupplierId() + "," + input.getPartId()+ ","+ input.getName()+ ","+ input.getAmount(); }
To convert from model to CSV in a simply way
public static Class<?> wrapper(Class<?> type){ if (type == null) { return null; } else if (type.isPrimitive()) { if (boolean.class == type) { return Boolean.class; } else if (int.class == type) { return Integer.class; } else if (long.class == type) { return Long.class;...
Get a wrapper type for a primitive type, or the argument type itself, if it is not a primitive type.
private static Credential authorize() throws Exception { GoogleClientSecrets clientSecrets=GoogleClientSecrets.load(JSON_FACTORY,new InputStreamReader(HelloAnalyticsApiSample.class.getResourceAsStream("/client_secrets.json"))); if (clientSecrets.getDetails().getClientId().startsWith("Enter") || clientSecrets.getDet...
Authorizes the installed application to access user's protected data.
@SuppressWarnings("unchecked") public void mouseDragged(MouseEvent e){ VisualizationViewer<V,E> vv=(VisualizationViewer<V,E>)e.getSource(); Point2D out=e.getPoint(); if (e.getModifiers() == additionalModifiers) { rectangularShape.setFrameFromDiagonal(down,out); } else if (e.getModifiers() == modifiers) {...
Draws the transient Paintable that will become a Shape annotation when the mouse button is released
public final String yytext(){ return new String(zzBuffer,zzStartRead,zzMarkedPos - zzStartRead); }
Returns the text matched by the current regular expression.
public void load(Element element,Object o){ Editor ed=(Editor)o; PositionableCircle ps=new PositionableCircle(ed); Element elem=element.getChild("size"); ps.setRadius(getInt(elem,"radius")); Editor editor=(Editor)o; editor.putItem(ps); loadCommonAttributes(ps,Editor.MARKERS,element); }
Create a PositionableShape, then add to a target JLayeredPane
public final void testContainsSymbol(){ assertNotNull(Constraints.containsSymbol()); }
Tests the functionality of the containsSymbol-method.
@Override public String validate(ILaunchConfiguration launchConfig,IJavaProject javaProject,List<String> programArgs,List<String> vmArgs) throws CoreException { return null; }
Only update this argument when in GWT SDM mode.
private static int determineIconIdByMimeTypeList(List<String> mimetypes){ if (mimetypes == null || mimetypes.size() < 1) { return R.drawable.file; } else { for ( String mimetype : mimetypes) { Integer iconId=MIMETYPE_TO_ICON_MAPPING.get(mimetype); if (iconId != null) { return iconId;...
determines the icon based on the mime type.
public Bundler(){ this(null); }
Constructs a new, empty Bundle.
protected MouseListener createMouseListener(){ return new MouseAdapter(){ } ; }
Overriden to return an empty adapter, the default listener was just implementing the tab selection mechanism
public void resetAxisMaxValue(){ mCustomAxisMax=Float.NaN; }
By calling this method, any custom maximum value that has been previously set is reseted, and the calculation is done automatically.
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1) public static boolean isWatchdogEnabled(Context context){ final int SETTING_UNKNOWN=-1; final int SETTING_ENABLED=1; final String AVOID_POOR="wifi_watchdog_poor_network_test_enabled"; final String WATCHDOG_CLASS="android.net.wifi.WifiWatchdogStateMachine"; final ...
Stolen with love from: http://stackoverflow.com/a/20752580/289641 <p> Checks whether the "Avoid poor networks" setting (named "Auto network switch" on some Samsung devices) is enabled, which can in some instances interfere with Wi-Fi.
public void addCalendar(String calName,Calendar calendar,boolean replace,boolean updateTriggers) throws SchedulerException { sched.addCalendar(calName,calendar,replace,updateTriggers); }
<p> Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>. </p>
@Override public boolean isActive(){ return amIActive; }
Used by the Whitebox GUI to tell if this plugin is still running.
private Set<String> acronymsNNP(Collection<WordToken> words){ final StringBuilder upperCaseNNP=new StringBuilder(); final StringBuilder upperAndLowerCaseNNP=new StringBuilder(); Set<String> acronyms=new HashSet<>(); words.stream().filter(null).map(null).forEach(null); if (upperCaseNNP.length() > 2) { acro...
Create acronym based on just the NNS, but unlike Stanford use lower and upper case again
public Hashtable determinePoliticalAreas(OMGraphicList graphicList,Hashtable poli_areas){ String name=null; String key=null; if (graphicList != null) { int size=graphicList.size(); for (int i=0; i < size; i++) { OMGraphic graphic=graphicList.getOMGraphicAt(i); Object obj=graphic.getAttribute(S...
DeterminePoliticalAreas goes over a list of omgraphics, and spits out a hashtable that holds PoliticalArea objects for every area key. When an ID is found in the graphics, it is checked in the hashtable for like graphics, and added to that PoliticalArea if found. If not found, a new PoliticalArea is created and placed ...
public static VirtualArray verifyVirtualArrayForRequest(Project project,URI varrayURI,UriInfo uriInfo,PermissionsHelper permissionsHelper,DbClient dbClient){ VirtualArray neighborhood=dbClient.queryObject(VirtualArray.class,varrayURI); ArgValidator.checkEntity(neighborhood,varrayURI,isIdEmbeddedInURL(varrayURI,uriI...
Gets and verifies that the VirtualArray passed in the request is accessible to the tenant.
public final CertPathBuilderResult build(CertPathParameters params) throws CertPathBuilderException, InvalidAlgorithmParameterException { return spiImpl.engineBuild(params); }
Builds a certification path with the specified algorithm parameters.
public ResultVO validate(BaseParam param,OperationType operationType) throws Exception { Field[] fields=param.getClass().getDeclaredFields(); for ( Field field : fields) { if (field == null || !field.isAnnotationPresent(NotNullField.class)) { continue; } field.setAccessible(true); if (ArrayUt...
Bean properties null validation.
public void dragDropEnd(DragSourceDropEvent dsde){ DragSourceListener dsl=listener; if (dsl != null) { dsl.dragDropEnd(dsde); } getDragSource().processDragDropEnd(dsde); }
Calls <code>dragDropEnd</code> on the <code>DragSourceListener</code>s registered with this <code>DragSourceContext</code> and with the associated <code>DragSource</code>, and passes them the specified <code>DragSourceDropEvent</code>.
public static boolean isEqual(String c,String a){ if (c.length() != a.length()) return false; for (int i=0; i < c.length(); i++) { if (c.charAt(i) != a.charAt(i)) return false; } return true; }
isEqual returns true if a is equal to c
public String useMissingTipText(){ return "Flag to set if missing values are used."; }
Returns the tip text for this property
public static boolean isInsatalled(Context context,String packageName){ if (!StringUtils.isEmpty(packageName)) { List<PackageInfo> list=getInsatalledPackageInfos(context); if (!CollectionUtils.isEmpty(list)) { for ( PackageInfo pi : list) { if (packageName.equalsIgnoreCase(pi.packageName)) ...
Judge whether the packageName is installed
private void addToken(int tokenType){ addToken(zzStartRead,zzMarkedPos - 1,tokenType); }
Adds the token specified to the current linked list of tokens.
public DataPanel(Instances data){ this(); m_Filename=""; setInstances(data); }
initializes the panel with the given data
public ContentValues(int size){ mValues=new HashMap<String,Object>(size,1.0f); }
Creates an empty set of values using the given initial size
@Override public void dragDropEnd(DragSourceDropEvent dsde){ DragSourceContext dsc=dsde.getDragSourceContext(); JComponent c=(JComponent)dsc.getComponent(); DefaultDrawingViewTransferHandler th=(DefaultDrawingViewTransferHandler)c.getTransferHandler(); if (dsde.getDropSuccess()) { th.exportDone(c,dsc.getTra...
as the operation completes
public boolean isDirty(){ return dirty; }
Returns whether or not the text in this editor has unsaved changes.
public byte remove(int offset){ byte old=get(offset); remove(offset,1); return old; }
Removes the value at <tt>offset</tt> from the list.
@Override public synchronized void configure() throws ReplicatorException, InterruptedException { super.configure(); }
Instantiate and configure all data source tables.
public float noise(float x){ return noise(x,0f,0f); }
Computes the Perlin noise function value at point x.
@edu.umd.cs.findbugs.annotations.SuppressWarnings(value="JLM_JSR166_UTILCONCURRENT_MONITORENTER",justification="findbugs complains about this synchronize. It could be changed to a sync on a dedicated Object instance to make findbugs happy. see comments below") private void prepareThreadStoreList(){ synchronized (thread...
Prepare the threadStoreList by moving into it all the new instances in Q.
public static synchronized void deleteLog(){ if (sLogStream != null) { sLogStream.removeLog(); setLogStream(); } }
Delete the file currently used for logging. This should only be called when you are certain the current logging file is not required. After calling this, the current logging stream is set to <code>null</code>.
public Builder withDataPart(String key,String value){ if (data == null) { data=new HashMap<>(); } data.put(key,value); return this; }
Set a key in the GCM JSON payload delivered to the application (optional).
public JsonObjectRequest(int method,String url,JSONObject jsonRequest,Listener<JSONObject> listener,ErrorListener errorListener){ super(method,url,(jsonRequest == null) ? null : jsonRequest.toString(),listener,errorListener); }
Creates a new request.
public AddUserToGroupScriptCommand(Configuration configuration,String resourcePath,User user,String groupRole){ super(configuration,resourcePath); this.user=user; this.groupRole=groupRole; }
Sets configuration containing all needed information for building configuration scripts.
@After public void tearDown() throws Exception { TradestrategyTest.clearDBData(); }
Method tearDown.
public void notifyLocalWatch(TableKraken table,byte[] key){ WatchTable watchTable=_tableMap.get(table); if (watchTable != null) { watchTable.onPut(key,TableListener.TypePut.LOCAL); } }
Notify local watches for the given table and key
public ArrayDeque<E> clone(){ try { @SuppressWarnings("unchecked") ArrayDeque<E> result=(ArrayDeque<E>)super.clone(); result.elements=Arrays.copyOf(elements,elements.length); return result; } catch ( CloneNotSupportedException e) { throw new AssertionError(); } }
Returns a copy of this deque.
protected AbstractElementNS(){ }
Creates a new AbstractElementNS object.
private void addReverse(final File[] files){ for (int i=files.length - 1; i >= 0; --i) { stack.add(files[i]); } }
Add the specified files in reverse order.
private void instrumentModelClasses(){ long start=Calendar.getInstance().getTime().getTime(); if (_lazyLoadedFields.isEmpty()) { return; } CtClass instrumentedClass=null; try { ClassPool pool=ClassPool.getDefault(); CtClass modelClass=pool.get(_clazz.getCanonicalName()); String instrumentedCla...
instrument model classes to override getter and setter methods to enable lazy loading
public void removeImageView(CubeImageView imageView){ if (null == imageView || null == mFirstImageViewHolder) { return; } ImageViewHolder holder=mFirstImageViewHolder; do { if (holder.contains(imageView)) { if (holder == mFirstImageViewHolder) { mFirstImageViewHolder=holder.mNext; } ...
Remove the ImageView from ImageTask
protected void init(long outfilePartitionMillis,String destSubTopicPathFormat,Locale locale,DateTimeZone outputTimeZone){ this.outfilePartitionMillis=outfilePartitionMillis; this.outputDirFormatter=DateUtils.getDateTimeFormatter(destSubTopicPathFormat,outputTimeZone).withLocale(locale); }
Initialize the partitioner. This method must be invoked once, and before any any other method.
public RepositoryConfig(String id,RepositoryImplConfig implConfig){ this(id); setRepositoryImplConfig(implConfig); }
Create a new RepositoryConfigImpl.
public static void println(){ out.println(); }
Terminate the current line by printing the line separator string.
public void dequeueOneToOneFileTransfer(String fileTransferId,ContactId contact,MmContent file,MmContent fileIcon){ long timestamp=System.currentTimeMillis(); long timestampSent=timestamp; FileTransferProtocol ftProtocol=getFileTransferProtocolForOneToOneFileTransfer(contact); if (ftProtocol == null) { thro...
Dequeue one-to-one file transfer
@Override public void updateBigDecimal(int columnIndex,BigDecimal x) throws SQLException { try { if (isDebugEnabled()) { debugCode("updateBigDecimal(" + columnIndex + ", "+ quoteBigDecimal(x)+ ");"); } update(columnIndex,x == null ? (Value)ValueNull.INSTANCE : ValueDecimal.get(x)); } catch ( Exc...
Updates a column in the current or insert row.
public void pointerReleased(final int[] x,final int[] y){ longPointerCharged=false; if (impl.getCurrentForm() == null) { return; } if (x.length == 1) { addPointerEvent(POINTER_RELEASED,x[0],y[0]); } else { addPointerEvent(POINTER_RELEASED_MULTI,x,y); } }
Pushes a pointer release event with the given coordinates into Codename One
default void addSuperClass(char[] buffer,int offset,int length){ }
Adds the superclass information to the scan class.
public static CreativeTabs tabMekanism(CreativeTabs preferred){ try { if (Mekanism == null) { Mekanism=Class.forName("mekanism.common.Mekanism"); } Object ret=Mekanism.getField("tabMekanism").get(null); if (ret instanceof CreativeTabs) { return (CreativeTabs)ret; } return preferred...
Attempts to get the Mekanism creative tab instance from the 'Mekanism' class. Will return the tab if the mod is loaded, but otherwise will return the defined 'preferred' creative tab. This way you don't need to worry about NPEs!
private void closeDatabase(){ if (mDatabase == null) return; mDatabase.close(); }
Closes the database if it's open
protected int AdditiveExpr(int addPos) throws javax.xml.transform.TransformerException { int opPos=m_ops.getOp(OpMap.MAPINDEX_LENGTH); if (-1 == addPos) addPos=opPos; MultiplicativeExpr(-1); if (null != m_token) { if (tokenIs('+')) { nextToken(); insertOp(addPos,2,OpCodes.OP_PLUS); int o...
This has to handle construction of the operations so that they are evaluated in pre-fix order. So, for 9+7-6, instead of |+|9|-|7|6|, this needs to be evaluated as |-|+|9|7|6|. AdditiveExpr ::= MultiplicativeExpr | AdditiveExpr '+' MultiplicativeExpr | AdditiveExpr '-' MultiplicativeExpr
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:59:45.537 -0500",hash_original_method="69829FBE15E20ADBF8C45DA9DA2D1745",hash_generated_method="6825C0FB6336688E464A7DD79DC4298D") public void replyToMessage(Message srcMsg,int what,int arg1,int arg2,Object obj){ Message msg=Message....
Reply to srcMsg
public void scheduleAtFixedRate(TimerTask task,Date when,long period){ if (period <= 0 || when.getTime() < 0) { throw new IllegalArgumentException(); } long delay=when.getTime() - System.currentTimeMillis(); scheduleImpl(task,delay,period,true); }
Schedule a task for repeated fixed-rate execution after a specific time has been reached.
@DSComment("data structure class") @DSSafe(DSCat.DATA_STRUCTURE) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:34:37.424 -0500",hash_original_method="79D16814F7AC00D5B324C095EC421557",hash_generated_method="E5447840A038CF6FF4B838DA64F9014B") public void put(String key,byte[] value...
Adds a value to the set.
public E put(int key,E value){ if (value == null) { throw new NullPointerException(); } final E prev; if (key < array.length) { prev=(E)array[key]; } else { array=Arrays.copyOf(array,key * 3 / 2 + 1); prev=null; size++; } array[key]=value; return prev; }
Associates the specified value with the specified key in this map. If the map previously contained a mapping for the key, the old value is replaced by the specified value.
private void prepareAtomic(String key) throws Exception { for (int i=0; i < INIT_GRID_NUM; i++) assert startGrid(i) != null; for (int i=0; i < INIT_GRID_NUM; i++) assert PARTITIONED == grid(i).cache(null).getConfiguration(CacheConfiguration.class).getCacheMode(); grid(0).atomicLong(key,0,true).getAndSet(INIT_...
Prepare test environment.
private void returnData(Object ret){ if (myHost != null) { myHost.returnData(ret); } }
Used to communicate a return object from a plugin tool to the main Whitebox user-interface.
protected String formatBoolean(boolean b){ return b ? new String(new byte[]{1}) : ""; }
Returns the String value of the bit 1 if the given boolean is true<br> and an empty String otherwise. This the way bit values are written<br> in .txt dump files.
public void testBeanPropertyApplication() throws Exception { SampleContainingObject sco=new SampleContainingObject(); sco.setMyString("aString"); SampleObject so1=new SampleObject(); so1.setString("so1"); so1.setMyLong(1); sco.setMyObject1(so1); TungstenProperties tp=new TungstenProperties(); tp.setBean...
Test extracting and rereading properties from classes with embedded Java beans.
public Response releaseIP(String networkInterface,String macAddress){ Response response=new Response(); try { String ipAddress=findIP(macAddress); String command=String.format("%s %s %s %s %s",releaseIPPath,dhcpReleaseUtilityPath,networkInterface,ipAddress,macAddress); Process p=Runtime.getRuntime().exe...
This method calls DHCP driver to release IP for cleanup of network resources.
private Object readResolve(){ return getPriorityForName(m_name); }
Helper method that replaces deserialized object with correct singleton.
public static void writeLines(Collection<?> lines,String lineEnding,OutputStream output,String encoding) throws IOException { writeLines(lines,lineEnding,output,Charsets.toCharset(encoding)); }
Writes the <code>toString()</code> value of each item in a collection to an <code>OutputStream</code> line by line, using the specified character encoding and the specified line ending. <p> Character encoding names can be found at <a href="http://www.iana.org/assignments/character-sets">IANA</a>.
public final double perBag(int bagIndex){ return m_perBag[bagIndex]; }
Returns number of (possibly fractional) instances in given bag.
private AlarmEvent activation(AlarmPoint alarm){ AlarmStatus status=alarm.currentStatus(); if ((status.name(null).equals(AlarmPoint.STATUS_NORMAL)) || (status.name(null).equals(AlarmPoint.STATUS_DEACTIVATED))) { AlarmStatus newStatus=createStatus(AlarmPoint.STATUS_ACTIVATED); return createEvent(alarm.identi...
StateMachine change for activate trigger.
public Segment(int marker) throws IOException { this.marker=marker; if (marker != 0) { out.writeShort(marker); offset=getStreamPosition(); if (!standaloneMarkers.contains(marker)) { out.writeShort(0); } } }
Creates a new Chunk at the current position of the ImageOutputStream.
private static void insertCommentsInNode(Node node,List<Comment> commentsToAttribute){ if (commentsToAttribute.size() == 0) return; List<Node> children=node.getChildrenNodes(); PositionUtils.sortByBeginPosition(children); for ( Node child : children) { List<Comment> commentsInsideChild=new LinkedList<Com...
This method try to attributes the nodes received to child of the node. It returns the node that were not attributed.