code stringlengths 10 174k | nl stringlengths 3 129k |
|---|---|
public static <T>List<T> distributedSample(List<T> items,int m){
if (items.size() <= m) {
return new ArrayList<>(items);
}
List<T> res=new ArrayList<>(m);
int n=items.size();
int step=n / m;
for (int i=0; i < n; i+=step) {
res.add(items.get(i));
}
return res;
}
| Get every nth point, where n = items.size()/m |
final void advance(){
if (next == null) throw new NoSuchElementException();
lastReturned=next;
for (; ; ) {
next=next.next;
if (next == null) break;
Object x=next.value;
if (x != null && x != next) break;
}
}
| Advances next to higher entry. |
public String toString(Tag tag){
return createHTML(readFile(tag.text()));
}
| Given the <code>Tag</code> representation of this custom tag, return its string representation. |
private void groupBuild(Node r){
if (m_groupNum > 0) {
m_groupNum=0;
m_groups[0].m_p=r;
m_groupNum++;
for (int noa=0; noa < m_groupNum; noa++) {
groupFind(m_groups[noa].m_p,noa);
}
}
}
| This starts to create the information about the sibling groups. As more groups are created the for loop in this will check those groups for lower groups. |
final boolean unlink(Index<K,V> succ){
return node.value != null && casRight(succ,succ.right);
}
| Tries to CAS right field to skip over apparent successor succ. Fails (forcing a retraversal by caller) if this node is known to be deleted. |
public static String flagsToString(Flags flags){
StringBuilder b=new StringBuilder();
if (flags.contains(Flag.ANSWERED)) {
b.append("ANSWERED ");
}
if (flags.contains(Flag.DELETED)) {
b.append("DELETED ");
}
if (flags.contains(Flag.DRAFT)) {
b.append("DRAFT ");
}
if (flags.contains(Flag.FLAG... | Returns a String composed of all flags in the parameter. |
public static void expand(ByteBuffer in,ByteBuffer out){
do {
int ctrl=in.get() & 255;
if (ctrl < MAX_LITERAL) {
ctrl++;
for (int i=0; i < ctrl; i++) {
out.put(in.get());
}
}
else {
int len=ctrl >> 5;
if (len == 7) {
len+=in.get() & 255;
}
len+=2;... | Expand a number of compressed bytes. |
public void stop() throws IllegalStateException {
Log.d(TAG,"stop");
if (mediaPlayer != null) {
currentState=State.STOPPED;
mediaPlayer.stop();
}
else throw new RuntimeException("Media Player is not initialized");
}
| MediaPlayer method (stop) |
protected MapNode selectRandomOkNode(List<MapNode> nodes){
MapNode n;
do {
n=nodes.get(rng.nextInt(nodes.size()));
}
while (okMapNodeTypes != null && !n.isType(okMapNodeTypes));
return n;
}
| Selects and returns a random node that is OK from a list of nodes. Whether node is OK, is determined by the okMapNodeTypes list. If okMapNodeTypes are defined, the given list <strong>must</strong> contain at least one OK node to prevent infinite looping. |
public ChatLinearLayoutManager(Context context){
this(context,VERTICAL,false);
}
| Creates a vertical LinearLayoutManager |
private static void err(String message){
out.println(message);
}
| All parts of JFlex, that want to report error messages should use this method for their output. |
public void testExplode(){
String[] testStrings={"a:b","ab:cd","ab::cd",":ab:cd","ab:cd:",":ab:cd:","::ab::cd::","a","ab",""};
for ( String test : testStrings) {
String[] resultExplode=StringUtils.explode(test,':');
String[] resultSplit=test.split(":");
assertEquals("Different result lengths with test ... | Tests the method explode(String, char), which should always return the same as String.split(String) does. |
public Registry loadRegistry(){
try {
Input input=new Input(new FileInputStream(Registry.HOME_DATA_FILE));
RegistryDescriptor registryDescriptor=kryo.readObjectOrNull(input,RegistryDescriptor.class);
if (registryDescriptor == null) {
registryDescriptor=new RegistryDescriptor();
}
return Desc... | Loads the registry. Save to use afterwards, nothing else needs to be loaded. |
public void add(int[] vals,int offset,int length){
ensureCapacity(_pos + length);
System.arraycopy(vals,offset,_data,_pos,length);
_pos+=length;
}
| Adds a subset of the values in the array <tt>vals</tt> to the end of the list, in order. |
public Boolean isHotAddRemove(){
return hotAddRemove;
}
| Gets the value of the hotAddRemove property. |
public ProtocolVersion(int major,int minor){
this.minor=minor;
this.major=major;
}
| Instantiates a new protocol version. |
public void run(){
Logger.debug(getClass().getName(),"Launching " + agent);
List peers=DRM.getContributions();
try {
final String pre=agent.getType() + "." + agent.getJob();
if (!StringCollections.containsPrefix(getNames(),pre) || peers.size() == 0) {
type="local";
return;
}
int p=(int... | Send the message through a socket connection. |
public String toString(){
StringBuffer sb=new StringBuffer("MNote[").append(get_ID()).append(",AD_Message_ID=").append(getAD_Message_ID()).append(",").append(getReference()).append(",Processed=").append(isProcessed()).append("]");
return sb.toString();
}
| String Representation |
@Override public void runSingleIteration(){
LOG.info("SALSA: running right subgraph iteration");
salsaSubgraphInternalState.traverseSubgraphRightToLeft();
}
| Runs a single right-to-left SALSA iteration. This direction resets some of the random walks to start again from the queryNode. |
@Override synchronized public void stop(){
if (mRunTask != null && !mRunTask.isCancelled()) {
if (mLogVerbose) Log.v(TAG,"Stopping graph.");
mRunTask.cancel(false);
}
}
| Stop graph execution. This is an asynchronous call; register a callback with setDoneCallback to be notified of when the background processing has been completed. Calling stop will close the filter graph. |
private ArrayList<Long> buildCursorPositionMapping(final long[] order,final String columnName,final List<? extends Object> extraData){
ArrayList<Long> missingIds=new ArrayList<Long>();
mOrderedPositions=new ArrayList<Integer>(mCursor.getCount());
mExtraData=new ArrayList<Object>();
mMapCursorPositions=new HashM... | This function populates mOrderedPositions with the cursor positions in the order based on the order passed in |
@Override public boolean isActive(){
return amIActive;
}
| Used by the Whitebox GUI to tell if this plugin is still running. |
protected final void showFileExistsErrorMessage(@NotNull VirtualFile file,@NotNull String id,@NotNull Project project){
final String message;
if (file.isDirectory()) {
message=PyBundle.message("refactoring.error.directory.exists",file.getName());
}
else {
message=PyBundle.message("refactoring.error.file.... | Show standard error dialog containing message about unexpected presense of given file or directory. |
@Override public synchronized void acceptDataSet(DataSetEvent e){
m_busy=true;
if (m_completed == null) {
m_completed=new HashMap<Object,Instances>();
m_tempBatchFiles=new HashMap<Object,File>();
}
Object source=e.getSource();
if (m_completed.containsKey(source)) {
if (m_log != null && !e.isStruct... | Accept and process a data set event |
boolean checkEOF() throws IOException {
switch (getConnectionState()) {
case cs_START:
throw new SocketException("Socket is not connected");
case cs_HANDSHAKE:
case cs_DATA:
case cs_RENEGOTIATE:
case cs_SENT_CLOSE:
return false;
case cs_APP_CLOSED:
throw new SocketException("Socket is closed");
case cs_ERROR:
cas... | Return whether we have reached end-of-file. If the socket is not connected, has been shutdown because of an error or has been closed, throw an Exception. |
public UndertowFraction enableAJP(){
this.enableAJP=true;
return this;
}
| Enable AJP on this fraction. |
private void drawConditions(MoveStep step,Point stepPos,Graphics graph,Color col){
if (step.isEvading()) {
String evade=Messages.getString("BoardView1.Evade");
graph.setFont(new Font("SansSerif",Font.PLAIN,12));
int evadeX=(stepPos.x + 42) - (graph.getFontMetrics(graph.getFont()).stringWidth(evade) / 2);
... | draw conditions separate from the step, This allows me to keep conditions on the Aero even when that step is erased (as per advanced movement). For now, just evading and rolling. eventually loading and unloading as well |
public void initialize(){
((NodeEventTarget)eventTarget).addEventListenerNS(eventNamespaceURI,eventType,this,false,null);
}
| Initializes this timing specifier by adding the initial instance time to the owner's instance time list or setting up any event listeners. |
public Object invoke(String methodName,Class<?>[] paramClasses,Object[] paramValues){
Object result;
result=null;
if (getInterpreter() != null) {
result=invoke(getInterpreter(),methodName,paramClasses,paramValues);
}
return result;
}
| executes the specified method on the current interpreter and returns the result, if any. |
@Override protected EClass eStaticClass(){
return UmplePackage.eINSTANCE.getAnonymous_activity_1_();
}
| <!-- begin-user-doc --> <!-- end-user-doc --> |
public byte[] toByteArray(){
if (index > 0xFFFF) {
throw new RuntimeException("Class file too large!");
}
int size=24 + 2 * interfaceCount;
int nbFields=0;
FieldWriter fb=firstField;
while (fb != null) {
++nbFields;
size+=fb.getSize();
fb=(FieldWriter)fb.fv;
}
int nbMethods=0;
MethodWr... | Returns the bytecode of the class that was build with this class writer. |
public static String format(Object value,int valueType){
if (value == null) {
return "?";
}
if (Ontology.ATTRIBUTE_VALUE_TYPE.isA(valueType,Ontology.NOMINAL)) {
return (String)value;
}
if (Ontology.ATTRIBUTE_VALUE_TYPE.isA(valueType,Ontology.NUMERICAL)) {
return formatIntegerIfPossible((Double)val... | Formats the value according to the given valueType. The value must be an object of type String for nominal values, an object of type Date for date_time values or of type Double for numerical values. |
public PacketBUTTON(String map_name,String button_name,boolean repeat,boolean down,boolean queue,short amount,byte axis){
super(PT_BUTTON);
short code=0;
short flags=BT_USE_NAME;
appendPayload(code,map_name,button_name,repeat,down,queue,amount,axis,flags);
}
| A button packet send a key press or release event to XBMC |
private void readObject(java.io.ObjectInputStream s) throws IOException, ClassNotFoundException {
s.defaultReadObject();
if (loadFactor <= 0 || Float.isNaN(loadFactor)) throw new StreamCorruptedException("Illegal Load: " + loadFactor);
int origlength=s.readInt();
int elements=s.readInt();
if (elements < 0) ... | Reconstitute the Hashtable from a stream (i.e., deserialize it). |
public InvitationExample(){
oredCriteria=new ArrayList<Criteria>();
}
| This method was generated by MyBatis Generator. This method corresponds to the database table invitation |
public void gcspyGatherData(LinearSpaceDriver driver){
driver.setRange(space.getStart(),limit);
this.linearScan(driver.getScanner());
}
| Gather data for GCspy. <p> This method calls the drivers linear scanner to scan through the objects allocated by this bump pointer. |
public static byte[] decodeWebSafe(byte[] source,int off,int len) throws Base64DecoderException {
return decode(source,off,len,WEBSAFE_DECODABET);
}
| Decodes web safe Base64 content in byte array format and returns the decoded byte array. Web safe encoding uses '-' instead of '+', '_' instead of '/' |
private void checkInternalMods(){
if (modules.getModList() == null) return;
for ( final ModuleBean mod : modules.getModList()) {
final Path intModPath=LEnv.PATH_MODS.resolve(mod.getFolder()).resolve(mod.getVersion().toString());
if (Files.exists(intModPath) && Files.isDirectory(intModPath)) validateM... | Checks the internal modules (and also updates/repairs them). |
private static Script scriptFromString(String scriptString,ScriptType scriptType){
return new Script(scriptString,scriptType);
}
| Create a DML or PYDML Script object based on a string. |
public static MatrixChar_N_ReducerGroups computeMatrixCharacteristics(JobConf job,byte[] inputIndexes,String dataGenInstructions,String instructionsInMapper,String reblockInstructions,String aggInstructionsInReducer,String aggBinInstructions,String otherInstructionsInReducer,byte[] resultIndexes,HashSet<Byte> mapOutput... | NOTE: this method needs to be in-sync with MRBaseForCommonInstructions.processOneInstruction, otherwise, the latter will potentially fail with missing dimension information. |
public final void add(IndexableField field){
fields.add(field);
}
| <p>Adds a field to a document. Several fields may be added with the same name. In this case, if the fields are indexed, their text is treated as though appended for the purposes of search.</p> <p> Note that add like the removeField(s) methods only makes sense prior to adding a document to an index. These methods can... |
public void addComment(Comment comment){
addProperty(comment);
}
| Adds a comment to the to-do task. |
public void prepareDraw(){
if (parentNode != null) parentNode.prepareDraw();
else {
setAbsoluteRotations();
setVectors();
}
}
| Prepares the bones for rendering. This will automatically take the root Bone if it isn't. |
public String htmlAll(boolean setIncluded){
StringBuilder sb=new StringBuilder();
for ( Node node : nodes) {
sb.append(setIncluded ? node.getHtml() : node.getInnerHtml());
}
return sb.toString();
}
| Gets the combined HTML contents of each element in the set of matched elements, including their descendants. |
public final boolean isProtReady(){
return (state == STATE_DONE);
}
| Tests if the context can be used for per-message service. Context may allow the calls to the per-message service functions before being fully established. |
public static void writeInputStreamToFile(InputStream inputStream,File file){
OutputStream outStream=null;
try {
outStream=new FileOutputStream(file);
byte[] buffer=new byte[8 * 1024];
int bytesRead;
while ((bytesRead=inputStream.read(buffer)) != -1) {
outStream.write(buffer,0,bytesRead);
... | Write input stream to file. |
public void testShortOptions(){
ArgumentParser parser=new ArgumentParser(new String[]{"-a","-b","-cd","-efg","-h=j","-kl=m","-nop=qrs","-tu=vw xyz","=","-","-=","-1","-2=","-=3","-=4=5"},true);
Iterator<String> iter=parser.iterator();
assertEquals("-a",iter.next());
assertEquals("-b",iter.next());
assertEqual... | Test if short options (beginning with '-'), which can be written in a collapsed form, are correctly recognized. |
private Node<Key> merge(Node<Key> h,Node<Key> x,Node<Key> y){
if (x == null && y == null) return h;
else if (x == null) h.sibling=merge(y,null,y.sibling);
else if (y == null) h.sibling=merge(x,x.sibling,null);
else if (x.order < y.order) h.sibling=merge(x,x.sibling,y);
else h.sibling=merge(y,x,y.s... | Functions for inserting a key in the heap |
@SuppressWarnings("ManualArrayToCollectionCopy") public void addExistingIds(Collection<IgniteUuid> col,boolean relaxed){
if (relaxed) {
col.add(ids[lastExistingIdx]);
if (lastExistingIdx == ids.length - 1 && lastExistingIdx > 0) col.add(ids[lastExistingIdx - 1]);
}
else {
for (int i=0; i <= lastExi... | Add existing IDs to provided collection. |
private void makeFPRPrimaryForThisNode(){
PartitionedRegion partitionedRegion=model.getPartitionedRegion();
List<FixedPartitionAttributesImpl> FPAs=partitionedRegion.getFixedPartitionAttributesImpl();
InternalDistributedMember targetId=partitionedRegion.getDistributionManager().getId();
Member target=model.getM... | Move all primary from other to this |
public static synchronized void sendAuthPathProto(UserLeafNode uln,RootNode root,Socket socket){
Logging.log("Sending authentication path response... ");
AuthPath authPath=buildAuthPathMsg(uln,root);
sendMsgProto(MsgType.AUTH_PATH,authPath,socket);
}
| Sends the authentication path protobuf returned for a client's key lookup. |
@Nonnull public static Uri addEmptyPlaceholder(@Nonnull Size size){
Uri uri=generateUniquePlaceholderUri();
sSessionsToSizes.put(uri,new Point(size.getWidth(),size.getHeight()));
sSessionsToPlaceholderBitmap.remove(uri);
Integer currentVersion=sSessionsToPlaceholderVersions.get(uri);
sSessionsToPlaceholderVer... | Creates an empty placeholder. |
private void initializeScreen(){
mListView=(ListView)findViewById(R.id.list_view_shopping_list_items);
mTextViewPeopleShopping=(TextView)findViewById(R.id.text_view_people_shopping);
mButtonShopping=(Button)findViewById(R.id.button_shopping);
Toolbar toolbar=(Toolbar)findViewById(R.id.app_bar);
setSupportActi... | Link layout elements from XML and setup the toolbar |
private static boolean shouldWrite(PngChunk c,int currentGroup){
if (currentGroup == CHUNK_GROUP_2_PLTE) return c.id.equals(ChunkHelper.PLTE);
if (currentGroup % 2 == 0) throw new PngjOutputException("bad chunk group?");
int minChunkGroup, maxChunkGroup;
if (c.getOrderingConstraint().mustGoBeforePLTE()) m... | this should be called only for ancillary chunks and PLTE (groups 1 - 3 - 5) |
public boolean isDone(){
return index > poly.npoints;
}
| Tests if there are more points to read. |
public JBBPOut Byte(final byte[] value) throws IOException {
assertNotEnded();
assertArrayNotNull(value);
if (this.processCommands) {
this.outStream.write(value);
}
return this;
}
| Write a byte array into the session stream. |
public Section readNextSection(String titleToLookFor) throws IOException {
String title=null;
StringBuilder keyBuilder=null;
while (true) {
String line=reader.readLine();
if (line == null) {
Preconditions.checkArgument(title == null,"missing end tag (%s)",title);
return null;
}
if (key... | Reads the next section in the PEM file, optionally based on a title to look for. |
public LeaderZookeeperStateMachineEnsemble(CuratorFramework curatorClient,String basePath,boolean cleanState,int logSize){
super(curatorClient,basePath,cleanState,logSize);
this.curatorClient=curatorClient;
this.basePath=basePath;
}
| Instantiates a new leader zookeeper state machine ensemble. |
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. |
public static void drawButton(AbstractButton b,Graphics g,Shape shape){
Graphics2D g2=(Graphics2D)g;
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
int h=(int)shape.getBounds().getHeight();
if (b.isEnabled()) {
if (b.getModel().isPressed() || b.getModel().isSelected(... | Draws the given button with the specified shape. |
public Clustering<CorrelationModel> run(Database database,Relation<V> relation){
final int dimensionality=RelationUtil.dimensionality(relation);
StepProgress stepprog=LOG.isVerbose() ? new StepProgress(3) : null;
LOG.beginStep(stepprog,1,"Preprocessing local correlation dimensionalities and partitioning data");
... | Performs the ERiC algorithm on the given database. |
public boolean performPrivateCommand(String action,Bundle data){
return false;
}
| The default implementation does nothing. |
public static String quoteRemarkSQL(String sql){
sql=replaceAll(sql,"*/","++/");
return replaceAll(sql,"/*","/++");
}
| In a string, replace block comment marks with /++ .. ++/. |
@Override protected EClass eStaticClass(){
return ImPackage.Literals.REFERENCING_ELEMENT_EXPRESSION_IM;
}
| <!-- begin-user-doc --> <!-- end-user-doc --> |
public static StackTraceElement[] approxSourceStackTraceElement(BytecodePosition bytecodePosition){
ArrayList<StackTraceElement> elements=new ArrayList<>();
BytecodePosition position=bytecodePosition;
while (position != null) {
ResolvedJavaMethod method=position.getMethod();
if (method != null) {
el... | Gets approximate stack trace elements for a bytecode position. |
public void testReset() throws InvalidKeyException {
if (!DEFSupported) {
fail(NotSupportedMsg);
return;
}
Mac[] macs=createMacs();
assertNotNull("Mac objects were not created",macs);
byte[] bb={(byte)1,(byte)2,(byte)3,(byte)4,(byte)5};
SecretKeySpec sks=new SecretKeySpec(bb,"SHA1");
byte[] bbuf={... | Test for <code>reset()</code> method Assertion: return Mac length |
@Override public boolean isFactoryForType(Object object){
if (object == modelPackage) {
return true;
}
if (object instanceof EObject) {
return ((EObject)object).eClass().getEPackage() == modelPackage;
}
return false;
}
| Returns whether this factory is applicable for the type of the object. <!-- begin-user-doc --> This implementation returns <code>true</code> if the object is either the model's package or is an instance object of the model. <!-- end-user-doc --> |
public boolean isDynamicSiblings(){
return dynamicSiblings;
}
| Returns true if siblings list is dynamic, i.e. task is continuous. |
private void removeSession(AbstractIoSession session){
sessions.remove(session);
}
| remove a session from the list of session being checked. |
public static Float toFloat(boolean b){
return new Float(toFloatValue(b));
}
| cast a boolean value to a Float Object(reference type) |
private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException {
s.defaultReadObject();
if (standardizedSemIm == null) {
throw new NullPointerException();
}
}
| Adds semantic checks to the default deserialization method. This method must have the standard signature for a readObject method, and the body of the method must begin with "s.defaultReadObject();". Other than that, any semantic checks can be specified and do not need to stay the same from version to version. A readObj... |
public static int encode(byte[] data,OutputStream out) throws IOException {
return encoder.encode(data,0,data.length,out);
}
| Encode the byte data to base 64 writing it to the given output stream. |
protected void initialize(){
Vector<String> classes;
int i;
Class<?> cls;
ResultMatrix matrix;
m_Result=CANCEL_OPTION;
if (m_OutputFormatClasses == null) {
classes=GenericObjectEditor.getClassnames(ResultMatrix.class.getName());
m_OutputFormatClasses=new Vector<Class<?>>();
m_OutputFormatNames=n... | initializes the member variables. |
public static Writer leftShift(OutputStream self,Object value) throws IOException {
OutputStreamWriter writer=new FlushingStreamWriter(self);
leftShift(writer,value);
return writer;
}
| Overloads the leftShift operator to provide an append mechanism to add values to a stream. |
protected ActionForward listadoConsultaNoDisponible(ActionMapping mappings,ActionForm form,HttpServletRequest request,HttpServletResponse response){
return mappings.findForward("ver_consultas_no_disponibles");
}
| Obtiene el forward para la pagina de ver prestamos no disponibles |
public LSSVM(KernelTrick kernel){
this(kernel,CacheMode.NONE);
}
| Creates a new LS-SVM learner that does not use a cache |
@Override public void eUnset(int featureID){
switch (featureID) {
case N4JSPackage.PROPERTY_NAME_OWNER__DECLARED_NAME:
setDeclaredName((LiteralOrComputedPropertyName)null);
return;
}
super.eUnset(featureID);
}
| <!-- begin-user-doc --> <!-- end-user-doc --> |
public boolean isPublic(){
return setter == null;
}
| is the field access using Field access type |
boolean accept(VcfRecord record){
mVcfFilterStatistics.increment(Stat.TOTAL_COUNT);
if (mSampleFailed != null) {
Arrays.fill(mSampleFailed,false);
}
mNonSampleSpecificFailed=false;
if (mRemoveOverlapping && record.getSequenceName().equals(mEndRef) && record.getStart() < mEndPosition) {
mVcfFilterStati... | Main filtering function... |
public FolderEntry createFolder(String name) throws ConflictException, ServerException, ForbiddenException {
return new FolderEntry(getVirtualFile().createFolder(name),projectRegistry);
}
| Creates new VirtualFile which denotes folder and use this one as parent folder. |
@Override public void resetTaskCompleted(){
lastTaskCompleted=true;
super.resetTaskCompleted();
}
| Resets the task processing status of the ArticleReader. This method has to be called if the hasNext() or next() methods throw an exception. |
private void playSoundInternal(String id,String channel){
if (client.settings.getBoolean("sounds") && checkRequirements(client.settings.getString(id + "Sound"),channel)) {
playSound(id);
}
}
| Plays the sound for the given sound identifier (highlight, status, ..), if the requirements are met. For use in EDT, because it may have to check which channel is currently selected, but not sure if that has to be in the EDT. |
public static TypeRef enforceNominalTyping(TypeRef rawT){
if (rawT.getTypingStrategy() == TypingStrategy.NOMINAL || rawT.isUseSiteStructuralTyping()) {
return rawT;
}
else {
TypeRef T=TypeUtils.copy(rawT);
if (T instanceof StructuralTypeRef) {
((StructuralTypeRef)T).setTypingStrategy(TypingStrate... | Enforces nominal typing if possible. |
public static String fasta(String... sequences){
final StringBuilder sb=new StringBuilder();
for (int i=0; i < sequences.length; i++) {
sb.append(">").append(i).append(StringUtils.LS).append(sequences[i]).append(StringUtils.LS);
}
return sb.toString();
}
| Produce a fasta string with the given sequences |
public XYZBounds(){
}
| Construct an empty bounds object |
public void resetCount(){
mProgress=0.0f;
mTargetProgress=0.0f;
invalidate();
}
| Reset the count (in increment mode) |
public synchronized StringBuffer reverse(){
reverse0();
return this;
}
| Reverses the order of characters in this buffer. |
public static byte[] speedStep28Packet(int address,boolean longAddr,int speed,boolean fwd){
log.debug("28 step packet {} {}",address,speed);
if (!addressCheck(address,longAddr)) {
return null;
}
if (speed < 0 || speed > 28) {
log.error("invalid speed " + speed);
return null;
}
int speedC=(speed ... | From NMRA RP 9.2.1 [A Crosland 05/02/12] There is an issue with this method in that it cannot create a 28 step speed packet for maximum speed. Input speed value in the range 0 - 28 is converted to speed steps, 0, estop, 1, 2, ..., 27. This method should probably be deprecated. It is used only by NceThrottle.java and Ea... |
public void loadStaticAspects(NBTTagCompound nbt){
this.matchedAspects.clear();
NBTTagList entryList=(NBTTagList)nbt.getTag("entries");
entryIT: for (int i=0; i < entryList.tagCount(); i++) {
NBTTagCompound entryCompound=entryList.getCompoundTagAt(i);
AspectItem itemEntry=AspectItem.readFromNBT(entryCom... | Loads all static aspects from an NBT |
public FloatConverter(){
super(true);
}
| Construct a <b>java.lang.Float</b> <i>Converter</i> that throws a <code>ConversionException</code> if an error occurs. |
public String repository(){
return repository;
}
| Returns repository name |
public void initVolumeExtensions(){
volume.setExtensions(new StringMap());
}
| Initialize volume extensions map |
public static Shape createShape(String name,ShapeType shapeType,float arg1,float arg2,float arg3){
Spatial geometry=null;
switch (shapeType) {
case none:
break;
case arrow:
geometry=new Arrow("_arrow",arg1,arg2);
break;
case ball:
geometry=new Sphere("_sphere",(int)arg1,(int)arg1,arg2);
geometry.setTranslation(... | Create an instance of shape containing a geometry specified by type. Arguments are treated according to geometry type. none: No geometry is created. Arguments are ignored. arrow: arg1=length, arg2=width ball: arg1=samples, arg2=radius box: arg1=xExtent, arg2=yExtent, arg3=zExtent cone: arg1=samples, arg2=radius, arg3=h... |
private void shrink(){
long maxSize=this.maxSize;
int maxBlocks=this.maxBlocks;
int cnt=queue.sizex();
for (int i=0; i < cnt && (maxBlocks > 0 && queue.sizex() > maxBlocks || maxSize > 0 && curSize.longValue() > maxSize); i++) {
EvictableEntry<IgfsBlockKey,byte[]> entry=queue.poll();
if (entry == null) ... | Shrinks queue to maximum allowed size. |
public DateTimeFormatterBuilder appendFixedDecimal(DateTimeFieldType fieldType,int numDigits){
if (fieldType == null) {
throw new IllegalArgumentException("Field type must not be null");
}
if (numDigits <= 0) {
throw new IllegalArgumentException("Illegal number of digits: " + numDigits);
}
return appe... | Instructs the printer to emit a field value as a fixed-width decimal number (smaller numbers will be left-padded with zeros), and the parser to expect an unsigned decimal number with the same fixed width. |
private void copyTable(String table) throws DatabaseException {
StringBuffer selectSQL=new StringBuffer();
StringBuffer insertSQL=new StringBuffer();
StringBuffer values=new StringBuffer();
Collection<String> columns=source.listColumns(table);
Logger.getLogger(this.getClass()).debug("Begin copy: " + table);
... | Copy the data from one table to another. To do this both a SELECT and INSERT statement must be created. |
private int readAhead(boolean allowBlocking) throws IOException {
if (state == STATE_DONE) {
return -1;
}
if (chunkPos >= chunkCount) {
chunkCount=0;
chunkPos=0;
}
if (allowBlocking) {
return readAheadBlocking();
}
else {
return readAheadNonBlocking();
}
}
| Read ahead in either blocking or non-blocking mode. This method is typically used when we run out of available bytes in <code>chunkData</code> or we need to determine how many bytes are available on the input stream. |
private void writeAttribute(java.lang.String namespace,java.lang.String attName,java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException {
if (namespace.equals("")) {
xmlWriter.writeAttribute(attName,attValue);
}
else {
registerPrefix(xmlWriter,namesp... | Util method to write an attribute without the ns prefix |
public TableId tableId(){
return tableId;
}
| Get the identifier for the table that owns this column. |
protected JobStateReason(int value){
super(value);
}
| Construct a new job state reason enumeration value with the given integer value. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.