code stringlengths 10 174k | nl stringlengths 3 129k |
|---|---|
public static List<String> splitForSearch(final String phraze,final int charThreshold){
if (phraze != null) {
String[] token=StringUtils.splitPreserveAllTokens(phraze,"| ;,.");
List<String> words=new ArrayList<String>(token.length);
for ( final String aToken : token) {
if (StringUtils.isNotBlank(... | Tokenize search phraze and clean from empty strings. |
public static List<ItemStack> requestItem(ItemStack stack,ICorporeaSpark spark,boolean checkNBT,boolean doit){
return requestItem(stack,stack.stackSize,spark,checkNBT,doit);
}
| Bridge for requestItem() using an ItemStack. |
@Deprecated public LuceneDocument(){
this(null);
}
| To be removed, no longer used. |
public static boolean isAuthenticated(){
SecurityContext securityContext=SecurityContextHolder.getContext();
Collection<? extends GrantedAuthority> authorities=securityContext.getAuthentication().getAuthorities();
if (authorities != null) {
for ( GrantedAuthority authority : authorities) {
if (author... | Check if a user is authenticated. |
public void handleClientMembership(String clientId,int eventType){
String notifType=null;
List<ManagedResource> cleanedUp=null;
if (eventType == ClientMembershipMessage.LEFT) {
notifType=NOTIF_CLIENT_LEFT;
cleanedUp=cleanupBridgeClientResources(clientId);
}
else if (eventType == ClientMembershipMessa... | Implementation handles client membership changes. |
public SizeSorter(boolean ascending){
super(ascending);
}
| Creates a new instance of SizeSorter |
@Override public String toString(){
if (eIsProxy()) return super.toString();
StringBuffer result=new StringBuffer(super.toString());
result.append(" (event_1: ");
result.append(event_1);
result.append(')');
return result.toString();
}
| <!-- begin-user-doc --> <!-- end-user-doc --> |
@After public void cleanup(){
for ( File f : indexDir.listFiles()) f.delete();
indexDir.delete();
}
| Cleanup tests |
public synchronized boolean isCoverageAvailable(int transport){
int available=getAvailableTransportCoverage();
if ((available & transport) > 0) return true;
else return false;
}
| Determines if a specific transport is available based on connectivity and service availability. In other words this method will return true only for those available transports for which there is sufficient coverage on the device and there is a service book present. Although having a transport in coverage means that we ... |
public void writeReport(BenchInfo[] binfo,Properties props) throws IOException {
PrintStream p=new PrintStream(out);
float total=0.0f;
p.println("\n" + title);
p.println(pad('-',title.length()));
p.println("");
for (int i=0; i < PROPNAMES.length; i++) {
p.println(fit(PROPNAMES[i] + ":",PROPNAME_WIDTH) +... | Generate text report. |
public static boolean isInstanceOf(Object object,Class target){
if (object == null || target == null) {
return false;
}
return target.isInstance(object);
}
| Safe version of <code>isInstance</code>, returns <code>false</code> if any of the arguments is <code>null</code>. |
private static void applyOpenSSLFix() throws SecurityException {
if ((Build.VERSION.SDK_INT < VERSION_CODE_JELLY_BEAN) || (Build.VERSION.SDK_INT > VERSION_CODE_JELLY_BEAN_MR2)) {
return;
}
try {
Class.forName("org.apache.harmony.xnet.provider.jsse.NativeCrypto").getMethod("RAND_seed",byte[].class).invoke(... | Applies the fix for OpenSSL PRNG having low entropy. Does nothing if the fix is not needed. |
private boolean listItemExists(ListItemEntry listItem,URL feedUrl,SitesService sitesService){
try {
Map<String,String> values=Maps.newHashMap();
for ( Field field : listItem.getFields()) {
values.put(field.getIndex(),field.getValue());
}
ContentQuery query=new ContentQuery(feedUrl);
Strin... | Returns whether or not an identical list item to the one given exists at the given feed URL. |
public boolean skipDelimiters(){
int workingPosition=position;
boolean workingEmptyReturned=emptyReturned;
boolean onToken=advancePosition();
tokenCount=-1;
while (position != workingPosition || emptyReturned != workingEmptyReturned) {
if (onToken) {
position=workingPosition;
emptyReturned=wor... | Advances the current position so it is before the next token. <p> This method skips nontoken delimiters but does not skip token delimiters. <p> This method is useful when switching to the new delimiter sets (see the second example in the class comment.) |
private void backupFavorites(BackupDataOutput data) throws IOException {
ContentResolver cr=mContext.getContentResolver();
Cursor cursor=cr.query(Favorites.CONTENT_URI,FAVORITE_PROJECTION,getUserSelectionArg(),null,null);
try {
cursor.moveToPosition(-1);
while (cursor.moveToNext()) {
final long id=c... | Write all modified favorites to the data stream. |
public LargeDeltas(LargeDeltas other){
__isset_bitfield=other.__isset_bitfield;
if (other.isSetB1()) {
this.b1=new Bools(other.b1);
}
if (other.isSetB10()) {
this.b10=new Bools(other.b10);
}
if (other.isSetB100()) {
this.b100=new Bools(other.b100);
}
this.check_true=other.check_true;
if (o... | Performs a deep copy on <i>other</i>. |
void sendPasswordRecoveryMails(PlatformUser pUser,EmailType mailType,String marketplaceId,Object[] obj) throws MailOperationException {
Marketplace marketplace=null;
if (marketplaceId != null) {
marketplace=new Marketplace();
marketplace.setMarketplaceId(marketplaceId);
marketplace=(Marketplace)dm.find(... | Sends an email to the given platform user. |
protected void onRemoveNoExternalMessages(String channel,String sourceNick,String sourceLogin,String sourceHostname){
}
| Called when a channel is set to allow messages from any user, even if they are not actually in the channel. <p> This is a type of mode change and is also passed to the onMode method in the PircBot class. <p> The implementation of this method in the PircBot abstract class performs no actions and may be overridden as req... |
@Nonnull static public String contentsToString(){
StringBuilder retval=new StringBuilder();
for ( Class<?> c : managerLists.keySet()) {
retval.append("List of ");
retval.append(c);
retval.append(" with ");
retval.append(Integer.toString(getList(c).size()));
retval.append(" objects\n");
for ... | Dump generic content of InstanceManager by type. |
public AvsPlayContentItem(String token,Uri uri){
super(token);
mUri=uri;
}
| Create a new local play item |
public static synchronized void moveLogsFromLegacyDirIfNecessary(){
File sdcardDir=Environment.getExternalStorageDirectory();
File legacyDir=new File(sdcardDir,LEGACY_SAVED_LOGS_DIR);
if (legacyDir.exists() && legacyDir.isDirectory()) {
File savedLogsDir=getSavedLogsDirectory();
for ( File file : legac... | I used to save logs to /sdcard/catlog_saved_logs. Now it's /sdcard/catlog/saved_logs. Move any files that need to be moved to the new directory. |
public Object encode(Object raw) throws EncoderException {
if (!(raw instanceof byte[])) {
throw new EncoderException("argument not a byte array");
}
return toAsciiChars((byte[])raw);
}
| Converts an array of raw binary data into an array of ascii 0 and 1 chars. |
public static HttpVersion parse(final String s) throws ProtocolException {
if (s == null) {
throw new IllegalArgumentException("String may not be null");
}
if (!s.startsWith("HTTP/")) {
throw new ProtocolException("Invalid HTTP version string: " + s);
}
int major, minor;
int i1="HTTP/".length();
i... | Parses the textual representation of the given HTTP protocol version. |
public PSPCommunicationException(String message,ApplicationExceptionBean bean){
super(message,bean);
}
| Constructs a new exception with the specified detail message and bean for JAX-WS exception serialization. |
private void initialize(){
this.setLayout(new BorderLayout());
this.setName(Constant.messages.getString("output.panel.title"));
if (Model.getSingleton().getOptionsParam().getViewParam().getWmUiHandlingOption() == 0) {
this.setSize(243,119);
}
this.setIcon(new ImageIcon(OutputPanel.class.getResource("/reso... | This method initializes this |
public static String suppressWhiteSpace(String str){
int len=str.length();
StringBuilder sb=new StringBuilder(len);
char c;
char buffer=0;
for (int i=0; i < len; i++) {
c=str.charAt(i);
if (c == '\n' || c == '\r') buffer='\n';
else if (isWhiteSpace(c)) {
if (buffer == 0) buffer=c;... | remove all white spaces followd by whitespaces |
public static void shuffle(Object[] a,int lo,int hi){
if (lo < 0 || lo > hi || hi >= a.length) throw new RuntimeException("Illegal subarray range");
for (int i=lo; i <= hi; i++) {
int r=i + uniform(hi - i + 1);
Object temp=a[i];
a[i]=a[r];
a[r]=temp;
}
}
| Rearrange the elements of the subarray a[lo..hi] in random order. |
private SwipeMode computeInputMode(long time,float x,float y,float dx,float dy){
if (!mStacks[1].isDisplayable()) return SwipeMode.SEND_TO_STACK;
int currentIndex=getTabStackIndex();
if (currentIndex != getViewportParameters().getStackIndexAt(x,y)) {
return SwipeMode.SWITCH_STACK;
}
float relativeX=mLas... | Computes the input mode for drag and fling based on the first event position. |
void skipData(int count) throws IOException {
if (bufAvail >= count) {
bufAvail-=count;
bufPtr+=count;
return;
}
if (bufAvail > 0) {
count-=bufAvail;
bufAvail=0;
bufPtr=0;
}
if (iis.skipBytes(count) != count) {
throw new IIOException("Image format Error");
}
}
| Skips <code>count</code> bytes, leaving the buffer in an appropriate state. If the end of the stream is encountered, an <code>IIOException</code> is thrown with the message "Image Format Error". |
public synchronized void die(){
if (connected) {
packetUpdate.signalStop();
connThread.interrupt();
send(new Packet(Packet.COMMAND_CLOSE_CONNECTION));
flushConn();
}
connected=false;
if (connection != null) {
connection.close();
}
for (int i=0; i < closeClientListeners.size(); i++) {
... | Shuts down threads and sockets |
public void addSeries(final String title,final double[] xs,final double[] ys){
XYSeries series=new XYSeries(title,false,true);
for (int i=0, n=Math.min(xs.length,ys.length); i < n; i++) {
series.add(xs[i],ys[i]);
}
this.dataset.addSeries(series);
}
| Adds a new data series to the chart with the specified title. <code>xs<code> and <code>ys</code> should have the same length. If not, only as many items are shown as the shorter array contains. |
@Override protected void initData(){
this.getContentResolver().registerContentObserver(MessageContentProvider.MESSAGE_URI,true,new MessageProviderObserver(new Handler()));
this.adapter=new ProviderRecyclerViewAdapter(this.getContentResolver(),MessageContentProvider.MESSAGE_URI);
this.providerRV.setAdapter(this.ad... | Initialize the Activity data |
private String toComparableString(final byte[] memory){
final StringBuffer stringBuffer=new StringBuffer();
for ( final byte b : memory) {
stringBuffer.append(Convert.byteToHexString(b));
}
return stringBuffer.toString();
}
| Turns a byte array into a string. |
public static ECKey fromASN1(byte[] asn1privkey){
return extractKeyFromASN1(asn1privkey);
}
| Construct an ECKey from an ASN.1 encoded private key. These are produced by OpenSSL and stored by Bitcoin Core in its wallet. Note that this is slow because it requires an EC point multiply. |
public AcelaTurnout(String systemName,String userName,AcelaSystemConnectionMemo memo){
super(systemName,userName);
_memo=memo;
prefix=_memo.getSystemPrefix() + "T";
initializeTurnout(systemName);
}
| Create a Light object, with both system and user names. <P> 'systemName' was previously validated in AcelaLightManager |
public R paramsToFormEntity(){
mHttpEntity=createFormEntity();
return (R)this;
}
| convert params to Form Entity. |
protected void restoreGraphics(Graphics g){
Graphics2D g2D=(Graphics2D)g;
g2D.setStroke(saveStroke);
g2D.setPaint(savePaint);
}
| Restores previous settings to the Graphics. Beware : no verification is made to be sure that it is the same Graphics ... |
private void saveImageBase(){
try {
final CAddress imageBase=new CAddress(Convert.hexStringToLong(m_debuggerPanel.getImageBase()));
if (m_addressSpace == null) {
m_module.getConfiguration().setImageBase(imageBase);
}
else {
m_addressSpace.getContent().setImageBase(m_module,imageBase);
}
... | Saves the module image base to the database. |
private void select(final JSpinner spinnerComponent){
final JComponent editor=spinnerComponent.getEditor();
if (!(editor instanceof JSpinner.DateEditor)) return;
final JSpinner.DateEditor dateEditor=(JSpinner.DateEditor)editor;
final JFormattedTextField ftf=dateEditor.getTextField();
final Format format=dat... | If the spinner's editor is a DateEditor, this selects the field associated with the value that is being incremented. |
public boolean tryNext(final T element){
Item<T> item=head;
while (item != null) {
if (equivalent(item.element,element)) {
return false;
}
item=item.next;
}
final Item<T> newHead=new Item<>();
newHead.element=element;
newHead.next=head;
head=newHead;
return true;
}
| Announce the next element and report whether that one is currently in the stack. That is, element should only be processed by caller if this method returns true. |
public synchronized void close(){
if (!this.mIsClosed) {
this.mSocket.close();
this.mIsClosed=true;
}
}
| close the UDP socket |
public void clearOpciones(){
opciones.clear();
}
| Elimina todas las opciones de la lista. |
protected void creditInventoryAndAssert(final long warehouseId,final String skuCode,final String creditQuantity,final String expectedAvailable,final String expectedReserved){
final Warehouse warehouse=warehouseService.findById(warehouseId);
skuWarehouseService.credit(warehouse,skuCode,new BigDecimal(creditQuantity)... | Add quantity to warehouse and assert inventory state. |
protected void report(GroovyExceptionInterface e,boolean child){
println(((Exception)e).getMessage());
stacktrace((Exception)e,false);
}
| For GroovyException. |
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2014-09-03 15:01:15.195 -0400",hash_original_method="01CB53E47AF5384558F5A1C3FDB268E6",hash_generated_method="A37A31244848C5A0C7DA46E18C1DFDCA") final boolean acquireQueued(final Node node,long arg){
boolean failed=true;
try {
boolean interr... | Acquires in exclusive uninterruptible mode for thread already in queue. Used by condition wait methods as well as acquire. |
public void parse(String theSrcText,String testName) throws Exception {
System.out.println("-------------------------------");
System.out.println(" " + testName);
System.out.println("-------------------------------");
try {
Reader reader=new BufferedReader(new StringReader(theSrcText));
GroovyRecognize... | run the JSR parser implementation over the supplied source text |
private void startPolling(){
String notifier=Preference.getString(context,Constants.PreferenceFlag.NOTIFIER_TYPE);
if (Constants.NOTIFIER_LOCAL.equals(notifier)) {
Log.i(TAG,"EMM auto enrollment, initiating polling task.");
LocalNotification.startPolling(context);
}
}
| Starts server polling task. |
protected HashEntry createEntry(HashEntry next,int hashCode,Object key,Object value){
return new HashEntry(next,hashCode,key,value);
}
| Creates an entry to store the key-value data. <p> This implementation creates a new HashEntry instance. Subclasses can override this to return a different storage class, or implement caching. |
@Override public String toString(){
if (eIsProxy()) return super.toString();
StringBuffer result=new StringBuffer(super.toString());
result.append(" (index_1: ");
result.append(index_1);
result.append(')');
return result.toString();
}
| <!-- begin-user-doc --> <!-- end-user-doc --> |
public PutIndexTemplateRequest alias(Alias alias){
aliases.add(alias);
return this;
}
| Adds an alias that will be added when the index gets created. |
private CipherBox(){
this.protocolVersion=ProtocolVersion.DEFAULT;
this.cipher=null;
this.cipherType=STREAM_CIPHER;
this.fixedIv=new byte[0];
this.key=null;
this.mode=Cipher.ENCRYPT_MODE;
this.random=null;
this.tagSize=0;
this.recordIvSize=0;
}
| NULL cipherbox. Identity operation, no encryption. |
public static <A>EvalTValue<A> of(final AnyMValue<Eval<A>> monads){
return new EvalTValue<>(monads);
}
| Construct an MaybeT from an AnyM that wraps a monad containing Maybes |
public static void write(JsonElement element,JsonWriter writer) throws IOException {
TypeAdapters.JSON_ELEMENT.write(writer,element);
}
| Writes the JSON element to the writer, recursively. |
public void appendToLog(String s){
append("\n" + s);
}
| Outputs the string as a new line of log data in the LogView. |
public boolean serialize(DataObject obj,RowMutator mutator){
try {
String id=obj.getId().toString();
if (isLazyLoaded() || _property.getReadMethod() == null) {
return false;
}
Object val=_property.getReadMethod().invoke(obj);
if (val == null) {
return false;
}
boolean changed=f... | Serializes object field into database updates |
public void age(Network network){
for ( Vertex vertex : network.findAll()) {
int level=vertex.getConsciousnessLevel();
if (level > 0) {
vertex.decrementConsciousnessLevel(level / 2);
}
}
}
| Age the network, decrease consciousness level by 10%. |
public static String buildFilterClause(final String sql,final Object value,final List<Object> preparedArgs){
if (value != null) {
preparedArgs.add(value);
return sql;
}
else {
return null;
}
}
| Returns the sql filter clause when value to set as prepared argument isn't null otherwise null is returned. |
public void assertArrayEqual(short[] expected,short[] actual,String errorMessage){
TestUtils.assertArrayEqual(expected,actual,errorMessage);
}
| This method just invokes the test utils method, it is here for convenience |
@SuppressWarnings("unchecked") @Override public NotificationChain eInverseAdd(InternalEObject otherEnd,int featureID,NotificationChain msgs){
switch (featureID) {
case SexecPackage.EXECUTION_STATE__SUB_SCOPES:
return ((InternalEList<InternalEObject>)(InternalEList<?>)getSubScopes()).basicAdd(otherEnd,msgs);
case Se... | <!-- begin-user-doc --> <!-- end-user-doc --> |
public StackedXYAreaRendererState(PlotRenderingInfo info){
super(info);
this.seriesArea=null;
this.line=new Line2D.Double();
this.lastSeriesPoints=new Stack();
this.currentSeriesPoints=new Stack();
}
| Creates a new state for the renderer. |
private void writeStubMethod(IndentingWriter p,int opnum) throws IOException {
RemoteClass.Method method=remoteMethods[opnum];
MethodDoc methodDoc=method.methodDoc();
String methodName=methodDoc.name();
Type[] paramTypes=method.parameterTypes();
String paramNames[]=nameParameters(paramTypes);
Type returnTyp... | Writes the stub method for the remote method with the given operation number. |
public BulkRetrievalEvent(BulkRetrievable source,String eventType,String item){
super(source);
this.eventType=eventType;
this.item=item;
}
| Creates a new event. |
@NotNull public List<? extends TargetBuilder<?,?>> createBuilders(){
return Collections.emptyList();
}
| Returns the list of non-module target builders contributed by this plugin. |
public TrieTest(String name){
super(name);
}
| Constructs the <code>TrieTest</code>. |
protected ModbusSlave(int port,int poolSize) throws ModbusException {
this(ModbusSlaveType.TCP,port,poolSize,null);
}
| Creates a TCP modbus slave |
public final boolean readBoolean() throws IOException {
int ch=in.read();
if (ch < 0) throw new EOFException();
return (ch != 0);
}
| See the general contract of the <code>readBoolean</code> method of <code>DataInput</code>. <p> Bytes for this operation are read from the contained input stream. |
public ReaderComponent(String name,ReaderWorld newWorld){
super(name);
world=newWorld;
init();
}
| Construct a component from an existing world; used in deserializing. |
public TenantDeletionConstraintException(String message,TenantDeletionConstraintException.Reason reason){
super(message);
setMessageKey(getMessageKey() + "." + reason.toString());
}
| Constructs a new exception with the given detail message, and appends the specified reason to the message key. |
protected void onPushDismiss(Context context,Intent intent){
}
| Called when the push notification is dismissed. By default, nothing is performed on notification dismissal. |
public void resetDocumentLocator(String publicid,String systemid){
thePublicid=publicid;
theSystemid=systemid;
theLastLine=theLastColumn=theCurrentLine=theCurrentColumn=0;
}
| Reset document locator, supplying systemid and publicid. |
public void doPrint(){
PrintController printer=new PrintController();
printer.printComponent(getFrame(),jTextArea1,"Print Errors");
}
| doPrint()() - |
public void removeStream(String streamName){
StreamMeta sm=logicalPlan.getStream(streamName);
if (sm == null) {
return;
}
if (physicalPlan != null) {
physicalPlan.removeLogicalStream(sm);
}
sm.remove();
}
| Remove the named stream. Ignored when stream does not exist. |
public NameNotFoundException(String message,Throwable cause){
super(message,cause);
}
| Constructs instance of ObjectNameNotFoundException with error message and cause |
public void computeRangeFacet(String facet){
Map<String,StatsCollector[]> f=rangeFacetCollectors.get(facet);
for ( StatsCollector[] arr : f.values()) {
for ( StatsCollector b : arr) {
b.compute();
}
}
}
| Finalizes the statistics within the a specific range facet before exporting; |
protected String normalizeNewlines(String source){
return perl.substitute("s/\r[\n]/\n/g",source);
}
| Normalizes lines to account for platform differences. Macs use a single \r, DOS derived operating systems use \r\n, and Unix uses \n. Replace each with a single \n. |
public static List<Object> parseParams(WarpScriptStack stack,int... numparams) throws WarpScriptException {
List<Object> params=new ArrayList<Object>();
int count=0;
Arrays.sort(numparams);
int maxparams=numparams[numparams.length - 1];
while (0 != stack.depth() && count <= maxparams) {
Object top=stack.p... | Retrieve parameters from the stack until a PGraphics instance is found. |
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:55:09.403 -0500",hash_original_method="2022581A914A53DEAB486C7C21721639",hash_generated_method="0B028D7882C237D4D15E9A31C97182E9") public int compareMediaRange(String media){
return (mediaRange.type + "/" + mediaRange.subtype).compar... | compare two MediaRange headers. |
public void copy(BytesRef bytes,BytesRef out){
int left=blockSize - upto;
if (bytes.length > left || currentBlock == null) {
if (currentBlock != null) {
addBlock(currentBlock);
didSkipBytes=true;
}
currentBlock=new byte[blockSize];
upto=0;
left=blockSize;
assert bytes.length <= b... | Copy BytesRef in, setting BytesRef out to the result. Do not use this if you will use freeze(true). This only supports bytes.length <= blockSize |
void addFillComponents(Container panel,int[] cols,int[] rows){
Dimension filler=new Dimension(10,10);
boolean filled_cell_11=false;
CellConstraints cc=new CellConstraints();
if (cols.length > 0 && rows.length > 0) {
if (cols[0] == 1 && rows[0] == 1) {
panel.add(Box.createRigidArea(filler),cc.xy(1,1));... | Adds fill components to empty cells in the first row and first column of the grid. This ensures that the grid spacing will be the same as shown in the designer. |
private void handleEventSynchronous(Event event) throws ReplicatorException {
EventRequest request=null;
try {
request=eventDispatcher.put(event);
request.get();
}
catch ( InterruptedException e) {
logger.warn("Event processing was interrupted: " + event.getClass().getName());
Thread.currentThre... | Wrapper method for methods that submits a synchronous event with proper MBean error handling. This translates the various state machine exceptions into a proper replicator exception. |
public static void assertNull(Object object,String message){
if (object != null) {
throw new IllegalArgumentException("assertion failed:" + message);
}
}
| Asserts that the given object is <code>null</code>. If this is not the case, a <code>IllegalArgumentException</code> is thrown. The given message is included in that exception, to aid debugging. |
protected void endDocument() throws XMLStreamException {
this.writer.writeEndElement();
this.writer.writeEndElement();
this.writer.writeEndDocument();
this.writer.close();
}
| End the KML document. |
@Override public void onDestroyView(){
mHandler.removeCallbacks(mRequestFocus);
mList=null;
mListShown=false;
mEmptyView=mProgressContainer=mListContainer=null;
mStandardEmptyView=null;
super.onDestroyView();
}
| Detach from list view. |
private static String grabLine(BufferedReader r) throws Exception {
int index=0;
String line=r.readLine();
while (line.startsWith("//") || line.length() < 1) line=r.readLine();
while ((index=line.indexOf("\\n")) != -1) {
StringBuffer temp=new StringBuffer(line);
temp.replace(index,index + 2,"\n");
... | Reads a line from the input file. Keeps reading lines until a non empty non comment line is read. If the line contains a \n then these two characters are replaced by a newline char. If a \\uxxxx sequence is read then the sequence is replaced by the unicode char. |
public EdgeInfo(int start,int end,int cap,int cost){
this.start=start;
this.end=end;
this.capacity=cap;
this.cost=cost;
}
| Construct EdgeInfo from (start,end) vertices with given capacity. |
static public double perc(int value,int max){
return perc((double)value,(double)max);
}
| It returns the percentage 100 * <tt>value</tt> / <tt>max</tt>. |
public static boolean isExternalStorageAvailable(){
String state=Environment.getExternalStorageState();
boolean mExternalStorageAvailable, mExternalStorageWriteable;
if (Environment.MEDIA_MOUNTED.equals(state)) {
mExternalStorageAvailable=mExternalStorageWriteable=true;
}
else if (Environment.MEDIA_MOUNT... | Checks if SD card available |
@Override public void put(String name,boolean value){
emulatedFields.put(name,value);
}
| Find and set the boolean value of a given field named <code>name</code> in the receiver. |
public BubbleChart(XYMultipleSeriesDataset dataset,XYMultipleSeriesRenderer renderer){
super(dataset,renderer);
}
| Builds a new bubble chart instance. |
public boolean hasAdds(){
return !addedClusters.isEmpty() || !addedHosts.isEmpty() || !addedInitiators.isEmpty();
}
| Returns true is export group state has additions (new hosts, new clusters, new initiators) |
private void _serializeList(PageContext pc,Set test,List list,StringBuilder sb,boolean serializeQueryByColumns,Set<Object> done) throws ConverterException {
sb.append(goIn());
sb.append("[");
boolean doIt=false;
ListIterator it=list.listIterator();
while (it.hasNext()) {
if (doIt) sb.append(',');
... | serialize a List (as Array) |
public NSData(byte[] bytes){
this.bytes=bytes;
}
| Creates the NSData object from the binary representation of it. |
public Object runSafely(Catbert.FastStack stack) throws Exception {
Airing a=getAir(stack);
if (a == null) return new Long(0);
Watched w=Wizard.getInstance().getWatch(a);
if (w != null) return new Long(w.getRealWatchStart());
if (stack.getUIMgrSafe() != null && stack.getUIMgrSafe().getVideoFrame().hasFile... | Gets the time the user started watching this Airing, in real time. |
public String toString(){
return ((primaryGroup ? rb.getString("SolarisNumericGroupPrincipal.Primary.Group.") + name : rb.getString("SolarisNumericGroupPrincipal.Supplementary.Group.") + name));
}
| Return a string representation of this <code>SolarisNumericGroupPrincipal</code>. <p> |
@PostConstruct public void build(){
try {
if (eventStream == null) {
logger.info("Building event stream...");
}
else {
logger.info("Rebuilding event stream..");
eventStream.setActive(false);
}
eventStream=makeEventStream();
eventStream.setActive(true);
logger.info("Success b... | Build event stream |
public static int discrete(double[] probabilities){
if (probabilities == null) throw new NullPointerException("argument array is null");
double EPSILON=1E-14;
double sum=0.0;
for (int i=0; i < probabilities.length; i++) {
if (!(probabilities[i] >= 0.0)) throw new IllegalArgumentException("array entry ... | Returns a random integer from the specified discrete distribution. |
public Builder singleShot(long shotId){
showcaseView.setSingleShot(shotId);
return this;
}
| Set the ShowcaseView to only ever show once. |
public PostfixOperator createPostfixOperatorFromString(EDataType eDataType,String initialValue){
PostfixOperator result=PostfixOperator.get(initialValue);
if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '"+ eDataType.getName()+ "'");
return r... | <!-- begin-user-doc --> <!-- end-user-doc --> |
public void hidePalette(){
WindowSupport ws=getWindowSupport();
if (ws != null) {
ws.killWindow();
}
}
| Hide the layer's palette. |
public void addCatch(char startPc,char endPc,char handlerPc,char catchType){
catchInfo.append(new char[]{startPc,endPc,handlerPc,catchType});
}
| Add a catch clause to code. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.