Object 內置對象

對象object

基礎對象,所有對象均繼承於此

繼承關係

#lineWidth: 1.5 #font: Helvetica,sans-Serif #fontSize: 10 #leading: 1.6 #.this: fill=lightgray #.class: fill=white [<this>object|toString();toJSON()] [<class>Buffer] [<class>Cipher] [<class>DbConnection] [<class>MySQL] [<class>Odbc] [<class>SQLite] [<class>Digest] [<class>EventEmitter] [<class>ChildProcess] [<class>DgramSocket] [<class>FSWatcher] [<class>LruCache] [<class>Service] [<class>StatsWatcher] [<class>WebSocket] [<class>WebView] [<class>Worker] [<class>Fiber] [<class>Handler] [<class>Chain] [<class>HttpHandler] [<class>HttpRepeater] [<class>Routing] [<class>SslHandler] [<class>HeapGraphEdge] [<class>HeapGraphNode] [<class>HeapSnapshot] [<class>HttpClient] [<class>HttpCollection] [<class>HttpCookie] [<class>HttpUploadData] [<class>Image] [<class>Iterator] [<class>LevelDB] [<class>Lock] [<class>Condition] [<class>Event] [<class>Semaphore] [<class>Message] [<class>HttpMessage] [<class>HttpRequest] [<class>HttpResponse] [<class>WebSocketMessage] [<class>MongoCollection] [<class>MongoCursor] [<class>MongoDB] [<class>MongoID] [<class>PKey] [<class>Redis] [<class>RedisHash] [<class>RedisList] [<class>RedisSet] [<class>RedisSortedSet] [<class>SandBox] [<class>Smtp] [<class>Stat] [<class>Stream] [<class>BufferedStream] [<class>SeekableStream] [<class>File] [<class>MemoryStream] [<class>RangeStream] [<class>Socket] [<class>SslSocket] [<class>TTYInputStream] [<class>TTYOutputStream] [<class>StringDecoder] [<class>TcpServer] [<class>HttpServer] [<class>HttpsServer] [<class>SslServer] [<class>Timer] [<class>UrlObject] [<class>X509Cert] [<class>X509Crl] [<class>X509Req] [<class>XmlAttr] [<class>XmlNamedNodeMap] [<class>XmlNode] [<class>XmlCharacterData] [<class>XmlComment] [<class>XmlText] [<class>XmlCDATASection] [<class>XmlDocument] [<class>XmlDocumentType] [<class>XmlElement] [<class>XmlProcessingInstruction] [<class>XmlNodeList] [<class>ZipFile] [object] <:- [Buffer] [object] <:- [Cipher] [object] <:- [DbConnection] [DbConnection] <:- [MySQL] [DbConnection] <:- [Odbc] [DbConnection] <:- [SQLite] [object] <:- [Digest] [object] <:- [EventEmitter] [EventEmitter] <:- [ChildProcess] [EventEmitter] <:- [DgramSocket] [EventEmitter] <:- [FSWatcher] [EventEmitter] <:- [LruCache] [EventEmitter] <:- [Service] [EventEmitter] <:- [StatsWatcher] [EventEmitter] <:- [WebSocket] [EventEmitter] <:- [WebView] [EventEmitter] <:- [Worker] [object] <:- [Fiber] [object] <:- [Handler] [Handler] <:- [Chain] [Handler] <:- [HttpHandler] [Handler] <:- [HttpRepeater] [Handler] <:- [Routing] [Handler] <:- [SslHandler] [object] <:- [HeapGraphEdge] [object] <:- [HeapGraphNode] [object] <:- [HeapSnapshot] [object] <:- [HttpClient] [object] <:- [HttpCollection] [object] <:- [HttpCookie] [object] <:- [HttpUploadData] [object] <:- [Image] [object] <:- [Iterator] [object] <:- [LevelDB] [object] <:- [Lock] [Lock] <:- [Condition] [Lock] <:- [Event] [Lock] <:- [Semaphore] [object] <:- [Message] [Message] <:- [HttpMessage] [HttpMessage] <:- [HttpRequest] [HttpMessage] <:- [HttpResponse] [Message] <:- [WebSocketMessage] [object] <:- [MongoCollection] [object] <:- [MongoCursor] [object] <:- [MongoDB] [object] <:- [MongoID] [object] <:- [PKey] [object] <:- [Redis] [object] <:- [RedisHash] [object] <:- [RedisList] [object] <:- [RedisSet] [object] <:- [RedisSortedSet] [object] <:- [SandBox] [object] <:- [Smtp] [object] <:- [Stat] [object] <:- [Stream] [Stream] <:- [BufferedStream] [Stream] <:- [SeekableStream] [SeekableStream] <:- [File] [SeekableStream] <:- [MemoryStream] [SeekableStream] <:- [RangeStream] [Stream] <:- [Socket] [Stream] <:- [SslSocket] [Stream] <:- [TTYInputStream] [Stream] <:- [TTYOutputStream] [object] <:- [StringDecoder] [object] <:- [TcpServer] [TcpServer] <:- [HttpServer] [HttpServer] <:- [HttpsServer] [TcpServer] <:- [SslServer] [object] <:- [Timer] [object] <:- [UrlObject] [object] <:- [X509Cert] [object] <:- [X509Crl] [object] <:- [X509Req] [object] <:- [XmlAttr] [object] <:- [XmlNamedNodeMap] [object] <:- [XmlNode] [XmlNode] <:- [XmlCharacterData] [XmlCharacterData] <:- [XmlComment] [XmlCharacterData] <:- [XmlText] [XmlText] <:- [XmlCDATASection] [XmlNode] <:- [XmlDocument] [XmlNode] <:- [XmlDocumentType] [XmlNode] <:- [XmlElement] [XmlNode] <:- [XmlProcessingInstruction] [object] <:- [XmlNodeList] [object] <:- [ZipFile] object toString() toJSON() Buffer Cipher DbConnection MySQL Odbc SQLite Digest EventEmitter ChildProcess DgramSocket FSWatcher LruCache Service StatsWatcher WebSocket WebView Worker Fiber Handler Chain HttpHandler HttpRepeater Routing SslHandler HeapGraphEdge HeapGraphNode HeapSnapshot HttpClient HttpCollection HttpCookie HttpUploadData Image Iterator LevelDB Lock Condition Event Semaphore Message HttpMessage HttpRequest HttpResponse WebSocketMessage MongoCollection MongoCursor MongoDB MongoID PKey Redis RedisHash RedisList RedisSet RedisSortedSet SandBox Smtp Stat Stream BufferedStream SeekableStream File MemoryStream RangeStream Socket SslSocket TTYInputStream TTYOutputStream StringDecoder TcpServer HttpServer HttpsServer SslServer Timer UrlObject X509Cert X509Crl X509Req XmlAttr XmlNamedNodeMap XmlNode XmlCharacterData XmlComment XmlText XmlCDATASection XmlDocument XmlDocumentType XmlElement XmlProcessingInstruction XmlNodeList ZipFile

成員函數

toString

返回對象的字符串表示,一般返回"[Native Object]",對象可以根據自己的特性重新實現

1
String object.toString();

返回結果:

  • String, 返回對象的字符串表示

toJSON

返回對象的JSON 格式表示,一般返回對象定義的可讀屬性集合

1
Value object.toJSON(String key = "");

調用參數:

  • key: String, 未使用

返回結果:

  • Value, 返回包含可JSON 序列化的值