code stringlengths 10 174k | nl stringlengths 3 129k |
|---|---|
@Override public void write(char[] bytes,int offset,int length) throws IOException {
for (int i=0; i < writer.length; i++) {
writer[i].write(bytes,offset,length);
}
}
| Implements the abstract method of the superclass. |
ImgComp(BufferedImage img,Rectangle off,boolean right){
this.img=img;
at=AffineTransform.getTranslateInstance(-off.x,0);
d=new Dimension(off.width,off.height);
isRight=right;
}
| Create a clone with a specified backing image |
public Pyramid(Position centerPosition,double northSouthRadius,double verticalRadius,double eastWestRadius){
if (centerPosition == null) {
String message=Logging.getMessage("nullValue.PositionIsNull");
Logging.logger().severe(message);
throw new IllegalArgumentException(message);
}
if (northSouthRadiu... | Construct a Pyramid from a specified center position and axes lengths. |
public Builder withReuseAddress(boolean reuseAddress){
properties.setProperty(NettyOptions.REUSE_ADDRESS,String.valueOf(reuseAddress));
return this;
}
| Sets the SO_REUSEADDR option. |
public Object jjtAccept(ParserVisitor visitor,Object data){
return visitor.visit(this,data);
}
| Accept the visitor. |
private static String encode(byte[] binaryData){
if (binaryData.length != 16) {
return null;
}
char[] buffer=new char[32];
for (int i=0; i < 16; i++) {
int low=(binaryData[i] & 0x0f);
int high=((binaryData[i] & 0xf0) >> 4);
buffer[i * 2]=HEXADECIMAL[high];
buffer[(i * 2) + 1]=HEXADECIMAL[low... | Encodes the 128 bit (16 bytes) MD5 digest into a 32 characters long <CODE>String</CODE> according to RFC 2617. |
private void updateVisibilityOfNumStatPanels(){
for ( JPanel statPanel : listOfNumStatPanels) {
if (getModel() != null && getModel().isEnlarged()) {
statPanel.setPreferredSize(DIMENSION_PANEL_NUMERIC_PREF_SIZE_ENLARGED);
if (listOfAdditionalNumStatPanels.contains(statPanel)) {
statPanel.setVi... | Updates the visibility of num stat panels depending on enlarged status. |
public static boolean isValid(long number){
boolean valid=(getSize(number) >= 13 && getSize(number) <= 16) && (prefixMatched(number,4) || prefixMatched(number,5) || prefixMatched(number,37)|| prefixMatched(number,6)) && ((sumOfDoubleEvenPlace(number) + sumOfOddPlace(number)) % 10 == 0);
return valid;
}
| Return true if the card number is valid |
public NetworkResponse(int statusCode,byte[] data,Map<String,String> headers,boolean notModified,long networkTimeMs){
this.statusCode=statusCode;
this.data=data;
this.headers=headers;
this.notModified=notModified;
this.networkTimeMs=networkTimeMs;
}
| Creates a new network response. |
public void update(byte[] input,int offset,int len){
if (input == null) {
throw new IllegalArgumentException("No input buffer given");
}
if (input.length - offset < len) {
throw new IllegalArgumentException("Input buffer too short");
}
engineUpdate(input,offset,len);
state=IN_PROGRESS;
}
| Updates the digest using the specified array of bytes, starting at the specified offset. |
public boolean visit(MoveSourceEdit edit){
return visitNode(edit);
}
| Visits a <code>MoveSourceEdit</code> instance. |
public void doCarDetail(HtmlPage carDetail) throws Exception {
assertNotNull(carDetail);
int previousPrice=0, basePrice=getNumberNearLabel("basePriceLabel",carDetail), currentPrice=getNumberNearLabel("yourPriceLabel",carDetail);
List buttons=getAllElementsOfGivenClass(carDetail,null,HtmlSubmitInput.class);
Html... | <p>Assumptions: Each of the package buttons causes an increase in base price over the previous button, in order.</p> |
QuantifierDecomposition decomposeQuantifier(NodeRepresentation nodeRepArg,boolean isForAll){
QuantifierDecomposition result=new QuantifierDecomposition();
result.news=new Vector<NodeRepresentation>();
NodeRepresentation nodeRep=nodeRepArg;
Decomposition decomp=nodeRep.decomposition;
NodeTextRep newNodeText=nu... | Returns the NodeRepresentations of the nodes forming the decomposition for a \A or \E split. It assumes that the decomposition is a \A or \E decomposition, so its quantIds field is not null. The NodeRepresentations for the NEW assumptions are given a null semanticNode field, since I don't think that field is ever used ... |
public LinkedList<Operator> createOperatorsFromSchedule(TransitSchedule originalSchedule){
return new CreateOperatorFromTransitSchedule(this.operatorFactory,this.routeProvider,this.pConfig,originalSchedule).run();
}
| Creates operators from a given transit schedule |
public void createRPClasses(){
if (inited) {
return;
}
createRPClassesWithoutBaking();
RPClass.bakeAll();
}
| creates the RPClass definitions, unless this was already done. |
public Issue2194ITCase(String name){
super(name);
}
| Construct a new instance of this test case. |
private Class<?> findDexClass(String name) throws TestFailed, InvocationTargetException {
Object dexFile=null;
Class dexClass=null;
try {
try {
dexClass=ClassLoader.getSystemClassLoader().loadClass("dalvik.system.DexFile");
Constructor ctor=dexClass.getConstructor(new Class[]{String.class});
... | Finds the class with the specified binary name, from DEX_FILE. If we don't find a match, we throw an exception. |
public static String stringFor(int n){
switch (n) {
case CU_JIT_CACHE_OPTION_NONE:
return "CU_JIT_CACHE_OPTION_NONE";
case CU_JIT_CACHE_OPTION_CG:
return "CU_JIT_CACHE_OPTION_CG";
case CU_JIT_CACHE_OPTION_CA:
return "CU_JIT_CACHE_OPTION_CA";
}
return "INVALID CUjit_cacheMode: " + n;
}
| Returns the String identifying the given CUjit_cacheMode |
public SourceDisplayText(String displayText){
super(displayText);
}
| Creates a source display text property. |
public void println(String x){
printHeader();
for (int i=0; i < size(); i++) ((PrintStream)m_Streams.get(i)).println(x);
flush();
}
| prints the given string to the streams. |
private static void createAndShowGUI(){
JFrame.setDefaultLookAndFeelDecorated(true);
JFrame frame=new JFrame("IM with L&F");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JTextArea description=new JTextArea("Please try typing using below-the-spot IM.\n\n eg. Use City IM with the following arguement:\n ... | Create the GUI and show it. For thread safety, this method should be invoked from the event-dispatching thread. |
private static void gatherSystemInfo(Ignite ignite) throws IgniteException {
Collection<String> res=ignite.compute().broadcast(null);
System.out.println();
System.out.println("Nodes system information:");
System.out.println();
res.forEach(null);
}
| Gather system info from all nodes and print it out. |
public void createTempTableIfNeeded(final String childTableName) throws IOException {
try {
final AccumuloRdfConfiguration accumuloRdfConfiguration=new AccumuloRdfConfiguration(conf);
accumuloRdfConfiguration.setTablePrefix(childTablePrefix);
final Connector connector=AccumuloRyaUtils.setupConnector(accum... | Creates the temp child table if it doesn't already exist in the parent. |
protected static LuaValue[] newupl(LuaValue v){
return new LuaValue[]{v};
}
| Java code generation utility to allocate storage for upvalue, initialize with value |
public String toString(){
StringBuilder buf=new StringBuilder();
buf.append('[').append(getTokenName(type));
if (line != -1) {
buf.append('@').append(line);
if (column != -1) buf.append(',').append(column);
}
buf.append("]:");
if (text != null) buf.append('"').append(text).append('"');
else ... | Returns a description of this token, for debugging purposes. |
@Override public boolean put(int key,int firstValue,int secondValue){
int position=key << 1;
array.addEntry(firstValue,position);
array.addEntry(secondValue,position + 1);
numStoredKeysCounter.incr();
return false;
}
| Only a single writer can call this at one time. This method is NOT thread-safe! |
protected void nodeCompleted(Object parent,Object node){
getProxyBuilder().getCurrentFactory().onNodeCompleted(getProxyBuilder().getChildBuilder(),parent,node);
}
| A hook to allow nodes to be processed once they have had all of their children applied. |
private void updateHomeTaskListAdapter(){
mHomeTaskListAdapter.notifyDataSetChanged();
mHomeTaskCountTextView.setText(String.valueOf(mHomeTaskListAdapter.getItemCount()));
}
| Should call this method after HomeTaskListAdapter's data are changed. |
public static int convertToIntArray(final byte[] vals,final int[] dest){
checkSource(vals.length,4);
checkDestination(vals.length,dest.length,4);
return convertToIntArrayInternal(vals,0,vals.length,dest,0);
}
| Converts <code>byte[]</code> to <code>long[]</code>, assuming big-endian byte order. |
private void run(){
try {
startServices();
}
catch ( Throwable ex) {
Slog.e("System","******************************************");
Slog.e("System","************ Failure starting cm system services",ex);
throw ex;
}
}
| Invoked via reflection by the SystemServer |
public Dependencies add(Dependency dependency){
dependencies.add(requireNonNull(dependency,"Required not null dependency"));
if (!isNew()) {
addDependencyToXML(dependency);
}
return this;
}
| Adds new dependency to the end of dependencies list. <p/> Creates dependencies tag if element doesn't have dependencies yet |
public static PropertyListBuilder createBuilder(ConfigurationEventTypeLegacy optionalLegacyClassConfigs){
if (optionalLegacyClassConfigs == null) {
return new PropertyListBuilderJavaBean(null);
}
if (optionalLegacyClassConfigs.getAccessorStyle() == ConfigurationEventTypeLegacy.AccessorStyle.JAVABEAN) {
re... | Creates an implementation for a builer considering the accessor style and code generation flags for a given class. |
public Configuration(String name,String[] args) throws IOException, ConfigurationException {
configName=name;
parseCmdLine(args);
readConfigurationFile();
parseCmdLine(args);
setConfig(this);
}
| Loads the configuration from a file named <tt>name</tt> and then updates the configuration using the programs arguments stored in <tt>args</tt>. |
protected String computeRemoteHostName() throws MessagingException, UnknownHostException {
return getDNSServer().getHostName(getDNSServer().getByName(getRemoteAddress()));
}
| Answer the Canonical host name of the remote server for the message being processed. |
public TupleSerializer(){
super();
}
| De-serialization ctor. |
public static Map<String,Object> createContentAssocMethod(DispatchContext dctx,Map<String,? extends Object> rcontext) throws GenericServiceException, GenericEntityException {
Map<String,Object> context=UtilMisc.makeMapWritable(rcontext);
List<String> targetOperationList=ContentWorker.prepTargetOperationList(context... | Create a ContentAssoc method. The work is done in this separate method so that complex services that need this functionality do not need to incur the reflection performance penalty. |
public static void d(String msg,Throwable cause){
if (BuildConfig.DEBUG) {
Log.d(LOG_TAG,msg,cause);
}
}
| <p><b>DEBUG:</b> This level of logging should be used to further note what is happening on the device that could be relevant to investigate and debug unexpected behaviors. You should log only what is needed to gather enough information about what is going on about your component. If your debug logs are dominating the l... |
public void cancelCellEditing(){
delegate.cancelCellEditing();
}
| Forwards the message from the <code>CellEditor</code> to the <code>delegate</code>. |
public static void register(){
final MoveAction move=new MoveAction();
CommandCenter.register(MOVE,move);
}
| registers the action |
final boolean ensureActivityConfigurationLocked(ActivityRecord r,int globalChanges){
if (mConfigWillChange) {
if (DEBUG_SWITCH || DEBUG_CONFIGURATION) Slog.v(TAG,"Skipping config check (will change): " + r);
return true;
}
if (DEBUG_SWITCH || DEBUG_CONFIGURATION) Slog.v(TAG,"Ensuring correct configu... | Make sure the given activity matches the current configuration. Returns false if the activity had to be destroyed. Returns true if the configuration is the same, or the activity will remain running as-is for whatever reason. Ensures the HistoryRecord is updated with the correct configuration and all other bookkeepin... |
static boolean keyEquals(long ptr,byte[] keyBytes,GridUnsafeMemory mem){
long len=readKeyLength(ptr,mem);
return len == keyBytes.length && GridUnsafeMemory.compare(ptr + HEADER_SIZE,keyBytes);
}
| Checks if keys are equal. |
public List<Contact> _queryAddressBook_ContactList(Long id){
synchronized (this) {
if (addressBook_ContactListQuery == null) {
QueryBuilder<Contact> queryBuilder=queryBuilder();
queryBuilder.where(Properties.Id.eq(null));
addressBook_ContactListQuery=queryBuilder.build();
}
}
Query<Contact... | Internal query to resolve the "contactList" to-many relationship of AddressBook. |
public SetSourceNeurons(final NetworkPanel networkPanel){
super(networkPanel,"Set Source Neurons",EnablingCondition.NEURONS);
putValue(NAME,"Set Source Neurons");
putValue(SHORT_DESCRIPTION,"Set selected neurons as source neurons. They can then be connected to target neurons using the connect commands.");
}
| Construct action. |
public void addEdge(T fromNode,T toNode){
if (!nodesMap.containsKey(fromNode)) {
addNode(fromNode);
}
if (!nodesMap.containsKey(toNode)) {
addNode(toNode);
}
if (nodesMap.get(fromNode).outEdges.add(nodesMap.get(toNode)) && nodesMap.get(toNode).inEdges.add(nodesMap.get(fromNode))) countEdges++;
}
| Add an edge in the digraph. In case the nodes do not exist yet then add them too. |
private void createConstraintToast(FormIndex index,int saveStatus){
FormController formController=Collect.getInstance().getFormController();
String constraintText;
switch (saveStatus) {
case FormEntryController.ANSWER_CONSTRAINT_VIOLATED:
Collect.getInstance().getActivityLogger().logInstanceAction(this,"createC... | Creates and displays a dialog displaying the violated constraint. |
public ModelKeyMap findKeyMap(String fieldName){
for ( ModelKeyMap keyMap : keyMaps) {
if (keyMap.getFieldName().equals(fieldName)) return keyMap;
}
return null;
}
| Find a KeyMap with the specified fieldName |
public void nodeAdded(SessionEvent event){
}
| Indicates that a node has been added. |
@SuppressWarnings("unchecked") public static void addToNamedList(Node nd,NamedList nlst,List arr){
if (nd.getNodeType() != Node.ELEMENT_NODE) return;
final String type=nd.getNodeName();
final String name=getAttr(nd,NAME);
Object val=null;
if ("lst".equals(type)) {
val=childNodesToNamedList(nd);
}
els... | Examines a Node from the DOM representation of a NamedList and adds the contents of that node to both the specified NamedList and List passed as arguments. |
public DirectedSparseMultigraph(){
super(EdgeType.DIRECTED);
vertices=new HashMap<V,Pair<Set<E>>>();
edges=new HashMap<E,Pair<V>>();
}
| Creates a new instance. |
protected void createShapes(DrawContext dc){
if (this.positions == null) return;
this.rings=new ArrayList<SurfaceCircle>();
Iterator<? extends Position> iterator=this.positions.iterator();
Position center=iterator.next();
double globeRadius=dc.getGlobe().getRadius();
while (iterator.hasNext()) {
Surfa... | Create the circles used to draw this graphic. |
@Override protected void init(){
super.init();
addTableStyleGenerator();
}
| Initialize the component. |
private void fillCompetitiveNetworkFieldValues(){
updateMethod.setSelectedItem(((CompetitiveNetwork)competitive).getCompetitive().getUpdateMethod());
tfEpsilon.setText(Double.toString(((CompetitiveNetwork)competitive).getCompetitive().getLearningRate()));
tfLoserValue.setText(Double.toString(((CompetitiveNetwork)... | Fill field values for a Competitive Network. |
public Button extractLastClickedComponent(){
Button c=lastClickedComponent;
lastClickedComponent=null;
return c;
}
| Allows partitioning the renderer into "areas" that can be clicked. When receiving an action event in the list this method allows a developer to query the renderer to "see" whether a button within the component was "touched" by the user on a touch screen device. This method will reset the value to null after returning... |
@Override public void add(int index,Character element){
}
| Inserts the specified element at the specified position in this list (optional operation). Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices). |
@SuppressWarnings("unused") private final void printPaths(){
String[] bootclassPaths=System.getProperty("sun.boot.class.path").split(":");
processingEnv.getMessager().printMessage(Kind.NOTE,"bootclass path:");
for ( String path : bootclassPaths) {
processingEnv.getMessager().printMessage(Kind.NOTE,"\t" + pat... | Debug Use Displays all classpaths |
public void commit(){
try {
endTransaction(true);
}
catch ( HGTransactionException ex) {
throw new HGException(ex);
}
}
| <p> Commit the current transaction by calling <code>endTransaction(true)</code>. Wrap the possible <code>HGTransactionException</code> in a <code>HGException</code>. </p> |
@Override protected int sizeOf(String key,BitmapDrawable value){
final int bitmapSize=getBitmapSize(value) / 1024;
return bitmapSize == 0 ? 1 : bitmapSize;
}
| Measure item size in kilobytes rather than units which is more practical for a bitmap cache |
private void pushMetadataMessage(byte[] key,byte[] value) throws IOException {
AtomicLong mms=this.metadataMessagesSize.get();
List<KeyedMessage<byte[],byte[]>> msglist=this.metadataMessages.get();
if (null != key && null != value) {
byte[] kv=Arrays.copyOf(key,key.length + value.length);
System.arraycopy... | Push a metadata message onto the buffered list of Kafka messages and flush the list to Kafka if it has reached a threshold. |
public static boolean isInvalid(){
return invalid;
}
| Status of the current configuration. |
public double classifyInstance(Instance instance) throws Exception {
double[] dist=distributionForInstance(instance);
if (dist == null) {
throw new Exception("Null distribution predicted");
}
switch (instance.classAttribute().type()) {
case Attribute.NOMINAL:
double max=0;
int maxIndex=0;
for (int i=0; ... | Classifies the given test instance. The instance has to belong to a dataset when it's being classified. Note that a classifier MUST implement either this or distributionForInstance(). |
@SuppressWarnings("unchecked") protected void onDeleteComplete(int token,Object cookie,int result){
((AsyncProviderCommand<ArgType>)cookie).onCompletion(token,result);
}
| Called when an asynchronous delete is completed. |
protected void resetCommon() throws XNIException {
int count=fCommonComponents.size();
for (int i=0; i < count; i++) {
XMLComponent c=(XMLComponent)fCommonComponents.get(i);
c.reset(this);
}
}
| reset all common components before parsing |
public void testNonEscapeSequence() throws Exception {
check("'{fn test()}'","'{fn test()}'");
check("select '{fn test()}'","select '{fn test()}'");
check("select '{fn test()}' from table;","select '{fn test()}' from table;");
check("select test('arg') from table;","select {fn test('arg')} from table;");
ch... | Test non-escape sequences. |
public void fireDOMNodeInsertedIntoDocumentEvent(){
AbstractDocument doc=getCurrentDocument();
if (doc.getEventsEnabled()) {
super.fireDOMNodeInsertedIntoDocumentEvent();
for (Node n=getFirstChild(); n != null; n=n.getNextSibling()) {
((AbstractNode)n).fireDOMNodeInsertedIntoDocumentEvent();
}
}... | Recursively fires a DOMNodeInsertedIntoDocument event. |
public boolean toBoolean(){
return TypeFormat.parseBoolean(this);
}
| Returns the <code>boolean</code> represented by this character array. |
public void componentAdded(final ContainerEvent e){
final Component child=e.getChild();
if (!(child instanceof JMenu)) return;
addSubmenu((JMenu)child);
}
| Invoked when a component has been added to the container. |
Calendar toCalendar(String value,String pattern,Locale locale){
Calendar calendar=null;
try {
DateFormat format=(locale == null) ? new SimpleDateFormat(pattern) : new SimpleDateFormat(pattern,locale);
format.setLenient(false);
format.parse(value);
calendar=format.getCalendar();
}
catch ( Excepti... | Parse a String value to a Calendar |
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 final boolean push(boolean val){
if (m_index == m_allocatedSize - 1) grow();
return (m_values[++m_index]=val);
}
| Pushes an item onto the top of this stack. |
private void flushBitBuffer() throws IOException {
if (this.bitBufferCount > 0) {
this.bitBufferCount=0;
writeByte(this.bitBuffer);
}
}
| Flush the bit buffer into the output stream |
public boolean isInMemoryDb(){
return path.equalsIgnoreCase(MEMORY_DB_PATH);
}
| Returns true if the database is in-memory. |
private boolean isPreviousVersionInitial(TriggerProcess process){
if (process.getVersion() == 2) {
return true;
}
return false;
}
| Help method to determine if the trigger process has been cancelled before it went to status "WAITING_FOR_APPROVAL". This can happen for example if the JMS queue is full and the user clicks on "Abort" before the message was processed . In this case the version of the TriggerProcess is 2 because it went immediately from ... |
public boolean isKeepResourcesInRam(){
return keepResourcesInRam;
}
| Indicates that the UIBuilder should cache resources in memory and never release them. This is useful with small resource files or high RAM devices since it saves the cost of constantly fetching the res file from the jar whenever moving between forms. This can be toggled in the properties (e.g. jad) using the flag: cach... |
private static void debugPrintln(String msg){
if (debug) {
System.err.println(CLASS_NAME + ":" + msg);
}
}
| <p>Output debugging messages.</p> |
@Override public boolean okPressed(){
return (true);
}
| Close the dialog |
protected void showCrosshairs(){
if (this.animatorSet.isStarted()) {
this.animatorSet.cancel();
}
this.crosshairs.setAlpha(1.0f);
this.crosshairsActive=true;
}
| Makes the crosshairs visible. |
public void validate(){
if (pc < 0 || pc >= instructions.size()) {
pc=0;
}
}
| Ensure values of the state are valid ones. |
public LineDecorationIcon(LineDecoration decoration,boolean isStartDecoration){
lineFigure=new LineFigure();
lineFigure.setBounds(new Point2D.Double(2,8),new Point2D.Double(23,8));
if (isStartDecoration) {
lineFigure.set(START_DECORATION,decoration);
}
else {
lineFigure.set(END_DECORATION,decoration);
... | Creates a new instance. |
public static Vectorizer load(File f,boolean hasHeaderLine) throws IOException {
return new TextFormatVectorizer(TextFormatVectorizerUtils.readEmbeddingFileTxt(f,hasHeaderLine));
}
| Load a text-format embeddings file. |
private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter,java.lang.String namespace) throws javax.xml.stream.XMLStreamException {
java.lang.String prefix=xmlWriter.getPrefix(namespace);
if (prefix == null) {
prefix=generatePrefix(namespace);
while (xmlWriter.getNamespaceContext().g... | Register a namespace prefix |
public static X509Certificate createMockCertificateWithName(final String name){
final X509Certificate certificate=Mockito.mock(X509Certificate.class);
final X500Principal principal=new X500Principal(name);
Mockito.when(certificate.getIssuerX500Principal()).thenReturn(principal);
return certificate;
}
| Creates a new 509 certificate with the specified name. |
@Override public void clear(){
this._set.clear();
}
| Empties the set. |
public void enableInputMethods(boolean enable){
checkForEnableIM=false;
super.enableInputMethods(enable);
}
| Enables or disables input method support for this text component. If input method support is enabled and the text component also processes key events, incoming events are offered to the current input method and will only be processed by the component or dispatched to its listeners if the input method does not consume t... |
public static int toPixels(Resources res,float dp){
return (int)(dp * res.getDisplayMetrics().density);
}
| Converts dp to px |
public void logWarning(String message){
logger.warning(logPrefix + message);
}
| Logs a warning message using the logger of this interpreter. |
public KeyedVersions(KeyedVersions other){
if (other.isSetKey()) {
this.key=org.apache.thrift.TBaseHelper.copyBinary(other.key);
;
}
if (other.isSetVersions()) {
List<VectorClock> __this__versions=new ArrayList<VectorClock>();
for ( VectorClock other_element : other.versions) {
__this__ve... | Performs a deep copy on <i>other</i>. |
private void queueOutgoingData(byte[] data,String identifier){
if (!outBuffers.containsKey(identifier)) {
outBuffers.put(identifier,new ArrayDeque<byte[]>());
}
int mtu=getMtuForIdentifier(identifier);
int readIdx=0;
while (readIdx < data.length) {
if (data.length - readIdx > mtu) {
ByteArrayOut... | Queue data for transmission to identifier |
public String globalInfo(){
return "Class for building and using a simple decision table majority " + "classifier.\n\n" + "For more information see: \n\n"+ getTechnicalInformation().toString();
}
| Returns a string describing classifier |
protected void nextLine(String s){
if (s.length() < 5) {
return;
}
if (s.startsWith("DATA,,")) {
setReceivers(s);
return;
}
Reading r;
try {
r=makeReading(s);
}
catch ( Exception e) {
log.error("Exception formatting input line \"" + s + "\": "+ e);
return;
}
if (r == null) {
... | Handle a new line from the device. This needs to execute on the Swing GUI thread. It forwards via the Distributor object. |
public <OUT>DataStreamSource<OUT> fromCollectionWithTimestamp(Collection<StreamRecord<OUT>> data,TypeInformation<OUT> outType,Boolean flushWindows){
Preconditions.checkNotNull(data,"Collection must not be null");
TypeInformation<StreamRecord<OUT>> typeInfo;
StreamRecord<OUT> first=data.iterator().next();
try {
... | Creates a data stream from the given non-empty collection. <p> <p>Note that this operation will result in a non-parallel data stream source, i.e., a data stream source with a parallelism one.</p> |
public void printStackTrace(java.io.PrintStream s){
if (exception == null) {
super.printStackTrace(s);
}
else {
synchronized (s) {
s.println(this);
super.printStackTrace();
}
}
}
| Prints this <code>Exception</code> and its backtrace to the specified print stream. |
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. |
@Override public void onTouchLetterSection(int sectionIndex,EasySection letterSection){
this.imageFloatingTv.setVisibility(View.VISIBLE);
this.imageFloatingIv.setVisibility(View.INVISIBLE);
this.imageFloatingTv.setText(letterSection.letter);
this.scrollToPosition(this.adapter.getPositionForSection(sectionIndex)... | On touch letter section |
public Id<ActivityFacility> sampleBiasedDestinationNode(Id<ActivityFacility> origin,String destinationType,Random random){
Tuple<Id<ActivityFacility>,String> weightMapTuple=new Tuple<Id<ActivityFacility>,String>(origin,destinationType);
Map<Id<ActivityFacility>,Integer> weightMap;
if (!nodeWeightMap.containsKey(w... | Samples a destination node from a given origin and given a specific activity type at the destination. |
public static boolean equals(long[] array1,long[] array2){
if (array1 == array2) {
return true;
}
if (array1 == null || array2 == null || array1.length != array2.length) {
return false;
}
for (int i=0; i < array1.length; i++) {
if (array1[i] != array2[i]) {
return false;
}
}
return t... | Compares the two arrays. |
@RequestMapping(value="/api/greetings/{id}/send",method=RequestMethod.POST,produces=MediaType.APPLICATION_JSON_VALUE) public ResponseEntity<Greeting> sendGreeting(@PathVariable("id") Long id,@RequestParam(value="wait",defaultValue="false") boolean waitForAsyncResult){
logger.info("> sendGreeting id:{}",id);
Greetin... | Web service endpoint to fetch a single Greeting entity by primary key identifier and send it as an email. If found, the Greeting is returned as JSON with HTTP status 200 and sent via Email. If not found, the service returns an empty response body with HTTP status 404. |
public LinkWithEditorPartListener(ILinkedWithEditorView view){
this.view=view;
}
| Creates a new LinkWithEditorPartListener |
public OMGraphic createGraphic(int renderType,int lineType){
OMGraphic g=null;
switch (renderType) {
case (OMGraphic.RENDERTYPE_LATLON):
g=new OMSpline(new double[0],OMGraphic.RADIANS,lineType);
break;
case (OMGraphic.RENDERTYPE_OFFSET):
g=new OMSpline(90f,-180f,new int[0],OMSpline.COORDMODE_ORIGIN);
break;
def... | Extendable method to create specific subclasses of OMPolys. |
public Expression parseExpression(String expression) throws ParseException {
this.lexer=new ExpressionLexer(expression);
nextToken();
Expression exp=parseExpression();
expect(Token.EOF);
return exp;
}
| Parses the given expression, or throws an exception if its not possible. |
public void resumeTransfer() throws RcsPermissionDeniedException, RcsPersistentStorageException, RcsGenericException {
try {
mTransferInf.resumeTransfer();
}
catch ( Exception e) {
RcsPermissionDeniedException.assertException(e);
RcsPersistentStorageException.assertException(e);
throw new RcsGener... | Resumes the file transfer |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.