Creates a <code>DocId</code> based on a document number.

@param docNumber the document number.
@return a <code>DocId</code> based on a document number.
349143
static DocId create(int docNumber) {
        if (docNumber < Short.MAX_VALUE) {
            // use cached values for docNumbers up to 32k
            return LOW_DOC_IDS[docNumber];
        }
        else
        {
            return new PlainDocId(docNumber);
        }
    }
503715
Document convertSelectorToDocument(Document selector) {
        Document document = new Document();
        for (String key : selector.keySet()) {
            if (key.startsWith("$")) {
                continue;
            }

            Object value = selector.get(key);
            if (!Utils.containsQueryExpression(value)) {
                Utils.changeSubdocumentValue(document, key, value, (AtomicReference<Integer>) null);
            }
        }
        return document;
    }
362847
private final static String generateIDMonomerNotation(String id, String count, String annotation) {
		if (id.length() > 1) {
			id = "[" + id + "]";
		}
		String result = id;
		try {
			if (!(Integer.parseInt(count) == 1)) {
				result += "'" + count + "'";
			}
		} catch (NumberFormatException e) {
			result += "'" + count + "'";
		}
		if (annotation != null) {
			result += "\"" + annotation + "\"";
		}
		return result;
	}
957448
@Override
    public AsyncLookupInBuilder lookupIn(String docId) {
        return new AsyncLookupInBuilder(core, bucket, environment, subdocumentTranscoder, docId);
    }
939132
function getDocument(document, docdbClient, nodeContext) {
    var documentUrl = `${collectionUrl}/docs/${document.id}`;
    nodeContext.log(`Getting document:\n${document.id}\n`);

    return new Promise((resolve, reject) => {
        nodeContext.log("trying read");
        docdbClient.readDocument(documentUrl, (err, result) => {
            nodeContext.log("reading");
            if (err) {
                nodeContext.log("error");
                if (err.code == HttpStatusCodes.NOTFOUND) {
                    nodeContext.log("creating");
                    docdbClient.createDocument(collectionUrl, document, (err, created) => {
                        nodeContext.log("try to create");
                        if (err) reject(err)
                        else resolve(created);
                    });
                } else {
                    reject(err);
                }
            } else {
                resolve(result);
            }
        });
    });
}
390872
public static Document create(@NonNull String id, @NonNull String text) {
      return DocumentFactory.getInstance().create(id, text);
   }
712284
public JcNumber asNumber() {
		JcNumber ret = new JcNumber(null, this, null);
		QueryRecorder.recordInvocationConditional(this, "asNumber", ret);
		return ret;
	}
1085235
public function setCompanyTaxDocument($documentNumber)
    {
        $this->initializeCompany();
        $this->data->company->taxDocument = new stdClass();
        $this->data->company->taxDocument->type = self::COMPANY_TAX_DOCUMENT;
        $this->data->company->taxDocument->number = $documentNumber;

        return $this;
    }
1371774
public Integer getNumberOfTokens(String field, int docId) {
    if (fieldReferences.containsKey(field)) {
      IndexDoc doc = getDoc(field, docId);
      if (doc != null) {
        return doc.size;
      }
    }
    return null;
  }
105941
private boolean goToNextDoc() throws IOException {
    if (docId == NO_MORE_DOCS) {
      return true;
    } else {
      int spans1DocId = spans1.spans.nextDoc();
      int spans2DocId = spans2.spans.docID();
      docId = Math.max(spans1DocId, spans2DocId);
      while (spans1DocId != spans2DocId && docId != NO_MORE_DOCS) {
        if (spans1DocId < spans2DocId) {
          spans1DocId = spans1.spans.advance(spans2DocId);
          docId = spans1DocId;
        } else {
          spans2DocId = spans2.spans.advance(spans1DocId);
          docId = spans2DocId;
        }
      }
      if (docId != NO_MORE_DOCS && !goToNextStartPosition()) {
        reset();
        return false;
      } else {
        return true;
      }
    }
  }
7433
@NotNull
    public static DocumentBuilder createDocumentBuilder() {
        try {
            final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
            factory.setNamespaceAware(true);
            return factory.newDocumentBuilder();
        } catch (final ParserConfigurationException ex) {
            throw new RuntimeException("Couldn't create document builder", ex);
        }
    }
996756
public OvhDocument document_documentId_GET(String documentId) throws IOException {
		String qPath = "/store/document/{documentId}";
		StringBuilder sb = path(qPath, documentId);
		String resp = exec(qPath, "GET", sb.toString(), null);
		return convertTo(resp, OvhDocument.class);
	}
962826
public int createIndex(String tokenForm) {
		int[] index = (int[]) tokenForm2index.get(tokenForm);
		if (index == null) {
			index = new int[] { nextAttributeID };
			tokenForm2index.put(tokenForm, index);
			nextAttributeID++;
		}
		// add information about number of documents
		// for the term
		Integer integ = Integer.valueOf(index[0]);
		int[] docfreq = (int[]) this.index2docfreq.get(integ);
		if (docfreq == null) {
			docfreq = new int[] { 0 };
			index2docfreq.put(integ, docfreq);
		}
		docfreq[0]++;
		return index[0];
	}
1004526
public static Document createDomDocument() throws Exception
	{
	    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
	    factory.setNamespaceAware(true);
	    DocumentBuilder builder = factory.newDocumentBuilder();

	    return builder.newDocument();
	}
1053441
public JsonDocument insert(String documentId, String json) {
        return this.bucket.insert(JsonDocument.create(documentId, JsonObject.fromJson(json)));
    }
663981
@NonNull
    public ListenerToken addDocumentChangeListener(
        @NonNull String id,
        Executor executor,
        @NonNull DocumentChangeListener listener) {
        if (id == null) { throw new IllegalArgumentException("id cannot be null."); }
        if (listener == null) { throw new IllegalArgumentException("listener cannot be null."); }

        synchronized (lock) {
            mustBeOpen();
            return addDocumentChangeListener(executor, listener, id);
        }
    }
207476
public static ClassFileVersion ofMinorMajor(int versionNumber) {
        ClassFileVersion classFileVersion = new ClassFileVersion(versionNumber);
        if (classFileVersion.getMajorVersion() <= BASE_VERSION) {
            throw new IllegalArgumentException("Class version " + versionNumber + " is not valid");
        }
        return classFileVersion;
    }